Sky View Café - Java

org.shetline.gui
Class CalendarComboBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.shetline.gui.KPanel
                      extended by org.shetline.gui.CalendarComboBox
All Implemented Interfaces:
ActionListener, FocusListener, TextListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class CalendarComboBox
extends KPanel
implements ActionListener, FocusListener, TextListener

See Also:
Serialized Form

Nested Class Summary
static class CalendarComboBox.DateStyle
           
protected  class CalendarComboBox.KeyAction
           
 
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
protected  MiniCalendar calendar
           
protected  AbstractButton calendarButton
           
protected static String CMD_HIDE_CALENDAR
           
protected static String CMD_NAV_DOWN
           
static String DATE_CHANGED
           
protected  KTextField dateField
           
protected  DateFormat dateFormat
           
protected  boolean dateIsFormatted
           
protected  boolean dateIsParsed
           
protected  boolean dateIsValid
           
protected static KeyStroke DOWN_KEY
           
protected static KeyStroke ESC_KEY
           
static int FIRST_YEAR_FOR_TWO_DIGIT_YEAR_NOT_SET
           
protected  int firstYearForTwoDigitYear
           
static CalendarComboBox.DateStyle FULL
           
protected  int ignoreCalendar
           
protected  int ignoreChange
           
static CalendarComboBox.DateStyle ISO
           
protected  int[] lastValidDate
           
protected  ListenerHandler listenerHandler
           
static CalendarComboBox.DateStyle LONG
           
static CalendarComboBox.DateStyle MEDIUM
           
protected  KPopup popup
           
static CalendarComboBox.DateStyle SHORT
           
 
Fields inherited from class org.shetline.gui.KPanel
maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
 
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
  CalendarComboBox()
           
  CalendarComboBox(boolean hideDateField)
           
  CalendarComboBox(int columns)
           
protected CalendarComboBox(int columns, boolean hideDateField)
           
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 void addActionListener(ActionListener listener)
           
 void addActionListener(ActionListener listener, boolean addWeakly)
           
protected  void broadcastChange()
           
 void clearFirstYearForTwoDigitYear()
           
protected  MiniCalendar createCalendar()
           
protected  AbstractButton createCalendarButton()
           
protected  KTextField createTextField(int columns)
           
protected  void doCommand(String command)
           
 void focusGained(FocusEvent event)
           
 void focusLost(FocusEvent event)
           
protected  void formatDate()
           
protected  void formatDate(boolean silently)
           
protected  void formatDate(boolean silently, boolean allowBadDate)
           
 MiniCalendar getCalendar()
           
 JComponent getCalendarButton()
           
protected  int getCalendarButtonGap()
           
 Date getDate()
           
 int[] getDateArray()
           
 int getFirstYearForTwoDigitYear()
           
 Date getGregorianChange()
           
 int[] getGregorianChangeArray()
           
 int getMaximumYear()
           
 int getMinimumYear()
           
 DateFormat getPreferredDateFormat()
           
 Dimension getPreferredSize()
           
 boolean getShowBC()
           
 String getText()
           
 KTextField getTextField()
           
 void hidePopup()
           
 boolean isBlank()
           
 boolean isValidDate()
           
protected  void parseDate()
           
 void removeActionListener(ActionListener listener)
           
 void requestFocus()
           
 void setBlank()
           
 void setBlank(boolean silently)
           
 void setDate(Date date)
           
 void setDate(Date date, boolean silently)
           
 void setDate(Date date, TimeZone zone)
           
 void setDate(Date date, TimeZone zone, boolean silently)
           
 void setDate(int[] ymd)
           
 void setDate(int[] ymd, boolean silently)
           
 void setDate(int year, int month, int day)
           
 void setDate(int year, int month, int day, boolean silently)
           
 void setEnabled(boolean enabled)
           
 void setFirstYearForTwoDigitYear(int firstYearForTwoDigitYear)
           
 void setGregorianChange(Date date)
           
 void setGregorianChange(int[] ymd)
           
 void setGregorianChange(int year, int month, int date)
           
 void setLocale(Locale locale)
           
 void setMaximumYear(int year)
           
 void setMinimumYear(int year)
           
 void setPreferredDateFormat(CalendarComboBox.DateStyle style)
           
 void setPreferredDateFormat(DateFormat format)
           
 void setShowBC(boolean show)
           
 void setText(String s)
           
 void setText(String s, boolean silently)
           
 void setTimeZone(TimeZone zone)
           
protected  void showPopup()
           
 void textValueChanged(TextEvent event)
           
protected  void togglePopup()
           
 
Methods inherited from class org.shetline.gui.KPanel
beep, getInnerSize, getInsets, getInsetsWithinBorder, getMaximumHeight, getMaximumInnerSize, getMaximumSize, getMaximumWidth, getMinimumHeight, getMinimumInnerSize, getMinimumSize, getMinimumWidth, getPreferredHeight, getPreferredInnerSize, getPreferredWidth, getScreenSize, paintComponent, paintInnerComponent, processInnerMouseEvent, processInnerMouseMotionEvent, processMouseEvent, processMouseMotionEvent, setInsets, setInsets, setInsets, setMaximumHeight, setMaximumWidth, setMinimumHeight, setMinimumWidth, setPreferredHeight, setPreferredWidth
 
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, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, 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, 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, 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, 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, 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

calendar

protected MiniCalendar calendar

calendarButton

protected AbstractButton calendarButton

dateField

protected KTextField dateField

dateFormat

protected DateFormat dateFormat

dateIsFormatted

protected boolean dateIsFormatted

dateIsParsed

protected boolean dateIsParsed

dateIsValid

protected boolean dateIsValid

firstYearForTwoDigitYear

protected int firstYearForTwoDigitYear

ignoreCalendar

protected int ignoreCalendar

ignoreChange

protected int ignoreChange

lastValidDate

protected int[] lastValidDate

listenerHandler

protected ListenerHandler listenerHandler

popup

protected KPopup popup

DOWN_KEY

protected static final KeyStroke DOWN_KEY

ESC_KEY

protected static final KeyStroke ESC_KEY

CMD_NAV_DOWN

protected static final String CMD_NAV_DOWN
See Also:
Constant Field Values

CMD_HIDE_CALENDAR

protected static final String CMD_HIDE_CALENDAR
See Also:
Constant Field Values

FIRST_YEAR_FOR_TWO_DIGIT_YEAR_NOT_SET

public static final int FIRST_YEAR_FOR_TWO_DIGIT_YEAR_NOT_SET
See Also:
Constant Field Values

SHORT

public static final CalendarComboBox.DateStyle SHORT

MEDIUM

public static final CalendarComboBox.DateStyle MEDIUM

LONG

public static final CalendarComboBox.DateStyle LONG

FULL

public static final CalendarComboBox.DateStyle FULL

ISO

public static final CalendarComboBox.DateStyle ISO

DATE_CHANGED

public static final String DATE_CHANGED
See Also:
Constant Field Values
Constructor Detail

CalendarComboBox

public CalendarComboBox()

CalendarComboBox

public CalendarComboBox(int columns)

CalendarComboBox

public CalendarComboBox(boolean hideDateField)

CalendarComboBox

protected CalendarComboBox(int columns,
                           boolean hideDateField)
Method Detail

createCalendar

protected MiniCalendar createCalendar()

createTextField

protected KTextField createTextField(int columns)

createCalendarButton

protected AbstractButton createCalendarButton()

getCalendarButtonGap

protected int getCalendarButtonGap()

getTextField

public KTextField getTextField()

getCalendar

public MiniCalendar getCalendar()

getCalendarButton

public JComponent getCalendarButton()

setPreferredDateFormat

public void setPreferredDateFormat(CalendarComboBox.DateStyle style)

setPreferredDateFormat

public void setPreferredDateFormat(DateFormat format)

getPreferredDateFormat

public DateFormat getPreferredDateFormat()

setGregorianChange

public void setGregorianChange(Date date)

setGregorianChange

public void setGregorianChange(int year,
                               int month,
                               int date)

setGregorianChange

public void setGregorianChange(int[] ymd)

getGregorianChange

public Date getGregorianChange()

getGregorianChangeArray

public int[] getGregorianChangeArray()

setMaximumYear

public void setMaximumYear(int year)

getMaximumYear

public int getMaximumYear()

setMinimumYear

public void setMinimumYear(int year)

getMinimumYear

public int getMinimumYear()

getFirstYearForTwoDigitYear

public int getFirstYearForTwoDigitYear()

setFirstYearForTwoDigitYear

public void setFirstYearForTwoDigitYear(int firstYearForTwoDigitYear)

clearFirstYearForTwoDigitYear

public void clearFirstYearForTwoDigitYear()

setShowBC

public void setShowBC(boolean show)

getShowBC

public boolean getShowBC()

setLocale

public void setLocale(Locale locale)
Overrides:
setLocale in class Component

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class JComponent

addActionListener

public void addActionListener(ActionListener listener)

addActionListener

public void addActionListener(ActionListener listener,
                              boolean addWeakly)

removeActionListener

public void removeActionListener(ActionListener listener)

broadcastChange

protected void broadcastChange()

setDate

public void setDate(int year,
                    int month,
                    int day)

setDate

public void setDate(int year,
                    int month,
                    int day,
                    boolean silently)

setText

public void setText(String s)

setText

public void setText(String s,
                    boolean silently)

setDate

public void setDate(int[] ymd)

setDate

public void setDate(int[] ymd,
                    boolean silently)

setDate

public void setDate(Date date,
                    TimeZone zone)

setDate

public void setDate(Date date,
                    TimeZone zone,
                    boolean silently)

setDate

public void setDate(Date date)

setDate

public void setDate(Date date,
                    boolean silently)

setTimeZone

public void setTimeZone(TimeZone zone)

getDate

public Date getDate()

getDateArray

public int[] getDateArray()

setBlank

public void setBlank()

setBlank

public void setBlank(boolean silently)

isBlank

public boolean isBlank()

isValidDate

public boolean isValidDate()

getText

public String getText()

hidePopup

public void hidePopup()

showPopup

protected void showPopup()

togglePopup

protected void togglePopup()

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class KPanel

actionPerformed

public void actionPerformed(ActionEvent event)
Specified by:
actionPerformed in interface ActionListener

formatDate

protected void formatDate()

formatDate

protected void formatDate(boolean silently)

formatDate

protected void formatDate(boolean silently,
                          boolean allowBadDate)

parseDate

protected void parseDate()

textValueChanged

public void textValueChanged(TextEvent event)
Specified by:
textValueChanged in interface TextListener

focusGained

public void focusGained(FocusEvent event)
Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent event)
Specified by:
focusLost in interface FocusListener

requestFocus

public void requestFocus()
Overrides:
requestFocus in class JComponent

doCommand

protected void doCommand(String command)

Sky View Café - Java