|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.bbn.openmap.Layer com.bbn.openmap.layer.OMGraphicHandlerLayer com.bbn.openmap.layer.GraticuleLayer
public class GraticuleLayer
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
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 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 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 |
---|
protected boolean defaultShowRuler
protected boolean defaultShowOneAndFiveLines
protected boolean defaultShowBelowOneLines
protected int defaultThreshold
protected boolean boxy
protected int threshold
protected OMGraphicList tenDegreeLines
protected OMGraphicList markerLines
protected boolean showOneAndFiveLines
protected boolean showBelowOneLines
protected boolean showRuler
protected java.awt.Font font
protected int fontSize
protected java.awt.Color tenDegreeColor
protected java.awt.Color fiveDegreeColor
protected java.awt.Color oneDegreeColor
protected java.awt.Color belowOneDegreeColor
protected java.awt.Color equatorColor
protected java.awt.Color dateLineColor
protected java.awt.Color specialLineColor
protected java.awt.Color textColor
protected java.lang.String defaultTenDegreeColorString
protected java.lang.String defaultFiveDegreeColorString
protected java.lang.String defaultOneDegreeColorString
protected java.lang.String defaultBelowOneDegreeColorString
protected java.lang.String defaultEquatorColorString
protected java.lang.String defaultDateLineColorString
protected java.lang.String defaultSpecialLineColorString
protected java.lang.String defaultTextColorString
public static final java.lang.String TenDegreeColorProperty
public static final java.lang.String FiveDegreeColorProperty
public static final java.lang.String OneDegreeColorProperty
public static final java.lang.String BelowOneDegreeColorProperty
public static final java.lang.String EquatorColorProperty
public static final java.lang.String DateLineColorProperty
public static final java.lang.String SpecialLineColorProperty
public static final java.lang.String TextColorProperty
public static final java.lang.String ThresholdProperty
public static final java.lang.String ShowRulerProperty
public static final java.lang.String ShowOneAndFiveProperty
public static final java.lang.String ShowBelowOneProperty
public static final java.lang.String FontSizeProperty
protected javax.swing.JCheckBox showRulerButton
protected javax.swing.JCheckBox show15Button
protected javax.swing.JCheckBox showBelow1Button
protected javax.swing.Box paletteBox
Constructor Detail |
---|
public GraticuleLayer()
Method Detail |
---|
public void setProperties(java.lang.String prefix, java.util.Properties properties)
setProperties
in interface PropertyConsumer
setProperties
in class OMGraphicHandlerLayer
prefix
- string prefix used in the properties file for this layer.properties
- the properties set in the properties file.public void setShowOneAndFiveLines(boolean set)
public void setShowBelowOneLines(boolean set)
public boolean getShowOneAndFiveLines()
public boolean getShowBelowOneLines()
public void setShowRuler(boolean set)
public boolean getShowRuler()
public java.util.Properties getProperties(java.util.Properties properties)
getProperties
in interface PropertyConsumer
getProperties
in class OMGraphicHandlerLayer
properties
- the properties set in the properties file.
public java.util.Properties getPropertyInfo(java.util.Properties properties)
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class OMGraphicHandlerLayer
properties
- the properties set in the properties file.
public void renderDataForProjection(Projection proj, java.awt.Graphics g)
renderDataForProjection
in interface ProjectionPainter
renderDataForProjection
in class OMGraphicHandlerLayer
proj
- Projection of the map.g
- java.awt.Graphics to draw into.public void projectionChanged(ProjectionEvent e)
Perform some extra checks to see if reprojection of the graphics is really necessary.
projectionChanged
in interface ProjectionListener
projectionChanged
in class OMGraphicHandlerLayer
e
- ProjectionEventProjectionChangePolicy
,
StandardPCPolicy
,
ListResetPCPolicy
public OMGraphicList prepare()
prepare
in class OMGraphicHandlerLayer
protected OMGraphicList constructGraticuleLines()
NOTES:
protected int evaluateSpacing(float up, float down, float left, float right)
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.
protected OMGraphicList constructGraticuleLines(float up, float down, float left, float right, int showWhichLines)
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.protected OMGraphicList constructTenDegreeLines(double ctrLon)
protected OMGraphicList constructTensLabels(float up, float down, float left, float right, boolean doLats)
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.
protected OMGraphicList constructMarkerLines(double ctrLon)
protected void setLineTypeAndProject(OMGraphicList list, int lineType)
list
- the list containing the lines to change.lineType
- the line type to change the lines to.public java.awt.Component getGUI()
getGUI
in class Layer
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class OMGraphicHandlerLayer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |