org.argouml.uml.diagram.ui
Class FigEdgeModelElement

java.lang.Object
  extended by FigEdgePoly
      extended by org.argouml.uml.diagram.ui.FigEdgeModelElement
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
Direct Known Subclasses:
FigAssociation, FigAssociationEnd, FigDependency, FigEdgeAssociationClass, FigExtend, FigGeneralization, FigInclude, FigLink, FigMessage, FigMessage, FigTransition

public abstract class FigEdgeModelElement
extends FigEdgePoly
implements java.beans.VetoableChangeListener, DelayedVChangeListener, java.awt.event.MouseListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener, ArgoNotationEventListener, ArgoDiagramAppearanceEventListener, Highlightable, IItemUID, ArgoFig, Clarifiable

Abstract class to display diagram lines (edges) for UML ModelElements that look like lines. This Fig is prepared to show a (possibly editable) name, and/or multiple stereotypes.

NOTE: This will drop the ArgoNotationEventListener and ArgoDiagramAppearanceEventListener interfaces in the next release. The corresponding methods have been marked as deprecated.


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
protected FigEdgeModelElement(java.lang.Object element, DiagramSettings renderSettings)
          Construct a new FigEdge.
 
Method Summary
protected  void addElementListener(java.lang.Object element)
          Add an element listener and remember the registration.
protected  void addElementListener(java.lang.Object element, java.lang.String property)
          Add a listener and remember the registration.
protected  void addElementListener(java.lang.Object element, java.lang.String[] property)
          Add a listener and remember the registration.
protected  void allowRemoveFromDiagram(boolean allowed)
           
protected  boolean canEdit(Fig f)
           
 void damage()
           
 void delayedVetoableChange(java.beans.PropertyChangeEvent pce)
           
 void deleteFromModel()
           
protected  boolean determineFigNodes()
          Determines if the FigEdge is currently connected to the correct FigNodes, if not the edges is the correct FigNodes set and the edge rerouted.
 void diagramFontChanged(ArgoDiagramAppearanceEvent e)
          Deprecated. for 0.27.2 by tfmorris. Global rendering changes are now managed at the diagram level.
protected  javax.swing.Action[] getApplyStereotypeActions()
          Get the set of Actions which valid for adding/removing Stereotypes on the ModelElement of this Fig's owner.
protected  java.lang.Object getDestination()
          Returns the destination of the edge.
 java.lang.Object getDestinationConnector()
          Get the model element at the destination end of the edge.
 DiElement getDiElement()
           
 FigEdgePort getEdgePort()
           
 ItemUID getItemUID()
          Getter for the UID
 java.lang.String getName()
           
 java.awt.Rectangle getNameBounds()
          Get the Rectangle in which the model elements name is displayed
protected  FigText getNameFig()
          Getter for name, the name Fig
protected  int getNameFigFontStyle()
          Determines the font style based on the UML model.
protected  int getNotationProviderType()
          Overrule this for subclasses that need a different NotationProvider.
protected  NotationSettings getNotationSettings()
           
 java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
           
protected static int getPopupAddOffset()
           
 Project getProject()
          Deprecated. for 0.27.2 by tfmorris. Implementations should have all the information that they require in the DiagramSettings object.
protected  Fig getRemoveDelegate()
          Subclasses should override this to redirect a remove request from one Fig to another.
 DiagramSettings getSettings()
           
protected  java.lang.Object getSource()
          Returns the source of the edge.
 java.lang.Object getSourceConnector()
          Get the model element at the source end of the edge.
protected  int getSquaredDistance(java.awt.Point p1, java.awt.Point p2)
          distance formula: (x-h)^2 + (y-k)^2 = distance^2
protected  FigStereotypesGroup getStereotypeFig()
          Getter for stereo, the stereotype Fig
 java.lang.String getTipString(java.awt.event.MouseEvent me)
           
 boolean hit(java.awt.Rectangle r)
           
 ToDoItem hitClarifier(int x, int y)
          The user clicked on the clarifier.
protected  void indicateBounds(FigText f, java.awt.Graphics g)
          This is used to draw a box round the edge of any editable FigText annotations of the edge when the edge is selected.
protected  void initNotationProviders(java.lang.Object own)
          Replace the NotationProvider(s).
 void keyPressed(java.awt.event.KeyEvent ke)
           
 void keyReleased(java.awt.event.KeyEvent ke)
           
 void keyTyped(java.awt.event.KeyEvent ke)
           
 void makeEdgePort()
          Create a FigCommentPort if needed
 Selection makeSelection()
           
protected  void modelAssociationAdded(AddAssociationEvent aae)
          Called whenever we receive an AddAssociationEvent.
protected  void modelAssociationRemoved(RemoveAssociationEvent rae)
          Called whenever we receive an RemoveAssociationEvent.
protected  void modelAttributeChanged(AttributeChangeEvent ace)
          Called whenever we receive an AttributeChangeEvent.
protected  void modelChanged(java.beans.PropertyChangeEvent e)
          This is called after any part of the UML ModelElement has changed.
 void mouseClicked(java.awt.event.MouseEvent me)
           
 void mouseEntered(java.awt.event.MouseEvent me)
           
 void mouseExited(java.awt.event.MouseEvent me)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
 void notationAdded(ArgoNotationEvent event)
          Deprecated. for 0.27.2 by tfmorris.
 void notationChanged(ArgoNotationEvent event)
          Deprecated. for 0.27.2 by tfmorris. Changes to notation provider are now handled by the owning diagram.
 void notationProviderAdded(ArgoNotationEvent event)
          Deprecated. for 0.27.2 by tfmorris.
 void notationProviderRemoved(ArgoNotationEvent event)
          Deprecated. for 0.27.2 by tfmorris.
 void notationRemoved(ArgoNotationEvent event)
          Deprecated. for 0.27.2 by tfmorris.
 void paintClarifiers(java.awt.Graphics g)
           
 void propertyChange(java.beans.PropertyChangeEvent pve)
          This method gets called when a bound property gets changed.
protected  void removeAllElementListeners()
          Unregister all listeners registered through addElementListener
protected  void removeElementListener(java.lang.Object element)
          Add an element listener and remember the registration.
 void removeFromDiagram()
           
protected  void removeFromDiagramImpl()
           
 void renderingChanged()
          Rerenders the attached elements of the fig.
 void setDiElement(DiElement element)
          Set the associated Diagram Interchange element.
 void setFig(Fig f)
           
 void setItemUID(ItemUID newId)
          Setter for the UID
 void setLayer(Layer lay)
           
 void setLineColor(java.awt.Color c)
           
 void setOwner(java.lang.Object owner)
          Deprecated. for 0.27.3 by tfmorris. Set owner in constructor. This method is implemented in GEF, so we'll leave this implementation here to block any attempts to use it within ArgoUML.
 void setProject(Project project)
          Deprecated.  
 void setSettings(DiagramSettings renderSettings)
          Set the rendering settings to be used for this fig.
protected  void showHelp(java.lang.String s)
          Utility function to localize the given string with help text, and show it in the status bar of the ArgoUML window.
protected  void superRemoveFromDiagram()
           
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 updateElementListeners(java.util.Set<java.lang.Object[]> listenerSet)
          Update the set of registered listeners to match the given set using a minimal update strategy to remove unneeded listeners and add new listeners.
protected  void updateFont()
          This function should, for all FigTexts, recalculate the font-style (plain, bold, italic, bold/italic), and apply it by calling FigText.setFont().
protected  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.
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
 void vetoableChange(java.beans.PropertyChangeEvent pce)
           
 
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

FigEdgeModelElement

protected FigEdgeModelElement(java.lang.Object element,
                              DiagramSettings renderSettings)
Construct a new FigEdge. This method creates the name element that holds the name of the model element and adds itself as a listener. Also a stereotype is constructed.

This constructor is only intended for use by concrete subclasses.

Parameters:
element - owning uml element
renderSettings - rendering settings
Method Detail

makeEdgePort

public void makeEdgePort()
Create a FigCommentPort if needed


getEdgePort

public FigEdgePort getEdgePort()
Returns:
the FigCommentPort

setItemUID

public void setItemUID(ItemUID newId)
Setter for the UID

Specified by:
setItemUID in interface IItemUID
Parameters:
newId - the new UID

getItemUID

public ItemUID getItemUID()
Getter for the UID

Specified by:
getItemUID in interface IItemUID
Returns:
the UID

getTipString

public java.lang.String getTipString(java.awt.event.MouseEvent me)

getPopUpActions

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

getApplyStereotypeActions

protected javax.swing.Action[] getApplyStereotypeActions()
Get the set of Actions which valid for adding/removing Stereotypes on the ModelElement of this Fig's owner.

Returns:
array of Actions

getSquaredDistance

protected int getSquaredDistance(java.awt.Point p1,
                                 java.awt.Point p2)
distance formula: (x-h)^2 + (y-k)^2 = distance^2

Parameters:
p1 - point
p2 - point
Returns:
the square of the distance

paintClarifiers

public void paintClarifiers(java.awt.Graphics g)
Specified by:
paintClarifiers in interface Clarifiable
Parameters:
g - the Graphics object

indicateBounds

protected void indicateBounds(FigText f,
                              java.awt.Graphics g)
This is used to draw a box round the edge of any editable FigText annotations of the edge when the edge is selected. TODO: This logic probably belongs in our base selection class SelectionEdgeClarifiers and could be written to discover what FigText annotations exist rather than hard code in subclasses.

Parameters:
f - the fig to indicate the bounds of
g - the graphics

hitClarifier

public ToDoItem hitClarifier(int x,
                             int y)
The user clicked on the clarifier.

Parameters:
x - the x of the point clicked
y - the y of the point clicked
Returns:
the todo item clicked

makeSelection

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

getNameFig

protected FigText getNameFig()
Getter for name, the name Fig

Returns:
the nameFig

getNameBounds

public java.awt.Rectangle getNameBounds()
Get the Rectangle in which the model elements name is displayed

Returns:
the bounds of the namefig

getName

public java.lang.String getName()
Returns:
the text of the namefig

getStereotypeFig

protected FigStereotypesGroup getStereotypeFig()
Getter for stereo, the stereotype Fig

Returns:
the stereo Fig

vetoableChange

public void vetoableChange(java.beans.PropertyChangeEvent pce)
Specified by:
vetoableChange in interface java.beans.VetoableChangeListener

delayedVetoableChange

public void delayedVetoableChange(java.beans.PropertyChangeEvent pce)
Specified by:
delayedVetoableChange in interface DelayedVChangeListener
Parameters:
pce - the event

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pve)
This method gets called when a bound property gets changed. This may represent a UML element value from the Model subsystem, a GEF property, or something which ArgoUML itself implements.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
pve - the event containing the property change information
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

modelAttributeChanged

protected void modelAttributeChanged(AttributeChangeEvent ace)
Called whenever we receive an AttributeChangeEvent.

Parameters:
ace - the event

modelAssociationAdded

protected void modelAssociationAdded(AddAssociationEvent aae)
Called whenever we receive an AddAssociationEvent.

Parameters:
aae - the event

modelAssociationRemoved

protected void modelAssociationRemoved(RemoveAssociationEvent rae)
Called whenever we receive an RemoveAssociationEvent.

Parameters:
rae - the event

updateLayout

protected 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.

Parameters:
event - the UmlChangeEvent that caused the change

textEditStarted

protected void textEditStarted(FigText ft)
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.

Parameters:
ft - the FigText that will be edited and contains the start-text

showHelp

protected void showHelp(java.lang.String s)
Utility function to localize the given string with help text, and show it in the status bar of the ArgoUML window. This function is used in favour of the inline call to enable later improvements; e.g. it would be possible to show a help-balloon. TODO: Work this out. One matter to possibly improve: show multiple lines.

Parameters:
s - the given string to be localized and shown

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.

Parameters:
ft - the text Fig that has been edited

canEdit

protected boolean canEdit(Fig f)
Parameters:
f - the Fig
Returns:
true if editable

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent ke)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent ke)
Specified by:
keyTyped in interface java.awt.event.KeyListener

renderingChanged

public void renderingChanged()
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

modelChanged

protected void modelChanged(java.beans.PropertyChangeEvent e)
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.

Parameters:
e - the event

updateNameText

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


updateStereotypeText

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


initNotationProviders

protected void initNotationProviders(java.lang.Object own)
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

Parameters:
own - the current owner

getNotationProviderType

protected int getNotationProviderType()
Overrule this for subclasses that need a different NotationProvider.

Returns:
the type of the notation provider

updateListeners

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. 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.

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

setLayer

public void setLayer(Layer lay)

deleteFromModel

public void deleteFromModel()

notationChanged

@Deprecated
public void notationChanged(ArgoNotationEvent event)
Deprecated. for 0.27.2 by tfmorris. Changes to notation provider are now handled by the owning diagram.

Description copied from interface: ArgoNotationEventListener
Invoked when any aspect of the notation has been changed.

Specified by:
notationChanged in interface ArgoNotationEventListener
Parameters:
event - ArgoNotationEvent describing the change.
See Also:
ArgoNotationEventListener.notationChanged(org.argouml.application.events.ArgoNotationEvent)

notationAdded

@Deprecated
public void notationAdded(ArgoNotationEvent event)
Deprecated. for 0.27.2 by tfmorris.

Description copied from interface: ArgoNotationEventListener
Invoked when a notation has been added.

Specified by:
notationAdded in interface ArgoNotationEventListener
Parameters:
event - ArgoNotationEvent describing the added notation.
See Also:
ArgoNotationEventListener.notationAdded(org.argouml.application.events.ArgoNotationEvent)

notationRemoved

@Deprecated
public void notationRemoved(ArgoNotationEvent event)
Deprecated. for 0.27.2 by tfmorris.

Description copied from interface: ArgoNotationEventListener
Invoked when a notation has been removed.

Specified by:
notationRemoved in interface ArgoNotationEventListener
Parameters:
event - ArgoNotationEvent describing the removed notation.
See Also:
ArgoNotationEventListener.notationRemoved(org.argouml.application.events.ArgoNotationEvent)

notationProviderAdded

@Deprecated
public void notationProviderAdded(ArgoNotationEvent event)
Deprecated. for 0.27.2 by tfmorris.

Description copied from interface: ArgoNotationEventListener
Invoked when a notation provider has been added.

Specified by:
notationProviderAdded in interface ArgoNotationEventListener
Parameters:
event - ArgoNotationEvent describing the added notation provider.
See Also:
ArgoNotationEventListener.notationProviderAdded(org.argouml.application.events.ArgoNotationEvent)

notationProviderRemoved

@Deprecated
public void notationProviderRemoved(ArgoNotationEvent event)
Deprecated. for 0.27.2 by tfmorris.

Description copied from interface: ArgoNotationEventListener
Invoked when a notation provider has been removed.

Specified by:
notationProviderRemoved in interface ArgoNotationEventListener
Parameters:
event - ArgoNotationEvent describing the removed notation provider.
See Also:
ArgoNotationEventListener.notationProviderRemoved(org.argouml.application.events.ArgoNotationEvent)

hit

public boolean hit(java.awt.Rectangle r)

removeFromDiagram

public final void removeFromDiagram()

getRemoveDelegate

protected Fig getRemoveDelegate()
Subclasses should override this to redirect a remove request from one Fig to another. e.g. FigEdgeAssociationClass uses this to delegate the remove to its attached FigAssociationClass.

Returns:
the fig handling the remove

removeFromDiagramImpl

protected void removeFromDiagramImpl()

superRemoveFromDiagram

protected void superRemoveFromDiagram()

damage

public void damage()

determineFigNodes

protected boolean determineFigNodes()

Determines if the FigEdge is currently connected to the correct FigNodes, if not the edges is the correct FigNodes set and the edge rerouted.

Typically this is used when a user has amended from the property panel a relationship from one model element to another and the graph needs to react to that change.

e.g. if the participant of an association end is changed.

Calls a helper method (layoutThisToSelf) to avoid this edge disappearing if the new source and dest are the same node. TODO: This method is called far too frequently. It should only be called when a specific event is received. It seems to be currently called whenever any event is received from the owner.

Returns:
boolean whether or not the update was sucessful

getSource

protected java.lang.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.

Returns:
a model element

getSourceConnector

public java.lang.Object getSourceConnector()
Get the model element at the source end of the edge. This is not the same as the owner of the node at the source end, rather it is the element that connects the element of the edge to the element of the node. Mostly this returns null as the edge connects directly to the node but implementations such as the Fig for association will return an association end that connects the association to the classifier.

Returns:
the model element that connects the edge to the node (or null if the edge requires no such connector.

getDestinationConnector

public java.lang.Object getDestinationConnector()
Get the model element at the destination end of the edge. This is not the same as the owner of the node at the source end, rather it is the element that connects the element of the edge to the element of the node. Mostly this returns null as the edge connects directly to the node but implementations such as the Fig for association will return an association end that connects the association to the classifier.

Returns:
the model element that connects the edge to the node (or null if the edge requires no such connector.

getDestination

protected java.lang.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.

Returns:
a model element

allowRemoveFromDiagram

protected void allowRemoveFromDiagram(boolean allowed)
Parameters:
allowed - true if the function RemoveFromDiagram is allowed

setDiElement

public void setDiElement(DiElement element)
Set the associated Diagram Interchange element.

Parameters:
element - the element to be associated with this Fig

getDiElement

public DiElement getDiElement()
Returns:
the Diagram Interchange element associated with this Fig

getPopupAddOffset

protected static int getPopupAddOffset()
Returns:
Returns the popupAddOffset.

addElementListener

protected void addElementListener(java.lang.Object element)
Add an element listener and remember the registration.

Parameters:
element - element to listen for changes on
See Also:
ModelEventPump.addModelEventListener(PropertyChangeListener, Object, String)

addElementListener

protected void addElementListener(java.lang.Object element,
                                  java.lang.String property)
Add a listener and remember the registration.

Parameters:
element - element to listen for changes on
property - name of property to listen for changes of
See Also:
ModelEventPump.addModelEventListener(PropertyChangeListener, Object, String)

addElementListener

protected void addElementListener(java.lang.Object element,
                                  java.lang.String[] property)
Add a listener and remember the registration.

Parameters:
element - element to listen for changes on
property - array of property names (Strings) to listen for changes of
See Also:
ModelEventPump.addModelEventListener(PropertyChangeListener, Object, String)

removeElementListener

protected void removeElementListener(java.lang.Object element)
Add an element listener and remember the registration.

Parameters:
element - element to listen for changes on
See Also:
ModelEventPump.addModelEventListener(PropertyChangeListener, Object, String)

removeAllElementListeners

protected void removeAllElementListeners()
Unregister all listeners registered through addElementListener

See Also:
addElementListener(Object, String)

updateElementListeners

protected void updateElementListeners(java.util.Set<java.lang.Object[]> listenerSet)
Update the set of registered listeners to match the given set using a minimal update strategy to remove unneeded listeners and add new listeners.

Parameters:
listenerSet - a set of arrays containing a tuple of a UML element to be listened to and a set of property to be listened for.

setProject

@Deprecated
public void setProject(Project project)
Deprecated. 

This optional method is not implemented. It will throw an UnsupportedOperationException if used. Figs are added to a GraphModel which is, in turn, owned by a project.

Specified by:
setProject in interface ArgoFig
Parameters:
project - the project

getProject

@Deprecated
public Project getProject()
Deprecated. for 0.27.2 by tfmorris. Implementations should have all the information that they require in the DiagramSettings object.

Description copied from interface: ArgoFig
Get the owning project for this fig.

Specified by:
getProject in interface ArgoFig
Returns:
the owning project
See Also:
ArgoFig.getProject()

diagramFontChanged

@Deprecated
public void diagramFontChanged(ArgoDiagramAppearanceEvent e)
Deprecated. for 0.27.2 by tfmorris. Global rendering changes are now managed at the diagram level.

Handles diagram font changing.

Specified by:
diagramFontChanged in interface ArgoDiagramAppearanceEventListener
Parameters:
e - the event
See Also:
ArgoDiagramAppearanceEventListener.diagramFontChanged(org.argouml.application.events.ArgoDiagramAppearanceEvent)

updateFont

protected void updateFont()
This function should, for all FigTexts, recalculate the font-style (plain, bold, italic, bold/italic), and apply it by calling FigText.setFont().


getNameFigFontStyle

protected int getNameFigFontStyle()
Determines the font style based on the UML model. Overrule this in Figs that have to show bold or italic based on the UML model they represent. E.g. abstract classes show their name in italic.

Returns:
the font style for the nameFig.

getSettings

public DiagramSettings getSettings()
Specified by:
getSettings in interface ArgoFig
Returns:
the rendering settings for the Fig

setSettings

public void setSettings(DiagramSettings renderSettings)
Description copied from interface: ArgoFig
Set the rendering settings to be used for this fig. Currently this normally will be a diagram-wide or project-wide settings object that is shared by all Figs.

Specified by:
setSettings in interface ArgoFig
Parameters:
renderSettings - the rendering settings to use

getNotationSettings

protected NotationSettings getNotationSettings()
Returns:
the current notation settings

setLineColor

public void setLineColor(java.awt.Color c)

setFig

public void setFig(Fig f)

setOwner

@Deprecated
public void setOwner(java.lang.Object owner)
Deprecated. for 0.27.3 by tfmorris. Set owner in constructor. This method is implemented in GEF, so we'll leave this implementation here to block any attempts to use it within ArgoUML.

Setting the owner of the Fig must be done in the constructor and not changed afterwards for all ArgoUML figs.

Specified by:
setOwner in interface ArgoFig
Parameters:
owner - owning UML element
Throws:
java.lang.UnsupportedOperationException
See Also:
org.tigris.gef.presentation.Fig#setOwner(java.lang.Object)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook