|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.idv.control.drawing.DrawingGlyph
public abstract class DrawingGlyph
Class Glyph. Base class for all drawing things
| Field Summary | |
|---|---|
protected List |
actualPoints
actual points being displayed |
static String |
ATTR_COLOR
xml attribute name |
static String |
ATTR_COORDTYPE
xml attribute name |
static String |
ATTR_FILLED
xml attribute name |
static String |
ATTR_FULLLATLON
xml attribute name |
static String |
ATTR_LINEWIDTH
xml attribute name |
static String |
ATTR_NAME
xml attribute name |
static String |
ATTR_PICKABLE
xml attribute name |
static String |
ATTR_POINTS
xml attribute name |
static String |
ATTR_TEXT
xml attr names |
static String |
ATTR_TIMES
xml attribute name |
static String |
ATTR_ZPOSITION
xml attribute name |
protected DrawingControl |
control
My control |
static String[] |
COORD_LABELS
labels for coordinate syste type. |
static int |
COORD_LATLON
Represents LAT/LON vertical coordinate |
static int |
COORD_LATLONALT
Represents LAT/LON/ALT vertical coordinate |
static int |
COORD_NONE
Represents no vertical coordinate |
static String[] |
COORD_TYPENAMES
Drawing coordinate names |
static int[] |
COORD_TYPES
Drawing coordinate types |
static int |
COORD_XY
Represents XY vertical coordinate |
static int |
COORD_XYZ
Represents XYZ vertical coordinate |
protected int |
coordType
What drawing coord system are we on |
protected EarthLocation |
firstMoveEarthLocation
Where did we start moving |
protected double[] |
firstMoveLocation
Where did we start moving |
static int |
IDX_ALT
Indices into arrays |
static int |
IDX_LAT
Indices into arrays |
static int |
IDX_LON
Indices into arrays |
static int |
IDX_X
Indices into arrays |
static int |
IDX_Y
Indices into arrays |
static int |
IDX_Z
Indices into arrays |
protected CompositeDisplayable |
parentDisplayable
Top level displayable |
protected List |
points
List of points. |
protected JDialog |
propDialog
The properties dialog |
protected boolean |
propertiesUp
Is properties dialog shown |
static int |
PT_X
Indices into arrays |
static int |
PT_Y
Indices into arrays |
static int |
PT_Z
Indices into arrays |
protected CompositeDisplayable |
selectionDisplayable
Shows selected highlight |
protected int |
stretchIndex
What point are we stretching |
protected JTabbedPane |
tabbedPane
For props |
static String |
TAG_ARROW
Xml tag name |
static String |
TAG_FRONT
Xml tag name |
static String |
TAG_HIGH
Xml tag name |
static String |
TAG_IMAGE
Xml tag name |
static String |
TAG_LOW
Xml tag name |
static String |
TAG_MOVIE
Xml tag name |
static String |
TAG_POLYGON
Xml tag name |
static String |
TAG_SHAPE
Xml tag name |
static String |
TAG_SYMBOL
Xml tag name |
static String |
TAG_TEXT
Xml tag name |
protected static int |
uniqueCnt
For unique ids |
protected float |
zPosition
Fixed z position |
| Constructor Summary | |
|---|---|
DrawingGlyph()
Ctor |
|
DrawingGlyph(DrawingControl control,
DisplayEvent event)
Ctor |
|
DrawingGlyph(DrawingControl control,
DisplayEvent event,
boolean filled)
Ctor |
|
| Method Summary | |
|---|---|
protected void |
addAttributes(Element e)
Populate the xml node with attrs |
protected void |
addDisplayable(Displayable displayable)
Add the displayable to the main parent displayable |
void |
addTime(Real time)
Add the time to the list of times |
protected boolean |
applyProperties(Hashtable compMap)
Handle the property apply. |
boolean |
canShowArea()
Can this glyph type calculate area |
boolean |
canShowDistance()
Can this glyph type calculate distance |
void |
checkTimeVisibility()
Is this glyph visible in the current time step |
void |
checkVisibility()
Make sure the displayable is not visible if this glyph is not visible |
int |
closestPoint(double[] location,
List points)
Find index of closest point |
protected boolean |
constrainedTo2D()
Is glyph constrained to 2d |
double |
distance(double[] location,
double[] direction)
Calculate distance |
static double |
distanceBetween(double[] origin,
double[] loc2)
Get distance between |
double |
distanceBetween(double[] loc1,
EarthLocation el)
Get distance |
protected void |
doInterpolatedStretch(DisplayEvent event)
This stretches the current point and also stretches the rest of the points by a linear delta from the initial point. |
void |
doMove(DisplayEvent event)
Move this glyph |
void |
doneBeingCreated()
all done |
void |
doStretch(DisplayEvent event)
Stretch this glyph |
void |
evaluateJython()
Evaluate the jython from the properties dialog |
double |
getArea()
Get the area in square feet. |
boolean |
getBeenRemoved()
Get the BeenRemoved property. |
boolean |
getBeingCreated()
currently being created |
protected List |
getBoundingBox(List points)
Find bounding box of points |
protected double[] |
getBoxPoint(int i)
Get xyz of point at given index |
protected double[] |
getBoxPoint(int i,
List l)
Get xyz of point at given index |
protected double[] |
getBoxPoint(Object point)
Convert point (either latlonalt or xyz) to xyz |
Color |
getColor()
Get the Color property. |
int |
getCoordType()
Get the CoordType property. |
boolean |
getCreatedByUser()
Get the CreatedByUser property. |
protected float |
getDefaultZPosition()
Get the default Z position for the glyph. |
String |
getDescription()
Get the description |
Displayable |
getDisplayable()
Get the main displayable. |
Real |
getDistance()
Calculate the distance along the line |
boolean |
getEditable()
Get the Editable property. |
Element |
getElement(Document doc)
Create an xml element that represents this glyph |
String |
getExtraDescription()
Get extra description to show in the JTable |
boolean |
getFilled()
Get the Filled property. |
protected double |
getFixedAltitude()
Get altitude of zposition |
boolean |
getFullLatLon()
Get the FullLatLon property. |
protected float[][] |
getLatLons(List points)
Convert points list of array of xyz or lat/lon/alt |
String |
getName()
Get the Name property. |
protected CompositeDisplayable |
getParent()
Get the main displayable. |
boolean |
getPickable()
Get the Pickable property. |
protected Object |
getPoint(DisplayEvent event)
Get point to use from the event. |
List |
getPoints()
Get the Points property. |
protected float[][] |
getPointValues()
Convert points list of array of xyz or lat/lon/alt |
protected float[][] |
getPointValues(boolean convertToXY)
Convert points list of array of xyz or lat/lon/alt |
protected double[][] |
getPointValuesDouble()
Convert points list of array of xyz or lat/lon/alt |
protected double[][] |
getPointValuesDouble(boolean convertToXY)
Convert points list of array of xyz or lat/lon/alt |
protected void |
getPropertiesComponents(List comps,
Hashtable compMap)
Make the properties widgets |
protected List |
getSelectionPoints()
Get points used to select this glyph. |
abstract String |
getTagName()
Get xml tag name to use |
protected Data |
getTimeField(Data data)
Make the time field if we have time values If not, just return the data |
protected void |
getTimePropertiesComponents(List comps,
Hashtable compMap)
Add to the comps array the time list for selecting times |
List |
getTimeValues()
Get the TimeValue property. |
abstract String |
getTypeName()
Get the name of this glyph type |
boolean |
getVisibleFlag()
Get the VisibleFlag property. |
float |
getZPosition()
Get the ZPosition property. |
DrawingGlyph |
handleCreation(DisplayEvent event)
Handle the creation event. |
DrawingGlyph |
handleKeyPressed(DisplayEvent event)
Handle event. |
DrawingGlyph |
handleMouseDragged(DisplayEvent event)
Handle event. |
DrawingGlyph |
handleMouseMoved(DisplayEvent event)
Handle the event. |
DrawingGlyph |
handleMousePressed(DisplayEvent event)
Handle the event. |
DrawingGlyph |
handleMouseReleased(DisplayEvent event)
Handle event. |
void |
hide()
Hide glyph |
boolean |
initFinal()
Do final initialization |
protected boolean |
initFinalInner()
This is called to do final initialization |
void |
initFromBundle(DrawingControl control)
Initialize when recreated from a bundle |
boolean |
initFromUser(DrawingControl control,
DisplayEvent event)
Initialize from a user event. |
void |
initFromXml(DrawingControl control,
Element node)
Initialize from xml |
void |
initMove(DisplayEvent event)
Started moving |
void |
initStretch(DisplayEvent event)
Start streth |
boolean |
isInFlatSpace()
Are we drawing in xy or lat/lon space |
boolean |
isInLatLonSpace()
In lat/lon or lat/lon/alt space |
boolean |
isInXYSpace()
Are we drawing in xy or xyz space |
boolean |
isSelectable()
Is this glyph selectable |
boolean |
isValid()
Is this glyph valid. |
boolean |
isVisible()
Is this glyph visible |
protected EarthLocation |
makePoint(double lat,
double lon,
double alt)
Utility to make a point |
boolean |
mousePressed(DisplayEvent event)
handle event |
protected void |
moveTo(DisplayEvent event)
Move this glyph to the location of the event |
void |
processPointStrings(List pointStrings)
Parse the List of point strings. |
void |
projectionChanged()
Handle event |
protected void |
removeDisplayable(Displayable displayable)
Remove the displayable from the main displayable |
protected void |
setActualPoints(float[][] pts)
Set the points list |
void |
setBeenRemoved(boolean value)
Set the BeenRemoved property. |
void |
setColor(Color value)
Set the Color property. |
protected void |
setColor(Displayable displayable,
Color c)
Set color on displayable |
void |
setCoordType(int value)
Set the CoordType property. |
void |
setCreatedByUser(boolean value)
Set the CreatedByUser property. |
void |
setEditable(boolean value)
Set the Editable property. |
void |
setFilled(boolean value)
Set the Filled property. |
void |
setFullLatLon(boolean value)
Set the Fulllatlon property. |
void |
setName(String value)
Set the Name property. |
void |
setPickable(boolean value)
Set the Pickable property. |
void |
setPoints(List value)
Set the Points property. |
void |
setProperties()
Set the properties from the dialog |
void |
setSelected(boolean selected)
Set this glyph selected |
void |
setTimeValues(List value)
Set the TimeValue property. |
void |
setVisible(boolean visible)
Toggle visiblity of the displayable |
void |
setVisibleFlag(boolean value)
Set the VisibleFlag property. |
void |
setZPosition(float value)
Set the Zposition property. |
protected boolean |
shouldShowColorSelector()
Should show color selector in properties |
void |
show()
Show glyph |
static double[][] |
smoothCurve(double[][] curve,
int window)
Smooth the curve |
static double |
squared(double v1)
Square value |
protected void |
swap(double[] a1,
double[] a2,
int index)
Swap array values at index |
protected void |
swap(float[] a1,
float[] a2,
int index)
Swap array values at index |
protected float[] |
toLatLonAlt(EarthLocation el)
Convert to float array |
String |
toString()
to string |
protected Data |
tryToFill(float[][] pts,
Data dflt)
Try to fill the pts array |
void |
updateLocation()
Glyph moved. |
void |
viewpointChanged()
viewpoint changed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static int uniqueCnt
public static final String TAG_POLYGON
public static final String TAG_ARROW
public static final String TAG_FRONT
public static final String TAG_TEXT
public static final String TAG_HIGH
public static final String TAG_LOW
public static final String TAG_SHAPE
public static final String TAG_SYMBOL
public static final String TAG_IMAGE
public static final String TAG_MOVIE
public static final String ATTR_COLOR
public static final String ATTR_FILLED
public static final String ATTR_PICKABLE
public static final String ATTR_FULLLATLON
public static final String ATTR_TIMES
public static final String ATTR_ZPOSITION
public static final String ATTR_COORDTYPE
public static final String ATTR_POINTS
public static final String ATTR_LINEWIDTH
public static final String ATTR_TEXT
public static final String ATTR_NAME
public static final int COORD_NONE
public static final int COORD_XYZ
public static final int COORD_XY
public static final int COORD_LATLONALT
public static final int COORD_LATLON
public static final int[] COORD_TYPES
public static final String[] COORD_TYPENAMES
public static final String[] COORD_LABELS
protected boolean propertiesUp
protected JDialog propDialog
protected JTabbedPane tabbedPane
protected List points
protected int stretchIndex
protected double[] firstMoveLocation
protected List actualPoints
protected EarthLocation firstMoveEarthLocation
public static final int PT_X
public static final int PT_Y
public static final int PT_Z
public static final int IDX_X
public static final int IDX_Y
public static final int IDX_Z
public static final int IDX_LAT
public static final int IDX_LON
public static final int IDX_ALT
protected int coordType
protected float zPosition
protected CompositeDisplayable parentDisplayable
protected CompositeDisplayable selectionDisplayable
protected DrawingControl control
| Constructor Detail |
|---|
public DrawingGlyph()
public DrawingGlyph(DrawingControl control,
DisplayEvent event)
control - The control I'm inevent - The display event.
public DrawingGlyph(DrawingControl control,
DisplayEvent event,
boolean filled)
control - The control I'm inevent - The display event.filled - Is this glyph filled| Method Detail |
|---|
public final boolean initFinal()
throws VisADException,
RemoteException
RemoteException - On badness
VisADException - On badness
protected boolean initFinalInner()
throws VisADException,
RemoteException
RemoteException - On badness
VisADException - On badness
public boolean initFromUser(DrawingControl control,
DisplayEvent event)
throws VisADException,
RemoteException
control - The control I'm inevent - The display event.
RemoteException - When bad things happen
VisADException - When bad things happen
public void initFromBundle(DrawingControl control)
throws VisADException,
RemoteException
control - The control I'm in
RemoteException - When bad things happen
VisADException - When bad things happen
public void initFromXml(DrawingControl control,
Element node)
throws VisADException,
RemoteException
control - The control I'm innode - The xml node
RemoteException - When bad things happen
VisADException - When bad things happenpublic boolean isSelectable()
protected float getDefaultZPosition()
public boolean isValid()
public void processPointStrings(List pointStrings)
throws VisADException,
RemoteException
pointStrings - List of Strings that represent double location values
RemoteException - On badness
VisADException - On badness
public boolean mousePressed(DisplayEvent event)
throws VisADException,
RemoteException
event - event
RemoteException - On badness
VisADException - On badness
public void setSelected(boolean selected)
throws VisADException,
RemoteException
selected - Is selected
RemoteException - On badness
VisADException - On badnessprotected List getSelectionPoints()
public final Element getElement(Document doc)
doc - The doc to create with
protected Data getTimeField(Data data)
throws VisADException,
RemoteException
data - the data to make the range of the time field with
RemoteException - On badness
VisADException - On badnessprotected void addAttributes(Element e)
e - Xml nodepublic abstract String getTagName()
public abstract String getTypeName()
public String getDescription()
public String getExtraDescription()
public Displayable getDisplayable()
throws VisADException,
RemoteException
RemoteException - On badness
VisADException - On badness
protected CompositeDisplayable getParent()
throws VisADException,
RemoteException
RemoteException - On badness
VisADException - On badness
protected void addDisplayable(Displayable displayable)
throws VisADException,
RemoteException
displayable - The displayable to add
RemoteException - On badness
VisADException - On badness
protected void removeDisplayable(Displayable displayable)
throws VisADException,
RemoteException
displayable - The displayable to remove
RemoteException - On badness
VisADException - On badnesspublic void addTime(Real time)
time - The timepublic void setTimeValues(List value)
value - The new value for TimeValuepublic List getTimeValues()
public void checkTimeVisibility()
throws VisADException,
RemoteException
RemoteException - When bad things happen
VisADException - When bad things happen
public void setVisible(boolean visible)
throws VisADException,
RemoteException
visible - Is visible
RemoteException - When bad things happen
VisADException - When bad things happenpublic boolean isVisible()
public void checkVisibility()
protected boolean constrainedTo2D()
public void setCoordType(int value)
value - The new value for CoordTypepublic int getCoordType()
public boolean isInXYSpace()
public boolean isInFlatSpace()
public boolean isInLatLonSpace()
protected Object getPoint(DisplayEvent event)
throws VisADException,
RemoteException
event - The display event.