sddl.hierarchy
Class Shape

java.lang.Object
  extended by sddl.hierarchy.Shape
Direct Known Subclasses:
Arrow, Canvas, Circle, Ellipse, EqTriangle, Line, Path, Rectangle, Square, Text

public abstract class Shape
extends java.lang.Object

A Shape is something waiting to be drawn. It is the abstract representation of an object. Anything that can be drawn in SDDL must be a Shape.

Version:
1.00
Author:
Mathieu Bourgeois

Constructor Summary
Shape()
           
 
Method Summary
abstract  Shape copy()
           
abstract  void draw(AbstractPoint location, java.io.PrintWriter out)
          Standard SDDL draw function.
 boolean isVisible()
          Verifies if the Shape is going to be drawn or not
abstract  Path obtainPath()
          Gives a Path describing the Shape.
 void setVisible(boolean isVisible)
          Sets if the Shape is going to be drawn or not
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shape

public Shape()
Method Detail

draw

public abstract void draw(AbstractPoint location,
                          java.io.PrintWriter out)
Standard SDDL draw function. Every shape must implement this

Parameters:
location - The location of the Shape on the main drawing
out - The file to be written to

obtainPath

public abstract Path obtainPath()
Gives a Path describing the Shape. Every Shape must implement obtainPath, but it can be done with a stub (returning an InterpreterException is favored) if no Path is to be given. The Path should describe the exact outer boundary of the object if it is closed. If this function does not work, this Shape can not be clipped against another.

Returns:
A Path describing the outer boundary of the Shape

setVisible

public void setVisible(boolean isVisible)
Sets if the Shape is going to be drawn or not

Parameters:
isVisible - If the Shape will be drawn

isVisible

public boolean isVisible()
Verifies if the Shape is going to be drawn or not

Returns:
A boolean describing if the Shape is going to be drawn or not

copy

public abstract Shape copy()