de.jaret.util.ui.timebars.swt
Class RenderDelegate

java.lang.Object
  extended by de.jaret.util.ui.timebars.swt.RenderDelegate

public class RenderDelegate
extends java.lang.Object

This class contains the actual methods used for rendering a time bar viewer. They have been factored out to support both printing (headless) and painting on the screen.

Version:
$Id: RenderDelegate.java 803 2008-12-28 19:30:23Z kliem $
Author:
Peter Kliem

Constructor Summary
RenderDelegate()
           
 
Method Summary
static void drawGap(TimeBarViewerDelegate delegate, TimeBarGapRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, TimeBarRow row, int xx, int y, de.jaret.util.date.Interval i1, de.jaret.util.date.Interval i2)
          Draw a gap beetween two intervals.
static void drawGrid(TimeBarViewerDelegate delegate, GridRenderer gridRenderer, boolean printing, org.eclipse.swt.graphics.GC gc)
          Render the grid (background).
static void drawHierarchy(TimeBarViewerDelegate delegate, HierarchyRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, int y, TimeBarRow row, boolean selected)
          Draw hierarchy element.
static void drawHierarchyVertical(TimeBarViewerDelegate delegate, HierarchyRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, int x, TimeBarRow row, boolean selected)
          Draw hierarchy element (vertical orientation).
static void drawIntervalHorizontal(TimeBarViewerDelegate delegate, TimeBarRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, int y, de.jaret.util.date.Interval interval, OverlapInfo oi, TimeBarRow row)
          Draws a single interval.
static void drawIntervalVertical(TimeBarViewerDelegate delegate, TimeBarRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, int x, de.jaret.util.date.Interval interval, OverlapInfo oi, TimeBarRow row)
          Draws a single interval (Vertical orientation).
static void drawMarker(TimeBarViewerDelegate delegate, TimeBarMarkerRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, TimeBarMarker marker)
          Draw a single marker.
static void drawMarkers(TimeBarViewerDelegate delegate, TimeBarMarkerRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc)
          Draws all markers for the diagram.
static void drawRowGaps(TimeBarViewerDelegate delegate, TimeBarGapRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, int x, int y, TimeBarRow row, boolean selected)
          Render the row gaps horizontal.
static void drawRowHeaderHorizontal(TimeBarViewerDelegate delegate, HeaderRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, int y, TimeBarRowHeader header, boolean selected, TimeBarRow row)
          Draw a row header (horizontal orientation).
static void drawRowHeaderVertical(TimeBarViewerDelegate delegate, HeaderRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc, int x, TimeBarRowHeader header, boolean selected, TimeBarRow row)
          Draw a row header (vertical orientation).
static void drawRowSimple(TimeBarViewerDelegate delegate, TimeBarPrinter tbPrinter, HeaderRenderer headerRenderer, HierarchyRenderer hierarchyRenderer, boolean printing, org.eclipse.swt.graphics.GC gc, TimeBarRow row, int y, boolean selected)
          Draw a timebar row (used by the timebar printer).
static void drawTitle(TimeBarViewerDelegate delegate, TitleRenderer titleRenderer, boolean printing, org.eclipse.swt.graphics.GC gc)
          Render the title area.
static void drawXAxis(TimeBarViewerDelegate delegate, TimeScaleRenderer renderer, boolean printing, org.eclipse.swt.graphics.GC gc)
          Draw the xaxis (timescale).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderDelegate

public RenderDelegate()
Method Detail

drawRowSimple

public static void drawRowSimple(TimeBarViewerDelegate delegate,
                                 TimeBarPrinter tbPrinter,
                                 HeaderRenderer headerRenderer,
                                 HierarchyRenderer hierarchyRenderer,
                                 boolean printing,
                                 org.eclipse.swt.graphics.GC gc,
                                 TimeBarRow row,
                                 int y,
                                 boolean selected)
Draw a timebar row (used by the timebar printer).

Parameters:
delegate - the delegate
tbPrinter - timebar printer
headerRenderer - header renderer
hierarchyRenderer - renderer for the hierarchy
printing - tru for printing
gc - GC to use
row - row to draw
y - begin y
selected - true if the row is selected

drawRowGaps

public static void drawRowGaps(TimeBarViewerDelegate delegate,
                               TimeBarGapRenderer renderer,
                               boolean printing,
                               org.eclipse.swt.graphics.GC gc,
                               int x,
                               int y,
                               TimeBarRow row,
                               boolean selected)
Render the row gaps horizontal.

Parameters:
delegate - the delegate
renderer - the gap renderer to use
printing - true for printing
gc - GC
x - begin x
y - begin y
row - row to draw the gaps for
selected - true if the row is selected

drawIntervalHorizontal

public static void drawIntervalHorizontal(TimeBarViewerDelegate delegate,
                                          TimeBarRenderer renderer,
                                          boolean printing,
                                          org.eclipse.swt.graphics.GC gc,
                                          int y,
                                          de.jaret.util.date.Interval interval,
                                          OverlapInfo oi,
                                          TimeBarRow row)
Draws a single interval.

Parameters:
delegate - delegate
renderer - renderer to use
printing - true if this rendering is for a printer
gc - GC to paint on
y - y coordinate of the row
interval - interval to be painted
oi - overlap information (may be null when drawing overlapped)
row - of the interval beeing rendered

