|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.lavantech.gui.comp.TimePanel
TimePanel displays the given time in a digital and analog format for a user to change the given time. The time that needs to be displayed/edited is passed as a GregorianCalendar object to the constructor. The edited time is returned by getCalendar() method.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
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 | |
TimePanel()
Constructs a TimePanel with the current Date Time. |
|
TimePanel(java.util.GregorianCalendar cal)
Constructs a TimePanel with the given GregorianCalendar. |
|
TimePanel(java.util.GregorianCalendar cal,
java.util.Locale locale)
Constructs a TimePanel with the given GregorianCalendar. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent evt)
Implementation side effect |
void |
addActionListener(java.awt.event.ActionListener ls)
Adds an ActionListener. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a propertyChangeListener. |
java.util.GregorianCalendar |
getCalendar()
Returns the selected Time. |
ClockPanel |
getClockPanel()
Returns the clockPanel inside the Time panel |
boolean |
getDisplayAnalog()
Returns whether the time in analog clock will be displayed. |
boolean |
getDisplayDigital()
Returns whether the time in digital form will be displayed. |
java.awt.Color |
getFaceColor()
Returns the clock's face color. |
java.awt.Color |
getHourNeedleColor()
Returns the clock hour needle color |
java.util.GregorianCalendar |
getMaxSelectableTime()
Returns the maximum time that can be selected. |
java.awt.Color |
getMinNeedleColor()
Gets the clock minute needle color |
java.util.GregorianCalendar |
getMinSelectableTime()
Returns the minimum time that can be selected. |
java.awt.Color |
getSecNeedleColor()
Gets the clock second needle color |
boolean |
isEditable()
Returns whether the time in the TimePanel can be changed by the user. |
boolean |
isEnabled()
Returns whether the TimePanel is enabled or not. |
boolean |
isHourMinSecLabelDisplayed()
Returns whether the hour, min and sec label above the digital time is displayed or not. |
boolean |
isMinDisplayed()
Returns whether minute is displayed or not. |
boolean |
isSecDisplayed()
Returns whether second is displayed or not. |
void |
removeActionListener(java.awt.event.ActionListener ls)
Removes an ActionListener |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a propertyChangeListner. |
void |
setBackground(java.awt.Color bg)
Set the background color of this component. |
void |
setCalendar(java.util.GregorianCalendar cal)
Sets the selected time. |
void |
setDisplayAnalog(boolean disp)
Sets whether Analog Clock will be displayed in the Time Panel. |
void |
setDisplayDigital(boolean disp)
Sets whether Digital time will be displayed in the Time Panel. |
void |
setEditable(boolean edit)
Sets whether the time in the TimePanel can be changed by the user. |
void |
setEnabled(boolean enable)
Sets whether the TimePanel is enabled or not. |
void |
setFaceColor(java.awt.Color color)
Sets the clock's face color. |
void |
setFont(java.awt.Font font)
Set the font for this component. |
void |
setForeground(java.awt.Color fg)
Set the foreground color of this component. |
void |
setHourMinSecLabelDisplayed(boolean disp)
Sets whether the hour, min and sec label above the digital time is displayed or not. |
void |
setHourNeedleColor(java.awt.Color color)
Sets the clock hour needle color |
void |
setMaxSelectableTime(java.util.GregorianCalendar maxTime)
Set the maximum time that can be selected. |
void |
setMinDisplayed(boolean val)
Sets whether the minute is displayed or not. |
void |
setMinNeedleColor(java.awt.Color color)
Sets the clock minute needle color |
void |
setMinSelectableTime(java.util.GregorianCalendar minTime)
Set the minimum time that can be selected. |
void |
setSecDisplayed(boolean val)
Sets whether the second is displayed or not. |
void |
setSecNeedleColor(java.awt.Color color)
Sets the clock second needle color |
void |
setToolTipText(java.lang.String text)
Set the ToolTip Text for this component. |
void |
stateChanged(javax.swing.event.ChangeEvent evt)
Implementation side effect |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
Constructor Detail |
public TimePanel()
public TimePanel(java.util.GregorianCalendar cal)
cal
- The GregorianCalendar that needs to be displayed/editedpublic TimePanel(java.util.GregorianCalendar cal, java.util.Locale locale)
cal
- The GregorianCalendar that needs to be displayed/editedlocale
- The locale that will be used to display "AM/PM" string.Method Detail |
public boolean isMinDisplayed()
public void setMinDisplayed(boolean val)
public boolean isSecDisplayed()
public void setSecDisplayed(boolean val)
public void setHourMinSecLabelDisplayed(boolean disp)
public boolean isHourMinSecLabelDisplayed()
public java.util.GregorianCalendar getMinSelectableTime()
public void setMinSelectableTime(java.util.GregorianCalendar minTime) throws java.lang.IllegalArgumentException
minTime
- Minimum time that can be selected in DateTimePicker. null
can be passed to remove minimum limit.
java.lang.IllegalArgumentException
- If minTime is greater than maxSelectableTimepublic java.util.GregorianCalendar getMaxSelectableTime()
public void setMaxSelectableTime(java.util.GregorianCalendar maxTime) throws java.lang.IllegalArgumentException
maxTime
- Maximum time that can be selected in DateTimePicker. null
can be passed to remove maximum limit.
java.lang.IllegalArgumentException
- If maxTime is less than minSelectableTimepublic boolean isEnabled()
public void setEnabled(boolean enable)
public boolean isEditable()
public void setEditable(boolean edit)
public boolean getDisplayDigital()
public void setDisplayDigital(boolean disp)
public boolean getDisplayAnalog()
public void setDisplayAnalog(boolean disp)
public java.util.GregorianCalendar getCalendar()
public void setCalendar(java.util.GregorianCalendar cal)
public void setFont(java.awt.Font font)
font
- the desired Font for this componentpublic void setForeground(java.awt.Color fg)
fg
- the desired foreground Color.public void setBackground(java.awt.Color bg)
bg
- the desired background Color.public void setToolTipText(java.lang.String text)
text
- the desired tooltip text. If text is null, tooltip is turned off.public ClockPanel getClockPanel()
public void addActionListener(java.awt.event.ActionListener ls)
public void removeActionListener(java.awt.event.ActionListener ls)
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
public java.awt.Color getFaceColor()
public void setFaceColor(java.awt.Color color)
public java.awt.Color getHourNeedleColor()
public void setHourNeedleColor(java.awt.Color color)
public java.awt.Color getMinNeedleColor()
public void setMinNeedleColor(java.awt.Color color)
public java.awt.Color getSecNeedleColor()
public void setSecNeedleColor(java.awt.Color color)
public void stateChanged(javax.swing.event.ChangeEvent evt)
stateChanged
in interface javax.swing.event.ChangeListener
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |