uavsim.navigationmodel
Class A_ChartElement

java.lang.Object
  extended by uavsim.navigationmodel.A_ChartElement
Direct Known Subclasses:
A_ChartElementTuneable, A_MarkerBeacon, Airport, Airport.RunwayDescriptor, Route, Waypoint

public abstract class A_ChartElement
extends java.lang.Object

Defines the shared aspects of navigation chart elements.

Author:
Dan Tappan [17.07.11]

Field Summary
protected  CoordinateCartesianAbsolute _anchor
          the relative origin of the element within its boundary extent to align to the world coordinate on the map
private  boolean _areDetailsVisible
          whether low-level details that would clutter the display should be rendered
protected  CoordinateWorld3D _coordinate
          the world coordinate to align the anchor to
protected  java.lang.String _id
          the unique element identifier
private static TextProperties LABEL_PROPERTIES
          the text properties of any element label
 
Constructor Summary
A_ChartElement(java.lang.String id, CoordinateWorld3D coordinate)
          Creates an abstract chart element.
 
Method Summary
 boolean areDetailsVisible()
          Returns whether low-level details that would clutter the display should be rendered.
abstract  java.awt.Color getColor()
          Gets the color of the glyph.
 CoordinateWorld3D getCoordinate()
          Gets the coordinate of the origin.
 java.lang.String getDesignator()
          Gets the station designator.
 A_Frequency<?> getFrequency()
          Returns the frequency of this element, if it has one; otherwise, it fails with an assertion.
 java.lang.String getID()
          Gets the unique element identifier.
 boolean hasFrequency()
          Returns whether this element has a frequency.
 void render(java.awt.Graphics2D graphics, I_WorldMappable mapper, boolean areDetailsVisible)
          Renders the glyph.
protected  void renderLabel(java.awt.Graphics2D graphics, java.lang.String label)
          Renders the label.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_anchor

protected CoordinateCartesianAbsolute _anchor
the relative origin of the element within its boundary extent to align to the world coordinate on the map


_areDetailsVisible

private boolean _areDetailsVisible
whether low-level details that would clutter the display should be rendered


_coordinate

protected final CoordinateWorld3D _coordinate
the world coordinate to align the anchor to


_id

protected final java.lang.String _id
the unique element identifier


LABEL_PROPERTIES

private static final TextProperties LABEL_PROPERTIES
the text properties of any element label

Constructor Detail

A_ChartElement

public A_ChartElement(java.lang.String id,
                      CoordinateWorld3D coordinate)
Creates an abstract chart element.

Parameters:
id - - the unique element identifier
coordinate - - the coordinate of the origin
Method Detail

areDetailsVisible

public boolean areDetailsVisible()
Returns whether low-level details that would clutter the display should be rendered.

Returns:
the state

getColor

public abstract java.awt.Color getColor()
Gets the color of the glyph.

Returns:
the color

getCoordinate

public CoordinateWorld3D getCoordinate()
Gets the coordinate of the origin.

Returns:
the coordinate

getDesignator

public java.lang.String getDesignator()
Gets the station designator. This approach is a little non-OOPy, but for simplicity and clarify in the CMPS 450, it is fine.

This is valid only on tuneable chart elements.

Returns:
the designator

getFrequency

public A_Frequency<?> getFrequency()
Returns the frequency of this element, if it has one; otherwise, it fails with an assertion. This approach is a little non-OOPy, but for simplicity and clarify in the CMPS 450, it is fine.

This is valid only on tuneable chart elements.

Returns:
the frequency

getID

public java.lang.String getID()
Gets the unique element identifier.

Returns:
the identifier

hasFrequency

public boolean hasFrequency()
Returns whether this element has a frequency. This approach is a little non-OOPy, but for simplicity and clarify in the CMPS 450, it is fine.

Returns:
always returns false

render

public void render(java.awt.Graphics2D graphics,
                   I_WorldMappable mapper,
                   boolean areDetailsVisible)
Renders the glyph.

Parameters:
graphics - - the graphics context
mapper - - the mapper that translates screen and world coordinates
areDetailsVisible - - whether low-level details that would clutter the display should be rendered

renderLabel

protected void renderLabel(java.awt.Graphics2D graphics,
                           java.lang.String label)
Renders the label.

Parameters:
graphics - - the graphics context
label - - the label contents

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object