|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.ui.drawing.Glyph
ucar.unidata.ui.drawing.RectangleGlyph
ucar.unidata.ui.symbol.MetSymbol
public abstract class MetSymbol
Class MetSymbol
| Field Summary | |
|---|---|
static String |
ATTR_PARAMID
Symbol type attribute |
protected StationModelCanvas |
canvas
The canvas we are in |
protected PropertiesDialog |
propertiesDialog
symbol properties dialog |
| Fields inherited from class ucar.unidata.ui.drawing.RectangleGlyph |
|---|
ATTR_RECTTYPE, bounds, CIRCLE, FCIRCLE, FRECTANGLE, FROUNDRECT, RECTANGLE, ROUNDRECT, TYPE_CIRCLE, TYPE_RECT, TYPE_RRECT |
| Fields inherited from class ucar.unidata.ui.drawing.Glyph |
|---|
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 |
| Constructor Summary | |
|---|---|
protected |
MetSymbol()
Default constructor. |
protected |
MetSymbol(DisplayCanvas canvas,
int x,
int y,
String[] paramIds,
String[] paramDescs)
The MetSymbol can be created in two ways. |
|
MetSymbol(int x,
int y)
Constructor |
| Method Summary | |
|---|---|
void |
addPropertyTabs(JTabbedPane tabbedPane)
Add extra components to the property tab |
protected void |
applyProperties()
Called by the PropertiesDialog to apply any special properties |
protected Object |
clone()
Clone this object |
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(Graphics2D g,
int x,
int y,
int width,
int height)
Draw the symbol, offset from the given location, using "normalized device" coordinates. |
void |
draw(Graphics2D g,
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. |
Rectangle |
getBounds(Point2D loc)
Get the bounds for this MetSymbol relative to
the point specified. |
List |
getColorMappings()
Get the ColorMappings property. |
String |
getColorParam()
Get the ColorParam property. |
ColorTable |
getColorTable()
Get the ColorTable property. |
String |
getColorTableParam()
Get the ColorTableParam property. |
Range |
getColorTableRange()
Get the ColorTableRange property. |
Unit |
getColorTableUnit()
Get the the colorTable unit. |
String |
getColorTableUnitName()
Get the name of the colorTable unit. |
String |
getDesc()
Get the description of this MetSymbol. |
Unit |
getDisplayUnit()
Get the the display unit. |
String |
getDisplayUnitName()
Get the name of the display unit. |
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. |
String |
getName()
Get the name of this MetSymbol. |
String |
getParam(int index)
Get the parameter at the index specified. |
String[] |
getParamDescs()
Get the parameter descriptions for this MetSymbol. |
String[] |
getParamIds()
Get the parameter ids for this MetSymbol. |
Object |
getParamValue(int index)
Get the parameter value at the index specified. |
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. |
String |
getScaleParam()
Get the ScaleParam property. |
Range |
getScaleRange()
Get the ScaleRange property. |
Unit |
getScaleUnit()
Get the the scale unit. |
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(Element symbolNode)
Initialize this symbol from the xml that defined it. |
protected void |
initPropertyComponents(List comps)
Add to the list any widgets that should be added to the basic properties dialog tab. |
VisADGeometryArray[] |
makeShapes(Data[] dataArray,
PointOb ob)
If this symbol is not one of the 'known' symbols then this method is called to create the shapes. |
VisADGeometryArray[] |
makeShapes(PointOb ob)
If doAllObs returns true then this method is called to create the shapes. |
void |
paint(Graphics g,
DisplayCanvas c)
This is called to paint within the EditCanvas |
void |
paintSelection(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(String name,
String value)
Set the attribute with the value supplied. |
void |
setColorMappings(List value)
Set the ColorMappings property. |
void |
setColorParam(String value)
Set the ColorParam property. |
void |
setColorTable(ColorTable value)
Set the ColorTable property. |
void |
setColorTableParam(String value)
Set the ColorTableParam property. |
void |
setColorTableRange(Range value)
Set the ColorTableRange property. |
void |
setColorTableUnitName(String name)
Set the name of the ColorTable unit. |
void |
setDisplayUnitName(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(String[] value)
Set the parameter descriptions for this MetSymbol. |
void |
setParamIds(String[] value)
Set the parameter ids for this MetSymbol. |
void |
setParamValue(int index,
Object v)
Set the parameter value at the index specified. |
void |
setRectPoint(String rp)
Set the point at which this object is alligned. |
void |
setRotateDataRange(Range value)
Set the RotateRange property. |
void |
setRotateParam(String value)
Set the RotateParam property. |
void |
setRotateRange(Range value)
Set the RotateRange property. |
void |
setRotateUnitName(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(String value)
Set the ScaleParam property. |
void |
setScaleRange(Range value)
Set the ScaleRange property. |
void |
setScaleUnitName(String name)
Set the name of the Scale unit. |
void |
setTheDisplayUnit(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. |
String |
toString()
Get the String that represents this MetSymbol. |
| Methods inherited from class ucar.unidata.ui.drawing.RectangleGlyph |
|---|
distance, getBottom, getBounds, getEqualSides, getLeft, getPoint, getPositionAttr, getStretchPoint, getSymetricReshape, getTop, moveBy, moveTo, setPoints, setSize, setType, stretchTo |
| Methods inherited from class ucar.unidata.ui.drawing.Glyph |
|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ATTR_PARAMID
protected StationModelCanvas canvas
protected PropertiesDialog propertiesDialog
| Constructor Detail |
|---|
protected MetSymbol()
public MetSymbol(int x,
int y)
x - Initial x position.y - Initial y position.
protected MetSymbol(DisplayCanvas canvas,
int x,
int y,
String[] paramIds,
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)| Method Detail |
|---|
public void initialize(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(List comps)
comps - List containing labels and widgets for the basic properties tab.protected void applyProperties()
public void addPropertyTabs(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 VisADGeometryArray[] makeShapes(PointOb ob)
throws Exception
ob - The observation
Exception - On badness
public VisADGeometryArray[] makeShapes(Data[] dataArray,
PointOb ob)
throws Exception
dataArray - The array of data objects. May have 0 or more data depending
on the paramids.ob - The observation
Exception - On badnesspublic boolean doAlignmentMenu()
MetSymbol should show an
alignment menu in an editor. Subclasses should override if not.
public void setParamIds(String[] value)
MetSymbol.
value - array of parameter idspublic String[] getParamIds()
MetSymbol.
public void setParamDescs(String[] value)
MetSymbol.
Descriptions are used for UI widgets (labels, combo boxes, etc)
value - array of parameter descriptionspublic 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 String getRectPoint()
public void setRectPoint(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 String toString()
String that represents this MetSymbol.
toString in class ObjectString representation.public String getLabel()
protected Object clone()
throws CloneNotSupportedException
clone in class RectangleGlyphCloneNotSupportedException - if cloning cannot be donepublic Object cloneMe()
public String getName()
MetSymbol.
paramIdpublic String getDesc()
MetSymbol.
paramIdpublic Object getParamValue(int index)
index - index into param array
public void setParamValue(int index,
Object v)
index - index into param arrayv - value to set at that index.public String getParam(int index)
index - index into param array
public void paint(Graphics g,
DisplayCanvas c)
paint in class RectangleGlyphg - Graphicsc - DisplayCanvas to paint on.
public void paintSelection(Graphics g,
DisplayCanvas c)
paintSelection in class Glyphg - Graphics to use for paintingc - DisplayCanvas to paint onpublic Rectangle getBounds(Point2D loc)
MetSymbol relative to
the point specified.
loc - Java coordinates to draw at
public void draw(Graphics2D g,
Point2D loc)
g - graphics to draw onloc - location to draw at. Used to normalize the
bounds.getBounds(Point2D)
public abstract void draw(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(String name,
String value)
setAttr in class RectangleGlyphname - name of attribute.value - value of attribute.public void setColorTable(ColorTable value)
value - The new value for ColorTablepublic ColorTable getColorTable()
public void setColorTableParam(String value)
value - The new value for ColorTableParampublic String getColorTableParam()
public void setColorTableUnitName(String name)
name - name of unitpublic String getColorTableUnitName()
null.public Unit getColorTableUnit()
null.public void setColorTableRange(Range value)
value - The new value for ColorTableRangepublic Range getColorTableRange()
public void setScaleUnitName(String name)
name - name of unitpublic String getScaleUnitName()
null.public 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(String value)
value - The new value for ScaleParampublic String getScaleParam()
public void setScale(double value)
value - The new value for Scalepublic double getScale()
public void setRotateParam(String value)
value - The new value for RotateParampublic void setRotateUnitName(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 - type
public void setColorParam(String value)
value - The new value for ColorParampublic String getColorParam()
public void setColorMappings(List value)
value - The new value for ColorMappingspublic List getColorMappings()
public void setDisplayUnitName(String name)
name - name of unitprotected boolean showDisplayUnitInProperties()
public String getDisplayUnitName()
null.public void setTheDisplayUnit(Unit u)
u - unit to display values inpublic Unit getDisplayUnit()
null.public boolean rotateOnEarth()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||