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

java.lang.Object
  extended by de.jaret.util.ui.timebars.swt.renderer.RendererBase
      extended by de.jaret.util.ui.timebars.swt.renderer.DefaultHeaderRenderer
All Implemented Interfaces:
HeaderRenderer

public class DefaultHeaderRenderer
extends RendererBase
implements HeaderRenderer

Simple default header renderer.

Version:
$Id: DefaultHeaderRenderer.java 781 2008-09-20 20:10:18Z kliem $
Author:
Peter Kliem

Field Summary
 
Fields inherited from class de.jaret.util.ui.timebars.swt.renderer.RendererBase
_printer, _scaleX, _scaleY
 
Constructor Summary
DefaultHeaderRenderer()
          Constructor for screen use.
DefaultHeaderRenderer(org.eclipse.swt.printing.Printer printer)
          Constructor for printing use.
 
Method Summary
 boolean contains(org.eclipse.swt.graphics.Rectangle drawingArea, int x, int y)
          Check whether a position in the header should be active for selecting.
 HeaderRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
          Create a similar renderer for printing.
 void dispose()
          Dispose the renderer.
 void draw(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle drawingArea, TimeBarViewerDelegate delegate, TimeBarRowHeader header, boolean selected, boolean printing)
          Draw the header.
 java.lang.String getToolTipText(TimeBarRow row, org.eclipse.swt.graphics.Rectangle drawingArea, int x, int y)
          Retrieve the tooltip for a position inside the header.
 
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
 

Constructor Detail

DefaultHeaderRenderer

public DefaultHeaderRenderer(org.eclipse.swt.printing.Printer printer)
Constructor for printing use.

Parameters:
printer - printing device

DefaultHeaderRenderer

public DefaultHeaderRenderer()
Constructor for screen use.

Method Detail

draw

public void draw(org.eclipse.swt.graphics.GC gc,
                 org.eclipse.swt.graphics.Rectangle drawingArea,
                 TimeBarViewerDelegate delegate,
                 TimeBarRowHeader header,
                 boolean selected,
                 boolean printing)
Draw the header.

Specified by:
draw in interface HeaderRenderer
Parameters:
gc - GC to use (clipped to drawing area)
drawingArea - Rectangle to paint within
delegate - TimeBarViewerDelegate for retrieving some support
header - the header to paint
selected - true if the row is selected
printing - flag indicating the current drawing is done for a printer

getToolTipText

public java.lang.String getToolTipText(TimeBarRow row,
                                       org.eclipse.swt.graphics.Rectangle drawingArea,
                                       int x,
                                       int y)
Retrieve the tooltip for a position inside the header.

Specified by:
getToolTipText in interface HeaderRenderer
Parameters:
row - the header is for
drawingArea - area in which the header has been drawn
x - x of the position in question
y - of the position in question
Returns:
the tooltip for the position or null

contains

public boolean contains(org.eclipse.swt.graphics.Rectangle drawingArea,
                        int x,
                        int y)
Check whether a position in the header should be active for selecting.

Specified by:
contains in interface HeaderRenderer
Parameters:
drawingArea - area in which the header has been drawn
x - x of the position in question
y - of the position in question
Returns:
true if this position hits an active part leeding to selection of the row.

dispose

public void dispose()
Dispose the renderer. Should free up any resources locked.

Specified by:
dispose in interface HeaderRenderer

createPrintRenderer

public HeaderRenderer createPrintRenderer(org.eclipse.swt.printing.Printer printer)
Create a similar renderer for printing. The creatin should copy settings made to the producing renderer.

Specified by:
createPrintRenderer in interface HeaderRenderer
Parameters:
printer - Printer device
Returns:
a configured renderer for printing.


Copyright © 2012. All Rights Reserved.