se.umu.cs.SequenceDiagramEditor
Class Actor

java.lang.Object
  extended byse.umu.cs.SequenceDiagramEditor.Entity
      extended byse.umu.cs.SequenceDiagramEditor.ClassEntity
          extended byse.umu.cs.SequenceDiagramEditor.Actor
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class Actor
extends ClassEntity
implements java.awt.event.ActionListener

This class represents an actor in a sequence diagram.

Author:
Matilda Östling

Field Summary
private  Handle handle
          The handle for the actor, used to move the actor.
private  javax.swing.JMenuItem menuDelete
          The menuitem used if the user wants to delete the actor.
private  javax.swing.JMenuItem menuDestroySymbol
          The menuitem used if the user wants to add a destroy symbol.
private  javax.swing.JMenuItem menuRename
          The menuitem used if the user wants to rename the actor.
private  boolean move
          Set true when the actor can be moved.
 
Fields inherited from class se.umu.cs.SequenceDiagramEditor.ClassEntity
bClass, destroySymbol, hasCreationMessage, hasDestroySymbol, messageList
 
Fields inherited from class se.umu.cs.SequenceDiagramEditor.Entity
drawingArea, endPoint, lifeLine, name, selected, startPoint, string
 
Constructor Summary
Actor(DrawingArea d)
          The constructor of the class.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          This method is called when an ActionEvent takes place.
 void changeName()
          This method is called when the user wants to change the name of the actor.
 void draw(java.awt.Graphics g)
          This method is called to draw the actor.
 int getNextState()
          This method returns the next state for this class.
 void setEndPoint(java.awt.Point p)
          This method sets the endpoint for the actor.
 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 showMenu(java.awt.Point p)
          This method is called to show the menu of the object.
 
Methods inherited from class se.umu.cs.SequenceDiagramEditor.ClassEntity
addMessage, arrangeObjects, createDestroySymbol, delete, deleteMessage, getBClass, moveObject, moveObjects, moveObjectUp, moveVertical, setSelected
 
Methods inherited from class se.umu.cs.SequenceDiagramEditor.Entity
getEndPoint, getName, getStartPoint, getString, isClickedOn, modifyString, setName, setStartPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

menuRename

private javax.swing.JMenuItem menuRename
The menuitem used if the user wants to rename the actor.


menuDestroySymbol

private javax.swing.JMenuItem menuDestroySymbol
The menuitem used if the user wants to add a destroy symbol.


menuDelete

private javax.swing.JMenuItem menuDelete
The menuitem used if the user wants to delete the actor.


handle

private Handle handle
The handle for the actor, used to move the actor.


move

private boolean move
Set true when the actor can be moved.

Constructor Detail

Actor

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

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

draw

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

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

showMenu

public void showMenu(java.awt.Point p)
This method is called to show the menu of the object.

Specified by:
showMenu in class Entity
Parameters:
p - The menu will be shown at the given point.

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.

setEndPoint

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

Overrides:
setEndPoint in class Entity
Parameters:
p - The startPoint of the actor.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
This method is called when an ActionEvent takes place.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - The ActionEvent.

changeName

public void changeName()
This method is called when the user wants to change the name of the actor.


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.