org.acm.seguin.uml.line
Class Vertex

java.lang.Object
  extended by org.acm.seguin.uml.line.Vertex

public class Vertex
extends java.lang.Object

Vertex

Author:
Chris Seguin, Mike Atkinson

Constructor Summary
Vertex(java.awt.Point init)
          Constructor for the Vertex object
 
Method Summary
protected  void active(boolean way)
          Sets whether this is the active vertex
protected  java.awt.Point getPoint()
          Gets the scaled point
protected  int getX()
          Gets the X attribute of the Vertex object
protected  int getY()
          Gets the Y attribute of the Vertex object
 boolean hit(java.awt.Point p)
          Determines if it is hit by a point
 boolean isActive()
          Checks if this vertex is the active vertex
 boolean isSelected()
          Checks if the point is selected
 void move(java.awt.Point p)
          Moves the vertex to p
 void paint(java.awt.Graphics g)
          Paints the object
 void save(java.io.PrintWriter output)
          Save the vertex
 void scale(double value)
          Scales the vertex
protected  void select(boolean way)
          Selects the point
static void setNear(double value)
          Sets the Near attribute of the Vertex class
static void setVertexSize(int value)
          Sets the VertexSize attribute of the Vertex class
 void shift(int x, int y)
          Shifts the point by a certain amount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vertex

public Vertex(java.awt.Point init)
Constructor for the Vertex object

Parameters:
init - Description of Parameter
Method Detail

isSelected

public boolean isSelected()
Checks if the point is selected

Returns:
true if the point is selected

isActive

public boolean isActive()
Checks if this vertex is the active vertex

Returns:
true if it is

paint

public void paint(java.awt.Graphics g)
Paints the object

Parameters:
g - The graphics context

hit

public boolean hit(java.awt.Point p)
Determines if it is hit by a point

Parameters:
p - The point
Returns:
true if this point hits this vertex

move

public void move(java.awt.Point p)
Moves the vertex to p

Parameters:
p - the destination of the move

save

public void save(java.io.PrintWriter output)
Save the vertex

Parameters:
output - the output stream

shift

public void shift(int x,
                  int y)
Shifts the point by a certain amount

Parameters:
x - the amount in the x coordinate
y - the amount in the y coordinate

scale

public void scale(double value)
Scales the vertex

Parameters:
value - the scaling factor

getX

protected int getX()
Gets the X attribute of the Vertex object

Returns:
The X value

getY

protected int getY()
Gets the Y attribute of the Vertex object

Returns:
The Y value

getPoint

protected java.awt.Point getPoint()
Gets the scaled point

Returns:
the scaled point

select

protected void select(boolean way)
Selects the point

Parameters:
way - true if the point is selected

active

protected void active(boolean way)
Sets whether this is the active vertex

Parameters:
way - true if this vertex is active

setNear

public static void setNear(double value)
Sets the Near attribute of the Vertex class

Parameters:
value - The new Near value

setVertexSize

public static void setVertexSize(int value)
Sets the VertexSize attribute of the Vertex class

Parameters:
value - The new VertexSize value