com.bbn.openmap.layer
Class GraticuleLayer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.bbn.openmap.Layer
                  extended by com.bbn.openmap.layer.OMGraphicHandlerLayer
                      extended by com.bbn.openmap.layer.GraticuleLayer
All Implemented Interfaces:
ProjectionListener, GestureResponsePolicy, OMGraphicHandler, ProjectionPainter, PropertyConsumer, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.io.Serializable, java.util.EventListener

public class GraticuleLayer
extends OMGraphicHandlerLayer
implements java.awt.event.ActionListener

Layer that draws graticule lines. If the showRuler property is set to true, then longitude values are displayed on the bottom of the map, and latitude values are displayed on the left side. If the show1And5Lines property is true, then 5 degree lines are drawn when there are <= threshold ten degree latitude or longitude lines, and 1 degree lines are drawn when there are <= threshold five degree latitude or longitude degree lines.

The openmap.properties file can control the layer with the following settings:

   
    # Show lat / lon spacing labels
    graticule.showRuler=true
    graticule.show1And5Lines=true
    # Controls when the five degree lines and one degree lines kick in
    #- when there is less than the threshold of ten degree lat or lon
    #lines, five degree lines are drawn. The same relationship is there
    #for one to five degree lines.
    graticule.threshold=2
    # the color of 10 degree spacing lines (Hex ARGB)
    graticule.10DegreeColor=FF000000
    # the color of 5 degree spacing lines (Hex ARGB)
    graticule.5DegreeColor=C7009900
    # the color of 1 degree spacing lines (Hex ARGB)
    graticule.1DegreeColor=C7003300
    # the color of the equator (Hex ARGB)
    graticule.equatorColor=FFFF0000
    # the color of the international dateline (Hex ARGB)
    graticule.datelineColor=7F000099
    # the color of the special lines (Hex ARGB)
    graticule.specialLineColor=FF000000
    # the color of the labels (Hex ARGB)
    graticule.textColor=FF000000
   
 

In addition, you can get this layer to work with the OpenMap viewer by editing your openmap.properties file:

   
    # layers
    openmap.layers=graticule ...
    # class
    graticule.class=com.bbn.openmap.layer.GraticuleLayer
    # name
    graticule.prettyName=Graticule
   
 

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.awt.Color belowOneDegreeColor
           
static java.lang.String BelowOneDegreeColorProperty
           
protected  boolean boxy
          Flag for lineType - true is LINETYPE_STRAIGHT, false is LINETYPE_GREATCIRCLE.
protected  java.awt.Color dateLineColor
           
static java.lang.String DateLineColorProperty
           
protected  java.lang.String defaultBelowOneDegreeColorString
           
protected  java.lang.String defaultDateLineColorString
           
protected  java.lang.String defaultEquatorColorString
           
protected  java.lang.String defaultFiveDegreeColorString
           
protected  java.lang.String defaultOneDegreeColorString
           
protected  boolean defaultShowBelowOneLines
           
protected  boolean defaultShowOneAndFiveLines
           
protected  boolean defaultShowRuler
           
protected  java.lang.String defaultSpecialLineColorString
           
protected  java.lang.String defaultTenDegreeColorString
           
protected  java.lang.String defaultTextColorString
           
protected  int defaultThreshold
           
protected  java.awt.Color equatorColor
           
static java.lang.String EquatorColorProperty
           
protected  java.awt.Color fiveDegreeColor
           
static java.lang.String FiveDegreeColorProperty
           
protected  java.awt.Font font
           
protected  int fontSize
           
static java.lang.String FontSizeProperty
           
protected  OMGraphicList markerLines
          The equator, dateline and meridian lines, premade.
protected  java.awt.Color oneDegreeColor
           
static java.lang.String OneDegreeColorProperty
           
protected  javax.swing.Box paletteBox
          The user interface palette for the Graticule layer.
protected  javax.swing.JCheckBox show15Button
           
protected  javax.swing.JCheckBox showBelow1Button
           
protected  boolean showBelowOneLines
           
static java.lang.String ShowBelowOneProperty
           
protected  boolean showOneAndFiveLines
           
static java.lang.String ShowOneAndFiveProperty
           
protected  boolean showRuler
           
protected  javax.swing.JCheckBox showRulerButton
           
static java.lang.String ShowRulerProperty
           
protected  java.awt.Color specialLineColor
           
