|
SGT Home | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | 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(Rectangle2D.Double pr,
int valign,
int halign)
ColorKey constructor that include location, size,
and alignment information. |
Method Summary | |
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)
This method gets called when a bound property is changed. |
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 |
setHAlign(int horz)
Set horizontal alignment |
void |
setId(java.lang.String id)
Set ColorKey identifier. |
void |
setLayer(Layer l)
Set parent Layer . |
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 alignmentMethod Detail |
public LayerChild copy()
ColorKey
.copy
in interface LayerChild
public void setSelected(boolean sel)
selected
property.setSelected
in interface Selectable
sel
- true if selected, false if not.public boolean isSelected()
selected
property is set.isSelected
in interface Selectable
public void setSelectable(boolean select)
setSelectable
in interface Selectable
public boolean isSelectable()
isSelectable
in interface Selectable
public void setId(java.lang.String id)
setId
in interface LayerChild
id
- key identifierpublic java.lang.String getId()
ColorKey
identifiergetId
in interface LayerChild
public void setLayer(Layer l)
Layer
. Method should not be called
directly, called when the Layer.addChild
method is called.setLayer
in interface LayerChild
l
- parent layerpublic Layer getLayer()
getLayer
in interface LayerChild
Layer
public AbstractPane getPane()
getPane
in interface LayerChild
public void modified(java.lang.String mess)
modified
in interface LayerChild
public void setColorMap(ColorMap cm)
cm
- color mappublic ColorMap getColorMap()
public void setBorderStyle(int style)
style
- border stylePLAIN_LINE
,
RAISED
,
NO_BORDER
public int getBorderStyle()
public void setAlign(int vert, int horz)
vert
- vertical alignmenthorz
- horizontal alignmentpublic void setOrientation(int orient)
orient
- key orientationpublic void setVAlign(int vert)
vert
- vertical alignmentpublic void setHAlign(int horz)
horz
- horizontal alignmentpublic int getVAlign()
public int getHAlign()
public void setLocationP(Point2D.Double loc)
loc
- key locationpublic void setSizeP(Dimension2D d)
d
- size of keypublic void setBoundsP(Rectangle2D.Double r)
r
- bounding rectanglepublic Rectangle2D.Double getBoundsP()
public java.awt.Rectangle getBounds()
getBounds
in interface Selectable
public void setBounds(java.awt.Rectangle r)
r
- new bounding rectanglepublic 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 LayerChild
Pane.draw()
public java.lang.String toString()
toString
in interface LayerChild
toString
in class java.lang.Object
public boolean isVisible()
isVisible
in interface LayerChild
public void setVisible(boolean visible)
setVisible
in interface LayerChild
public void propertyChange(java.beans.PropertyChangeEvent evt)
java.beans.PropertyChangeListener
propertyChange
in interface java.beans.PropertyChangeListener
java.beans.PropertyChangeListener
evt
- A PropertyChangeEvent object describing the event source
and the property that has changed.
|
SGT Home | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |