All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jdsltools.visualization.LineShape

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----jdsltools.visualization.GenericShape
                           |
                           +----jdsltools.visualization.LineShape

public class LineShape
extends GenericShape
Timeline that displays events on a horizontal line. Also a java.awt.Canvas.

Version:
Fri Jan 3 16:26:21 1997
Author:
Lubomir Bourdev, Mark Handy modified Ryan Shaun Baker

Variable Index

 o initialHeight_
 o LINE_COLOR
 o minSeparation_
 o TEXT_COLOR

Constructor Index

 o LineShape()
Constructs a vertical timeline.

Method Index

 o addEvent(Point, Color, Object)
Adds a new base at the END of the list of bases.
 o addEventScroll(Point, Color, Object, boolean)
 o beginOperation()
LineShape changes its canvas size when reset
 o drawEmpty(Graphics)
Called when drawing is necessary but there are no events.

 o drawShape(Graphics)
Draws the shape on the given graphics.
 o init(int, int, int, int, VisualizationController)
Real work of initialization.

 o onShape(Point, boolean)
For any point on the canvas, returns the corresponding point on the shape

Variables

 o LINE_COLOR
 protected static Color LINE_COLOR
 o TEXT_COLOR
 protected static Color TEXT_COLOR
 o minSeparation_
 protected int minSeparation_
 o initialHeight_
 protected int initialHeight_

Constructors

 o LineShape
 public LineShape()
Constructs a vertical timeline. Constructor has no parameters, in order to support instantiation with java.lang.Class.newInstance(). A call to init(.) should immediately follow construction.

Methods

 o init
 public void init(int width,
                  int height,
                  int margin,
                  int minSeparation,
                  VisualizationController client)
Real work of initialization.

Parameters:
width - Width of Canvas initially
height - Height of Canvas initially
margin - Gap between edge of shape and edge of Canvas
minSeparation - Minimum number of pixels between centers of nodes.
 o beginOperation
 public void beginOperation()
LineShape changes its canvas size when reset

Overrides:
beginOperation in class GenericShape
 o addEvent
 public void addEvent(Point locatorPosition,
                      Color baseColor,
                      Object clientData)
Adds a new base at the END of the list of bases. Changes the shape and the coordinates of the other bases if necessary

Parameters:
p - the coordinates of the locator (in the visualizer canvas) that corresponds to the new base
Overrides:
addEvent in class GenericShape
 o addEventScroll
 public void addEventScroll(Point locatorPosition,
                            Color baseColor,
                            Object clientData,
                            boolean scroll)
Overrides:
addEventScroll in class GenericShape
 o onShape
 public Point onShape(Point p,
                      boolean constrain)
For any point on the canvas, returns the corresponding point on the shape

Parameters:
p - A point
constrain - Whether the returned point should be constrained to be on the part of the shape between the first base and the last, as opposed to whether it should be somewhere on the mathematical curve
Returns:
point on the shape corresponding to p
Overrides:
onShape in class GenericShape
 o drawShape
 public void drawShape(Graphics g)
Draws the shape on the given graphics. Superclass draws the bases.

Overrides:
drawShape in class GenericShape
 o drawEmpty
 public void drawEmpty(Graphics g)
Called when drawing is necessary but there are no events.

Overrides:
drawEmpty in class GenericShape

All Packages  Class Hierarchy  This Package  Previous  Next  Index