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

java.lang.Object
  extended by FigNode
      extended by org.argouml.uml.diagram.ui.FigNodeModelElement
          extended by org.argouml.uml.diagram.deployment.ui.AbstractFigNode
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:
FigMNode, FigNodeInstance

public abstract class AbstractFigNode
extends FigNodeModelElement

Introduce abstract superclass for FigMNode & FigNodeInstance so that we can do proper inheritance.


Field Summary
protected static int DEPTH
          Offset in x & y for depth perspective lines of cube.
 
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
AbstractFigNode(java.lang.Object owner, java.awt.Rectangle bounds, DiagramSettings settings)
          Construct a new AbstractFigNode.
 
Method Summary
 java.lang.Object clone()
          Clone this figure.
 java.awt.Point getClosestPoint(java.awt.Point anotherPt)
           
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of the Fig.
 boolean getUseTrapRect()
           
 boolean isFilled()
           
 Selection makeSelection()
           
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 mouseClicked(java.awt.event.MouseEvent me)
           
 void setEnclosingFig(Fig encloser)
           
 void setFilled(boolean f)
           
 void setLineColor(java.awt.Color c)
           
 void setLineWidth(int w)
           
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, moveIntoComponent, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, placeString, propertyChange, removeAllElementListeners, removeElementListener, removeEnclosedFig, removeFromDiagram, removeFromDiagramImpl, renderingChanged, setBigPort, setBoundsImpl, setDiElement, setEditable, setEncloser, setItemUID, setLayer, 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
 

Field Detail

DEPTH

protected static final int DEPTH
Offset in x & y for depth perspective lines of cube. TODO: This is the same value as the member 'D'in org.tigris.gef.presentation.FigCube, but there is nothing enforcing that correspondence. Things will probably break if they don't match.

See Also:
Constant Field Values
Constructor Detail

AbstractFigNode

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

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()

setLineColor

public void setLineColor(java.awt.Color c)

setLineWidth

public void setLineWidth(int w)
Overrides:
setLineWidth in class FigNodeModelElement

isFilled

public boolean isFilled()

setFilled

public void setFilled(boolean f)

makeSelection

public Selection makeSelection()
Overrides:
makeSelection in class FigNodeModelElement

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)

mouseClicked

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

setEnclosingFig

public void setEnclosingFig(Fig encloser)
Overrides:
setEnclosingFig in class FigNodeModelElement

getUseTrapRect

public boolean getUseTrapRect()

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.

getClosestPoint

public java.awt.Point getClosestPoint(java.awt.Point anotherPt)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook