|
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.ColorKey
The ColorKey class provides a graphical depiction
of the relationship between a ColorMap
and user values. A single ColorKey can be
attached to a Layer. A ColorMap
is associated with the Key and therefor with a specific transformation
and optionally a SGTData object.
Ruler,
ColorMap,
Layer| Field Summary | |
static int |
BOTTOM
Align to bottom of key. |
static int |
CENTER
Align to center of key. |
static int |
HORIZONTAL
Orient key horizontally. |
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. |
static int |
VERTICAL
Orient key vertically. |
| Constructor Summary | |
ColorKey()
Default ColorKey constructor. |
|
ColorKey(Point2D.Double pt,
Dimension2D size,
int valign,
int halign)
|
|
ColorKey(Rectangle2D.Double pr,
int valign,
int halign)
ColorKey constructor that include location, size,
and alignment information. |
|
| Method Summary | |
void |
addGraph(CartesianRenderer rend,
SGLabel label)
Add a GridCartesianRenderer and label to the ColorKey. |
LayerChild |
copy()
Create a copy of ColorKey. |
void |
draw(java.awt.Graphics g)
Draw the ColorKey. |
int |
getBorderStyle()
Get border style. |
java.awt.Rectangle |
getBounds()
Gets the bounding rectangle in device coordinates. |
Rectangle2D.Double |
getBoundsP()
Get the bounding rectangle for the key in physical coordinates. |
ColorMap |
getColorMap()
Get color map. |
int |
getHAlign()
Get horizontal alignment |
java.lang.String |
getId()
Get ColorKey identifier |
Layer |
getLayer()
Returns the layer the ColorKey is attached. |
AbstractPane |
getPane()
Get the parent pane. |
Ruler |
getRuler()
Get the Ruler associated
with the key. |
SGLabel |
getTitle()
Get the key's title. |
int |
getVAlign()
Get vertical alignment |
boolean |
isSelectable()
Tests the selectable property. |
boolean |
isSelected()
Returns true if the selected property is set. |
boolean |
isVisible()
Check if ColorKey is visible. |
void |
modified(java.lang.String mess)
For internal sgt use. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
setAlign(int vert,
int horz)
Set color key alignment. |
void |
setBorderStyle(int style)
Set border style. |
void |
setBounds(int x,
int y,
int width,
int height)
Change the selected objects bounding rectangle in device coordinates. |
void |
setBounds(java.awt.Rectangle r)
Change the selected objects bounding rectangle in device coordinates. |
void |
setBoundsP(Rectangle2D.Double r)
Set the bounds of the key in physical coordinates. |
void |
setColorMap(ColorMap cm)
Set color map. |
void |
setColumns(int col)
Set columns. |
void |
setHAlign(int horz)
Set horizontal alignment |
void |
setId(java.lang.String id)
Set ColorKey identifier. |
void |
setLayer(Layer l)
Set parent Layer. |
void |
setLineLengthP(double len)
Set line lenght. |
void |
setLocationP(Point2D.Double loc)
Set location of key in physical coordinates. |
void |
setOrientation(int orient)
Set orientation. |
void |
setSelectable(boolean select)
Sets the selectable property. |
void |
setSelected(boolean sel)
Sets the selected property. |
void |
setSizeP(Dimension2D d)
Set the size of the key in physical coordinates. |
void |
setTitle(SGLabel title)
Set the title of the key. |
void |
setVAlign(int vert)
Set vertical alignment |
void |
setVisible(boolean visible)
Set visibility state for ColorKey. |
java.lang.String |
toString()
Get a string representation of the key. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int PLAIN_LINE
public static final int RAISED
public static final int NO_BORDER
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
| Constructor Detail |
public ColorKey()
ColorKey constructor. The location and size
must be specified before the ColorKey is
attached to a layer!
public ColorKey(Rectangle2D.Double pr,
int valign,
int halign)
ColorKey constructor that include location, size,
and alignment information. Default orientation is
HORIZONTAL.
pr - a Rectangle2D object that includes location and sizevalign - vertical alignmenthalign - horizontal alignment
public ColorKey(Point2D.Double pt,
Dimension2D size,
int valign,
int halign)
| Method Detail |
public LayerChild copy()
ColorKey.
copy in interface LayerChildpublic void setSelected(boolean sel)
selected property.
setSelected in interface Selectablesel - true if selected, false if not.public boolean isSelected()
selected property is set.
isSelected in interface Selectablepublic void setSelectable(boolean select)
setSelectable in interface Selectableselect - if true object is selectablepublic boolean isSelectable()
isSelectable in interface Selectablepublic void setId(java.lang.String id)
setId in interface LayerChildid - key identifierpublic java.lang.String getId()
ColorKey identifier
getId in interface LayerChildpublic void setLayer(Layer l)
Layer. Method should not be called
directly, called when the Layer.addChild
method is called.
setLayer in interface LayerChildl - parent layerpublic Layer getLayer()
getLayer in interface LayerChildLayerpublic AbstractPane getPane()
getPane in interface LayerChildpublic void modified(java.lang.String mess)
modified in interface LayerChildpublic void setColorMap(ColorMap cm)
cm - color map
public void addGraph(CartesianRenderer rend,
SGLabel label)
throws java.lang.IllegalArgumentException
addGraph in interface DataKeyrend - GridCartesianRenderer objectlabel - descriptive label
java.lang.IllegalArgumentExceptionpublic ColorMap getColorMap()
public void setBorderStyle(int style)
setBorderStyle in interface DataKeystyle - border stylePLAIN_LINE,
RAISED,
NO_BORDERpublic int getBorderStyle()
public void setAlign(int vert,
int horz)
setAlign in interface DataKeyvert - vertical alignmenthorz - horizontal alignmentpublic void setOrientation(int orient)
orient - key orientationpublic void setVAlign(int vert)
setVAlign in interface DataKeyvert - vertical alignmentpublic void setHAlign(int horz)
setHAlign in interface DataKeyhorz - horizontal alignmentpublic int getVAlign()
public int getHAlign()
public void setLocationP(Point2D.Double loc)
setLocationP in interface DataKeyloc - key locationpublic void setSizeP(Dimension2D d)
d - size of keypublic void setBoundsP(Rectangle2D.Double r)
setBoundsP in interface DataKeyr - bounding rectanglepublic Rectangle2D.Double getBoundsP()
public java.awt.Rectangle getBounds()
getBounds in interface Selectablepublic void setBounds(java.awt.Rectangle r)
r - new bounding rectangle
public void setBounds(int x,
int y,
int width,
int height)
x - horizontal location, positive righty - vertical location, positive downwidth - horizontal sizeheight - vertical sizepublic void setTitle(SGLabel title)
title - key titlepublic SGLabel getTitle()
public Ruler getRuler()
Ruler associated
with the key.
public void draw(java.awt.Graphics g)
draw in interface LayerChildg - Graphics contextPane.draw()public java.lang.String toString()
toString in interface LayerChildtoString in class java.lang.Objectpublic boolean isVisible()
isVisible in interface LayerChildpublic void setVisible(boolean visible)
setVisible in interface LayerChildvisible - visible if truepublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerpublic void setColumns(int col)
setColumns in interface DataKeycol - public void setLineLengthP(double len)
setLineLengthP in interface DataKey
|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||