org.argouml.uml.diagram.use_case.ui
Class FigActor

java.lang.Object
  extended by FigNode
      extended by org.argouml.uml.diagram.ui.FigNodeModelElement
          extended by org.argouml.uml.diagram.use_case.ui.FigActor
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

public class FigActor
extends FigNodeModelElement

Class to display graphics for an Actor in a diagram.

The dimensions of the stick-man figure are fixed at 40 wide by 55 high. It does not support different line-widths.

Stereotypes and the name are shown below the stick-man.

This seems to be the only ArgoUML element where the stereotypes are shown below the name. The UML 1.4.2 standard does not forbid nor prescribe this layout detail.


Field Summary
protected static int MIN_VERT_PADDING
          The padding between the actor body and name and the top of the stereotype.
 
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
FigActor(java.lang.Object owner, java.awt.Rectangle bounds, DiagramSettings settings)
          Construct a new Actor with the given owner, bounds, and settings.
 
Method Summary
protected  Fig createBigPortFig()
          Overrule this if a rectangle is not usable.
 java.lang.Object deepHitPort(int x, int y)
           
 java.util.List<java.awt.Point> getGravityPoints()
           
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of the Fig.
protected  int getNameFigFontStyle()
          Determines the font style based on the UML model.
 java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
          This method returns a Vector of one of these 4 types: AbstractAction, JMenu, JMenuItem, JSeparator.
 boolean isResizable()
           
 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 setFillColor(java.awt.Color col)
           
 void setFilled(boolean filled)
           
 void setLineWidth(int width)
           
protected  void setStandardBounds(int x, int y, int w, int h)
          Replaces FigNodeModelElement.setBoundsImpl(int, int, int, int).
 
Methods inherited from class org.argouml.uml.diagram.ui.FigNodeModelElement
addElementListener, addElementListener, addElementListener, addEnclosedFig, allowRemoveFromDiagram, bindPort, buildModifierPopUp, buildShowPopUp, buildVisibilityPopUp, calcBounds, classNameAndBounds, clone, createContainedModelElement, createStereotypeFig, delayedVetoableChange, deleteFromModel, determineDefaultPathVisible, diagramFontChanged, displace, enableSizeChecking, getBigPort, getDiElement, getEnclosedFigs, getEncloser, getEnclosingFig, getItemUID, getName, getNameBounds, getNameFig, 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, mouseClicked, moveIntoComponent, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, placeString, propertyChange, removeAllElementListeners, removeElementListener, removeEnclosedFig, removeFromDiagram, removeFromDiagramImpl, renderingChanged, 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, updateLayout, updateListeners, 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

MIN_VERT_PADDING

protected static final int MIN_VERT_PADDING
The padding between the actor body and name and the top of the stereotype.

See Also:
Constant Field Values
Constructor Detail

FigActor

public FigActor(java.lang.Object owner,
                java.awt.Rectangle bounds,
                DiagramSettings settings)
Construct a new Actor with the given owner, bounds, and settings. This constructor is used by the PGML parser.

Parameters:
owner - model element that owns this fig
bounds - position and size
settings - rendering settings
Method Detail

createBigPortFig

protected Fig createBigPortFig()
Description copied from class: FigNodeModelElement
Overrule this if a rectangle is not usable.

Overrides:
createBigPortFig in class FigNodeModelElement
Returns:
the Fig to be used as bigPort

setLineWidth

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

setFillColor

public void setFillColor(java.awt.Color col)

setFilled

public void setFilled(boolean filled)

makeSelection

public Selection makeSelection()
Overrides:
makeSelection in class FigNodeModelElement

getPopUpActions

public java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
Description copied from class: FigNodeModelElement
This method returns a Vector of one of these 4 types: AbstractAction, JMenu, JMenuItem, JSeparator.

Overrides:
getPopUpActions in class FigNodeModelElement

isResizable

public boolean isResizable()

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)

deepHitPort

public java.lang.Object deepHitPort(int x,
                                    int y)

getGravityPoints

public java.util.List<java.awt.Point> getGravityPoints()

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

getNameFigFontStyle

protected int getNameFigFontStyle()
Description copied from class: FigNodeModelElement
Determines the font style based on the UML model. Overrule this in Figs that have to show bold or italic based on the UML model they represent. E.g. abstract classes show their name in italic.

Overrides:
getNameFigFontStyle in class FigNodeModelElement
Returns:
the font style for the nameFig.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook