net.sourceforge.nite.time
Class ExampleTimeHandler

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JInternalFrame
                  extended by net.sourceforge.nite.time.ExampleTimeHandler
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, TimeHandler

public class ExampleTimeHandler
extends javax.swing.JInternalFrame
implements TimeHandler

An example implementation of a time handler.

Author:
jeanc, jonathan
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.JDesktopIcon
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 Clock clock
           
 
Fields inherited from class javax.swing.JInternalFrame
CONTENT_PANE_PROPERTY, FRAME_ICON_PROPERTY, GLASS_PANE_PROPERTY, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, LAYERED_PANE_PROPERTY, MENU_BAR_PROPERTY, ROOT_PANE_PROPERTY, TITLE_PROPERTY
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ExampleTimeHandler()
          Constructor
ExampleTimeHandler(Clock myclock)
          Constructor
 
Method Summary
 void acceptTimeChange(double systemTime)
          Accept a new time (generally from another registered TimeHandler).
 void acceptTimeSpanChange(double start, double end)
          Accept a new time span from another registered time handler.
 Clock getClock()
          Return the Clock that is currently syncronising this TimeHandler
 int getID()
           
 double getMaxTime()
          get the largest end time handled by this TimeHandler.
 void setClock(Clock clock)
          Set the Clock to which this TimeHandler is registered
 void setID(int i)
           
 void setTime(double time)
          Broadcast a new time.
 void setTimeHighlightColor(java.awt.Color color)
          Change the Color used for all registered TimeHandlers to highlight times
 void setTimeSpan(double s, double e)
          Broadcast a new span to all registered TimeHandlers.
 
Methods inherited from class javax.swing.JInternalFrame
addInternalFrameListener, dispose, doDefaultCloseAction, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isSelected, moveToBack, moveToFront, pack, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setSelected, setTitle, setUI, show, toBack, toFront, 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, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, 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, 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, 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, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clock

public Clock clock
Constructor Detail

ExampleTimeHandler

public ExampleTimeHandler()
Constructor


ExampleTimeHandler

public ExampleTimeHandler(Clock myclock)
Constructor

Method Detail

acceptTimeChange

public void acceptTimeChange(double systemTime)
Description copied from interface: TimeHandler
Accept a new time (generally from another registered TimeHandler). Do what you have to do in this TimeHandler to represent the fact that the global system time is now 'systemTime' (but don't inform the niteclock to pass it on).

Specified by:
acceptTimeChange in interface TimeHandler

acceptTimeSpanChange

public void acceptTimeSpanChange(double start,
                                 double end)
Description copied from interface: TimeHandler
Accept a new time span from another registered time handler. This may involve changing our on-screen appearance to introduce some new time highlights, or playing a stretch of video, depending on the type of handler.

Specified by:
acceptTimeSpanChange in interface TimeHandler

setTimeSpan

public void setTimeSpan(double s,
                        double e)
Description copied from interface: TimeHandler
Broadcast a new span to all registered TimeHandlers.

Specified by:
setTimeSpan in interface TimeHandler

setTime

public void setTime(double time)
Description copied from interface: TimeHandler
Broadcast a new time. Implement by sending a setSystemTime call to the current Clock.

Specified by:
setTime in interface TimeHandler

getClock

public Clock getClock()
Description copied from interface: TimeHandler
Return the Clock that is currently syncronising this TimeHandler

Specified by:
getClock in interface TimeHandler

setClock

public void setClock(Clock clock)
Description copied from interface: TimeHandler
Set the Clock to which this TimeHandler is registered

Specified by:
setClock in interface TimeHandler

setID

public void setID(int i)

getID

public int getID()

setTimeHighlightColor

public void setTimeHighlightColor(java.awt.Color color)
Description copied from interface: TimeHandler
Change the Color used for all registered TimeHandlers to highlight times

Specified by:
setTimeHighlightColor in interface TimeHandler

getMaxTime

public double getMaxTime()
get the largest end time handled by this TimeHandler. Returns 0.0 since we have no timed elements

Specified by:
getMaxTime in interface TimeHandler