public class ShapeGlyph extends LineGlyph
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_SHAPETYPE
Xml attribute name
|
static int |
SHAPE_DIAMOND
Shape type
|
static int |
SHAPE_HARROW
Shape type
|
static int |
SHAPE_LINE
Shape type
|
static java.lang.String[] |
SHAPE_NAMES
Shape type names
|
static int |
SHAPE_OVAL
Shape type
|
static int |
SHAPE_RECTANGLE
Shape type
|
static int |
SHAPE_VARROW
Shape type
|
static int[] |
SHAPES
Shape types
|
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 and Description |
---|
ShapeGlyph()
Ctor
|
ShapeGlyph(DrawingControl control,
visad.DisplayEvent event)
The ctor
|
ShapeGlyph(DrawingControl control,
visad.DisplayEvent event,
int shapeType)
The ctor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAttributes(org.w3c.dom.Element e)
Populate the xml node with attrs
|
boolean |
canShowArea()
Can we display area
|
boolean |
canShowDistance()
Can we display distance
|
protected boolean |
constrainedTo2D()
Is glyph constrained to 2d
|
java.lang.String |
getDescription()
Get the description of this glyph
|
protected int |
getNumInterpolationPoints()
By default we don't interpolate
|
int |
getShapeType()
Get the shape type
|
java.lang.String |
getTagName()
Get xml tag name to use
|
java.lang.String |
getTypeName()
Name to use for this glyph
|
DrawingGlyph |
handleMouseDragged(visad.DisplayEvent event)
Handle event
|
DrawingGlyph |
handleMousePressed(visad.DisplayEvent event)
Handle event
|
void |
initFromXml(DrawingControl control,
org.w3c.dom.Element node)
Init from xml
|
static float[][] |
interpolate(int cnt,
float[] startXYZ,
float[] endXYZ)
Utility to interpolate cnt number of times between the start and end points
|
boolean |
isValid()
Do we have a valid number of points
|
static float[][] |
makeRectangle(float[][] lineVals)
Utility to make a rectangle from 2 points
|
static java.awt.geom.Rectangle2D.Float |
makeRectangle2D(float[][] pts)
Make a rectangle from the points
|
void |
setShapeType(int s)
Set the shapea
|
void |
updateLocation()
The glyph moved.
|
applyProperties, createDisplayable, getLineWidth, getPropertiesComponents, initFinalInner, initFromUser, setLineWidth
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
public static final java.lang.String ATTR_SHAPETYPE
public static final int SHAPE_RECTANGLE
public static final int SHAPE_OVAL
public static final int SHAPE_LINE
public static final int SHAPE_DIAMOND
public static final int SHAPE_HARROW
public static final int SHAPE_VARROW
public static final int[] SHAPES
public static final java.lang.String[] SHAPE_NAMES
public ShapeGlyph()
public ShapeGlyph(DrawingControl control, visad.DisplayEvent event) throws visad.VisADException, java.rmi.RemoteException
control
- The control I'm in.event
- The display event.java.rmi.RemoteException
- When bad things happenvisad.VisADException
- When bad things happenpublic ShapeGlyph(DrawingControl control, visad.DisplayEvent event, int shapeType) throws visad.VisADException, java.rmi.RemoteException
control
- The control I'm in.event
- The display event.shapeType
- The shape typejava.rmi.RemoteException
- When bad things happenvisad.VisADException
- When bad things happenpublic boolean canShowDistance()
canShowDistance
in class DrawingGlyph
public boolean canShowArea()
canShowArea
in class DrawingGlyph
public boolean isValid()
isValid
in class DrawingGlyph
public DrawingGlyph handleMouseDragged(visad.DisplayEvent event) throws visad.VisADException, java.rmi.RemoteException
handleMouseDragged
in class DrawingGlyph
event
- The display event.java.rmi.RemoteException
- When bad things happenvisad.VisADException
- When bad things happenpublic void initFromXml(DrawingControl control, org.w3c.dom.Element node) throws visad.VisADException, java.rmi.RemoteException
initFromXml
in class LineGlyph
control
- The control I'm in.node
- The xml nodejava.rmi.RemoteException
- On badnessvisad.VisADException
- On badnessprotected boolean constrainedTo2D()
constrainedTo2D
in class DrawingGlyph
protected void addAttributes(org.w3c.dom.Element e)
addAttributes
in class LineGlyph
e
- Xml nodepublic java.lang.String getTagName()
getTagName
in class DrawingGlyph
protected int getNumInterpolationPoints()
public static float[][] interpolate(int cnt, float[] startXYZ, float[] endXYZ)
cnt
- Number of interpolation points inculding start and end pointstartXYZ
- Start pointendXYZ
- End pointpublic void updateLocation() throws visad.VisADException, java.rmi.RemoteException
updateLocation
in class DrawingGlyph
java.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic static float[][] makeRectangle(float[][] lineVals)
lineVals
- The 2 pointspublic static java.awt.geom.Rectangle2D.Float makeRectangle2D(float[][] pts)
pts
- the pointspublic DrawingGlyph handleMousePressed(visad.DisplayEvent event) throws visad.VisADException, java.rmi.RemoteException
handleMousePressed
in class DrawingGlyph
event
- The display event.java.rmi.RemoteException
- When bad things happenvisad.VisADException
- When bad things happenpublic java.lang.String getTypeName()
getTypeName
in class DrawingGlyph
public java.lang.String getDescription()
getDescription
in class DrawingGlyph
public int getShapeType()
public void setShapeType(int s)
s
- Shape type