gov.noaa.pmel.sgt
Class VectorKey

java.lang.Object
  |
  +--gov.noaa.pmel.sgt.VectorKey
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, LayerChild, Moveable, java.beans.PropertyChangeListener, Selectable

public class VectorKey
extends java.lang.Object
implements java.lang.Cloneable, LayerChild, Moveable, java.beans.PropertyChangeListener

VectorKey is used to create a key for the VectorCartesianRenderer. Multiple lines can be included in the key.

Since:
2.1
Version:
$Revision: 1.13 $, $Date: 2001/12/13 19:07:05 $
Author:
Donald Denbo

Field Summary
static int BOTTOM
          Align to bottom of key.
static int CENTER
          Align to center of key.
static int LEFT
          Align to left of key.
static int MIDDLE
          Align to middle of key.
static int NO_BORDER
          Do not draw a border.
static int PLAIN_LINE
          Use plain line border.
static int RAISED
          Use raised border.
static int RIGHT
          Align to right of key.
static int TOP
          Align to top of key.
 
Constructor Summary
VectorKey()
          Default constructor.
VectorKey(Point2D.Double loc, int valign, int halign)
          Create VectorKey.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a new PropertyChangeListener.
 void addVectorGraph(VectorCartesianRenderer vector, SGLabel label)
          Add a VectorCartesianRenderer and label to the VectorKey.
 void clear(java.lang.String data_id)
          Remove data from key by id.
 void clearAll()
          Remove all lines from the VectorKey.
 LayerChild copy()
          Create of copy of VectorKey.
 void draw(java.awt.Graphics g)
          Draw the Key.
 int getBorderStyle()
          Get border style.
 java.awt.Rectangle getBounds()
          Get the bounding rectangle.
 Rectangle2D.Double getBoundsP()
           
 int getColumns()
          Get the number of columns.
 int getHAlign()
          Get horizontal alignment
 java.lang.String getId()
          Get VectorKey identifier
 Layer getLayer()
          Get layer.
 java.awt.Point getLocation()
          Gets the location in device coordinates.
 Point2D.Double getLocationP()
          Get location of key.
 AbstractPane getPane()
          Get AbstractPane of the LayerChild.
 int getRowHeight()
          Return height of key row in pixels.
 int getVAlign()
          Get vertical alignment
 double getVectorLengthP()
          Get line length
 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 mess)
          Used by sgt internally.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          This method gets called when a bound property is changed.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove a listener.
 void removeVectorGraph(SGLabel label)
          Remove a line from the VectorKey.
 void removeVectorGraph(java.lang.String ident)
          Remove a line from the VectorKey.
 void removeVectorRenderer(VectorCartesianRenderer line)
          Remove a line from the VectorKey.
 void setAlign(int vert, int horz)
          Set alignment.
 void setBorderStyle(int style)
          Set border style.
 void setBounds(int x, int y, int width, int height)
          Set the bounds, in pixels, of the VectorKey
Property Change: location.
 void setBounds(java.awt.Rectangle r)
          Set the bounds, in pixels, of the VectorKey
 void setBoundsP(Rectangle2D.Double r)
          Set the bounds, in physical units, of the VectorKey
 void setColumns(int col)
          Set the number of columns.
 void setHAlign(int horz)
          Set horizontal alignment
 void setId(java.lang.String id)
          Set VectorKey identifier.
 void setLayer(Layer l)
          Set parent layer.
 void setLocation(java.awt.Point loc)
          Sets the location in device coordinates.
 void setLocationP(Point2D.Double loc)
          Set location of key
Property Change: location.
 void setMoveable(boolean moveable)
          Set the moveable property.
 void setSelectable(boolean select)
          Set the Selectable property.
 void setSelected(boolean sel)
          Sets the selected property.
 void setVAlign(int vert)
          Set vertical alignment
 void setVectorLengthP(double len)
          Set line length.
 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAIN_LINE

public static final int PLAIN_LINE
Use plain line border.

RAISED

public static final int RAISED
Use raised border.

NO_BORDER

public static final int NO_BORDER
Do not draw a border.

TOP

public static final int TOP
Align to top of key.

MIDDLE

public static final int MIDDLE
Align to middle of key.

BOTTOM

public static final int BOTTOM
Align to bottom of key.

LEFT

public static final int LEFT
Align to left of key.

CENTER

public static final int CENTER
Align to center of key.

RIGHT

public static final int RIGHT
Align to right of key.
Constructor Detail

VectorKey

public VectorKey()
Default constructor.

VectorKey

public VectorKey(Point2D.Double loc,
                 int valign,
                 int halign)
Create VectorKey.
Method Detail

copy

public LayerChild copy()
Create of copy of VectorKey.
Specified by:
copy in interface LayerChild
Following copied from interface: gov.noaa.pmel.sgt.LayerChild
Returns:
A copy of the LayerChild.

setSelected

public void setSelected(boolean sel)
Description copied from interface: Selectable
Sets the selected property.
Specified by:
setSelected in interface Selectable
Following copied from interface: gov.noaa.pmel.sgt.Selectable
Parameters:
sel - true if selected, false if not.

isSelected

public boolean isSelected()
Description copied from interface: Selectable
Returns true if the object's selected property is set.
Specified by:
isSelected in interface Selectable
Following copied from interface: gov.noaa.pmel.sgt.Selectable
Returns:
true if selected, false if not.

setSelectable

public void setSelectable(boolean select)
Description copied from interface: Selectable
Set the Selectable property.
Specified by:
setSelectable in interface Selectable
Following copied from interface: gov.noaa.pmel.sgt.Selectable
Parameters:
select - if true object is selectable

isSelectable

public boolean isSelectable()
Description copied from interface: Selectable
Returns true if the current state is selectable.
Specified by:
isSelectable in interface Selectable
Following copied from interface: gov.noaa.pmel.sgt.Selectable
Returns:
true if selectable

isMoveable

public boolean isMoveable()
Description copied from interface: Moveable
Returns true if the current state is moveable
Specified by:
isMoveable in interface Moveable
Following copied from interface: gov.noaa.pmel.sgt.Moveable
Returns:
true if moveable

setMoveable

public void setMoveable(boolean moveable)
Description copied from interface: Moveable
Set the moveable property.
Specified by:
setMoveable in interface Moveable
Following copied from interface: gov.noaa.pmel.sgt.Moveable
Parameters:
select - if true object is moveable

setLayer

public void setLayer(Layer l)
Set parent layer.
Specified by:
setLayer in interface LayerChild
Parameters:
l - parent layer

getLayer

public Layer getLayer()
Get layer.
Specified by:
getLayer in interface LayerChild
Returns:
layer

getPane

public AbstractPane getPane()
Description copied from interface: LayerChild
Get AbstractPane of the LayerChild.
Specified by:
getPane in interface LayerChild

modified

public void modified(java.lang.String mess)
Description copied from interface: LayerChild
Used by sgt internally.
Specified by:
modified in interface LayerChild

setId

public void setId(java.lang.String id)
Set VectorKey identifier.
Specified by:
setId in interface LayerChild
Parameters:
id - key identifier

getId

public java.lang.String getId()
Get VectorKey identifier
Specified by:
getId in interface LayerChild
Returns:
identifier

setVectorLengthP

public void setVectorLengthP(double len)
Set line length.
Parameters:
len - line length

getVectorLengthP

public double getVectorLengthP()
Get line length
Returns:
line length

setColumns

public void setColumns(int col)
Set the number of columns.
Parameters:
col - number of columns

getColumns

public int getColumns()
Get the number of columns.
Returns:
number of columns

setBorderStyle

public void setBorderStyle(int style)
Set border style.
Parameters:
style - border style
See Also:
PLAIN_LINE, RAISED, NO_BORDER

getBorderStyle

public int getBorderStyle()
Get border style.
Returns:
border style

setAlign

public void setAlign(int vert,
                     int horz)
Set alignment.
Parameters:
vert - vertical alignment
horz - horizontal alignment

setVAlign

public void setVAlign(int vert)
Set vertical alignment
Parameters:
vert - vertical alignment

setHAlign

public void setHAlign(int horz)
Set horizontal alignment
Parameters:
horz - horizontal alignment

getVAlign

public int getVAlign()
Get vertical alignment
Returns:
vertical alignment

getHAlign

public int getHAlign()
Get horizontal alignment
Returns:
horizontal alignment

setLocationP

public void setLocationP(Point2D.Double loc)
Set location of key
Property Change: location.
Parameters:
loc - key location

setBoundsP

public void setBoundsP(Rectangle2D.Double r)
Set the bounds, in physical units, of the VectorKey

getBoundsP

public Rectangle2D.Double getBoundsP()

getLocationP

public Point2D.Double getLocationP()
Get location of key.
Returns:
Key location

addVectorGraph

public void addVectorGraph(VectorCartesianRenderer vector,
                           SGLabel label)
Add a VectorCartesianRenderer and label to the VectorKey.
Parameters:
line - VectorCartesianGraph object
label - descriptive label

removeVectorGraph

public void removeVectorGraph(SGLabel label)
Remove a line from the VectorKey.

removeVectorRenderer

public void removeVectorRenderer(VectorCartesianRenderer line)
Remove a line from the VectorKey.

removeVectorGraph

public void removeVectorGraph(java.lang.String ident)
Remove a line from the VectorKey.

clearAll

public void clearAll()
Remove all lines from the VectorKey.

clear

public void clear(java.lang.String data_id)
Remove data from key by id.

getRowHeight

public int getRowHeight()
Return height of key row in pixels.

draw

public void draw(java.awt.Graphics g)
Draw the Key.
Specified by:
draw in interface LayerChild
Following copied from interface: gov.noaa.pmel.sgt.LayerChild
Parameters:
g - Graphics context
Throws:
LayerNotFoundException - No layer is associated with the LayerChild.

getBounds

public java.awt.Rectangle getBounds()
Get the bounding rectangle.
Specified by:
getBounds in interface Selectable
Returns:
bounding rectangle

getLocation

public java.awt.Point getLocation()
Description copied from interface: Moveable
Gets the location in device coordinates.
Specified by:
getLocation in interface Moveable
Following copied from interface: gov.noaa.pmel.sgt.Moveable
Returns:
location

setLocation

public void setLocation(java.awt.Point loc)
Description copied from interface: Moveable
Sets the location in device coordinates.
Specified by:
setLocation in interface Moveable

setBounds

public void setBounds(java.awt.Rectangle r)
Set the bounds, in pixels, of the VectorKey

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Set the bounds, in pixels, of the VectorKey
Property Change: location.

toString

public java.lang.String toString()
Description copied from interface: LayerChild
Return a string that represents the LayerChild.
Specified by:
toString in interface LayerChild
Overrides:
toString in class java.lang.Object
Following copied from interface: gov.noaa.pmel.sgt.LayerChild
Returns:
Stringified LayerChild representation.

isVisible

public boolean isVisible()
Description copied from interface: LayerChild
Check if LayerChild is visible.
Specified by:
isVisible in interface LayerChild
Following copied from interface: gov.noaa.pmel.sgt.LayerChild
Returns:
true if visible

setVisible

public void setVisible(boolean visible)
Description copied from interface: LayerChild
Set visibility for a LayerChild.
Specified by:
setVisible in interface LayerChild
Following copied from interface: gov.noaa.pmel.sgt.LayerChild
Parameters:
visible - visible if true

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Description copied from interface: java.beans.PropertyChangeListener
This method gets called when a bound property is changed.
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Following copied from interface: java.beans.PropertyChangeListener
Parameters:
evt - A PropertyChangeEvent object describing the event source and the property that has changed.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: Moveable
Add a new PropertyChangeListener. Properties will include "moved". Implementation of the following two methods will normally be via the PropertyChangeSupport class.
Specified by:
addPropertyChangeListener in interface Moveable

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: Moveable
Remove a listener.
Specified by:
removePropertyChangeListener in interface Moveable


Send comments about the Scientific Graphics toolkit to dwd@pmel.noaa.gov. For more information about Java Development in the EPIC Group see the EPIC Software Page
Generated on December 13 2001