org.rapla.components.calendar
Class RaplaTime

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 org.rapla.components.calendar.RaplaComboBox
                      extended by org.rapla.components.calendar.RaplaTime
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public final class RaplaTime
extends RaplaComboBox

A ComboBox like time chooser. It is localizable and it uses swing-components.

The combobox editor is a TimeField. If the ComboBox-Button is pressed a TimeSelectionList will drop down.

Author:
Christopher Kohlhaas
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Collection m_listenerList
           
protected  TimeField m_timeField
           
protected  org.rapla.components.calendar.TimeList m_timeList
           
protected  org.rapla.components.calendar.TimeModel m_timeModel
           
 
Fields inherited from class org.rapla.components.calendar.RaplaComboBox
jLabel, m_editorComponent, m_popupButton
 
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
RaplaTime()
          Create a new TimeBox with the default locale.
RaplaTime(Locale locale)
          Create a new TimeBox with the specified locale.
RaplaTime(Locale locale, boolean isDropDown)
          Deprecated. replaced with #RaplaTime(Locale,TimeZone,boolean)
RaplaTime(Locale locale, TimeZone timeZone)
          Create a new TimeBox with the specified locale and timeZone.
RaplaTime(Locale locale, TimeZone timeZone, boolean isDropDown, boolean showClock)
          Create a new TimeBox with the specified locale and timeZone.
 
Method Summary
 void addDateChangeListener(DateChangeListener listener)
          registers new DateChangedListener for this component.
protected  Image createClockImage()
           
protected  void fireTimeChanged(Date date)
           
 DateChangeListener[] getDateChangeListeners()
           
 JComponent getPopupComponent()
          The popup-component will be created lazily.
 int getRowsPerHour()
           
 Date getTime()
          Parse this date with a calendar-object set to the correct time-zone to get the hour,minute and second.
 TimeZone getTimeZone()
           
 void removeDateChangeListener(DateChangeListener listener)
          removes a listener from this component.
 void setFont(Font font)
           
 void setLocale(Locale locale)
           
 void setRowsPerHour(int rowsPerHour)
          The granularity of the selection rows: 1: 1 rows per hour = 1 Hour 2: 2 rows per hour = 1/2 Hour 2: 3 rows per hour = 20 Minutes 4: 4 rows per hour = 15 Minutes 6: 6 rows per hour = 10 Minutes 12: 12 rows per hour = 5 Minutes
 void setTime(Date time)
          Set the time relative to the given timezone.
 void setTimeRenderer(TimeRenderer renderer)
           
 void setTimeZone(TimeZone zone)
           
 void setVisibleRowCount(int count)
          the number of visble rows in the drop-down menu.
protected  void showPopup()
           
protected  void validateEditor()
           
 
Methods inherited from class org.rapla.components.calendar.RaplaComboBox
closePopup, getLabel, setEnabled
 
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, 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, 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, setFocusTraversalKeys, 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, 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

m_timeField

protected TimeField m_timeField

m_timeList

protected org.rapla.components.calendar.TimeList m_timeList

m_timeModel

protected org.rapla.components.calendar.TimeModel m_timeModel

m_listenerList

protected Collection m_listenerList
Constructor Detail

RaplaTime

public RaplaTime()
Create a new TimeBox with the default locale.


RaplaTime

public RaplaTime(Locale locale)
Create a new TimeBox with the specified locale.


RaplaTime

public RaplaTime(Locale locale,
                 TimeZone timeZone)
Create a new TimeBox with the specified locale and timeZone.


RaplaTime

public RaplaTime(Locale locale,
                 boolean isDropDown)
Deprecated. replaced with #RaplaTime(Locale,TimeZone,boolean)


RaplaTime

public RaplaTime(Locale locale,
                 TimeZone timeZone,
                 boolean isDropDown,
                 boolean showClock)
Create a new TimeBox with the specified locale and timeZone. The isDropDown flag specifies if times could be selected via a drop-down-box.

Method Detail

createClockImage

protected Image createClockImage()

setRowsPerHour

public void setRowsPerHour(int rowsPerHour)
The granularity of the selection rows:


getRowsPerHour

public int getRowsPerHour()
See Also:
setRowsPerHour(int)

validateEditor

protected void validateEditor()

setVisibleRowCount

public void setVisibleRowCount(int count)
the number of visble rows in the drop-down menu.


setFont

public void setFont(Font font)
Overrides:
setFont in class RaplaComboBox

setLocale

public void setLocale(Locale locale)
Overrides:
setLocale in class Component

setTimeZone

public void setTimeZone(TimeZone zone)

getTimeZone

public TimeZone getTimeZone()

setTime

public void setTime(Date time)
Set the time relative to the given timezone. The date,month and year values will be ignored.


getTime

public Date getTime()
Parse this date with a calendar-object set to the correct time-zone to get the hour,minute and second. The date,month and year values should be ignored.


showPopup

protected void showPopup()
Overrides:
showPopup in class RaplaComboBox

addDateChangeListener

public void addDateChangeListener(DateChangeListener listener)
registers new DateChangedListener for this component. An DateChangedEvent will be fired to every registered DateChangedListener when the a different time is selected.

See Also:
DateChangeListener, DateChangeEvent

removeDateChangeListener

public void removeDateChangeListener(DateChangeListener listener)
removes a listener from this component.


getDateChangeListeners

public DateChangeListener[] getDateChangeListeners()

fireTimeChanged

protected void fireTimeChanged(Date date)

getPopupComponent

public JComponent getPopupComponent()
The popup-component will be created lazily.

Specified by:
getPopupComponent in class RaplaComboBox

setTimeRenderer

public void setTimeRenderer(TimeRenderer renderer)


Copyright © 2000-2006 Rapla Team. All Rights Reseserved.