## com.bbn.openmap
Class BufferedLayerMapBean

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  com.bbn.openmap.MapBean
                      com.bbn.openmap.BufferedMapBean
                          com.bbn.openmap.BufferedLayerMapBean

All Implemented Interfaces:
  CenterListener, java.awt.event.ComponentListener, java.awt.event.ContainerListener, java.util.EventListener, java.awt.image.ImageObserver, LayerListener, java.awt.MenuContainer, PanListener, ProjectionListener, java.io.Serializable, SoloMapComponent, ZoomListener

public class BufferedLayerMapBean
extends BufferedMapBean

The BufferedLayerMapBean is a BufferedMapBean with an additional image buffer that holds Layers designated as background layers. The additional image buffer is a BufferedLayer that this MapBean manages, and all background layers are added to the BufferedLayer, which is automatically added to the bottom of the map. When layers are added to the MapBean via the setLayers() method, the Layer.getAddAsBackground() flag is checked, and if that is true for a layer, it is added to the BufferedLayer. The background layers do not receive mouse events.

It should be cautioned that the appearance of the map may not match the layer stack as it is delivered to the MapBean because of this flag. If, for example, layers 1 and 4 are marked as background layers, while layers 2 and 3 are not (in a 4 layer stack), then the map will show layers 2, 3, 1, 4, with layers 1 and 4 being displayed from the BufferedLayer. Something to think about when it comes to designing GUI elements.

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`java.awt.Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary
`protected BufferedLayer` `bufferedLayer`
`protected boolean` `DEBUG`

Fields inherited from class com.bbn.openmap.BufferedMapBean
`bufferDirty, drawingBuffer`

Fields inherited from class com.bbn.openmap.MapBean

`addedLayers, background, BackgroundProperty, currentLayers, CursorProperty, DEFAULT_BACKGROUND_COLOR, DEFAULT_CENTER_LAT, DEFAULT_CENTER_LON, DEFAULT_HEIGHT, DEFAULT_SCALE, DEFAULT_WIDTH, doContainerChange, layerRemovalDelayed, LayersProperty, minHeight, minWidth, painters, projection, ProjectionProperty, projectionSupport, ProjectionVetoedProperty, removedLayers, repaintPolicy, suppressCopyright, title, version`

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 java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`BufferedLayerMapBean()` Construct a MapBean.

Method Summary
`protected void` `changeLayers(java.awt.event.ContainerEvent e)` ContainerListener Interface method.
`BufferedLayer` `getBufferedLayer()`
`void` `setBackgroundColor(java.awt.Color color)` Set the background color of the map.
`void` `setBckgrnd(java.awt.Paint paint)` Set the background of the map.
`void` `setBufferedLayer(BufferedLayer bl)`
`void` `setLayers(LayerEvent evt)` LayerListener interface method.
`void` `setMapBeanRepaintPolicy(MapBeanRepaintPolicy mbrp)` Set the MapBeanRepaintPolicy used by the MapBean.

Methods inherited from class com.bbn.openmap.BufferedMapBean
`componentResized, isBufferDirty, isBuffered, paintChildren, paintChildren, setBufferDirty`

Methods inherited from class com.bbn.openmap.MapBean

`addImpl, addPaintListener, addProjectionListener, addPropertyChangeListener, center, componentAdded, componentHidden, componentMoved, componentRemoved, componentShown, debugmsg, drawProjectionBackground, fireProjectionChanged, getBackground, getBckgrnd, getCenter, getCoordinates, getCoordinates, getCopyrightMessage, getDoContainerChange, getInsets, getMapBeanRepaintPolicy, getMinimumSize, getProjection, getProjectionType, getScale, hideLayerPalettes, isLayerRemovalDelayed, paint, paintBorder, paintChildrenWithBorder, pan, projectionChanged, purgeAndNotifyRemovedLayers, removePaintListener, removeProjectionListener, repaint, setBackground, setCenter, setCenter, setCursor, setDoContainerChange, setLayerRemovalDelayed, setLayout, setMinimumSize, setProjection, setProjectionType, setScale, showLayerPalettes, toString, zoom`

Methods inherited from class javax.swing.JComponent

`addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, 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, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI`

Methods inherited from class java.awt.Container

`add, add, add, add, add, addContainerListener, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree`

Methods inherited from class java.awt.Component

`action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### bufferedLayer

    protected BufferedLayer bufferedLayer

### DEBUG

    protected boolean DEBUG

Constructor Detail

### BufferedLayerMapBean

    public BufferedLayerMapBean()

  Construct a MapBean.

Method Detail

### setBackgroundColor

    public void setBackgroundColor(java.awt.Color color)

  Set the background color of the map. Actually sets the background color of the projection, and calls repaint().

  Overrides:
    `setBackgroundColor` in class `MapBean`
  Parameters:
    `color` - java.awt.Color.

### setBckgrnd

    public void setBckgrnd(java.awt.Paint paint)

  Description copied from class: `MapBean`
  Set the background of the map. If the background for this MapBean is not null, the background of the projection will be used.

  Overrides:
    `setBckgrnd` in class `MapBean`
  Parameters:
    `paint` - java.awt.Paint.

### setBufferedLayer

    public void setBufferedLayer(BufferedLayer bl)

### getBufferedLayer

    public BufferedLayer getBufferedLayer()

### setMapBeanRepaintPolicy

    public void setMapBeanRepaintPolicy(MapBeanRepaintPolicy mbrp)

  Set the MapBeanRepaintPolicy used by the MapBean. This method is overriden in order to pass the policy on to the MapBean stored in the internal BufferedLayer.

  Overrides:
    `setMapBeanRepaintPolicy` in class `MapBean`

### setLayers

    public void setLayers(LayerEvent evt)

  LayerListener interface method. A list of layers will be added, removed, or replaced based on on the type of LayerEvent.

  Specified by:
    `setLayers` in interface `LayerListener`
  Overrides:
    `setLayers` in class `BufferedMapBean`
  Parameters:
    `evt` - a LayerEvent

### changeLayers

    protected void changeLayers(java.awt.event.ContainerEvent e)

  ContainerListener Interface method. Should not be called directly. Part of the ContainerListener interface, and it's here to make the MapBean a good Container citizen.

  Overrides:
    `changeLayers` in class `MapBean`
  Parameters:
    `e` - ContainerEvent

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