static java.lang.String SpecialLineColorProperty
           
protected  java.awt.Color tenDegreeColor
           
static java.lang.String TenDegreeColorProperty
           
protected  OMGraphicList tenDegreeLines
          The ten degree latitude and longitude lines, premade.
protected  java.awt.Color textColor
           
static java.lang.String TextColorProperty
           
protected  int threshold
          Threshold is the total number of ten lines on the screen before the five lines appear, and the total number of five lines on the screen before the one lines appear.
static java.lang.String ThresholdProperty
           
 
Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, logger, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty
 
Fields inherited from class com.bbn.openmap.Layer
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, readyToPaint, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GraticuleLayer()
          Construct the GraticuleLayer.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Used just for the redraw button.
protected  OMGraphicList constructGraticuleLines()
          Create the graticule lines.
protected  OMGraphicList constructGraticuleLines(float up, float down, float left, float right, int showWhichLines)
          Construct the five degree and one degree graticule lines, depending on the showWhichLines setting.
protected  OMGraphicList constructMarkerLines(double ctrLon)
          Constructs the Dateline and Prime Meridian lines.
protected  OMGraphicList constructTenDegreeLines(double ctrLon)
          Create the ten degree lines.
protected  OMGraphicList constructTensLabels(float up, float down, float left, float right, boolean doLats)
          Constructs the labels for the tens lines.
protected  int evaluateSpacing(float up, float down, float left, float right)
          Figure out which graticule lines should be drawn based on the treshold set in the layer, and the coordinates of the screen.
 java.awt.Component getGUI()
          Creates the interface palette.
 java.util.Properties getProperties(java.util.Properties properties)
          The properties and prefix are managed and decoded here, for the standard uses of the GraticuleLayer.
 java.util.Properties getPropertyInfo(java.util.Properties properties)
          The properties and prefix are managed and decoded here, for the standard uses of the GraticuleLayer.
 boolean getShowBelowOneLines()
           
 boolean getShowOneAndFiveLines()
           
 boolean getShowRuler()
           
 OMGraphicList prepare()
          Creates the OMGraphic list with graticule lines.
 void projectionChanged(ProjectionEvent e)
          Invoked when the projection has changed or this Layer has been added to the MapBean.
 void renderDataForProjection(Projection proj, java.awt.Graphics g)
          Implementing the ProjectionPainter interface.
protected  void setLineTypeAndProject(OMGraphicList list, int lineType)
          Take a graphic list, and set all the items on the list to the line type specified, and project them into the current projection.
 void setProperties(java.lang.String prefix, java.util.Properties properties)
          The properties and prefix are managed and decoded here, for the standard uses of the GraticuleLayer.
 void setShowBelowOneLines(boolean set)
           
 void setShowOneAndFiveLines(boolean set)
           
 void setShowRuler(boolean set)
           
 
Methods inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
canSetList, copy, createLayerWorker, cut, deselect, dispose, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getDefaultSettingsPanel, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMapMouseListener, getMouseEventInterpreter, getMouseModeIDsForEvents, getProjectionChangePolicy, getRedrawButton, getRenderPolicy, getSelected, getSettingsButton, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, isCancelled, isHighlightable, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paint, paste, receivesMapEvents, resetFiltering, select, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete
 
Methods inherited from class com.bbn.openmap.Layer
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, finalize, findAndInit, findAndInit, findAndUndo, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getAttribute, getBeanContext, getCoordTransform, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isReadyToPaint, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setReadyToPaint, setRemovable, setVisible, setWindowSupport, showPalette
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

defaultShowRuler

protected boolean defaultShowRuler

defaultShowOneAndFiveLines

protected boolean defaultShowOneAndFiveLines

defaultShowBelowOneLines

protected boolean defaultShowBelowOneLines

defaultThreshold

protected int defaultThreshold

boxy

protected boolean boxy
Flag for lineType - true is LINETYPE_STRAIGHT, false is LINETYPE_GREATCIRCLE.


threshold

protected int threshold
Threshold is the total number of ten lines on the screen before the five lines appear, and the total number of five lines on the screen before the one lines appear.


tenDegreeLines

protected OMGraphicList tenDegreeLines
The ten degree latitude and longitude lines, premade.


markerLines

protected OMGraphicList markerLines
The equator, dateline and meridian lines, premade.


