org.argouml.uml.diagram.static_structure.ui
Class FigEdgeNote

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.static_structure.ui.FigEdgeNote
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 FigEdgeNote
extends FigEdgeModelElement
implements VetoableChangeListener, DelayedVChangeListener, MouseListener, KeyListener, PropertyChangeListener

Class to display a UML note connection to a annotated model element.

The owner of this fig is always CommentEdge

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
FigEdgeNote()
          Construct a new note connection.
FigEdgeNote(Object commentEdge, Layer theLayer)
          Constructor that hooks the Fig to a CommentEdge.
 
Method Summary
protected  boolean canEdit(Fig f)
           
protected  Action[] getApplyStereotypeActions()
          Overrides the standard method to return null.
protected  Object getDestination()
          Returns the destination of the edge.
 Object getOwner()
           
protected  Object getSource()
          Returns the source of the edge.
 String getTipString(MouseEvent me)
           
protected  void modelChanged(PropertyChangeEvent e)
          Listen for a RemoveAssociationEvent between the comment and the annotated element.
 void postLoad()
           
 void propertyChange(PropertyChangeEvent pve)
           
 void removeFromDiagramImpl()
           
 void setDestFigNode(FigNode fn)
           
 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).
 void setSourceFigNode(FigNode fn)
           
 String toString()
           
protected  void updateListeners(Object oldOwner, Object newOwner)
          Implementations of this method should register/unregister the fig for all (model)events.
protected  void updateNameText()
          generate the notation for the modelelement and stuff it into the text Fig
protected  void updateStereotypeText()
          generate the notation for the stereotype and stuff it into the text Fig
 
Methods inherited from class org.argouml.uml.diagram.ui.FigEdgeModelElement
addElementListener, addElementListener, addElementListener, allowRemoveFromDiagram, damage, delayedVetoableChange, deleteFromModel, getContextNotation, getDiElement, getEdgePort, getItalicLabelFont, getItemUID, getLabelFont, getName, getNameBounds, getNameFig, getPopUpActions, getPopupAddOffset, getRemoveDelegate, getSquaredDistance, getStereotypeFig, hit, hitClarifier, indicateBounds, initNotationProviders, keyPressed, keyReleased, keyTyped, makeEdgePort, makeSelection, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, removeAllElementListeners, removeElementListener, removeFromDiagram, renderingChanged, setContextNotation, setDiElement, setItemUID, setLayer, showHelp, superRemoveFromDiagram, textEdited, textEditStarted, updateClassifiers, 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, setDestPortFig, setHighlight, setLineColor, setLineWidth, setNumPoints, setPoint, setPoints, setSourceArrowHead, 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, getPreferredSize, getResource, getSingle, getSize, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getY, hasLineColor, initAnnotations, intersectsPerimeter, isAnnotation, isCopyable, isCutable, isLowerRightResizable, isMovable, isRemoveStarted, isSelectable, isSelected, isVisible, paint, 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, wait, wait, wait
 
Methods inherited from interface java.beans.VetoableChangeListener
vetoableChange
 
Methods inherited from interface org.argouml.kernel.DelayedVChangeListener
delayedVetoableChange
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
 
Methods inherited from interface org.argouml.cognitive.Highlightable
getHighlight, setHighlight
 
Methods inherited from interface org.tigris.gef.di.GraphicElement
getId, routingRect
 

Constructor Detail

FigEdgeNote

public FigEdgeNote()
Construct a new note connection. Use the same layout as for other edges.


FigEdgeNote

public FigEdgeNote(Object commentEdge,
                   Layer theLayer)
Constructor that hooks the Fig to a CommentEdge.

Parameters:
commentEdge - the CommentEdge
theLayer - the layer (ignored)
Method Detail

setFig

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

canEdit

protected boolean canEdit(Fig f)
Overrides:
canEdit in class FigEdgeModelElement
Parameters:
f - the Fig
Returns:
true if editable
See Also:
FigEdgeModelElement.canEdit(org.tigris.gef.presentation.Fig)

toString

public String toString()
See Also:
Object.toString()

modelChanged

protected void modelChanged(PropertyChangeEvent e)
Listen for a RemoveAssociationEvent between the comment and the annotated element. When recieved delete the CommentEdge and this FigEdgeNote.

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

getTipString

public String getTipString(MouseEvent me)
Overrides:
getTipString in class FigEdgeModelElement
See Also:
Fig.getTipString(java.awt.event.MouseEvent)

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:
Fig.setOwner(java.lang.Object)

getOwner

public Object getOwner()
Specified by:
getOwner in interface org.tigris.gef.di.GraphicElement
See Also:
Fig.getOwner()

getApplyStereotypeActions

protected final Action[] getApplyStereotypeActions()
Overrides the standard method to return null. A note edge cannot have a stereotype.

Overrides:
getApplyStereotypeActions in class FigEdgeModelElement
Returns:
null.

postLoad

public void postLoad()
Overrides:
postLoad in class FigEdgeModelElement
See Also:
Fig.postLoad()

updateNameText

protected void updateNameText()
generate the notation for the modelelement and stuff it into the text Fig

Overrides:
updateNameText in class FigEdgeModelElement

updateStereotypeText

protected void updateStereotypeText()
generate the notation for the stereotype and stuff it into the text Fig

Overrides:
updateStereotypeText in class FigEdgeModelElement

updateListeners

protected void updateListeners(Object oldOwner,
                               Object newOwner)
Description copied from class: FigEdgeModelElement
Implementations of this method should register/unregister the fig for all (model)events. For FigEdgeModelElement only the fig itself is registered as listening to events fired by the owner itself. But for, for example, FigAssociation the fig must also register for events fired by the stereotypes of the owner.

This function is used in UMLDiagram, which removes all listeners to all Figs when a diagram is not displayed, and restore them when it becomes visible again.

In this case, it is not imperative that indeed ALL listeners are updated, as long as the ones removed get added again and vice versa.

Additionally, this function may be used by the modelChanged() function.

In this case, it IS imperative that all listeners get removed / added.

Overrides:
updateListeners in class FigEdgeModelElement
Parameters:
newOwner - the new owner for the listeners
See Also:
org.argouml.uml.diagram.ui.FigEdgeModelElement#updateListeners(java.lang.Object)

propertyChange

public void propertyChange(PropertyChangeEvent pve)
Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class FigEdgeModelElement
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

removeFromDiagramImpl

public void removeFromDiagramImpl()
Overrides:
removeFromDiagramImpl in class FigEdgeModelElement
See Also:
Fig.removeFromDiagram()

getSource

protected Object getSource()
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:
MModelElement

getDestination

protected Object getDestination()
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:
Object

setDestFigNode

public void setDestFigNode(FigNode fn)
See Also:
FigEdge.setDestFigNode(org.tigris.gef.presentation.FigNode)

setSourceFigNode

public void setSourceFigNode(FigNode fn)
See Also:
FigEdge.setSourceFigNode(org.tigris.gef.presentation.FigNode)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook