|
Java Date Picker v3.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.standbysoft.component.date.swing.JDateComponent
com.standbysoft.component.date.swing.JMonth
A JMonth is a convenient way of representing all the days of
a month from the calendar. It inherits from JDateComponent
which means that it uses a date selection model
to restrict date selection as you need.
Although date selection can be controled using the selection model, the API
has a few methods for the most frequent operations. It adds a method
for selecting a set of dates and one for
changing the selection type.
An important part of its API is reserved for customizing its appearance. You can control:
horizontal, vertical and colorweek names and numbersmonth background, title background and foreground, trailing datesdate rendererThe third and last part of the API is dedicated to the MonthModel
and its wrapper methods that define month specific information. The month model
is a way of abstracting all the information about the currently displayed month, like:
Because this component is only a visualization for one calendar month, you
might actually want to use the more feature rich JMonthView.
| Nested Class Summary |
| Nested classes inherited from class com.standbysoft.component.date.swing.JDateComponent |
JDateComponent.DateAction, JDateComponent.RollDateAction, JDateComponent.SelectFirstDayAction, JDateComponent.SelectLastDayAction, JDateComponent.SelectNoneAction, JDateComponent.SelectTodayAction |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static java.lang.String |
DATE_COMMAND
Action name that indicates a date command. |
protected java.awt.Color |
gridColor
|
protected boolean |
horizontalLinesVisible
|
protected java.awt.Color |
monthBackground
|
protected MonthModel |
monthModel
|
protected MonthModelListener |
monthModelListener
Listener that takes month model events from the model and fires them further away as events generated by this component. |
protected DateRenderer |
renderer
Renderer that is used to display the dates of a month. |
protected java.awt.Color |
titleBackground
|
protected java.awt.Color |
titleForeground
|
protected java.awt.Color |
trailingForeground
|
protected boolean |
verticalLinesVisible
|
protected boolean |
weekNamesVisible
|
protected boolean |
weekNumbersVisible
|
| Fields inherited from class com.standbysoft.component.date.swing.JDateComponent |
actionCommand, dateSelectionModel, dateSelectionModelListener, locale, selectFirstDayAction, selectLastDayAction, selectNextDayAction, selectNoneAction, selectPreviousDayAction, selectSameDayNextMonthAction, selectSameDayNextWeekAction, selectSameDayNextYearAction, selectSameDayPreviousMonthAction, selectSameDayPreviousWeekAction, selectSameDayPreviousYearAction, selectTodayAction |
| 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 | |
JMonth()
Creates a component that displays the days of a month. |
|
JMonth(MonthModel model)
|
|
JMonth(MonthModel model,
DateSelectionModel dateSelectionModel)
|
|
| Method Summary | |
void |
addMonthModelListener(MonthModelListener listener)
Registers a month model listener that will receive notifications when the month model model changes. |
protected void |
fireDowFirstChanged(MonthModelEvent evt)
|
protected void |
fireDowNamesFormatChanged(MonthModelEvent evt)
|
protected void |
fireMonthChanged(MonthModelEvent evt)
|
protected void |
fireMonthNamesFormatChanged(MonthModelEvent evt)
|
DateRenderer |
getDateRenderer()
Returns the renderer used to display the dates of the month. |
int |
getDowFirst()
Returns the first day of week. |
java.awt.Color |
getGridColor()
Detrmines the color used to paint the grid. |
int |
getMonth()
Returns the month displayed by this component. |
java.awt.Color |
getMonthBackground()
Returns the background color for the displayed month. |
MonthModel |
getMonthModel()
Returns the month model used by this component. |
java.util.Date[] |
getSelectedDates()
Returns the selected dates. |
DateSelectionModel.SelectionMode |
getSelectionMode()
Returns the selection mode used by this component. |
java.awt.Color |
getTitleBackground()
Returns the background color for the month title. |
java.awt.Color |
getTitleForeground()
Returns the foreground color for the month title. |
java.awt.Color |
getTrailingForeground()
Returns the foreground color for trailing days. |
java.lang.String |
getUIClassID()
Returns the name of the L&F class that renders this component. |
int |
getYear()
Returns the year that is displayed by this component. |
boolean |
isHorizontalLinesVisible()
Determines whether the horizontal lines of the grid are visible. |
boolean |
isVerticalLinesVisible()
Determines whether the vertical lines of the grid are visible. |
boolean |
isWeekNamesVisible()
Determines whether the week names are visible or not. |
boolean |
isWeekNumbersVisible()
Determines whether the week numbers are visible or not. |
void |
removeMonthModelListener(MonthModelListener listener)
Removes a specified month model listener. |
void |
requestFocus()
|
void |
setDateRenderer(DateRenderer renderer)
Specify a renderer that will be used to display the dates of the month. |
void |
setDowFirst(int dow)
Specifies the first day of week. |
void |
setGridColor(java.awt.Color color)
Specifies the color used to paint the grid when it is visible. |
void |
setHorizontalLinesVisible(boolean visible)
Specifies whether the horizontal lines of the grid are visible. |
void |
setLocale(java.util.Locale locale)
Specifies a new locale to be used by this component. |
void |
setMonth(int month)
Specifies the month that is displayed by this component. |
void |
setMonthBackground(java.awt.Color color)
Sets the background color for the displayed month. |
void |
setMonthModel(MonthModel model)
Specifies a new month model for this component. |
void |
setSelectedDates(java.util.Date[] dates)
Specifies the dates selected by this component. |
void |
setSelectionMode(DateSelectionModel.SelectionMode mode)
Specifies a new selection mode to be used by this component. |
void |
setTitleBackground(java.awt.Color color)
Sets the background color for the month title. |
void |
setTitleForeground(java.awt.Color color)
Sets the foreground color for the month title. |
void |
setTrailingForeground(java.awt.Color color)
Sets the foreground color for trailing days. |
void |
setVerticalLinesVisible(boolean visible)
Specifies whether the vertical lines of the grid are visible. |
void |
setWeekNamesVisible(boolean visible)
Specifies whether the week names are visible or not. |
void |
setWeekNumbersVisible(boolean visible)
Specifies whether the week numbers are visible or not. |
void |
setYear(int year)
Specifies the year that is displayed by this component. |
| Methods inherited from class com.standbysoft.component.date.swing.JDateComponent |
addActionListener, addDateSelectionListener, fireActionEvent, fireDateSelectionChanged, fireDisabledDatesChanged, fireEmptySelectionAllowedChanged, fireSelectionModeChanged, getActionCommand, getDateSelectionModel, getLocale, getSelectedDate, getUI, isEmptySelectionAllowed, removeActionListener, removeDateSelectionListener, setActionCommand, setDateSelectionModel, setEmptySelectionAllowed, setSelectedDate, setUI, 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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, 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, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, 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, 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, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, 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 |
public static final java.lang.String DATE_COMMAND
protected MonthModelListener monthModelListener
protected DateRenderer renderer
protected MonthModel monthModel
protected java.awt.Color monthBackground
protected java.awt.Color titleBackground
protected java.awt.Color titleForeground
protected java.awt.Color trailingForeground
protected java.awt.Color gridColor
protected boolean weekNumbersVisible
protected boolean weekNamesVisible
protected boolean horizontalLinesVisible
protected boolean verticalLinesVisible
| Constructor Detail |
public JMonth()
public JMonth(MonthModel model)
public JMonth(MonthModel model,
DateSelectionModel dateSelectionModel)
| Method Detail |
public void requestFocus()
public void addMonthModelListener(MonthModelListener listener)
listener - listener that is registeredsetMonthModel(MonthModel),
removeMonthModelListener(MonthModelListener)public void removeMonthModelListener(MonthModelListener listener)
listener - removed listenerpublic MonthModel getMonthModel()
public void setMonthModel(MonthModel model)
model - new month model to be used by this componentpublic void setDateRenderer(DateRenderer renderer)
renderer - specified renderer that displays the dates of the monthpublic DateRenderer getDateRenderer()
public java.lang.String getUIClassID()
public int getDowFirst()
MonthModel.getDowFirst()public void setDowFirst(int dow)
dow - day of week that is a java.util.Calendar
constant like Calendar.MONDAYMonthModel.setDowFirst(int)public void setMonth(int month)
java.util.Calendar.
month - MonthModel.setMonth(int)public int getMonth()
MonthModel.getMonth(),
getYear()public void setYear(int year)
year - year that is displayed by this component.MonthModel.setYear(int)public int getYear()
MonthModel.getYear(),
getMonth()public void setLocale(java.util.Locale locale)
setLocale in class JDateComponentlocale - locale to be used by this componentpublic boolean isWeekNumbersVisible()
true if the week numbers are visible or false otherwise.public void setWeekNumbersVisible(boolean visible)
visible - visibility of the week numberspublic boolean isWeekNamesVisible()
true if the week names are visible or false otherwise.public void setWeekNamesVisible(boolean visible)
visible - visibility of the week namespublic boolean isHorizontalLinesVisible()
true if the horizontal line are visible; false otherwisesetHorizontalLinesVisible(boolean)public void setHorizontalLinesVisible(boolean visible)
visible - true if the lines should be visible; false otherwisesetVerticalLinesVisible(boolean),
setGridColor(Color)public boolean isVerticalLinesVisible()
true if the vertical line are visible; false otherwisesetVerticalLinesVisible(boolean)public void setVerticalLinesVisible(boolean visible)
visible - true if the lines should be visible; false otherwisesetHorizontalLinesVisible(boolean),
setGridColor(Color)public java.awt.Color getGridColor()
setGridColor(Color)public void setGridColor(java.awt.Color color)
color - color used to paint the gridsetHorizontalLinesVisible(boolean),
setVerticalLinesVisible(boolean)public java.awt.Color getTitleBackground()
setTitleBackground(Color)public void setTitleBackground(java.awt.Color color)
color - new color that is set.setDateRenderer(DateRenderer)public java.awt.Color getTitleForeground()
setTitleForeground(Color)public void setTitleForeground(java.awt.Color color)
color - new color that is set.setDateRenderer(DateRenderer)public java.awt.Color getTrailingForeground()
setTrailingForeground(Color)public void setTrailingForeground(java.awt.Color color)
color - new color that is setsetDateRenderer(DateRenderer)public java.awt.Color getMonthBackground()
setMonthBackground(Color)public void setMonthBackground(java.awt.Color color)
color - new color that is setsetDateRenderer(DateRenderer)public java.util.Date[] getSelectedDates()
JDateComponent.setEmptySelectionAllowed(boolean)public void setSelectedDates(java.util.Date[] dates)
dates - array of dates selected by this component. If the array is empty,
no date will be selected.getSelectedDates(),
setSelectionMode(com.standbysoft.component.date.DateSelectionModel.SelectionMode)public DateSelectionModel.SelectionMode getSelectionMode()
public void setSelectionMode(DateSelectionModel.SelectionMode mode)
mode - selection mode to be used by this componentJDateComponent.setEmptySelectionAllowed(boolean)protected void fireMonthChanged(MonthModelEvent evt)
protected void fireDowFirstChanged(MonthModelEvent evt)
protected void fireDowNamesFormatChanged(MonthModelEvent evt)
protected void fireMonthNamesFormatChanged(MonthModelEvent evt)
|
Java Date Picker v3.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Visit www.javadatepicker.com for further information or send us your suggestions.
Copyright © 2003-2004 Stand By Soft Ltd. All Rights Reserved.