showOneAndFiveLines

protected boolean showOneAndFiveLines

showBelowOneLines

protected boolean showBelowOneLines

showRuler

protected boolean showRuler

font

protected java.awt.Font font

fontSize

protected int fontSize

tenDegreeColor

protected java.awt.Color tenDegreeColor

fiveDegreeColor

protected java.awt.Color fiveDegreeColor

oneDegreeColor

protected java.awt.Color oneDegreeColor

belowOneDegreeColor

protected java.awt.Color belowOneDegreeColor

equatorColor

protected java.awt.Color equatorColor

dateLineColor

protected java.awt.Color dateLineColor

specialLineColor

protected java.awt.Color specialLineColor

textColor

protected java.awt.Color textColor

defaultTenDegreeColorString

protected java.lang.String defaultTenDegreeColorString

defaultFiveDegreeColorString

protected java.lang.String defaultFiveDegreeColorString

defaultOneDegreeColorString

protected java.lang.String defaultOneDegreeColorString

defaultBelowOneDegreeColorString

protected java.lang.String defaultBelowOneDegreeColorString

defaultEquatorColorString

protected java.lang.String defaultEquatorColorString

defaultDateLineColorString

protected java.lang.String defaultDateLineColorString

defaultSpecialLineColorString

protected java.lang.String defaultSpecialLineColorString

defaultTextColorString

protected java.lang.String defaultTextColorString

TenDegreeColorProperty

public static final java.lang.String TenDegreeColorProperty
See Also:
Constant Field Values

FiveDegreeColorProperty

public static final java.lang.String FiveDegreeColorProperty
See Also:
Constant Field Values

OneDegreeColorProperty

public static final java.lang.String OneDegreeColorProperty
See Also:
Constant Field Values

BelowOneDegreeColorProperty

public static final java.lang.String BelowOneDegreeColorProperty
See Also:
Constant Field Values

EquatorColorProperty

public static final java.lang.String EquatorColorProperty
See Also:
Constant Field Values

DateLineColorProperty

public static final java.lang.String DateLineColorProperty
See Also:
Constant Field Values

SpecialLineColorProperty

public static final java.lang.String SpecialLineColorProperty
See Also:
Constant Field Values

TextColorProperty

public static final java.lang.String TextColorProperty
See Also:
Constant Field Values

ThresholdProperty

public static final java.lang.String ThresholdProperty
See Also:
Constant Field Values

ShowRulerProperty

public static final java.lang.String ShowRulerProperty
See Also:
Constant Field Values

ShowOneAndFiveProperty

public static final java.lang.String ShowOneAndFiveProperty
See Also:
Constant Field Values

ShowBelowOneProperty

public static final java.lang.String ShowBelowOneProperty
See Also:
Constant Field Values

FontSizeProperty

public static final java.lang.String FontSizeProperty
See Also:
Constant Field Values

showRulerButton

protected javax.swing.JCheckBox showRulerButton

show15Button

protected javax.swing.JCheckBox show15Button

showBelow1Button

protected javax.swing.JCheckBox showBelow1Button

paletteBox

protected javax.swing.Box paletteBox
The user interface palette for the Graticule layer.

Constructor Detail

GraticuleLayer

public GraticuleLayer()
Construct the GraticuleLayer.

Method Detail

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties properties)
The properties and prefix are managed and decoded here, for the standard uses of the GraticuleLayer.

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class OMGraphicHandlerLayer
Parameters:
prefix - string prefix used in the properties file for this layer.
properties - the properties set in the properties file.

setShowOneAndFiveLines

public void setShowOneAndFiveLines(boolean set)

setShowBelowOneLines

public void setShowBelowOneLines(boolean set)

getShowOneAndFiveLines

public boolean getShowOneAndFiveLines()

getShowBelowOneLines

public boolean getShowBelowOneLines()

setShowRuler

public void setShowRuler(boolean set)

getShowRuler

public boolean getShowRuler()

getProperties

public java.util.Properties getProperties(java.util.Properties properties)
The properties and prefix are managed and decoded here, for the standard uses of the GraticuleLayer.

Specified by:
getProperties in interface PropertyConsumer
Overrides:
getProperties in class OMGraphicHandlerLayer
Parameters:
properties - the properties set in the properties file.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getPropertyInfo

public java.util.Properties getPropertyInfo(java.util.Properties properties)
The properties and prefix are managed and decoded here, for the standard uses of the GraticuleLayer.

Specified by:
getPropertyInfo in interface PropertyConsumer
Overrides:
getPropertyInfo in class OMGraphicHandlerLayer
Parameters:
properties - the properties set in the properties file.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

renderDataForProjection

public void renderDataForProjection(Projection proj,
                                    java.awt.Graphics g)
Implementing the ProjectionPainter interface.

Specified by:
renderDataForProjection in interface ProjectionPainter
Overrides:
renderDataForProjection in class OMGraphicHandlerLayer
Parameters:
proj - Projection of the map.
g - java.awt.Graphics to draw into.

projectionChanged

public void projectionChanged(ProjectionEvent e)
Invoked when the projection has changed or this Layer has been added to the MapBean.

Perform some extra checks to see if reprojection of the graphics is really necessary.

Specified by:
projectionChanged in interface ProjectionListener
Overrides:
projectionChanged in class OMGraphicHandlerLayer
Parameters:
e - ProjectionEvent
See Also:
ProjectionChangePolicy, StandardPCPolicy, ListResetPCPolicy

prepare

public OMGraphicList prepare()
Creates the OMGraphic list with graticule lines.

Overrides:
prepare in class OMGraphicHandlerLayer

constructGraticuleLines

protected OMGraphicList constructGraticuleLines()
Create the graticule lines.

NOTES:

Returns:
OMGraphicList new graphic list

evaluateSpacing

protected int evaluateSpacing(float up,
                              float down,
                              float left,
                              float right)
Figure out which graticule lines should be drawn based on the treshold set in the layer, and the coordinates of the screen. Method checks for crossing of the dateline, but still assumes that the up and down latitude coordinates are less than abs(+/-80). This is because the projection shouldn't give anything above 90 degrees, and we limit the lines to less than 80..

Parameters:
up - northern latitude coordinate, in decimal degrees,
down - southern latitude coordinate, in decimal degrees.
left - western longitude coordinate, in decimal degrees,
right - eastern longitude coordinate, in decimal degrees.
Returns:
which lines should be shown, either SHOW_TENS, SHOW_FIVES and SHOW_ONES.

constructGraticuleLines

protected OMGraphicList constructGraticuleLines(float up,
                                                float down,
                                                float left,
                                                float right,
                                                int showWhichLines)
Construct the five degree and one degree graticule lines, depending on the showWhichLines setting. Assumes that the coordinates passed in do not cross the dateline, and that the up is not greater than 80 and that the south is not less than -80.

Parameters:
up - northern latitude coordinate, in decimal degrees,
down - southern latitude coordinate, in decimal degrees.
left - western longitude coordinate, in decimal degrees,
right - eastern longitude coordinate, in decimal degrees.
showWhichLines - indicator for which level of lines should be included, either SHOW_FIVES or SHOW_ONES. SHOW_TENS could be there, too, but then we wouldn't do anything.

constructTenDegreeLines

protected OMGraphicList constructTenDegreeLines(double ctrLon)
Create the ten degree lines.


constructTensLabels

protected OMGraphicList constructTensLabels(float up,
                                            float down,
                                            float left,
                                            float right,
                                            boolean doLats)
Constructs the labels for the tens lines. Called from within the constructGraticuleLines if the showRuler variable is true. Usually called only if the ones and fives lines are not being drawn.

Parameters:
up - northern latitude coordinate, in decimal degrees,
down - southern latitude coordinate, in decimal degrees.
left - western longitude coordinate, in decimal degrees,
right - eastern longitude coordinate, in decimal degrees.
doLats - do the latitude labels if true.
Returns:
OMGraphicList of labels.

constructMarkerLines

protected OMGraphicList constructMarkerLines(double ctrLon)
Constructs the Dateline and Prime Meridian lines.


setLineTypeAndProject

protected void setLineTypeAndProject(OMGraphicList list,
                                     int lineType)
Take a graphic list, and set all the items on the list to the line type specified, and project them into the current projection.

Parameters:
list - the list containing the lines to change.
lineType - the line type to change the lines to.

getGUI

public java.awt.Component getGUI()
Creates the interface palette.

Overrides:
getGUI in class Layer
Returns:
java.awt.Component or null, null by default.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Used just for the redraw button.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class OMGraphicHandlerLayer


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details