|
||||||||||
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 javax.swing.JPanel com.bbn.openmap.gui.OMComponentPanel com.bbn.openmap.InformationDelegator
public class InformationDelegator
The InformationDelegator manages the display of information requested by Layers and other map components. It can bring up a web browser to display web pages and files, and pop up a message window to provide status information to the user. It also has a visible status window that contains a layer status indicator, and an information line that can display short messages.
InformationDelegators are added to layers, and the layer fires events through the InfoDisplayListener interface. The InformationDelegator has a method called listenToLayers() that lets you give it an array of layers, and it adds itself as a InfoDisplayListener to those layers.
The InformationDelegator lets you alter its behavior with property settings:
# Make the status lights buttons that bring up layer palettes. infoDelegator.triggers=true # Show the layer status lights. infoDelegator.showLights=true # Show the text line for map object information infoDelegator.showInfoLine=true # Show the text line for coordinate information infoDelegator.showCoordsInfoLine=true
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
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 WebBrowser |
browser
|
static int |
COORDINATE_INFO_LINE
|
protected java.awt.Cursor |
currentMapBeanCursor
Used to remember any cursor that may bave been requested by a layer. |
protected java.awt.Cursor |
fallbackMapBeanCursor
Used to remember what the MouseModeCursor is, which is the base cursor setting for the MapBean. |
protected javax.swing.JLabel |
infoLineHolder
|
protected javax.swing.JLabel |
infoLineHolder2
|
protected java.util.ArrayList |
infoLineOrganizer
|
protected MapBean |
map
|
static int |
MAP_OBJECT_INFO_LINE
|
protected java.lang.String |
preferredLocation
BorderLayout.SOUTH by default for this class. |
protected javax.swing.JProgressBar |
progressBar
|
protected java.lang.String |
propertyPrefix
|
static java.lang.String |
ShowCoordsInfoLineProperty
|
static java.lang.String |
ShowInfoLineProperty
|
protected boolean |
showLights
Flag to show the status lights. |
static java.lang.String |
ShowLightsProperty
|
protected boolean |
showWaitCursor
|
protected StatusLightPanel |
statusBar
|
protected javax.swing.ToolTipManager |
ttmanager
|
protected boolean |
waitingForLayers
|
static java.lang.String |
WebBrowserClassProperty
|
Fields inherited from class com.bbn.openmap.gui.OMComponentPanel |
---|
beanContextChildSupport, i18n, isolated, orientation, 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.gui.MapPanelChild |
---|
ParentNameProperty, PreferredLocationProperty |
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 | |
---|---|
InformationDelegator()
|
Method Summary | |
---|---|
void |
addInfoLine(int refIndex,
javax.swing.JLabel iLine)
|
void |
displayBrowserContent(java.lang.String content)
Display a html String in a window. |
void |
displayInfoLine(java.lang.String infoLine)
Display a line of text in a info line. |
void |
displayInfoLine(java.lang.String infoLine,
int labelDesignator)
Display a line of text in a designated info line. |
void |
displayMessage(java.lang.String title,
java.lang.String message)
Display a message in a pop-up window. |
void |
displayURL(java.lang.String url)
Try to display a URL in a web browser. |
void |
findAndInit(java.lang.Object someObj)
Called when an object has been added to the BeanContext. |
void |
findAndUndo(java.lang.Object someObj)
Called when an object is being removed from the BeanContext. |
WebBrowser |
getBrowser()
|
javax.swing.JLabel |
getInfoLineHolder()
|
boolean |
getLightTriggers()
|
java.lang.String |
getParentName()
Should return the name of the desired parent component. |
java.lang.String |
getPreferredLocation()
MapPanelChild method. |
javax.swing.JProgressBar |
getProgressBar()
|
java.util.Properties |
getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the current values of the OMComponent. |
java.util.Properties |
getPropertyInfo(java.util.Properties props)
Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer. |
boolean |
getShowCoordsInfoLine()
|
boolean |
getShowInfoLine()
|
boolean |
getShowLights()
|
void |
initInfoWidgets()
If you want to subclass the InformationDelegator and have it handle messages differently, you can override this method to set the widgets you want. |
void |
initToolTip()
This method should be called to initialize the tooltip status so that an old tooltip doesn't remain when a layer starts listening to mouse events. |
boolean |
isShowWaitCursor()
Returns whether the wait cursor will be shown if the layers are working. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Listen for changes to the active mouse mode and for any changes to the list of available mouse modes. |
void |
removeInfoLine(int refIndex)
|
void |
requestBrowserContent(InfoDisplayEvent event)
Handle layer requests that plain text or html text be displayed in a browser. |
void |
requestCursor(java.awt.Cursor cursor)
Change the cursor for the MapBean. |
void |
requestHideToolTip()
This method should follow a call to showToolTip in order to indicate that the tooltip should no longer be displayed. |
void |
requestHideToolTip(java.awt.event.MouseEvent me)
Deprecated. call requestHideToolTip() instead. |
void |
requestInfoLine(InfoDisplayEvent event)
Handle layer requests to have an information line displayed in an application status window. |
void |
requestMessage(InfoDisplayEvent event)
Handle layer requests to have a message displayed in a dialog window. |
void |
requestShowToolTip(InfoDisplayEvent event)
If a tooltip is required over a spot on the map then a MouseMapListener should pass a MouseEvent to this method. |
void |
requestShowToolTip(java.awt.event.MouseEvent me,
InfoDisplayEvent event)
Deprecated. use requestShowToolTip(InfoDisplayEvent) instead. |
void |
requestURL(InfoDisplayEvent event)
Handle layer requests to have a URL displayed in a Browser. |
void |
resetCursor()
Sets the cursor over the mapbean to the assigned default, or whatever has been set by the MouseMode. |
void |
resetForLayers(Layer[] connectToLayers,
Layer[] removeFromLayers)
Set the InformationDelegator on Layers. |
void |
setAllLabels(java.lang.String str)
|
void |
setBrowser(WebBrowser wb)
|
void |
setFloatable(boolean value)
|
void |
setInfoLineHolder(javax.swing.JLabel ilh)
|
void |
setLabel(java.lang.String str)
Set the information line label. |
void |
setLabel(java.lang.String str,
int infoLineDesignator)
Set the information line label. |
void |
setLightTriggers(boolean set)
|
void |
setMap(MapBean map)
Set the MapBean so that when the mouse mode changes, the cursor can change. |
void |
setPreferredLocation(java.lang.String value)
MapPanelChild method. |
void |
setProgressBar(javax.swing.JProgressBar progressBar)
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent. |
void |
setResetCursor(java.awt.Cursor cursor)
Set the cursor to use when the waiting is done, if a layer hasn't asked for one to be displayed. |
void |
setShowCoordsInfoLine(boolean set)
This only holds if the COORDINATE_INFO_LINE has been created. |
void |
setShowInfoLine(boolean set)
This only holds if the MAP_OBJECT_INFO_LINE has been created. |
void |
setShowLights(boolean set)
|
void |
setShowWaitCursor(boolean value)
If the value passed in is true, the cursor over the MapBean will be the waiting cursor layers are off working. |
protected void |
setStatusBar()
The method that updates the InformationDelegator display window with the correct layer representation. |
void |
updateProgress(ProgressEvent evt)
Receive a ProgressEvent, and use it if possible. |
Methods inherited from class com.bbn.openmap.gui.OMComponentPanel |
---|
addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, fireVetoableChange, getBeanContext, getOrientation, getPropertyPrefix, getWindowSupport, isIsolated, removeVetoableChangeListener, setBeanContext, setIsolated, setOrientation, 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, 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, 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 |
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, 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, 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 javax.swing.JLabel infoLineHolder
protected javax.swing.JLabel infoLineHolder2
protected WebBrowser browser
protected StatusLightPanel statusBar
protected javax.swing.JProgressBar progressBar
protected MapBean map
protected javax.swing.ToolTipManager ttmanager
protected java.lang.String propertyPrefix
protected java.awt.Cursor fallbackMapBeanCursor
protected java.awt.Cursor currentMapBeanCursor
protected boolean waitingForLayers
protected boolean showWaitCursor
protected boolean showLights
public static final java.lang.String ShowLightsProperty
public static final java.lang.String ShowInfoLineProperty
public static final java.lang.String ShowCoordsInfoLineProperty
public static final java.lang.String WebBrowserClassProperty
public static final int MAP_OBJECT_INFO_LINE
public static final int COORDINATE_INFO_LINE
protected java.util.ArrayList infoLineOrganizer
protected java.lang.String preferredLocation
Constructor Detail |
---|
public InformationDelegator()
Method Detail |
---|
public void initInfoWidgets()
public void setMap(MapBean map)
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void resetForLayers(Layer[] connectToLayers, Layer[] removeFromLayers)
public void updateProgress(ProgressEvent evt)
updateProgress
in interface ProgressListener
public void addInfoLine(int refIndex, javax.swing.JLabel iLine)
public void removeInfoLine(int refIndex)
public void setLabel(java.lang.String str)
str
- Stringpublic void setAllLabels(java.lang.String str)
public void setLabel(java.lang.String str, int infoLineDesignator)
str
- StringinfoLineDesignator
- the designator used to specify which
information line to use to display the string.protected void setStatusBar()
public void setBrowser(WebBrowser wb)
public WebBrowser getBrowser()
public void displayURL(java.lang.String url)
public void displayBrowserContent(java.lang.String content)
public void displayInfoLine(java.lang.String infoLine)
public void displayInfoLine(java.lang.String infoLine, int labelDesignator)
public void displayMessage(java.lang.String title, java.lang.String message)
public void requestURL(InfoDisplayEvent event)
requestURL
in interface InfoDisplayListener
event
- InfoDisplayEventpublic void requestMessage(InfoDisplayEvent event)
requestMessage
in interface InfoDisplayListener
event
- InfoDisplayEventpublic void requestInfoLine(InfoDisplayEvent event)
requestInfoLine
in interface InfoDisplayListener
event
- InfoDisplayEventpublic void requestBrowserContent(InfoDisplayEvent event)
requestBrowserContent
in interface InfoDisplayListener
event
- InfoDisplayEventpublic void requestShowToolTip(java.awt.event.MouseEvent me, InfoDisplayEvent event)
MouseMapListener
should pass a MouseEvent to this method.
The Swing ToolTipManager is used to achieve this. A call to this method
should always be followed by a call to hideToolTip
me
- A MouseEvent from a MapMouseListener
which
indicates where the tooltip is to appear (unused)event
- an event containing the ToolTip to showpublic void requestShowToolTip(InfoDisplayEvent event)
MouseMapListener
should pass a MouseEvent to this method.
The Swing ToolTipManager is used to achieve this. A call to this method
should always be followed by a call to hideToolTip
requestShowToolTip
in interface InfoDisplayListener
event
- an event containing the ToolTip to showpublic void requestHideToolTip(java.awt.event.MouseEvent me)
showToolTip
me
- A MouseEvent which passes from a MapMouseListener to indicate
that a tooltip should disappearpublic void requestHideToolTip()
showToolTip
requestHideToolTip
in interface InfoDisplayListener
public void initToolTip()
public void requestCursor(java.awt.Cursor cursor)
requestCursor
in interface InfoDisplayListener
cursor
- java.awt.Cursor to change the cursor to.public void setResetCursor(java.awt.Cursor cursor)
public void resetCursor()
public void setShowWaitCursor(boolean value)
public boolean isShowWaitCursor()
public void findAndInit(java.lang.Object someObj)
findAndInit
in interface LightMapHandlerChild
findAndInit
in class OMComponentPanel
public void findAndUndo(java.lang.Object someObj)
findAndUndo
in interface LightMapHandlerChild
findAndUndo
in class OMComponentPanel
public void setProperties(java.lang.String prefix, java.util.Properties props)
OMComponentPanel
setProperties
in interface PropertyConsumer
setProperties
in class OMComponentPanel
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties props)
OMComponentPanel
getProperties
in interface PropertyConsumer
getProperties
in class OMComponentPanel
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)
OMComponentPanel
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class OMComponentPanel
props
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.
public void setInfoLineHolder(javax.swing.JLabel ilh)
public javax.swing.JLabel getInfoLineHolder()
public void setProgressBar(javax.swing.JProgressBar progressBar)
public javax.swing.JProgressBar getProgressBar()
public void setShowLights(boolean set)
public boolean getShowLights()
public void setShowInfoLine(boolean set)
set
- sets the visibility of the information line for map object
information.public boolean getShowInfoLine()
public void setShowCoordsInfoLine(boolean set)
set
- sets the visibility of the information line for coordinate
information.public boolean getShowCoordsInfoLine()
public void setLightTriggers(boolean set)
public boolean getLightTriggers()
public void setFloatable(boolean value)
public void setPreferredLocation(java.lang.String value)
setPreferredLocation
in interface MapPanelChild
public java.lang.String getPreferredLocation()
getPreferredLocation
in interface MapPanelChild
public java.lang.String getParentName()
MapPanelChild
getParentName
in interface MapPanelChild
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |