sddl.hierarchy
Class Drawing

java.lang.Object
  extended by sddl.hierarchy.Drawing

public class Drawing
extends java.lang.Object

Class representing a positioned Shape (or its concrete form). You can extract specific reference points from a Drawing

Version:
1.00
Author:
Mathieu Bourgeois

Constructor Summary
Drawing(Shape s)
          Constructor for a Drawing.
Drawing(Shape s, AbstractPoint location)
          Constructor for a Drawing.
 
Method Summary
 int addDefinedPoint(AbstractPoint point)
          Add a new reference point
 void addDependency(Drawing dependency)
          Add a dependency to a drawing.
 boolean canBeDrawn()
          Determine if a drawing can be drawn
 AbstractPoint clip(Drawing other)
          Returns the intersection point between two Drawing
 void draw(AbstractPoint location, java.io.PrintWriter out)
          Draws the current drawing and defined all of its reference points
 java.util.LinkedList<Drawing> getDependencies()
          Get all dependencies.
 Drawing getDependency(int i)
          Get a dependency to a drawing.
 java.lang.String getName()
          Returns the name of the drawing
 int getNumberOfDependencies()
          Get the number of dependencies.
 Shape getShape()
          Returns the Shape associated with the Drawing
 Drawing getSubDrawing(java.lang.String name)
          Returns a subdrawing in the current drawing
 void hasBeenDrawn()
          Sets the drawing as being drawn.
 boolean isDrawn()
          Determine if the drawing has been drawn.
 Path obtainPath()
          Returns the Path from the Shape associated with the Drawing
 java.lang.String returnString()
          Returns a String defining the name of the drawing
 void setDrawingName(java.lang.String name)
          Sets a drawing name
 void setPosition(AbstractPoint position)
          Sets the position of the drawing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Drawing

public Drawing(Shape s)
Constructor for a Drawing. This constructor does not specify the location point


Drawing

public Drawing(Shape s,
               AbstractPoint location)
Constructor for a Drawing. This constructor specifies the location point

Method Detail

setPosition

public void setPosition(AbstractPoint position)
Sets the position of the drawing

Parameters:
position - The position of the drawing¸

setDrawingName

public void setDrawingName(java.lang.String name)
Sets a drawing name

Parameters:
name - Name of the Drawing

getName

public java.lang.String getName()
Returns the name of the drawing

Returns:
The name of the drawing

getSubDrawing

public Drawing getSubDrawing(java.lang.String name)
Returns a subdrawing in the current drawing

Parameters:
name - The name of the subdrawing
Returns:
The subdrawing with the current name

returnString

public java.lang.String returnString()
Returns a String defining the name of the drawing

Returns:
A String defining the name of the drawing

addDefinedPoint

public int addDefinedPoint(AbstractPoint point)
Add a new reference point

Parameters:
point - The point which has been defined
Returns:
The index of the current point

addDependency

public void addDependency(Drawing dependency)
Add a dependency to a drawing. Not in use.


getDependency

public Drawing getDependency(int i)
Get a dependency to a drawing. Not in use.


getDependencies

public java.util.LinkedList<Drawing> getDependencies()
Get all dependencies. Not in use.


getNumberOfDependencies

public int getNumberOfDependencies()
Get the number of dependencies. Not in use.


hasBeenDrawn

public void hasBeenDrawn()
Sets the drawing as being drawn.


isDrawn

public boolean isDrawn()
Determine if the drawing has been drawn.

Returns:
If the drawing has been drawn.

canBeDrawn

public boolean canBeDrawn()
Determine if a drawing can be drawn

Returns:
If a drawing can be drawn

getShape

public Shape getShape()
Returns the Shape associated with the Drawing

Returns:
The Shape associated with the Drawing

draw

public void draw(AbstractPoint location,
                 java.io.PrintWriter out)
Draws the current drawing and defined all of its reference points

Parameters:
location - The location of the drawing from the main drawing
out - File to write to

obtainPath

public Path obtainPath()
Returns the Path from the Shape associated with the Drawing

Returns:
The Path from the Shape associated with the Drawing

clip

public AbstractPoint clip(Drawing other)
Returns the intersection point between two Drawing

Parameters:
other - The other Drawing to be clipped
Returns:
The intersection point