ucar.unidata.ui.symbol
Class MappedShapeSymbol

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.ShapeSymbol
                  extended by ucar.unidata.ui.symbol.MappedShapeSymbol
All Implemented Interfaces:
Cloneable

public class MappedShapeSymbol
extends ShapeSymbol

This is a symbol that holds a list of ShapeMap-s. It allows us to map a string pattern to a particular shape type. For example, if a point obs has a filed: aircraft_type which can contain the values:

 military
 glider
 civilian
 ...
 
This symbol could hold the shape maps:
 military -> triangle
 glider -> circle
 civilian->square
 ...
 

Version:
$Revision: 1.8 $
Author:
Metapps development team

Field Summary
 
Fields inherited from class ucar.unidata.ui.symbol.ShapeSymbol
ATTR_POINTS, ATTR_SHAPE, ATTR_SHAPETYPE, TYPE_LINE, TYPE_QUAD, TYPE_TRIANGLE
 
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
MappedShapeSymbol()
          Default constructor.
MappedShapeSymbol(DisplayCanvas canvas, int x, int y)
          Construct a ShapeSymbol to use on the canvas specified at the position specified.
MappedShapeSymbol(int x, int y)
          Construct a ShapeSymbol without a canvas at the position specified.
 
Method Summary
protected  void applyProperties()
          Apply properties from the properties dialog.
 boolean doAllObs()
          Should this symbol do all of the observations.
 String getLabel()
          Get the label
 List getShapeMappings()
          Get the ShapeMappings property.
protected  void initPropertyComponents(List comps)
          Add any components to the list of widgets for the main property 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.
 void setShapeMappings(List value)
          Set the ShapeMappings property.
protected  boolean showDisplayUnitInProperties()
          Should we show the display unit widget in the properties dialog
 
Methods inherited from class ucar.unidata.ui.symbol.ShapeSymbol
draw, getEqualSides, getParamValue, getPoints, getShape, getShapeType, getStretchy, initialize, makeShapePropertyComponents, makeShapes, setParamValue, setPoints, setShape, setShapeType, setStretchy
 
Methods 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, 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, showPropertiesDialog, toString
 
Methods inherited from class ucar.unidata.ui.drawing.RectangleGlyph
distance, getBottom, getBounds, 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, getXml, initDone, makeAttr, notifyChange, paintHighlight, paintSelectionPoints, pickable, processAttrs, setBackground, setBeingCreated, setFilled, setForeground, setId, setLineWidth, setParent, stretchTo, stretchTo, toRect, transformOutput, transformOutput, transformOutputX, transformOutputY
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MappedShapeSymbol

public MappedShapeSymbol()
Default constructor.


MappedShapeSymbol

public MappedShapeSymbol(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 position
y - y position

MappedShapeSymbol

public MappedShapeSymbol(DisplayCanvas canvas,
                         int x,
                         int y)
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 canvas
y - y position on the canvas
Method Detail

getLabel

public String getLabel()
Get the label

Overrides:
getLabel in class ShapeSymbol
Returns:
Label for gui

initPropertyComponents

protected void initPropertyComponents(List comps)
Add any components to the list of widgets for the main property dialog tab.

Overrides:
initPropertyComponents in class ShapeSymbol
Parameters:
comps - List of components.

applyProperties

protected void applyProperties()
Apply properties from the properties dialog.

Overrides:
applyProperties in class ShapeSymbol

doAllObs

public boolean doAllObs()
Should this symbol do all of the observations. Used by the StationModelDisplayable to determine if makeShapes should be called.

Overrides:
doAllObs in class ShapeSymbol
Returns:
Do all obs - true.

makeShapes

public VisADGeometryArray[] makeShapes(Data[] dataArray,
                                       PointOb ob)
                                throws Exception
If this symbol is not one of the 'known' symbols then this method is called to create the shapes.

Overrides:
makeShapes in class MetSymbol
Parameters:
dataArray - The array of data objects. May have 0 or more data depending on the paramids.
ob - The observation
Returns:
The shapes
Throws:
Exception - On badness

showDisplayUnitInProperties

protected boolean showDisplayUnitInProperties()
Should we show the display unit widget in the properties dialog

Overrides:
showDisplayUnitInProperties in class MetSymbol
Returns:
true

setShapeMappings

public void setShapeMappings(List value)
Set the ShapeMappings property.

Parameters:
value - The new value for ShapeMappings

getShapeMappings

public List getShapeMappings()
Get the ShapeMappings property.

Returns:
The ShapeMappings