org.eclipse.contribution.visualiser.views
Class BarDrawing

java.lang.Object
  extended byorg.eclipse.contribution.visualiser.views.BarDrawing

public class BarDrawing
extends java.lang.Object

When given a canvas and various data BarDrawing displays the data on the canvas using draw2d. Designed for general purpose visualisation.


Field Summary
static Control canvas
           
 org.eclipse.swt.graphics.Rectangle viewsize
           
 
Method Summary
 org.eclipse.draw2d.Button createButton(java.lang.String n, int width)
          Create a button and return it
 void draw(java.util.List whatToDraw, Canvas canvas, boolean absolute_proportions)
          Draw is the main method.
static BarDrawing getBarDrawing()
          Get the single instance of this class
 void setDemarcation(boolean set, Canvas canvas)
          Set demarcation to be on (true) or off (false) when in group view.
 boolean zoomIn(Canvas canvas)
          Increases magnification by 0.5 (up to max_zoom) and redraws.
 boolean zoomOut(Canvas canvas)
          Decreases magnification by 0.5 (down to 1) and redraws.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewsize

public org.eclipse.swt.graphics.Rectangle viewsize

canvas

public static Control canvas
Method Detail

getBarDrawing

public static BarDrawing getBarDrawing()
Get the single instance of this class

Returns:

draw

public void draw(java.util.List whatToDraw,
                 Canvas canvas,
                 boolean absolute_proportions)
Draw is the main method. It is passed a canvas and some data and it calls subsidiary methods to display the data graphically on the canvas.


zoomIn

public boolean zoomIn(Canvas canvas)
Increases magnification by 0.5 (up to max_zoom) and redraws. Returns true if further zoom in is possible.


zoomOut

public boolean zoomOut(Canvas canvas)
Decreases magnification by 0.5 (down to 1) and redraws. Returns true if further zoom out is possible.


setDemarcation

public void setDemarcation(boolean set,
                           Canvas canvas)
Set demarcation to be on (true) or off (false) when in group view.

Parameters:
set - - demarcation on or off

createButton

public org.eclipse.draw2d.Button createButton(java.lang.String n,
                                              int width)
Create a button and return it

Parameters:
n -
width -
Returns: