org.argouml.uml.diagram.static_structure.ui
Class FigClassifierBox

java.lang.Object
  extended by FigNode
      extended by org.argouml.uml.diagram.ui.FigNodeModelElement
          extended by org.argouml.uml.diagram.ui.FigCompartmentBox
              extended by org.argouml.uml.diagram.static_structure.ui.FigClassifierBox
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, OperationsCompartmentContainer, PathContainer, ArgoFig, Clarifiable, StereotypeStyled, IItemUID
Direct Known Subclasses:
FigClassifierBoxWithAttributes, FigDataType, FigInterface

public abstract class FigClassifierBox
extends FigCompartmentBox
implements OperationsCompartmentContainer

Class to display graphics for any UML Classifier in a diagram.

This abstract Fig adds an Operations compartment.


Field Summary
 
Fields inherited from class org.argouml.uml.diagram.ui.FigCompartmentBox
containerBox, DEFAULT_COMPARTMENT_BOUNDS
 
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
FigClassifierBox(java.lang.Object owner, java.awt.Rectangle bounds, DiagramSettings settings)
          Construct a Fig with owner, bounds, and settings.
 
Method Summary
protected  ArgoJMenu buildAddMenu()
           
protected  java.lang.Object buildModifierPopUp()
           
protected  ArgoJMenu buildShowPopUp()
           
 java.lang.String classNameAndBounds()
          USED BY PGML.tee.
 java.lang.Object clone()
          Clone this figure.
 java.awt.Rectangle getAttributesBounds()
          Deprecated. by Bob Tarling in 0.29.2 use getCompartment(Model.getMetaTypes().getAttribute()).getBounds()
protected  FigAttributesCompartment getAttributesFig()
          Deprecated. in 0.29.1 use getCompartment(Model.getUmlFactory(Model.getMetaTypes(),getAttribute())) to determine if an attribute compartment exists and return it. The attributesCompartment should be created by the concrete class
 java.awt.Rectangle getOperationsBounds()
          Get the bounds of the operations compartment.
protected  FigOperationsCompartment getOperationsFig()
           
 java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
          Build a collection of menu items relevant for a right-click popup menu on an Interface.
 boolean isAttributesVisible()
          Deprecated. by Bob Tarling in 0.29.2 use getCompartment(Model.getMetaTypes().getAttribute()).isVisible()
 boolean isOperationsVisible()
          Determine if the operations compartment is visible.
 void propertyChange(java.beans.PropertyChangeEvent event)
          We are getting events we don't want.
 void renderingChanged()
          Rerender the entire fig.
 void setAttributesVisible(boolean isVisible)
          Deprecated. by Bob Tarling in 0.29.2 use setCompartmentVisible
 void setOperationsVisible(boolean isVisible)
          Set the visibility of the operations compartment.
 void translate(int dx, int dy)
           
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 updateOperations()
          Updates the operations box.
 
Methods inherited from class org.argouml.uml.diagram.ui.FigCompartmentBox
addCompartmentBoxSurroundings, addFig, calculateCompartmentBoxDimensions, createBorderFig, createContainedModelElement, getBorderFig, getCompartment, getFillColor, getLineWidth, getMinimumSize, getVisibleCompartmentCount, modelChanged, mouseClicked, setCompartmentBounds, setCompartmentVisible, setFillColor, setFilled, setLineWidth, setStandardBounds, unhighlight, unhighlight, updateStereotypeText
 
Methods inherited from class org.argouml.uml.diagram.ui.FigNodeModelElement
addElementListener, addElementListener, addElementListener, addEnclosedFig, allowRemoveFromDiagram, bindPort, buildModifierPopUp, buildVisibilityPopUp, calcBounds, createBigPortFig, createStereotypeFig, delayedVetoableChange, deleteFromModel, determineDefaultPathVisible, diagramFontChanged, displace, enableSizeChecking, getBigPort, getDiElement, getEnclosedFigs, getEncloser, getEnclosingFig, getItemUID, getName, getNameBounds, getNameFig, getNameFigFontStyle, getNotationProviderType, getNotationSettings, getPopupAddOffset, getProject, getRemoveDelegate, getSettings, getStereotypeCount, getStereotypeFig, getStereotypeStyle, getStereotypeView, getTipString, hit, hitClarifier, initNotationProviders, isCheckSize, isDragConnectable, isEditable, isPartlyOwner, isPartlyOwner, isPathVisible, isReadyToEdit, isSingleTarget, keyPressed, keyReleased, keyTyped, makeSelection, moveIntoComponent, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, placeString, removeAllElementListeners, removeElementListener, removeEnclosedFig, removeFromDiagram, removeFromDiagramImpl, setBigPort, setBoundsImpl, setDiElement, setEditable, setEncloser, setEnclosingFig, setItemUID, setLayer, setName, setNameFig, setOwner, setPathVisible, setProject, setReadyToEdit, setSettings, setStereotypeStyle, setStereotypeView, setSuppressCalcBounds, setVisible, showHelp, textEdited, textEditStarted, updateBounds, updateElementListeners, updateFont, updateListeners, updateNameText, updateStereotypeIcon, 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

FigClassifierBox

public FigClassifierBox(java.lang.Object owner,
                        java.awt.Rectangle bounds,
                        DiagramSettings settings)
Construct a Fig with owner, bounds, and settings.

Parameters:
owner - the model element that owns this fig
bounds - the rectangle defining the bounds
settings - the rendering 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()

updateOperations

protected void updateOperations()
Updates the operations box. Called from updateLayout if there is a model event effecting the attributes and from renderingChanged in all cases. TODO: The above statement means that the entire contents of the FigOperationsCompartment is being rebuilt whenever an add/remove of an operation or a reception is detected. It would be better to have FigOperationsCompartment itself listen for add and remove events and make minimum change rather than entirely rebuild. Remark MVW: This is a bit exaggerated, since the populate() method is already heavily optimized.


renderingChanged

public void renderingChanged()
Description copied from class: FigNodeModelElement
Rerender the entire fig.

This is may be an expensive operation for subclasses which are complex, so should be used sparingly. This functionality was originally the functionality of modelChanged but modelChanged takes the event now into account.

Specified by:
renderingChanged in interface ArgoFig
Overrides:
renderingChanged in class FigNodeModelElement

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
We are getting events we don't want. Filter them out. TODO: Can we instruct the model event pump not to send these in the first place? See defect 5095.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class FigNodeModelElement
Parameters:
event - the event

updateLayout

protected void updateLayout(UmlChangeEvent event)
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 restructure the FigNode due to change of any model element that this FigNode is listening to.

This method automatically updates the stereotype rendering.

The default behavior is to update the name and stereotype text.

For e.g. a Package, if the visibility is changed via the properties panel, then the display of it on the diagram has to follow the change. This is not handled here, but by the notationProviderName.

This method is guaranteed by the framework to be running on the Swing/AWT thread.

Overrides:
updateLayout in class FigNodeModelElement
Parameters:
event - the UmlChangeEvent that caused the change

getOperationsFig

protected FigOperationsCompartment getOperationsFig()
Returns:
The Fig for the operations compartment

getOperationsBounds

public java.awt.Rectangle getOperationsBounds()
Get the bounds of the operations compartment.

Specified by:
getOperationsBounds in interface OperationsCompartmentContainer
Returns:
the bounds of the operations compartment

isOperationsVisible

public boolean isOperationsVisible()
Description copied from interface: OperationsCompartmentContainer
Determine if the operations compartment is visible.

Specified by:
isOperationsVisible in interface OperationsCompartmentContainer
Returns:
true if the operations compartment is visible.

setOperationsVisible

public void setOperationsVisible(boolean isVisible)
Description copied from interface: OperationsCompartmentContainer
Set the visibility of the operations compartment.

Specified by:
setOperationsVisible in interface OperationsCompartmentContainer
Parameters:
isVisible - the new visibility status.

getAttributesFig

protected FigAttributesCompartment getAttributesFig()
Deprecated. in 0.29.1 use getCompartment(Model.getUmlFactory(Model.getMetaTypes(),getAttribute())) to determine if an attribute compartment exists and return it. The attributesCompartment should be created by the concrete class

Returns:
The graphics for the UML attributes (if any).

getAttributesBounds

@Deprecated
public java.awt.Rectangle getAttributesBounds()
Deprecated. by Bob Tarling in 0.29.2 use getCompartment(Model.getMetaTypes().getAttribute()).getBounds()

Returns:
the bounds

isAttributesVisible

@Deprecated
public boolean isAttributesVisible()
Deprecated. by Bob Tarling in 0.29.2 use getCompartment(Model.getMetaTypes().getAttribute()).isVisible()

Returns:
the visibility

setAttributesVisible

public void setAttributesVisible(boolean isVisible)
Deprecated. by Bob Tarling in 0.29.2 use setCompartmentVisible

TODO: Should not be on this class as we don't know if we'll have attributes

Parameters:
isVisible - true if the attribute compartment is visible

translate

public void translate(int dx,
                      int dy)
Overrides:
translate in class FigCompartmentBox

getPopUpActions

public java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
Build a collection of menu items relevant for a right-click popup menu on an Interface.

Overrides:
getPopUpActions in class FigNodeModelElement
Parameters:
me - a mouse event
Returns:
a collection of menu items

buildShowPopUp

protected ArgoJMenu buildShowPopUp()
Overrides:
buildShowPopUp in class FigNodeModelElement

buildAddMenu

protected ArgoJMenu buildAddMenu()

classNameAndBounds

public java.lang.String classNameAndBounds()
USED BY PGML.tee. TODO We should loop round the compartments to build this string. That way we have no attribute/operation knowledge at this level.

Overrides:
classNameAndBounds in class FigNodeModelElement
Returns:
the class name and bounds together with compartment visibility.

buildModifierPopUp

protected java.lang.Object buildModifierPopUp()


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook