|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.bbn.openmap.gui.OMComponentPanel
com.bbn.openmap.gui.BasicMapPanel
The BasicMapPanel is a MapPanel and OMComponentPanel that is the heart of the OpenMap application framework. It can be used in a application or applet. The Panel has a BorderLayout, and creates a MapBean for its center area. It creates a MapHandler to use to hold all of its OpenMap components, and uses the PropertyHandler given to it in its constructor to create and configure all of the application components. The best way to add components to the MapPanel is to get the MapHandler from it and add components to that. The BasicMapPanel also adds itself to its MapHandler, so when the PropertyHandler adds MapPanelChildren components to the MapHandler, the BasicMapPanel is able to find them via the findAndInit method. By default, the BasicMapPanel looks for MapPanelChildren and asks them for where they would prefer to be located (BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST, BorderLayout.WEST). If you extend this component, though, other components could be found via that same findAndInit method.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
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 MapBean |
mapBean
|
protected MapHandler |
mapHandler
|
protected MenuList |
menuList
|
protected PropertyHandler |
propertyHandler
|
Fields inherited from class com.bbn.openmap.gui.OMComponentPanel |
beanContextChildSupport, i18n, propertyPrefix, 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 | |
BasicMapPanel()
Creates an empty MapPanel that creates its own empty PropertyHandler. |
|
BasicMapPanel(boolean delayCreation)
Create a MapPanel with the option of delaying the search for properties until the create() call is made. |
|
BasicMapPanel(PropertyHandler propertyHandler)
Create a MapPanel that configures itself with the properties contained in the PropertyHandler provided. |
|
BasicMapPanel(PropertyHandler propertyHandler,
boolean delayCreation)
Create a MapPanel that configures itself with properties contained in the PropertyHandler provided, and with the option of delaying the search for properties until the create() call is made. |
Method Summary | |
protected void |
addMapBeanToPanel(MapBean map)
Position the map bean in this panel according to the layout manger. |
void |
addMapComponent(java.lang.Object mapComponent)
Adds a component to the map bean context. |
protected void |
addMapPanelChild(MapPanelChild mpc)
Add a child to the MapPanel. |
void |
addProperties(java.util.Properties p)
Add in the properties from the given Properties object. |
void |
addProperties(java.lang.String propFile)
Add in the properties from the given source, which can be a resorce, file or URL. |
void |
addProperties(java.net.URL urlToProperties)
Add in the properties from the given URL. |
void |
addProperty(java.lang.String property,
java.lang.String value)
Add (or overwrite) a property to the current properties |
void |
appendProperty(java.lang.String property,
java.util.Properties src)
Append the given property into the current properties |
void |
appendProperty(java.lang.String property,
java.lang.String value)
Append the given property into the current properties |
void |
create()
The method that triggers setLayout() and createComponents() to be called. |
protected void |
createComponents()
The constructor calls this method that creates the MapHandler and MapBean, and then tells the PropertyHandler to create the components described in its properties. |
protected java.awt.LayoutManager |
createLayoutManager()
The constructor calls this method that sets the LayoutManager for this MapPanel. |
static MapBean |
createMapBean()
A static method that creates a MapBean with it's projection set to the values set in the Environment. |
static MapBean |
createMapBean(Projection proj,
javax.swing.border.Border border)
A static method that creates a MapBean and sets its projection and border to the values given. |
void |
findAndInit(java.lang.Object someObj)
The BasicMapPanel looks for MapPanelChild components, finds out from them where they prefer to be placed, and adds them. |
void |
findAndUndo(java.lang.Object someObj)
The MapPanel looks for MapPanelChild components and removes them from iteself. |
MapBean |
getMapBean()
MapPanel method. |
java.lang.Object |
getMapComponent(java.lang.String prefix)
Find the object with the given prefix by looking it up in the prefix librarian in the MapHandler. |
java.lang.Object |
getMapComponentByType(java.lang.Class c)
Given a Class, find the object in the MapHandler. |
java.util.Collection |
getMapComponentsByType(java.lang.Class c)
Get all of the mapComponents that are of the given class type. |
MapHandler |
getMapHandler()
MapPanel method. |
javax.swing.JMenu |
getMapMenu()
MapPanel method. |
javax.swing.JMenuBar |
getMapMenuBar()
MapPanel method. |
java.util.Properties |
getProperties()
Get the current properties. |
PropertyHandler |
getPropertyHandler()
Get the PropertyHandler containing properties used to configure the panel, creating it if it doesn't exist. |
void |
prependProperty(java.lang.String property,
java.util.Properties src)
Prepend the given property into the current properties |
void |
prependProperty(java.lang.String property,
java.lang.String value)
Prepend the given property into the current properties |
boolean |
removeMapComponent(java.lang.Object mapComponent)
Remove a component from the map bean context. |
void |
removeMarker(java.lang.String property,
java.lang.String marker)
remove a marker from a space delimated set of properties. |
boolean |
removeProperty(java.lang.String property)
Remove an existing property if it exists. |
void |
setMapBean(MapBean bean)
Set the map bean used in this map panel, replace the map bean in the MapHandler if there isn't already one, or if the policy allows replacement. |
void |
setPropertyHandler(PropertyHandler handler)
Set the PropertyHandler containing the properties used to configure this panel. |
Methods inherited from class com.bbn.openmap.gui.OMComponentPanel |
addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, fireVetoableChange, getBeanContext, getProperties, getPropertyInfo, getPropertyPrefix, getWindowSupport, removeVetoableChangeListener, setBeanContext, setProperties, setProperties, setPropertyPrefix, setWindowSupport |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
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, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
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, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.beans.beancontext.BeanContextChild |
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
protected MapHandler mapHandler
protected MapBean mapBean
protected PropertyHandler propertyHandler
protected MenuList menuList
Constructor Detail |
public BasicMapPanel()
public BasicMapPanel(boolean delayCreation)
create()
call is made.
delayCreation
- true to let the MapPanel know that the
artful programmer will call create()
public BasicMapPanel(PropertyHandler propertyHandler)
public BasicMapPanel(PropertyHandler propertyHandler, boolean delayCreation)
create()
call is made.
delayCreation
- true to let the MapPanel know that the
artful programmer will call create()
Method Detail |
public void create()
protected java.awt.LayoutManager createLayoutManager()
protected void addMapBeanToPanel(MapBean map)
protected void createComponents()
public MapBean getMapBean()
getMapBean
in interface MapPanel
public void setMapBean(MapBean bean)
MultipleSoloMapComponentException
- if there is already a
map bean in the map handler and the policy is to reject
duplicates (since the MapBean is a SoloMapComponent).public PropertyHandler getPropertyHandler()
public void setPropertyHandler(PropertyHandler handler)
public MapHandler getMapHandler()
getMapHandler
in interface MapPanel
public javax.swing.JMenuBar getMapMenuBar()
getMapMenuBar
in interface MapPanel
public javax.swing.JMenu getMapMenu()
getMapMenu
in interface MapPanel
public void addMapComponent(java.lang.Object mapComponent)
mapComponent
available to the map layers and
other components.
mapComponent
- a component to be added to the map bean
context
MultipleSoloMapComponentException
- if mapComponent is a
SoloMapComponent and another instance already exists
and the policy is a reject policy.public boolean removeMapComponent(java.lang.Object mapComponent)
mapComponent
- a component to be removed to the map bean
context
public java.lang.Object getMapComponentByType(java.lang.Class c)
public java.util.Collection getMapComponentsByType(java.lang.Class c)
public java.lang.Object getMapComponent(java.lang.String prefix)
public void findAndInit(java.lang.Object someObj)
findAndInit
in interface LightMapHandlerChild
findAndInit
in class OMComponentPanel
protected void addMapPanelChild(MapPanelChild mpc)
public void findAndUndo(java.lang.Object someObj)
findAndUndo
in interface LightMapHandlerChild
findAndUndo
in class OMComponentPanel
public static MapBean createMapBean()
public static MapBean createMapBean(Projection proj, javax.swing.border.Border border)
public java.util.Properties getProperties()
public boolean removeProperty(java.lang.String property)
public void addProperty(java.lang.String property, java.lang.String value)
public void addProperties(java.net.URL urlToProperties)
public void addProperties(java.lang.String propFile) throws java.net.MalformedURLException
java.net.MalformedURLException
- if propFile doesn't resolve
properly.public void removeMarker(java.lang.String property, java.lang.String marker)
public void addProperties(java.util.Properties p)
public void appendProperty(java.lang.String property, java.util.Properties src)
public void appendProperty(java.lang.String property, java.lang.String value)
public void prependProperty(java.lang.String property, java.util.Properties src)
public void prependProperty(java.lang.String property, java.lang.String value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |