Class Navigable_date_selector
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.client.util.gui.date_selector.Navigable_date_selector
- All Implemented Interfaces:
Date_selector
,ActionListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
This class is wrapper for a
Date_selector
that adds a navigation bar to manipulate the wrapped selector. See
Date_selector_panel
for a description and picture of date selectors.
- Images
-
The navigation-bar arrows in the current implementation are images loaded as a "resource" from the CLASSPATH. Four files are used:
$CLASSPATH/images/10px.red.arrow.right.double.gif
where $CLASSPATH is any directory on your CLASSPATH. If the
$CLASSPATH/images/10px.red.arrow.left.double.gif
$CLASSPATH/images/10px.red.arrow.right.gif
$CLASSPATH/images/10px.red.arrow.left.gifDate_selector_panel
can't find the image file, it uses character representations (">"
,">>"
,"<"
,"<<"
). The main problem with this approach is that you can't change the color of the arrows without changing the image files. On the plus side, arbitrary images can be used for the movement icons. Future versions of this class will provide some way for you to specify that the arrows be rendered internally in colors that you specify at run time.
-
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
-
Constructor Summary
ConstructorsConstructorDescriptionConvenience constructor.Navigable_date_selector
(Date_selector selector) Wrap an existing Date_selector to add a a navigation bar modifies the wrapped Date_selector.Navigable_date_selector
(Date_selector selector, Color backgroundColor) Create a navigable date selector by wrapping the indicated one.Navigable_date_selector
(Date_selector selector, String okayText) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
change_navigation_bar_color
(Color backgroundColor) int
get
(int f) Must work just likeCalendar.get(int)
boolean
boolean
void
void
roll
(int f, boolean up) Must work just likeCalendar.roll(int, boolean)
void
void
setEnabled
(boolean b) void
void
setForeground
(Color fg) void
void
setShowNavigationButtons
(boolean showNavButtons) void
setShowOkButton
(boolean showOkButton) 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, 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, 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, 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, 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, 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
-
Constructor Details
-
Navigable_date_selector
Wrap an existing Date_selector to add a a navigation bar modifies the wrapped Date_selector. -
Navigable_date_selector
-
Navigable_date_selector
Create a navigable date selector by wrapping the indicated one.- Parameters:
selector
- the raw date selector to wrap;backgroundColor
- the background color of the navigation bar (or null for transparent).- See Also:
-
Navigable_date_selector
public Navigable_date_selector()Convenience constructor. Creates the wrapped Date_selector for you. (It creates aDate_selector_panel
using the no-arg constructor.
-
-
Method Details
-
setFont
- Overrides:
setFont
in classJComponent
-
setForeground
- Overrides:
setForeground
in classJComponent
-
setEnabled
public void setEnabled(boolean b) - Overrides:
setEnabled
in classJComponent
-
addActionListener
- Specified by:
addActionListener
in interfaceDate_selector
-
removeActionListener
- Specified by:
removeActionListener
in interfaceDate_selector
-
get_selected_date
- Specified by:
get_selected_date
in interfaceDate_selector
-
get_current_date
- Specified by:
get_current_date
in interfaceDate_selector
-
set_selected_date
- Specified by:
set_selected_date
in interfaceDate_selector
-
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
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
- See Also:
-
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
.
-
isShowOkButton
public boolean isShowOkButton() -
setShowOkButton
public void setShowOkButton(boolean showOkButton) -
setOKText
-
getBackYearButton
-
getBackMonthButton
-
getForwardMonthButton
-
getForwardYearButton
-