|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--gov.noaa.pmel.sgt.SGLabel
Draws text on a layer object. SGLabel uses the drawString() method of the Graphics class. SGLabel allows the user to align the text both vertically (TOP, MIDDLE, and BOTTOM) and horizontally (LEFT, MIDDLE, and RIGHT). The font, color, and height (in user coordinates) can also be specified. The SGLabel can also be drawn either HORIZONTAL or VERTICAL.
Graphics,
Serialized Form| Field Summary | |
static int |
ANGLE
Orient label at an angle |
static int |
BOTTOM
Align bottom of label |
static int |
CENTER
Align center of label |
static int |
HORIZONTAL
Orient label horizontal |
static int |
LEFT
Align left of label |
static int |
MIDDLE
Align middle of label |
static int |
RIGHT
Align right of label |
static int |
TOP
Align top of label |
static int |
VERTICAL
Orient label vertical |
| Constructor Summary | |
SGLabel(java.lang.String id,
java.lang.String lbl,
double hgt,
Point2D.Double loc,
int valign,
int halign)
Long SGLabel constructor. |
|
SGLabel(java.lang.String id,
java.lang.String lbl,
Point2D.Double loc)
Quick SGLabel constructor. |
|
| Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a new PropertyChangeListener. |
LayerChild |
copy()
Create a copy of the LayerChild. |
void |
draw(java.awt.Graphics g)
Draw the LayerChild. |
boolean |
equals(java.lang.Object obj)
|
double |
getAngle()
Get label drawing angle. |
java.awt.Rectangle |
getBounds()
Get the label bounds in device units. |
Rectangle2D.Double |
getBoundsP()
Get the label bounds in physical units. |
java.awt.Color |
getColor()
Get the color. |
java.awt.Font |
getFont()
Get the font. |
int |
getHAlign()
Get the horizontal alignment. |
int |
getHeight()
Get the label height in device coordinates. |
double |
getHeightP()
Get the label height in physical coordinates. |
java.lang.String |
getId()
Get the label identifier. |
Layer |
getLayer()
Get the layer. |
java.awt.Point |
getLocation()
Get the label position in device coordinates. |
Point2D.Double |
getLocationP()
Get the label reference location in physcial coordinates. |
int |
getOrientation()
Get the origentation. |
AbstractPane |
getPane()
Get AbstractPane of the LayerChild. |
float |
getStringHeight(java.awt.Graphics g)
Get the string height in device units. |
float |
getStringWidth(java.awt.Graphics g)
Get the string width in device units. |
java.lang.String |
getText()
Get the label text. |
int |
getVAlign()
Get the vertical alignment. |
boolean |
isMoveable()
Returns true if the current state is moveable |
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 text)
Used by sgt internally. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a listener. |
void |
setAlign(int vert,
int horz)
Set the vertical and horizontal alignment. |
void |
setAngle(double angle)
Draw label at arbitrary rotation. |
void |
setBounds(int x,
int y,
int width,
int height)
Set the label bounds in device units. |
void |
setBounds(java.awt.Rectangle r)
Set the label bounds in device units. |
void |
setColor(java.awt.Color color)
Set the color. |
void |
setFont(java.awt.Font fnt)
Set the font. |
void |
setHAlign(int horz)
Set the horizontal alignment. |
void |
setHeightP(double hgt)
Set the height of the label in physical coordinates. |
void |
setId(java.lang.String id)
Set the label identifier. |
void |
setLayer(Layer l)
Associate a Layer with the LayerChild. |
void |
setLocation(java.awt.Point loc)
Set the label reference location in pixel coordinates. |
void |
setLocationP(Point2D.Double loc)
Set the label reference location in physcial coordinates. |
void |
setMoveable(boolean moveable)
Set the moveable property. |
void |
setOrientation(int orient)
Set the orientation. |
void |
setSelectable(boolean select)
Set the Selectable property. |
void |
setSelected(boolean sel)
Sets the selected property. |
void |
setText(java.lang.String lbl)
Set the label text. |
void |
setVAlign(int vert)
Set the vertical alignment. |
void |
setVisible(boolean visible)
Set visibility for a LayerChild. |
java.lang.String |
toString()
Return a string that represents the LayerChild. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int TOP
public static final int MIDDLE
public static final int BOTTOM
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int HORIZONTAL
public static final int VERTICAL
public static final int ANGLE
| Constructor Detail |
public SGLabel(java.lang.String id,
java.lang.String lbl,
Point2D.Double loc)
id - Label identifierlbl - String to be plotted.
public SGLabel(java.lang.String id,
java.lang.String lbl,
double hgt,
Point2D.Double loc,
int valign,
int halign)
id - Label identifierlbl - String to be plottedhgt - String height in physical unitsloc - Location to plot label in physical unitsvalign - Vertical alignmenthalign - Horizontal alignment| Method Detail |
public LayerChild copy()
LayerChildLayerChild.
copy in interface LayerChildLayerChild.public boolean equals(java.lang.Object obj)
equals in class java.lang.Object
public void draw(java.awt.Graphics g)
throws LayerNotFoundException
LayerChildLayerChild.
draw in interface LayerChildg - Graphics context
LayerNotFoundException - No layer is associated with the LayerChild.public void setSelected(boolean sel)
Selectable
setSelected in interface Selectablesel - true if selected, false if not.public boolean isSelected()
Selectable
isSelected in interface Selectablepublic void setSelectable(boolean select)
Selectable
setSelectable in interface Selectableselect - if true object is selectablepublic boolean isSelectable()
Selectable
isSelectable in interface Selectablepublic void setColor(java.awt.Color color)
color - The color of the label.Colorpublic java.awt.Color getColor()
public void setFont(java.awt.Font fnt)
fnt - The Font to use to draw the label.Fontpublic java.awt.Font getFont()
public void setHeightP(double hgt)
hgt - The label height.public double getHeightP()
public void setAlign(int vert,
int horz)
vert - The vertical alignment.horz - The horizontal alignment.public void setHAlign(int horz)
horz - The horizontal alignment.public int getHAlign()
public void setVAlign(int vert)
vert - The vertical alignment.public int getVAlign()
public void setLocationP(Point2D.Double loc)
location.
loc - physical location of labelpublic Point2D.Double getLocationP()
public void setOrientation(int orient)
orient - The orientation.public int getOrientation()
public void setAngle(double angle)
public double getAngle()
public void setLayer(Layer l)
LayerChildLayer with the LayerChild.
setLayer in interface LayerChildl - Parent layer.public Layer getLayer()
getLayer in interface LayerChildpublic AbstractPane getPane()
LayerChildAbstractPane of the LayerChild.
getPane in interface LayerChildpublic void modified(java.lang.String text)
LayerChild
modified in interface LayerChildpublic java.lang.String getText()
public void setText(java.lang.String lbl)
lbl - the label textpublic java.lang.String getId()
getId in interface LayerChildpublic void setId(java.lang.String id)
setId in interface LayerChildid - the label identifierpublic int getHeight()
public java.awt.Point getLocation()
getLocation in interface Moveablepublic void setLocation(java.awt.Point loc)
location.
setLocation in interface Moveableloc - physical location of labelpublic Rectangle2D.Double getBoundsP()
public java.awt.Rectangle getBounds()
getBounds in interface Selectablepublic void setBounds(java.awt.Rectangle r)
public void setBounds(int x,
int y,
int width,
int height)
public java.lang.String toString()
LayerChildLayerChild.
toString in interface LayerChildtoString in class java.lang.ObjectLayerChild representation.public boolean isVisible()
LayerChildLayerChild is visible.
isVisible in interface LayerChildpublic void setVisible(boolean visible)
LayerChildLayerChild.
setVisible in interface LayerChildvisible - visible if truepublic boolean isMoveable()
Moveable
isMoveable in interface Moveablepublic void setMoveable(boolean moveable)
Moveable
setMoveable in interface Moveablepublic float getStringWidth(java.awt.Graphics g)
public float getStringHeight(java.awt.Graphics g)
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Moveable
addPropertyChangeListener in interface Moveablepublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Moveable
removePropertyChangeListener in interface Moveable
|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||