|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FigNode | +--org.argouml.uml.diagram.ui.FigNodeModelElement | +--org.argouml.uml.diagram.static_structure.ui.FigInterface
Class to display graphics for a UML Interface in a diagram.
Field Summary | |
---|---|
protected FigRect |
_operBigPort
The rectangle for the entire operations box. |
protected FigGroup |
_operVec
The vector of graphics for operations (if any). |
protected FigRect |
_stereoLineBlinder
A rectangle to blank out the line that would otherwise appear at the bottom of the stereotype text box. |
protected static Category |
cat
|
protected CompartmentFigText |
highlightedFigText
Text highlighted by mouse actions on the diagram. |
MElementResidence |
resident
Manages residency of an interface within a component on a deployment diagram. |
Fields inherited from class org.argouml.uml.diagram.ui.FigNodeModelElement |
---|
_bigPort, _enclosedFigs, _encloser, _name, _readyToEdit, _shadowSize, _stereo, checkSize, ITALIC_LABEL_FONT, LABEL_FONT, MARGIN, ROWHEIGHT, STEREOHEIGHT, suppressCalcBounds |
Constructor Summary | |
---|---|
FigInterface()
Main constructor for a FigInterface . |
|
FigInterface(GraphModel gm,
java.lang.Object node)
Constructor for use if this figure is created for an existing interface node in the metamodel. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
protected void |
createFeatureIn(FigGroup fg,
java.awt.event.InputEvent ie)
|
java.awt.Dimension |
getMinimumSize()
Gets the minimum size permitted for an interface on the diagram. |
protected FigText |
getNextVisibleFeature(FigText ft,
int i)
|
FigGroup |
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. |
protected FigText |
getPreviousVisibleFeature(FigText ft,
int i)
|
boolean |
isOperationVisible()
Returns the status of the operation field. |
void |
keyPressed(java.awt.event.KeyEvent ke)
|
Selection |
makeSelection()
|
protected void |
modelChanged(MElementEvent mee)
This is called aftern any part of the UML MModelElement has changed. |
void |
mouseClicked(java.awt.event.MouseEvent me)
If the user double clicks on any part of this FigNode, pass it down to one of the internal Figs. |
void |
mouseExited(java.awt.event.MouseEvent me)
|
java.lang.String |
placeString()
Reply text to be shown while placing node in diagram |
void |
renderingChanged()
Rerenders the fig if needed. |
void |
setBounds(int x,
int y,
int w,
int h)
Sets the bounds, but the size will be at least the one returned by getMinimumSize() , unless checking of size is disabled. |
void |
setEnclosingFig(Fig encloser)
Updates the modelelement container if the fig is moved in or out another fig. |
void |
setFillColor(java.awt.Color lColor)
|
void |
setLineColor(java.awt.Color lColor)
|
void |
setOperationVisible(boolean isVisible)
|
protected void |
textEdited(FigText ft)
This method is called after the user finishes editing a text field that is in the FigNodeModelElement. |
void |
translate(int dx,
int dy)
|
protected CompartmentFigText |
unhighlight()
|
protected void |
updateOperations()
Updates the operations box. |
protected void |
updateStereotypeText()
Updates the text of the sterotype FigText. |
Methods inherited from class org.argouml.uml.diagram.ui.FigNodeModelElement |
---|
calcBounds, damage, delayedVetoableChange, delete, dispose, elementOrdering, enableSizeChecking, finalize, getContextNotation, getEnclosedFigs, getEnclosingFig, getItemUID, getNameFig, getShadowSize, getTipString, getUpdatedSize, hit, hitClarifier, isPartlyOwner, isPartlyOwner, keyReleased, keyTyped, listRoleItemSet, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, paintClarifiers, postLoad, propertyChange, propertySet, recovered, removed, roleAdded, roleRemoved, setItemUID, setOwner, setShadowSize, updateBounds, updateListeners, updateNameText, vetoableChange |
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, mousePressed, mouseReleased |
Field Detail |
protected static Category cat
protected FigGroup _operVec
The vector of graphics for operations (if any). First one is the rectangle for the entire operations box.
protected FigRect _operBigPort
The rectangle for the entire operations box.
protected FigRect _stereoLineBlinder
A rectangle to blank out the line that would otherwise appear at the bottom of the stereotype text box.
public MElementResidence resident
Manages residency of an interface within a component on a deployment diagram. Not clear why it is public, or even why it is an instance variable (rather than local to the method).
protected CompartmentFigText highlightedFigText
Text highlighted by mouse actions on the diagram.
Constructor Detail |
public FigInterface()
Main constructor for a FigInterface
.
Parent FigNodeModelElement
will have created the main box
FigNodeModelElement._bigPort
and its name FigNodeModelElement._name
and stereotype (@link
#_stereo}. This constructor creates a box for the operations.
The properties of all these graphic elements are adjusted appropriately. The main boxes are all filled and have outlines.
For reasons I don't understand the stereotype is created in a box with lines. So we have to created a blanking rectangle to overlay the bottom line, and avoid three compartments showing.
Warning. Much of the graphics positioning is hard coded. The
overall figure is placed at location (10,10). The name compartment (in
the parent FigNodeModelElement
is 21 pixels high. The
stereotype compartment is created 15 pixels high in the parent, but we
change it to 19 pixels, 1 more than (FigNodeModelElement.STEREOHEIGHT
here. The
operations box is created at 19 pixels, 2 more than
FigNodeModelElement.ROWHEIGHT
.
CAUTION: This constructor (with no arguments) is the only one that does enableSizeChecking(false), all others must set it true. This is because this constructor is the only one called when loading a project. In this case, the parsed size must be maintained.
public FigInterface(GraphModel gm, java.lang.Object node)
Constructor for use if this figure is created for an existing interface node in the metamodel.
Set the figure's name according to this node. This is used when the user click's on 'add to diagram' in the navpane. Don't know if this should rather be done in one of the super classes, since similar code is used in FigClass.java etc. Andreas Rueckert <a_rueckert@gmx.net>
gm
- Not actually used in the current implementationnode
- The UML object being placed.Method Detail |
public java.lang.String placeString()
FigNodeModelElement
placeString
in class FigNodeModelElement
public java.lang.Object clone()
public Selection makeSelection()
makeSelection
in class FigNodeModelElement
public java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
getPopUpActions
in class FigNodeModelElement
me
- a mouse event
public FigGroup getOperationsFig()
public boolean isOperationVisible()
public void setOperationVisible(boolean isVisible)
public java.awt.Dimension getMinimumSize()
Gets the minimum size permitted for an interface on the diagram.
Parts of this are hardcoded, notably the fact that the name compartment has a minimum height of 21 pixels.
public void setFillColor(java.awt.Color lColor)
public void setLineColor(java.awt.Color lColor)
public void translate(int dx, int dy)
public void mouseClicked(java.awt.event.MouseEvent me)
FigNodeModelElement
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class FigNodeModelElement
public void mouseExited(java.awt.event.MouseEvent me)
public void keyPressed(java.awt.event.KeyEvent ke)
keyPressed
in interface java.awt.event.KeyListener
keyPressed
in class FigNodeModelElement
public void setEnclosingFig(Fig encloser)
FigNodeModelElement
setEnclosingFig
in class FigNodeModelElement
org.tigris.gef.presentation.Fig#setEnclosingFig(org.tigris.gef.presentation.Fig)
protected void textEdited(FigText ft) throws java.beans.PropertyVetoException
FigNodeModelElement
textEdited
in class FigNodeModelElement
java.beans.PropertyVetoException
protected FigText getPreviousVisibleFeature(FigText ft, int i)
protected FigText getNextVisibleFeature(FigText ft, int i)
protected void createFeatureIn(FigGroup fg, java.awt.event.InputEvent ie)
createFeatureIn
in class FigNodeModelElement
protected CompartmentFigText unhighlight()
protected void modelChanged(MElementEvent mee)
FigNodeModelElement
modelChanged
in class FigNodeModelElement
public void renderingChanged()
FigNodeModelElement
renderingChanged
in class FigNodeModelElement
public void setBounds(int x, int y, int w, int h)
Sets the bounds, but the size will be at least the one returned by
getMinimumSize()
, unless checking of size is disabled.
If the required height is bigger, then the additional height is equally distributed among all figs (i.e. compartments), such that the cumulated height of all visible figs equals the demanded height
.
Some of this has "magic numbers" hardcoded in. In particular there is a knowledge that the minimum height of a name compartment is 21 pixels.
x
- Desired X coordinate of upper left cornery
- Desired Y coordinate of upper left cornerw
- Desired width of the FigInterfaceh
- Desired height of the FigInterfaceprotected void updateOperations()
protected void updateStereotypeText()
FigNodeModelElement
updateStereotypeText
in class FigNodeModelElement
FigNodeModelElement.updateStereotypeText()
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2003 (20040229) | ArgoUML Project Home | ArgoUML Cookbook |