drawIntervalVertical

public static void drawIntervalVertical(TimeBarViewerDelegate delegate,
                                        TimeBarRenderer renderer,
                                        boolean printing,
                                        org.eclipse.swt.graphics.GC gc,
                                        int x,
                                        de.jaret.util.date.Interval interval,
                                        OverlapInfo oi,
                                        TimeBarRow row)
Draws a single interval (Vertical orientation).

Parameters:
delegate - delegate
renderer - renderer to use
printing - true if this rendering is for a printer
gc - GC tio paint on
x - x coordinate of the row
interval - interval to be painted
oi - overlap information (may be null when drawing overlapped)
row - of the interval beeing rendered

drawRowHeaderHorizontal

public static void drawRowHeaderHorizontal(TimeBarViewerDelegate delegate,
                                           HeaderRenderer renderer,
                                           boolean printing,
                                           org.eclipse.swt.graphics.GC gc,
                                           int y,
                                           TimeBarRowHeader header,
                                           boolean selected,
                                           TimeBarRow row)
Draw a row header (horizontal orientation).

Parameters:
delegate - the delegate
renderer - renderer to use
printing - true for printing
gc - GC
y - begin y
header - header to draw
selected - true for selected
row - of the header beeing rendered

drawRowHeaderVertical

public static void drawRowHeaderVertical(TimeBarViewerDelegate delegate,
                                         HeaderRenderer renderer,
                                         boolean printing,
                                         org.eclipse.swt.graphics.GC gc,
                                         int x,
                                         TimeBarRowHeader header,
                                         boolean selected,
                                         TimeBarRow row)
Draw a row header (vertical orientation).

Parameters:
delegate - the delegate
renderer - renderer to use
printing - true for printing
gc - GC
x - begin x
header - header to draw
selected - true for selected
row - of the header beeing rendered

drawHierarchy

public static void drawHierarchy(TimeBarViewerDelegate delegate,
                                 HierarchyRenderer renderer,
                                 boolean printing,
                                 org.eclipse.swt.graphics.GC gc,
                                 int y,
                                 TimeBarRow row,
                                 boolean selected)
Draw hierarchy element.

Parameters:
delegate - the delegate
renderer - the renderer to use
printing - true for printing
gc - GC
y - begin y
row - the element is for
selected - true for selected

drawHierarchyVertical

public static void drawHierarchyVertical(TimeBarViewerDelegate delegate,
                                         HierarchyRenderer renderer,
                                         boolean printing,
                                         org.eclipse.swt.graphics.GC gc,
                                         int x,
                                         TimeBarRow row,
                                         boolean selected)
Draw hierarchy element (vertical orientation).

Parameters:
delegate - the delegate
renderer - the renderer to use
printing - true for printing
gc - GC
x - begin x
row - the element is for
selected - true for selected

drawXAxis

public static void drawXAxis(TimeBarViewerDelegate delegate,
                             TimeScaleRenderer renderer,
                             boolean printing,
                             org.eclipse.swt.graphics.GC gc)
Draw the xaxis (timescale).

Parameters:
delegate - the delegate
renderer - the renderer
printing - true for printing
gc - GC

drawGrid

public static void drawGrid(TimeBarViewerDelegate delegate,
                            GridRenderer gridRenderer,
                            boolean printing,
                            org.eclipse.swt.graphics.GC gc)
Render the grid (background).

Parameters:
delegate - delegate
gridRenderer - the renderer to use
printing - true for printing
gc - GC

drawTitle

public static void drawTitle(TimeBarViewerDelegate delegate,
                             TitleRenderer titleRenderer,
                             boolean printing,
                             org.eclipse.swt.graphics.GC gc)
Render the title area.

Parameters:
delegate - the delegate
titleRenderer - the renderer
printing - true for printing
gc - GC

drawMarkers

public static void drawMarkers(TimeBarViewerDelegate delegate,
                               TimeBarMarkerRenderer renderer,
                               boolean printing,
                               org.eclipse.swt.graphics.GC gc)
Draws all markers for the diagram. If a marker is not currently displayed it will not be painted.

Parameters:
delegate - the delegate
renderer - the renderer to use
printing - true for printing
gc - GC

drawMarker

public static void drawMarker(TimeBarViewerDelegate delegate,
                              TimeBarMarkerRenderer renderer,
                              boolean printing,
                              org.eclipse.swt.graphics.GC gc,
                              TimeBarMarker marker)
Draw a single marker.

Parameters:
delegate - the delegate
renderer - renderer to use
printing - true for printing
gc - GC
marker - the marker

drawGap

public static void drawGap(TimeBarViewerDelegate delegate,
                           TimeBarGapRenderer renderer,
                           boolean printing,
                           org.eclipse.swt.graphics.GC gc,
                           TimeBarRow row,
                           int xx,
                           int y,
                           de.jaret.util.date.Interval i1,
                           de.jaret.util.date.Interval i2)
Draw a gap beetween two intervals.

Parameters:
delegate - the delegate
renderer - the renderer to use
printing - true for printing
gc - GC
row - the row of both intervals
xx - begin x
y - begin y
i1 - first interval
i2 - second interval


Copyright © 2012. All Rights Reserved.