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

java.lang.Object
  |
  +--org.tigris.gef.presentation.Fig
        |
        +--org.tigris.gef.presentation.FigGroup
              |
              +--org.tigris.gef.presentation.FigNode
                    |
                    +--org.argouml.uml.diagram.ui.FigNodeModelElement
                          |
                          +--org.argouml.uml.diagram.sequence.ui.FigSeqObject
All Implemented Interfaces:
ArgoEventListener, ArgoNotationEventListener, java.lang.Cloneable, DelayedVChangeListener, java.util.EventListener, org.tigris.gef.ui.Highlightable, java.awt.event.KeyListener, ru.novosoft.uml.MElementListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, NotationContext, org.tigris.gef.ui.PopupGenerator, java.beans.PropertyChangeListener, java.io.Serializable, java.beans.VetoableChangeListener

public class FigSeqObject
extends FigNodeModelElement
implements java.awt.event.MouseMotionListener, ru.novosoft.uml.MElementListener

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, cat, checkSize, ITALIC_LABEL_FONT, LABEL_FONT, MARGIN, ROWHEIGHT, STEREOHEIGHT, suppressCalcBounds
 
Fields inherited from class org.tigris.gef.presentation.FigNode
_blinkPorts, _figEdges, _highlight, ang135, ang225, ang315, ang45
 
Fields inherited from class org.tigris.gef.presentation.FigGroup
_dynObjects, _figs
 
Fields inherited from class org.tigris.gef.presentation.Fig
_allowsSaving, _context, _dashes, _displayed, _fillColor, _filled, _group, _h, _layer, _lineColor, _lineWidth, _locked, _resource, _shown, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, DASH_ARRAYS, DASHED_CHOICES, MIN_SIZE
 
Constructor Summary
FigSeqObject()
           
FigSeqObject(org.tigris.gef.graph.GraphModel gm, java.lang.Object node)
           
 
Method Summary
 void bindPort(java.lang.Object port, org.tigris.gef.presentation.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.
 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
 org.tigris.gef.presentation.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.
 org.tigris.gef.base.Selection makeSelection()
           
protected  void modelChanged(ru.novosoft.uml.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(org.tigris.gef.presentation.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, propertyChange, propertySet, recovered, removed, roleAdded, roleRemoved, setEnclosingFig, setItemUID, setShadowSize, updateBounds, updateListeners, updateNameText, updateStereotypeText, vetoableChange
 
Methods inherited from class org.tigris.gef.presentation.FigNode
addFigEdge, cleanUp, contains, deepHitPort, endTrans, getBlinkPorts, getFigEdges, getHighlight, getPortFig, getPortFigs, getPortSector, hidePorts, hitPort, mouseEntered, mouseExited, paint, postLoad, removeFigEdge, removePort, setBlinkPorts, setBounds, setHighlight, showPorts, startTrans, superTranslate, updateEdges
 
Methods inherited from class org.tigris.gef.presentation.FigGroup
addFig, elements, getDisplayedFigs, getFigs, getFillColor, getFilled, getFont, getFontFamily, getFontSize, getLineColor, getLineWidth, getPrivateData, getTextColor, getTextFillColor, getTextFilled, hitFig, isReshapable, isResizable, isRotatable, removeAll, removeFig, setFigs, setFillColor, setFilled, setFont, setFontFamily, setFontSize, setLineColor, setLineWidth, setPrivateData, setTextColor, setTextFillColor, setTextFilled
 
Methods inherited from class org.tigris.gef.presentation.Fig
addAnnotation, addPoint, addPropertyChangeListener, align, center, classNameAndBounds, connectionPoint, contains, contains, countCornersContained, createDrag, drawDashedLine, drawDashedPerimeter, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getBounds, getClosestPoint, getContext, getDashed, getDashed01, getDashedString, getFilled01, getFirstPoint, getGravityPoints, getGroup, getHalfHeight, getHalfWidth, getHandleBox, getHeight, getId, getLastPoint, getLayer, getLocation, getLocked, getNumPoints, getOwner, getPerimeterLength, getPoints, getPoints, getPreferedSize, getResource, getSize, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getXs, getY, getYs, initAnnotations, insertPoint, intersects, isAnnotation, isDisplayed, isLowerRightResizable, isMovable, OK, pointAlongPerimeter, postSave, preSave, print, removeAnnotation, removeAnnotation, removePoint, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setCenter, setContext, setDashed, setDashedString, setDisplayed, setGroup, setHandleBox, setHeight, setLayer, setLocation, setLocation, setLocked, setNumPoints, setPoints, setPoints, setPoints, setPoints, setPoints, setResource, setSavingAllowed, setSize, setSize, setVisState, setWidth, setX, setXs, setY, setYs, stuffBounds, stuffPointAlongPerimeter, unsetAnnotationOwner, updateAnnotationPositions, updateVisState, within
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ru.novosoft.uml.MElementListener
listRoleItemSet, propertySet, recovered, removed, roleAdded, roleRemoved
 
Methods inherited from interface java.awt.event.MouseListener
mouseEntered, mouseExited
 
Methods inherited from interface org.tigris.gef.ui.Highlightable
addPropertyChangeListener, removePropertyChangeListener
 

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(org.tigris.gef.graph.GraphModel gm,
                    java.lang.Object node)
Method Detail

makeSelection

public org.tigris.gef.base.Selection makeSelection()
Overrides:
makeSelection in class FigNodeModelElement

translate

public void translate(int dx,
                      int dy)
Overrides:
translate in class org.tigris.gef.presentation.FigNode

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()
Overrides:
clone in class org.tigris.gef.presentation.FigNode

parseDynObjects

public void parseDynObjects(java.lang.String dynobjs)
Overrides:
parseDynObjects in class org.tigris.gef.presentation.FigGroup

setOwner

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

bindPort

public void bindPort(java.lang.Object port,
                     org.tigris.gef.presentation.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.
Overrides:
bindPort in class org.tigris.gef.presentation.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.
Overrides:
hitPort in class org.tigris.gef.presentation.FigNode

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class org.tigris.gef.presentation.Fig

setBounds

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

textEdited

protected void textEdited(org.tigris.gef.presentation.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

modelChanged

protected void modelChanged(ru.novosoft.uml.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 org.tigris.gef.presentation.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)
Overrides:
mousePressed in class org.tigris.gef.presentation.FigNode

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.
Overrides:
mouseClicked in class FigNodeModelElement

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Overrides:
mouseReleased in class org.tigris.gef.presentation.FigNode

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 (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook