|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.ImageIcon
gov.noaa.pmel.sgt.swing.UserIcon
public class UserIcon
UserIcon
extends ImageIcon
to create a
icon than can be dragged on a sgt
plot displaying a
user defined text string along with the image.
ValueIcon
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.ImageIcon |
---|
javax.swing.ImageIcon.AccessibleImageIcon |
Field Summary | |
---|---|
protected java.awt.Rectangle |
bounds_
|
protected java.beans.PropertyChangeSupport |
changes_
|
protected Layer |
layer_
|
protected Point2D.Double |
loc_
|
protected boolean |
moved_
|
protected SoTPoint |
uLoc_
|
protected java.beans.VetoableChangeSupport |
vetos_
|
Fields inherited from class javax.swing.ImageIcon |
---|
component, tracker |
Constructor Summary | |
---|---|
UserIcon(java.awt.Image image,
java.lang.String description)
Construct a UserIcon using an Image . |
|
UserIcon(java.lang.String filename,
java.lang.String description)
Construct a UserIcon using an image from a
specified file. |
|
UserIcon(java.net.URL location,
java.lang.String description)
Construct a UserIcon 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. |
SoTPoint |
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. |
protected void |
setBounds(int x,
int y,
int width,
int height,
boolean fireEvent)
|
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 |
setLocation(java.awt.Point loc,
boolean fireEvent)
Set icon location in device units and optionally fire a PropertyChangeEvent . |
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(SoTPoint loc)
Set the icon location in user units. |
void |
setLocationUNoVeto(SoTPoint 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 |
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, loadImage, setDescription, setImage, setImageObserver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean moved_
protected Layer layer_
protected java.awt.Rectangle bounds_
protected Point2D.Double loc_
protected SoTPoint uLoc_
protected java.beans.PropertyChangeSupport changes_
protected java.beans.VetoableChangeSupport vetos_
Constructor Detail |
---|
public UserIcon(java.lang.String filename, java.lang.String description)
UserIcon
using an image from a
specified file.
filename
- name of image filedescription
- brief textual description of the imagepublic UserIcon(java.net.URL location, java.lang.String description)
UserIcon
using an image from a
specified URL
.
location
- URL of image filedescription
- brief textual description of the imagepublic UserIcon(java.awt.Image image, java.lang.String description)
UserIcon
using an Image
.
image
- the imagedescription
- brief textual description of the imageMethod Detail |
---|
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
paintIcon
in class javax.swing.ImageIcon
public void setFont(java.awt.Font font)
font
- the fontpublic java.awt.Font getFont()
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
getIconWidth
in class javax.swing.ImageIcon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
getIconHeight
in class javax.swing.ImageIcon
public LayerChild copy()
LayerChild
LayerChild
.
copy
in interface LayerChild
LayerChild
.public void setVisible(boolean vis)
LayerChild
LayerChild
.
setVisible
in interface LayerChild
vis
- visible if truepublic boolean isVisible()
LayerChild
LayerChild
is visible.
isVisible
in interface LayerChild
public void draw(java.awt.Graphics g)
LayerChild
LayerChild
.
draw
in interface LayerChild
g
- Graphics contextpublic java.lang.String getId()
LayerChild
getId
in interface LayerChild
LayerChild
identification.public Layer getLayer()
LayerChild
Layer
.
getLayer
in interface 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
id
- LayerChild
identification.public void setLayer(Layer l)
LayerChild
Layer
with the LayerChild
.
setLayer
in interface LayerChild
l
- Parent layer.public java.lang.String toString()
LayerChild
LayerChild
.
toString
in interface LayerChild
toString
in class javax.swing.ImageIcon
LayerChild
representation.public java.awt.Rectangle getBounds()
Selectable
getBounds
in interface Selectable
public boolean isSelected()
Selectable
isSelected
in interface Selectable
public void setSelected(boolean sel)
Selectable
setSelected
in interface Selectable
sel
- true if selected, false if not.public boolean isSelectable()
Selectable
isSelectable
in interface Selectable
public void setSelectable(boolean select)
Selectable
setSelectable
in interface Selectable
select
- if true object is selectablepublic Point2D.Double getLocationP()
public void setLocationP(Point2D.Double loc)
location
.
public SoTPoint getLocationU()
public void setLocationUNoVeto(SoTPoint loc)
public void setLocationU(SoTPoint loc) throws java.beans.PropertyVetoException
location
.
java.beans.PropertyVetoException
public void setLocationNoVeto(int x, int y)
setLocationNoVeto
in interface Draggable
public void setLocation(java.awt.Point loc)
setLocation
in interface Draggable
public void setLocation(java.awt.Point loc, boolean fireEvent)
PropertyChangeEvent
.
setLocation
in interface Draggable
public void setBounds(int x, int y, int width, int height)
location
.
protected void setBounds(int x, int y, int width, int height, boolean fireEvent)
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |