All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.util.Calendar
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.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.
-
Calendar()
- Creates a default calendar with today's
date initialized.
-
Calendar(Date)
- Creates a calendar with the specified date initialized.
-
getDate()
- Returns the date that the calendar is set to.
-
getSelectedColor()
- Returns the color that highlights the selected date on the calendar.
-
handleEvent(Event)
- Processes events for this component.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
reshape(int, int, int, int)
- Moves and/or resizes this component.
-
setDate(String)
- Sets the date selected on the calendar.
-
setSelectedColor(Color)
- Sets the color used to highlight the selected date on the calendar.
-
update(Graphics)
- Handles redrawing of this component on the screen.
Calendar
public Calendar()
- Creates a default calendar with today's
date initialized.
Calendar
public Calendar(Date defaultdate)
- Creates a calendar with the specified date initialized.
- Parameters:
- defaultdate - the date to be shown initially
getDate
public String getDate()
- Returns the date that the calendar is set to.
- Returns:
- the current value of the calendar.
setDate
public void setDate(String date)
- Sets the date selected on the calendar.
- Parameters:
- date - the date that the calendar is to be set to
getSelectedColor
public Color getSelectedColor()
- Returns the color that highlights the selected date on the calendar.
- Returns:
- the current selected color.
setSelectedColor
public void setSelectedColor(Color c)
- 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
handleEvent
public boolean handleEvent(Event event)
- Processes events for this component.
This is a standard Java AWT method which gets called by the AWT
to handle this component's events. The default handler for
components dispatches to one of the following methods as needed:
action(), gotFocus(), lostFocus(), keyDown(), keyUp(), mouseEnter(),
mouseExit(), mouseMove(), mouseDrag(), mouseDown(), or mouseUp().
- Parameters:
- event - the event to handle
- Returns:
- true if the event was handled and no further action is needed,
false to pass the event to this component's parent
- Overrides:
- handleEvent in class Component
- See Also:
- action, gotFocus, lostFocus, keyDown, keyUp, mouseEnter, mouseExit, mouseMove, mouseDrag, mouseDown, mouseUp
reshape
public void reshape(int x,
int y,
int width,
int height)
- Moves and/or resizes this component.
This is a standard Java AWT method which gets called to move and/or
resize this component. Components that are in containers with layout
managers should not call this method, but rely on the layout manager
instead.
- Parameters:
- x - horizontal position in the parent's coordinate space
- y - vertical position in the parent's coordinate space
- width - the new width
- height - the new height
- Overrides:
- reshape in class Component
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 Component
- See Also:
- repaint, paint
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
preferredSize
public 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
minimumSize
public 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
All Packages Class Hierarchy This Package Previous Next Index