Package ucar.unidata.ui.symbol
Class WindBarbSymbol
java.lang.Object
ucar.unidata.ui.drawing.Glyph
ucar.unidata.ui.drawing.RectangleGlyph
ucar.unidata.ui.symbol.MetSymbol
ucar.unidata.ui.symbol.WindBarbSymbol
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
WindVectorSymbol
Wind Barb meteorological symbol.
- Version:
- $Id: WindBarbSymbol.java,v 1.23 2007/05/22 20:00:23 jeffmc Exp $
- Author:
- Metapps development team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Class WindDrawer knows how to draw windbarbs -
Field Summary
FieldsFields inherited from class ucar.unidata.ui.symbol.MetSymbol
ATTR_PARAMID, canvas, propertiesDialog
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
ConstructorsConstructorDescriptionDefault constructor.WindBarbSymbol
(int x, int y, String uOrSpeedParam, String uOrSpeedDescr, String vOrDirParam, String vOrDirDescr) Construct a WindBarbSymbol without a canvas at the position specified.WindBarbSymbol
(DisplayCanvas canvas, int x, int y) Construct a WindBarbSymbol to use on the canvas specified at the position specified.WindBarbSymbol
(DisplayCanvas canvas, int x, int y, String uOrSpeedParam, String uOrSpeedDescr, String vOrDirParam, String vOrDirDescr) Construct a WindBarbSymbol to use on the canvas specified at the position specified. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine whether thisMetSymbol
should show an alignment menu in an editor.void
draw
(Graphics2D g, int x, int y, int width, int height) draw the symbol at the specified locationGet the name of the Direction or V component.boolean
Get whether thisMetSymbol
has equals sides (width and height).getParamValue
(int index) Get the parameter value at the index specified.Get the name of the Speed or U component.boolean
Get whether thisMetSymbol
can be stretched or not.boolean
Get whether thisMetSymbol
should be stretched symetrically or not.double
get the Wind Direction, in degrees (0 = north) from [0, 360)double
get the Wind Speed, in knotsprotected WindBarbSymbol.WindDrawer
Make the drawer for this symbolboolean
Can we rotate this symbol when the display rotatesvoid
setParamValue
(int index, Object v) Set the parameter value at the index specified.void
setWindDirection
(double windDirection) set the Wind Direction, in degrees (0 = north) from [0, 360)void
setWindSpeed
(double windSpeed) set the Wind Speed, in knotsboolean
Should this shape be offset.boolean
Should this shape be scaled.Methods inherited from class ucar.unidata.ui.symbol.MetSymbol
addPropertyTabs, applyProperties, clone, cloneMe, closePropertiesDialog, decrSize, doAllObs, draw, getActive, getBounds, getColorMappings, getColorParam, getColorTable, getColorTableParam, getColorTableRange, getColorTableUnit, getColorTableUnitName, getDesc, getDisplayUnit, getDisplayUnitName, getLabel, getMissing, getName, getParam, getParamDescs, getParamIds, getRectPoint, getRotateInfo, getRotateXInfo, getRotateYInfo, getRotateZInfo, getScale, getScaleDataRange, getScaleParam, getScaleRange, getScaleUnit, getScaleUnitName, getXOffset, getYOffset, incrSize, initialize, initPropertyComponents, makeShapes, makeShapes, paint, paintSelection, 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, shouldShowColorTableGui, shouldShowRotateGui, shouldShowScaleGui, showDisplayUnitInProperties, showPropertiesDialog, toString
Methods inherited from class ucar.unidata.ui.drawing.RectangleGlyph
distance, getBottom, getBounds, getLeft, getPoint, getPositionAttr, getStretchPoint, 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, getXml, initDone, makeAttr, notifyChange, paintHighlight, paintSelectionPoints, pickable, processAttrs, setBackground, setBeingCreated, setFilled, setForeground, setId, setLineWidth, setParent, setStretchy, stretchTo, stretchTo, toRect, transformOutput, transformOutput, transformOutputX, transformOutputY
-
Field Details
-
DEG_TO_RAD
public static final double DEG_TO_RADFix conversion value- See Also:
-
-
Constructor Details
-
WindBarbSymbol
public WindBarbSymbol()Default constructor. -
WindBarbSymbol
Construct a WindBarbSymbol to use on the canvas specified at the position specified. Use the default names and long names.- Parameters:
canvas
- canvas to draw on.x
- x position on the canvasy
- y position on the canvas
-
WindBarbSymbol
public WindBarbSymbol(int x, int y, String uOrSpeedParam, String uOrSpeedDescr, String vOrDirParam, String vOrDirDescr) Construct a WindBarbSymbol without a canvas at the position specified. Use the parameter names and long names specified.- Parameters:
x
- x positiony
- y positionuOrSpeedParam
- u or speed component of wind parameter nameuOrSpeedDescr
- u or speed component of wind parameter descriptionvOrDirParam
- v or direction component of wind parameter namevOrDirDescr
- v or direction component of wind parameter descr
-
WindBarbSymbol
public WindBarbSymbol(DisplayCanvas canvas, int x, int y, String uOrSpeedParam, String uOrSpeedDescr, String vOrDirParam, String vOrDirDescr) Construct a WindBarbSymbol 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 canvasuOrSpeedParam
- u or speed component of wind parameter nameuOrSpeedDescr
- u or speed component of wind parameter descriptionvOrDirParam
- v or direction component of wind parameter namevOrDirDescr
- v or direction component of wind parameter descr
-
-
Method Details
-
shouldScaleShape
public boolean shouldScaleShape()Should this shape be scaled. See MetSymbol.- Overrides:
shouldScaleShape
in classMetSymbol
- Returns:
- Should this shape be scaled
-
shouldOffsetShape
public boolean shouldOffsetShape()Should this shape be offset. See MetSymbol.- Overrides:
shouldOffsetShape
in classMetSymbol
- Returns:
- Should this shape be offset
-
doAlignmentMenu
public boolean doAlignmentMenu()Determine whether thisMetSymbol
should show an alignment menu in an editor. Subclasses should override if not.- Overrides:
doAlignmentMenu
in classMetSymbol
- Returns:
- false for this
-
getParamValue
Get the parameter value at the index specified.- Overrides:
getParamValue
in 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:
setParamValue
in classMetSymbol
- Parameters:
index
- index into param arrayv
- value (String
) of double parameter value
-
getSpeedName
Get the name of the Speed or U component.- Returns:
- name of this component.
-
getDirectionName
Get the name of the Direction or V component.- Returns:
- name of this component.
-
getStretchy
public boolean getStretchy()Get whether thisMetSymbol
can be stretched or not.- Overrides:
getStretchy
in classGlyph
- Returns:
- true if can be stretched.
-
getEqualSides
public boolean getEqualSides()Get whether thisMetSymbol
has equals sides (width and height).- Overrides:
getEqualSides
in classRectangleGlyph
- Returns:
- true
-
getSymetricReshape
public boolean getSymetricReshape()Get whether thisMetSymbol
should be stretched symetrically or not.- Overrides:
getSymetricReshape
in classRectangleGlyph
- Returns:
- true
-
getWindSpeed
public double getWindSpeed()get the Wind Speed, in knots- Returns:
- windSpeed
-
setWindSpeed
public void setWindSpeed(double windSpeed) set the Wind Speed, in knots- Parameters:
windSpeed
- speed in knots
-
getWindDirection
public double getWindDirection()get the Wind Direction, in degrees (0 = north) from [0, 360)- Returns:
- The direction
-
setWindDirection
public void setWindDirection(double windDirection) set the Wind Direction, in degrees (0 = north) from [0, 360)- Parameters:
windDirection
-
-
draw
draw the symbol at the specified location -
makeDrawer
Make the drawer for this symbol- Returns:
- the drawer
-
rotateOnEarth
public boolean rotateOnEarth()Can we rotate this symbol when the display rotates- Overrides:
rotateOnEarth
in classMetSymbol
- Returns:
- false
-