public class BasicMapPanel extends OMComponentPanel implements MapPanel
If a property prefix is set on this MapPanel, that property prefix can be used to designate MapPanelChild objects for this MapPanel. The setName variable should be set to true, and the children's parent name should match whatever property prefix is given to the panel.
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.util.logging.Logger |
logger |
protected MapBean |
mapBean |
protected MapHandler |
mapHandler |
protected MenuList |
menuList |
protected PropertyHandler |
propertyHandler |
static java.lang.String |
SET_NAME_PROPERTY |
protected boolean |
setName |
beanContextChildSupport, i18n, isolated, orientation, propertyPrefix, 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 |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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 resource,
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 |
dispose()
Sets the MapBean variable to null and removes all children.
|
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.
|
boolean |
isSetName() |
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 delimited 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 |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties in the PropertyHandler managed by this BasicMapPanel.
|
void |
setPropertyHandler(PropertyHandler handler)
Set the PropertyHandler containing the properties used to configure this
panel.
|
void |
setSetName(boolean setName) |
addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, fireVetoableChange, getBeanContext, getOrientation, getProperties, getPropertyInfo, getPropertyPrefix, getWindowSupport, isIsolated, removeVetoableChangeListener, setBeanContext, setIsolated, setOrientation, setProperties, setPropertyPrefix, setWindowSupport
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, 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, setVisible, unregisterKeyboardAction, update
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, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, 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, removeComponentListener, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static java.util.logging.Logger logger
public static final java.lang.String SET_NAME_PROPERTY
protected MapHandler mapHandler
protected MapBean mapBean
protected PropertyHandler propertyHandler
protected MenuList menuList
protected boolean setName
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()
public void setProperties(java.lang.String prefix, java.util.Properties props)
setProperties
in interface PropertyConsumer
setProperties
in class OMComponentPanel
prefix
- property prefix for scoping properties for this panelprops
- the properties to search for properties in.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 contextMultipleSoloMapComponentException
- 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 contextpublic 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 void dispose()
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
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)
public boolean isSetName()
public void setSetName(boolean setName)
setName
- whether the property prefix provided in setProperties will
be set on the MapPanel. If it is, then when MapPanelChild objects
are found in the MapHandler, they will only be added if the names
match.Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details