de.jaret.util.ui.timebars.swt.renderer
Class CombiningTimeScaleRenderer

java.lang.Object
  extended by de.jaret.util.ui.timebars.swt.renderer.CombiningTimeScaleRenderer
All Implemented Interfaces:
TimeScaleRenderer

public class CombiningTimeScaleRenderer
extends java.lang.Object
implements TimeScaleRenderer

A TimeScaleRenderer that combines two other TimeScaleRenderers.

Author:
kliem

Field Summary
protected  TimeScaleRenderer _innerRenderer
           
protected  TimeScaleRenderer _outerRenderer
           
 
Constructor Summary
CombiningTimeScaleRenderer(TimeScaleRenderer outerRenderer, TimeScaleRenderer innerRenderer)
           
 
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.
protected  de.jaret.util.misc.Pair<org.eclipse.swt.graphics.Rectangle,org.eclipse.swt.graphics.Rectangle> getDrawingareas(org.eclipse.swt.graphics.Rectangle drawingArea, TimeBarViewerDelegate delegate, boolean top)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_outerRenderer

protected TimeScaleRenderer _outerRenderer

_innerRenderer

protected TimeScaleRenderer _innerRenderer
Constructor Detail

CombiningTimeScaleRenderer

public CombiningTimeScaleRenderer(TimeScaleRenderer outerRenderer,
                                  TimeScaleRenderer innerRenderer)
Method Detail

draw

public void draw(org.eclipse.swt.graphics.GC gc,
                 org.eclipse.swt.graphics.Rectangle drawingArea,
                 TimeBarViewerDelegate delegate,
                 boolean top,
                 boolean printing)
Description copied from interface: TimeScaleRenderer
Draw the Timescale.

Specified by:
draw in interface TimeScaleRenderer
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

public java.lang.String getToolTipText(TimeBarViewer tbv,
                                       org.eclipse.swt.graphics.Rectangle drawingArea,
                                       int x,
                                       int y)
Description copied from interface: TimeScaleRenderer
Retrieve the tooltip text for a given locatin in the timescale.

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

getDrawingareas

protected de.jaret.util.misc.Pair<org.eclipse.swt.graphics.Rectangle,org.eclipse.swt.graphics.Rectangle> getDrawingareas(org.eclipse.swt.graphics.Rectangle drawingArea,
                                                                                                                         TimeBarViewerDelegate delegate,
                                                                                                                         boolean top)

getHeight

public int getHeight()
Description copied from interface: TimeScaleRenderer
Returns the prferred height for rendering.

Specified by:
getHeight in interface TimeScaleRenderer
Returns:
preferred height

dispose

public void dispose()
Description copied from interface: TimeScaleRenderer
Dispose resources.

Specified by:
dispose in interface TimeScaleRenderer

createPrintRenderer

public TimeScaleRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
Description copied from interface: TimeScaleRenderer
Create a timescale renderer setup for printing.

Specified by:
createPrintRenderer in interface TimeScaleRenderer
Parameters:
printer - Printer device taht will be used.
Returns:
timescale renderer setup for printing.

supportsOptimizedScrolling

public 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.

Specified by:
supportsOptimizedScrolling in interface TimeScaleRenderer
Returns:
true if optimzed drawing can be used.


Copyright © 2012. All Rights Reserved.