com.bbn.openmap.gui.time
Class TimePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.bbn.openmap.gui.OMComponentPanel
                      extended by com.bbn.openmap.gui.time.TimePanel
All Implemented Interfaces:
MapPanelChild, LightMapHandlerChild, PropertyConsumer, TimeEventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class TimePanel
extends OMComponentPanel
implements MapPanelChild, java.beans.PropertyChangeListener, TimeEventListener

The TimePanel is a GUI widget that provides assortment of Clock controls, including play, step and reverse buttons, a rate controller, a current time label and a time slider.

A Clock is needed to create an interface. If there is no clock, an empty panel with a title will be displayed.

If you are using the openmap.properties file to configure your application and want to control the parent component of the TimePanel, use the "parent" property to specify the marker name of the parent component. The BasicMapPanel asks MapPanelChildren for their parent's names when deciding whether to add them or not, when it finds potential children in the findAndInit method.

See Also:
Serialized Form

Nested Class Summary
 class TimePanel.NoBorder
           
static class TimePanel.Wrapper
           
 
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  Clock clock
          The Clock object used by the TimePanel.
static java.text.DateFormat dateFormat
           
static java.text.DateFormat dateFormat_realTime
           
static java.text.DateFormat dayFormat
           
 java.text.DecimalFormat df
           
protected  javax.swing.JLabel eventDetailLabel
           
static java.util.logging.Logger logger
           
protected  javax.swing.JLabel mouseTimeLabel
           
static java.lang.String NO_TIME_STRING
           
static java.lang.String PanelTitleProperty
           
protected  java.lang.String parentName
           
protected  javax.swing.JCheckBox playFilter
           
static java.lang.String PlayFilterProperty
          This property is used to signify whether the play filter should be used.
protected  java.lang.String preferredLocation
           
static java.lang.String RealTimeModeProperty
           
static java.lang.String ShowPlayFilterProperty
           
protected  javax.swing.JLabel timeLabel
           
protected  HotwashTimerControlButtonPanel timerControl
           
protected  TimerRateComboBox timerRateControl
           
protected  javax.swing.JToggleButton timeWrapToggle
           
protected  boolean useTimeWrapToggle
           
 
Fields inherited from class com.bbn.openmap.gui.OMComponentPanel
beanContextChildSupport, i18n, isolated, orientation, 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.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
TimePanel()
           
 
Method Summary
 void addTimeBoundsUserActionsListener(ITimeBoundsUserActionsListener timeBoundsUserActionsListener)
           
protected  boolean checkAndSetForNoTime(TimeEvent te)
           
 java.lang.String convertOffsetTimeToText(long offsetTimeFromLeft)
           
 void createInterface()
          A Clock is needed to create an interface.
 void findAndInit(java.lang.Object someObj)
          OMComponentPanel method, called when new components are added to the MapHandler.
 void findAndUndo(java.lang.Object someObj)
          OMComponentPanel method, called when new components are removed from the MapHandler.
 Clock getClock()
           
 java.lang.String getParentName()
          Should return the name of the desired parent component.
 java.lang.String getPreferredLocation()
          Should return BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST or BorderLayout.WEST.
 TimelinePanel getTimelinePanel()
           
 TimeSliderPanel getTimeSliderPanel()
           
 boolean isPlayFilterVisible()
           
 void propertyChange(java.beans.PropertyChangeEvent pce)
          PropertyChangeListener method called when a Clock fires, or the Clock time bounds change.
 void removeTimeBoundsUserActionsListener(ITimeBoundsUserActionsListener timeBoundsUserActionsListener)
           
 void setClock(Clock cl)
           
 void setParentName(java.lang.String pName)
           
 void setPlayFilterVisible(boolean visible)
           
 void setPreferredLocation(java.lang.String loc)
          Should be provided with BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST or BorderLayout.WEST.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Sets the properties for the OMComponent.
 void setUserHasChangedScale(boolean userHasChangedScale)
           
 void updateEventDetailsDisplay(java.lang.String details)
           
 void updateMouseTimeDisplay(long mouseOffsetTime)
          Displays the provided offset time in the Mouse Time display label.
 void updateTime(TimeEvent te)
           
 void updateTimeLabel(long sysTime, long offsetTime)
          Updates the timeLabel with the proper formats, dashes if needed.
 
Methods inherited from class com.bbn.openmap.gui.OMComponentPanel
addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, fireVetoableChange, getBeanContext, getOrientation, getProperties, getPropertyInfo, 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

logger

public static java.util.logging.Logger logger

PlayFilterProperty

public static final java.lang.String PlayFilterProperty
This property is used to signify whether the play filter should be used.

See Also:
Constant Field Values

NO_TIME_STRING

public static final java.lang.String NO_TIME_STRING
See Also:
Constant Field Values

PanelTitleProperty

public static final java.lang.String PanelTitleProperty
See Also:
Constant Field Values

RealTimeModeProperty

public static final java.lang.String RealTimeModeProperty
See Also:
Constant Field Values

ShowPlayFilterProperty

public static final java.lang.String ShowPlayFilterProperty
See Also:
Constant Field Values

clock

protected Clock clock
The Clock object used by the TimePanel.


timeWrapToggle

protected javax.swing.JToggleButton timeWrapToggle

timeLabel

protected javax.swing.JLabel timeLabel

mouseTimeLabel

protected javax.swing.JLabel mouseTimeLabel

eventDetailLabel

protected javax.swing.JLabel eventDetailLabel

playFilter

protected javax.swing.JCheckBox playFilter

timerControl

protected HotwashTimerControlButtonPanel timerControl

timerRateControl

protected TimerRateComboBox timerRateControl

preferredLocation

protected java.lang.String preferredLocation

useTimeWrapToggle

protected boolean useTimeWrapToggle

df

public transient java.text.DecimalFormat df

parentName

protected java.lang.String parentName

dateFormat

public static final java.text.DateFormat dateFormat

dateFormat_realTime

public static final java.text.DateFormat dateFormat_realTime

dayFormat

public static final java.text.DateFormat dayFormat
Constructor Detail

TimePanel

public TimePanel()
Method Detail

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
Description copied from class: OMComponentPanel
Sets the properties for the OMComponent.

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class OMComponentPanel
Parameters:
prefix - the token to prefix the property names
props - the Properties object

createInterface

public void createInterface()
A Clock is needed to create an interface. If there is no clock, an empty panel with a title will be displayed.


updateEventDetailsDisplay

public void updateEventDetailsDisplay(java.lang.String details)

updateMouseTimeDisplay

public void updateMouseTimeDisplay(long mouseOffsetTime)
Displays the provided offset time in the Mouse Time display label. Time is expected to be milliseconds offset from the beginning of displayed time.

Parameters:
mouseOffsetTime -

convertOffsetTimeToText

public java.lang.String convertOffsetTimeToText(long offsetTimeFromLeft)

setPreferredLocation

public void setPreferredLocation(java.lang.String loc)
Description copied from interface: MapPanelChild
Should be provided with BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST or BorderLayout.WEST. BorderLayout.Center is generally reserved for the MapBean.

Specified by:
setPreferredLocation in interface MapPanelChild

getPreferredLocation

public java.lang.String getPreferredLocation()
Description copied from interface: MapPanelChild
Should return BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST or BorderLayout.WEST. BorderLayout.Center is generally reserved for the MapBean.

Specified by:
getPreferredLocation in interface MapPanelChild

updateTime

public void updateTime(TimeEvent te)
Specified by:
updateTime in interface TimeEventListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pce)
PropertyChangeListener method called when a Clock fires, or the Clock time bounds change.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

checkAndSetForNoTime

protected boolean checkAndSetForNoTime(TimeEvent te)

updateTimeLabel

public void updateTimeLabel(long sysTime,
                            long offsetTime)
Updates the timeLabel with the proper formats, dashes if needed.

Parameters:
sysTime -
offsetTime -

setClock

public void setClock(Clock cl)

setPlayFilterVisible

public void setPlayFilterVisible(boolean visible)

isPlayFilterVisible

public boolean isPlayFilterVisible()

getClock

public Clock getClock()

findAndInit

public void findAndInit(java.lang.Object someObj)
OMComponentPanel method, called when new components are added to the MapHandler. Lets the TimePanel register itself as PropertyChangeListener to the Clock.

Specified by:
findAndInit in interface LightMapHandlerChild
Overrides:
findAndInit in class OMComponentPanel

findAndUndo

public void findAndUndo(java.lang.Object someObj)
OMComponentPanel method, called when new components are removed from the MapHandler. Lets the TimePanel unregister itself as PropertyChangeListener to the Clock.

Specified by:
findAndUndo in interface LightMapHandlerChild
Overrides:
findAndUndo in class OMComponentPanel

getParentName

public java.lang.String getParentName()
Description copied from interface: MapPanelChild
Should return the name of the desired parent component. This method lets a MapPanel to ask a component if it should be added to the panel. Enables application components to configure themselves from property file information.

Specified by:
getParentName in interface MapPanelChild
Returns:
the name of the parent component that the MapPanelChild should be added to, or null if it doesn't know.

setParentName

public void setParentName(java.lang.String pName)

getTimelinePanel

public TimelinePanel getTimelinePanel()

getTimeSliderPanel

public TimeSliderPanel getTimeSliderPanel()

setUserHasChangedScale

public void setUserHasChangedScale(boolean userHasChangedScale)

addTimeBoundsUserActionsListener

public void addTimeBoundsUserActionsListener(ITimeBoundsUserActionsListener timeBoundsUserActionsListener)

removeTimeBoundsUserActionsListener

public void removeTimeBoundsUserActionsListener(ITimeBoundsUserActionsListener timeBoundsUserActionsListener)


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