gov.noaa.pmel.sgt.beans
Class Label

java.lang.Object
  extended by gov.noaa.pmel.sgt.beans.Label
All Implemented Interfaces:
java.io.Serializable

public class Label
extends java.lang.Object
implements java.io.Serializable

Encapsulates SGLabel properties.

Since:
3.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
Serialized Form

Constructor Summary
Label()
          Default constructor.
Label(java.lang.String id, Point2D.Double loc, double wid, double hgt)
          Label constructor.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
           
protected  void fireStateChanged()
           
 Rectangle2D.Double getBoundsP()
          Get Label bounds.
 java.awt.Color getColor()
          Get label color.
 java.awt.Font getFont()
          Get label font.
 double getHeightP()
          Get Label height.
 java.lang.String getId()
          Get Label identifier.
 int getJustification()
          Get label justification.
 Point2D.Double getLocationP()
          Get Label location
 int getOrientation()
          Get label orientation.
 PanelHolder getPanelHolder()
          Get panel holder.
 java.lang.String getText()
          Get label text.
 double getWidthP()
          Get label width.
 boolean isInstantiated()
          Is SGLabel instatiated?
 boolean isSelectable()
          Is label selectable?
 boolean isVisible()
          Is Label visible?
 void removeAllChangeListeners()
          Remove all change listeners.
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Remove change listener.
 void removeDesignChangeListeners()
          Remove change listeners that implement DesignListener.
 void setBoundsP(Rectangle2D.Double bounds)
          Set Label bounds.
 void setColor(java.awt.Color color)
          Set label color.
 void setFont(java.awt.Font font)
          Set label font.
 void setHeightP(double heightP)
          Set Label height.
 void setId(java.lang.String id)
          Set label identifier.
 void setInstantiated(boolean instantiated)
          Set instantiation for label.
 void setJustification(int justification)
          Set label justification.
 void setLocationP(Point2D.Double locationP)
          Set Label location.
 void setOrientation(int orientation)
          Set label orientation.
 void setPanelHolder(PanelHolder pHolder)
          Set panelholder.
 void setSelectable(boolean selectable)
          Set label selectable.
 void setText(java.lang.String text)
          Set label text.
 void setVisible(boolean visible)
          Set label visiblity.
 void setWidthP(double widthP)
          Set label width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Label

public Label()
Default constructor. Width and height are set to 0.0, name and location are null.


Label

public Label(java.lang.String id,
             Point2D.Double loc,
             double wid,
             double hgt)
Label constructor.

Parameters:
id - label identifier
loc - location in physical coordinates
wid - width in physical coordinates
hgt - height in physical coorindates.
Method Detail

getId

public java.lang.String getId()
Get Label identifier.

Returns:
identification

setId

public void setId(java.lang.String id)
Set label identifier.

Parameters:
id - identifier

setBoundsP

public void setBoundsP(Rectangle2D.Double bounds)
Set Label bounds.

Parameters:
bounds - bounds in physical coordinates.

getBoundsP

public Rectangle2D.Double getBoundsP()
Get Label bounds.

Returns:
bounds

setLocationP

public void setLocationP(Point2D.Double locationP)
Set Label location. Updates x and y in bounds.

Parameters:
locationP - location in physical coordinates.

getLocationP

public Point2D.Double getLocationP()
Get Label location

Returns:
location in physical coordinates

setHeightP

public void setHeightP(double heightP)
Set Label height. Updates height in bounds.

Parameters:
heightP - height in physical coordinates

getHeightP

public double getHeightP()
Get Label height.

Returns:
height

setWidthP

public void setWidthP(double widthP)
Set label width. Updates width in bounds.

Parameters:
widthP - width in physcial coordinates

getWidthP

public double getWidthP()
Get label width.

Returns:
width

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Remove change listener.

Parameters:
l - change listener.

removeAllChangeListeners

public void removeAllChangeListeners()
Remove all change listeners.


addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)

removeDesignChangeListeners

public void removeDesignChangeListeners()
Remove change listeners that implement DesignListener.


fireStateChanged

protected void fireStateChanged()

setText

public void setText(java.lang.String text)
Set label text.

Parameters:
text - label text

getText

public java.lang.String getText()
Get label text.

Returns:
text

setVisible

public void setVisible(boolean visible)
Set label visiblity. Visible if true. Default = true.

Parameters:
visible - label visiblity

isVisible

public boolean isVisible()
Is Label visible?

Returns:
true, if label is visible

setInstantiated

public void setInstantiated(boolean instantiated)
Set instantiation for label. Used internally. Set when SGLabel is instantiated from Label.

Parameters:
instantiated - SGLabel instantiated

isInstantiated

public boolean isInstantiated()
Is SGLabel instatiated?

Returns:
true, if SGLabel is instantiated

setPanelHolder

public void setPanelHolder(PanelHolder pHolder)
Set panelholder.

Parameters:
pHolder - panel holder

getPanelHolder

public PanelHolder getPanelHolder()
Get panel holder.

Returns:
panel holder

getJustification

public int getJustification()
Get label justification.

Returns:
justification.

setJustification

public void setJustification(int justification)
Set label justification. Justification can be SGLabel.LEFT, SGLabel.RIGHT, or SGLabel.CENTER. Default = SGLabel.LEFT.

Parameters:
justification - label justification
See Also:
SGLabel

getColor

public java.awt.Color getColor()
Get label color.

Returns:
color

getFont

public java.awt.Font getFont()
Get label font.

Returns:
font

setColor

public void setColor(java.awt.Color color)
Set label color. Default = Color.black.

Parameters:
color - label color

setFont

public void setFont(java.awt.Font font)
Set label font. Default = Helvectia, PLAIN

Parameters:
font - label font

getOrientation

public int getOrientation()
Get label orientation.

Returns:
orientation

setOrientation

public void setOrientation(int orientation)
Set label orientation. Legal values are SGLabel.HORIZONTAL and SGLabel.VERTICAL. Default = SGLabel.HORIZONTAL.

Parameters:
orientation - label orientation
See Also:
SGLabel

isSelectable

public boolean isSelectable()
Is label selectable?

Returns:
true if label is selectable

setSelectable

public void setSelectable(boolean selectable)
Set label selectable.

Parameters:
selectable - true if label is selectable