|
SGT Home | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.ImageIcon | +--gov.noaa.pmel.sgt.swing.ValueIcon
ValueIcon
extends ImageIcon
to create a
icon than can be dragged on a sgt
plot displaying the
local coordinates along with the image. Typically a cross-hairs
image is used, but others can be substituted.
UserIcon
,
ValueIconFormat
, Serialized FormConstructor Summary | |
ValueIcon(java.awt.Image image,
java.lang.String description)
Construct a ValueIcon using an Image . |
|
ValueIcon(java.lang.String filename,
java.lang.String description)
Construct a ValueIcon using an image from a
specified file. |
|
ValueIcon(java.net.URL location,
java.lang.String description)
Construct a ValueIcon using an image from a
specified URL . |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener l)
|
LayerChild |
copy()
Create a copy of the LayerChild . |
void |
draw(java.awt.Graphics g)
Draw the LayerChild . |
java.awt.Rectangle |
getBounds()
Gets the bounding rectangle in device coordinates. |
java.awt.Font |
getFont()
Get the value label font |
int |
getIconHeight()
Get the total heigth. |
int |
getIconWidth()
Get the total width, icon + label. |
java.lang.String |
getId()
Get the identifier. |
Layer |
getLayer()
Get the associated Layer . |
Point2D.Double |
getLocationP()
Get the icon location in physical units. |
Point2D.Double |
getLocationU()
Get the icon location in user units. |
AbstractPane |
getPane()
Get AbstractPane of the LayerChild . |
boolean |
isSelectable()
Returns true if the current state is selectable. |
boolean |
isSelected()
Returns true if the object's selected property is set. |
boolean |
isVisible()
Check if LayerChild is visible. |
void |
modified(java.lang.String mess)
Used by sgt internally. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paint the icon at the specified location. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener l)
|
void |
setBounds(int x,
int y,
int width,
int height)
Set icon bounds. |
void |
setBounds(java.awt.Rectangle bounds)
Set icon bounds. |
void |
setFont(java.awt.Font font)
Set the font for the value label. |
void |
setId(java.lang.String id)
Set the identifier. |
void |
setLayer(Layer l)
Associate a Layer with the LayerChild . |
void |
setLocation(java.awt.Point loc)
Set icon location in device units |
void |
setLocationNoVeto(int x,
int y)
Set icon location in device coordinates. |
void |
setLocationP(Point2D.Double loc)
Set the icon location in physical units. |
void |
setLocationU(Point2D.Double loc)
Set the icon location in user units. |
void |
setLocationUNoVeto(Point2D.Double loc)
Set the icon location in user units. |
void |
setSelectable(boolean select)
Set the Selectable property. |
void |
setSelected(boolean sel)
Sets the selected property. |
void |
setValueFormat(ValueIconFormat vf)
Set format to be used to create the value string. |
void |
setVisible(boolean vis)
Set visibility for a LayerChild . |
java.lang.String |
toString()
Return a string that represents the LayerChild . |
Methods inherited from class javax.swing.ImageIcon |
getAccessibleContext, getDescription, getImage, getImageLoadStatus, getImageObserver, setDescription, setImage, setImageObserver |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ValueIcon(java.lang.String filename, java.lang.String description)
ValueIcon
using an image from a
specified file.filename
- name of image filedescription
- brief textual description of the imagepublic ValueIcon(java.net.URL location, java.lang.String description)
ValueIcon
using an image from a
specified URL
.location
- URL of image filedescription
- brief textual description of the imagepublic ValueIcon(java.awt.Image image, java.lang.String description)
ValueIcon
using an Image
.image
- the imagedescription
- brief textual description of the imageMethod Detail |
public void setValueFormat(ValueIconFormat vf)
new ValueIconFormat("#####.##", "#")
.the
- value formatpublic void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in class javax.swing.ImageIcon
javax.swing.ImageIcon
c
- the component to be used as the observer
if this icon has no image observerg
- the graphics contextx
- the X coordinate of the icon's top-left cornery
- the Y coordinate of the icon's top-left cornerpublic void setFont(java.awt.Font font)
font
- the fontpublic java.awt.Font getFont()
public int getIconWidth()
getIconWidth
in class javax.swing.ImageIcon
javax.swing.ImageIcon
public int getIconHeight()
getIconHeight
in class javax.swing.ImageIcon
javax.swing.ImageIcon
public LayerChild copy()
LayerChild
LayerChild
.copy
in interface LayerChild
gov.noaa.pmel.sgt.LayerChild
LayerChild
.public void setVisible(boolean vis)
LayerChild
LayerChild
.setVisible
in interface LayerChild
gov.noaa.pmel.sgt.LayerChild
visible
- visible if truepublic boolean isVisible()
LayerChild
LayerChild
is visible.isVisible
in interface LayerChild
gov.noaa.pmel.sgt.LayerChild
public void draw(java.awt.Graphics g)
LayerChild
LayerChild
.draw
in interface LayerChild
gov.noaa.pmel.sgt.LayerChild
g
- Graphics contextLayerNotFoundException
- No layer is associated with the LayerChild
.public java.lang.String getId()
LayerChild
getId
in interface LayerChild
gov.noaa.pmel.sgt.LayerChild
LayerChild
identification.public Layer getLayer()
LayerChild
Layer
.getLayer
in interface LayerChild
gov.noaa.pmel.sgt.LayerChild
public AbstractPane getPane()
LayerChild
AbstractPane
of the LayerChild
.getPane
in interface LayerChild
public void modified(java.lang.String mess)
LayerChild
modified
in interface LayerChild
public void setId(java.lang.String id)
LayerChild
setId
in interface LayerChild
gov.noaa.pmel.sgt.LayerChild
id
- LayerChild
identification.public void setLayer(Layer l)
LayerChild
Layer
with the LayerChild
.setLayer
in interface LayerChild
gov.noaa.pmel.sgt.LayerChild
l
- Parent layer.public java.lang.String toString()
LayerChild
LayerChild
.toString
in interface LayerChild
toString
in class javax.swing.ImageIcon
gov.noaa.pmel.sgt.LayerChild
LayerChild
representation.public java.awt.Rectangle getBounds()
Selectable
getBounds
in interface Selectable
gov.noaa.pmel.sgt.Selectable
public boolean isSelected()
Selectable
isSelected
in interface Selectable
gov.noaa.pmel.sgt.Selectable
public void setSelected(boolean sel)
Selectable
setSelected
in interface Selectable
gov.noaa.pmel.sgt.Selectable
sel
- true if selected, false if not.public boolean isSelectable()
Selectable
isSelectable
in interface Selectable
gov.noaa.pmel.sgt.Selectable
public void setSelectable(boolean select)
Selectable
setSelectable
in interface Selectable
gov.noaa.pmel.sgt.Selectable
select
- if true object is selectablepublic Point2D.Double getLocationP()
public void setLocationP(Point2D.Double loc)
location
.public Point2D.Double getLocationU()
public void setLocationUNoVeto(Point2D.Double loc)
public void setLocationU(Point2D.Double loc) throws java.beans.PropertyVetoException
location
.public void setLocationNoVeto(int x, int y)
setLocationNoVeto
in interface Draggable
public void setLocation(java.awt.Point loc)
setLocation
in interface Draggable
public void setBounds(int x, int y, int width, int height)
location
.public void setBounds(java.awt.Rectangle bounds)
public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
|
SGT Home | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |