Package ucar.unidata.idv.control.drawing
Class ShapeGlyph
java.lang.Object
ucar.unidata.idv.control.drawing.DrawingGlyph
ucar.unidata.idv.control.drawing.LineGlyph
ucar.unidata.idv.control.drawing.ShapeGlyph
- Direct Known Subclasses:
TransectGlyph
Class ShapeGlyph. Displays a shape.
- Version:
- $Revision: 1.33 $
- Author:
- IDV Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXml attribute namestatic final intShape typestatic final intShape typestatic final intShape typestatic final String[]Shape type namesstatic final intShape typestatic final intShape typestatic final intShape typestatic final int[]Shape typesFields inherited from class ucar.unidata.idv.control.drawing.DrawingGlyph
actualPoints, ATTR_BGCOLOR, ATTR_COLOR, ATTR_COORDTYPE, ATTR_FILLED, ATTR_FULLLATLON, ATTR_LINEWIDTH, ATTR_NAME, ATTR_PICKABLE, ATTR_POINTS, ATTR_TEXT, ATTR_TIMEFORMAT, ATTR_TIMES, ATTR_ZPOSITION, control, COORD_LABELS, COORD_LATLON, COORD_LATLONALT, COORD_LONLAT, COORD_NONE, COORD_TYPENAMES, COORD_TYPES, COORD_XY, COORD_XYZ, coordType, firstMoveEarthLocation, firstMoveLocation, IDX_ALT, IDX_LAT, IDX_LON, IDX_X, IDX_Y, IDX_Z, oldVisibility, parentDisplayable, points, propDialog, propertiesUp, PT_X, PT_Y, PT_Z, selectionDisplayable, stretchIndex, tabbedPane, TAG_ARROW, TAG_FRONT, TAG_HIGH, TAG_IMAGE, TAG_LOW, TAG_MOVIE, TAG_POLYGON, TAG_SHAPE, TAG_SYMBOL, TAG_TEXT, uniqueCnt, zPosition -
Constructor Summary
ConstructorsConstructorDescriptionCtorShapeGlyph(DrawingControl control, DisplayEvent event) The ctorShapeGlyph(DrawingControl control, DisplayEvent event, int shapeType) The ctor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPopulate the xml node with attrsbooleanCan we display areabooleanCan we display distanceprotected booleanIs glyph constrained to 2dGet the description of this glyphprotected intBy default we don't interpolateintGet the shape typeGet xml tag name to useName to use for this glyphhandleMouseDragged(DisplayEvent event) Handle eventhandleMousePressed(DisplayEvent event) Handle eventvoidinitFromXml(DrawingControl control, Element node) Init from xmlstatic float[][]interpolate(int cnt, float[] startXYZ, float[] endXYZ) Utility to interpolate cnt number of times between the start and end pointsbooleanisValid()Do we have a valid number of pointsstatic float[][]makeRectangle(float[][] lineVals) Utility to make a rectangle from 2 pointsstatic Rectangle2D.FloatmakeRectangle2D(float[][] pts) Make a rectangle from the pointsvoidsetShapeType(int s) Set the shapeavoidThe glyph moved.Methods inherited from class ucar.unidata.idv.control.drawing.LineGlyph
applyProperties, createDisplayable, getLineWidth, getPropertiesComponents, initFinalInner, initFromUser, setLineWidthMethods inherited from class ucar.unidata.idv.control.drawing.DrawingGlyph
addDisplayable, addTime, checkTimeVisibility, checkVisibility, closestPoint, distance, distanceBetween, distanceBetween, doDeletePoint, doInterpolatedStretch, doMove, doneBeingCreated, doStretch, evaluateJython, getArea, getAreaString, getBeenRemoved, getBeingCreated, getBgcolor, getBoundingBox, getBoxPoint, getBoxPoint, getBoxPoint, getColor, getCoordType, getCreatedByUser, getDefaultZPosition, getDisplayable, getDistance, getEditable, getElement, getExtraDescription, getFilled, getFixedAltitude, getFullLatLon, getIsRaster, getLatLons, getLatLons, getName, getParent, getPickable, getPoint, getPoints, getPointValues, getPointValues, getPointValuesDouble, getPointValuesDouble, getSelectionPoints, getTimeField, getTimePropertiesComponents, getTimeValues, getVisibleFlag, getZPosition, handleCreation, handleKeyPressed, handleMouseMoved, handleMouseReleased, hide, initFinal, initFromBundle, initMove, initStretch, isFrontDisplay, isInFlatSpace, isInLatLonSpace, isInXYSpace, isSelectable, isVisible, makePoint, mousePressed, moveTo, processPointStrings, processPointStrings, projectionChanged, removeDisplayable, setActualPoints, setBeenRemoved, setBgcolor, setColor, setColor, setCoordType, setCreatedByUser, setEditable, setFilled, setFullLatLon, setName, setPickable, setPoints, setProperties, setSelected, setTimeValues, setVisible, setVisibleFlag, setZPosition, shouldShowBgColorSelector, shouldShowColorSelector, show, smoothCurve, squared, swap, swap, toLatLonAlt, toString, tryToFill, viewpointChanged, writePoints
-
Field Details
-
ATTR_SHAPETYPE
Xml attribute name- See Also:
-
SHAPE_RECTANGLE
public static final int SHAPE_RECTANGLEShape type- See Also:
-
SHAPE_OVAL
public static final int SHAPE_OVALShape type- See Also:
-
SHAPE_LINE
public static final int SHAPE_LINEShape type- See Also:
-
SHAPE_DIAMOND
public static final int SHAPE_DIAMONDShape type- See Also:
-
SHAPE_HARROW
public static final int SHAPE_HARROWShape type- See Also:
-
SHAPE_VARROW
public static final int SHAPE_VARROWShape type- See Also:
-
SHAPES
public static final int[] SHAPESShape types -
SHAPE_NAMES
Shape type names
-
-
Constructor Details
-
ShapeGlyph
public ShapeGlyph()Ctor -
ShapeGlyph
public ShapeGlyph(DrawingControl control, DisplayEvent event) throws VisADException, RemoteException The ctor- Parameters:
control- The control I'm in.event- The display event.- Throws:
RemoteException- When bad things happenVisADException- When bad things happen
-
ShapeGlyph
public ShapeGlyph(DrawingControl control, DisplayEvent event, int shapeType) throws VisADException, RemoteException The ctor- Parameters:
control- The control I'm in.event- The display event.shapeType- The shape type- Throws:
RemoteException- When bad things happenVisADException- When bad things happen
-
-
Method Details
-
canShowDistance
public boolean canShowDistance()Can we display distance- Overrides:
canShowDistancein classDrawingGlyph- Returns:
- can do distance
-
canShowArea
public boolean canShowArea()Can we display area- Overrides:
canShowAreain classDrawingGlyph- Returns:
- can do area
-
isValid
public boolean isValid()Do we have a valid number of points- Overrides:
isValidin classDrawingGlyph- Returns:
- Is this glyph valid
-
handleMouseDragged
Handle event- Overrides:
handleMouseDraggedin classDrawingGlyph- Parameters:
event- The display event.- Returns:
- This or null
- Throws:
RemoteException- When bad things happenVisADException- When bad things happen
-
initFromXml
public void initFromXml(DrawingControl control, Element node) throws VisADException, RemoteException Init from xml- Overrides:
initFromXmlin classLineGlyph- Parameters:
control- The control I'm in.node- The xml node- Throws:
RemoteException- On badnessVisADException- On badness
-
constrainedTo2D
protected boolean constrainedTo2D()Is glyph constrained to 2d- Overrides:
constrainedTo2Din classDrawingGlyph- Returns:
- Constrained to 2d
-
addAttributes
Populate the xml node with attrs- Overrides:
addAttributesin classLineGlyph- Parameters:
e- Xml node
-
getTagName
Get xml tag name to use- Specified by:
getTagNamein classDrawingGlyph- Returns:
- Xml tag name
-
getNumInterpolationPoints
protected int getNumInterpolationPoints()By default we don't interpolate- Returns:
- 0
-
interpolate
public static float[][] interpolate(int cnt, float[] startXYZ, float[] endXYZ) Utility to interpolate cnt number of times between the start and end points- Parameters:
cnt- Number of interpolation points inculding start and end pointstartXYZ- Start pointendXYZ- End point- Returns:
- Interpolated points
-
updateLocation
The glyph moved. Update location.- Overrides:
updateLocationin classDrawingGlyph- Throws:
RemoteException- On badnessVisADException- On badness
-
makeRectangle
public static float[][] makeRectangle(float[][] lineVals) Utility to make a rectangle from 2 points- Parameters:
lineVals- The 2 points- Returns:
- 5 points
-
makeRectangle2D
Make a rectangle from the points- Parameters:
pts- the points- Returns:
- the rectangle
-
handleMousePressed
Handle event- Overrides:
handleMousePressedin classDrawingGlyph- Parameters:
event- The display event.- Returns:
- This or null
- Throws:
RemoteException- When bad things happenVisADException- When bad things happen
-
getTypeName
Name to use for this glyph- Specified by:
getTypeNamein classDrawingGlyph- Returns:
- The glyph type name
-
getDescription
Get the description of this glyph- Overrides:
getDescriptionin classDrawingGlyph- Returns:
- The description
-
getShapeType
public int getShapeType()Get the shape type- Returns:
- Shape type
-
setShapeType
public void setShapeType(int s) Set the shapea- Parameters:
s- Shape type
-