|
||||||||||
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.DefaultTimeScaleRenderer
public class DefaultTimeScaleRenderer
A default timescale renderer rendering a readable scale for ranges from years to milliseconds. A holiday enumerator is used to display special and holidays in the tooltip. Suports horizontal and vertical orientation.
Field Summary | |
---|---|
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 date iterators for the strips. |
protected de.jaret.util.date.iterator.DateIterator |
_lowerStrip
iterator for the minor ticks. |
protected java.util.List<de.jaret.util.date.JaretDate> |
_majorTicks
major ticks of the last rendering. |
protected de.jaret.util.date.iterator.DateIterator |
_midStrip
iterator for the middle main strip. |
protected java.util.List<de.jaret.util.date.JaretDate> |
_minorTicks
minor ticks of the last rendering. |
protected java.util.Map<de.jaret.util.date.iterator.DateIterator,de.jaret.util.date.iterator.DateIterator> |
_upperMap
map defining upper iterators for middle iterators. |
protected de.jaret.util.date.iterator.DateIterator |
_upperStrip
iterator for the upmost strip. |
protected static int |
ADDITIONALGAP
additional gap between end of label and next line (approx). |
protected static int |
GAP
gap between line and label. |
protected static int |
MAJORLENGTH
length of major ticks. |
protected static int |
MINORLENGTH
length of minor ticks. |
protected static int |
PREFERREDHEIGHT
preferred height. |
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 | |
---|---|
DefaultTimeScaleRenderer()
Default constructor. |
|
DefaultTimeScaleRenderer(org.eclipse.swt.printing.Printer printer)
Construct the renderer for a prinetr 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. |
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. |
protected java.lang.String |
getToolTipTextForDate(de.jaret.util.date.JaretDate date,
TickScaler.Range range)
Convert date to string for tooltip display. |
protected void |
initIterators()
Initialize all possible iterators (strips). |
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 diasplaying special days as tooltip. |
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 PREFERREDHEIGHT
protected static final int MINORLENGTH
protected static final int MAJORLENGTH
protected static final int ADDITIONALGAP
protected static final int GAP
protected static final int SETBONUS
protected java.util.List<de.jaret.util.date.JaretDate> _majorTicks
protected java.util.List<de.jaret.util.date.JaretDate> _minorTicks
protected java.util.List<de.jaret.util.date.iterator.DateIterator> _iterators
protected java.util.List<de.jaret.util.date.iterator.DateIterator.Format> _formats
protected de.jaret.util.date.iterator.DateIterator _midStrip
protected de.jaret.util.date.iterator.DateIterator _upperStrip
protected de.jaret.util.date.iterator.DateIterator _lowerStrip
protected java.util.Map<de.jaret.util.date.iterator.DateIterator,de.jaret.util.date.iterator.DateIterator> _upperMap
protected de.jaret.util.date.holidayenumerator.HolidayEnumerator _holidayEnumerator
Constructor Detail |
---|
public DefaultTimeScaleRenderer(org.eclipse.swt.printing.Printer printer)
printer
- printer devicepublic DefaultTimeScaleRenderer()
Method Detail |
---|
protected void initIterators()
public void setHolidayEnumerator(de.jaret.util.date.holidayenumerator.HolidayEnumerator he)
he
- holidayenumerator to usepublic void draw(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle drawingArea, TimeBarViewerDelegate delegate, boolean top, boolean printing)
draw
in interface TimeScaleRenderer
gc
- 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 TimeScaleRenderer
tbv
- TimeBarViewerdrawingArea
- area in that the timescale has been paintedx
- x coordinatey
- y coordinate
null
protected java.lang.String getToolTipTextForDate(de.jaret.util.date.JaretDate date, TickScaler.Range range)
date
- daterange
- last range
public int getHeight()
getHeight
in interface TimeScaleRenderer
public void dispose()
dispose
in interface TimeScaleRenderer
public TimeScaleRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
createPrintRenderer
in interface TimeScaleRenderer
printer
- Printer device taht will be used.
public java.util.List<de.jaret.util.date.JaretDate> getMajorTicks(TimeBarViewerDelegate delegate)
getMajorTicks
in interface ITickProvider
delegate
- the delegate the ticks are used with
public java.util.List<de.jaret.util.date.JaretDate> getMinorTicks(TimeBarViewerDelegate delegate)
getMinorTicks
in interface ITickProvider
delegate
- 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 |