Package ucar.unidata.ui.symbol
Class WeatherSymbol
java.lang.Object
ucar.unidata.ui.drawing.Glyph
ucar.unidata.ui.drawing.RectangleGlyph
ucar.unidata.ui.symbol.MetSymbol
ucar.unidata.ui.symbol.WeatherSymbol
- All Implemented Interfaces:
ImageObserver,Cloneable
Glyphs representing Meteorological symbols.
- Version:
- $Revision: 1.20 $
- Author:
- Metapps development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSymbol type attributestatic final intAll symbols indexstatic final intCloud coverage symbol indexstatic final intHigh cloud symbol indexstatic final intIcing symbol indexstatic final intLightning symbol indexstatic final intLow cloud symbol indexstatic final intMid cloud symbol indexstatic final intMiscellaneous symbol indexstatic final intPresent weather symbol indexstatic final intPressure tendency symbol indexstatic final intTurbulence symbol indexstatic final String[]Symbol namesFields 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, urlFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.WeatherSymbol(int x, int y) Create aWeatherSymbolat the position indicated.WeatherSymbol(int x, int y, String param, String paramDesc) Create aWeatherSymbolat the position indicated and use the name and description supplied.WeatherSymbol(DisplayCanvas canvas, int x, int y) Create aWeatherSymbolon the canvas specified at the position indicated.WeatherSymbol(DisplayCanvas canvas, int x, int y, String param, String paramDesc) Create aWeatherSymboloncanvasat the position indicated and use the name and description supplied. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D g, int x, int y, int width, int height) Draw this object to the graphics device.intgetCode()Get the code (index) for this symbol type.booleanGet whether thisMetSymbolhas equals sides (width and height).getLabel()Get the label to show the usergetLines(int index) Gets the VisADLineArray that corresponds to the index for the symbol type.static VisADLineArraygetLines(int symbolType, int code) Gets the VisADLineArray that corresponds to the code for the symbol type.getParamValue(int index) Get the value for the parameter at the particular index.booleanGet whether thisMetSymbolcan be stretched or not.intGet the symbol type for thisWeatherSymbol.booleanGet whether thisMetSymbolshould be stretched symetrically or not.booleanimageUpdate(Image img, int flags, int x, int y, int width, int height) This method is called when information about an image which was previously requested using an asynchronous interface becomes available, public due do implementingImageObserver.voidSet the attribute with the value supplied.voidsetCode(int value) Set the code (index) for this symbol type.voidsetParamValue(int index, Object v) Set the value for the parameter at the particular index.voidsetSymbolType(int value) Set the type of symbol that this is.Methods inherited from class ucar.unidata.ui.symbol.MetSymbol
addPropertyTabs, applyProperties, clone, cloneMe, closePropertiesDialog, decrSize, doAlignmentMenu, doAllObs, 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, initialize, initPropertyComponents, makeShapes, makeShapes, paint, paintSelection, rotateOnEarth, setActive, 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, 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, setStretchy, stretchTo, stretchTo, toRect, transformOutput, transformOutput, transformOutputX, transformOutputY
-
Field Details
-
SYMBOL_CLOUDCOVERAGE
public static final int SYMBOL_CLOUDCOVERAGECloud coverage symbol index- See Also:
-
SYMBOL_PRESENTWEATHER
public static final int SYMBOL_PRESENTWEATHERPresent weather symbol index- See Also:
-
SYMBOL_LOWCLOUD
public static final int SYMBOL_LOWCLOUDLow cloud symbol index- See Also:
-
SYMBOL_MIDCLOUD
public static final int SYMBOL_MIDCLOUDMid cloud symbol index- See Also:
-
SYMBOL_HIGHCLOUD
public static final int SYMBOL_HIGHCLOUDHigh cloud symbol index- See Also:
-
SYMBOL_PRESSURETENDENCY
public static final int SYMBOL_PRESSURETENDENCYPressure tendency symbol index- See Also:
-
SYMBOL_ICING
public static final int SYMBOL_ICINGIcing symbol index- See Also:
-
SYMBOL_TURBULENCE
public static final int SYMBOL_TURBULENCETurbulence symbol index- See Also:
-
SYMBOL_LIGHTNING
public static final int SYMBOL_LIGHTNINGLightning symbol index- See Also:
-
SYMBOL_MISC
public static final int SYMBOL_MISCMiscellaneous symbol index- See Also:
-
SYMBOL_ALL
public static final int SYMBOL_ALLAll symbols index- See Also:
-
SYMBOLNAMES
Symbol names -
ATTR_SYMBOLTYPE
Symbol type attribute- See Also:
-
-
Constructor Details
-
WeatherSymbol
public WeatherSymbol()Default constructor. -
WeatherSymbol
public WeatherSymbol(int x, int y) Create aWeatherSymbolat the position indicated.- Parameters:
x- x coordinatey- y coordinate
-
WeatherSymbol
Create aWeatherSymbolon the canvas specified at the position indicated.- Parameters:
canvas- canvas for displaying this symbolx- x coordinatey- y coordinate
-
WeatherSymbol
Create aWeatherSymbolat the position indicated and use the name and description supplied.- Parameters:
x- x coordinatey- y coordinateparam- parameter nameparamDesc- parameter description (used in labels, widgets)
-
WeatherSymbol
Create aWeatherSymboloncanvasat the position indicated and use the name and description supplied.- Parameters:
canvas- canvas for displaying this symbolx- x coordinatey- y coordinateparam- parameter nameparamDesc- parameter description (used in labels, widgets)
-
-
Method Details
-
getLabel
Get the label to show the user -
imageUpdate
This method is called when information about an image which was previously requested using an asynchronous interface becomes available, public due do implementingImageObserver.- Specified by:
imageUpdatein interfaceImageObserver- Parameters:
img- image being observedflags- information flagsx- x coordinatey- y coordinatewidth- the widthheight- the height- Returns:
falseif the infoflags indicate that the image is completely loaded;trueotherwise.
-
setSymbolType
public void setSymbolType(int value) Set the type of symbol that this is.- Parameters:
value- symbol type (e.g., SYMBOL_LOWCLOUD)
-
getLines
Gets the VisADLineArray that corresponds to the index for the symbol type.- Parameters:
index- index for this symbolType.- Returns:
- VisADLineArray corresponding to this symbol
- See Also:
-
getLines
Gets the VisADLineArray that corresponds to the code for the symbol type.- Parameters:
symbolType- type of symbolcode- code for the particular item in this symbol type- Returns:
- VisADLineArray corresponding to this symbol
- See Also:
-
getParamValue
Get the value for the parameter at the particular index. Since this objection only has one value, it is returned.- Overrides:
getParamValuein classMetSymbol- Parameters:
index- parameter index (ignored)- Returns:
- symbol code for this symbolType as an
Integer
-
setParamValue
Set the value for the parameter at the particular index. Since this objection only has one value, it is set with the input.- Overrides:
setParamValuein classMetSymbol- Parameters:
index- parameter index (ignored)v- value (String version of integer code)
-
getSymbolType
public int getSymbolType()Get the symbol type for thisWeatherSymbol. Used primarily for persistence.- Returns:
- symbol type (e.g., SYMBOL_LOWCLOUD)
-
setCode
public void setCode(int value) Set the code (index) for this symbol type. Used primarily for XML persistence.- Parameters:
value- code for the index for this symbol type.- See Also:
-
getCode
public int getCode()Get the code (index) for this symbol type. Used primarily for XML persistence.- Returns:
- code for the index for this symbol type.
- See Also:
-
getStretchy
public boolean getStretchy()Get whether thisMetSymbolcan be stretched or not.- Overrides:
getStretchyin classGlyph- Returns:
- true if can be stretched.
-
getEqualSides
public boolean getEqualSides()Get whether thisMetSymbolhas equals sides (width and height).- Overrides:
getEqualSidesin classRectangleGlyph- Returns:
- true
-
getSymetricReshape
public boolean getSymetricReshape()Get whether thisMetSymbolshould be stretched symetrically or not.- Overrides:
getSymetricReshapein classRectangleGlyph- Returns:
- true
-
draw
Draw this object to the graphics device. -
setAttr
Set the attribute with the value supplied.
-