|
|||||||||||
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.ScaleFilterLayer
An OpenMap Layer that encapsulates other layers and acts as a scale filter. It will delegate responsibility to one of several layers depending on the scale.
To use this layer, list it as a layer in the openmap.properties
file in the openmap.layers properties, as you would add any other
layer. Then, add these properties to the openmap.properties file.
The layers added to the ScaleFilterLayer do not get added to the
openmap.layers property, but instead get added to the
scaledFilterLayer.layers property listed here. Then, the properties
for these layers are added to the openmap.properties file like any
other layer.
The properties for this layer look like this:
#######################################
# Properties for ScaleFilterLayer
#######################################
scaledFilterLayer.class=com.bbn.openmap.layer.ScaleFilterLayer
scaledFilterLayer.prettyName=<Pretty name used on menu&ge
# List 2 or more layers, larger scale layers first
scaledFilterLayer.layers=layer_1 layer_2 layer_3 ...
# List the transition scales to switch between layers
scaledFilterLayer.transitionScales= (transition scale from layer 1 to 2) (transition scale from layer 2 to 3) (...)
#######################################
Field Summary | |
protected MapMouseListener |
clmml
The current MapMouseListener from the currently appropriate layer. |
protected boolean |
coolMM
Flag to specify that the current layer wants events from the current active mouse mode. |
protected float |
defaultTransitionScale
The default transition scale. |
protected java.util.Vector |
layers
The layers. |
static java.lang.String |
layersProperty
The layers property. |
protected java.lang.String |
mmID
The current active mouse mode ID. |
protected javax.swing.JPanel |
panel
|
protected javax.swing.JTabbedPane |
tabs
|
protected int |
targetIndex
The index of the currently selected layer. |
protected float[] |
transitionScales
The transition scales. |
static java.lang.String |
transitionScalesProperty
The transition scales property. |
Fields inherited from class com.bbn.openmap.Layer |
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, autoPalette, AutoPaletteProperty, beanContextChildSupport, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, IDListeners, localHackList, lsListeners, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, RemoveableProperty, SWING_PACKAGE, 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 | |
ScaleFilterLayer()
Initializes an empty layer. |
Method Summary | |
boolean |
checkMouseMode()
Set the coolMM flag, whenever the scale-appropriate layer changes, or if the active mouse mode changes. |
void |
findAndInit(java.lang.Object obj)
MapHandler child methods, passing found objects to child layers. |
void |
findAndUndo(java.lang.Object obj)
MapHandler child methods, passing removed objects to child layers. |
protected Layer |
getAppropriateLayer()
Get the layer that's appropriate at the current scale. |
MapMouseListener |
getCurrentLayerMapMouseListener()
Get the MapMouseListener to received events if the current layer wants them. |
java.awt.Component |
getEmptyGUIFiller(Layer layer)
|
java.awt.Component |
getGUI()
Get the GUI (palettes) for the layers. |
java.util.Vector |
getLayers()
Get the Vector holding the Layers. |
MapMouseListener |
getMapMouseListener()
Try to handle mouse events for the current layer. |
java.lang.String[] |
getMouseModeServiceList()
Return a list of the modes that are interesting to the MapMouseListener. |
java.util.Properties |
getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the current values of the layer. |
float[] |
getTransitionScales()
Get the transition scales used to set the active layer. |
boolean |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
boolean |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved()
Handle a mouse cursor moving without the button being pressed. |
boolean |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons down). |
boolean |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
boolean |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. |
void |
paint(java.awt.Graphics g)
Renders the scale-appropriate layer on the map. |
protected void |
parseLayers(java.lang.String prefix,
java.util.Properties props)
Create the Layers from a property value string. |
protected void |
parseScales(java.lang.String prefix,
java.util.Properties props)
Create the transition scales from a property value string. |
void |
projectionChanged(ProjectionEvent ev)
Handles projection change notification events. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Listen for changes to the active mouse mode and for any changes to the list of available mouse modes |
void |
renderDataForProjection(Projection proj,
java.awt.Graphics g)
Implementing the ProjectionPainter interface. |
void |
requestBrowserContent(InfoDisplayEvent event)
Request that plain text or html text be displayed in a browser. |
void |
requestCursor(java.awt.Cursor cursor)
Request that the MapBean cursor be set to a certain type. |
void |
requestHideToolTip()
Request a tool tip be hidden. |
void |
requestInfoLine(InfoDisplayEvent event)
Request to have an information line displayed in an application status window. |
void |
requestMessage(InfoDisplayEvent event)
Request to have a message displayed in a dialog window. |
void |
requestShowToolTip(InfoDisplayEvent event)
Request a tool tip be shown. |
void |
requestURL(InfoDisplayEvent event)
Request to have a URL displayed in a Browser. |
void |
setBeanContext(java.beans.beancontext.BeanContext in_bc)
Method for BeanContextChild interface. |
void |
setCurrentLayerMapMouseListener(MapMouseListener mml)
Pre-set the MapMouseListener to received events if the current layer wants them. |
void |
setLayersAndScales(java.util.Vector list,
float[] scales)
Programmatic way to set layers and scales. |
protected void |
setPaletteTab(int layerIndex)
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Initializes this layer from the given properties. |
boolean |
setTargetIndex(float scale)
Calculate the index of the target layer. |
void |
updateLayerStatus(LayerStatusEvent evt)
Try to handle receiving LayerStatusEvents from child layers. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
public static final transient java.lang.String layersProperty
public static final transient java.lang.String transitionScalesProperty
protected java.util.Vector layers
protected float[] transitionScales
protected float defaultTransitionScale
protected int targetIndex
protected javax.swing.JPanel panel
protected javax.swing.JTabbedPane tabs
protected java.lang.String mmID
protected boolean coolMM
protected MapMouseListener clmml
Constructor Detail |
public ScaleFilterLayer()
Method Detail |
public java.util.Vector getLayers()
public float[] getTransitionScales()
public void setLayersAndScales(java.util.Vector list, float[] scales)
list
- Vector of layersscales
- Array of transition scales.public void setProperties(java.lang.String prefix, java.util.Properties props)
setProperties
in interface PropertyConsumer
setProperties
in class Layer
props
- the Properties
holding settings for
this layerprefix
- the token to prefix the property namespublic java.util.Properties getProperties(java.util.Properties props)
Layer
getProperties
in interface PropertyConsumer
getProperties
in class Layer
props
- a Properties object to load the PropertyConsumer
properties into. If props equals null, then a new
Properties object should be created.
protected Layer getAppropriateLayer()
protected void parseLayers(java.lang.String prefix, java.util.Properties props)
prefix
- Stringprops
- Propertiesprotected void parseScales(java.lang.String prefix, java.util.Properties props)
prefix
- Stringprops
- Propertiespublic void renderDataForProjection(Projection proj, java.awt.Graphics g)
renderDataForProjection
in interface ProjectionPainter
renderDataForProjection
in class Layer
proj
- Projection of the map.g
- java.awt.Graphics to draw into.public boolean setTargetIndex(float scale)
scale
- the current map scale
public void projectionChanged(ProjectionEvent ev)
Projection
.
projectionChanged
in interface ProjectionListener
ev
- the new projection eventpublic void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
g
- a graphics contextpublic void updateLayerStatus(LayerStatusEvent evt)
updateLayerStatus
in interface LayerStatusListener
evt
- LayerStatusEventpublic java.awt.Component getGUI()
getGUI
in class Layer
public java.awt.Component getEmptyGUIFiller(Layer layer)
protected void setPaletteTab(int layerIndex)
public void requestURL(InfoDisplayEvent event)
requestURL
in interface InfoDisplayListener
event
- InfoDisplayEventpublic void requestMessage(InfoDisplayEvent event)
requestMessage
in interface InfoDisplayListener
event
- InfoDisplayEventpublic void requestInfoLine(InfoDisplayEvent event)
requestInfoLine
in interface InfoDisplayListener
event
- InfoDisplayEventpublic void requestBrowserContent(InfoDisplayEvent event)
requestBrowserContent
in interface InfoDisplayListener
event
- InfoDisplayEventpublic void requestCursor(java.awt.Cursor cursor)
requestCursor
in interface InfoDisplayListener
cursor
- java.awt.Cursor to set over the MapBean.public void requestShowToolTip(InfoDisplayEvent event)
requestShowToolTip
in interface InfoDisplayListener
event
- The InfoDisplayEvent containing the text and
requestor.public void requestHideToolTip()
requestHideToolTip
in interface InfoDisplayListener
public MapMouseListener getMapMouseListener()
getMapMouseListener
in class Layer
public boolean checkMouseMode()
public void setCurrentLayerMapMouseListener(MapMouseListener mml)
public MapMouseListener getCurrentLayerMapMouseListener()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public java.lang.String[] getMouseModeServiceList()
return new String[] { SelectMouseMode.modeID };
- Specified by:
getMouseModeServiceList
in interface MapMouseListener
- Returns:
- String[] of modeID's
- See Also:
NavMouseMode.modeID
,
SelectMouseMode.modeID
,
NullMouseMode.modeID
public boolean mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface MapMouseListener
e
- MouseEvent
public boolean mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface MapMouseListener
e
- MouseEvent
public boolean mouseClicked(java.awt.event.MouseEvent e)
mousePressed()
, or if no other listener
processes the event. If the listener successfully processes
mouseClicked()
, then it will receive the next
mouseClicked()
notifications that have a click
count greater than one.
mouseClicked
in interface MapMouseListener
e
- MouseEvent
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface MapMouseListener
e
- MouseEventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface MapMouseListener
e
- MouseEventpublic boolean mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface MapMouseListener
e
- MouseEvent
public boolean mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface MapMouseListener
e
- MouseEvent
public void mouseMoved()
mouseMoved
in interface MapMouseListener
public void setBeanContext(java.beans.beancontext.BeanContext in_bc) throws java.beans.PropertyVetoException
setBeanContext
in interface java.beans.beancontext.BeanContextChild
setBeanContext
in class Layer
java.beans.PropertyVetoException
public void findAndInit(java.lang.Object obj)
findAndInit
in class Layer
public void findAndUndo(java.lang.Object obj)
findAndUndo
in class Layer
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |