se.umu.cs.SequenceDiagramEditor
Class Entity

java.lang.Object
  extended byse.umu.cs.SequenceDiagramEditor.Entity
Direct Known Subclasses:
ClassEntity, DestroySymbol, LifeLine, Message

public abstract class Entity
extends java.lang.Object

This class represents a entity on the drawingarea.

Author:
Matilda Östling

Field Summary
protected  DrawingArea drawingArea
          An object of the drawing area.
protected  java.awt.Point endPoint
          The endpoint of the entity.
protected  LifeLine lifeLine
          The lifeline belonging to this entity.
protected  java.lang.String name
          The name of the entity (e.g actor, object, message etc).
protected  boolean selected
          Tells if the entity is selected or not.
protected  java.awt.Point startPoint
          The startpoint of the entity.
protected  java.lang.String string
          The string of the entity.
 
Constructor Summary
Entity(DrawingArea d)
          The constructor of the class.
 
Method Summary
abstract  void draw(java.awt.Graphics g)
          This abstract method draws the entity.
 java.awt.Point getEndPoint()
          This method returns the endpoint of the entity.
 java.lang.String getName()
          This method returns the name of the entity.
abstract  int getNextState()
          This abstract method returns the next state for the entity.
 java.awt.Point getStartPoint()
          This method returns the startpoint of the entity.
 java.lang.String getString()
          This method returns the string of the entity.
 boolean isClickedOn(java.awt.Point p)
          This method is called to decide wether the object is clicked on or not.
 void modifyString(java.lang.String s)
          This method is used to modify the string of the entity.
 void setEndPoint(java.awt.Point p)
          This method is used to set the endpoint of the entity.
 void setName(java.lang.String n)
          This method is used to set the name of the entity.
abstract  void setNextState(java.awt.Point p)
          This abstract method sets the next state of the entity.
 void setSelected(boolean s)
          This method is used to set the entity selected, if it has been clicked on.
 void setStartPoint(java.awt.Point p)
          This method is used to set the startpoint of the entity.
abstract  void showMenu(java.awt.Point p)
          This abstract method shows the menu of the entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selected

protected boolean selected
Tells if the entity is selected or not.


startPoint

protected java.awt.Point startPoint
The startpoint of the entity.


endPoint

protected java.awt.Point endPoint
The endpoint of the entity.


string

protected java.lang.String string
The string of the entity.


name

protected java.lang.String name
The name of the entity (e.g actor, object, message etc).


lifeLine

protected LifeLine lifeLine
The lifeline belonging to this entity.


drawingArea

protected DrawingArea drawingArea
An object of the drawing area.

Constructor Detail

Entity

public Entity(DrawingArea d)
The constructor of the class.

Parameters:
d - The component where the entity will be drawn.
Method Detail

isClickedOn

public boolean isClickedOn(java.awt.Point p)
This method is called to decide wether the object is clicked on or not.

Parameters:
p - The point where the user has clicked.
Returns:
True if the object is clicked on, otherwise false.

getString

public java.lang.String getString()
This method returns the string of the entity.

Returns:
The string

modifyString

public void modifyString(java.lang.String s)
This method is used to modify the string of the entity.

Parameters:
s - The new string

setStartPoint

public void setStartPoint(java.awt.Point p)
This method is used to set the startpoint of the entity.

Parameters:
p - The startpoint

getStartPoint

public java.awt.Point getStartPoint()
This method returns the startpoint of the entity.

Returns:
The startpoint

setEndPoint

public void setEndPoint(java.awt.Point p)
This method is used to set the endpoint of the entity.

Parameters:
p - The new endpoint

getEndPoint

public java.awt.Point getEndPoint()
This method returns the endpoint of the entity.

Returns:
The endpoint

setSelected

public void setSelected(boolean s)
This method is used to set the entity selected, if it has been clicked on.

Parameters:
s - True if selected, otherwise false

setName

public void setName(java.lang.String n)
This method is used to set the name of the entity.

Parameters:
n - The name of the entity

getName

public java.lang.String getName()
This method returns the name of the entity.

Returns:
The name

getNextState

public abstract int getNextState()
This abstract method returns the next state for the entity.

Returns:
The next state

draw

public abstract void draw(java.awt.Graphics g)
This abstract method draws the entity.

Parameters:
g - The graphics

showMenu

public abstract void showMenu(java.awt.Point p)
This abstract method shows the menu of the entity.

Parameters:
p - The point where the menu should be shown

setNextState

public abstract void setNextState(java.awt.Point p)
This abstract method sets the next state of the entity.

Parameters:
p - The point