org.argouml.sequence2.diagram
Class FigMessage

java.lang.Object
  extended by FigEdgePoly
      extended by org.argouml.uml.diagram.ui.FigEdgeModelElement
          extended by org.argouml.sequence2.diagram.FigMessage
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 FigMessage
extends FigEdgeModelElement

The Fig that represents a message between classifier roles.


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
FigMessage(java.lang.Object edge, DiagramSettings settings)
          Construct a fig owned by the given UML element with the provided render settings.
 
Method Summary
protected  ArgoJMenu buildOperationMenu()
           
 void calcBounds()
           
 void computeRouteImpl()
           
 void convertToArc()
          Converts the message into a spline.
 void deleteFromModel()
           
 java.lang.Object determineActivator()
          Determines the activator of this message based on the message position in relation to other messages.
protected  boolean determineFigNodes()
          The default behaviour from FigEdgeModelElement is not correct here.
 java.lang.Object getAction()
          Deprecated. This method is only called internally. If its needed at all it will become private. External callers can test for action type using isCallAction etc. If absolutely required the actions can be accessed via the model.
protected  int getNotationProviderType()
          Overrule this for subclasses that need a different NotationProvider.
protected  SDNotationSettings getNotationSettings()
           
 java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
           
protected  void initNotationProviders(java.lang.Object own)
          Replace the NotationProvider(s).
 Selection makeSelection()
           
 void setFig(Fig f)
           
 void setLineColor(java.awt.Color c)
           
protected  void textEditStarted(FigText ft)
          This method is called when the user doubleclicked on the text field, and starts editing.
 void translate(int dx, int dy)
           
 void updateLayout(UmlChangeEvent event)
          This is a template method called by the ArgoUML framework as the result of a change to a model element.
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, canEdit, damage, delayedVetoableChange, diagramFontChanged, getApplyStereotypeActions, getDestination, getDestinationConnector, getDiElement, getEdgePort, getItemUID, getName, getNameBounds, getNameFig, getNameFigFontStyle, getPopupAddOffset, getProject, getRemoveDelegate, getSettings, getSource, getSourceConnector, getSquaredDistance, getStereotypeFig, getTipString, hit, hitClarifier, indicateBounds, keyPressed, keyReleased, keyTyped, makeEdgePort, modelAssociationAdded, modelAssociationRemoved, modelAttributeChanged, modelChanged, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, propertyChange, removeAllElementListeners, removeElementListener, removeFromDiagram, removeFromDiagramImpl, renderingChanged, setDiElement, setItemUID, setLayer, setOwner, setProject, setSettings, showHelp, superRemoveFromDiagram, textEdited, updateElementListeners, updateFont, 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

FigMessage

public FigMessage(java.lang.Object edge,
                  DiagramSettings settings)
Construct a fig owned by the given UML element with the provided render settings.

Parameters:
edge - owning UML element
settings - rendering settings
Method Detail

getNotationProviderType

protected int getNotationProviderType()
Description copied from class: FigEdgeModelElement
Overrule this for subclasses that need a different NotationProvider.

Overrides:
getNotationProviderType in class FigEdgeModelElement
Returns:
the type of the notation provider

initNotationProviders

protected void initNotationProviders(java.lang.Object own)
Description copied from class: FigEdgeModelElement
Replace the NotationProvider(s).

This method shall not be used for the initial creation of notation providers, but only for replacing them when required. Initialization must be done in the constructor using methods which can't be overridden.

NotationProviders can not be updated - they are lightweight throw-away objects. Hence this method creates a (new) NotationProvider whenever needed. E.g. when the notation language is changed by the user, then the NPs are to be re-created. So, this method shall not be called from a Fig constructor.

After the removal of the deprecated method setOwner(), this method shall contain the following statement: assert notationProviderName != null

Overrides:
initNotationProviders in class FigEdgeModelElement
Parameters:
own - the current owner

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 override this method 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

getNotationSettings

protected SDNotationSettings getNotationSettings()
Overrides:
getNotationSettings in class FigEdgeModelElement
Returns:
the current notation settings

getAction

public java.lang.Object getAction()
Deprecated. This method is only called internally. If its needed at all it will become private. External callers can test for action type using isCallAction etc. If absolutely required the actions can be accessed via the model.

Gets the action attached to the message.

Returns:
the action

getPopUpActions

public java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
Overrides:
getPopUpActions in class FigEdgeModelElement
Parameters:
me - the MouseEvent that triggered the popup menu request
Returns:
a Vector containing a combination of these 4 types: Action, JMenu, JMenuItem, JSeparator.

buildOperationMenu

protected ArgoJMenu buildOperationMenu()

makeSelection

public Selection makeSelection()
Overrides:
makeSelection in class FigEdgeModelElement
Returns:
a SelectionRerouteEdge object that manages selection and rerouting of the edge.
See Also:
org.tigris.gef.presentation.Fig#makeSelection()

setFig

public void setFig(Fig f)
Overrides:
setFig in class FigEdgeModelElement

convertToArc

public void convertToArc()
Converts the message into a spline. This is needed for self-referencing messages.


computeRouteImpl

public void computeRouteImpl()

calcBounds

public void calcBounds()

setLineColor

public void setLineColor(java.awt.Color c)
Overrides:
setLineColor in class FigEdgeModelElement

deleteFromModel

public void deleteFromModel()
Overrides:
deleteFromModel in class FigEdgeModelElement

determineFigNodes

protected boolean determineFigNodes()
The default behaviour from FigEdgeModelElement is not correct here. See issue 5005. TODO: We must determine what to do here but for now doing nothing is better. I'm not sure why the super method would not work as I would expect that to do nothing if the ends are already correct.

Overrides:
determineFigNodes in class FigEdgeModelElement
Returns:
true at all times for now

translate

public void translate(int dx,
                      int dy)

updateLayout

public void updateLayout(UmlChangeEvent event)
This is a template method called by the ArgoUML framework as the result of a change to a model element. Do not call this method directly yourself.

Override this in any subclasses in order to restructure the FigNode due to change of any model element that this FigNode is listening to.

This method is guaranteed by the framework to be running on the Swing/AWT thread.

Overrides:
updateLayout in class FigEdgeModelElement
Parameters:
event - the UmlChangeEvent that caused the change
See Also:
FigEdgeModelElement.updateLayout(org.argouml.model.UmlChangeEvent)

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

determineActivator

public java.lang.Object determineActivator()
Determines the activator of this message based on the message position in relation to other messages.

Currently this only manages return messages. Any other message type returns with no action taking place.

The activator is set to the first call or create message found above this message.

Returns:
the activator that has been applied to the message.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook