se.umu.cs.SequenceDiagramEditor
Class LifeLine

java.lang.Object
  extended byse.umu.cs.SequenceDiagramEditor.Entity
      extended byse.umu.cs.SequenceDiagramEditor.LifeLine

public class LifeLine
extends Entity

This class represents a lifeline.

Author:
Matilda Östling

Field Summary
private  Handle handle
          The handle for the lifeline, used to change the length of the lifeline.
private  boolean move
          Tells if the lifeline could be changed or not.
private  ClassEntity ownerEntity
          The ClassEntity that the lifeline belongs to.
 
Fields inherited from class se.umu.cs.SequenceDiagramEditor.Entity
drawingArea, endPoint, lifeLine, name, selected, startPoint, string
 
Constructor Summary
LifeLine(ClassEntity e, DrawingArea d)
          The constructor of the class.
 
Method Summary
 void draw(java.awt.Graphics g)
          This method is called to draw the object.
 int getNextState()
          This method returns the next state for this class.
 ClassEntity getOwnerEntity()
          This method returns the ClassEntity that the lifeline belongs to.
 void setEndPoint(java.awt.Point p)
          This method sets the endpoint for the object.
 void setNextState(java.awt.Point p)
          This method is called to update the next state of the class based upon what the user has choosen.
 void setSelected(boolean b)
          This method sets the object selected or not selected.
 void setStartPoint(java.awt.Point p)
          This method sets the startpoint for the object.
 void showMenu(java.awt.Point p)
          This method shows the menu of the lifeline.
 
Methods inherited from class se.umu.cs.SequenceDiagramEditor.Entity
getEndPoint, getName, getStartPoint, getString, isClickedOn, modifyString, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ownerEntity

private ClassEntity ownerEntity
The ClassEntity that the lifeline belongs to.


handle

private Handle handle
The handle for the lifeline, used to change the length of the lifeline.


move

private boolean move
Tells if the lifeline could be changed or not.

Constructor Detail

LifeLine

public LifeLine(ClassEntity e,
                DrawingArea d)
The constructor of the class.

Parameters:
e - This ClassEntity will be the owner of the lifeline, to which it will belong.
d - This is the component where the lifeline will be drawn.
Method Detail

getNextState

public int getNextState()
This method returns the next state for this class.

Specified by:
getNextState in class Entity
Returns:
The next state for this class.

setStartPoint

public void setStartPoint(java.awt.Point p)
This method sets the startpoint for the object.

Overrides:
setStartPoint in class Entity
Parameters:
p - The startpoint.

setEndPoint

public void setEndPoint(java.awt.Point p)
This method sets the endpoint for the object.

Overrides:
setEndPoint in class Entity
Parameters:
p - The endpoint.

draw

public void draw(java.awt.Graphics g)
This method is called to draw the object.

Specified by:
draw in class Entity
Parameters:
g - Used for the drawing.

setNextState

public void setNextState(java.awt.Point p)
This method is called to update the next state of the class based upon what the user has choosen.

Specified by:
setNextState in class Entity
Parameters:
p - The point of the mouse.

setSelected

public void setSelected(boolean b)
This method sets the object selected or not selected. If it is selected it also sets the current state for the DrawingArea object to Currentstate.CHANGE.

Overrides:
setSelected in class Entity
Parameters:
b - True if the object is selected, otherwise false.

getOwnerEntity

public ClassEntity getOwnerEntity()
This method returns the ClassEntity that the lifeline belongs to.

Returns:
The ClassEntity

showMenu

public void showMenu(java.awt.Point p)
This method shows the menu of the lifeline. But it is empty since a lifeline does not have a menu.

Specified by:
showMenu in class Entity
Parameters:
p - The point where the menu should be shown