Class SequenceObject

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

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

This class represents an object in a sequence diagram.

Author:
Matilda Östling

Field Summary
private  java.lang.String bClassName
           
private  boolean color
           
private  Handle handle
           
private  int length
           
private  javax.swing.JMenuItem menuDelete
           
private  javax.swing.JMenuItem menuDestroySymbol
           
private  javax.swing.JMenuItem menuRename
           
private  boolean move
           
private static int nrOfObjects
           
 
Fields inherited from class ClassEntity
bClass, destroySymbol, hasCreationMessage, hasDestroySymbol, messageList
 
Fields inherited from class Entity
drawingArea, end, endPoint, lifeLine, name, selected, start, startPoint, string
 
Constructor Summary
SequenceObject(DrawingArea d)
          The constructor of the class.
SequenceObject(DrawingArea d, bluej.extensions.BClass b)
          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 for the object.
 void draw(java.awt.Graphics g)
          This method is called to draw the object.
 java.lang.String getBClassName()
           
 int getLength()
           
 int getNextState()
          This method returns the next state for this class.
 int getNrOfObjects()
           
 void setBClassName(java.lang.String s)
           
 void setColor(boolean b)
           
 void setEndPoint(java.awt.Point p)
          This method sets the endpoint for the object.
 void setLength(int l)
           
 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 ClassEntity
addMessage, arrangeObjects, createDestroySymbol, delete, deleteMessage, getBClass, moveObject, moveObjects, moveObjectUp, moveVertical, setSelected
 
Methods inherited from class 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

menuDestroySymbol

private javax.swing.JMenuItem menuDestroySymbol

menuDelete

private javax.swing.JMenuItem menuDelete

handle

private Handle handle

move

private boolean move

nrOfObjects

private static int nrOfObjects

bClassName

private java.lang.String bClassName

length

private int length

color

private boolean color
Constructor Detail

SequenceObject

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

Parameters:
d - The component where the object will be drawn.

SequenceObject

public SequenceObject(DrawingArea d,
                      bluej.extensions.BClass b)
The constructor of the class.

Parameters:
d - The component where the object will be drawn.
b - The BClass to which the object belongs to.
Method Detail

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.

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

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

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 for the object. It creates a popupwindow and asks the user for the new name.


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.

getNrOfObjects

public int getNrOfObjects()

setBClassName

public void setBClassName(java.lang.String s)

getBClassName

public java.lang.String getBClassName()

getLength

public int getLength()

setLength

public void setLength(int l)

setColor

public void setColor(boolean b)