Class Date_selector_dialog
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
com.inductiveautomation.ignition.client.util.gui.date_selector.Popup_dialog
com.inductiveautomation.ignition.client.util.gui.date_selector.Date_selector_dialog
- All Implemented Interfaces:
Date_selector
,ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
The Date_selector_dialog, shown below, combines a
Date_selector
and a Popup_dialog
to provide a
standalone, popup dialog for choosing dates. The dialog is a free-floating top-level window. You can drag it around by the title bar and close it by clicking on the "close" icon.![]()
The class does implement the Date_selector
interface, but bear in mind that the window closes when the user
selects a date. Unlike the Titled_date_selector
wrapper class, both of the action events are sent to
listeners, however. Create one the hard way like this:
Date_selector calendar = new Date_selector_panel(selector); calendar = new Navigable_date_selector(calendar); // add navigation Date_selector_dialog chooser = new Date_selector_dialog(parent_frame, calendar); //... Date d = chooser.select(); // Pops up chooser; returns selected Date.
You can leave out the navigation bar by omitting the second line of the previous example. The following convenience constructor has exactly the same effect as the earlier code:
Date_selector_dialog chooser = new Date_selector_dialog(parent_frame); <pre> You can also pop up the dialog like this: <pre> chooser.setVisible(true); // blocks until dialog closed Date d = chooser.get_selected_date(); </pre>This class is a stand-alone dialog. For a version that you can embed into another window, see
Date_selector_panel
.
@see Date_selector @see Date_selector_panel @see Navigable_date_selector @see Titled_date_selector
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface com.inductiveautomation.ignition.client.util.gui.date_selector.Date_selector
CHANGE_ACTION, COMMIT_ACTION, SELECT_ACTION
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
ConstructorsConstructorDescriptionDate_selector_dialog
(Dialog parent) Date_selector_dialog
(Dialog parent, Date_selector toWrap) LikeDate_selector_dialog(Frame, Date_selector)
, but for aDialog
parent.Date_selector_dialog
(Frame parent) Creates a dialog box with the indicated parent that holds a standardDate_selector_panel
(as created using the no-arg constructor).Date_selector_dialog
(Frame parent, Date_selector toWrap) Creates a dialog box with the indicated parent that holds the indicated Date_selector. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an action listner for bothDate_selector.CHANGE_ACTION
andDate_selector.SELECT_ACTION
action events.int
get
(int f) Must work just likeCalendar.get(int)
Get the current date.For use when you pop up a dialog usingsetVisible(true)
rather thanselect()
.int
void
Remove a previously-added listenervoid
roll
(int f, boolean up) Must work just likeCalendar.roll(int, boolean)
select()
Pops up the chooser and blocks until the user selects a date.void
void
setCloseAction
(int i) The close action to set.Methods inherited from class com.inductiveautomation.ignition.client.util.gui.date_selector.Popup_dialog
getContentPane
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
Date_selector_dialog
Creates a dialog box with the indicated parent that holds a standardDate_selector_panel
(as created using the no-arg constructor). -
Date_selector_dialog
-
Date_selector_dialog
Creates a dialog box with the indicated parent that holds the indicated Date_selector. Note that the current month and year is displayed in the dialog-box title bar, so there's no need to display it in the selector too. -
Date_selector_dialog
LikeDate_selector_dialog(Frame, Date_selector)
, but for aDialog
parent.
-
-
Method Details
-
get_selected_date
For use when you pop up a dialog usingsetVisible(true)
rather thanselect()
.- Specified by:
get_selected_date
in interfaceDate_selector
- Returns:
- the selected date or null if the dialog was closed without selecting anything.
-
get_current_date
Get the current date. The dialog stays in existance until the user closes it or selects a date, so this method can be used to see what month the user has scrolled to.- Specified by:
get_current_date
in interfaceDate_selector
- Returns:
- the date currently displayed on the calendar.
-
set_selected_date
- Specified by:
set_selected_date
in interfaceDate_selector
-
addActionListener
Add an action listner for bothDate_selector.CHANGE_ACTION
andDate_selector.SELECT_ACTION
action events.- Specified by:
addActionListener
in interfaceDate_selector
-
removeActionListener
Remove a previously-added listener- Specified by:
removeActionListener
in interfaceDate_selector
-
select
Pops up the chooser and blocks until the user selects a date.- Returns:
- the selected date or null if the dialog was closed without selecting anything.
-
roll
public void roll(int f, boolean up) Description copied from interface:Date_selector
Must work just likeCalendar.roll(int, boolean)
- Specified by:
roll
in interfaceDate_selector
-
get
public int get(int f) Description copied from interface:Date_selector
Must work just likeCalendar.get(int)
- Specified by:
get
in interfaceDate_selector
-
getCloseAction
public int getCloseAction()- Returns:
- Current close action: Date_selector.CHANGE_ACTION, Date_selector.SELECT_ACTION, or Date_selector.COMMIT_ACTION
-
setCloseAction
public void setCloseAction(int i) The close action to set. Allowable values are Date_selector.CHANGE_ACTION, Date_selector.SELECT_ACTION, and Date_selector.COMMIT_ACTION -
getComponent
- Specified by:
getComponent
in interfaceDate_selector
-
getInnerSelector
- Specified by:
getInnerSelector
in interfaceDate_selector
- Returns:
- A reference to any 'inner' selector inside this
Date_selector
implementation. May returnthis
.
-