|
|||||||||
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.isti.util.gui.IstiClockPanel
public class IstiClockPanel
Class IstiClockPanel implements a clock panel that displays the current time.
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 | |
---|---|
static java.util.TimeZone |
DEFAULT_TIME_ZONE
Value to use when the default time zone is desired. |
static int |
DISPMODE_ALWAYS_SHOW_DEFAULT_TIME_ZONE
Display mode value (displayMode): Always show the default time zone |
static int |
DISPMODE_DEFAULT
Display mode value (displayMode): Default mode - only show the selected time zone |
static int |
DISPMODE_SHOW_LOCAL_WHEN_DEFAULT
Display mode value (displayMode): Show local time zone when the default time zone is selected. |
static int |
SHOW_24_HOUR_COMMAND
Command to show the time in 24 hour mode on the display. |
static int |
SHOW_ALL_TIME_ZONES_COMMAND
Command to show the all time zones on the display. |
static int |
SHOW_SECOND_TIME_ZONE_COMMAND
Command to show the second time zone on the display if more than one time zone is displayed. |
static int |
SHOW_SECONDS_COMMAND
Command to show seconds on the display. |
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
IstiClockPanel()
Creates a clock panel with the default time zone. |
|
IstiClockPanel(java.util.TimeZone zone)
Creates a clock panel with the specified time zone. |
|
IstiClockPanel(java.util.TimeZone zone,
int displayMode)
Creates a clock panel with the specified time zone. |
|
IstiClockPanel(java.util.TimeZone zone,
int displayMode,
java.util.TimeZone defaultZone)
Creates a clock panel with the specified time zone. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Implements the ActionListener interface. |
protected void |
addMenuItem(int command)
Adds a menu item to the popup menu. |
boolean |
disableCommand(int command)
Disables the specified command. |
boolean |
getCommandState(int command)
Gets the state for the specified command. |
protected javax.swing.JCheckBoxMenuItem |
getMenuItem(int command)
Gets the menu item for the specified command. |
void |
init(java.util.TimeZone zone,
int displayMode)
Initializes the time zone values. |
boolean |
isCommandEnabled(int command)
Determines if the specified command is enabled. |
boolean |
isFloatable()
Returns the "floatable" property for the panel. |
boolean |
isRunning()
Returns true if the clock is running. |
void |
restart()
Restart the clock. |
boolean |
setCommandEnable(int command,
boolean b)
Enables/disables the specified command. |
boolean |
setCommandState(int command,
boolean b)
Sets the state for the specified command. |
void |
setFloatable(boolean flgVal)
Sets the "floatable" property for the panel. |
protected void |
setMenuItemEnable(javax.swing.JCheckBoxMenuItem mi,
boolean b)
Enables/disables the specified menu item. |
void |
setPopupEnabled(boolean b)
Enable/disables popup menu. |
void |
setTimeZone(java.util.TimeZone zone)
Sets the time zone. |
void |
start()
Starts the clock. |
void |
stop()
Stops the clock. |
protected boolean |
updateCommandState(int command)
Updates the state for the specified command. |
protected boolean |
updateCommandState(int command,
boolean b)
Updates the state for the specified command. |
protected boolean |
updateCommandState(java.lang.String actionCommand)
Updates the state for the specified command. |
protected void |
updateDateFormatString(boolean firstTimeZone)
Updates the date format string. |
protected java.util.Calendar |
updateTime()
Updates the time on the display. |
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, fireVetoableChange, 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 |
Field Detail |
---|
public static final int SHOW_ALL_TIME_ZONES_COMMAND
public static final int SHOW_SECONDS_COMMAND
public static final int SHOW_24_HOUR_COMMAND
public static final int SHOW_SECOND_TIME_ZONE_COMMAND
public static final java.util.TimeZone DEFAULT_TIME_ZONE
public static final int DISPMODE_DEFAULT
public static final int DISPMODE_ALWAYS_SHOW_DEFAULT_TIME_ZONE
public static final int DISPMODE_SHOW_LOCAL_WHEN_DEFAULT
Constructor Detail |
---|
public IstiClockPanel()
start
public IstiClockPanel(java.util.TimeZone zone)
zone
- time zone for the clock or DEFAULT_TIME_ZONE for default.
The 'start' method needs to be called to start the clock after
the clock panel is setup.start
public IstiClockPanel(java.util.TimeZone zone, int displayMode)
zone
- time zone for the clock or DEFAULT_TIME_ZONE for default.displayMode
- display mode.
The 'start' method needs to be called to start the clock after
the clock panel is setup.start, DISPMODE_*
public IstiClockPanel(java.util.TimeZone zone, int displayMode, java.util.TimeZone defaultZone)
zone
- time zone for the clock or DEFAULT_TIME_ZONE for default.displayMode
- display mode.defaultZone
- default time zone for the clock or DEFAULT_TIME_ZONE
for system default.
The 'start' method needs to be called to start the clock after
the clock panel is setup.start, DISPMODE_*
Method Detail |
---|
public void init(java.util.TimeZone zone, int displayMode)
zone
- time zone.displayMode
- display mode.DISPMODE_*
public void setTimeZone(java.util.TimeZone zone)
zone
- time zone.public boolean getCommandState(int command)
command
- the command.
SHOW_ALL_TIME_ZONES_COMMAND, SHOW_SECONDS_COMMAND, ...
public boolean disableCommand(int command)
command
- the command.
SHOW_ALL_TIME_ZONES_COMMAND, SHOW_SECONDS_COMMAND, ...
public boolean setCommandEnable(int command, boolean b)
command
- the command.b
- true if the command should be enabled.
SHOW_ALL_TIME_ZONES_COMMAND, SHOW_SECONDS_COMMAND, ...
protected javax.swing.JCheckBoxMenuItem getMenuItem(int command)
command
- the command.
protected void setMenuItemEnable(javax.swing.JCheckBoxMenuItem mi, boolean b)
mi
- the menu item.b
- true if the command should be enabled.public boolean isCommandEnabled(int command)
command
- the command.
public boolean setCommandState(int command, boolean b)
command
- the command.b
- command state.
SHOW_ALL_TIME_ZONES_COMMAND, SHOW_SECONDS_COMMAND, ...
public void setPopupEnabled(boolean b)
b
- true if popups should be enabled.protected boolean updateCommandState(int command, boolean b)
command
- the command.b
- command state.
SHOW_ALL_TIME_ZONES_COMMAND, SHOW_SECONDS_COMMAND, ...
protected boolean updateCommandState(int command)
command
- the command.
SHOW_ALL_TIME_ZONES_COMMAND, SHOW_SECONDS_COMMAND, ...
protected boolean updateCommandState(java.lang.String actionCommand)
actionCommand
- the action command string.
popupCommands
protected void updateDateFormatString(boolean firstTimeZone)
firstTimeZone
- true if first time zone should be updated.protected void addMenuItem(int command)
command
- command index.public void start()
public boolean isRunning()
start()
public void restart()
public void stop()
protected java.util.Calendar updateTime()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- action event.public void setFloatable(boolean flgVal)
flgVal
- true to enable; false to disable.public boolean isFloatable()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |