public class DateTimePicker
extends javax.swing.JPanel
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected class |
DateTimePicker.PopupWindow
The class used to create the popup menu.
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JButton |
actDate |
protected java.util.Calendar |
calendar |
protected java.lang.String |
format |
protected int |
hourDecrease |
protected int |
hourIncrease |
protected javax.swing.JLabel |
label |
protected int |
minuteDecrease |
protected int |
minuteIncrease |
protected static java.text.SimpleDateFormat |
MONTH_NAME |
protected static java.text.SimpleDateFormat |
ODS_DATE_FORMAT |
protected static java.lang.String |
ODS_DATE_FORMAT_STRING |
protected javax.swing.JButton |
popupBut |
protected int |
secondDecrease |
protected int |
secondIncrease |
protected static java.text.SimpleDateFormat |
YEAR |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DateTimePicker()
The default constructor.
|
DateTimePicker(java.util.Calendar calendar)
The constructor receiving the calendar.
|
DateTimePicker(java.util.Calendar calendar,
java.lang.String format)
The constructor receiving the calendar and the picker type.
|
DateTimePicker(java.lang.String format)
The constructor receiving the picker type.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
configureButton(javax.swing.JButton ret) |
void |
createComponents()
Create the sub component.
|
protected static javax.swing.JButton |
createIconButton(java.lang.String resource) |
protected int |
decreaseValue(int value,
int decrease,
int mod)
Decrease a value.
|
java.lang.String |
getASAMODSDate()
Get an ASAM ODS date string.
|
java.util.Calendar |
getCalendar()
Get the calendar value.
|
protected static java.lang.String |
getDateFormat()
Returns the default date format.
|
int |
getHourDecrease()
Get the hour decrease value.
|
int |
getHourIncrease()
Get the hour increase value.
|
int |
getMinuteDecrease()
Get the minute decrease value.
|
int |
getMinuteIncrease()
Get the minute increase value.
|
int |
getSecondDecrease()
Get the second decrease value.
|
int |
getSecondIncrease()
Get the second increase value.
|
protected int |
increaseValue(int value,
int increase,
int mod)
Increase a value.
|
static void |
main(java.lang.String[] args) |
void |
setASAMODSDate(java.lang.String date)
Set an ASAM ODS date string.
|
void |
setCalendar(java.util.Calendar calendar)
Set the calendar value.
|
void |
setFormat(java.lang.String format)
Set the format string.
|
void |
setHourDecrease(int value)
Set the hour decrease value.
|
void |
setHourIncrease(int value)
Set the hour increase value.
|
void |
setMinuteDecrease(int value)
Set the minute decrease value.
|
void |
setMinuteIncrease(int value)
Set the minute increase value.
|
void |
setSecondDecrease(int value)
Set the second decrease value.
|
void |
setSecondIncrease(int value)
Set the second increase value.
|
protected void |
setTextValue(javax.swing.JLabel widget,
int val) |
protected void |
showPopup()
Open the popup menu.
|
protected void |
updateComponents()
Update the components.
|
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, setEnabled, 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, 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, transferFocusBackward, transferFocusUpCycle
protected static final java.lang.String ODS_DATE_FORMAT_STRING
protected static final java.text.SimpleDateFormat MONTH_NAME
protected static final java.text.SimpleDateFormat YEAR
protected static final java.text.SimpleDateFormat ODS_DATE_FORMAT
protected java.util.Calendar calendar
protected java.lang.String format
protected javax.swing.JLabel label
protected javax.swing.JButton actDate
protected javax.swing.JButton popupBut
protected int hourIncrease
protected int hourDecrease
protected int minuteIncrease
protected int minuteDecrease
protected int secondIncrease
protected int secondDecrease
public DateTimePicker()
public DateTimePicker(java.util.Calendar calendar)
calendar
- the calendar object to be editedpublic DateTimePicker(java.lang.String format)
format
- the time format string.java.util.SimpleDateFormat
public DateTimePicker(java.util.Calendar calendar, java.lang.String format)
calendar
- the calendar object to be editedformat
- the time format string.java.util.SimpleDateFormat
public void setASAMODSDate(java.lang.String date) throws java.text.ParseException
java.text.ParseException
public java.lang.String getASAMODSDate()
public void setHourIncrease(int value)
val
- the new interval value (default == 1);public int getHourIncrease()
public void setHourDecrease(int value)
val
- the new interval value (default == 1);public int getHourDecrease()
public void setMinuteIncrease(int value)
val
- the new interval value (default == 1);public int getMinuteIncrease()
public void setMinuteDecrease(int value)
val
- the new interval value (default == 1);public int getMinuteDecrease()
public void setSecondIncrease(int value)
val
- the new interval value (default == 1);public int getSecondIncrease()
public void setSecondDecrease(int value)
val
- the new interval value (default == 1);public int getSecondDecrease()
protected int increaseValue(int value, int increase, int mod)
value
- the actual value.increase
- the deltamod
- the moduluprotected int decreaseValue(int value, int decrease, int mod)
value
- the actual value.decrease
- the deltamod
- the moduluprotected void setTextValue(javax.swing.JLabel widget, int val)
public void createComponents()
protected void updateComponents()
protected void showPopup()
public void setCalendar(java.util.Calendar calendar)
calendar
- the new calendar value.public java.util.Calendar getCalendar()
public void setFormat(java.lang.String format)
format
- the format string.java.util.SimpleDateFormat
protected static javax.swing.JButton createIconButton(java.lang.String resource)
protected static void configureButton(javax.swing.JButton ret)
protected static java.lang.String getDateFormat()
java.util.SimpleDateFormat
public static void main(java.lang.String[] args)