public class IstiTimePanel extends javax.swing.JPanel implements UpdateListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
calendarTipText |
protected java.lang.String |
dayOfMonthTextTip |
protected static boolean |
debugFlag |
protected java.lang.String |
monthTipText |
protected java.lang.String |
timeTipText |
protected java.lang.String |
yearTextTip |
TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
IstiTimePanel()
Creates a time panel with the default title for the panel
and the calendar popup.
|
IstiTimePanel(java.lang.String title)
Creates a time panel with the given title for the panel
and the calendar popup.
|
IstiTimePanel(java.lang.String title,
boolean showZeroTextFlag)
Creates a time panel with the given title for the panel
and the calendar popup using the provided calendar.
|
IstiTimePanel(java.lang.String title,
boolean showZeroTextFlag,
java.util.Calendar calObj)
Creates a time panel with the given title for the panel
and the calendar popup using the provided calendar.
|
Modifier and Type | Method and Description |
---|---|
void |
addUpdateListener(UpdateListener l)
Adds an
UpdateListener . |
(package private) void |
calendarButton_actionPerformed(java.awt.event.ActionEvent e)
Calendar button processing
|
protected void |
fireUpdate(java.awt.Component component,
java.lang.Object e)
Notification of an update event.
|
java.util.Calendar |
getCalendar()
Gets the calendar for this panel.
|
int |
getDayOfMonth()
Gets the current day of the month.
|
java.util.Date |
getMaxTime()
Gets the maximum time.
|
java.util.Date |
getMinTime()
Gets the minimum time.
|
int |
getMonth()
Gets the current month.
|
java.util.Date |
getTime()
Get the date that is specified in this object.
|
java.util.TimeZone |
getTimeZone()
Gets the time zone.
|
java.lang.String |
getTitle()
Gets the title of the time panel.
|
int |
getYear()
Gets the current year.
|
boolean |
isEnabled()
Determines whether this component is enabled.
|
boolean |
isShowLabels()
Determines if the labels are shown.
|
protected boolean |
isTimeUpdate()
Gets the time update flag.
|
void |
processUpdate(java.awt.Component component,
java.lang.Object e)
Process an update.
|
void |
removeUpdateListener(UpdateListener l)
Removes an
UpdateListener . |
void |
setEnabled(boolean b)
Enables or disables this component, depending on the value of the
parameter
b . |
boolean |
setMaxTime(java.util.Date date)
Sets the maximum time.
|
boolean |
setMinTime(java.util.Date date)
Sets the minimum time.
|
void |
setShowLabels(boolean b)
Enables or disables showing the labels.
|
boolean |
setTime(java.util.Date date)
Sets the time.
|
protected void |
setTimeUpdateFlag(boolean b)
Sets the time update flag.
|
void |
setTimeZone(java.util.TimeZone value)
Sets the time zone with the given time zone value.
|
void |
setTitle(java.lang.String title)
Sets the title of the time panel.
|
java.lang.String |
toString()
Returns a string representation of this component and its values.
|
protected void |
updateDateFields()
Update the date fields to the current date.
|
protected void |
updateDays()
Updates the days of the month.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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, transferFocusDownCycle, validate, validateTree
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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
protected static boolean debugFlag
protected final java.lang.String monthTipText
protected final java.lang.String dayOfMonthTextTip
protected final java.lang.String yearTextTip
protected final java.lang.String timeTipText
protected final java.lang.String calendarTipText
public IstiTimePanel()
public IstiTimePanel(java.lang.String title)
title
- the title for the panel and the calendar popup
or null for default.public IstiTimePanel(java.lang.String title, boolean showZeroTextFlag)
title
- the title for the panel and the calendar popup
or null for default.showZeroTextFlag
- the show zero test flag,
if true spaces in the text are replaced with zeros.public IstiTimePanel(java.lang.String title, boolean showZeroTextFlag, java.util.Calendar calObj)
title
- the title for the panel and the calendar popup
or null for default.showZeroTextFlag
- the show zero test flag,
if true spaces in the text are replaced with zeros.calObj
- calendar object or null to create a new one.public java.util.Date getMaxTime()
public java.util.Date getMinTime()
public java.util.Date getTime()
public java.util.TimeZone getTimeZone()
public java.lang.String getTitle()
public boolean isEnabled()
setEnabled
method.isEnabled
in class java.awt.Component
true
if the component is enabled;
false
otherwise.setEnabled(boolean)
public boolean isShowLabels()
public void setEnabled(boolean b)
b
. An enabled component can respond to user
input and generate events. Components are enabled initially by default.setEnabled
in class javax.swing.JComponent
b
- If true
, this component is
enabled; otherwise this component is disabled.isEnabled()
public void setShowLabels(boolean b)
b
- If true the labels are shown; otherwise the labels are not shown.public boolean setMaxTime(java.util.Date date)
date
- the date to set or null to clear.public boolean setMinTime(java.util.Date date)
date
- the date to set or null to clear.public boolean setTime(java.util.Date date)
date
- the date to set or null to clear.public void setTimeZone(java.util.TimeZone value)
value
- the given time zone.public void setTitle(java.lang.String title)
title
- the title for the time panel.public java.lang.String toString()
toString
in class java.awt.Component
protected boolean isTimeUpdate()
protected void setTimeUpdateFlag(boolean b)
b
- true if time is being updated, false otherwise.protected void updateDateFields()
protected void updateDays()
void calendarButton_actionPerformed(java.awt.event.ActionEvent e)
e
- action eventpublic int getMonth()
public int getDayOfMonth()
public int getYear()
public java.util.Calendar getCalendar()
public void addUpdateListener(UpdateListener l)
UpdateListener
. The listener will
receive an update event
the user finishes making a selection.l
- the UpdateListener
that is to be notifiedpublic void removeUpdateListener(UpdateListener l)
UpdateListener
.l
- the UpdateListener
to removeprotected void fireUpdate(java.awt.Component component, java.lang.Object e)
component
- the component.e
- the event or null if none.public void processUpdate(java.awt.Component component, java.lang.Object e)
processUpdate
in interface UpdateListener
component
- the component.e
- the event or null if none.