class JMonthYearPanel
extends javax.swing.JPanel
implements java.awt.event.ActionListener, java.awt.event.ItemListener
This class displays the year/month gui controls at the top of
the composite JpanelCalendar widget. If the calendar widget is editable, this
panel will allow the user to change the month and year year
corresponding with the date shown in the calendar widget.
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
private javax.swing.JButton |
_nextdate |
private javax.swing.JButton |
_prevdate |
private JpanelCalendar |
container |
private int |
currentMonth |
private int |
currentYear |
(package private) static boolean |
debug |
private boolean |
editable |
private javax.swing.JComboBox |
month |
private javax.swing.JLabel |
mYLabel |
private java.awt.Font |
titleFont |
(package private) static TranslationService |
ts
TranslationService object for handling string localization in
the Ganymede system.
|
private JYearChooser |
year |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
JMonthYearPanel(JpanelCalendar parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
int |
getMonth()
Returns the month currently selected in the JMonthYearPanel.
|
java.lang.String |
getMonthString()
This method returns a human readable string containing
the month shown in the JMonthYearPanel.
|
int |
getYear()
Returns the year currently selected in the JMonthYearPanel.
|
void |
initializeEditable()
This method initializes or re-initializes this panel for editing.
|
void |
initializeNonEditable()
This method initializes or re-initializes this panel for
display.
|
void |
itemStateChanged(java.awt.event.ItemEvent e)
This is called when our month is changed
|
private void |
performCallback() |
void |
setAllowMonthChange(boolean allow)
This method toggles this panel from display mode to editing mode
or vice-versa.
|
void |
setMonth(int index)
This method sets the month in the JMonthYearPanel.
|
void |
setYear(int index)
This method sets the year in the JMonthYearPanel.
|
void |
updateYear(int index)
This method passes changes from the JYearChooser up to
the parent calendar widget.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, 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, updateadd, 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, validateTreeaction, 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, hide, 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, transferFocusUpCyclestatic final boolean debug
static final TranslationService ts
TranslationService object for handling string localization in the Ganymede system.
private boolean editable
private javax.swing.JButton _prevdate
private javax.swing.JButton _nextdate
private JYearChooser year
private javax.swing.JComboBox month
private JpanelCalendar container
private int currentMonth
private int currentYear
private javax.swing.JLabel mYLabel
private java.awt.Font titleFont
public JMonthYearPanel(JpanelCalendar parent)
public void setMonth(int index)
This method sets the month in the JMonthYearPanel. The appropriate range is from 0 to 11.
Calling this method will update the display, but it will not trigger a callback to the JpanelCalendar.
public int getMonth()
Returns the month currently selected in the JMonthYearPanel. This is not necessarily the same as the month of the currently selected day in the calendar.
public java.lang.String getMonthString()
This method returns a human readable string containing the month shown in the JMonthYearPanel.
public void setYear(int index)
This method sets the year in the JMonthYearPanel.
Calling this method will update the display, but it will not trigger a callback to the JpanelCalendar.
public void updateYear(int index)
This method passes changes from the JYearChooser up to the parent calendar widget.
public int getYear()
Returns the year currently selected in the JMonthYearPanel. This is not necessarily the same as the year of the currently selected day in the calendar.
public void initializeEditable()
This method initializes or re-initializes this panel for editing.
public void initializeNonEditable()
This method initializes or re-initializes this panel for display.
public void setAllowMonthChange(boolean allow)
This method toggles this panel from display mode to editing mode or vice-versa. If allow is true, this panel will be editable, and the year and month will be changable by the user.
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListenerprivate void performCallback()