JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.calendar
Class MonthSpin

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.util.swing.AbstractSpinBox
                          |
                          +--com.klg.jclass.util.swing.JCSpinBox
                                |
                                +--com.klg.jclass.util.calendar.MonthSpin
All Implemented Interfaces:
CalendarComponent, EventListener, ImageObserver, ItemListener, ItemSelectable, JCValueListener, MenuContainer, Serializable

public class MonthSpin
extends JCSpinBox
implements CalendarComponent, JCValueListener, ItemListener

SpinBox that shows months of the year.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.klg.jclass.util.swing.JCSpinBox
JCSpinBox.KeySelectionManager
 
Nested classes inherited from class com.klg.jclass.util.swing.AbstractSpinBox
AbstractSpinBox.ArrowButton, AbstractSpinBox.MetalArrowButton, AbstractSpinBox.MetalBorder
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  com.klg.jclass.util.JCListenerList actionListeners
           
protected  com.klg.jclass.util.value.JCValueModel calendarModel
           
protected  boolean ignoreChange
           
protected  Locale locale
           
protected  String[] months
           
protected  int selectedMonth
           
protected  boolean userSetMonths
           
 
Fields inherited from class com.klg.jclass.util.swing.JCSpinBox
actionCommand, firstPaint, itemListeners, keySelectionManager, lastSelectedItem, listDataListener, model, modelChanging
 
Fields inherited from class com.klg.jclass.util.swing.AbstractSpinBox
arrowKeySpinningAllowed, buttonTimer, continuousScroll, currentButton, DECREMENT, downArrow, editable, editor, editorIsValidateRoot, INCREMENT, l, metalBorder, minimumHeight, NONE, renderer, renderPanel, rl, upArrow, userFont, valueListeners, valueModel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MonthSpin(com.klg.jclass.util.value.JCValueModel model, Locale l)
          Constructs a MonthSpin with the given value model and locale.
MonthSpin(com.klg.jclass.util.value.JCValueModel model, Locale l, String[] months)
          Constructs a MonthSpin with the given value model and locale.
 
Method Summary
 void addActionListener(ActionListener l)
          Add listener to receive action event when data is changed by the user
 com.klg.jclass.util.value.JCValueModel getCalendarModel()
          Get the value model.
 Locale getLocale()
          Get the locale that is being used.
 com.klg.jclass.util.calendar.JCCalendar getSpecialDates()
          Get the special dates being used by the DayTable.
 com.klg.jclass.util.calendar.JCCalendar getSpecialDates(com.klg.jclass.util.calendar.JCCalendar sd)
          Deprecated. As the parameter is unused, should use getSpecialDates()
 void itemStateChanged(ItemEvent e)
          State Changed.
 void removeActionListener(ActionListener l)
          Remove listener to receive action event when data is changed by the user
 void setCalendarModel(com.klg.jclass.util.value.JCValueModel model)
          Set the value model.
 void setLocale(Locale l)
          Set the locale to use.
 void setSpecialDates(com.klg.jclass.util.calendar.JCCalendar sd)
          This component ignores special dates
 void valueChanged(com.klg.jclass.util.value.JCValueEvent event)
          The method informs the listener that the value has been changed.
 void valueChanging(com.klg.jclass.util.value.JCValueEvent event)
          The value is changing.
 
Methods inherited from class com.klg.jclass.util.swing.JCSpinBox
addItem, addItemListener, checkArrowButtons, checkSpinBoxMutableModel, getAbout, getActionCommand, getItemAt, getItemCount, getKeySelectionManager, getModel, getSelectedIndex, getSelectedItem, getSelectedObjects, handleKeyPressed, insertItemAt, modelChanged, paint, preferredWidthOfView, processValueChanged, removeAllItems, removeItem, removeItemAt, removeItemListener, selectWithKeyChar, setAbout, setActionCommand, setKeySelectionManager, setModel, setSelectedIndex, setSelectedItem, spinDown, spinUp
 
Methods inherited from class com.klg.jclass.util.swing.AbstractSpinBox
addValueListener, compareToValue, configureArrowButtons, createDecrArrow, createIncrArrow, doBorder, doFocusedLook, doLayout, doNonFocusedLook, getDecrementArrow, getEditor, getIncrementArrow, getPreferredSize, getRenderer, getValueModel, isArrowKeySpinningAllowed, isContinuousScroll, isEditable, isEnabled, isFocusTraversable, preferredHeightOfView, processFocusLost, processValueChanging, removeValueListener, requestFocus, setArrowEnabled, setArrowKeySpinningAllowed, setBackground, setContinuousScroll, setEditable, setEditor, setEnabled, setFont, setForeground, setLayout, setRenderer, setUI, setValue, setValueModel, swapEditorRenderer, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

locale

protected Locale locale

calendarModel

protected com.klg.jclass.util.value.JCValueModel calendarModel

selectedMonth

protected int selectedMonth

months

protected String[] months

userSetMonths

protected boolean userSetMonths

actionListeners

protected com.klg.jclass.util.JCListenerList actionListeners

ignoreChange

protected boolean ignoreChange
Constructor Detail

MonthSpin

public MonthSpin(com.klg.jclass.util.value.JCValueModel model,
                 Locale l)
Constructs a MonthSpin with the given value model and locale.

Parameters:
model - The new calendar value model
l - The locale to use

MonthSpin

public MonthSpin(com.klg.jclass.util.value.JCValueModel model,
                 Locale l,
                 String[] months)
Constructs a MonthSpin with the given value model and locale.

Parameters:
model - The new calendar value model
l - The locale to use
months - A list of months to use (null means use locale specific names)
Method Detail

setLocale

public void setLocale(Locale l)
Set the locale to use.

Specified by:
setLocale in interface CalendarComponent
Overrides:
setLocale in class AbstractSpinBox
Parameters:
l - The new locale to use

getLocale

public Locale getLocale()
Get the locale that is being used.

Overrides:
getLocale in class Component
Returns:
The current locale being used.

setCalendarModel

public void setCalendarModel(com.klg.jclass.util.value.JCValueModel model)
Set the value model.

Specified by:
setCalendarModel in interface CalendarComponent
Parameters:
model - The new calendar value model

getCalendarModel

public com.klg.jclass.util.value.JCValueModel getCalendarModel()
Get the value model.

Returns:
The current calendar value model

setSpecialDates

public void setSpecialDates(com.klg.jclass.util.calendar.JCCalendar sd)
This component ignores special dates

Specified by:
setSpecialDates in interface CalendarComponent
Parameters:
sd - The new list of special dates stored within a JCCalendar object

getSpecialDates

public com.klg.jclass.util.calendar.JCCalendar getSpecialDates(com.klg.jclass.util.calendar.JCCalendar sd)
Deprecated. As the parameter is unused, should use getSpecialDates()

Get the special dates being used by the DayTable.

Parameters:
sd - Unused
Returns:
The current list of special dates stored within a JCCalendar object

getSpecialDates

public com.klg.jclass.util.calendar.JCCalendar getSpecialDates()
Get the special dates being used by the DayTable.

Returns:
The current list of special dates stored within a JCCalendar object

addActionListener

public void addActionListener(ActionListener l)
Add listener to receive action event when data is changed by the user

Specified by:
addActionListener in interface CalendarComponent
Overrides:
addActionListener in class JCSpinBox
Parameters:
l - The action listener to be added

removeActionListener

public void removeActionListener(ActionListener l)
Remove listener to receive action event when data is changed by the user

Specified by:
removeActionListener in interface CalendarComponent
Overrides:
removeActionListener in class JCSpinBox
Parameters:
l - The action listener to be removed

itemStateChanged

public void itemStateChanged(ItemEvent e)
State Changed.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
e - The event caused by the item being changed

valueChanging

public void valueChanging(com.klg.jclass.util.value.JCValueEvent event)
The value is changing. The listener may further change the new_value or abort the change altogether. If the case of an abort (call event.setAllowChange(false)) the "valueChanged" method will never be called.

Specified by:
valueChanging in interface JCValueListener
Parameters:
event - The event generated by the value changing

valueChanged

public void valueChanged(com.klg.jclass.util.value.JCValueEvent event)
The method informs the listener that the value has been changed.

Specified by:
valueChanged in interface JCValueListener
Parameters:
event - The event generated by the value being changed

Copyright © 2004 Quest Software Inc..
All rights reserved.