org.argouml.uml.diagram.ui
Class FigNodeModelElement

java.lang.Object
  extended byorg.tigris.gef.presentation.Fig
      extended byorg.tigris.gef.presentation.FigGroup
          extended byorg.tigris.gef.presentation.FigNode
              extended byorg.argouml.uml.diagram.ui.FigNodeModelElement
All Implemented Interfaces:
ArgoEventListener, ArgoNotationEventListener, Cloneable, org.tigris.gef.presentation.Connecter, DelayedVChangeListener, EventListener, org.tigris.gef.ui.Highlightable, KeyListener, MouseListener, NotationContext, org.tigris.gef.ui.PopupGenerator, PropertyChangeListener, Serializable, VetoableChangeListener
Direct Known Subclasses:
FigActor, FigClass, FigClassifierRole, FigComment, FigComponent, FigComponentInstance, FigInstance, FigInterface, FigMessage, FigMNode, FigMNodeInstance, FigNodeAssociation, FigNote, FigObject, FigObject, FigObjectFlowState, FigPackage, FigPartition, FigStateVertex, FigUseCase, ShadowComboBox.ShadowFig

public abstract class FigNodeModelElement
extends org.tigris.gef.presentation.FigNode
implements VetoableChangeListener, DelayedVChangeListener, MouseListener, KeyListener, PropertyChangeListener, NotationContext, ArgoNotationEventListener

Abstract class to display diagram icons for UML ModelElements that look like nodes and that have editable names and can be resized.

See Also:
Serialized Form

Nested Class Summary
(package private)  class FigNodeModelElement.ActionModifierAbstract
           
(package private)  class FigNodeModelElement.ActionModifierActive
           
(package private)  class FigNodeModelElement.ActionModifierLeaf
           
(package private)  class FigNodeModelElement.ActionModifierRoot
           
(package private)  class FigNodeModelElement.ActionVisibilityPrivate
           
(package private)  class FigNodeModelElement.ActionVisibilityProtected
           
(package private)  class FigNodeModelElement.ActionVisibilityPublic
           
 
Field Summary
protected static int ABSTRACT
          Used for #buildModifierPopUp().
protected static int ACTIVE
          Used for #buildModifierPopUp().
private  org.tigris.gef.presentation.Fig bigPort
           
private  int cachedHeight
           
private  int cachedWidth
           
private  boolean checkSize
          Needed for loading.
private  NotationName currentNotationName
           
private  Vector enclosedFigs
          enclosedFigs are the Figs that are enclosed by this figure.
private  org.tigris.gef.presentation.Fig encloser
          The figure enclosing this figure.
private static Font ITALIC_LABEL_FONT
           
private  ItemUID itemUid
           
private static Font LABEL_FONT
           
protected static int LEAF
          Used for #buildModifierPopUp().
private static Logger LOG
           
private  org.tigris.gef.presentation.FigText name
          use getNameFig() and setNameFig() to access the Figs.
protected static int POPUP_ADD_OFFSET
          Offset from the end of the set of popup actions at which new items should be inserted by concrete figures.
private  boolean readyToEdit
           
private  boolean removeFromDiagram
          Set the removeFromDiagram to false if this node may not be removed from the diagram.
protected static int ROOT
          Used for #buildModifierPopUp().
protected static int ROWHEIGHT
          min.
protected static int SHADOW_COLOR_ALPHA
          The transparency value of the shadow color (0-255).
protected static int SHADOW_COLOR_VALUE
          The intensity value of the shadow color (0-255).
private static ConvolveOp SHADOW_CONVOLVE_OP
           
private static LookupOp SHADOW_LOOKUP_OP
           
private  BufferedImage shadowImage
           
private  int shadowSize
           
private  org.tigris.gef.presentation.FigText stereo
          use getter/setter getStereotypeFig() and setStereoTypeFig() to access the Figs.
protected static int STEREOHEIGHT
          min.
private  boolean suppressCalcBounds
           
 
Fields inherited from class org.tigris.gef.presentation.FigNode
_blinkPorts, _highlight, ang135, ang225, ang315, ang45
 
Fields inherited from class org.tigris.gef.presentation.FigGroup
_dynObjects, _extraFrameSpace
 
Fields inherited from class org.tigris.gef.presentation.Fig
_allowsSaving, _context, _dashes, _dashPeriod, _dashStyle, _displayed, _fillColor, _filled, _group, _h, _layer, _lineColor, _lineWidth, _locked, _resource, _selected, _shown, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, MIN_SIZE
 
Constructor Summary
FigNodeModelElement()
          The main constructor.
FigNodeModelElement(org.tigris.gef.graph.GraphModel gm, Object node)
          Partially construct a new FigNode.
 
Method Summary
 void addEnclosedFig(org.tigris.gef.presentation.Fig fig)
           
 void addFig(org.tigris.gef.presentation.Fig f)
          Adds a fig to this FigNodeModelElement and removes it from the group it belonged to if any.
protected  void allowRemoveFromDiagram(boolean allowed)
           
protected  Object buildModifierPopUp(int items)
          Build a pop-up menu item for the various modifiers.
protected  Object buildVisibilityPopUp()
           
 void calcBounds()
           
 String classNameAndBounds()
          USED BY PGML.tee.
 Object clone()
          After the base clone method has been called determine which child figs of the clone represent the name, stereotype and port.
protected  void createFeatureIn(org.tigris.gef.presentation.FigGroup fg, InputEvent me)
          Create a new "feature" in the owner fig.
 void damage()
           
 void delayedVetoableChange(PropertyChangeEvent pce)
           
 void deleteFromModel()
           
 void displace(int xInc, int yInc)
          To redraw each element correctly when changing its location with X and U additions.
 void elementOrdering(Vector figures)
          Update the order of this fig and the order of the figs that are inside of this fig.
 void enableSizeChecking(boolean flag)
          The setter for checkSize.
 void finalize()
           
protected  org.tigris.gef.presentation.Fig getBigPort()
           
 NotationName getContextNotation()
          Returns the notation name for this fig.
 Vector getEnclosedFigs()
           
protected  org.tigris.gef.presentation.Fig getEncloser()
           
 org.tigris.gef.presentation.Fig getEnclosingFig()
           
static Font getItalicLabelFont()
           
 ItemUID getItemUID()
           
static Font getLabelFont()
           
 String getName()
          Get the name of the model element this Fig represents.
 org.tigris.gef.presentation.FigText getNameFig()
          Get the Fig that displays the model element name.
 Vector getPopUpActions(MouseEvent me)
           
 int getShadowSize()
           
 String getStereotype()
          Get the text describing the stereotype.
protected  org.tigris.gef.presentation.Fig getStereotypeFig()
          Get the Fig containing the stereotype.
protected  org.tigris.gef.presentation.FigText getStereotypeFigText()
          Get the FigText containing the stereotype.
 String getTipString(MouseEvent me)
           
 boolean hit(Rectangle r)
          Necessary since GEF contains some errors regarding the hit subject.
 ToDoItem hitClarifier(int x, int y)
           
protected  boolean isCheckSize()
           
protected  boolean isPartlyOwner(org.tigris.gef.presentation.Fig fig, Object o)
           
protected  boolean isPartlyOwner(Object o)
           
protected  boolean isReadyToEdit()
           
 void keyPressed(KeyEvent ke)
           
 void keyReleased(KeyEvent ke)
           
 void keyTyped(KeyEvent ke)
           
 org.tigris.gef.base.Selection makeSelection()
           
protected  void modelChanged(PropertyChangeEvent mee)
          This is called after any part of the UML MModelElement has changed.
 void mouseClicked(MouseEvent me)
          If the user double clicks on any part of this FigNode, pass it down to one of the internal Figs.
 void notationAdded(ArgoNotationEvent event)
          Invoked when a notation has been added.
 void notationChanged(ArgoNotationEvent event)
          Invoked when any aspect of the notation has been changed.
 void notationProviderAdded(ArgoNotationEvent event)
          Invoked when a notation provider has been added.
 void notationProviderRemoved(ArgoNotationEvent event)
          Invoked when a notation provider has been removed.
 void notationRemoved(ArgoNotationEvent event)
          Invoked when a notation has been removed.
 void paint(Graphics g)
          Overridden to paint shadows.
 void paintClarifiers(Graphics g)
          Displays visual indications of pending ToDoItems.
 String placeString()
          Default Reply text to be shown while placing node in diagram.
 void postLoad()
           
 void propertyChange(PropertyChangeEvent pve)
           
 void redrawEnclosedFigs()
          Method to draw a StateVertex Fig's enclosed figs.
 void removeEnclosedFig(org.tigris.gef.presentation.Fig fig)
           
 void removeFromDiagram()
           
 void renderingChanged()
          Rerenders the fig if needed.
