|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.ui.timebars.swt.renderer.RendererBase
de.jaret.util.ui.timebars.swt.renderer.BoxTimeScaleRenderer
public class BoxTimeScaleRenderer
Timescalerenderer rendering strips of boxes for different time intervals using DateIterator instances. A holiday enumerator can be used to display special and holidays in the tooltip. Supports horizontal and vertical operation (vertical might be imperformant since vertical text is used).
| Field Summary | |
|---|---|
protected java.util.List<java.lang.Boolean> |
_enable
enabled state of the corresponding strip. |
protected java.util.List<de.jaret.util.date.iterator.DateIterator.Format> |
_formats
format of the corresponding iterator label. |
protected de.jaret.util.date.holidayenumerator.HolidayEnumerator |
_holidayEnumerator
holiday enumerator for tooltips. |
protected java.util.List<de.jaret.util.date.iterator.DateIterator> |
_iterators
List of dateiterators for the strips. |
protected java.util.List<de.jaret.util.date.JaretDate> |
_majorTicks
major ticks of the last rendering. |
protected java.util.List<de.jaret.util.date.JaretDate> |
_minorTicks
minor ticks of the last rendering. |
protected int |
_numberOfStrips
actual number of strips to render. |
protected int |
_textHeight
local cache for textextent height. |
protected static int |
ADDITIONALGAP
additional gap between end of label and next line (approx). |
protected static int |
BOXHEIGHT
height of a box. |
protected static int |
GAP
gap between line and label. |
protected static int |
SETBONUS
Bonus rewarded when an Iterator is already enabled for a format. |
| Fields inherited from class de.jaret.util.ui.timebars.swt.renderer.RendererBase |
|---|
_printer, _scaleX, _scaleY |
| Constructor Summary | |
|---|---|
BoxTimeScaleRenderer()
Default constructor. |
|
BoxTimeScaleRenderer(org.eclipse.swt.printing.Printer printer)
Construct the renderer for a printer device. |
|
| Method Summary | |
|---|---|
TimeScaleRenderer |
createPrintRenderer(org.eclipse.swt.printing.Printer printer)
Create a timescale renderer setup for printing. |
void |
dispose()
Dispose resources. |
void |
draw(org.eclipse.swt.graphics.GC gc,
org.eclipse.swt.graphics.Rectangle drawingArea,
TimeBarViewerDelegate delegate,
boolean top,
boolean printing)
Draw the Timescale. |
int |
getHeight()
Returns the prferred height for rendering. |
java.util.List<de.jaret.util.date.JaretDate> |
getMajorTicks(TimeBarViewerDelegate delegate)
Provide a list of dates used as major ticks. |
java.util.List<de.jaret.util.date.JaretDate> |
getMinorTicks(TimeBarViewerDelegate delegate)
Provide a list of dates used as minor ticks. |
int |
getNumberOfStrips()
retrieve the number of strips to render. |
java.lang.String |
getToolTipText(TimeBarViewer tbv,
org.eclipse.swt.graphics.Rectangle drawingArea,
int x,
int y)
Retrieve the tooltip text for a given locatin in the timescale. |
void |
setCorrectDST(boolean correctDST)
Setup the iterators to do a DST correction. |
void |
setHolidayEnumerator(de.jaret.util.date.holidayenumerator.HolidayEnumerator he)
Set a holidayenumerator for displaying special days as tooltip. |
void |
setNumberOfStrips(int numberOfStrips)
Set the maximum number of strips to render. |
boolean |
supportsOptimizedScrolling()
Report whether this renderer can be used with optimized scrolling. |
| Methods inherited from class de.jaret.util.ui.timebars.swt.renderer.RendererBase |
|---|
drawFocus, getDefaultLineWidth, getPrinter, getScaleX, getScaleY, scaleX, scaleY |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int BOXHEIGHT
protected static final int ADDITIONALGAP
protected static final int GAP
protected static final int SETBONUS
protected int _textHeight
protected int _numberOfStrips
protected de.jaret.util.date.holidayenumerator.HolidayEnumerator _holidayEnumerator
protected java.util.List<de.jaret.util.date.iterator.DateIterator> _iterators
protected java.util.List<de.jaret.util.date.iterator.DateIterator.Format> _formats
protected java.util.List<java.lang.Boolean> _enable
protected java.util.List<de.jaret.util.date.JaretDate> _majorTicks
protected java.util.List<de.jaret.util.date.JaretDate> _minorTicks
| Constructor Detail |
|---|
public BoxTimeScaleRenderer(org.eclipse.swt.printing.Printer printer)
printer - printer devicepublic BoxTimeScaleRenderer()
| Method Detail |
|---|
public void setHolidayEnumerator(de.jaret.util.date.holidayenumerator.HolidayEnumerator he)
he - holidayenumerator to use
public void draw(org.eclipse.swt.graphics.GC gc,
org.eclipse.swt.graphics.Rectangle drawingArea,
TimeBarViewerDelegate delegate,
boolean top,
boolean printing)
draw in interface TimeScaleRenderergc - GraphicsContext to paint with.drawingArea - Rectangel denoting the area to draw in. The gc is clipped to this area.delegate - TimeBarViewerDelegate exposed for callbackstop - if true the tmiescale is in position top, bottom otherwiseprinting - flag to indicate printing.
public java.lang.String getToolTipText(TimeBarViewer tbv,
org.eclipse.swt.graphics.Rectangle drawingArea,
int x,
int y)
getToolTipText in interface TimeScaleRenderertbv - TimeBarViewerdrawingArea - area in that the timescale has been paintedx - x coordinatey - y coordinate
nullpublic int getHeight()
getHeight in interface TimeScaleRendererpublic void dispose()
dispose in interface TimeScaleRendererpublic TimeScaleRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
createPrintRenderer in interface TimeScaleRendererprinter - Printer device taht will be used.
public int getNumberOfStrips()
public void setNumberOfStrips(int numberOfStrips)
numberOfStrips - maximum number of stripspublic java.util.List<de.jaret.util.date.JaretDate> getMajorTicks(TimeBarViewerDelegate delegate)
getMajorTicks in interface ITickProviderdelegate - the delegate the ticks are used with
public java.util.List<de.jaret.util.date.JaretDate> getMinorTicks(TimeBarViewerDelegate delegate)
getMinorTicks in interface ITickProviderdelegate - the delegate the ticks are used with
public void setCorrectDST(boolean correctDST)
correctDST - true if a correction should be done.public boolean supportsOptimizedScrolling()
supportsOptimizedScrolling in interface TimeScaleRenderer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||