|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.presentation.Fig
org.tigris.gef.presentation.FigGroup
org.tigris.gef.presentation.FigNode
org.argouml.uml.diagram.ui.FigNodeModelElement
org.argouml.uml.diagram.static_structure.ui.FigClass
Class to display graphics for a UML Class in a diagram.
Field Summary | |
protected org.tigris.gef.presentation.FigRect |
_attrBigPort
The rectangle for the entire attribute box. |
protected org.tigris.gef.presentation.FigGroup |
_attrVec
The vector of graphics for attributes (if any). |
protected org.tigris.gef.presentation.FigRect |
_operBigPort
The rectangle for the entire operations box. |
protected org.tigris.gef.presentation.FigGroup |
_operVec
The vector of graphics for operations (if any). |
protected org.tigris.gef.presentation.FigRect |
_stereoLineBlinder
A rectangle to blank out the line that would otherwise appear at the bottom of the stereotype text box. |
protected CompartmentFigText |
highlightedFigText
Text highlighted by mouse actions on the diagram. |
ru.novosoft.uml.foundation.core.MElementResidence |
resident
Manages residency of a class 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 |
Fields inherited from class org.tigris.gef.presentation.FigNode |
_blinkPorts, _figEdges, _highlight, ang135, ang225, ang315, ang45 |
Fields inherited from class org.tigris.gef.presentation.FigGroup |
_dynObjects, _figs |
Fields inherited from class org.tigris.gef.presentation.Fig |
_allowsSaving, _context, _dashes, _displayed, _fillColor, _filled, _group, _h, _layer, _lineColor, _lineWidth, _locked, _resource, _shown, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, DASH_ARRAYS, DASHED_CHOICES, MIN_SIZE |
Constructor Summary | |
FigClass()
Main constructor for a FigClass . |
|
FigClass(org.tigris.gef.graph.GraphModel gm,
java.lang.Object node)
Constructor for use if this figure is created for an existing class node in the metamodel. |
Method Summary | |
java.lang.Object |
clone()
|
protected void |
createFeatureIn(org.tigris.gef.presentation.FigGroup fg,
java.awt.event.InputEvent ie)
|
org.tigris.gef.presentation.FigGroup |
getAttributesFig()
|
java.awt.Dimension |
getMinimumSize()
Gets the minimum size permitted for a class on the diagram. |
protected org.tigris.gef.presentation.FigText |
getNextVisibleFeature(org.tigris.gef.presentation.FigGroup fgVec,
org.tigris.gef.presentation.FigText ft,
int i)
|
org.tigris.gef.presentation.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 a Package. |
protected org.tigris.gef.presentation.FigText |
getPreviousVisibleFeature(org.tigris.gef.presentation.FigGroup fgVec,
org.tigris.gef.presentation.FigText ft,
int i)
|
boolean |
isAttributeVisible()
Returns the status of the attribute field. |
boolean |
isOperationVisible()
Returns the status of the operation field. |
void |
keyPressed(java.awt.event.KeyEvent ke)
|
org.tigris.gef.base.Selection |
makeSelection()
|
protected void |
modelChanged(ru.novosoft.uml.MElementEvent mee)
Handles changes of the model. |
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 |
postLoad()
|
void |
renderingChanged()
Rerenders the fig if needed. |
void |
setAttributeVisible(boolean isVisible)
|
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 |
setFillColor(java.awt.Color lColor)
|
void |
setLineColor(java.awt.Color lColor)
|
void |
setOperationVisible(boolean isVisible)
|
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. |
void |
translate(int dx,
int dy)
|
protected CompartmentFigText |
unhighlight()
|
protected void |
updateAbstract()
Updates the name if modelchanged receives an "isAbstract" event |
protected void |
updateAttributes()
Updates the attributes in the fig. |
protected void |
updateListeners(java.lang.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 |
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, propertyChange, propertySet, recovered, removed, roleAdded, roleRemoved, setEnclosingFig, setItemUID, setOwner, setShadowSize, updateBounds, vetoableChange |
Methods inherited from class org.tigris.gef.presentation.FigNode |
addFigEdge, bindPort, cleanUp, contains, deepHitPort, endTrans, getBlinkPorts, getFigEdges, getHighlight, getPortFig, getPortFigs, getPortSector, hidePorts, hitPort, hitPort, mouseEntered, mousePressed, mouseReleased, paint, removeFigEdge, removePort, setBlinkPorts, setHighlight, showPorts, startTrans, superTranslate, updateEdges |
Methods inherited from class org.tigris.gef.presentation.FigGroup |
addFig, elements, getDisplayedFigs, getFigs, getFillColor, getFilled, getFont, getFontFamily, getFontSize, getLineColor, getLineWidth, getPrivateData, getTextColor, getTextFillColor, getTextFilled, hitFig, isReshapable, isResizable, isRotatable, parseDynObjects, removeAll, removeFig, setFigs, setFilled, setFont, setFontFamily, setFontSize, setLineWidth, setPrivateData, setTextColor, setTextFillColor, setTextFilled |
Methods inherited from class org.tigris.gef.presentation.Fig |
addAnnotation, addPoint, addPropertyChangeListener, align, center, classNameAndBounds, connectionPoint, contains, contains, countCornersContained, createDrag, drawDashedLine, drawDashedPerimeter, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getBounds, getClosestPoint, getContext, getDashed, getDashed01, getDashedString, getFilled01, getFirstPoint, getGravityPoints, getGroup, getHalfHeight, getHalfWidth, getHandleBox, getHeight, getId, getLastPoint, getLayer, getLocation, getLocked, getNumPoints, getOwner, getPerimeterLength, getPoints, getPoints, getPreferedSize, getResource, getSize, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getXs, getY, getYs, initAnnotations, insertPoint, intersects, isAnnotation, isDisplayed, isLowerRightResizable, isMovable, OK, pointAlongPerimeter, postSave, preSave, print, removeAnnotation, removeAnnotation, removePoint, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setCenter, setContext, setDashed, setDashedString, setDisplayed, setGroup, setHandleBox, setHeight, setLayer, setLocation, setLocation, setLocked, setNumPoints, setPoints, setPoints, setPoints, setPoints, setPoints, setResource, setSavingAllowed, setSize, setSize, setVisState, setWidth, setX, setXs, setY, setYs, stuffBounds, stuffPointAlongPerimeter, 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, mousePressed, mouseReleased |
Methods inherited from interface org.tigris.gef.ui.Highlightable |
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
protected org.tigris.gef.presentation.FigGroup _attrVec
The vector of graphics for attributes (if any). First one is the rectangle for the entire attributes box.
protected org.tigris.gef.presentation.FigGroup _operVec
The vector of graphics for operations (if any). First one is the rectangle for the entire operations box.
protected org.tigris.gef.presentation.FigRect _attrBigPort
The rectangle for the entire attribute box.
protected org.tigris.gef.presentation.FigRect _operBigPort
The rectangle for the entire operations box.
protected org.tigris.gef.presentation.FigRect _stereoLineBlinder
A rectangle to blank out the line that would otherwise appear at the bottom of the stereotype text box.
public ru.novosoft.uml.foundation.core.MElementResidence resident
Manages residency of a class 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 FigClass()
Main constructor for a FigClass
.
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 attributes and
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 four compartments showing.
There is some complex logic to allow for the possibility that stereotypes may not be displayed (unlike operations and attributes this is not a standard thing for UML). Some care is needed to ensure that additional space is not added, each time a stereotyped class is loaded.
There is a particular problem when loading diagrams with stereotyped classes. Because we create a FigClass indicating the stereotype is not displayed, we then add extra space for such classes when they are first rendered. This ought to be fixed by correctly saving the class dimensions, but that needs more work. The solution here is to use a simple flag to indicate the FigClass has just been created.
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
attribute and operations boxes are 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 FigClass(org.tigris.gef.graph.GraphModel gm, java.lang.Object node)
Constructor for use if this figure is created for an existing class 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 FigInterface.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 org.tigris.gef.base.Selection makeSelection()
makeSelection
in class FigNodeModelElement
public java.util.Vector getPopUpActions(java.awt.event.MouseEvent me)
getPopUpActions
in interface org.tigris.gef.ui.PopupGenerator
getPopUpActions
in class FigNodeModelElement
me
- a mouse event
public org.tigris.gef.presentation.FigGroup getOperationsFig()
public org.tigris.gef.presentation.FigGroup getAttributesFig()
public boolean isOperationVisible()
public boolean isAttributeVisible()
public void setAttributeVisible(boolean isVisible)
public void setOperationVisible(boolean isVisible)
public java.awt.Dimension getMinimumSize()
Gets the minimum size permitted for a class 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 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
protected void textEdited(org.tigris.gef.presentation.FigText ft) throws java.beans.PropertyVetoException
FigNodeModelElement
textEdited
in class FigNodeModelElement
java.beans.PropertyVetoException
protected org.tigris.gef.presentation.FigText getPreviousVisibleFeature(org.tigris.gef.presentation.FigGroup fgVec, org.tigris.gef.presentation.FigText ft, int i)
protected org.tigris.gef.presentation.FigText getNextVisibleFeature(org.tigris.gef.presentation.FigGroup fgVec, org.tigris.gef.presentation.FigText ft, int i)
protected void createFeatureIn(org.tigris.gef.presentation.FigGroup fg, java.awt.event.InputEvent ie)
createFeatureIn
in class FigNodeModelElement
protected CompartmentFigText unhighlight()
protected void modelChanged(ru.novosoft.uml.MElementEvent mee)
modelChanged
in class FigNodeModelElement
FigNodeModelElement.modelChanged(MElementEvent)
protected void updateStereotypeText()
FigNodeModelElement
updateStereotypeText
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 FigClassh
- Desired height of the FigClasspublic void mouseClicked(java.awt.event.MouseEvent me)
FigNodeModelElement
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class FigNodeModelElement
MouseListener.mouseClicked(java.awt.event.MouseEvent)
protected void updateAttributes()
protected void updateOperations()
public void renderingChanged()
FigNodeModelElement
renderingChanged
in class FigNodeModelElement
FigNodeModelElement.renderingChanged()
protected void updateNameText()
FigNodeModelElement
updateNameText
in class FigNodeModelElement
FigNodeModelElement.updateNameText()
protected void updateAbstract()
protected void updateListeners(java.lang.Object newOwner)
FigNodeModelElement
updateListeners
in class FigNodeModelElement
newOwner
- FigNodeModelElement.updateListeners(java.lang.Object)
public void postLoad()
postLoad
in class FigNodeModelElement
Fig.postLoad()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2003 (20030829) | ArgoUML Project Home | ArgoUML Cookbook |