ucar.unidata.idv.control.drawing
Class DrawingGlyph

java.lang.Object
  extended by ucar.unidata.idv.control.drawing.DrawingGlyph
Direct Known Subclasses:
HighLowGlyph, ImageGlyph, LineGlyph, MovieGlyph, SymbolGlyph, TextGlyph

public abstract class DrawingGlyph
extends Object

Class Glyph. Base class for all drawing things

Version:
$Revision: 1.92 $
Author:
IDV Development Team

Field Summary
protected  List actualPoints
          actual points being displayed
static String ATTR_BGCOLOR
           
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_TIMEFORMAT
          xml attribute for time format
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
 boolean oldVisibility
          flag
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
 void doDeletePoint(DisplayEvent event)
          delete the point nearest the event
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.
 String getAreaString()
          get string representation of the area for showing the user
 boolean getBeenRemoved()
          Get the BeenRemoved property.
 boolean getBeingCreated()
          currently being created
 Color getBgcolor()
          Get the Bgcolor property.
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.
 boolean getIsRaster()
          is this glyph a raster thing
 float[][] getLatLons()
          get the points as an array of lat/lons
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
protected  boolean isFrontDisplay()
          Is the control a front display
 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 setBgcolor(Color value)
          Set the Bgcolor 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 shouldShowBgColorSelector()
           
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
 void writePoints()
          write out the points as a csv file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uniqueCnt

protected static int uniqueCnt
For unique ids


TAG_POLYGON

public static final String TAG_POLYGON
Xml tag name

See Also:
Constant Field Values

TAG_ARROW

public static final String TAG_ARROW
Xml tag name

See Also:
Constant Field Values

TAG_FRONT

public static final String TAG_FRONT
Xml tag name

See Also:
Constant Field Values

TAG_TEXT

public static final String TAG_TEXT
Xml tag name

See Also:
Constant Field Values

TAG_HIGH

public static final String TAG_HIGH
Xml tag name

See Also:
Constant Field Values

TAG_LOW

public static final String TAG_LOW
Xml tag name

See Also:
Constant Field Values

TAG_SHAPE

public static final String TAG_SHAPE
Xml tag name

See Also:
Constant Field Values

TAG_SYMBOL

public static final String TAG_SYMBOL
Xml tag name

See Also:
Constant Field Values

TAG_IMAGE

public static final String TAG_IMAGE
Xml tag name

See Also:
Constant Field Values

TAG_MOVIE

public static final String TAG_MOVIE
Xml tag name

See Also:
Constant Field Values

ATTR_COLOR

public static final String ATTR_COLOR
xml attribute name

See Also:
Constant Field Values

ATTR_BGCOLOR

public static final String ATTR_BGCOLOR
See Also:
Constant Field Values

ATTR_FILLED

public static final String ATTR_FILLED
xml attribute name

See Also:
Constant Field Values

ATTR_PICKABLE

public static final String ATTR_PICKABLE
xml attribute name

See Also:
Constant Field Values

ATTR_FULLLATLON

public static final String ATTR_FULLLATLON
xml attribute name

See Also:
Constant Field Values

ATTR_TIMES

public static final String ATTR_TIMES
xml attribute name

See Also:
Constant Field Values

ATTR_TIMEFORMAT

public static final String ATTR_TIMEFORMAT
xml attribute for time format

See Also:
Constant Field Values

ATTR_ZPOSITION

public static final String ATTR_ZPOSITION
xml attribute name

See Also:
Constant Field Values

ATTR_COORDTYPE

public static final String ATTR_COORDTYPE
xml attribute name

See Also:
Constant Field Values

ATTR_POINTS

public static final String ATTR_POINTS
xml attribute name

See Also:
Constant Field Values

ATTR_LINEWIDTH

public static final String ATTR_LINEWIDTH
xml attribute name

See Also:
Constant Field Values

ATTR_TEXT

public static final String ATTR_TEXT
xml attr names

See Also:
Constant Field Values

ATTR_NAME

public static final String ATTR_NAME
xml attribute name

See Also:
Constant Field Values

COORD_NONE

public static final int COORD_NONE
Represents no vertical coordinate

See Also:
Constant Field Values

COORD_XYZ

public static final int COORD_XYZ
Represents XYZ vertical coordinate

See Also:
Constant Field Values

COORD_XY

public static final int COORD_XY
Represents XY vertical coordinate

See Also:
Constant Field Values

COORD_LATLONALT

public static final int COORD_LATLONALT
Represents LAT/LON/ALT vertical coordinate

See Also:
Constant Field Values

COORD_LATLON

public static final int COORD_LATLON
Represents LAT/LON vertical coordinate

See Also:
Constant Field Values

COORD_TYPES

public static final int[] COORD_TYPES
Drawing coordinate types


COORD_TYPENAMES

public static final String[] COORD_TYPENAMES
Drawing coordinate names


COORD_LABELS

public static final String[] COORD_LABELS
labels for coordinate syste type.


oldVisibility

public boolean oldVisibility
flag


propertiesUp

protected boolean propertiesUp
Is properties dialog shown


propDialog

protected JDialog propDialog
The properties dialog


tabbedPane

protected JTabbedPane tabbedPane
For props


points

protected List points
List of points. May be lat/lon/alt or x/y/z


stretchIndex

protected int stretchIndex
What point are we stretching


firstMoveLocation

protected double[] firstMoveLocation
Where did we start moving


actualPoints

protected List actualPoints
actual points being displayed


firstMoveEarthLocation

protected EarthLocation firstMoveEarthLocation
Where did we start moving


PT_X

public static final int PT_X
Indices into arrays

See Also:
Constant Field Values

PT_Y

public static final int PT_Y
Indices into arrays

See Also:
Constant Field Values

PT_Z

public static final int PT_Z
Indices into arrays

See Also:
Constant Field Values

IDX_X

public static final int IDX_X
Indices into arrays

See Also:
Constant Field Values

IDX_Y

public static final int IDX_Y
Indices into arrays

See Also:
Constant Field Values

IDX_Z

public static final int IDX_Z
Indices into arrays

See Also:
Constant Field Values

IDX_LAT

public static final int IDX_LAT
Indices into arrays

See Also:
Constant Field Values

IDX_LON

public static final int IDX_LON
Indices into arrays

See Also:
Constant Field Values

IDX_ALT

public static final int IDX_ALT
Indices into arrays

See Also:
Constant Field Values

coordType

protected int coordType
What drawing coord system are we on


zPosition

protected float zPosition
Fixed z position


parentDisplayable

protected CompositeDisplayable parentDisplayable
Top level displayable


selectionDisplayable

protected CompositeDisplayable selectionDisplayable
Shows selected highlight


control

protected DrawingControl control
My control

Constructor Detail

DrawingGlyph

public DrawingGlyph()
Ctor


DrawingGlyph

public DrawingGlyph(DrawingControl control,
                    DisplayEvent event)
Ctor

Parameters:
control - The control I'm in
event - The display event.

DrawingGlyph

public DrawingGlyph(DrawingControl control,
                    DisplayEvent event,
                    boolean filled)
Ctor

Parameters:
control - The control I'm in
event - The display event.
filled - Is this glyph filled
Method Detail

initFinal

public final boolean initFinal()
                        throws VisADException,
                               RemoteException
Do final initialization

Returns:
Success
Throws:
RemoteException - On badness
VisADException - On badness

initFinalInner

protected boolean initFinalInner()
                          throws VisADException,
                                 RemoteException
This is called to do final initialization

Returns:
Successful
Throws:
RemoteException - On badness
VisADException - On badness

initFromUser

public boolean initFromUser(DrawingControl control,
                            DisplayEvent event)
                     throws VisADException,
                            RemoteException
Initialize from a user event.

Parameters:
control - The control I'm in
event - The display event.
Returns:
OK
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

initFromBundle

public void initFromBundle(DrawingControl control)
                    throws VisADException,
                           RemoteException
Initialize when recreated from a bundle

Parameters:
control - The control I'm in
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

initFromXml

public void initFromXml(DrawingControl control,
                        Element node)
                 throws VisADException,
                        RemoteException
Initialize from xml

Parameters:
control - The control I'm in
node - The xml node
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

isSelectable

public boolean isSelectable()
Is this glyph selectable

Returns:
By default return true

isFrontDisplay

protected boolean isFrontDisplay()
Is the control a front display

Returns:
is a front display

getDefaultZPosition

protected float getDefaultZPosition()
Get the default Z position for the glyph.

Returns:
default Z position for the glyph.

isValid

public boolean isValid()
Is this glyph valid. Some glyph classes get created but are not fully valid.

Returns:
By default return true

processPointStrings

public void processPointStrings(List pointStrings)
                         throws VisADException,
                                RemoteException
Parse the List of point strings. The format depends on the coordinate system type (e.g., XY, XYZ, etc.)

Parameters:
pointStrings - List of Strings that represent double location values
Throws:
RemoteException - On badness
VisADException - On badness

mousePressed

public boolean mousePressed(DisplayEvent event)
                     throws VisADException,
                            RemoteException
handle event

Parameters:
event - event
Returns:
continue processing
Throws:
RemoteException - On badness
VisADException - On badness

setSelected

public void setSelected(boolean selected)
                 throws VisADException,
                        RemoteException
Set this glyph selected

Parameters:
selected - Is selected
Throws:
RemoteException - On badness
VisADException - On badness

getSelectionPoints

protected List getSelectionPoints()
Get points used to select this glyph.

Returns:
Selection points

getElement

public final Element getElement(Document doc)
Create an xml element that represents this glyph

Parameters:
doc - The doc to create with
Returns:
The element

getTimeField

protected Data getTimeField(Data data)
                     throws VisADException,
                            RemoteException
Make the time field if we have time values If not, just return the data

Parameters:
data - the data to make the range of the time field with
Returns:
The time field or the data argument if there are no times
Throws:
RemoteException - On badness
VisADException - On badness

addAttributes

protected void addAttributes(Element e)
Populate the xml node with attrs

Parameters:
e - Xml node

getTagName

public abstract String getTagName()
Get xml tag name to use

Returns:
Xml tag name

getTypeName

public abstract String getTypeName()
Get the name of this glyph type

Returns:
The name

getDescription

public String getDescription()
Get the description

Returns:
the description

getAreaString

public String getAreaString()
                     throws Exception
get string representation of the area for showing the user

Returns:
area label
Throws:
Exception - on badness

getExtraDescription

public String getExtraDescription()
Get extra description to show in the JTable

Returns:
extra description

getDisplayable

public Displayable getDisplayable()
                           throws VisADException,
                                  RemoteException
Get the main displayable.

Returns:
The displayable
Throws:
RemoteException - On badness
VisADException - On badness

getParent

protected CompositeDisplayable getParent()
                                  throws VisADException,
                                         RemoteException
Get the main displayable.

Returns:
The displayable
Throws:
RemoteException - On badness
VisADException - On badness

addDisplayable

protected void addDisplayable(Displayable displayable)
                       throws VisADException,
                              RemoteException
Add the displayable to the main parent displayable

Parameters:
displayable - The displayable to add
Throws:
RemoteException - On badness
VisADException - On badness

removeDisplayable

protected void removeDisplayable(Displayable displayable)
                          throws VisADException,
                                 RemoteException
Remove the displayable from the main displayable

Parameters:
displayable - The displayable to remove
Throws:
RemoteException - On badness
VisADException - On badness

addTime

public void addTime(Real time)
Add the time to the list of times

Parameters:
time - The time

setTimeValues

public void setTimeValues(List value)
Set the TimeValue property.

Parameters:
value - The new value for TimeValue

getTimeValues

public List getTimeValues()
Get the TimeValue property.

