de.jaret.util.ui.timebars.swt.renderer
Interface TimeScaleRenderer

All Known Implementing Classes:
BoxTimeScaleRenderer, CombiningTimeScaleRenderer, DateStripRenderer, DefaultTimeScaleRenderer, OldDefaultTimeScaleRenderer

public interface TimeScaleRenderer

Interface for a renderer rending the timescale (x axis). The renderer can (should) support printing.

Version:
$Id: TimeScaleRenderer.java 1086 2011-07-30 20:28:05Z kliem $
Author:
Peter Kliem

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.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.
 boolean supportsOptimizedScrolling()
          Report whether this renderer can be used with optimized scrolling.
 

Method Detail

draw

void draw(org.eclipse.swt.graphics.GC gc,
          org.eclipse.swt.graphics.Rectangle drawingArea,
          TimeBarViewerDelegate delegate,
          boolean top,
          boolean printing)
Draw the Timescale.

Parameters:
gc - GraphicsContext to paint with.
drawingArea - Rectangel denoting the area to draw in. The gc is clipped to this area.
delegate - TimeBarViewerDelegate exposed for callbacks
top - if true the tmiescale is in position top, bottom otherwise
printing - flag to indicate printing.

getToolTipText

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.

Parameters:
tbv - TimeBarViewer
drawingArea - area in that the timescale has been painted
x - x coordinate
y - y coordinate
Returns:
tooltip text or null

getHeight

int getHeight()
Returns the prferred height for rendering.

Returns:
preferred height

supportsOptimizedScrolling

boolean supportsOptimizedScrolling()
Report whether this renderer can be used with optimized scrolling. This will usually be the case if all elements drawn are positioned by the date.

Returns:
true if optimzed drawing can be used.

dispose

void dispose()
Dispose resources.


createPrintRenderer

TimeScaleRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
Create a timescale renderer setup for printing.

Parameters:
printer - Printer device taht will be used.
Returns:
timescale renderer setup for printing.


Copyright © 2012. All Rights Reserved.