org.argouml.uml.diagram.use_case.ui
Class FigExtend

java.lang.Object
  extended by FigEdgePoly
      extended by org.argouml.uml.diagram.ui.FigEdgeModelElement
          extended by org.argouml.uml.diagram.use_case.ui.FigExtend
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.beans.PropertyChangeListener, java.beans.VetoableChangeListener, java.util.EventListener, ArgoEventListener, ArgoDiagramAppearanceEventListener, ArgoNotationEventListener, Highlightable, DelayedVChangeListener, ArgoFig, Clarifiable, IItemUID

public class FigExtend
extends FigEdgeModelElement

A fig for use with extend relationships on use case diagrams.

Realised as a dotted line with an open arrow head and the label «extend» together with any condition alongside.


Field Summary
 
Fields inherited from interface org.argouml.uml.diagram.ui.ArgoFig
DEBUG, DEBUG_COLOR, FILL_COLOR, INVISIBLE_LINE_COLOR, LINE_COLOR, LINE_WIDTH, ROWHEIGHT, SOLID_FILL_COLOR, STEREOHEIGHT, TEXT_COLOR, X0, Y0
 
Constructor Summary
FigExtend(java.lang.Object owner, DiagramSettings settings)
          Construct an Extend fig.
 
Method Summary
protected  boolean canEdit(Fig f)
          Define whether the given fig can be edited (it can't).
protected  void modelChanged(java.beans.PropertyChangeEvent e)
          This is called after any part of the UML ModelElement has changed.
 void paint(java.awt.Graphics g)
           
 void renderingChanged()
          Rerenders the attached elements of the fig.
 void setFig(Fig f)
          Set a new fig to represent this edge.
protected  void updateConditionText()
          Now sort out the condition text.
protected  void updateLabel()
           
protected  void updateListeners(java.lang.Object oldOwner, java.lang.Object newOwner)
          Implementations of this method should register/unregister the fig for all (model)events that may cause a repaint to be necessary.
 
Methods inherited from class org.argouml.uml.diagram.ui.FigEdgeModelElement
addElementListener, addElementListener, addElementListener, allowRemoveFromDiagram, computeRouteImpl, damage, delayedVetoableChange, deleteFromModel, determineFigNodes, diagramFontChanged, getApplyStereotypeActions, getDestination, getDestinationConnector, getDiElement, getEdgePort, getItemUID, getName, getNameBounds, getNameFig, getNameFigFontStyle, getNotationProviderType, getNotationSettings, getPopUpActions, getPopupAddOffset, getProject, getRemoveDelegate, getSettings, getSource, getSourceConnector, getSquaredDistance, getStereotypeFig, getTipString, hit, hitClarifier, indicateBounds, initNotationProviders, keyPressed, keyReleased, keyTyped, makeEdgePort, makeSelection, modelAssociationAdded, modelAssociationRemoved, modelAttributeChanged, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, propertyChange, removeAllElementListeners, removeElementListener, removeFromDiagram, removeFromDiagramImpl, setDiElement, setItemUID, setLayer, setLineColor, setOwner, setProject, setSettings, showHelp, superRemoveFromDiagram, textEdited, textEditStarted, updateElementListeners, updateFont, updateLayout, updateNameText, updateStereotypeText, vetoableChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.argouml.cognitive.Highlightable
getHighlight, setHighlight
 

Constructor Detail

FigExtend

public FigExtend(java.lang.Object owner,
                 DiagramSettings settings)
Construct an Extend fig.

Parameters:
owner - uml element
settings - rendering settings
Method Detail

setFig

public void setFig(Fig f)
Set a new fig to represent this edge.

We invoke the superclass accessor. Then change aspects of the new fig that are not as we want. In this case to use dashed lines.

Overrides:
setFig in class FigEdgeModelElement
Parameters:
f - The fig to use.

canEdit

protected boolean canEdit(Fig f)
Define whether the given fig can be edited (it can't).

Overrides:
canEdit in class FigEdgeModelElement
Parameters:
f - The fig about which the enquiry is being made. Ignored in this implementation.
Returns:
false under all circumstances.

paint

public void paint(java.awt.Graphics g)

updateListeners

protected void updateListeners(java.lang.Object oldOwner,
                               java.lang.Object newOwner)
Description copied from class: FigEdgeModelElement
Implementations of this method should register/unregister the fig for all (model)events that may cause a repaint to be necessary. In the simplest case, the fig should register itself as listening to (all) events fired by (only) the owner.

But for, for example, for a FigLink the fig must also register for events fired by the association of the owner - because the name of the association is shown, not the name of the Link.

In other cases, there is no need to register for any event, e.g. when a notationProvider is used.

This function is called in 2 places: at creation (load) time of this Fig, i.e. when the owner changes, and in some cases by the modelChanged() function, i.e. when the model changes.

This function shall always register for the "remove" event of the owner! Otherwise the Fig will not be deleted when the owner gets deleted.

IF this method is called with both the oldOwner and the newOwner equal and not null, AND we listen only to the owner itself, THEN we can safely ignore the call, but ELSE we need to update the listeners of the related elements, since the related elements may have been replaced.

Overrides:
updateListeners in class FigEdgeModelElement
Parameters:
oldOwner - the previous owner, or null if there was none, and all listeners have to be set
newOwner - the new owner for the listeners, or null if all listeners have to be removed

modelChanged

protected void modelChanged(java.beans.PropertyChangeEvent e)
Description copied from class: FigEdgeModelElement
This is called after any part of the UML ModelElement has changed. This method automatically updates the name FigText. Subclasses should override and update other parts.

Overrides:
modelChanged in class FigEdgeModelElement
Parameters:
e - the event

renderingChanged

public void renderingChanged()
Description copied from class: FigEdgeModelElement
Rerenders the attached elements of the fig.

Warning: The purpose of this function is NOT to redraw the whole Fig every time something changes. That would be inefficient.

Instead, this function should only be called for major changes that require a complete redraw, such as change of owner, and change of notation language.

Overrule this function for subclasses that add extra or remove graphical parts.

Specified by:
renderingChanged in interface ArgoFig
Overrides:
renderingChanged in class FigEdgeModelElement

updateConditionText

protected void updateConditionText()
Now sort out the condition text. Use the null string if there is no condition set. The condition is a BooleanExpression, so we show the "body" of it, and ignore the "language".


updateLabel

protected void updateLabel()


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook