org.argouml.uml.diagram.ui
Class FigAssociationClass

java.lang.Object
  extended byorg.tigris.gef.presentation.Fig
      extended byorg.tigris.gef.presentation.FigEdge
          extended byorg.tigris.gef.presentation.FigEdgePoly
              extended byorg.argouml.uml.diagram.ui.FigEdgeModelElement
                  extended byorg.argouml.uml.diagram.ui.FigAssociation
                      extended byorg.argouml.uml.diagram.ui.FigAssociationClass
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

public class FigAssociationClass
extends FigAssociation
implements VetoableChangeListener, DelayedVChangeListener, MouseListener, KeyListener, PropertyChangeListener

Class to display an association edge in an Association Class. It is considered the main Fig in the group of Figs that composes an Association Class. It must be associated with a FigEdgeAssociationClass and a FigClassAssociationClass.

This implementation is GEF-independent: Without changing GEF features, it is an edge and a node at the same time. The Association Class is composed of a FigAssociationClass (edge), a FigEdgeAssociationClass (linking edge) and a FigClassAssociationClass (node). The whole fig is built as an edge but is handled as a node to allow for example that an Association Class is bound to a Class with a simple association. The three Figs have the same rank.

To handle it, the restriction that must be fulfilled is that the FigClassAssociationClass must be always the first in the Editor's layer, and several methods are overridden and implemented: removeFromDiagram, damage, figdamaged, etc.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.tigris.gef.presentation.FigEdge
 
Field Summary
private  org.tigris.gef.presentation.FigCircle bigPort
           
private  boolean damageLock
           
private static int DISTANCE
           
private  FigEdgeAssociationClass edge
           
private  FigClassAssociationClass fig
           
private  org.tigris.gef.presentation.FigCircle head
           
private  int oldMax
           
private  int oldMin
           
 
Fields inherited from class org.argouml.uml.diagram.ui.FigAssociation
serialVersionUID
 
Fields inherited from class org.argouml.uml.diagram.ui.FigEdgeModelElement
BUNDLE, POPUP_ADD_OFFSET
 
Fields inherited from class org.tigris.gef.presentation.FigEdgePoly
_initiallyLaidOut
 
Fields inherited from class org.tigris.gef.presentation.FigEdge
_arrowHeadEnd, _arrowHeadStart, _destFigNode, _fig, _highlight, _pathItems, _sourceFigNode, _useNearest
 
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
FigAssociationClass()
          Construct a new AssociationClass.
FigAssociationClass(Object ed, org.tigris.gef.base.Layer lay)
          Construct a new AssociationClass.
 
Method Summary
 void calcBounds()
          Calculate the bounds.
protected  boolean canEdit(org.tigris.gef.presentation.Fig f)
           
 void damage()
           
 void figDamaged()
          This method should be called whenever a FigAssociationClass or a FigClassAssociationClass or a FigEdgeAssociationClass is damaged.
 void removeFromDiagram()
          It is used to remove itself and also its associated figs.
 void setFig(org.tigris.gef.presentation.Fig f)
           
 
Methods inherited from class org.argouml.uml.diagram.ui.FigAssociation
getMiddleGroup, getPopUpActions, modelChanged, paint, setOwner, textEdited, updateAbstract
 
Methods inherited from class org.argouml.uml.diagram.ui.FigEdgeModelElement
allowRemoveFromDiagram, delayedVetoableChange, deleteFromModel, finalize, getContextNotation, getDestination, getItalicLabelFont, getItemUID, getLabelFont, getNameFig, getSource, getSquaredDistance, getStereotypeFig, getTipString, hit, hitClarifier, keyPressed, keyReleased, keyTyped, makeSelection, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, postLoad, propertyChange, renderingChanged, setItemUID, updateClassifiers, updateNameText, updateStereotypeText, vetoableChange
 
Methods inherited from class org.tigris.gef.presentation.FigEdgePoly
computeRoute, findAvoidPt, insertPoint, layoutEdge, makeEdgeFig, moveVertex, routingRectPoint, segOK, setEndPoints, setInitiallyLaidOut, setPoint, tryRoute
 
Methods inherited from class org.tigris.gef.presentation.FigEdge
addPathItem, cleanUp, contains, getBetweenNearestPoints, getBounds, getBounds, getDashed, getDestArrowHead, getDestFigNode, getDestPortFig, getFig, getFirstPoint, getHighlight, getLastPoint, getLineColor, getLineWidth, getNumPoints, getPathItem, getPathItemFig, getPathItemFigs, getPathItemsRaw, getPerimeterLength, getPoint, getPoints, getPrivateData, getSourceArrowHead, getSourceFigNode, getSourcePortFig, getXs, getYs, hasFillColor, hitFig, intersects, isReshapable, isResizable, isRotatable, paintArrowHeads, paintHighlightLine, paintPathItems, removePathItem, removePathItem, setBetweenNearestPoints, setDashed, setDestArrowHead, setDestFigNode, setDestPortFig, setHighlight, setLineColor, setLineWidth, setNumPoints, setPoint, setPoints, setPoints, setPoints, setPrivateData, setSourceArrowHead, setSourceFigNode, setSourcePortFig, setXs, setYs, stuffPointAlongPerimeter, translateEdge, updatePathItemLocations
 
Methods inherited from class org.tigris.gef.presentation.Fig
addAnnotation, addPoint, addPropertyChangeListener, align, center, classNameAndBounds, clone, connectionPoint, contains, contains, countCornersContained, createDrag, delete, dispose, drawDashedLine, drawDashedPerimeter, endTrans, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getClosestPoint, getContext, getDashed01, getDashedString, getEnclosedFigs, getEnclosingFig, getFillColor, getFilled, getFilled01, getGravityPoints, getGroup, getHalfHeight, getHalfWidth, getHandleBox, getHeight, getId, getLayer, getLocation, getLocked, getMinimumSize, getOwner, getPreferredSize, getResource, getSingle, getSize, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getY, hasLineColor, initAnnotations, intersectsPerimeter, isAnnotation, isCopieable, isCopyable, isCutable, isDisplayed, isLowerRightResizable, isMovable, isSelected, isVisible, OK, pointAlongPerimeter, postSave, preSave, print, redraw, removeAnnotation, removeAnnotation, removePoint, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setBounds, setCenter, setContext, setDashedString, setDisplayed, setEnclosingFig, setFillColor, setFilled, setGroup, setHandleBox, setHeight, setLayer, setLocation, setLocation, setLocked, setMovable, setPoint, setPoint, setPoints, setPoints, setResizable, setResource, setSavingAllowed, setSelected, setSingle, setSize, setSize, setVisible, setVisState, setWidth, setX, setY, stuffBounds, translate, 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.beans.VetoableChangeListener
vetoableChange
 
Methods inherited from interface org.argouml.kernel.DelayedVChangeListener
delayedVetoableChange
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface org.tigris.gef.ui.Highlightable
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

DISTANCE

private static final int DISTANCE
See Also:
Constant Field Values

bigPort

private org.tigris.gef.presentation.FigCircle bigPort

head

private org.tigris.gef.presentation.FigCircle head

edge

private FigEdgeAssociationClass edge

fig

private FigClassAssociationClass fig

oldMin

private int oldMin

oldMax

private int oldMax

damageLock

private boolean damageLock
Constructor Detail

FigAssociationClass

public FigAssociationClass()
Construct a new AssociationClass. Use the same layout as for other edges.


FigAssociationClass

public FigAssociationClass(Object ed,
                           org.tigris.gef.base.Layer lay)
Construct a new AssociationClass. Use the same layout as for other edges.

Parameters:
ed - the edge
lay - the layer
Method Detail

setFig

public void setFig(org.tigris.gef.presentation.Fig f)
See Also:
FigEdge.setFig(org.tigris.gef.presentation.Fig)

canEdit

protected boolean canEdit(org.tigris.gef.presentation.Fig f)
Overrides:
canEdit in class FigEdgeModelElement
Parameters:
f - the Fig
Returns:
true if editable
See Also:
FigEdgeModelElement.canEdit(org.tigris.gef.presentation.Fig)

calcBounds

public void calcBounds()
Calculate the bounds.

See Also:
Fig.calcBounds()

damage

public void damage()
Overrides:
damage in class FigEdgeModelElement
See Also:
Fig.damage()

figDamaged

public void figDamaged()
This method should be called whenever a FigAssociationClass or a FigClassAssociationClass or a FigEdgeAssociationClass is damaged. It changes the position of these three Figs so that the FigClassAssociationClass is the first in the Editor's layer. Then the FigAssociationClass and finally the FigEdgeAssociationClass.


removeFromDiagram

public void removeFromDiagram()
It is used to remove itself and also its associated figs.

Overrides:
removeFromDiagram in class FigEdgeModelElement
See Also:
Fig.removeFromDiagram()


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