org.apache.myfaces.custom.schedule
Class ScheduleDetailedDayRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.custom.schedule.AbstractScheduleRenderer
          extended by org.apache.myfaces.custom.schedule.ScheduleDetailedDayRenderer
All Implemented Interfaces:
Serializable

public class ScheduleDetailedDayRenderer
extends AbstractScheduleRenderer
implements Serializable

Renderer for the day and workweek views of the Schedule component

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

Nested Class Summary
protected  class ScheduleDetailedDayRenderer.EntryWrapper
           
 
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
ScheduleDetailedDayRenderer()
           
 
Method Summary
protected  Date determineLastClickedDate(org.apache.myfaces.custom.schedule.HtmlSchedule schedule, String dateId, String yPos)
          In the detailed day renderer, we take the y coordinate of the mouse into account when determining the last clicked date.
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 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  boolean expandToFitEntries(javax.faces.component.UIComponent component)
           When the start- and endtime of an entry are the same, should the entry be rendered, fitting the entry box to the text?
protected  String getCellClass(org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleDay day, boolean even, int hour)
           
protected  int getDefaultRowHeight()
           
protected  int getRenderedEndHour(org.apache.myfaces.custom.schedule.HtmlSchedule schedule)
           
protected  int getRenderedStartHour(org.apache.myfaces.custom.schedule.HtmlSchedule schedule)
           
protected  int getRowHeight(org.apache.myfaces.custom.schedule.UIScheduleBase schedule)
           
protected  boolean isSelected(org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleDetailedDayRenderer.EntryWrapper entry)
           
protected  void maximizeEntries(ScheduleDetailedDayRenderer.EntryWrapper[] entries, int numberOfColumns)
           
protected  boolean renderZeroLengthEntries(javax.faces.component.UIComponent component)
           When the start- and endtime of an entry are the same, should the entry be rendered, fitting the entry box to the text?
protected  void scanEntries(ScheduleDetailedDayRenderer.EntryWrapper[] entries, int index)
           
protected  void writeBackgroundEnd(javax.faces.context.ResponseWriter writer)
           
protected  void writeBackgroundStart(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, javax.faces.context.ResponseWriter writer)
           
protected  void writeEntries(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleDay day, javax.faces.context.ResponseWriter writer)
           
protected  void writeForegroundEnd(javax.faces.context.ResponseWriter writer)
           
protected  void writeForegroundStart(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, javax.faces.context.ResponseWriter writer)
           
protected  void writeGutter(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, javax.faces.context.ResponseWriter writer, boolean useIntervalLabels)
           
 
Methods inherited from class org.apache.myfaces.custom.schedule.AbstractScheduleRenderer
decode, getCalendarInstance, getDateFormat, getDateFormat, getDateString, getEntryRenderer, getRendersChildren, getStyleClass
 
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

ScheduleDetailedDayRenderer

public ScheduleDetailedDayRenderer()
Method Detail

encodeBegin

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

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)

getCellClass

protected String getCellClass(org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                              ScheduleDay day,
                              boolean even,
                              int hour)

isSelected

protected boolean isSelected(org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                             ScheduleDetailedDayRenderer.EntryWrapper entry)

maximizeEntries

protected void maximizeEntries(ScheduleDetailedDayRenderer.EntryWrapper[] entries,
                               int numberOfColumns)

scanEntries

protected void scanEntries(ScheduleDetailedDayRenderer.EntryWrapper[] entries,
                           int index)

writeGutter

protected void writeGutter(javax.faces.context.FacesContext context,
                           org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                           javax.faces.context.ResponseWriter writer,
                           boolean useIntervalLabels)
                    throws IOException
Throws:
IOException

writeBackgroundStart

protected void writeBackgroundStart(javax.faces.context.FacesContext context,
                                    org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                                    javax.faces.context.ResponseWriter writer)
                             throws IOException
Throws:
IOException

writeBackgroundEnd

protected void writeBackgroundEnd(javax.faces.context.ResponseWriter writer)
                           throws IOException
Throws:
IOException

getRenderedStartHour

protected int getRenderedStartHour(org.apache.myfaces.custom.schedule.HtmlSchedule schedule)

getRenderedEndHour

protected int getRenderedEndHour(org.apache.myfaces.custom.schedule.HtmlSchedule schedule)

writeEntries

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

writeForegroundEnd

protected void writeForegroundEnd(javax.faces.context.ResponseWriter writer)
                           throws IOException
Throws:
IOException

writeForegroundStart

protected void writeForegroundStart(javax.faces.context.FacesContext context,
                                    org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                                    javax.faces.context.ResponseWriter writer)
                             throws IOException
Throws:
IOException

getDefaultRowHeight

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

determineLastClickedDate

protected Date determineLastClickedDate(org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                                        String dateId,
                                        String yPos)
In the detailed day renderer, we 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

renderZeroLengthEntries

protected boolean renderZeroLengthEntries(javax.faces.component.UIComponent component)

When the start- and endtime of an entry are the same, should the entry be rendered, fitting the entry box to the text?

Parameters:
component - the component
Returns:
whether or not zero length entries should be rendered

expandToFitEntries

protected boolean expandToFitEntries(javax.faces.component.UIComponent component)

When the start- and endtime of an entry are the same, should the entry be rendered, fitting the entry box to the text?

Parameters:
component - the component
Returns:
whether or not zero length entries should be rendered

getRowHeight

protected int getRowHeight(org.apache.myfaces.custom.schedule.UIScheduleBase schedule)
Specified by:
getRowHeight in class AbstractScheduleRenderer
Parameters:
schedule - The schedule
Returns:
The row height, in pixels


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