Class symantec.itools.awt.util.Calendar
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.util.Calendar

Object
   |
   +----Component
           |
           +----Container
                   |
                   +----Panel
                           |
                           +----symantec.itools.awt.util.Calendar

public class Calendar
extends Panel
Calendar component. Creates a graphic calendar displaying a month of dates. A combo box controls the month displayed, a numeric spin control changes the year displayed.

Version:
1.1, July 18, 1997
Author:
Symantec

Variable Index

 o bNeedsPlatformHelp
True if the ComboBox needs help changing state.
 o cal
Not used.
 o centerNumber
Internal drawing calibration value.
 o combo
The ComboBox that displays/controls the month.
 o dCurrent
The date that the calendar is set to.
 o dLast
The current date when the Calendar was last painted.
 o dateSelectedx
The column index of the currently selected day.
 o dateSelectedy
The row index of the currently selected day.
 o edgePad
The number of pixels to offset the internal components from the edges.
 o firstDay
The day of the week the month starts on.
 o heightAdjust
Internal drawing calibration value.
 o lastSelectedDate
The day selected when the Caledar was last painted.
 o maxMonthx
The column index of the last day in the month.
 o maxMonthy
The row index of the last day in the month.
 o numberAdjust
Internal drawing calibration value.
 o sc
The spinner that displays/controls the year.
 o selectHeight
Internal drawing calibration value.
 o selectedColor
The color used to highlight the selected date on the calendar.
 o topRow
Internal drawing calibration value.

Constructor Index

 o symantec.itools.awt.util.Calendar()
Creates a default calendar with today's date initialized.
 o symantec.itools.awt.util.Calendar(Date)
Creates a calendar with the specified date initialized.

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this button.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all property change events.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener for all vetoable property change events.
 o getActionCommand()
 o getDate()
Returns the date that the calendar is set to.
 o getSelectedColor()
Returns the color that highlights the selected date on the calendar.
 o minimumSize()
Returns the minimum dimensions to properly display this component.
 o paint(Graphics)
Paints this component using the given graphics context.
 o preferredSize()
Returns the recommended dimensions to properly display this component.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this button.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all property change events.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a listener for all vetoable property change events.
 o setActionCommand(String)
Sets the command name of the action event fired by this button.
 o setDate(String)
Sets the date selected on the calendar.
 o setLayout(LayoutManager)
Takes no action.
 o setSelectedColor(Color)
Sets the color used to highlight the selected date on the calendar.
 o sourceActionEvent()
Fire an action event to the listeners
 o update(Graphics)
Handles redrawing of this component on the screen.

Variables

 o bNeedsPlatformHelp
protected boolean bNeedsPlatformHelp
True if the ComboBox needs help changing state.

See Also:
combo, needsPlatformHelp
 o cal
protected java.lang.String[][] cal
Not used.

 o centerNumber
protected int centerNumber
Internal drawing calibration value.

 o combo
protected symantec.itools.awt.ComboBox combo
The ComboBox that displays/controls the month.

 o dCurrent
protected java.util.Date dCurrent
The date that the calendar is set to.

See Also:
setDate, getDate
 o dLast
protected java.util.Date dLast
The current date when the Calendar was last painted.

 o dateSelectedx
protected int dateSelectedx
The column index of the currently selected day.

 o dateSelectedy
protected int dateSelectedy
The row index of the currently selected day.

 o edgePad
protected int edgePad
The number of pixels to offset the internal components from the edges.

 o firstDay
protected int firstDay
The day of the week the month starts on.

 o heightAdjust
protected int heightAdjust
Internal drawing calibration value.

 o lastSelectedDate
protected int lastSelectedDate
The day selected when the Caledar was last painted.

 o maxMonthx
protected int maxMonthx
The column index of the last day in the month.

 o maxMonthy
protected int maxMonthy
The row index of the last day in the month.

 o numberAdjust
protected int numberAdjust
Internal drawing calibration value.

 o sc
protected symantec.itools.awt.util.spinner.NumericSpinner sc
The spinner that displays/controls the year.

 o selectHeight
protected int selectHeight
Internal drawing calibration value. The height of a selected area in the Calendar, in pixels.

 o selectedColor
protected java.awt.Color selectedColor
The color used to highlight the selected date on the calendar.

See Also:
setSelectedColor, getSelectedColor
 o topRow
protected int topRow
Internal drawing calibration value. The height of the topmost row of the Calendar, in pixels.

Constructors

 o Calendar
public Calendar()
Creates a default calendar with today's date initialized.

 o Calendar
public Calendar(Date defaultdate)
Creates a calendar with the specified date initialized.

Parameters:
defaultdate - the date to be shown initially

Methods

 o addActionListener
public synchronized void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this button.

Parameters:
l - the action listener
 o addNotify
public synchronized void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. It has been overridden here to hook-up event listeners.

Overrides:
addNotify in class Panel
See Also:
removeNotify
 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all property change events.

Parameters:
listener - the listener to add
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener for all vetoable property change events.

Parameters:
listener - the listener to add
See Also:
removeVetoableChangeListener
 o getActionCommand
public java.lang.String getActionCommand()

Returns:
the command name of the action event fired by this button.
 o getDate
public java.lang.String getDate()
Returns the date that the calendar is set to.

Returns:
the current value of the calendar.
 o getSelectedColor
public java.awt.Color getSelectedColor()
Returns the color that highlights the selected date on the calendar.

Returns:
the current selected color.
 o minimumSize
public java.awt.Dimension minimumSize()
Returns the minimum dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the minimum size of this component.

Returns:
the minimum dimensions needed for the calender (250 x 200 pixels).
Overrides:
minimumSize in class Container
See Also:
preferredSize
 o paint
public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Container
See Also:
repaint, update
 o preferredSize
public java.awt.Dimension preferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component.

Returns:
the preferred dimensions for the calender (250 x 200 pixels).
Overrides:
preferredSize in class Container
See Also:
minimumSize
 o removeActionListener
public synchronized void removeActionListener(ActionListener l)
Removes the specified action listener so it no longer receives action events from this button.

Parameters:
l - the action listener
 o removeNotify
public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents. It has been overridden here to unhook event listeners.

Overrides:
removeNotify in class Container
See Also:
addNotify
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all property change events.

Parameters:
listener - the listener to remove
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a listener for all vetoable property change events.

Parameters:
listener - the listener to remove
See Also:
addVetoableChangeListener
 o setActionCommand
public void setActionCommand(String command) throws PropertyVetoException
Sets the command name of the action event fired by this button.

Parameters:
command - The name of the action event command fired by this button
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setDate
public void setDate(String date) throws PropertyVetoException
Sets the date selected on the calendar.

Parameters:
date - the date that the calendar is to be set to
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setLayout
public void setLayout(LayoutManager lm)
Takes no action. This is a standard Java AWT method which gets called to specify which layout manager should be used to layout the components in standard containers. Since layout managers CANNOT BE USED with this container the standard setLayout has been OVERRIDDEN for this container and does nothing.

Parameters:
lm - the layout manager to use to layout this container's components (IGNORED)
Overrides:
setLayout in class Container
See Also:
getLayout
 o setSelectedColor
public void setSelectedColor(Color c) throws PropertyVetoException
Sets the color used to highlight the selected date on the calendar.

Parameters:
c - the color that the selected color is to be set to
Throws: PropertyVetoException
if the specified property value is unacceptable
 o sourceActionEvent
public void sourceActionEvent()
Fire an action event to the listeners

 o update
public void update(Graphics g)
Handles redrawing of this component on the screen. This is a standard Java AWT method which gets called by the Java AWT (repaint()) to handle repainting this component on the screen. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner. Typically this method paints the background color to clear the component's drawing space, sets graphics context to be the foreground color, and then calls paint() to draw the component. It is overridden here to reduce flicker by eliminating the uneeded clearing of the background.

Parameters:
g - the graphics context
Overrides:
update in class Container
See Also:
repaint, paint

All Packages  Class Hierarchy  This Package  Previous  Next  Index