se.umu.cs.SequenceDiagramEditor
Class DestroySymbol

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

public class DestroySymbol
extends Entity
implements java.awt.event.ActionListener

This class represents a destroysymbol.

Author:
Matilda Östling

Field Summary
private  Handle handle
          The handle of the destroy symbol, used to move it.
private  javax.swing.JMenuItem menuDelete
          The menuitem used when the user wants to delete the destroy symbol.
private  boolean move
          Tells if the destroy symbol could be moved or not.
private  ClassEntity ownerEntity
          The ClassEntity the the destroy symbol belongs to.
 
Fields inherited from class se.umu.cs.SequenceDiagramEditor.Entity
drawingArea, endPoint, lifeLine, name, selected, startPoint, string
 
Constructor Summary
DestroySymbol(ClassEntity e, 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 draw(java.awt.Graphics g)
          This method is called to draw the object.
 int getNextState()
          This method returns the next state for this class.
 void setEndPoint(java.awt.Point p)
          This method sets the endpoint for the object.
 void setHandle(Handle h)
          This method is called to set the handle of the destroy symbol.
 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 is called to show the menu of the object.
 
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 the the destroy symbol belongs to.


menuDelete

private javax.swing.JMenuItem menuDelete
The menuitem used when the user wants to delete the destroy symbol.


handle

private Handle handle
The handle of the destroy symbol, used to move it.


move

private boolean move
Tells if the destroy symbol could be moved or not.

Constructor Detail

DestroySymbol

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

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

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.

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.

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.

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.

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.

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.

setHandle

public void setHandle(Handle h)
This method is called to set the handle of the destroy symbol.

Parameters:
h - The new handle