protected  void setBigPort(org.tigris.gef.presentation.Fig bp)
           
protected  void setEncloser(org.tigris.gef.presentation.Fig e)
           
 void setEnclosingFig(org.tigris.gef.presentation.Fig newEncloser)
          Updates the modelelement container if the fig is moved in or out another fig.
 void setItemUID(ItemUID id)
           
 void setName(String n)
          Change the name of the model element this Fig represents.
protected  void setNameFig(org.tigris.gef.presentation.FigText fig)
          Set the Fig that displays the model element name.
 void setOwner(Object own)
           
protected  void setReadyToEdit(boolean v)
           
 void setShadowSize(int size)
           
 void setStereotype(String stereotype)
          Set the text describing the stereotype.
protected  void setStereotypeFig(org.tigris.gef.presentation.Fig fig)
          Set the Fig containing the stereotype.
protected  void setSuppressCalcBounds(boolean scb)
           
protected  void textEdited(org.tigris.gef.presentation.FigText ft)
          This method is called after the user finishes editing a text field that is in the FigNodeModelElement.
protected  void updateBounds()
          set some new bounds.
protected  Dimension updateFigGroupSize(org.tigris.gef.presentation.FigGroup fg, int x, int y, int w, int h)
          Returns the new size of the FigGroup (either attributes or operations) after calculation new bounds for all sub-figs, considering their minimal sizes; FigGroup need not be displayed; no update event is fired.
protected  void updateListeners(Object newOwner)
          Implementations of this method should register/unregister the fig for all (model)events.
protected  void updateNameText()
          Updates the text of the name FigText.
protected  void updateStereotypeText()
          Updates the text of the sterotype FigText.
 void vetoableChange(PropertyChangeEvent pce)
           
 
Methods inherited from class org.tigris.gef.presentation.FigNode
addFigEdge, bindPort, cleanUp, contains, deepHitPort, delete, dispose, endTrans, getBlinkPorts, getFigEdges, getFigEdges, getHighlight, getPortFig, getPortFigs, getPortSector, hidePorts, hitPort, hitPort, isBlinkPorts, isDragConnectable, mouseEntered, mouseExited, mousePressed, mouseReleased, removeFigEdge, removePort, setBlinkPorts, setBounds, setHighlight, showPorts, superTranslate, translate, updateEdges
 
Methods inherited from class org.tigris.gef.presentation.FigGroup
addFigs, deepSelect, elements, getDisplayedFigs, getExtraFrameSpace, getFigAt, getFigs, getFigs, getFont, getFontFamily, getFontSize, getPrivateData, getSize, getSubFigBounds, getTextColor, getTextFillColor, getTextFilled, hitFig, isReshapable, isRotatable, iterator, parseDynObjects, removeAll, removeFig, setExtraFrameSpace, setFigs, setFigs, setFillColor, setFilled, setFont, setFontFamily, setFontSize, setLineColor, setLineWidth, setPrivateData, setTextColor, setTextFillColor, setTextFilled
 
Methods inherited from class org.tigris.gef.presentation.Fig
addAnnotation, addPoint, addPropertyChangeListener, align, center, connectionPoint, contains, contains, countCornersContained, createDrag, drawDashedLine, drawDashedPerimeter, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getBounds, getBounds, getClosestPoint, getContext, getDashed, getDashed01, getDashedString, getFillColor, getFilled, getFilled01, getFirstPoint, getGravityPoints, getGroup, getHalfHeight, getHalfWidth, getHandleBox, getHeight, getId, getLastPoint, getLayer, getLineColor, getLineWidth, getLocation, getLocked, getMinimumSize, getNumPoints, getOwner, getPerimeterLength, getPoint, getPoints, getPreferredSize, getResource, getSingle, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getXs, getY, getYs, hasFillColor, hasLineColor, initAnnotations, insertPoint, intersects, intersectsPerimeter, isAnnotation, isCopieable, isCopyable, isCutable, isDisplayed, isLowerRightResizable, isMovable, isResizable, isSelected, isVisible, OK, pointAlongPerimeter, postSave, preSave, print, redraw, removeAnnotation, removeAnnotation, removePoint, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setCenter, setContext, setDashed, setDashedString, setDisplayed, setGroup, setHandleBox, setHeight, setLayer, setLocation, setLocation, setLocked, setMovable, setNumPoints, setPoint, setPoint, setPoint, setPoint, setPoints, setPoints, setPoints, setPoints, setPoints, setResizable, setResource, setSavingAllowed, setSelected, setSingle, setSize, setSize, setVisible, setVisState, setWidth, setX, setXs, setY, setYs, stuffBounds, stuffPointAlongPerimeter, translateAnnotations, unsetAnnotationOwner, updateAnnotationPositions, updateVisState, within
 
Methods inherited from class java.lang.Object
equals, 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.tigris.gef.ui.Highlightable
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

LOG

private static final Logger LOG

currentNotationName

private NotationName currentNotationName

LABEL_FONT

private static final Font LABEL_FONT

ITALIC_LABEL_FONT

private static final Font ITALIC_LABEL_FONT

ROWHEIGHT

protected static final int ROWHEIGHT
min. 17, used to calculate y pos of FigText items in a compartment

See Also:
Constant Field Values

STEREOHEIGHT

protected static final int STEREOHEIGHT
min. 18, used to calculate y pos of stereotype FigText items in a compartment

See Also:
Constant Field Values

checkSize

private boolean checkSize
Needed for loading. Warning: if false, a too small size might look bad!


POPUP_ADD_OFFSET

protected static final int POPUP_ADD_OFFSET
Offset from the end of the set of popup actions at which new items should be inserted by concrete figures. See #getPopUpActions()

See Also:
Constant Field Values

shadowImage

private BufferedImage shadowImage

cachedWidth

private int cachedWidth

cachedHeight

private int cachedHeight

SHADOW_LOOKUP_OP

private static final LookupOp SHADOW_LOOKUP_OP

SHADOW_CONVOLVE_OP

private static final ConvolveOp SHADOW_CONVOLVE_OP

SHADOW_COLOR_VALUE

protected static final int SHADOW_COLOR_VALUE
The intensity value of the shadow color (0-255).

See Also:
Constant Field Values

SHADOW_COLOR_ALPHA

protected static final int SHADOW_COLOR_ALPHA
The transparency value of the shadow color (0-255).

See Also:
Constant Field Values

ROOT

protected static final int ROOT
Used for #buildModifierPopUp().

See Also:
Constant Field Values

ABSTRACT

protected static final int ABSTRACT
Used for #buildModifierPopUp().

See Also:
Constant Field Values

LEAF

protected static final int LEAF
Used for #buildModifierPopUp().

See Also:
Constant Field Values

ACTIVE

protected static final int ACTIVE
Used for #buildModifierPopUp().

See Also:
Constant Field Values

bigPort

private org.tigris.gef.presentation.Fig bigPort

name

private org.tigris.gef.presentation.FigText name
use getNameFig() and setNameFig() to access the Figs. Use getName() and setName() to just change the text.


stereo

private org.tigris.gef.presentation.FigText stereo
use getter/setter getStereotypeFig() and setStereoTypeFig() to access the Figs. Use getStereotype() and setStereotype() to change stereotype text. MVW: Why are the getter/setter not returning a FigText, but a Fig? I created a new (real) getter: getStereotypeFigText()


enclosedFigs

private Vector enclosedFigs
enclosedFigs are the Figs that are enclosed by this figure. Say that it is a Package then these are the Classes, Interfaces, Packages etc that are on this figure. This is not the same as the figures in the FigGroup that this FigNodeModelElement "is", since these are the figures that make up this high-level primitive figure.


encloser

private org.tigris.gef.presentation.Fig encloser
The figure enclosing this figure.


readyToEdit

private boolean readyToEdit

suppressCalcBounds

private boolean suppressCalcBounds

shadowSize

private int shadowSize

itemUid

private ItemUID itemUid

removeFromDiagram

private boolean removeFromDiagram
Set the removeFromDiagram to false if this node may not be removed from the diagram.

Constructor Detail

FigNodeModelElement

public FigNodeModelElement()
The main constructor.


FigNodeModelElement

public FigNodeModelElement(org.tigris.gef.graph.GraphModel gm,
                           Object node)
Partially construct a new FigNode. This method creates the name element that holds the name of the model element and adds itself as a listener.

Parameters:
gm - ignored
node - the owning UML element
Method Detail

finalize

public void finalize()
See Also:
Object.finalize()

classNameAndBounds

public String classNameAndBounds()
USED BY PGML.tee.

See Also:
org.tigris.gef.presentation.Fig#getNameAndBounds()

clone

public Object clone()
After the base clone method has been called determine which child figs of the clone represent the name, stereotype and port.

The clone function is used by Copy/Paste operations.

See Also:
Object.clone()

placeString

public String placeString()
Default Reply text to be shown while placing node in diagram. Overrule this when the text is not "new [UMLClassName]".

Returns:
the text to be shown while placing node in diagram

setItemUID

public void setItemUID(ItemUID id)
Parameters:
id - UID

getItemUID

public ItemUID getItemUID()
Returns:
UID

getNameFig

public org.tigris.gef.presentation.FigText getNameFig()
Get the Fig that displays the model element name.

Returns:
the name Fig

setNameFig

protected void setNameFig(org.tigris.gef.presentation.FigText fig)
Set the Fig that displays the model element name.

Parameters:
fig - the name Fig

getName

public String getName()
Get the name of the model element this Fig represents.

Returns:
the name of the model element

setName

public void setName(String n)
Change the name of the model element this Fig represents.

Parameters:
n - the name of the model element

getPopUpActions

public Vector getPopUpActions(MouseEvent me)
Specified by:
getPopUpActions in interface org.tigris.gef.ui.PopupGenerator
See Also:
PopupGenerator.getPopUpActions(java.awt.event.MouseEvent)

buildVisibilityPopUp

protected Object buildVisibilityPopUp()
Returns:
the pop-up menu item for Visibility

buildModifierPopUp

protected Object buildModifierPopUp(int items)
Build a pop-up menu item for the various modifiers.

This function is designed to be easily extendable with new items.

Parameters:
items - bitwise OR of the items: ROOT, ABSTRACT, LEAF, ACTIVE.
Returns:
the menu item

getEnclosingFig

public org.tigris.gef.presentation.Fig getEnclosingFig()
See Also:
Fig.getEnclosingFig()

setEnclosingFig

public void setEnclosingFig(org.tigris.gef.presentation.Fig newEncloser)
Updates the modelelement container if the fig is moved in or out another fig. If this fig doesn't have an enclosing fig anymore, the namespace of the diagram will be the owning modelelement. If this fig is moved inside another FigNodeModelElement the owner of that fignodemodelelement will be the owning modelelement.

See Also:
Fig.setEnclosingFig(Fig)

addEnclosedFig

public void addEnclosedFig(org.tigris.gef.presentation.Fig fig)
Parameters:
fig - The fig to be added

removeEnclosedFig

public void removeEnclosedFig(org.tigris.gef.presentation.Fig fig)
Parameters:
fig - The Fig to be removed

getEnclosedFigs

public Vector getEnclosedFigs()
See Also:
Fig.getEnclosedFigs()

elementOrdering

public void elementOrdering(Vector figures)
Update the order of this fig and the order of the figs that are inside of this fig.

Parameters:
figures - in the new order

makeSelection

public org.tigris.gef.base.Selection makeSelection()
See Also:
Fig.makeSelection()

paint

public void paint(Graphics g)
Overridden to paint shadows. This method supports painting shadows for any FigNodeModelElement. Any Figs that are nested within the FigNodeModelElement will be shadowed.

TODO: If g is not a Graphics2D shadows cannot be painted. This is a problem when saving the diagram as SVG.

Parameters:
g - is a Graphics that we paint this object on.

paintClarifiers

public void paintClarifiers(Graphics g)
Displays visual indications of pending ToDoItems. Please note that the list of advices (ToDoList) is not the same as the list of element known by the FigNode (_figs). Therefore, it is necessary to check if the graphic item exists before drawing on it. See ClAttributeCompartment for an example.

See Also:
ClAttributeCompartment

hitClarifier

public ToDoItem hitClarifier(int x,
                             int y)
Parameters:
x - the x of the hit
y - the y of the hit
Returns:
the todo item of which the clarifier has been hit

getTipString

public String getTipString(MouseEvent me)
See Also:
Fig.getTipString(java.awt.event.MouseEvent)

vetoableChange

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

delayedVetoableChange

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

updateBounds

protected void updateBounds()
set some new bounds.


propertyChange

public void propertyChange(PropertyChangeEvent pve)
Specified by:
propertyChange in interface PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

textEdited

protected void textEdited(org.tigris.gef.presentation.FigText ft)
                   throws PropertyVetoException
This method is called after the user finishes editing a text field that is in the FigNodeModelElement. Determine which field and update the model. This class handles the name, subclasses should override to handle other text elements.

Parameters:
ft - the FigText that has been edited and contains the new text
Throws:
PropertyVetoException - thrown when new text represents an unacceptable value

mouseClicked

public void mouseClicked(MouseEvent me)
If the user double clicks on any part of this FigNode, pass it down to one of the internal Figs. This allows the user to initiate direct text editing.

Specified by:
mouseClicked in interface MouseListener
See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)

keyPressed

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

keyReleased

public void keyReleased(KeyEvent ke)
Specified by:
keyReleased in interface KeyListener
See Also:
not used, do nothing.

keyTyped

public void keyTyped(KeyEvent ke)
Specified by:
keyTyped in interface KeyListener
See Also:
not used, do nothing.

modelChanged

protected void modelChanged(PropertyChangeEvent mee)
This is called after any part of the UML MModelElement has changed. This method automatically updates the name FigText. Subclasses should override and update other parts.

Parameters:
mee - the ModelElementEvent that caused the change

createFeatureIn

protected void createFeatureIn(org.tigris.gef.presentation.FigGroup fg,
                               InputEvent me)
Create a new "feature" in the owner fig. must be overridden to make sense (I didn't want to make it abstract because it might not be required)

Parameters:
fg - The fig group to which this applies
me - The input event that triggered us. In the current implementation a mouse double click.

isPartlyOwner

protected boolean isPartlyOwner(Object o)
Parameters:
o - the given object
Returns:
true if one of my figs has the given object as owner

isPartlyOwner

protected boolean isPartlyOwner(org.tigris.gef.presentation.Fig fig,
                                Object o)
Parameters:
fig - the given fig (may be a group)
o - the given object
Returns:
true if one of the given figs has the given object as owner

deleteFromModel

public void deleteFromModel()
See Also:
Fig.deleteFromModel()

setOwner

public void setOwner(Object own)
See Also:
Fig.setOwner(java.lang.Object)

updateStereotypeText

protected void updateStereotypeText()
Updates the text of the sterotype FigText. Override in subclasses to get wanted behaviour. TODO: remove all 'misuses' of the stereotype figtexts (like in FigInterface)


updateNameText

protected void updateNameText()
Updates the text of the name FigText.


updateListeners

protected void updateListeners(Object newOwner)
Implementations of this method should register/unregister the fig for all (model)events. For FigNodeModelElement only the fig itself is registred as listening to 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.

Parameters:
newOwner - the new owner for the listeners

getContextNotation

public NotationName getContextNotation()
Returns the notation name for this fig. First start to implement notations on a per fig basis.

Specified by:
getContextNotation in interface NotationContext
Returns:
null if the context does not wish to name a specific notation
See Also:
NotationContext.getContextNotation()

notationChanged

public void notationChanged(ArgoNotationEvent event)
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

public void notationAdded(ArgoNotationEvent event)
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

public void notationRemoved(ArgoNotationEvent event)
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

public void notationProviderAdded(ArgoNotationEvent event)
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

public void notationProviderRemoved(ArgoNotationEvent event)
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)

renderingChanged

public void renderingChanged()
Rerenders the fig if needed. This functionality was originally the functionality of modelChanged but modelChanged takes the event now into account.


calcBounds

public void calcBounds()
See Also:
Fig.calcBounds()

enableSizeChecking

public void enableSizeChecking(boolean flag)
The setter for checkSize.

Parameters:
flag - the new value

updateFigGroupSize

protected Dimension updateFigGroupSize(org.tigris.gef.presentation.FigGroup fg,
                                       int x,
                                       int y,
                                       int w,
                                       int h)
Returns the new size of the FigGroup (either attributes or operations) after calculation new bounds for all sub-figs, considering their minimal sizes; FigGroup need not be displayed; no update event is fired.

This method has side effects that are sometimes used.

Parameters:
fg - the FigGroup to be updated
x - x
y - y
w - w
h - h
Returns:
the new dimension

setShadowSize

public void setShadowSize(int size)
Parameters:
size - the new shadow size

getShadowSize

public int getShadowSize()
Returns:
the current shadow size

hit

public boolean hit(Rectangle r)
Necessary since GEF contains some errors regarding the hit subject.

See Also:
Fig.hit(Rectangle)

removeFromDiagram

public void removeFromDiagram()
See Also:
Fig.removeFromDiagram()

damage

public void damage()
See Also:
Fig.damage()

postLoad

public void postLoad()
See Also:
Fig.postLoad()

addFig

public void addFig(org.tigris.gef.presentation.Fig f)
Adds a fig to this FigNodeModelElement and removes it from the group it belonged to if any. Correction to the GEF implementation that does not handle the double association correctly.

See Also:
TODO: remove this once GEF0.10 is in place and tested

setStereotypeFig

protected void setStereotypeFig(org.tigris.gef.presentation.Fig fig)
Set the Fig containing the stereotype.

Parameters:
fig - the stereotype Fig

getStereotypeFig

protected org.tigris.gef.presentation.Fig getStereotypeFig()
Get the Fig containing the stereotype.

Returns:
the stereotype Fig

getStereotypeFigText

protected org.tigris.gef.presentation.FigText getStereotypeFigText()
Get the FigText containing the stereotype.

Returns:
the stereotype FigText

setStereotype

public void setStereotype(String stereotype)
Set the text describing the stereotype.

Parameters:
stereotype - the stereotype text

getStereotype

public String getStereotype()
Get the text describing the stereotype.

Returns:
the stereotype text

getLabelFont

public static Font getLabelFont()
Returns:
Returns the lABEL_FONT.

getItalicLabelFont

public static Font getItalicLabelFont()
Returns:
Returns the iTALIC_LABEL_FONT.

setBigPort

protected void setBigPort(org.tigris.gef.presentation.Fig bp)
Parameters:
bp - The _bigPort to set.

getBigPort

protected org.tigris.gef.presentation.Fig getBigPort()
Returns:
Returns the _bigPort.

isCheckSize

protected boolean isCheckSize()
Returns:
Returns the checkSize.

setEncloser

protected void setEncloser(org.tigris.gef.presentation.Fig e)
Parameters:
e - The _encloser to set.

getEncloser

protected org.tigris.gef.presentation.Fig getEncloser()
Returns:
Returns the _encloser.

isReadyToEdit

protected boolean isReadyToEdit()
Returns:
Returns the ReadyToEdit.

setReadyToEdit

protected void setReadyToEdit(boolean v)
Parameters:
v - if ready to edit

setSuppressCalcBounds

protected void setSuppressCalcBounds(boolean scb)
Parameters:
scb - The suppressCalcBounds to set.

redrawEnclosedFigs

public void redrawEnclosedFigs()
Method to draw a StateVertex Fig's enclosed figs.


displace

public void displace(int xInc,
                     int yInc)
To redraw each element correctly when changing its location with X and U additions.

Parameters:
xInc - the increment in the x direction
yInc - the increment in the y direction

allowRemoveFromDiagram

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


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook