org.apache.myfaces.custom.schedule
Class AbstractCompactScheduleRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.custom.schedule.AbstractScheduleRenderer
          extended by org.apache.myfaces.custom.schedule.AbstractCompactScheduleRenderer
All Implemented Interfaces:
Serializable, EventListener, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener

public abstract class AbstractCompactScheduleRenderer
extends AbstractScheduleRenderer
implements Serializable

Abstract superclass for the week and month view renderers.

Since:
1.1.7
Version:
$Revision: 398348 $
Author:
Jurgen Lust (latest modification by $Author: jlust $), Bruno Aranda (adaptation of Jurgen's code to myfaces)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.myfaces.custom.schedule.AbstractScheduleRenderer
comparator, DEFAULT_THEME, EVOLUTION_THEME, LAST_CLICKED_DATE, LAST_CLICKED_Y, OUTLOOK_THEME
 
Constructor Summary
AbstractCompactScheduleRenderer()
           
 
Method Summary
protected  Date determineLastClickedDate(org.apache.myfaces.custom.schedule.HtmlSchedule schedule, String dateId, String yPos)
          In the compact renderer, we don't take the y coordinate of the mouse into account when determining the last clicked date.
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected abstract  int getDefaultRowHeight()
           
protected  boolean isSelected(org.apache.myfaces.custom.schedule.HtmlSchedule schedule, org.apache.myfaces.custom.schedule.model.ScheduleEntry entry)
           
protected  void writeDayCell(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, org.apache.myfaces.custom.schedule.model.ScheduleDay day, float cellWidth, int dayOfWeek, int dayOfMonth, boolean isWeekend, boolean isCurrentMonth, int rowspan)
           Draw one day in the schedule
protected  void writeEntries(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, org.apache.myfaces.custom.schedule.model.ScheduleDay day, javax.faces.context.ResponseWriter writer)
           Draw the schedule entries in the specified day cell
 
Methods inherited from class org.apache.myfaces.custom.schedule.AbstractScheduleRenderer
decode, encodeBegin, getCalendarInstance, getDateFormat, getDateFormat, getDateString, getEntryRenderer, getRendersChildren, getRowHeight, getStyleClass, processEvent
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCompactScheduleRenderer

public AbstractCompactScheduleRenderer()
Method Detail

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws IOException
Overrides:
encodeChildren in class javax.faces.render.Renderer
Throws:
IOException
See Also:
Renderer.encodeChildren(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component)
               throws IOException
Overrides:
encodeEnd in class javax.faces.render.Renderer
Throws:
IOException
See Also:
Renderer.encodeEnd(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

getDefaultRowHeight

protected abstract int getDefaultRowHeight()
Specified by:
getDefaultRowHeight in class AbstractScheduleRenderer
Returns:
The default height, in pixels, of one row in the schedule grid

writeDayCell

protected void writeDayCell(javax.faces.context.FacesContext context,
                            javax.faces.context.ResponseWriter writer,
                            org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                            org.apache.myfaces.custom.schedule.model.ScheduleDay day,
                            float cellWidth,
                            int dayOfWeek,
                            int dayOfMonth,
                            boolean isWeekend,
                            boolean isCurrentMonth,
                            int rowspan)
                     throws IOException

Draw one day in the schedule

Parameters:
context - the FacesContext
writer - the ResponseWriter
schedule - the schedule
day - the day that should be drawn
cellWidth - the width of the cell
dayOfWeek - the day of the week
dayOfMonth - the day of the month
isWeekend - is it a weekend day?
isCurrentMonth - is the day in the currently selected month?
rowspan - the rowspan for the table cell
Throws:
IOException - when the cell could not be drawn

writeEntries

protected void writeEntries(javax.faces.context.FacesContext context,
                            org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                            org.apache.myfaces.custom.schedule.model.ScheduleDay day,
                            javax.faces.context.ResponseWriter writer)
                     throws IOException

Draw the schedule entries in the specified day cell

Parameters:
context - the FacesContext
schedule - the schedule
day - the day
writer - the ResponseWriter
Throws:
IOException - when the entries could not be drawn

isSelected

protected boolean isSelected(org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                             org.apache.myfaces.custom.schedule.model.ScheduleEntry entry)

determineLastClickedDate

protected Date determineLastClickedDate(org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                                        String dateId,
                                        String yPos)
In the compact renderer, we don't take the y coordinate of the mouse into account when determining the last clicked date.

Specified by:
determineLastClickedDate in class AbstractScheduleRenderer
Parameters:
schedule - the schedule component
dateId - the string identifying the date
yPos - the y coordinate of the mouse
Returns:
the clicked date


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.