ucar.unidata.ui.symbol
Class WindBarbSymbol

java.lang.Object
  extended by ucar.unidata.ui.drawing.Glyph
      extended by ucar.unidata.ui.drawing.RectangleGlyph
          extended by ucar.unidata.ui.symbol.MetSymbol
              extended by ucar.unidata.ui.symbol.WindBarbSymbol
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
WindVectorSymbol

public class WindBarbSymbol
extends MetSymbol

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
static class WindBarbSymbol.WindDrawer
          Class WindDrawer knows how to draw windbarbs
 
Field Summary
static double DEG_TO_RAD
          Fix conversion value
 
Fields 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
WindBarbSymbol()
          Default constructor.
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.
WindBarbSymbol(int x, int y, String uOrSpeedParam, String uOrSpeedDescr, String vOrDirParam, String vOrDirDescr)
          Construct a WindBarbSymbol without a canvas at the position specified.
 
Method Summary
 boolean doAlignmentMenu()
          Determine whether this MetSymbol 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 location
 String getDirectionName()
          Get the name of the Direction or V component.
 boolean getEqualSides()
          Get whether this MetSymbol has equals sides (width and height).
 Object getParamValue(int index)
          Get the parameter value at the index specified.
 String getSpeedName()
          Get the name of the Speed or U component.
 boolean getStretchy()
          Get whether this MetSymbol can be stretched or not.
 boolean getSymetricReshape()
          Get whether this MetSymbol should be stretched symetrically or not.
 double getWindDirection()
          get the Wind Direction, in degrees (0 = north) from [0, 360)
 double getWindSpeed()
          get the Wind Speed, in knots
protected  WindBarbSymbol.WindDrawer makeDrawer()
          Make the drawer for this symbol
 boolean rotateOnEarth()
          Can we rotate this symbol when the display rotates
 void 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 knots
 boolean shouldOffsetShape()
          Should this shape be offset.
 boolean shouldScaleShape()
          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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEG_TO_RAD

public static final double DEG_TO_RAD
Fix conversion value

See Also:
Constant Field Values
Constructor Detail

WindBarbSymbol

public WindBarbSymbol()
Default constructor.


WindBarbSymbol

public WindBarbSymbol(DisplayCanvas canvas,
                      int x,
                      int y)
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 canvas
y - 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 position
y - y position
uOrSpeedParam - u or speed component of wind parameter name
uOrSpeedDescr - u or speed component of wind parameter description
vOrDirParam - v or direction component of wind parameter name
vOrDirDescr - 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 canvas
y - y position on the canvas
uOrSpeedParam - u or speed component of wind parameter name
uOrSpeedDescr - u or speed component of wind parameter description
vOrDirParam - v or direction component of wind parameter name
vOrDirDescr - v or direction component of wind parameter descr
Method Detail

shouldScaleShape

public boolean shouldScaleShape()
Should this shape be scaled. See MetSymbol.

Overrides:
shouldScaleShape in class MetSymbol
Returns:
Should this shape be scaled

shouldOffsetShape

public boolean shouldOffsetShape()
Should this shape be offset. See MetSymbol.

Overrides:
shouldOffsetShape in class MetSymbol
Returns:
Should this shape be offset

doAlignmentMenu

public boolean doAlignmentMenu()
Determine whether this MetSymbol should show an alignment menu in an editor. Subclasses should override if not.

Overrides:
doAlignmentMenu in class MetSymbol
Returns:
false for this

getParamValue

public Object getParamValue(int index)
Get the parameter value at the index specified.

Overrides:
getParamValue in class MetSymbol
Parameters:
index - index into param array
Returns:
value of uOrSpeedParam if index = 0, otherwise vOrDirParam value

setParamValue

public void setParamValue(int index,
                          Object v)
Set the parameter value at the index specified.

Overrides:
setParamValue in class MetSymbol
Parameters:
index - index into param array
v - value (String) of double parameter value

getSpeedName

public String getSpeedName()
Get the name of the Speed or U component.

Returns:
name of this component.

getDirectionName

public String getDirectionName()
Get the name of the Direction or V component.

Returns:
name of this component.

getStretchy

public boolean getStretchy()
Get whether this MetSymbol can be stretched or not.

Overrides:
getStretchy in class Glyph
Returns:
true if can be stretched.

getEqualSides

public boolean getEqualSides()
Get whether this MetSymbol has equals sides (width and height).

Overrides:
getEqualSides in class RectangleGlyph
Returns:
true

getSymetricReshape

public boolean getSymetricReshape()
Get whether this MetSymbol should be stretched symetrically or not.

Overrides:
getSymetricReshape in class RectangleGlyph
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

public void draw(Graphics2D g,
                 int x,
                 int y,
                 int width,
                 int height)
draw the symbol at the specified location

Specified by:
draw in class MetSymbol
Parameters:
g - Graphics to draw to
x - x location
y - y location
width - width to draw
height - height to draw

makeDrawer

protected WindBarbSymbol.WindDrawer 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 class MetSymbol
Returns:
false