com.dlsc.flexgantt.swing.timeline
Interface IDatelineRenderer<T extends IDatelineModel>

Type Parameters:
T - the type of the dateline model
All Known Implementing Classes:
AbstractDatelineRenderer, SimpleGranularityDatelineRenderer, TimeGranularityDatelineRenderer

public interface IDatelineRenderer<T extends IDatelineModel>

The renderer interface used by the dateline to renderer major and minor time spans. The dateline uses the grid returned by the dateline model to divide itself into cells in two rows. The cells in the upper row represent the major time spans, the cells in the lower row represent the minor time spans. The dateline renderer gets invoked for each of these cells. The component returned by the renderer fills the entire bounds of each cell and is free to render the time span in any way it desires. Renderers are looked up based on the type of the dateline model. The same renderer will be used for the entire dateline. This behaviour is different than the behaviour of the TreeTable, where different renderers can be used for different cells, depending on the object type of the value in that cell.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
Dateline.setDatelineRenderer(Class, IDatelineRenderer), IDatelineModel.getGrid(int, int, boolean)

Method Summary
 java.awt.Component getDatelineRendererComponent(Dateline dateline, T model, ITimeSpan timeSpan, boolean major, boolean focus)
          Returns the renderer component that will be used by the dateline to render a time span that can be located on the major or the minor part of the dateline.
 

Method Detail

getDatelineRendererComponent

java.awt.Component getDatelineRendererComponent(Dateline dateline,
                                                T model,
                                                ITimeSpan timeSpan,
                                                boolean major,
                                                boolean focus)
Returns the renderer component that will be used by the dateline to render a time span that can be located on the major or the minor part of the dateline. The renderer supports a focus attribute that tells the renderer whether the mouse cursor is currently on top of the time span. This visual feedback is important so that the user knows into which time span the dateline will zoom into when the left mouse button gets clicked.

Parameters:
dateline - the dateline component
model - the dateline model that returned / specified the given time span
timeSpan - the time span to render
major - a flag that signals whether the time span is located on the upper or the lower part of the dateline
focus - a flag indicating whether the time span has the focus
Returns:
a component used for the actual rendering of the time span
Since:
1.0