Package rma.swing
Class DateTimePanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
rma.swing.DateTimePanel
- All Implemented Interfaces:
FocusListener,ImageObserver,MenuContainer,Serializable,Cloneable,EventListener,Accessible,Modifiable,TimeZoneComponent,RmaValidComponent
public class DateTimePanel
extends JPanel
implements RmaValidComponent, TimeZoneComponent, FocusListener, Modifiable, Cloneable
Class Description
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TimeZoneDescriptionprotected SimpleDateFormatDescriptionprotected TimeZoneDescriptionprotected HecTimeDescriptionprotected SimpleDateFormatDescriptionstatic final intDescriptionstatic final intDescriptionFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionDateTimePanel(int layout, String dateLabel, String timeLabel, String dateFmt) Constructor for the DateTimePanel object -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidadd a focus listener to the datefield and the timefieldvoidadd a KeyListener to the datefield and the timefieldvoidclear()Description of the Methodclone()voidDescription of the MethodvoidMethod Descriptionvoidthis method is public as an implementation side-effect and probably shouldn't be called directly from users code.voidfocusLost(FocusEvent fe) this method is public as an implementation side-effect and probably shouldn't be called directly from users code.booleanGets the AllowsMinutes attribute of the DateTimePanel objectgetDate(int style) Gets the Date attribute of the DateTimePanel objectReturns the date and time in an HecTimeArray of size 1.return the unconverted date in the date fieldbooleangetTime()Gets the Time attribute of the DateTimePanel objectreturn the unconverted time in the time fieldGets the TimeZone attribute of the DateTimePanel objectbooleanGets the Editable attribute of the DateTimePanel objectbooleanGets the Enabled attribute of the DateTimePanel objectbooleanbooleanisValid(boolean showError) Gets the Valid attribute of the DateTimePanel objectvoidremove a focus listener from the datefield and the timefieldvoidMethod DescriptionvoidsetAllowsMinutes(boolean b) Sets the AllowsMinutes attribute of the DateTimePanel objectvoidset the foreground color for the fields in this panel when the user edits the valuesvoidvoidsetDateTime(HecTimeArray hTimeArray) Sets the DateTime attribute of the DateTimePanel objectvoidsetDateTime(HecTime hTime, TimeZone dataTz) Sets the DateTime attribute of the DateTimePanel objectvoidvoidsetEditable(boolean b) Sets the Editable attribute of the DateTimePanel objectvoidsetEnabled(boolean b) Sets the Enabled attribute of the DateTimePanel objectvoidsetIgnoreModifiedEvents(boolean b) voidsetModified(boolean modified) voidsetTimeFieldVisible(boolean visible) voidsetTimeZone(TimeZone tz) Sets the Display TimeZone attribute of the DateTimePanel object.voidshowTimeAsBeginningOfDay(boolean b) Show midnight at the beginning of the next day, instead of the end of the previous day.voidDescription of the MethodMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, 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, updateMethods 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, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
VERTICAL_LAYOUT
public static final int VERTICAL_LAYOUTDescription- See Also:
-
HORIZONTAL_LAYOUT
public static final int HORIZONTAL_LAYOUTDescription- See Also:
-
_displayTimeZone
Description -
_dataTimeZone
Description -
_hTime
Description -
_dateFormat
Description -
_timeFormat
Description
-
-
Constructor Details
-
DateTimePanel
public DateTimePanel() -
DateTimePanel
Constructor for the DateTimePanel object- Parameters:
layout- DescriptiondateLabel- DescriptiontimeLabel- DescriptiondateFmt- Description
-
-
Method Details
-
setDateTime
Sets the DateTime attribute of the DateTimePanel object- Parameters:
hTimeArray- The new DateTime value
-
setDateTime
Sets the DateTime attribute of the DateTimePanel object- Parameters:
hTime- The new DateTime valuedataTz- The new DateTime value
-
setDataTimeZone
-
setDisplayTimeZone
-
setTimeZone
Sets the Display TimeZone attribute of the DateTimePanel object. All times are converted from the dataTimeZone to the display time zone set here and displayed in the Text Fields- Specified by:
setTimeZonein interfaceTimeZoneComponent- Parameters:
tz- The new TimeZone value
-
setEditable
public void setEditable(boolean b) Sets the Editable attribute of the DateTimePanel object- Parameters:
b- The new Editable value
-
setEnabled
public void setEnabled(boolean b) Sets the Enabled attribute of the DateTimePanel object- Overrides:
setEnabledin classJComponent- Parameters:
b- The new Enabled value
-
setChangeColor
set the foreground color for the fields in this panel when the user edits the values- Parameters:
c- the foreground Color
-
setAllowsMinutes
public void setAllowsMinutes(boolean b) Sets the AllowsMinutes attribute of the DateTimePanel object- Parameters:
b- The new AllowsMinutes value
-
getTimeUnconverted
return the unconverted time in the time field- Returns:
- The TimeUnconverted value
-
getDateUnconverted
return the unconverted date in the date field- Returns:
- The DateUnconverted value
-
setTimeFieldVisible
public void setTimeFieldVisible(boolean visible) -
getTime
Gets the Time attribute of the DateTimePanel object- Returns:
- The Time value
-
getDate
Gets the Date attribute of the DateTimePanel object- Parameters:
style- Description of Parameter- Returns:
- The Date value
-
getDateTime
Returns the date and time in an HecTimeArray of size 1. The date and time is in a HecTime Object accompanied by the time zone it is in. The timezone is in the same time zone that was set by the setDateTime() call. -
isValid
public boolean isValid(boolean showError) Gets the Valid attribute of the DateTimePanel object- Specified by:
isValidin interfaceRmaValidComponent- Parameters:
showError- Description- Returns:
- The Valid value
-
getTimeZone
Gets the TimeZone attribute of the DateTimePanel object- Specified by:
getTimeZonein interfaceTimeZoneComponent- Returns:
- The TimeZone value
-
isEditable
public boolean isEditable()Gets the Editable attribute of the DateTimePanel object- Returns:
- The Editable value
-
isEnabled
public boolean isEnabled()Gets the Enabled attribute of the DateTimePanel object -
getAllowsMinutes
public boolean getAllowsMinutes()Gets the AllowsMinutes attribute of the DateTimePanel object- Returns:
- The AllowsMinutes value
-
fillPanel
public void fillPanel()Method Description -
savePanel
public void savePanel()Method Description -
showTimeAsBeginningOfDay
public void showTimeAsBeginningOfDay(boolean b) Show midnight at the beginning of the next day, instead of the end of the previous day. (For example, 06Jan2002 00:00, instead of 05Jan2002 24:00.)- Parameters:
b- true to show midnight as 00:00 hrs, false to show midnight as 24:00 hrs (default).- See Also:
-
clear
public void clear()Description of the Method -
removeDateTimeFocusListener
remove a focus listener from the datefield and the timefield- Parameters:
fl- Description of Parameter
-
addDateTimeFocusListener
add a focus listener to the datefield and the timefield- Parameters:
fl- The feature to be added to the DateTimeFocusListener attribute
-
addKeyListener
add a KeyListener to the datefield and the timefield- Overrides:
addKeyListenerin classComponent- Parameters:
kl- the KeyListener
-
addActionListener
-
focusGained
this method is public as an implementation side-effect and probably shouldn't be called directly from users code.- Specified by:
focusGainedin interfaceFocusListener- Parameters:
fe- Description of Parameter
-
focusLost
this method is public as an implementation side-effect and probably shouldn't be called directly from users code.- Specified by:
focusLostin interfaceFocusListener- Parameters:
fe- Description of Parameter
-
timeFieldRequestFocus
public void timeFieldRequestFocus()Description of the Method -
dateFieldRequestFocus
public void dateFieldRequestFocus()Description of the Method -
isModified
public boolean isModified()- Specified by:
isModifiedin interfaceModifiable- Returns:
- See Also:
-
setModified
public void setModified(boolean modified) - Specified by:
setModifiedin interfaceModifiable- See Also:
-
setIgnoreModifiedEvents
public void setIgnoreModifiedEvents(boolean b) -
getIgnoreModifiedEvents
public boolean getIgnoreModifiedEvents() -
clone
-