org.argouml.uml.diagram.state.ui
Class FigTransition

java.lang.Object
  extended byorg.tigris.gef.presentation.Fig
      extended byorg.tigris.gef.presentation.FigEdge
          extended byorg.tigris.gef.presentation.FigEdgePoly
              extended byorg.argouml.uml.diagram.ui.FigEdgeModelElement
                  extended byorg.argouml.uml.diagram.state.ui.FigTransition
All Implemented Interfaces:
ArgoEventListener, ArgoNotationEventListener, Cloneable, Connecter, DelayedVChangeListener, EventListener, org.tigris.gef.di.GraphEdge, org.tigris.gef.di.GraphicElement, Highlightable, KeyListener, MouseListener, NotationContext, PopupGenerator, PropertyChangeListener, Serializable, VetoableChangeListener

public class FigTransition
extends FigEdgeModelElement

This class represents the graphical representation of a transition on a diagram.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.argouml.uml.diagram.ui.FigEdgeModelElement
notationProviderName
 
Fields inherited from class org.tigris.gef.presentation.FigEdgePoly
_initiallyLaidOut
 
Fields inherited from class org.tigris.gef.presentation.FigEdge
_arrowHeadEnd, _arrowHeadStart, _destFigNode, _highlight, _pathItems, _sourceFigNode, _useNearest
 
Fields inherited from class org.tigris.gef.presentation.Fig
_allowsSaving, _context, _dashes, _dashPeriod, _dashStyle, _filled, _h, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, MIN_SIZE, plotter
 
Constructor Summary
FigTransition()
          The main constructor.
FigTransition(Object edge, Layer lay)
          The constructor that hooks the Fig into an existing UML element.
 
Method Summary
protected  Object getDestination()
          Returns the destination of the edge.
protected  Object getSource()
          Returns the source of the edge.
protected  void initNotationProviders(Object own)
          Create the NotationProviders.
protected  void modelChanged(PropertyChangeEvent e)
          This is called after any part of the UML ModelElement has changed.
 void paint(Graphics g)
           
 void paintClarifiers(Graphics g)
           
 void setFig(Fig f)
           
 void setOwner(Object newOwner)
          This method should only be called once for any one Fig instance that represents a model element (ie not for a FigEdgeNote).
protected  void textEdited(FigText ft)
          This method is called after the user finishes editing a text field that is in the FigEdgeModelElement.
protected  void textEditStarted(FigText ft)
          This method is called when the user doubleclicked on the text field, and starts editing.
protected  void updateNameText()
          Updates the name text box.
 
Methods inherited from class org.argouml.uml.diagram.ui.FigEdgeModelElement
addElementListener, addElementListener, addElementListener, allowRemoveFromDiagram, canEdit, damage, delayedVetoableChange, deleteFromModel, getApplyStereotypeActions, getContextNotation, getDiElement, getEdgePort, getItalicLabelFont, getItemUID, getLabelFont, getName, getNameBounds, getNameFig, getPopUpActions, getPopupAddOffset, getRemoveDelegate, getSquaredDistance, getStereotypeFig, getTipString, hit, hitClarifier, indicateBounds, keyPressed, keyReleased, keyTyped, makeEdgePort, makeSelection, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, postLoad, propertyChange, removeAllElementListeners, removeElementListener, removeFromDiagram, removeFromDiagramImpl, renderingChanged, setContextNotation, setDiElement, setItemUID, setLayer, showHelp, superRemoveFromDiagram, updateClassifiers, updateListeners, updateStereotypeText, vetoableChange
 
Methods inherited from class org.tigris.gef.presentation.FigEdgePoly
computeRouteImpl, findAvoidPt, getPolygon, insertPoint, layoutEdge, makeEdgeFig, moveVertex, paint, routingRectPoint, segOK, setEndPoints, setInitiallyLaidOut, setPoint, setPolygon, tryRoute
 
Methods inherited from class org.tigris.gef.presentation.FigEdge
addPathItem, calcBounds, cleanUp, computeRoute, contains, getBetweenNearestPoints, getBounds, getDashed, getDestArrowHead, getDestFigNode, getDestPortFig, getFig, getFirstPoint, getHighlight, getLastPoint, getLineColor, getLineWidth, getNumPoints, getPathItem, getPathItemFig, getPathItemFigs, getPathItemsRaw, getPerimeterLength, getPoint, getPoints, getPrivateData, getSourceArrowHead, getSourceFigNode, getSourcePortFig, getXs, getYs, hasFillColor, hitFig, intersects, isReshapable, isResizable, isRotatable, paintArrowHeads, paintHighlightLine, paintPathItems, removePathItem, removePathItem, setBetweenNearestPoints, setDashed, setDestArrowHead, setDestFigNode, setDestPortFig, setHighlight, setLineColor, setLineWidth, setNumPoints, setPoint, setPoints, setSourceArrowHead, setSourceFigNode, setSourcePortFig, setXs, setYs, stuffPointAlongPerimeter, translateEdge, updatePathItemLocations
 
Methods inherited from class org.tigris.gef.presentation.Fig
addAnnotation, addPoint, addPropertyChangeListener, align, center, classNameAndBounds, clone, connectionPoint, contains, contains, countCornersContained, createDrag, endTrans, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getBounds, getCenter, getClosestPoint, getContext, getDashed01, getDashedString, getEnclosedFigs, getEnclosingFig, getFillColor, getFilled, getFilled01, getGravityPoints, getGroup, getHalfHeight, getHalfWidth, getHandleBox, getHeight, getId, getLayer, getLocation, getLocked, getMinimumSize, getOwner, getPreferredSize, getResource, getSingle, getSize, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getY, hasLineColor, initAnnotations, intersectsPerimeter, isAnnotation, isCopyable, isCutable, isLowerRightResizable, isMovable, isRemoveStarted, isSelectable, isSelected, isVisible, pointAlongPerimeter, postSave, preSave, print, redraw, removeAnnotation, removePoint, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setBounds, setBoundsImpl, setCenter, setContext, setDashedString, setEnclosingFig, setFillColor, setFilled, setGroup, setHandleBox, setHeight, setLocation, setLocation, setLocked, setMovable, setPoint, setPoint, setPrivateData, setResizable, setResource, setSavingAllowed, setSize, setSize, setVisible, setWidth, setX, setY, stuffBounds, translate, translateAnnotations, translateImpl, unsetAnnotationOwner, updateAnnotationPositions, within
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.argouml.cognitive.Highlightable
getHighlight, setHighlight
 
Methods inherited from interface org.tigris.gef.di.GraphicElement
getId, getOwner, routingRect
 

Constructor Detail

FigTransition

public FigTransition()
The main constructor.


FigTransition

public FigTransition(Object edge,
                     Layer lay)
The constructor that hooks the Fig into an existing UML element. It also adapts the line to be dashed if the source or destination is an ObjectFlowState.

Parameters:
edge - the UML element
lay - the layer
Method Detail

setOwner

public void setOwner(Object newOwner)
Description copied from class: FigEdgeModelElement
This method should only be called once for any one Fig instance that represents a model element (ie not for a FigEdgeNote). It is called either by the constructor that takes an model element as an argument or it is called by PGMLStackParser after it has created the Fig by use of the empty constructor. The assigned model element (owner) must not change during the lifetime of the Fig. TODO: It is planned to refactor so that there is only one Fig constructor. When this is achieved this method can refactored out.

Overrides:
setOwner in class FigEdgeModelElement
See Also:
FigEdgeModelElement.setOwner(java.lang.Object)

initNotationProviders

protected void initNotationProviders(Object own)
Description copied from class: FigEdgeModelElement
Create the NotationProviders.

Overrides:
initNotationProviders in class FigEdgeModelElement
Parameters:
own - the current owner
See Also:
FigEdgeModelElement.initNotationProviders(java.lang.Object)

setFig

public void setFig(Fig f)
See Also:
FigEdge.setFig(org.tigris.gef.presentation.Fig)

textEdited

protected void textEdited(FigText ft)
This method is called after the user finishes editing a text field that is in the FigEdgeModelElement. Determine which field and update the model. This class handles the name, subclasses should override to handle other text elements.

Overrides:
textEdited in class FigEdgeModelElement
Parameters:
ft - the text Fig that has been edited
See Also:
FigEdgeModelElement.textEdited(org.tigris.gef.presentation.FigText)

textEditStarted

protected void textEditStarted(FigText ft)
Description copied from class: FigEdgeModelElement
This method is called when the user doubleclicked on the text field, and starts editing. Subclasses should overrule this field to e.g. supply help to the user about the used format.

It is also possible to alter the text to be edited already here, e.g. by adding the stereotype in front of the name, but that seems not user-friendly.

Overrides:
textEditStarted in class FigEdgeModelElement
Parameters:
ft - the FigText that will be edited and contains the start-text
See Also:
FigEdgeModelElement.textEditStarted(org.tigris.gef.presentation.FigText)

modelChanged

protected void modelChanged(PropertyChangeEvent e)
This is called after any part of the UML ModelElement has changed. This method automatically updates the attached FigText.

Overrides:
modelChanged in class FigEdgeModelElement
Parameters:
e - the event
See Also:
FigEdgeModelElement.modelChanged(java.beans.PropertyChangeEvent)

getDestination

protected Object getDestination()
Description copied from class: FigEdgeModelElement
Returns the destination of the edge. The destination is the owner of the node the edge travels to in a binary relationship. For instance: for a classifierrole, this is the receiver.

Overrides:
getDestination in class FigEdgeModelElement
Returns:
a model element
See Also:
FigEdgeModelElement.getDestination()

getSource

protected Object getSource()
Description copied from class: FigEdgeModelElement
Returns the source of the edge. The source is the owner of the node the edge travels from in a binary relationship. For instance: for a classifierrole, this is the sender.

Overrides:
getSource in class FigEdgeModelElement
Returns:
a model element
See Also:
FigEdgeModelElement.getSource()

paint

public void paint(Graphics g)
See Also:
Fig.paint(java.awt.Graphics)

updateNameText

protected void updateNameText()
Updates the name text box. In case of a transition the name text box contains: The contents of the text box is generated by the notationProvider

Overrides:
updateNameText in class FigEdgeModelElement
See Also:
FigEdgeModelElement.updateNameText()

paintClarifiers

public void paintClarifiers(Graphics g)
Overrides:
paintClarifiers in class FigEdgeModelElement
Parameters:
g - the Graphics object
See Also:
FigEdgeModelElement.paintClarifiers(java.awt.Graphics)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook