net.sf.nachocalendar.tasks

Class TaskQuantityRenderer

Implemented Interfaces:
DayRenderer

public class TaskQuantityRenderer
extends JLabel
implements DayRenderer

Renderer customized to show dates with tasks assigned in yellow background. It also creates a tooltip with the quantity of tasks related to the Date
Author:
Ignacio Merani

Constructor Summary

TaskQuantityRenderer()
Creates a new instance of TaskRenderer.

Method Summary

Component
getDayRenderer(DayPanel daypanel, Date day, Object data, boolean selected, boolean working, boolean enabled)
Returns a component configured to render the Day.
Color
getTaskBg()
void
paint(Graphics g)
Draws the component.
void
setTaskBg(Color taskBg)

Constructor Details

TaskQuantityRenderer

public TaskQuantityRenderer()
Creates a new instance of TaskRenderer.

Method Details

getDayRenderer

public Component getDayRenderer(DayPanel daypanel,
                                Date day,
                                Object data,
                                boolean selected,
                                boolean working,
                                boolean enabled)
Returns a component configured to render the Day.
Parameters:
daypanel - Daypanel to be renderer
day - current day
data - current data
selected - true if it's selected
working - true if it's a working day
enabled - true if it's enabled
Returns:
component to be used

getTaskBg

public Color getTaskBg()
Returns:
Returns the taskBg.

paint

public void paint(Graphics g)
Draws the component.
Parameters:
g - Graphics Object

setTaskBg

public void setTaskBg(Color taskBg)
Parameters:
taskBg - The taskBg to set.