Package ucar.unidata.ui.symbol
Class ShapeSymbol
java.lang.Object
ucar.unidata.ui.drawing.Glyph
ucar.unidata.ui.drawing.RectangleGlyph
ucar.unidata.ui.symbol.MetSymbol
ucar.unidata.ui.symbol.ShapeSymbol
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
MappedShapeSymbol
Shape symbol.
- Version:
- $Revision: 1.25 $
- Author:
- Metapps development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXml attr name for pointsstatic final StringXml attr name for shapestatic final StringXml attr name for shape type (triangle, quad, line)static final StringShape type to create when using points - visadlinearraystatic final StringShape type to create when using points - visadquadarraystatic final StringShape type to create when using points - visadtrianglearrayFields inherited from class ucar.unidata.ui.symbol.MetSymbol
ATTR_PARAMID, canvas, propertiesDialogFields inherited from class ucar.unidata.ui.drawing.RectangleGlyph
ATTR_RECTTYPE, bounds, CIRCLE, FCIRCLE, FRECTANGLE, FROUNDRECT, RECTANGLE, ROUNDRECT, TYPE_CIRCLE, TYPE_RECT, TYPE_RRECTFields 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
ConstructorsConstructorDescriptionDefault constructor.ShapeSymbol(int x, int y) Construct a ShapeSymbol without a canvas at the position specified.ShapeSymbol(DisplayCanvas canvas, int x, int y) Construct a ShapeSymbol to use on the canvas specified at the position specified. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidApply properties from the properties dialog.booleandoAllObs()Should this symbol do all of the observations.voiddraw(Graphics2D g, int x, int y, int width, int height) draw the symbol at the specified locationbooleanGet whether thisMetSymbolhas equals sides (width and height).getLabel()Get the label to show the user what I am in the propertiesgetParamValue(int index) Get the parameter value at the index specified.float[]Get the points.getShape()Get the Shape property.Get the shape type.booleanGet whether thisMetSymbolcan be stretched or not.voidinitialize(Element symbolNode) Initialize the shape with the xmlprotected voidinitPropertyComponents(List comps) Add any components to the list of widgets for the main property dialog tab.protected voidmakeShapePropertyComponents(List comps) Add to the property components.makeShapes(PointOb ob) Make the shapes.voidsetParamValue(int index, Object v) Set the parameter value at the index specified.voidsetPoints(float[] p) Set the points.voidSet the Shape property.voidsetShapeType(String type) Set the shape typevoidsetStretchy(boolean s) Is this stretchyMethods inherited from class ucar.unidata.ui.symbol.MetSymbol
addPropertyTabs, clone, cloneMe, closePropertiesDialog, decrSize, doAlignmentMenu, draw, getActive, getBounds, getColorMappings, getColorParam, getColorTable, getColorTableParam, getColorTableRange, getColorTableUnit, getColorTableUnitName, getDesc, getDisplayUnit, getDisplayUnitName, getMissing, getName, getParam, getParamDescs, getParamIds, getRectPoint, getRotateInfo, getRotateXInfo, getRotateYInfo, getRotateZInfo, getScale, getScaleDataRange, getScaleParam, getScaleRange, getScaleUnit, getScaleUnitName, getXOffset, getYOffset, incrSize, makeShapes, paint, paintSelection, rotateOnEarth, setActive, setAttr, setColorMappings, setColorParam, setColorTable, setColorTableParam, setColorTableRange, setColorTableUnitName, setDisplayUnitName, setMissing, setOffset, setParamDescs, setParamIds, setRectPoint, setRotateDataRange, setRotateParam, setRotateRange, setRotateUnitName, setRotateXInfo, setRotateYInfo, setRotateZInfo, setScale, setScaleDataRange, setScaleParam, setScaleRange, setScaleUnitName, setTheDisplayUnit, shouldBeColored, shouldOffsetShape, shouldScaleShape, shouldShowColorTableGui, shouldShowRotateGui, shouldShowScaleGui, showDisplayUnitInProperties, showPropertiesDialog, toStringMethods inherited from class ucar.unidata.ui.drawing.RectangleGlyph
distance, getBottom, getBounds, getLeft, getPoint, getPositionAttr, getStretchPoint, getSymetricReshape, getTop, moveBy, moveTo, setPoints, setSize, setType, stretchToMethods 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, getXml, initDone, makeAttr, notifyChange, paintHighlight, paintSelectionPoints, pickable, processAttrs, setBackground, setBeingCreated, setFilled, setForeground, setId, setLineWidth, setParent, stretchTo, stretchTo, toRect, transformOutput, transformOutput, transformOutputX, transformOutputY
-
Field Details
-
ATTR_POINTS
Xml attr name for points- See Also:
-
ATTR_SHAPE
Xml attr name for shape- See Also:
-
ATTR_SHAPETYPE
Xml attr name for shape type (triangle, quad, line)- See Also:
-
TYPE_LINE
Shape type to create when using points - visadlinearray- See Also:
-
TYPE_TRIANGLE
Shape type to create when using points - visadtrianglearray- See Also:
-
TYPE_QUAD
Shape type to create when using points - visadquadarray- See Also:
-
-
Constructor Details
-
ShapeSymbol
public ShapeSymbol()Default constructor. -
ShapeSymbol
public ShapeSymbol(int x, int y) Construct a ShapeSymbol without a canvas at the position specified. Use the parameter names and long names specified.- Parameters:
x- x positiony- y position
-
ShapeSymbol
Construct a ShapeSymbol to use on the canvas specified at the position specified. Use the parameter names and long names specified.- Parameters:
canvas- canvas to draw on.x- x position on the canvasy- y position on the canvas
-
-
Method Details
-
getLabel
Get the label to show the user what I am in the properties -
initialize
Initialize the shape with the xml- Overrides:
initializein classMetSymbol- Parameters:
symbolNode- The xml
-
initPropertyComponents
Add any components to the list of widgets for the main property dialog tab.- Overrides:
initPropertyComponentsin classMetSymbol- Parameters:
comps- List of components.
-
makeShapePropertyComponents
Add to the property components.- Parameters:
comps- List of label/component pairs.
-
applyProperties
protected void applyProperties()Apply properties from the properties dialog.- Overrides:
applyPropertiesin classMetSymbol
-
getStretchy
public boolean getStretchy()Get whether thisMetSymbolcan be stretched or not.- Overrides:
getStretchyin classGlyph- Returns:
- true if can be stretched.
-
setStretchy
public void setStretchy(boolean s) Is this stretchy- Overrides:
setStretchyin classGlyph- Parameters:
s- Is this stretchy
-
getParamValue
Get the parameter value at the index specified.- Overrides:
getParamValuein classMetSymbol- Parameters:
index- index into param array- Returns:
- value of uOrSpeedParam if index = 0, otherwise vOrDirParam value
-
setParamValue
Set the parameter value at the index specified.- Overrides:
setParamValuein classMetSymbol- Parameters:
index- index into param arrayv- value (String) of double parameter value
-
getEqualSides
public boolean getEqualSides()Get whether thisMetSymbolhas equals sides (width and height).- Overrides:
getEqualSidesin classRectangleGlyph- Returns:
- true
-
draw
draw the symbol at the specified location -
setShape
Set the Shape property.- Parameters:
value- The new value for Shape
-
getShape
Get the Shape property.- Returns:
- The Shape
-
doAllObs
public boolean doAllObs()Should this symbol do all of the observations. Used by the StationModelDisplayable to determine if makeShapes should be called. -
makeShapes
Make the shapes.- Overrides:
makeShapesin classMetSymbol- Parameters:
ob- The observation. We don't use this.- Returns:
- The array of shapes.
-
getShapeType
Get the shape type.- Returns:
- The shape type
-
setShapeType
Set the shape type- Parameters:
type- The shape type
-
getPoints
public float[] getPoints()Get the points. From the xml.- Returns:
- The points. May be null.
-
setPoints
public void setPoints(float[] p) Set the points.- Parameters:
p- The points.
-