Returns:
The TimeValue

checkTimeVisibility

public void checkTimeVisibility()
                         throws VisADException,
                                RemoteException
Is this glyph visible in the current time step

Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

setVisible

public void setVisible(boolean visible)
                throws VisADException,
                       RemoteException
Toggle visiblity of the displayable

Parameters:
visible - Is visible
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

isVisible

public boolean isVisible()
Is this glyph visible

Returns:
is visible

checkVisibility

public void checkVisibility()
Make sure the displayable is not visible if this glyph is not visible


constrainedTo2D

protected boolean constrainedTo2D()
Is glyph constrained to 2d

Returns:
Constrained to 2d

setCoordType

public void setCoordType(int value)
Set the CoordType property.

Parameters:
value - The new value for CoordType

getCoordType

public int getCoordType()
Get the CoordType property.

Returns:
The CoordType

isInXYSpace

public boolean isInXYSpace()
Are we drawing in xy or xyz space

Returns:
Is in xy space

isInFlatSpace

public boolean isInFlatSpace()
Are we drawing in xy or lat/lon space

Returns:
Is in 2d space

isInLatLonSpace

public boolean isInLatLonSpace()
In lat/lon or lat/lon/alt space

Returns:
Is in latlon space

getPoint

protected Object getPoint(DisplayEvent event)
                   throws VisADException,
                          RemoteException
Get point to use from the event. This may be an earthlocation if in latlon space or a double array if in x space.

Parameters:
event - The display event.
Returns:
The point
Throws:
RemoteException - On badness
VisADException - On badness

setProperties

public final void setProperties()
Set the properties from the dialog


writePoints

public void writePoints()
write out the points as a csv file


evaluateJython

public void evaluateJython()
Evaluate the jython from the properties dialog


applyProperties

protected boolean applyProperties(Hashtable compMap)
                           throws VisADException,
                                  RemoteException
Handle the property apply.

Parameters:
compMap - Holds property widgets
Returns:
Success
Throws:
RemoteException - On badness
VisADException - On badness

hide

public void hide()
          throws VisADException,
                 RemoteException
Hide glyph

Throws:
RemoteException - On badness
VisADException - On badness

show

public void show()
          throws VisADException,
                 RemoteException
Show glyph

Throws:
RemoteException - On badness
VisADException - On badness

shouldShowColorSelector

protected boolean shouldShowColorSelector()
Should show color selector in properties

Returns:
show color selector

shouldShowBgColorSelector

protected boolean shouldShowBgColorSelector()

getPropertiesComponents

protected void getPropertiesComponents(List comps,
                                       Hashtable compMap)
Make the properties widgets

Parameters:
comps - List of components
compMap - Map to hold name to widget

getTimePropertiesComponents

protected void getTimePropertiesComponents(List comps,
                                           Hashtable compMap)
Add to the comps array the time list for selecting times

Parameters:
comps - comps
compMap - map

getDistance

public Real getDistance()
                 throws Exception
Calculate the distance along the line

Returns:
Distance or null if this glyph type cannot calculate it
Throws:
Exception - On badness

getArea

public double getArea()
               throws Exception
Get the area in square feet.

Returns:
area of this shape in square feet
Throws:
Exception - On badness

canShowDistance

public boolean canShowDistance()
Can this glyph type calculate distance

Returns:
can do distance

canShowArea

public boolean canShowArea()
Can this glyph type calculate area

Returns:
can do area

getBeingCreated

public boolean getBeingCreated()
currently being created

Returns:
being created

doneBeingCreated

public void doneBeingCreated()
all done


handleCreation

public DrawingGlyph handleCreation(DisplayEvent event)
                            throws VisADException,
                                   RemoteException
Handle the creation event. If it returns this then the DrawingControl keeps routing events to me. If returns null then no more events get routed to me.

Parameters:
event - The display event.
Returns:
This or null
Throws:
RemoteException - On badness
VisADException - On badness

handleMousePressed

public DrawingGlyph handleMousePressed(DisplayEvent event)
                                throws VisADException,
                                       RemoteException
Handle the event. If it returns this then the DrawingControl keeps routing events to me. If returns null then no more events get routed to me.

Parameters:
event - The display event.
Returns:
This or null.
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

handleMouseMoved

public DrawingGlyph handleMouseMoved(DisplayEvent event)
                              throws VisADException,
                                     RemoteException
Handle the event. If it returns this then the DrawingControl keeps routing events to me. If returns null then no more events get routed to me.

Parameters:
event - The display event.
Returns:
This or null
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

initStretch

public void initStretch(DisplayEvent event)
                 throws VisADException,
                        RemoteException
Start streth

Parameters:
event - The display event.
Throws:
RemoteException - On badness
VisADException - On badness

doStretch

public void doStretch(DisplayEvent event)
               throws VisADException,
                      RemoteException
Stretch this glyph

Parameters:
event - The display event.
Throws:
RemoteException - On badness
VisADException - On badness

doDeletePoint

public void doDeletePoint(DisplayEvent event)
                   throws VisADException,
                          RemoteException
delete the point nearest the event

Parameters:
event - the event
Throws:
RemoteException - on badness
VisADException - on badness

doMove

public void doMove(DisplayEvent event)
            throws VisADException,
                   RemoteException
Move this glyph

Parameters:
event - The display event.
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

moveTo

protected void moveTo(DisplayEvent event)
               throws VisADException,
                      RemoteException
Move this glyph to the location of the event

Parameters:
event - The display event.
Throws:
RemoteException - On badness
VisADException - On badness

getPointValues

protected float[][] getPointValues()
                            throws VisADException,
                                   RemoteException
Convert points list of array of xyz or lat/lon/alt

Returns:
Location
Throws:
RemoteException - On badness
VisADException - On badness

getPointValues

protected float[][] getPointValues(boolean convertToXY)
                            throws VisADException,
                                   RemoteException
Convert points list of array of xyz or lat/lon/alt

Parameters:
convertToXY - If true, force result to be xyz
Returns:
Location
Throws:
RemoteException - On badness
VisADException - On badness

getLatLons

public float[][] getLatLons()
                     throws Exception
get the points as an array of lat/lons

Returns:
latlons
Throws:
Exception - on badness

getLatLons

protected float[][] getLatLons(List points)
                        throws VisADException,
                               RemoteException
Convert points list of array of xyz or lat/lon/alt

Parameters:
points - List of points. Either double array or EarthLocation
Returns:
lat/lons
Throws:
RemoteException - On badness
VisADException - On badness

getPointValuesDouble

protected double[][] getPointValuesDouble()
                                   throws VisADException,
                                          RemoteException
Convert points list of array of xyz or lat/lon/alt

Returns:
Location
Throws:
RemoteException - On badness
VisADException - On badness

getPointValuesDouble

protected double[][] getPointValuesDouble(boolean convertToXY)
                                   throws VisADException,
                                          RemoteException
Convert points list of array of xyz or lat/lon/alt

Parameters:
convertToXY - If true, force result to be xyz
Returns:
Location
Throws:
RemoteException - On badness
VisADException - On badness

tryToFill

protected Data tryToFill(float[][] pts,
                         Data dflt)
                  throws VisADException,
                         RemoteException
Try to fill the pts array

Parameters:
pts - The points to fill
dflt - The default to return if cannot fill
Returns:
The filled data or the default if fill is not possible
Throws:
RemoteException - On badness
VisADException - On badness

toLatLonAlt

protected float[] toLatLonAlt(EarthLocation el)
                       throws VisADException,
                              RemoteException
Convert to float array

Parameters:
el - Location
Returns:
Converted location
Throws:
RemoteException - On badness
VisADException - On badness

getFixedAltitude

protected double getFixedAltitude()
                           throws VisADException,
                                  RemoteException
Get altitude of zposition

Returns:
Altitude
Throws:
RemoteException - On badness
VisADException - On badness

projectionChanged

