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

All Known Implementing Classes:
DefaultHierarchyRenderer

public interface HierarchyRenderer

This interface describes a renderer used to render the hierarchy column.

Version:
$Id: HierarchyRenderer.java 800 2008-12-27 22:27:33Z kliem $
Author:
Peter Kliem

Method Summary
 HierarchyRenderer 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, TimeBarRow row, boolean selected, boolean expanded, boolean leaf, int level, int depth, boolean printing)
          Drwa one hierarchy element.
 int getPreferredWidth()
          Return the preferred width for the hierachy display.
 java.lang.String getToolTipText(TimeBarNode node, org.eclipse.swt.graphics.Rectangle drawingArea, int x, int y)
          Retrieve the tooltip for a position inside the header.
 boolean isInHierarchySelectionArea(TimeBarViewer viewer, TimeBarNode node, org.eclipse.swt.graphics.Rectangle drawingArea, int xx, int yy)
          Check whether a position should trigger a row selection.
 boolean isInToggleArea(TimeBarViewerInterface tbv, TimeBarNode node, org.eclipse.swt.graphics.Rectangle drawingArea, int xx, int yy)
          Check whether a position in the header should be active for folding/expanding.
 

Method Detail

draw

void draw(org.eclipse.swt.graphics.GC gc,
          org.eclipse.swt.graphics.Rectangle drawingArea,
          TimeBarViewerDelegate delegate,
          TimeBarRow row,
          boolean selected,
          boolean expanded,
          boolean leaf,
          int level,
          int depth,
          boolean printing)
Drwa one hierarchy element.

Parameters:
gc - GC to draw with
drawingArea - rectangle to draw within
delegate - TimeBarViewerDelegate for supporting information
row - the row (node) for which the hierarchy should be painted
selected - wehether the row is selscted or not
expanded - expanded status of the row
leaf - if true the row is a leaf
level - level in the tree of the current element
depth - depth of the tree. If the depth is not known a value of -1 will indicate this fact.
printing - falg indicate the current paint operation is for a printer

getToolTipText

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

Parameters:
node - TimeBarNode that the hierarchy element has been painted 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

isInToggleArea

boolean isInToggleArea(TimeBarViewerInterface tbv,
                       TimeBarNode node,
                       org.eclipse.swt.graphics.Rectangle drawingArea,
                       int xx,
                       int yy)
Check whether a position in the header should be active for folding/expanding.

Parameters:
tbv - TimeBarViewer
node - node
drawingArea - area in which the header has been drawn
xx - x of the position in question
yy - y of the position in question
Returns:
true if this position hits an active part leeding to a fold/unfold operation.

isInHierarchySelectionArea

boolean isInHierarchySelectionArea(TimeBarViewer viewer,
                                   TimeBarNode node,
                                   org.eclipse.swt.graphics.Rectangle drawingArea,
                                   int xx,
                                   int yy)
Check whether a position should trigger a row selection.

Parameters:
viewer - the asking viewer
node - node
drawingArea - drawingarea
xx - x coordinate
yy - y coordinate
Returns:
true if the position should trigger the selection

getPreferredWidth

int getPreferredWidth()
Return the preferred width for the hierachy display.

Returns:
preferred with or -1 for "don't care"

dispose

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


createPrintRenderer

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

Parameters:
printer - Printer device
Returns:
a configured renderer for printing.


Copyright © 2012. All Rights Reserved.