net.sourceforge.nite.time
Class ClockFace

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.ClockFace
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class ClockFace
extends javax.swing.JInternalFrame

A control-strip for playing through time in NXT containing play / pause / forward / rewind buttons, a speed slider and a progress slider. Original implementation Judy Robertson; Rate slider by Dennis Hofs; Other work by Jonathan & Jean.

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
 
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
 
Method Summary
 void acceptTimeChange(double systemTime)
          We're the king of time, we'll only accept time changes using setClockFaceTime - i.e.
 void acceptTimeSpanChange(double start, double end)
          This gets called if we control-right-click to play the currently selected segment.
 void broadcastRate()
          change the rate of play of all the known media players
 void fastForward()
           
 Clock getClock()
           
 double getClockFaceTime()
          get the time according to the clock-face
 int getID()
           
 int getMaxTime()
          Returns the maximum time.
 int getWindSkip()
          get the number of seconds the fast-forward and rewind buttons jump
 void pause()
           
 void play()
           
 void registerMaxTime(int max)
          Called by registered displays to allow the slider to be set correctly.
 void rewind()
           
 void setClock(Clock c)
           
 void setClockFaceTime(double time)
          set the time according to the clock-face
 void setID(int i)
           
 void setSendSynchronization(boolean val)
          set the player to send synchronize messages
 void setSlaveMode(boolean sm)
          set this clock face as a slave not master of the current time.
 void setSyncRate(int milliseconds)
          set the rate at which the clock attempts to synchronize with its TimeHandlers.
 void setTime(double time)
           
 void setTimeHighlightColor(java.awt.Color color)
           
 void setTimeSpan(double start, double end)
           
 void setWindSkip(int seconds)
          set the number of seconds the fast-forward and rewind buttons jump
 boolean slaveMode()
          return this clock's mode: if true, we're not giving out our time as the master time, but polling a media signal instead
 
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
 

Method Detail

play

public void play()

pause

public void pause()

rewind

public void rewind()

fastForward

public void fastForward()

getClockFaceTime

public double getClockFaceTime()
get the time according to the clock-face


setClockFaceTime

public void setClockFaceTime(double time)
set the time according to the clock-face


acceptTimeChange

public void acceptTimeChange(double systemTime)
We're the king of time, we'll only accept time changes using setClockFaceTime - i.e. explicitly not from other timehandlers


acceptTimeSpanChange

public void acceptTimeSpanChange(double start,
                                 double end)
This gets called if we control-right-click to play the currently selected segment.


setTimeSpan

public void setTimeSpan(double start,
                        double end)

setTime

public void setTime(double time)

getClock

public Clock getClock()

setTimeHighlightColor

public void setTimeHighlightColor(java.awt.Color color)

setClock

public void setClock(Clock c)

getID

public int getID()

setID

public void setID(int i)

setWindSkip

public void setWindSkip(int seconds)
set the number of seconds the fast-forward and rewind buttons jump


getWindSkip

public int getWindSkip()
get the number of seconds the fast-forward and rewind buttons jump


setSendSynchronization

public void setSendSynchronization(boolean val)
set the player to send synchronize messages


broadcastRate

public void broadcastRate()
change the rate of play of all the known media players


registerMaxTime

public void registerMaxTime(int max)
Called by registered displays to allow the slider to be set correctly.


getMaxTime

public int getMaxTime()

Returns the maximum time. If the maximum has not yet been registered with registerMaxTime(), this method will return -1.

Returns:
the maximum time or -1

setSyncRate

public void setSyncRate(int milliseconds)
set the rate at which the clock attempts to synchronize with its TimeHandlers. The default is 200 milliseconds (5 times a second). If you set this too low, you'll find degradation in performance!


setSlaveMode

public void setSlaveMode(boolean sm)
set this clock face as a slave not master of the current time.


slaveMode

public boolean slaveMode()
return this clock's mode: if true, we're not giving out our time as the master time, but polling a media signal instead