public void projectionChanged()
                       throws VisADException,
                              RemoteException
Handle event

Throws:
RemoteException - On badness
VisADException - On badness

viewpointChanged

public void viewpointChanged()
                      throws VisADException,
                             RemoteException
viewpoint changed

Throws:
RemoteException - On badness
VisADException - On badness

updateLocation

public void updateLocation()
                    throws VisADException,
                           RemoteException
Glyph moved. Update the Displayable location.

Throws:
RemoteException - On badness
VisADException - On badness

initMove

public void initMove(DisplayEvent event)
              throws VisADException,
                     RemoteException
Started moving

Parameters:
event - The display event.
Throws:
RemoteException - On badness
VisADException - On badness

handleKeyPressed

public DrawingGlyph handleKeyPressed(DisplayEvent event)
                              throws VisADException,
                                     RemoteException
Handle event.

Parameters:
event - The display event.
Returns:
This or null
Throws:
RemoteException - On badness
VisADException - On badness

handleMouseDragged

public DrawingGlyph handleMouseDragged(DisplayEvent event)
                                throws VisADException,
                                       RemoteException
Handle event.

Parameters:
event - The display event.
Returns:
This or null
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

handleMouseReleased

public DrawingGlyph handleMouseReleased(DisplayEvent event)
                                 throws VisADException,
                                        RemoteException
Handle event.

Parameters:
event - The display event.
Returns:
This or null
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

setColor

public void setColor(Color value)
Set the Color property.

Parameters:
value - The new value for Color

setColor

protected void setColor(Displayable displayable,
                        Color c)
                 throws VisADException,
                        RemoteException
Set color on displayable

Parameters:
displayable - displayable_
c - color
Throws:
RemoteException - On badness
VisADException - On badness

getColor

public Color getColor()
Get the Color property.

Returns:
The Color

setBgcolor

public void setBgcolor(Color value)
Set the Bgcolor property.

Parameters:
value - The new value for Bgcolor

getBgcolor

public Color getBgcolor()
Get the Bgcolor property.

Returns:
The Bgcolor

setActualPoints

protected void setActualPoints(float[][] pts)
                        throws VisADException,
                               RemoteException
Set the points list

Parameters:
pts - Points
Throws:
RemoteException - On badness
VisADException - On badness

makePoint

protected EarthLocation makePoint(double lat,
                                  double lon,
                                  double alt)
                           throws VisADException,
                                  RemoteException
Utility to make a point

Parameters:
lat - lat
lon - lon
alt - alt
Returns:
point
Throws:
RemoteException - On badness
VisADException - On badness

distance

public double distance(double[] location,
                       double[] direction)
                throws VisADException,
                       RemoteException
Calculate distance

Parameters:
location - from
direction - direction
Returns:
distance
Throws:
RemoteException - On badness
VisADException - On badness

distanceBetween

public static double distanceBetween(double[] origin,
                                     double[] loc2)
Get distance between

Parameters:
origin - From
loc2 - To
Returns:
Distance

distanceBetween

public double distanceBetween(double[] loc1,
                              EarthLocation el)
                       throws VisADException,
                              RemoteException
Get distance

Parameters:
loc1 - point 1
el - point 2
Returns:
distance
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

doInterpolatedStretch

protected void doInterpolatedStretch(DisplayEvent event)
                              throws VisADException,
                                     RemoteException
This stretches the current point and also stretches the rest of the points by a linear delta from the initial point.

Parameters:
event - The mouse move event
Throws:
RemoteException - On badness
VisADException - On badness

squared

public static double squared(double v1)
Square value

Parameters:
v1 - Value
Returns:
Squared

closestPoint

public int closestPoint(double[] location,
                        List points)
                 throws VisADException,
                        RemoteException
Find index of closest point

Parameters:
location - From
points - Points
Returns:
Index
Throws:
RemoteException - On badness
VisADException - On badness

smoothCurve

public static double[][] smoothCurve(double[][] curve,
                                     int window)
