public class BufferedLayer extends OMGraphicHandlerLayer implements java.beans.PropertyChangeListener
This layer contains a MapBean, and any layer that gets added to it simply gets added to the MapBean. When a layer needs to redraw itself, it can act normally, and the BufferedLayer will get updated as needed. If the MapBean is a BufferedMapBean (which it is by default), then the layers will get buffered into an image.
The BufferedLayer can be configured in the openmap.properties file:
bufLayer.class=com.bbn.openmap.layer.BufferedLayer bufLayer.prettyName=My Layer Group bufLayer.layers=layer1 layer2 layer3 bufLayer.visibleLayers=layer1 layer3layer1, layer2, etc should be defined as any other openmap layer.
Modifier and Type | Class and Description |
---|---|
class |
BufferedLayer.BLMapBean
An simple extension of the BufferedMapBean that calls a layer, presumably
its parent, to call repaint().
|
protected class |
BufferedLayer.VisHelper
Class that helps track turning on/off layers in the buffered layer.
|
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected boolean |
hasTransparentBackground
Used to tell the BufferedLayer that the background is transparent.
|
static java.lang.String |
LayersProperty |
static java.lang.String |
VisibleLayersProperty |
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, logger, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
BufferedLayer() |
Modifier and Type | Method and Description |
---|---|
void |
addLayer(Layer layer)
Add a layer to the group.
|
void |
clearLayers()
Remove all layers from the group.
|
void |
dispose()
Overrides Layer.dispose(), makes sure the OMGraphicList is cleared.
|
java.awt.Color |
getBackground()
Get the background color of the image.
|
java.awt.Paint |
getBckgrnd(java.awt.Paint paint)
Get the background Paint object used for the internal MapBean.
|
java.awt.Component |
getGUI()
Get the GUI (palettes) for the layers.
|
boolean |
getHasTransparentBackground() |
java.awt.Component[] |
getLayers()
Get the layers assigned to the internal MapBean.
|
MapBean |
getMapBean()
Get the current MapBean used in the BufferedLayer.
|
java.util.Properties |
getProperties(java.util.Properties props)
Overrides Layer getProperties method., also calls that method on Layer.
|
java.util.Properties |
getPropertyInfo(java.util.Properties props)
Not really implemented, because the mechanism for providing a set of
properties that let you add a variable number of new objects as children
to this one.
|
boolean |
hasLayers()
Return if there is at least one layer assigned to the group.
|
void |
paint(java.awt.Graphics g)
The default action is to get the OMGraphicList and render it.
|
void |
projectionChanged(ProjectionEvent pevent)
We don't want a projection change policy called here, because that will
call for a repaint.
|
void |
propertyChange(java.beans.PropertyChangeEvent pce)
PropertyChangeListener method, to listen for the source map's background
changes.
|
void |
removed(java.awt.Container cont)
Called when the layer is removed from the MapBean, and after the
projection changes.
|
void |
removeLayer(Layer layer)
Remove the layer from group.
|
void |
renderDataForProjection(Projection proj,
java.awt.Graphics g)
Part of the ProjectionPainter interface.
|
void |
resetPalette()
Should be called if layers are added or removed from the buffer.
|
void |
setBackground(java.awt.Color color)
Set the background color of the group.
|
void |
setBckgrnd(java.awt.Paint paint)
Set the background paint of the group.
|
void |
setBeanContext(java.beans.beancontext.BeanContext in_bc)
Method for BeanContextChild interface.
|
void |
setBufferDirty(boolean value) |
void |
setHasTransparentBackground(boolean value)
If true, will create a new image buffer when the projection changes.
|
void |
setMapBean(MapBean mb)
You can change what kind of MapBean is used to hold onto the layers.
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Overrides the Layer setProperties method.
|
actionPerformed, canSetList, copy, createLayerWorker, cut, deselect, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMapMouseListener, getMouseEventInterpreter, getMouseModeIDsForEvents, getProjectionChangePolicy, getRenderPolicy, getSelected, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, interrupt, isCancelled, isHighlightable, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paste, prepare, receivesMapEvents, resetFiltering, select, setCancelled, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete
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, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, setAddAsBackground, setAddToBeanContext, setAutoPalette, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setRemovable, setVisible, setWindowSupport, showPalette
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, isPaintingOrigin, 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, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String LayersProperty
public static final java.lang.String VisibleLayersProperty
protected boolean hasTransparentBackground
public void setProperties(java.lang.String prefix, java.util.Properties props)
OMGraphicHandlerLayer
setProperties
in interface PropertyConsumer
setProperties
in class OMGraphicHandlerLayer
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties props)
OMGraphicHandlerLayer
getProperties
in interface PropertyConsumer
getProperties
in class OMGraphicHandlerLayer
props
- a Properties object to load the PropertyConsumer properties
into. If props equals null, then a new Properties object should be
created.public java.util.Properties getPropertyInfo(java.util.Properties props)
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class OMGraphicHandlerLayer
props
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.public void setHasTransparentBackground(boolean value)
public boolean getHasTransparentBackground()
public void clearLayers()
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 addLayer(Layer layer)
public void removeLayer(Layer layer)
public boolean hasLayers()
public java.awt.Component[] getLayers()
public void setMapBean(MapBean mb)
mb
- new MapBeanpublic MapBean getMapBean()
public void setBackground(java.awt.Color color)
setBackground
in class javax.swing.JComponent
color
- java.awt.Color.public void setBckgrnd(java.awt.Paint paint)
paint
- java.awt.Paintpublic java.awt.Color getBackground()
getBackground
in class java.awt.Component
public java.awt.Paint getBckgrnd(java.awt.Paint paint)
public void projectionChanged(ProjectionEvent pevent)
projectionChanged
in interface ProjectionListener
projectionChanged
in class OMGraphicHandlerLayer
pevent
- ProjectionEventProjectionChangePolicy
,
StandardPCPolicy
,
ListResetPCPolicy
public void removed(java.awt.Container cont)
public void resetPalette()
resetPalette
in class Layer
public java.awt.Component getGUI()
public void paint(java.awt.Graphics g)
OMGraphicHandlerLayer
paint
in class OMGraphicHandlerLayer
g
- java.awt.Graphics object to render OMGraphics into.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 propertyChange(java.beans.PropertyChangeEvent pce)
propertyChange
in interface java.beans.PropertyChangeListener
public void dispose()
OMGraphicHandlerLayer
dispose
in class OMGraphicHandlerLayer
public void setBufferDirty(boolean value)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details