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
-
initialHeight_
-
-
LINE_COLOR
-
-
minSeparation_
-
-
TEXT_COLOR
-
-
LineShape()
- Constructs a vertical timeline.
-
addEvent(Point, Color, Object)
-
Adds a new base at the END of the list of bases.
-
addEventScroll(Point, Color, Object, boolean)
-
-
beginOperation()
-
LineShape changes its canvas size when reset
-
drawEmpty(Graphics)
-
Called when drawing is necessary but there are no events.
-
drawShape(Graphics)
-
Draws the shape on the given graphics.
-
init(int, int, int, int, VisualizationController)
-
Real work of initialization.
-
onShape(Point, boolean)
-
For any point on the canvas, returns the corresponding point on the shape
LINE_COLOR
protected static Color LINE_COLOR
TEXT_COLOR
protected static Color TEXT_COLOR
minSeparation_
protected int minSeparation_
initialHeight_
protected int initialHeight_
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.
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.
beginOperation
public void beginOperation()
- LineShape changes its canvas size when reset
- Overrides:
- beginOperation in class GenericShape
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
addEventScroll
public void addEventScroll(Point locatorPosition,
Color baseColor,
Object clientData,
boolean scroll)
- Overrides:
- addEventScroll in class GenericShape
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
drawShape
public void drawShape(Graphics g)
- Draws the shape on the given graphics. Superclass draws
the bases.
- Overrides:
- drawShape in class GenericShape
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