Smooth the curve

Parameters:
curve - The curve
window - Smooth window
Returns:
Smoothed curve

setZPosition

public void setZPosition(float value)
Set the Zposition property.

Parameters:
value - The new value for Zposition

getZPosition

public float getZPosition()
Get the ZPosition property.

Returns:
The ZPosition

setPoints

public void setPoints(List value)
Set the Points property.

Parameters:
value - The new value for Points

getPoints

public List getPoints()
Get the Points property.

Returns:
The Points

getBoxPoint

protected double[] getBoxPoint(int i)
                        throws VisADException,
                               RemoteException
Get xyz of point at given index

Parameters:
i - Index
Returns:
xyz
Throws:
RemoteException - On badness
VisADException - On badness

getBoxPoint

protected double[] getBoxPoint(int i,
                               List l)
                        throws VisADException,
                               RemoteException
Get xyz of point at given index

Parameters:
i - Index
l - Points
Returns:
xyz
Throws:
RemoteException - On badness
VisADException - On badness

getBoxPoint

protected double[] getBoxPoint(Object point)
                        throws VisADException,
                               RemoteException
Convert point (either latlonalt or xyz) to xyz

Parameters:
point - Point
Returns:
xyz
Throws:
RemoteException - On badness
VisADException - On badness

swap

protected void swap(double[] a1,
                    double[] a2,
                    int index)
Swap array values at index

Parameters:
a1 - Array 1
a2 - Array 2
index - Index

swap

protected void swap(float[] a1,
                    float[] a2,
                    int index)
Swap array values at index

Parameters:
a1 - Array 1
a2 - Array 2
index - Index

getBoundingBox

protected List getBoundingBox(List points)
                       throws VisADException,
                              RemoteException
Find bounding box of points

Parameters:
points - Points
Returns:
bbox
Throws:
RemoteException - On badness
VisADException - On badness

setFilled

public void setFilled(boolean value)
Set the Filled property.

Parameters:
value - The new value for Filled

getFilled

public boolean getFilled()
Get the Filled property.

Returns:
The Filled

setPickable

public void setPickable(boolean value)
Set the Pickable property.

Parameters:
value - The new value for Pickable

getPickable

public boolean getPickable()
Get the Pickable property.

Returns:
The Pickable

setFullLatLon

public void setFullLatLon(boolean value)
Set the Fulllatlon property.

Parameters:
value - The new value for Fulllatlon

getFullLatLon

public boolean getFullLatLon()
Get the FullLatLon property.

Returns:
The FullLatLon

setBeenRemoved

public void setBeenRemoved(boolean value)
Set the BeenRemoved property.

Parameters:
value - The new value for BeenRemoved

getBeenRemoved

public boolean getBeenRemoved()
Get the BeenRemoved property.

Returns:
The BeenRemoved

setName

public void setName(String value)
Set the Name property.

Parameters:
value - The new value for Name

getName

public String getName()
Get the Name property.

Returns:
The Name

toString

public String toString()
to string

Overrides:
toString in class Object
Returns:
tostring

setEditable

public void setEditable(boolean value)
Set the Editable property.

Parameters:
value - The new value for Editable

getEditable

public boolean getEditable()
Get the Editable property.

Returns:
The Editable

setVisibleFlag

public void setVisibleFlag(boolean value)
                    throws VisADException,
                           RemoteException
Set the VisibleFlag property.

Parameters:
value - The new value for VisibleFlag
Throws:
RemoteException - On badness
VisADException - On badness

getVisibleFlag

public boolean getVisibleFlag()
Get the VisibleFlag property.

Returns:
The VisibleFlag

getIsRaster

public boolean getIsRaster()
is this glyph a raster thing

Returns:
is raster

setCreatedByUser

public void setCreatedByUser(boolean value)
Set the CreatedByUser property.

Parameters:
value - The new value for CreatedByUser

getCreatedByUser

public boolean getCreatedByUser()
Get the CreatedByUser property.

Returns:
The CreatedByUser