org.argouml.uml.diagram.sequence.ui
Class FigSeqObject

java.lang.Object
  |
  +--FigNode
        |
        +--org.argouml.uml.diagram.ui.FigNodeModelElement
              |
              +--org.argouml.uml.diagram.sequence.ui.FigSeqObject
All Implemented Interfaces:
ArgoEventListener, ArgoNotationEventListener, DelayedVChangeListener, java.util.EventListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, NotationContext, java.beans.PropertyChangeListener, java.beans.VetoableChangeListener

public class FigSeqObject
extends FigNodeModelElement
implements java.awt.event.MouseMotionListener

Class to display graphics for a UML sequence in a diagram.

See Also:
Serialized Form

Field Summary
 java.util.Vector _activations
           
 boolean _created
           
 int _createHeight
           
 java.util.Vector _dynVector
           
 java.util.Vector _ports
           
 
Fields inherited from class org.argouml.uml.diagram.ui.FigNodeModelElement
_bigPort, _enclosedFigs, _encloser, _name, _readyToEdit, _shadowSize, _stereo, checkSize, ITALIC_LABEL_FONT, LABEL_FONT, MARGIN, ROWHEIGHT, STEREOHEIGHT, suppressCalcBounds
 
Constructor Summary
FigSeqObject()
           
FigSeqObject(GraphModel gm, java.lang.Object node)
           
 
Method Summary
 void bindPort(java.lang.Object port, Fig f)
          Sets the port (some object in an underlying model) for Fig f.
 void breakActivation(FigSeqLink figLink, java.util.Vector contents)
          If the connected action of the FigSeqLink figLink is a return-action, the corresponding FigActivation will be cut in two FigActivations
 FigActivation canConcat(int portNumber)
          Returns true, if two FigActivations at the given port-number can be replaced by one FigActivation
 boolean canDo(boolean side, FigSeqLink fsl, int portNumber)
          If the FigSeqLink fsl has a return- or destroy-action, this method decides, if this link can have this action --> returns true
 void changePosition(java.util.Vector contents)
          This method is called, when the FigSeqObject is moving around.
 java.lang.Object clone()
           
 void concatActivation(FigSeqLink figLink, java.util.Vector contents)
          This method decides, if two FigActivations can be replaced with the first of this two FigActivations with the added lenght of both FigActivations
 int edgesCount(java.util.Vector contents)
          Count the edges that are in this diagram
 java.util.Vector getContents()
          Get the Vector of all figures, that are shown in the diagram, is important because in sequence- diagrams often you have to update all figures
 java.awt.Dimension getMinimumSize()
           
 java.lang.Object hitPort(int x, int y)
          Reply the port that "owns" the topmost Fig under the given point, or null if none.
 Selection makeSelection()
           
protected  void modelChanged(MElementEvent mee)
          This is called aftern any part of the UML MModelElement has changed.
 void mouseClicked(java.awt.event.MouseEvent me)
          If the user double clicks on any part of this FigNode, pass it down to one of the internal Figs.
 void mouseDragged(java.awt.event.MouseEvent me)
           
 void mouseMoved(java.awt.event.MouseEvent me)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
 java.util.Vector nearestLink(java.util.Vector edges, int portNumber, java.util.Vector contents)
          Returns two Integers, one is the port-number of the FigSeqLink which is next to the given portNumber.
 java.lang.String ownerName()
           
 void parseDynObjects(java.lang.String dynobjs)
           
 java.lang.String placeString()
          Reply text to be shown while placing node in diagram
 void renderingChanged()
          Rerenders the fig if needed.
 void setBounds(int x, int y, int w, int h, int edges)
           
 void setForCreate(FigSeqLink linkFig, java.lang.String connectTo, boolean isCreate)
          If the FigSeqLink linkFig is connected to a create-action this FigSeqObject will be updated with the right values
 void setForDestroy(FigSeqLink linkFig, java.lang.String connectTo, boolean isTerminate)
          If the FigSeqLink linkFig is connected to a destroy-action this FigSeqObject will be updated with the right values
 void setOwner(java.lang.Object node)
           
 void terminateSymbolSetBounds(int x1, int y1, int x2, int y2)
          If the object is terminated , the termination symbol will appear as a cross.
protected  void textEdited(FigText ft)
          This method is called after the user finishes editing a text field that is in the FigNodeModelElement.
 void translate(int dx, int dy)
           
 
Methods inherited from class org.argouml.uml.diagram.ui.FigNodeModelElement
calcBounds, createFeatureIn, damage, delayedVetoableChange, delete, dispose, elementOrdering, enableSizeChecking, finalize, getContextNotation, getEnclosedFigs, getEnclosingFig, getItemUID, getNameFig, getPopUpActions, getShadowSize, getTipString, getUpdatedSize, hit, hitClarifier, isPartlyOwner, isPartlyOwner, keyPressed, keyReleased, keyTyped, listRoleItemSet, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, postLoad, propertyChange, propertySet, recovered, removed, roleAdded, roleRemoved, setEnclosingFig, setItemUID, setShadowSize, updateBounds, updateListeners, updateNameText, updateStereotypeText, vetoableChange
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.MouseListener
mouseEntered, mouseExited
 

