psgraphics
Class DrawableLine

java.lang.Object
  extended bypsgraphics.Figure
      extended bypsgraphics.DrawableLine

public class DrawableLine
extends Figure

Represents a line that can be drawn to the screen. The parameter from describe the starting coordinates and the parameter to describe the ending coordinates.


Constructor Summary
DrawableLine(java.awt.Point from, java.awt.Point to)
          Creates a new DrawableLine and initializes the coordinates which describe it.
 
Method Summary
 void draw(java.awt.Graphics g)
          Draws the line on the drawing area of the postscript interpreter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawableLine

public DrawableLine(java.awt.Point from,
                    java.awt.Point to)
Creates a new DrawableLine and initializes the coordinates which describe it.

Precondition: The right parameters must be given.
Postcondition : A new DrawableLine will be created.

Parameters:
from - Starting coordinates.
to - Ending coordinates.
Method Detail

draw

public void draw(java.awt.Graphics g)
Draws the line on the drawing area of the postscript interpreter.

Precondition : Must be called by the paint method of the component it draws on and given the same Graphics parameter.
Postcondition : The figure will be drawn on the drawing area.

Specified by:
draw in class Figure
Parameters:
g - The same Graphics parameter passed to the paint method of the drawing area.