|
|||||||||
| 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
org.formaria.swing.date.CalendarPanel
public class CalendarPanel
A panel containing a representation of a month so that the user can select a date visually. Events/Appointments can be added and rendered via the CalendatEvent interface.
Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.
$Revision: 1.2 $
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
DAY_VIEW
|
protected int |
highlightedDay
|
static int |
MONTH_VIEW
|
protected int |
selectedDay
|
protected StyleManager |
styleManager
|
protected java.lang.String[] |
styles
|
| 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 | |
|---|---|
CalendarPanel()
|
|
| Method Summary | |
|---|---|
java.util.Date |
getDate()
Gets the current date. |
boolean |
getDayNames()
Get the style of the 3D elements including the navigation buttons |
boolean |
getDrawBorder()
Get the drawBorder flag value |
java.lang.String |
getFormat()
Get the format of the edit field. |
java.lang.String |
getHeaderStyle()
Get the style of the header. |
java.lang.String |
getHighlightStyle()
Get the style of the highlighted date. |
Appointment |
getSelectedAppointment()
Get the selected appointment if any. |
java.lang.String |
getSelectedStyle()
Get the style of the selected date. |
java.lang.String |
getStyle()
Get the style asociated with the normal elements |
java.lang.String |
getStyleHighlighted()
Get the style asociated with the highlighted element |
java.lang.String |
getStyleSelected()
Get the style asociated with the selected elements |
java.lang.String |
getStyleWeekend()
Get the style asociated with the weekend element |
java.lang.String |
getText()
Get the text/label of a component |
java.lang.String |
getThreeDStyle()
Get the style of the 3D elements including the navigation buttons |
java.lang.String |
getWeekendStyle()
Get the style of the weekend elements. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
next()
Move to the next month |
void |
nextDay()
Move to the next month |
void |
nextYear()
Move to the next year |
void |
paintComponent(java.awt.Graphics g)
Renders the current month |
void |
paintDayView(java.awt.Graphics2D g2d)
Paint the day view of the calendar |
void |
paintMonthView(java.awt.Graphics2D g2d)
Paint the month view of the calendar |
void |
prev()
Move to the previous month |
void |
prevDay()
Move to the previous month |
void |
prevYear()
Move to the previous year |
void |
setAppointmentPainter(AppointmentPainter painter)
Set the AppointmentPainter which will receive month and day view paint events. |
void |
setAppointmentProvider(AppointmentProvider provider)
Set the appointment provider that provides the dates for this calendar |
void |
setBounds(int x,
int y,
int w,
int h)
Moves and resizes this component. |
void |
setDate(java.util.Date newDate)
Sets the current date |
void |
setDateFormat(java.lang.String dateFormat)
Set the date format string |
void |
setDayNames(boolean show)
Set the style of the 3D elements including the navigation buttons |
void |
setDrawBorder(boolean b)
Set the drawBorder flag value |
void |
setFormat(java.lang.String format)
Set the format of the edit field. |
void |
setHeaderStyle(java.lang.String styleName)
Set the style of the header. |
void |
setHighlightStyle(java.lang.String styleName)
Set the style of the highlighted date. |
void |
setSelectedStyle(java.lang.String styleName)
Set the style of the selected date. |
void |
setShowDayNames(boolean state)
Show or hide the day names |
void |
setStyle(java.lang.String newStyle)
set the style asociated with the normal elements |
void |
setStyleHighlighted(java.lang.String newStyle)
set the style asociated with highlighted element |
void |
setStyles(java.lang.String[] styles)
Set the styles for the date panel |
void |
setStyleSelected(java.lang.String newStyle)
Get the style asociated with the selected elements |
void |
setStyleWeekend(java.lang.String newStyle)
set the style asociated with weekend element |
void |
setText(java.lang.String s)
Set the text/label of a component |
void |
setThreeDStyle(java.lang.String styleName)
Set the style of the 3D elements including the navigation buttons |
void |
setView(java.lang.String mode)
Set the view mode |
void |
setWeekendStyle(java.lang.String styleName)
Set the style of the weekend elements. |
void |
showNavItems(boolean bShow)
Show the navigation header items |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, update, updateUI |
| 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, 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 int MONTH_VIEW
public static final int DAY_VIEW
protected StyleManager styleManager
protected int selectedDay
protected int highlightedDay
protected java.lang.String[] styles
| Constructor Detail |
|---|
public CalendarPanel()
| Method Detail |
|---|
public void setAppointmentPainter(AppointmentPainter painter)
painter - the AppointmentPainter objectpublic void setAppointmentProvider(AppointmentProvider provider)
provider - the object that provides the appointment informationpublic void showNavItems(boolean bShow)
bShow - true to show the navigation items
public void setBounds(int x,
int y,
int w,
int h)
x and y, and the
new size is specified by width and height.
setBounds in class java.awt.Componentx - the new x-coordinate of this componenty - the new y-coordinate of this componentwidth - the new width of this componentheight - the new height of this
componentJComponent.getBounds(java.awt.Rectangle),
Component.setLocation(int, int),
Component.setLocation(Point),
Component.setSize(int, int),
Component.setSize(Dimension)public void setView(java.lang.String mode)
mode - "month" or "day"public java.util.Date getDate()
public void setDate(java.util.Date newDate)
newDate - the new datepublic void prev()
public void next()
public void prevDay()
public void nextDay()
public void prevYear()
public void nextYear()
public Appointment getSelectedAppointment()
public void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentg - public void paintMonthView(java.awt.Graphics2D g2d)
public void paintDayView(java.awt.Graphics2D g2d)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic java.lang.String getStyleSelected()
public void setStyleSelected(java.lang.String newStyle)
newStyle - the style namepublic java.lang.String getStyleWeekend()
public void setStyleWeekend(java.lang.String newStyle)
newStyle - the style namepublic java.lang.String getStyleHighlighted()
public void setStyleHighlighted(java.lang.String newStyle)
newStyle - the style namepublic java.lang.String getStyle()
public void setStyle(java.lang.String newStyle)
newStyle - the style namepublic void setStyles(java.lang.String[] styles)
styles - the styles in the following order: style, selectedStyle, weekendStyle, highlightStyle, headerStyle, threeDStylepublic void setShowDayNames(boolean state)
state - true to show the day namespublic void setWeekendStyle(java.lang.String styleName)
styleName - the style name for the weekend datespublic void setSelectedStyle(java.lang.String styleName)
styleName - the style name for the selected datepublic void setHighlightStyle(java.lang.String styleName)
styleName - the style name for the highlighted datepublic void setHeaderStyle(java.lang.String styleName)
styleName - the style name for the highlighted datepublic void setThreeDStyle(java.lang.String styleName)
styleName - the style name for the highlighted datepublic void setFormat(java.lang.String format)
format - the new date formatpublic void setDayNames(boolean show)
styleName - the style name for the highlighted datepublic java.lang.String getWeekendStyle()
public java.lang.String getSelectedStyle()
public java.lang.String getHighlightStyle()
public java.lang.String getHeaderStyle()
public java.lang.String getThreeDStyle()
public java.lang.String getFormat()
public boolean getDayNames()
public void setText(java.lang.String s)
TextHolder
setText in interface TextHolders - the new textpublic java.lang.String getText()
TextHolder
getText in interface TextHolderpublic boolean getDrawBorder()
public void setDrawBorder(boolean b)
b - true if the border is drawnpublic void setDateFormat(java.lang.String dateFormat)
dateFormat -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||