Field Detail

_ports

public java.util.Vector _ports

_activations

public java.util.Vector _activations

_created

public boolean _created

_createHeight

public int _createHeight

_dynVector

public java.util.Vector _dynVector
Constructor Detail

FigSeqObject

public FigSeqObject()

FigSeqObject

public FigSeqObject(GraphModel gm,
                    java.lang.Object node)
Method Detail

makeSelection

public Selection makeSelection()
Overrides:
makeSelection in class FigNodeModelElement

translate

public void translate(int dx,
                      int dy)

ownerName

public java.lang.String ownerName()

terminateSymbolSetBounds

public void terminateSymbolSetBounds(int x1,
                                     int y1,
                                     int x2,
                                     int y2)
If the object is terminated , the termination symbol will appear as a cross. If not, the termination symbol is hidden.


placeString

public java.lang.String placeString()
Description copied from class: FigNodeModelElement
Reply text to be shown while placing node in diagram

Overrides:
placeString in class FigNodeModelElement

clone

public java.lang.Object clone()

parseDynObjects

public void parseDynObjects(java.lang.String dynobjs)

setOwner

public void setOwner(java.lang.Object node)
Overrides:
setOwner in class FigNodeModelElement

bindPort

public void bindPort(java.lang.Object port,
                     Fig f)
Sets the port (some object in an underlying model) for Fig f. f must already be contained in the FigNode. f will now represent the given port. Overrides the implementation of FigNode.


hitPort

public java.lang.Object hitPort(int x,
                                int y)
Reply the port that "owns" the topmost Fig under the given point, or null if none. Overrides the implementation of FigNode. If the hit port has an owner, hitPort() returns that owner object. The mode manageer tries to create an arc, even in the select mode. Because the user shall select the FigSeqObject with its lifeline, which is binded to the underlying object, a special handling is needed to make it selectable.


getMinimumSize

public java.awt.Dimension getMinimumSize()

setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h,
                      int edges)

textEdited

protected void textEdited(FigText ft)
                   throws java.beans.PropertyVetoException
Description copied from class: FigNodeModelElement
This method is called after the user finishes editing a text field that is in the FigNodeModelElement. Determine which field and update the model. This class handles the name, subclasses should override to handle other text elements.

Overrides:
textEdited in class FigNodeModelElement
java.beans.PropertyVetoException

modelChanged

protected void modelChanged(MElementEvent mee)
Description copied from class: FigNodeModelElement
This is called aftern any part of the UML MModelElement has changed. This method automatically updates the name FigText. Subclasses should override and update other parts.

Overrides:
modelChanged in class FigNodeModelElement

changePosition

public void changePosition(java.util.Vector contents)
This method is called, when the FigSeqObject is moving around. Changes the position of the FigSeqObjects.


edgesCount

public int edgesCount(java.util.Vector contents)
Count the edges that are in this diagram


setForCreate

public void setForCreate(FigSeqLink linkFig,
                         java.lang.String connectTo,
                         boolean isCreate)
If the FigSeqLink linkFig is connected to a create-action this FigSeqObject will be updated with the right values


setForDestroy

public void setForDestroy(FigSeqLink linkFig,
                          java.lang.String connectTo,
                          boolean isTerminate)
If the FigSeqLink linkFig is connected to a destroy-action this FigSeqObject will be updated with the right values


breakActivation

public void breakActivation(FigSeqLink figLink,
                            java.util.Vector contents)
If the connected action of the FigSeqLink figLink is a return-action, the corresponding FigActivation will be cut in two FigActivations


concatActivation

public void concatActivation(FigSeqLink figLink,
                             java.util.Vector contents)
This method decides, if two FigActivations can be replaced with the first of this two FigActivations with the added lenght of both FigActivations


getContents

public java.util.Vector getContents()
Get the Vector of all figures, that are shown in the diagram, is important because in sequence- diagrams often you have to update all figures


canDo

public boolean canDo(boolean side,
                     FigSeqLink fsl,
                     int portNumber)
If the FigSeqLink fsl has a return- or destroy-action, this method decides, if this link can have this action --> returns true


canConcat

public FigActivation canConcat(int portNumber)
Returns true, if two FigActivations at the given port-number can be replaced by one FigActivation


nearestLink

public java.util.Vector nearestLink(java.util.Vector edges,
                                    int portNumber,
                                    java.util.Vector contents)
Returns two Integers, one is the port-number of the FigSeqLink which is next to the given portNumber. The second Integer is the highest port-number


mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Description copied from class: FigNodeModelElement
If the user double clicks on any part of this FigNode, pass it down to one of the internal Figs. This allows the user to initiate direct text editing.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class FigNodeModelElement

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent me)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

renderingChanged

public void renderingChanged()
Description copied from class: FigNodeModelElement
Rerenders the fig if needed. This functionality was originally the functionality of modelChanged but modelChanged takes the event now into account.

Overrides:
renderingChanged in class FigNodeModelElement
See Also:
FigNodeModelElement.renderingChanged()


ArgoUML © 1996-2003 (20040216)ArgoUML Project HomeArgoUML Cookbook