org.argouml.uml.diagram.deployment.ui
Class AbstractFigComponent

java.lang.Object
  extended by FigNode
      extended by org.argouml.uml.diagram.ui.FigNodeModelElement
          extended by org.argouml.uml.diagram.deployment.ui.AbstractFigComponent
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, DiagramElement, PathContainer, ArgoFig, Clarifiable, StereotypeStyled, IItemUID
Direct Known Subclasses:
FigComponent, FigComponentInstance

public abstract class AbstractFigComponent
extends FigNodeModelElement

Common abstract superclass for FigComponent and FigComponentInstance to encapsulate common behavior.


Field Summary
 
Fields inherited from class org.argouml.uml.diagram.ui.FigNodeModelElement
ABSTRACT, ACTIVE, invisibleAllowed, LEAF, NAME_FIG_HEIGHT, NAME_V_PADDING, ROOT, WIDTH
 
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
AbstractFigComponent(java.lang.Object owner, java.awt.Rectangle bounds, DiagramSettings settings)
          Construct a new AbstractFigComponent.
 
Method Summary
 java.lang.Object clone()
          Clone this figure.
 java.awt.Rectangle getHandleBox()
           
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of the Fig.
 boolean getUseTrapRect()
           
protected  void modelChanged(java.beans.PropertyChangeEvent mee)
          This is a template method called by the ArgoUML framework as the result of a change to a model element.
 void setHandleBox(int x, int y, int w, int h)
           
 void setLineColor(java.awt.Color c)
           
protected  void setStandardBounds(int x, int y, int w, int h)
          Replaces FigNodeModelElement.setBoundsImpl(int, int, int, int).
protected  void updateListeners(java.lang.Object oldOwner, java.lang.Object newOwner)
          Implementations of this method should register/unregister the fig for all (model)events.
 
Methods inherited from class org.argouml.uml.diagram.ui.FigNodeModelElement
addElementListener, addElementListener, addElementListener, addEnclosedFig, allowRemoveFromDiagram, bindPort, buildModifierPopUp, buildShowPopUp, buildVisibilityPopUp, calcBounds, classNameAndBounds, createBigPortFig, createContainedModelElement, createStereotypeFig, delayedVetoableChange, deleteFromModel, determineDefaultPathVisible, diagramFontChanged, displace, enableSizeChecking, getBigPort, getDiElement, getEnclosedFigs, getEncloser, getEnclosingFig, getItemUID, getName, getNameBounds, getNameFig, getNameFigFontStyle, getNotationProviderType, getNotationSettings, getPopUpActions, getPopupAddOffset, getProject, getRemoveDelegate, getSettings, getStereotypeCount, getStereotypeFig, getStereotypeStyle, getStereotypeView, getTipString, hit, hitClarifier, initNotationProviders, isCheckSize, isDragConnectable, isEditable, isPartlyOwner, isPartlyOwner, isPathVisible, isReadyToEdit, isSingleTarget, keyPressed, keyReleased, keyTyped, makeSelection, mouseClicked, moveIntoComponent, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, placeString, propertyChange, removeAllElementListeners, removeElementListener, removeEnclosedFig, removeFromDiagram, removeFromDiagramImpl, renderingChanged, setBigPort, setBoundsImpl, setDiElement, setEditable, setEncloser, setEnclosingFig, setItemUID, setLayer, setLineWidth, setName, setNameFig, setOwner, setPathVisible, setProject, setReadyToEdit, setSettings, setStereotypeStyle, setStereotypeView, setSuppressCalcBounds, setVisible, showHelp, textEdited, textEditStarted, updateBounds, updateElementListeners, updateFont, updateLayout, updateNameText, updateStereotypeIcon, updateStereotypeText, vetoableChange
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.MouseListener
mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from interface org.argouml.cognitive.Highlightable
getHighlight, setHighlight
 

Constructor Detail

AbstractFigComponent

public AbstractFigComponent(java.lang.Object owner,
                            java.awt.Rectangle bounds,
                            DiagramSettings settings)
Construct a new AbstractFigComponent.

Parameters:
owner - owning UML element
bounds - position and size
settings - render settings
Method Detail

clone

public java.lang.Object clone()
Description copied from class: FigNodeModelElement
Clone this figure. After the base clone method has been called determine which child figs of the clone represent the name, stereotype and port.

TODO: enclosedFigs, encloser and eventSenders may also need to be cloned.

Overrides:
clone in class FigNodeModelElement
Returns:
the cloned figure
See Also:
Object.clone()

modelChanged

protected void modelChanged(java.beans.PropertyChangeEvent mee)
Description copied from class: FigNodeModelElement
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 change what model elements the FigNode is listening to as a result of change to the model.

This method is guaranteed by the framework to be running on the same thread as the model subsystem.

TODO: Lets refactor this at some time to take UmlChangeEvent argument

Overrides:
modelChanged in class FigNodeModelElement
Parameters:
mee - the UmlChangeEvent that caused the change

updateListeners

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

An explanation of the original purpose of this method is given in issue 1321.

This function is used by the modelChanged() function.

In certain cases, it is imperative that indeed ALL listeners are updated, since they are ALL removed by a call to removeElementListener.

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 FigNodeModelElement
Parameters:
oldOwner - null, or the previous owner The former means that all listeners have to be set.
newOwner - null, or the owner of this. The former means that all listeners have to be removed.

setLineColor

public void setLineColor(java.awt.Color c)

getMinimumSize

public java.awt.Dimension getMinimumSize()
Description copied from class: FigNodeModelElement
Returns the minimum size of the Fig. This is the smallest size that the user can make this Fig by dragging.

Do not call this function if the Fig is not resizable! In ArgoUML we decided that it is not needed to implement suitable getMinimumSize() methods for Figs that are not resizable.

Overrides:
getMinimumSize in class FigNodeModelElement

setStandardBounds

protected void setStandardBounds(int x,
                                 int y,
                                 int w,
                                 int h)
Description copied from class: FigNodeModelElement
Replaces FigNodeModelElement.setBoundsImpl(int, int, int, int).

Overrides:
setStandardBounds in class FigNodeModelElement
Parameters:
x - Desired X coordinate of upper left corner
y - Desired Y coordinate of upper left corner
w - Desired width of the FigClass
h - Desired height of the FigClass
See Also:
org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)

getUseTrapRect

public boolean getUseTrapRect()

getHandleBox

public java.awt.Rectangle getHandleBox()

setHandleBox

public void setHandleBox(int x,
                         int y,
                         int w,
                         int h)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook