com.cc.framework.ui.painter.def.scheduler
Class DefSchedulerViewPainter

java.lang.Object
  extended bycom.cc.framework.ui.painter.ControlPortionPainter
      extended bycom.cc.framework.ui.painter.def.scheduler.DefSchedulerViewPainter
Direct Known Subclasses:
DefDayViewPainter, DefMonthViewPainter, DefWeekViewPainter, DefYearViewPainter

public abstract class DefSchedulerViewPainter
extends ControlPortionPainter

Scheduler View painter. This Painter creates the View Part of the Scheduling Calendar Control

Version:
$Revision: 1.26 $
Author:
Harald Schulz

Nested Class Summary
protected static class DefSchedulerViewPainter.CompositeElement
          Composite HTML element
 
Field Summary
protected static int DATEFORMAT_DATETIME
          Date format: yyyy.MM.dd 'at' h:mm a
protected static int DATEFORMAT_DAY
          Date format: d.
protected static int DATEFORMAT_DETAIL
          Date format: variable
protected static int DATEFORMAT_HOUR
          Date format: variable
protected static int DATEFORMAT_MONTH_OF_YEAR
          Date format: MMMMM yyyy
protected static int DATEFORMAT_TIME
          Date format: h:mm a
protected static int DATEFORMAT_WEEK
          Date format: 'Week' w 'in' yyyy
protected static int DATEFORMAT_WEEKDAY
          Date format: EEE, d MMM yyyy
protected static int DATEFORMAT_WEEKDAY_SHORT
          Date format: EEE, d MMM
private  java.util.Map formatterCache
          This is a cache for DateFormat objects
protected static int LABELFORMAT_LONG
          Long Label Format
protected static int LABELFORMAT_SHORT
          Short Label Format
private  java.util.Collection popups
          Popup Window List
protected static int STATE_APPOINTMENTS
          This flag is set when the day has appointments assigned
protected static int STATE_DAY_IN_MONTH
          Flag for a day that belongs to the selected month
protected static int STATE_FIRST_DAY
          Flag for the first visible Day of the month
protected static int STATE_FIRST_MONTH
          Flag for the first visible month
protected static int STATE_HIDDEN
          This flag is set when the day should be hidden
protected static int STATE_LAST_MONTH
          Flag for the last visible month
protected static int STATE_LEFTMOST_MONTH
          Flag for the leftmost month
protected static int STATE_RIGHTMOST_MONTH
          Flag for the rightmost month
protected static int STATE_TODAY
          Flag for the day that is the current day
private  java.util.Calendar today
          The "today" date
 
Fields inherited from class com.cc.framework.ui.painter.ControlPortionPainter
 
Constructor Summary
DefSchedulerViewPainter()
          Creates a new ViewPainter
 
Method Summary
protected  void addPopup(PopupElement popup)
          Adds a popup Window to the popup Window List for this control
protected  PopupElement addPopupWindow(java.util.Calendar date, Appointment[] appointments, int shown, org.apache.ecs.ConcreteElement popupAnchor)
          This method creates an appointment popup window witch is then added to the internal popup window list of the control.
protected  PopupElement addPopupWindow(java.lang.String title, java.util.Calendar date, Appointment[] appointments, org.apache.ecs.ConcreteElement popupAnchor)
          This method creates an appointment popup window witch is then added to the internal popup window list of the control.
protected  org.apache.ecs.html.IMG createClockImage(java.util.Calendar date)
          Creates a image with a clock symbol for the given time
protected  java.text.DateFormat createDateFormatter(int formatterId, java.util.Locale locale)
          Creates a formatter object for the given format id
protected  org.apache.ecs.ConcreteElement createNavigationButton(java.util.Calendar cal, SchedulerView view, boolean up)
          Creates the Previous Button
protected  org.apache.ecs.ConcreteElement doCreateAppointment(java.util.Calendar date, Appointment appointment, int labelFormat)
          Creates the HTML element for an simple appointment
protected  org.apache.ecs.ConcreteElement doCreateAppointmentList(java.util.Calendar date, Appointment[] appointments, int labelFormat)
          Creates a appointment list.
protected abstract  org.apache.ecs.ConcreteElement doCreateBody()
          This method creates the Body of the Scheduling Calendar Control
protected  org.apache.ecs.ConcreteElement doCreateHeader()
          Creates a navigation header element
protected  org.apache.ecs.ConcreteElement doCreateMoreButton(java.util.Calendar date, Appointment[] appointments, int shown)
          Creates the "more..."
abstract  org.apache.ecs.ConcreteElement doCreateNavigationButton(boolean up)
          Creates the Roll-Button
 org.apache.ecs.ConcreteElement doCreateView()
          This method creates the View Part of the Scheduling Calendar Control
protected  java.lang.String getAppointmentLabel(java.util.Calendar date, Appointment appointment, int labelFormat)
          Creates the Appointment Label
protected  java.lang.String getAppointmentTimeStr(java.util.Calendar date, Appointment appointment)
          Creates a time string for the given appointment
protected  java.lang.String getAppointmentTooltip(java.util.Calendar date, Appointment appointment, int labelFormat)
          Creates a tooltip for the given appointment
protected  SchedulerControl getCtrl()
          Liefert das Kontrollelement
protected  java.text.DateFormat getDateFormat(int formatterId)
          Retrieves the formatter for the given format id
protected  java.lang.String getDayClass(int state)
          Returns the HTML class for a given days state
protected  int getDayOfWeekMask()
          this method calculates a mask that contains all the visible days.
protected  int getDayState(CalendarIterator iter, boolean first, int inherit)
          Retrieves the state for the given Day
 java.lang.String getDetail()
          Retrieves the Detail Text for the Scheduler Control.
protected  int getFirstDayOfWeek()
          Retrieves the index of the first day of the week
protected  java.util.Iterator getPopups()
           
protected  ImageModel getPriorityImage(AppointmentPriority priority)
          Retrieves the Image for the given Appointment Priority
protected  boolean hasPopups()
           
protected  boolean markAsToday(java.util.Calendar date)
          Checks if the given Date should be marked as today
 void setControlPainter(ControlPainter ctrlPainter)
          Sets the ControlPainter
protected  boolean showDay(int dayOfWeek)
          this method checks if a given day should be displayed.
protected  boolean showFrame()
          Checks if the frame should be painted
 
Methods inherited from class com.cc.framework.ui.painter.ControlPortionPainter
attr, attr, attr, createActionPainter, createActionPainter, createImage, createImage, createImage, createSpacer, getColor, getControlPainter, getElementClass, getFrameworkString, getFrameworkString, getImage, getImage, getImageSrc, getImageSrc, getLocale, getPageContext, getPainterContext, getPrincipal, getSafeLocale, html, html, html, isRunAtClient, localize, removeHtml, removeHtml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATEFORMAT_DETAIL

protected static final int DATEFORMAT_DETAIL
Date format: variable

See Also:
Constant Field Values

DATEFORMAT_DAY

protected static final int DATEFORMAT_DAY
Date format: d. MMM

See Also:
Constant Field Values

DATEFORMAT_WEEKDAY

protected static final int DATEFORMAT_WEEKDAY
Date format: EEE, d MMM yyyy

See Also:
Constant Field Values

DATEFORMAT_WEEKDAY_SHORT

protected static final int DATEFORMAT_WEEKDAY_SHORT
Date format: EEE, d MMM

See Also:
Constant Field Values

DATEFORMAT_WEEK

protected static final int DATEFORMAT_WEEK
Date format: 'Week' w 'in' yyyy

See Also:
Constant Field Values

DATEFORMAT_MONTH_OF_YEAR

protected static final int DATEFORMAT_MONTH_OF_YEAR
Date format: MMMMM yyyy

See Also:
Constant Field Values

DATEFORMAT_TIME

protected static final int DATEFORMAT_TIME
Date format: h:mm a

See Also:
Constant Field Values

DATEFORMAT_DATETIME

protected static final int DATEFORMAT_DATETIME
Date format: yyyy.MM.dd 'at' h:mm a

See Also:
Constant Field Values

DATEFORMAT_HOUR

protected static final int DATEFORMAT_HOUR
Date format: variable

See Also:
Constant Field Values

STATE_FIRST_DAY

protected static final int STATE_FIRST_DAY
Flag for the first visible Day of the month

See Also:
Constant Field Values

STATE_DAY_IN_MONTH

protected static final int STATE_DAY_IN_MONTH
Flag for a day that belongs to the selected month

See Also:
Constant Field Values

STATE_TODAY

protected static final int STATE_TODAY
Flag for the day that is the current day

See Also:
Constant Field Values

STATE_HIDDEN

protected static final int STATE_HIDDEN
This flag is set when the day should be hidden

See Also:
Constant Field Values

STATE_APPOINTMENTS

protected static final int STATE_APPOINTMENTS
This flag is set when the day has appointments assigned

See Also:
Constant Field Values

STATE_FIRST_MONTH

protected static final int STATE_FIRST_MONTH
Flag for the first visible month

See Also:
Constant Field Values

STATE_LAST_MONTH

protected static final int STATE_LAST_MONTH
Flag for the last visible month

See Also:
Constant Field Values

STATE_LEFTMOST_MONTH

protected static final int STATE_LEFTMOST_MONTH
Flag for the leftmost month

See Also:
Constant Field Values

STATE_RIGHTMOST_MONTH

protected static final int STATE_RIGHTMOST_MONTH
Flag for the rightmost month

See Also:
Constant Field Values

LABELFORMAT_SHORT

protected static final int LABELFORMAT_SHORT
Short Label Format

See Also:
Constant Field Values

LABELFORMAT_LONG

protected static final int LABELFORMAT_LONG
Long Label Format

See Also:
Constant Field Values

today

private java.util.Calendar today
The "today" date


formatterCache

private java.util.Map formatterCache
This is a cache for DateFormat objects


popups

private java.util.Collection popups
Popup Window List

Constructor Detail

DefSchedulerViewPainter

public DefSchedulerViewPainter()
Creates a new ViewPainter

Method Detail

setControlPainter

public void setControlPainter(ControlPainter ctrlPainter)
Description copied from class: ControlPortionPainter
Sets the ControlPainter

Overrides:
setControlPainter in class ControlPortionPainter
Parameters:
ctrlPainter - The Control Painter
See Also:
ControlPortionPainter.setControlPainter(com.cc.framework.ui.painter.ControlPainter)

getCtrl

protected SchedulerControl getCtrl()
Liefert das Kontrollelement

Returns:
Kontrollelement

getFirstDayOfWeek

protected final int getFirstDayOfWeek()
Retrieves the index of the first day of the week

Returns:
index of the first day of the week

getDetail

public java.lang.String getDetail()
Retrieves the Detail Text for the Scheduler Control. The detail text shows the current date

Returns:
Detail Text

showFrame

protected boolean showFrame()
Checks if the frame should be painted

Returns:
true if the frame should be painted

markAsToday

protected boolean markAsToday(java.util.Calendar date)
Checks if the given Date should be marked as today

Parameters:
date - The date to check
Returns:
true if the day should be marked as today

getDayOfWeekMask

protected int getDayOfWeekMask()
this method calculates a mask that contains all the visible days.

Returns:
Day mask

showDay

protected boolean showDay(int dayOfWeek)
this method checks if a given day should be displayed. This depends on the WeekEndDay settings of the design model.

Parameters:
dayOfWeek - the day
Returns:
true if the day should be shown

getDateFormat

protected java.text.DateFormat getDateFormat(int formatterId)
Retrieves the formatter for the given format id

Parameters:
formatterId - the id of the formatter (DATEFORMAT_xxxx constant)
Returns:
formatter object

createDateFormatter

protected java.text.DateFormat createDateFormatter(int formatterId,
                                                   java.util.Locale locale)
Creates a formatter object for the given format id

Parameters:
formatterId - the id of the formatter (DATEFORMAT_xxxx constant)
locale - the locale
Returns:
formatter object

getPriorityImage

protected ImageModel getPriorityImage(AppointmentPriority priority)
Retrieves the Image for the given Appointment Priority

Parameters:
priority - Priority
Returns:
Image

getDayState

protected int getDayState(CalendarIterator iter,
                          boolean first,
                          int inherit)
Retrieves the state for the given Day

Parameters:
iter - iterator
first - indicates if this is the first visible day of the month
inherit - the state that this day should inherit
Returns:
State

getDayClass

protected java.lang.String getDayClass(int state)
Returns the HTML class for a given days state

Parameters:
state - days state
Returns:
HTML class

addPopupWindow

protected PopupElement addPopupWindow(java.util.Calendar date,
                                      Appointment[] appointments,
                                      int shown,
                                      org.apache.ecs.ConcreteElement popupAnchor)
This method creates an appointment popup window witch is then added to the internal popup window list of the control.

Parameters:
date - The date
appointments - The list of all available appointments for the day
shown - the number of shown appointments
popupAnchor - The anchor element for the popup window
Returns:
Button element

addPopupWindow

protected PopupElement addPopupWindow(java.lang.String title,
                                      java.util.Calendar date,
                                      Appointment[] appointments,
                                      org.apache.ecs.ConcreteElement popupAnchor)
This method creates an appointment popup window witch is then added to the internal popup window list of the control.

Parameters:
title - the popup windows title
date - the date
appointments - appointments list
popupAnchor - the anchor element for the popup window
Returns:
Popup element

doCreateAppointmentList

protected org.apache.ecs.ConcreteElement doCreateAppointmentList(java.util.Calendar date,
                                                                 Appointment[] appointments,
                                                                 int labelFormat)
Creates a appointment list. If the maximum number of visible appointments gets exceeded a "more..." button will be shown.

Parameters:
date - the day for which to create the appointment list
appointments - the appointments for that day
labelFormat - the Label format (LABELFORMAT_xxx) be generated
Returns:
HTML Elements

createClockImage

protected org.apache.ecs.html.IMG createClockImage(java.util.Calendar date)
Creates a image with a clock symbol for the given time

Parameters:
date - The current date and time
Returns:
Image

getAppointmentLabel

protected java.lang.String getAppointmentLabel(java.util.Calendar date,
                                               Appointment appointment,
                                               int labelFormat)
Creates the Appointment Label

Parameters:
date - The concrete day date
appointment - The appointment
labelFormat - the Label format (LABELFORMAT_xxx) be generated
Returns:
The Label Text

getAppointmentTooltip

protected java.lang.String getAppointmentTooltip(java.util.Calendar date,
                                                 Appointment appointment,
                                                 int labelFormat)
Creates a tooltip for the given appointment

Parameters:
date - The concrete day date
appointment - The appointment
labelFormat - the Label format (LABELFORMAT_xxx) be generated
Returns:
Tooltip text

getAppointmentTimeStr

protected java.lang.String getAppointmentTimeStr(java.util.Calendar date,
                                                 Appointment appointment)
Creates a time string for the given appointment

Parameters:
date - The concrete day date
appointment - The appointment
Returns:
Time String

doCreateAppointment

protected org.apache.ecs.ConcreteElement doCreateAppointment(java.util.Calendar date,
                                                             Appointment appointment,
                                                             int labelFormat)
Creates the HTML element for an simple appointment

Parameters:
date - The date
appointment - The appointment
labelFormat - the Label format (LABELFORMAT_xxx) be generated
Returns:
HTML Elements

doCreateHeader

protected org.apache.ecs.ConcreteElement doCreateHeader()
Creates a navigation header element

Returns:
Header element for navigation or null

doCreateMoreButton

protected org.apache.ecs.ConcreteElement doCreateMoreButton(java.util.Calendar date,
                                                            Appointment[] appointments,
                                                            int shown)
Creates the "more..." Button

Parameters:
date - The date
appointments - The list of all available appointments for the day
shown - the number of shown appointments
Returns:
Button element

createNavigationButton

protected org.apache.ecs.ConcreteElement createNavigationButton(java.util.Calendar cal,
                                                                SchedulerView view,
                                                                boolean up)
Creates the Previous Button

Parameters:
cal - The Date to change to
view - The View
up - Indicates if this a up or down button
Returns:
ConcreteElement

doCreateNavigationButton

public abstract org.apache.ecs.ConcreteElement doCreateNavigationButton(boolean up)
Creates the Roll-Button

Parameters:
up - true if the button rolls up
Returns:
ConcreteElement

doCreateBody

protected abstract org.apache.ecs.ConcreteElement doCreateBody()
This method creates the Body of the Scheduling Calendar Control

Returns:
HTML Element

doCreateView

public final org.apache.ecs.ConcreteElement doCreateView()
This method creates the View Part of the Scheduling Calendar Control

Returns:
View Element

addPopup

protected void addPopup(PopupElement popup)
Adds a popup Window to the popup Window List for this control

Parameters:
popup - The Popup window to add

hasPopups

protected boolean hasPopups()
Returns:
returns true if the control has any popup windows

getPopups

protected java.util.Iterator getPopups()
Returns:
Returns a Iterator for PopupElement Objects


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.