public abstract class MetSymbol extends RectangleGlyph
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_PARAMID
Symbol type attribute
|
protected StationModelCanvas |
canvas
The canvas we are in
|
protected PropertiesDialog |
propertiesDialog
symbol properties dialog
|
ATTR_RECTTYPE, bounds, CIRCLE, FCIRCLE, FRECTANGLE, FROUNDRECT, RECTANGLE, ROUNDRECT, TYPE_CIRCLE, TYPE_RECT, TYPE_RRECT
ATTR_BGCOLOR, ATTR_CHILDREN, ATTR_CLASS, ATTR_COLOR, ATTR_FILL, ATTR_HEIGHT, ATTR_IMAGE, ATTR_LINEWIDTH, ATTR_PARENT, ATTR_PTS, ATTR_STRETCHY, ATTR_TEXT, ATTR_TYPE, ATTR_WIDTH, baseline, H_SEL_WIDTH, highlightColor, idToGlyph, MIN_DISTANCE_TO_STRETCH, PT_CENTER, PT_H_LEFT, PT_H_MIDDLE, PT_H_RIGHT, PT_LL, PT_LM, PT_LR, PT_ML, PT_MM, PT_MR, PT_P1, PT_P2, PT_PREFIX, PT_UL, PT_UM, PT_UR, PT_V_LOWER, PT_V_MIDDLE, PT_V_UPPER, RECTPOINTNAMES, RECTPOINTS, SEL_WIDTH, TAG_GLYPH, underline, url
Modifier | Constructor and Description |
---|---|
protected |
MetSymbol()
Default constructor.
|
protected |
MetSymbol(DisplayCanvas canvas,
int x,
int y,
java.lang.String[] paramIds,
java.lang.String[] paramDescs)
The MetSymbol can be created in two ways.
|
|
MetSymbol(int x,
int y)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyTabs(javax.swing.JTabbedPane tabbedPane)
Add extra components to the property tab
|
protected void |
applyProperties()
Called by the PropertiesDialog to apply any special properties
|
protected java.lang.Object |
clone()
Clone this object
|
java.lang.Object |
cloneMe()
Return a clone of this object.
|
void |
closePropertiesDialog()
Close the properties dialog if it is open.
|
void |
decrSize()
Increase the size of this
MetSymbol . |
boolean |
doAlignmentMenu()
Determine whether this
MetSymbol should show an
alignment menu in an editor. |
boolean |
doAllObs()
Called by the StationModelDisplayable to determine if the shapes
should be created with a call to makeShapes(PointOb).
|
abstract void |
draw(java.awt.Graphics2D g,
int x,
int y,
int width,
int height)
Draw the symbol, offset from the given location, using
"normalized device" coordinates.
|
void |
draw(java.awt.Graphics2D g,
java.awt.geom.Point2D loc)
This is called to paint when we are managed by other objects
(e.g., StationLocationRenderer)
|
boolean |
getActive()
Get whether this
MetSymbol is active or not. |
java.awt.Rectangle |
getBounds(java.awt.geom.Point2D loc)
Get the bounds for this
MetSymbol relative to
the point specified. |
java.util.List |
getColorMappings()
Get the ColorMappings property.
|
java.lang.String |
getColorParam()
Get the ColorParam property.
|
ColorTable |
getColorTable()
Get the ColorTable property.
|
java.lang.String |
getColorTableParam()
Get the ColorTableParam property.
|
Range |
getColorTableRange()
Get the ColorTableRange property.
|
visad.Unit |
getColorTableUnit()
Get the the colorTable unit.
|
java.lang.String |
getColorTableUnitName()
Get the name of the colorTable unit.
|
java.lang.String |
getDesc()
Get the description of this
MetSymbol . |
visad.Unit |
getDisplayUnit()
Get the the display unit.
|
java.lang.String |
getDisplayUnitName()
Get the name of the display unit.
|
java.lang.String |
getLabel()
Get the label to show the user what I am in the properties
|
boolean |
getMissing()
Get whether this
MetSymbol is missing or not. |
java.lang.String |
getName()
Get the name of this
MetSymbol . |
java.lang.String |
getParam(int index)
Get the parameter at the index specified.
|
java.lang.String[] |
getParamDescs()
Get the parameter descriptions for this
MetSymbol . |
java.lang.String[] |
getParamIds()
Get the parameter ids for this
MetSymbol . |
java.lang.Object |
getParamValue(int index)
Get the parameter value at the index specified.
|
java.lang.String |
getRectPoint()
Get the point at which this object is alligned.
|
RotateInfo |
getRotateInfo(int type)
Get the rotate info object for the given type.
|
RotateInfo |
getRotateXInfo()
Get the RotateXInfo property.
|
RotateInfo |
getRotateYInfo()
Get the RotateYInfo property.
|
RotateInfo |
getRotateZInfo()
Get the RotateZInfo property.
|
double |
getScale()
Get the Scale property.
|
Range |
getScaleDataRange()
Get the ScaleRange property.
|
java.lang.String |
getScaleParam()
Get the ScaleParam property.
|
Range |
getScaleRange()
Get the ScaleRange property.
|
visad.Unit |
getScaleUnit()
Get the the scale unit.
|
java.lang.String |
getScaleUnitName()
Get the name of the scale unit.
|
int |
getXOffset()
Get the x value of the offset.
|
int |
getYOffset()
Get the y value of the offset.
|
void |
incrSize()
Increase the size of this
MetSymbol . |
void |
initialize(org.w3c.dom.Element symbolNode)
Initialize this symbol from the xml that defined it.
|
protected void |
initPropertyComponents(java.util.List comps)
Add to the list any widgets that should be added to the basic properties dialog tab.
|
visad.VisADGeometryArray[] |
makeShapes(visad.Data[] dataArray,
PointOb ob)
If this symbol is not one of the 'known' symbols then this method is
called to create the shapes.
|
visad.VisADGeometryArray[] |
makeShapes(PointOb ob)
If doAllObs returns true then this method is called to create the shapes.
|
void |
paint(java.awt.Graphics g,
DisplayCanvas c)
This is called to paint within the EditCanvas
|
void |
paintSelection(java.awt.Graphics g,
DisplayCanvas c)
Paint the selection
|
boolean |
rotateOnEarth()
Can we rotate this symbol when the display rotates
|
void |
setActive(boolean active)
Set whether this
MetSymbol is active or not. |
void |
setAttr(java.lang.String name,
java.lang.String value)
Set the attribute with the value supplied.
|
void |
setColorMappings(java.util.List value)
Set the ColorMappings property.
|
void |
setColorParam(java.lang.String value)
Set the ColorParam property.
|
void |
setColorTable(ColorTable value)
Set the ColorTable property.
|
void |
setColorTableParam(java.lang.String value)
Set the ColorTableParam property.
|
void |
setColorTableRange(Range value)
Set the ColorTableRange property.
|
void |
setColorTableUnitName(java.lang.String name)
Set the name of the ColorTable unit.
|
void |
setDisplayUnitName(java.lang.String name)
Set the name of the display unit.
|
void |
setMissing(boolean missing)
Set whether this
MetSymbol is missing or not. |
void |
setOffset(int x,
int y)
Set the offset from the center for this
MetSymbol . |
void |
setParamDescs(java.lang.String[] value)
Set the parameter descriptions for this
MetSymbol . |
void |
setParamIds(java.lang.String[] value)
Set the parameter ids for this
MetSymbol . |
void |
setParamValue(int index,
java.lang.Object v)
Set the parameter value at the index specified.
|
void |
setRectPoint(java.lang.String rp)
Set the point at which this object is alligned.
|
void |
setRotateDataRange(Range value)
Set the RotateRange property.
|
void |
setRotateParam(java.lang.String value)
Set the RotateParam property.
|
void |
setRotateRange(Range value)
Set the RotateRange property.
|
void |
setRotateUnitName(java.lang.String name)
Set the name of the Rotate unit.
|
void |
setRotateXInfo(RotateInfo value)
Set the RotateXInfo property.
|
void |
setRotateYInfo(RotateInfo value)
Set the RotateYInfo property.
|
void |
setRotateZInfo(RotateInfo value)
Set the RotateZInfo property.
|
void |
setScale(double value)
Set the Scale property.
|
void |
setScaleDataRange(Range value)
Set the ScaleRange property.
|
void |
setScaleParam(java.lang.String value)
Set the ScaleParam property.
|
void |
setScaleRange(Range value)
Set the ScaleRange property.
|
void |
setScaleUnitName(java.lang.String name)
Set the name of the Scale unit.
|
void |
setTheDisplayUnit(visad.Unit u)
Set the the display unit.
|
boolean |
shouldBeColored()
Is used by the StationModelDisplayable to determine if the color
of the shapes should be set.
|
boolean |
shouldOffsetShape()
Is used by the StationModelDisplayable to determine if the
shapes should be moved in accordance to the position of this symbol.
|
boolean |
shouldScaleShape()
Is used by the StationModelDisplayable to determine if the
shapes should be scaled.
|
protected boolean |
shouldShowColorTableGui()
Should the 'Color by' properties dialog tab be shown.
|
protected boolean |
shouldShowRotateGui()
Should the 'Rotate by' properties dialog tab be shown.
|
protected boolean |
shouldShowScaleGui()
Should the 'Scale by' properties dialog tab be shown.
|
protected boolean |
showDisplayUnitInProperties()
Should we show the display unit widget in the properties dialog
|
void |
showPropertiesDialog(StationModelCanvas canvas)
Create, if needed, and show the properties dialog.
|
java.lang.String |
toString()
Get the
String that represents this MetSymbol . |
distance, getBottom, getBounds, getEqualSides, getLeft, getPoint, getPositionAttr, getStretchPoint, getSymetricReshape, getTop, moveBy, moveTo, setPoints, setSize, setType, stretchTo
boundsChanged, canStretch, distance, doRemove, flipY, getAttrs, getBackground, getBackground, getBeingCreated, getCreateCommand, getCursor, getFilled, getForeground, getId, getLineWidth, getMoveCommand, getPersistent, getPointOnRect, getPointOnRect, getRectPointName, getRepaintBounds, getStretchPoint, getStretchy, getXml, initDone, makeAttr, notifyChange, paintHighlight, paintSelectionPoints, pickable, processAttrs, setBackground, setBeingCreated, setFilled, setForeground, setId, setLineWidth, setParent, setStretchy, stretchTo, stretchTo, toRect, transformOutput, transformOutput, transformOutputX, transformOutputY
public static final java.lang.String ATTR_PARAMID
protected StationModelCanvas canvas
protected PropertiesDialog propertiesDialog
protected MetSymbol()
public MetSymbol(int x, int y)
x
- Initial x position.y
- Initial y position.protected MetSymbol(DisplayCanvas canvas, int x, int y, java.lang.String[] paramIds, java.lang.String[] paramDescs)
canvas
- DisplayCanvas
to draw on. May be null.x
- x position (either offset or canvas relative)y
- y position (either offset or canvas relative)paramIds
- array of parameter idsparamDescs
- array of parameter descriptions (long names)public void initialize(org.w3c.dom.Element symbolNode)
symbolNode
- The xml node that defines this symbol.public void showPropertiesDialog(StationModelCanvas canvas)
canvas
- The canvas we are in.public void closePropertiesDialog()
protected void initPropertyComponents(java.util.List comps)
comps
- List containing labels and widgets for the basic properties tab.protected void applyProperties()
public void addPropertyTabs(javax.swing.JTabbedPane tabbedPane)
tabbedPane
- Tabbed pane to add toprotected boolean shouldShowColorTableGui()
protected boolean shouldShowRotateGui()
protected boolean shouldShowScaleGui()
public boolean shouldScaleShape()
public boolean shouldBeColored()
public boolean shouldOffsetShape()
public boolean doAllObs()
public visad.VisADGeometryArray[] makeShapes(PointOb ob) throws java.lang.Exception
ob
- The observationjava.lang.Exception
- On badnesspublic visad.VisADGeometryArray[] makeShapes(visad.Data[] dataArray, PointOb ob) throws java.lang.Exception
dataArray
- The array of data objects. May have 0 or more data depending
on the paramids.ob
- The observationjava.lang.Exception
- On badnesspublic boolean doAlignmentMenu()
MetSymbol
should show an
alignment menu in an editor. Subclasses should override if not.public void setParamIds(java.lang.String[] value)
MetSymbol
.value
- array of parameter idspublic java.lang.String[] getParamIds()
MetSymbol
.public void setParamDescs(java.lang.String[] value)
MetSymbol
.
Descriptions are used for UI widgets (labels, combo boxes, etc)value
- array of parameter descriptionspublic java.lang.String[] getParamDescs()
MetSymbol
.
Descriptions are used for UI widgets (labels, combo boxes, etc)public void setOffset(int x, int y)
MetSymbol
.x
- x offsety
- y offsetpublic int getXOffset()
public java.lang.String getRectPoint()
public void setRectPoint(java.lang.String rp)
rp
- allignment point (e.g. Glyph.PT_MM, Glyph.PT_LL)public int getYOffset()
public void incrSize()
MetSymbol
. Subclasses
should implement this if they support such a thing.public void decrSize()
MetSymbol
. Subclasses
should implement this if they support such a thing.public java.lang.String toString()
String
that represents this MetSymbol
.toString
in class java.lang.Object
String
representation.public java.lang.String getLabel()
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class RectangleGlyph
java.lang.CloneNotSupportedException
- if cloning cannot be donepublic java.lang.Object cloneMe()
public java.lang.String getName()
MetSymbol
.paramId
public java.lang.String getDesc()
MetSymbol
.paramId
public java.lang.Object getParamValue(int index)
index
- index into param arraypublic void setParamValue(int index, java.lang.Object v)
index
- index into param arrayv
- value to set at that index.public java.lang.String getParam(int index)
index
- index into param arraypublic void paint(java.awt.Graphics g, DisplayCanvas c)
paint
in class RectangleGlyph
g
- Graphicsc
- DisplayCanvas to paint on.public void paintSelection(java.awt.Graphics g, DisplayCanvas c)
paintSelection
in class Glyph
g
- Graphics to use for paintingc
- DisplayCanvas to paint onpublic java.awt.Rectangle getBounds(java.awt.geom.Point2D loc)
MetSymbol
relative to
the point specified.loc
- Java coordinates to draw atpublic void draw(java.awt.Graphics2D g, java.awt.geom.Point2D loc)
g
- graphics to draw onloc
- location to draw at. Used to normalize the
bounds.getBounds(Point2D)
public abstract void draw(java.awt.Graphics2D g, int x, int y, int width, int height)
g
- Graphics to draw tox
- x locationy
- y locationwidth
- width to drawheight
- height to drawpublic void setActive(boolean active)
MetSymbol
is active or not.active
- true to be active (i.e., visible)public boolean getActive()
MetSymbol
is active or not.public void setMissing(boolean missing)
MetSymbol
is missing or not.
(i.e., no parameters or values have been set.missing
- true if missing.public boolean getMissing()
MetSymbol
is missing or not.
(i.e., no parameters or values have been set.public void setAttr(java.lang.String name, java.lang.String value)
setAttr
in class RectangleGlyph
name
- name of attribute.value
- value of attribute.public void setColorTable(ColorTable value)
value
- The new value for ColorTablepublic ColorTable getColorTable()
public void setColorTableParam(java.lang.String value)
value
- The new value for ColorTableParampublic java.lang.String getColorTableParam()
public void setColorTableUnitName(java.lang.String name)
name
- name of unitpublic java.lang.String getColorTableUnitName()
null
.public visad.Unit getColorTableUnit()
null
.public void setColorTableRange(Range value)
value
- The new value for ColorTableRangepublic Range getColorTableRange()
public void setScaleUnitName(java.lang.String name)
name
- name of unitpublic java.lang.String getScaleUnitName()
null
.public visad.Unit getScaleUnit()
null
.public void setScaleRange(Range value)
value
- The new value for ScaleRangepublic Range getScaleRange()
public void setScaleDataRange(Range value)
value
- The new value for ScaleRangepublic Range getScaleDataRange()
public void setScaleParam(java.lang.String value)
value
- The new value for ScaleParampublic java.lang.String getScaleParam()
public void setScale(double value)
value
- The new value for Scalepublic double getScale()
public void setRotateParam(java.lang.String value)
value
- The new value for RotateParampublic void setRotateUnitName(java.lang.String name)
name
- name of unitpublic void setRotateRange(Range value)
value
- The new value for RotateRangepublic void setRotateDataRange(Range value)
value
- The new value for RotateRangepublic void setRotateXInfo(RotateInfo value)
value
- The new value for RotateXInfopublic RotateInfo getRotateXInfo()
public void setRotateYInfo(RotateInfo value)
value
- The new value for RotateYInfopublic RotateInfo getRotateYInfo()
public void setRotateZInfo(RotateInfo value)
value
- The new value for RotateZInfopublic RotateInfo getRotateZInfo()
public RotateInfo getRotateInfo(int type)
type
- typepublic void setColorParam(java.lang.String value)
value
- The new value for ColorParampublic java.lang.String getColorParam()
public void setColorMappings(java.util.List value)
value
- The new value for ColorMappingspublic java.util.List getColorMappings()
public void setDisplayUnitName(java.lang.String name)
name
- name of unitprotected boolean showDisplayUnitInProperties()
public java.lang.String getDisplayUnitName()
null
.public void setTheDisplayUnit(visad.Unit u)
u
- unit to display values inpublic visad.Unit getDisplayUnit()
null
.public boolean rotateOnEarth()