public class WebCalendar extends WebPanel implements LanguageListener
WebDateField
,
Serialized FormJPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected boolean |
animate
Whether should animate month transitions or not.
|
protected Date |
date
Currently selected date.
|
protected DateCustomizer |
dateCustomizer
Date buttons customizer.
|
protected List<DateListener> |
dateListeners
Date selection listeners.
|
protected boolean |
displayWeekNumbers
Whether should display week numbers or not.
|
protected boolean |
horizontalSlide
Whether should perform horizontal slide animation or not.
|
protected WebToggleButton |
lastSelectedDayButton |
protected WebPanel |
monthDays |
protected ComponentTransition |
monthDaysTransition |
protected Map<Integer,WebToggleButton> |
mothDaysButtons
Runtime settings.
|
protected WebButton |
next |
protected WebButton |
nextSkip |
protected Date |
oldShownDate
Previously displayed month date.
|
protected WebButton |
previous |
protected WebButton |
previousSkip
UI components.
|
protected Date |
shownDate
Displayed month date.
|
protected boolean |
startWeekFromSunday
Whether sunday should be the first day of week or not.
|
protected DateFormat |
titleFormat
Calendar title format.
|
protected WebLabel |
titleLabel |
protected WebPanel |
weekHeaders |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
UNDEFINED
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
WebCalendar()
Constructs new calendar without selected date.
|
WebCalendar(Date date)
Constructs new calendar with the specified selected date.
|
WebCalendar(StyleId id)
Constructs new calendar without selected date.
|
WebCalendar(StyleId id,
Date date)
Constructs new calendar with the specified selected date.
|
Modifier and Type | Method and Description |
---|---|
void |
addDateSelectionListener(DateListener listener)
Adds date selection listener.
|
protected void |
changeMonth(int change)
Changes displayed month.
|
protected void |
changeYear(int change)
Changes displayed year.
|
protected TableLayout |
createMonthLayout()
Creates and returns month panel layout.
|
protected WebPanel |
createMonthPanel()
Creates and returns month panel.
|
protected TableLayout |
createWeekHeadersLayout()
Creates and returns week headers panel layout.
|
void |
fireDateSelected(Date date)
Informs about date selection change.
|
protected double[] |
getContentColumns()
Returns content columns.
|
Date |
getDate()
Returns currently selected date.
|
DateCustomizer |
getDateCustomizer()
Returns date buttons customizer.
|
StyleId |
getDefaultStyleId()
Returns default component
StyleId . |
protected int |
getFirstDatesColumn()
Returns first content column.
|
protected Direction |
getNextDirection(boolean ltr)
Returns next month transition direction.
|
protected Direction |
getPrevDirection(boolean ltr)
Returns previous month transition direction.
|
Date |
getShownDate()
Returns displayed month date.
|
DateFormat |
getTitleFormat()
Returns title format.
|
boolean |
isAnimate()
Returns whether should animate month transitions or not.
|
boolean |
isDisplayWeekNumbers()
Returns whether week numbers are displayed or not.
|
boolean |
isHorizontalSlide()
Returns whether should perform horizontal slide animation or not.
|
boolean |
isStartWeekFromSunday()
Returns whether sunday should be the first day of week or not.
|
void |
languageChanged(Language oldLanguage,
Language newLanguage) |
void |
removeDateSelectionListener(DateListener listener)
Removes date selection listener.
|
protected void |
requestFocusToSelected()
Requests focus to last selected date button.
|
void |
setAnimate(boolean animate)
Sets whether should animate month transitions or not.
|
void |
setDate(Date date)
Sets currently selected and displayed date.
|
void |
setDate(Date date,
boolean animate)
Sets currently selected and displayed date.
|
void |
setDateCustomizer(DateCustomizer dateCustomizer)
Sets date buttons customizer.
|
protected void |
setDateImpl(Date date)
Sets currently selected and displayed date.
|
protected void |
setDateImpl(Date date,
boolean animate)
Sets currently selected and displayed date.
|
void |
setDisplayWeekNumbers(boolean display)
Sets whether should display week numbers or not.
|
void |
setEnabled(boolean enabled) |
void |
setHorizontalSlide(boolean horizontalSlide)
Sets whether should perform horizontal slide animation or not.
|
void |
setShownDate(Date date)
Sets displayed month date.
|
void |
setShownDate(Date date,
boolean animate)
Sets displayed month date.
|
void |
setStartWeekFromSunday(boolean startWeekFromSunday)
Sets whether sunday should be the first day of week or not.
|
void |
setTitleFormat(DateFormat titleFormat)
Sets title format.
|
protected void |
updateMonth(boolean animate)
Switches view to new displayed month.
|
protected void |
updateMonth(JPanel monthDays)
Updates displayed month date buttons.
|
protected void |
updateSelectedDay(int dayNumber)
Updates selected day number.
|
protected void |
updateTitleLabel()
Switches to new title label.
|
protected void |
updateWeekHeaders()
Updates week headers.
|
add, add, add, add, add, addDictionaryListener, addLanguageListener, addStyleListener, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, changeFontSize, contains, equalizeComponentsHeight, equalizeComponentsSize, equalizeComponentsWidth, forEach, getCustomPainter, getFirstComponent, getFontName, getFontSize, getLanguage, getLastComponent, getMargin, getMaximumHeight, getMaximumSize, getMaximumWidth, getMinimumHeight, getMinimumSize, getMinimumWidth, getOriginalMaximumSize, getOriginalMinimumSize, getOriginalPreferredSize, getPadding, getPainterShape, getPreferredHeight, getPreferredSize, getPreferredWidth, getSkin, getStyleId, getUI, getUIClassID, isBoldFont, isItalicFont, isLanguageSet, isPlainFont, isShapeDetectionEnabled, loadSettings, onDoubleClick, onDragStart, onDragStart, onFocusGain, onFocusLoss, onKeyPress, onKeyPress, onKeyRelease, onKeyRelease, onKeyType, onKeyType, onMenuTrigger, onMouseClick, onMouseClick, onMouseDrag, onMouseDrag, onMouseEnter, onMouseExit, onMousePress, onMousePress, registerSettings, registerSettings, remove, remove, removeAll, removeDictionaryListener, removeDictionaryListeners, removeLanguage, removeLanguageListener, removeLanguageListeners, removeLanguageUpdater, removeStyleListener, removeToolTip, removeToolTips, removeToolTips, removeToolTips, resetCustomPainter, resetSkin, resetStyleId, saveSettings, setBoldFont, setBoldFont, setCustomPainter, setFontName, setFontSize, setFontSizeAndStyle, setFontSizeAndStyle, setFontStyle, setFontStyle, setItalicFont, setItalicFont, setLanguage, setLanguageUpdater, setMargin, setMargin, setMargin, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setPadding, setPadding, setPadding, setPlainFont, setPlainFont, setPreferredHeight, setPreferredSize, setPreferredWidth, setShapeDetectionEnabled, setSkin, setSkin, setStyleId, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setUI, unregisterSettings, updateLanguage, updateLanguage, updateUI
getAccessibleContext, paramString, setUI
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, getNextFocusableComponent, getPopupLocation, 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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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
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, 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, transferFocusUpCycle
protected List<DateListener> dateListeners
protected DateFormat titleFormat
protected boolean startWeekFromSunday
protected boolean displayWeekNumbers
protected boolean animate
protected boolean horizontalSlide
protected DateCustomizer dateCustomizer
protected Date date
protected Date shownDate
protected Date oldShownDate
protected WebButton previousSkip
protected WebButton previous
protected WebLabel titleLabel
protected WebButton next
protected WebButton nextSkip
protected WebPanel weekHeaders
protected WebPanel monthDays
protected ComponentTransition monthDaysTransition
protected WebToggleButton lastSelectedDayButton
protected final Map<Integer,WebToggleButton> mothDaysButtons
public WebCalendar()
public WebCalendar(Date date)
date
- selected datepublic WebCalendar(StyleId id)
id
- StyleId
@NotNull public StyleId getDefaultStyleId()
Styleable
StyleId
.
This method is asked when initial component StyleId
have to be provided.getDefaultStyleId
in interface Styleable
getDefaultStyleId
in class WebPanel
StyleId
public void languageChanged(@NotNull Language oldLanguage, @NotNull Language newLanguage)
languageChanged
in interface LanguageListener
protected void updateTitleLabel()
protected void updateMonth(boolean animate)
animate
- whether should animate transition or notprotected void changeMonth(int change)
change
- months change amountprotected void changeYear(int change)
change
- years change amountprotected WebPanel createMonthPanel()
protected TableLayout createWeekHeadersLayout()
protected TableLayout createMonthLayout()
protected double[] getContentColumns()
protected int getFirstDatesColumn()
protected void requestFocusToSelected()
protected Direction getNextDirection(boolean ltr)
ltr
- whether LTR orientation or notprotected Direction getPrevDirection(boolean ltr)
ltr
- whether LTR orientation or notprotected void updateWeekHeaders()
protected void updateMonth(JPanel monthDays)
monthDays
- panel to updateprotected void updateSelectedDay(int dayNumber)
dayNumber
- day numberpublic DateFormat getTitleFormat()
public void setTitleFormat(DateFormat titleFormat)
titleFormat
- title formatpublic Date getDate()
public void setDate(Date date)
date
- date to select and displaypublic void setDate(Date date, boolean animate)
date
- date to select and displayanimate
- whether should animate month transition or notprotected void setDateImpl(Date date)
date
- date to select and displayprotected void setDateImpl(Date date, boolean animate)
date
- date to select and displayanimate
- whether should animate month transition or notpublic Date getShownDate()
public void setShownDate(Date date)
date
- displayed month datepublic void setShownDate(Date date, boolean animate)
date
- displayed month dateanimate
- whether should animate month transition or notpublic boolean isStartWeekFromSunday()
public void setStartWeekFromSunday(boolean startWeekFromSunday)
startWeekFromSunday
- whether sunday should be the first day of week or notpublic boolean isDisplayWeekNumbers()
public void setDisplayWeekNumbers(boolean display)
display
- whether should display week numbers or notpublic boolean isAnimate()
public void setAnimate(boolean animate)
animate
- whether should animate month transitions or notpublic boolean isHorizontalSlide()
public void setHorizontalSlide(boolean horizontalSlide)
horizontalSlide
- whether should perform horizontal slide animation or notpublic DateCustomizer getDateCustomizer()
public void setDateCustomizer(DateCustomizer dateCustomizer)
dateCustomizer
- date buttons customizerpublic void setEnabled(boolean enabled)
setEnabled
in class JComponent
public void addDateSelectionListener(DateListener listener)
listener
- date selection listenerpublic void removeDateSelectionListener(DateListener listener)
listener
- date selection listenerpublic void fireDateSelected(Date date)
date
- new selected dateCopyright © 2020. All rights reserved.