Class ActivationBox

java.lang.Object
  extended byEntity
      extended byActivationBox
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

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

This class represents an activationbox.

Author:
Matilda Östling

Field Summary
private  javax.swing.JMenuItem menuItem1
           
protected  boolean moveEnd
           
protected  boolean moveStart
           
protected  ClassEntity ownerEntity
           
 
Fields inherited from class Entity
drawingArea, end, endPoint, lifeLine, name, selected, start, startPoint, string
 
Constructor Summary
ActivationBox(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 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 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

protected ClassEntity ownerEntity

moveStart

protected boolean moveStart

moveEnd

protected boolean moveEnd

menuItem1

private javax.swing.JMenuItem menuItem1
Constructor Detail

ActivationBox

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

Parameters:
e - This ClassEntity will be the owner of the activationbox, to which it will belong.
d - This is the component where the activationbox 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.

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.

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 for the object.

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 for the object.

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.

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.

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.