com.bbn.openmap.layer.beanbox
Class SimpleBeanLayer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.bbn.openmap.Layer
                  extended by com.bbn.openmap.layer.beanbox.SimpleBeanLayer
All Implemented Interfaces:
ProjectionListener, ProjectionPainter, PropertyConsumer, BeanBoxHandler, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.io.Serializable, java.util.EventListener

public class SimpleBeanLayer
extends Layer
implements BeanBoxHandler

An OpenMap Layer for displaying SimpleBeanObjectbeans. This class an example of an openmap layer that contains an instance of the BeanBoxclass. This layer maintains a reference to an instance of SimpleBeanBoxclass which is a sample implementation of the BeanBoxclass. The SimpleBeanBoxclass manages the set of SimpleBeanObjectbeans that are displayed by this layer.

See Also:
Serialized Form

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  SimpleBeanBox beanBox
           
protected  java.util.HashMap beans
           
protected  java.util.HashMap graphics
           
protected  Projection projection
           
 
Fields inherited from class com.bbn.openmap.Layer
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, readyToPaint, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, 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
SimpleBeanLayer()
           
 
Method Summary
 void addObject(SimpleBeanObject object)
          Adds a bean to this layer.
 BeanBox getBeanBox()
          returns a layer specific implementation of the BeanBoxclass instance.
 OMGraphic getGraphic(long id)
           
 OMGraphic getGraphic(java.lang.Long id)
          return the OMGraphic object associated with the SimpleBeanObject with the specified id.
 MapMouseListener getMapMouseListener()
          Returns the MapMouseListener object that handles the mouse events.
 SimpleBeanObject getObject(long id)
           
 SimpleBeanObject getObject(java.lang.Long id)
          returns a bean with the specified id.
 java.util.Vector getObjects()
          return all SimpleBeanObject beans maintained by this layer.
 Projection getProjection()
          Gets the current projection
 void paint(java.awt.Graphics g)
          override Component method
 void projectionChanged(ProjectionEvent event)
          Implement ProjectionListener method inherited from Layer.
 void removeObject(long id)
           
 void removeObject(java.lang.Long id)
          Removes a bean from this layer.
 void updateGraphics()
          Update all OMGraphic objects maintained by this layer using the information stored in corresponding SimpleBeanObject beans.
 void updateObject(SimpleBeanObject object)
          Update the specified SimpleBeanObject object that may be maintained by this layer.
 
Methods inherited from class com.bbn.openmap.Layer
actionPerformed, addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, dispose, 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, getGUI, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProperties, getPropertyInfo, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isReadyToPaint, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, renderDataForProjection, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setProperties, setPropertyPrefix, setReadyToPaint, setRemovable, setVisible, setWindowSupport, showPalette
 
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

beans

protected java.util.HashMap beans

graphics

protected java.util.HashMap graphics

projection

protected Projection projection

beanBox

protected SimpleBeanBox beanBox
Constructor Detail

SimpleBeanLayer

public SimpleBeanLayer()
Method Detail

getBeanBox

public BeanBox getBeanBox()
Description copied from interface: BeanBoxHandler
returns a layer specific implementation of the BeanBoxclass instance.

Specified by:
getBeanBox in interface BeanBoxHandler
Returns:
the instance of SimpleBeanBox that is maintained by this layer.

getProjection

public Projection getProjection()
Gets the current projection

Overrides:
getProjection in class Layer

getMapMouseListener

public MapMouseListener getMapMouseListener()
Description copied from class: Layer
Returns the MapMouseListener object that handles the mouse events. This method is IGNORED in this class: it returns null. Derived Layers should return the appropriate object if they desire to receive MouseEvents. The easiest thing for a Layer to do in order to receive MouseEvents is to implement the MapMouseListener interface and return itself. A code snippet:

 public MapMouseListener getMapMouseListener() {
     return this;
 }
 
 public String[] getMouseModeServiceList() {
     return new String[] { SelectMouseMode.modeID };
 }
 

Overrides:
getMapMouseListener in class Layer
Returns:
an instance of SimpleBeanBox, which implements the MapMouseListener interface.

projectionChanged

public void projectionChanged(ProjectionEvent event)
Implement ProjectionListener method inherited from Layer.

Specified by:
projectionChanged in interface ProjectionListener
Parameters:
event - ProjectionEvent

paint

public void paint(java.awt.Graphics g)
override Component method

Overrides:
paint in class javax.swing.JComponent

updateGraphics

public void updateGraphics()
Update all OMGraphic objects maintained by this layer using the information stored in corresponding SimpleBeanObject beans.


addObject

public void addObject(SimpleBeanObject object)
Adds a bean to this layer.


removeObject

public void removeObject(java.lang.Long id)
Removes a bean from this layer.


removeObject

public void removeObject(long id)

getObject

public SimpleBeanObject getObject(java.lang.Long id)
returns a bean with the specified id.


getObject

public SimpleBeanObject getObject(long id)

getObjects

public java.util.Vector getObjects()
return all SimpleBeanObject beans maintained by this layer.


getGraphic

public OMGraphic getGraphic(java.lang.Long id)
return the OMGraphic object associated with the SimpleBeanObject with the specified id.


getGraphic

public OMGraphic getGraphic(long id)

updateObject

public void updateObject(SimpleBeanObject object)
Update the specified SimpleBeanObject object that may be maintained by this layer.



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