|
||||||||||
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.BufferedLayer
public class BufferedLayer
A BufferedLayer is a layer that buffers a group of layers into an image. When this layer repaints, the image gets rendered. This layer can be used to group a set of layers into one, and was designed with the idea that it is a background layer where a more animated layer would be on top of it.
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.
Nested Class Summary | |
---|---|
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. |
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 boolean |
hasTransparentBackground
Used to tell the BufferedLayer that the background is transparent. |
static java.lang.String |
LayersProperty
|
static java.lang.String |
VisibleLayersProperty
|
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 | |
---|---|
BufferedLayer()
|
Method Summary | |
---|---|
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. |
boolean |
isReadyToPaint()
Returns true if all children are are ready to be painted - that is, they have called for a repaint. |
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. |
void |
setReadyToPaint(boolean readyToPaint)
Set whether this layer should be ready to paint. |
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, 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, 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 |
---|
public static final java.lang.String LayersProperty
public static final java.lang.String VisibleLayersProperty
protected boolean hasTransparentBackground
Constructor Detail |
---|
public BufferedLayer()
Method Detail |
---|
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 boolean isReadyToPaint()
isReadyToPaint
in class Layer
public void setReadyToPaint(boolean readyToPaint)
setReadyToPaint
in class Layer
readyToPaint
- the readyToPaint to setpublic 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)
removed
in class Layer
cont
- Containerpublic void resetPalette()
resetPalette
in class Layer
public java.awt.Component getGUI()
getGUI
in class Layer
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |