|
|||||||||||
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
Abstract class to display diagram icons for UML ModelElements that look like nodes and that have editable names and can be resized.
Nested Class Summary | |
(package private) class |
FigNodeModelElement.ActionModifierAbstract
|
(package private) class |
FigNodeModelElement.ActionModifierActive
|
(package private) class |
FigNodeModelElement.ActionModifierLeaf
|
(package private) class |
FigNodeModelElement.ActionModifierRoot
|
(package private) class |
FigNodeModelElement.ActionVisibilityPrivate
|
(package private) class |
FigNodeModelElement.ActionVisibilityProtected
|
(package private) class |
FigNodeModelElement.ActionVisibilityPublic
|
Field Summary | |
protected static int |
ABSTRACT
Used for #buildModifierPopUp(). |
protected static int |
ACTIVE
Used for #buildModifierPopUp(). |
private org.tigris.gef.presentation.Fig |
bigPort
|
private int |
cachedHeight
|
private int |
cachedWidth
|
private boolean |
checkSize
Needed for loading. |
private NotationName |
currentNotationName
|
private Vector |
enclosedFigs
enclosedFigs are the Figs that are enclosed by this figure. |
private org.tigris.gef.presentation.Fig |
encloser
The figure enclosing this figure. |
private static Font |
ITALIC_LABEL_FONT
|
private ItemUID |
itemUid
|
private static Font |
LABEL_FONT
|
protected static int |
LEAF
Used for #buildModifierPopUp(). |
private static Logger |
LOG
|
private org.tigris.gef.presentation.FigText |
name
use getNameFig() and setNameFig() to access the Figs. |
protected static int |
POPUP_ADD_OFFSET
Offset from the end of the set of popup actions at which new items should be inserted by concrete figures. |
private boolean |
readyToEdit
|
private boolean |
removeFromDiagram
Set the removeFromDiagram to false if this node may not be removed from the diagram. |
protected static int |
ROOT
Used for #buildModifierPopUp(). |
protected static int |
ROWHEIGHT
min. |
protected static int |
SHADOW_COLOR_ALPHA
The transparency value of the shadow color (0-255). |
protected static int |
SHADOW_COLOR_VALUE
The intensity value of the shadow color (0-255). |
private static ConvolveOp |
SHADOW_CONVOLVE_OP
|
private static LookupOp |
SHADOW_LOOKUP_OP
|
private BufferedImage |
shadowImage
|
private int |
shadowSize
|
private org.tigris.gef.presentation.FigText |
stereo
use getter/setter getStereotypeFig() and setStereoTypeFig() to access the Figs. |
protected static int |
STEREOHEIGHT
min. |
private boolean |
suppressCalcBounds
|
Fields inherited from class org.tigris.gef.presentation.FigNode |
_blinkPorts, _highlight, ang135, ang225, ang315, ang45 |
Fields inherited from class org.tigris.gef.presentation.FigGroup |
_dynObjects, _extraFrameSpace |
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 | |
FigNodeModelElement()
The main constructor. |
|
FigNodeModelElement(org.tigris.gef.graph.GraphModel gm,
Object node)
Partially construct a new FigNode. |
Method Summary | |
void |
addEnclosedFig(org.tigris.gef.presentation.Fig fig)
|
void |
addFig(org.tigris.gef.presentation.Fig f)
Adds a fig to this FigNodeModelElement and removes it from the group it belonged to if any. |
protected void |
allowRemoveFromDiagram(boolean allowed)
|
protected Object |
buildModifierPopUp(int items)
Build a pop-up menu item for the various modifiers. |
protected Object |
buildVisibilityPopUp()
|
void |
calcBounds()
|
String |
classNameAndBounds()
USED BY PGML.tee. |
Object |
clone()
After the base clone method has been called determine which child figs of the clone represent the name, stereotype and port. |
protected void |
createFeatureIn(org.tigris.gef.presentation.FigGroup fg,
InputEvent me)
Create a new "feature" in the owner fig. |
void |
damage()
|
void |
delayedVetoableChange(PropertyChangeEvent pce)
|
void |
deleteFromModel()
|
void |
displace(int xInc,
int yInc)
To redraw each element correctly when changing its location with X and U additions. |
void |
elementOrdering(Vector figures)
Update the order of this fig and the order of the figs that are inside of this fig. |
void |
enableSizeChecking(boolean flag)
The setter for checkSize. |
void |
finalize()
|
protected org.tigris.gef.presentation.Fig |
getBigPort()
|
NotationName |
getContextNotation()
Returns the notation name for this fig. |
Vector |
getEnclosedFigs()
|
protected org.tigris.gef.presentation.Fig |
getEncloser()
|
org.tigris.gef.presentation.Fig |
getEnclosingFig()
|
static Font |
getItalicLabelFont()
|
ItemUID |
getItemUID()
|
static Font |
getLabelFont()
|
String |
getName()
Get the name of the model element this Fig represents. |
org.tigris.gef.presentation.FigText |
getNameFig()
Get the Fig that displays the model element name. |
Vector |
getPopUpActions(MouseEvent me)
|
int |
getShadowSize()
|
String |
getStereotype()
Get the text describing the stereotype. |
protected org.tigris.gef.presentation.Fig |
getStereotypeFig()
Get the Fig containing the stereotype. |
protected org.tigris.gef.presentation.FigText |
getStereotypeFigText()
Get the FigText containing the stereotype. |
String |
getTipString(MouseEvent me)
|
boolean |
hit(Rectangle r)
Necessary since GEF contains some errors regarding the hit subject. |
ToDoItem |
hitClarifier(int x,
int y)
|
protected boolean |
isCheckSize()
|
protected boolean |
isPartlyOwner(org.tigris.gef.presentation.Fig fig,
Object o)
|
protected boolean |
isPartlyOwner(Object o)
|
protected boolean |
isReadyToEdit()
|
void |
keyPressed(KeyEvent ke)
|
void |
keyReleased(KeyEvent ke)
|
void |
keyTyped(KeyEvent ke)
|
org.tigris.gef.base.Selection |
makeSelection()
|
protected void |
modelChanged(PropertyChangeEvent mee)
This is called after any part of the UML MModelElement has changed. |
void |
mouseClicked(MouseEvent me)
If the user double clicks on any part of this FigNode, pass it down to one of the internal Figs. |
void |
notationAdded(ArgoNotationEvent event)
Invoked when a notation has been added. |
void |
notationChanged(ArgoNotationEvent event)
Invoked when any aspect of the notation has been changed. |
void |
notationProviderAdded(ArgoNotationEvent event)
Invoked when a notation provider has been added. |
void |
notationProviderRemoved(ArgoNotationEvent event)
Invoked when a notation provider has been removed. |
void |
notationRemoved(ArgoNotationEvent event)
Invoked when a notation has been removed. |
void |
paint(Graphics g)
Overridden to paint shadows. |
void |
paintClarifiers(Graphics g)
Displays visual indications of pending ToDoItems. |
String |
placeString()
Default Reply text to be shown while placing node in diagram. |
void |
postLoad()
|
void |
propertyChange(PropertyChangeEvent pve)
|
void |
redrawEnclosedFigs()
Method to draw a StateVertex Fig's enclosed figs. |
void |
removeEnclosedFig(org.tigris.gef.presentation.Fig fig)
|
void |
removeFromDiagram()
|
void |
renderingChanged()
Rerenders the fig if needed. |
protected void |
setBigPort(org.tigris.gef.presentation.Fig bp)
|
protected void |
setEncloser(org.tigris.gef.presentation.Fig e)
|
void |
setEnclosingFig(org.tigris.gef.presentation.Fig newEncloser)
Updates the modelelement container if the fig is moved in or out another fig. |
void |
setItemUID(ItemUID id)
|
void |
setName(String n)
Change the name of the model element this Fig represents. |
protected void |
setNameFig(org.tigris.gef.presentation.FigText fig)
Set the Fig that displays the model element name. |
void |
setOwner(Object own)
|
protected void |
setReadyToEdit(boolean v)
|
void |
setShadowSize(int size)
|
void |
setStereotype(String stereotype)
Set the text describing the stereotype. |
protected void |
setStereotypeFig(org.tigris.gef.presentation.Fig fig)
Set the Fig containing the stereotype. |
protected void |
setSuppressCalcBounds(boolean scb)
|
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. |
protected void |
updateBounds()
set some new bounds. |
protected Dimension |
updateFigGroupSize(org.tigris.gef.presentation.FigGroup fg,
int x,
int y,
int w,
int h)
Returns the new size of the FigGroup (either attributes or operations) after calculation new bounds for all sub-figs, considering their minimal sizes; FigGroup need not be displayed; no update event is fired. |
protected void |
updateListeners(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 |
updateStereotypeText()
Updates the text of the sterotype FigText. |
void |
vetoableChange(PropertyChangeEvent pce)
|
Methods inherited from class org.tigris.gef.presentation.FigNode |
addFigEdge, bindPort, cleanUp, contains, deepHitPort, delete, dispose, endTrans, getBlinkPorts, getFigEdges, getFigEdges, getHighlight, getPortFig, getPortFigs, getPortSector, hidePorts, hitPort, hitPort, isBlinkPorts, isDragConnectable, mouseEntered, mouseExited, mousePressed, mouseReleased, removeFigEdge, removePort, setBlinkPorts, setBounds, setHighlight, showPorts, superTranslate, translate, updateEdges |
Methods inherited from class org.tigris.gef.presentation.FigGroup |
addFigs, deepSelect, elements, getDisplayedFigs, getExtraFrameSpace, getFigAt, getFigs, getFigs, getFont, getFontFamily, getFontSize, getPrivateData, getSize, getSubFigBounds, getTextColor, getTextFillColor, getTextFilled, hitFig, isReshapable, isRotatable, iterator, parseDynObjects, removeAll, removeFig, setExtraFrameSpace, setFigs, setFigs, setFillColor, setFilled, setFont, setFontFamily, setFontSize, setLineColor, setLineWidth, setPrivateData, setTextColor, setTextFillColor, setTextFilled |
Methods inherited from class org.tigris.gef.presentation.Fig |
addAnnotation, addPoint, addPropertyChangeListener, align, center, connectionPoint, contains, contains, countCornersContained, createDrag, drawDashedLine, drawDashedPerimeter, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getBounds, getBounds, getClosestPoint, getContext, getDashed, getDashed01, getDashedString, getFillColor, getFilled, getFilled01, getFirstPoint, getGravityPoints, getGroup, getHalfHeight, getHalfWidth, getHandleBox, getHeight, getId, getLastPoint, getLayer, getLineColor, getLineWidth, getLocation, getLocked, getMinimumSize, getNumPoints, getOwner, getPerimeterLength, getPoint, getPoints, getPreferredSize, getResource, getSingle, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getXs, getY, getYs, hasFillColor, hasLineColor, initAnnotations, insertPoint, intersects, intersectsPerimeter, isAnnotation, isCopieable, isCopyable, isCutable, isDisplayed, isLowerRightResizable, isMovable, isResizable, isSelected, isVisible, OK, pointAlongPerimeter, postSave, preSave, print, redraw, removeAnnotation, removeAnnotation, removePoint, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setCenter, setContext, setDashed, setDashedString, setDisplayed, setGroup, setHandleBox, setHeight, setLayer, setLocation, setLocation, setLocked, setMovable, setNumPoints, setPoint, setPoint, setPoint, setPoint, setPoints, setPoints, setPoints, setPoints, setPoints, setResizable, setResource, setSavingAllowed, setSelected, setSingle, setSize, setSize, setVisible, setVisState, setWidth, setX, setXs, setY, setYs, stuffBounds, stuffPointAlongPerimeter, 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.awt.event.MouseListener |
mouseEntered, mouseExited, mousePressed, mouseReleased |
Methods inherited from interface org.tigris.gef.ui.Highlightable |
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
private static final Logger LOG
private NotationName currentNotationName
private static final Font LABEL_FONT
private static final Font ITALIC_LABEL_FONT
protected static final int ROWHEIGHT
protected static final int STEREOHEIGHT
private boolean checkSize
protected static final int POPUP_ADD_OFFSET
private BufferedImage shadowImage
private int cachedWidth
private int cachedHeight
private static final LookupOp SHADOW_LOOKUP_OP
private static final ConvolveOp SHADOW_CONVOLVE_OP
protected static final int SHADOW_COLOR_VALUE
protected static final int SHADOW_COLOR_ALPHA
protected static final int ROOT
protected static final int ABSTRACT
protected static final int LEAF
protected static final int ACTIVE
private org.tigris.gef.presentation.Fig bigPort
private org.tigris.gef.presentation.FigText name
private org.tigris.gef.presentation.FigText stereo
private Vector enclosedFigs
private org.tigris.gef.presentation.Fig encloser
private boolean readyToEdit
private boolean suppressCalcBounds
private int shadowSize
private ItemUID itemUid
private boolean removeFromDiagram
Constructor Detail |
public FigNodeModelElement()
public FigNodeModelElement(org.tigris.gef.graph.GraphModel gm, Object node)
gm
- ignorednode
- the owning UML elementMethod Detail |
public void finalize()
Object.finalize()
public String classNameAndBounds()
org.tigris.gef.presentation.Fig#getNameAndBounds()
public Object clone()
The clone function is used by Copy/Paste operations.
Object.clone()
public String placeString()
public void setItemUID(ItemUID id)
id
- UIDpublic ItemUID getItemUID()
public org.tigris.gef.presentation.FigText getNameFig()
protected void setNameFig(org.tigris.gef.presentation.FigText fig)
fig
- the name Figpublic String getName()
public void setName(String n)
n
- the name of the model elementpublic Vector getPopUpActions(MouseEvent me)
getPopUpActions
in interface org.tigris.gef.ui.PopupGenerator
PopupGenerator.getPopUpActions(java.awt.event.MouseEvent)
protected Object buildVisibilityPopUp()
protected Object buildModifierPopUp(int items)
This function is designed to be easily extendable with new items.
items
- bitwise OR of the items: ROOT, ABSTRACT, LEAF, ACTIVE.
public org.tigris.gef.presentation.Fig getEnclosingFig()
Fig.getEnclosingFig()
public void setEnclosingFig(org.tigris.gef.presentation.Fig newEncloser)
Fig.setEnclosingFig(Fig)
public void addEnclosedFig(org.tigris.gef.presentation.Fig fig)
fig
- The fig to be addedpublic void removeEnclosedFig(org.tigris.gef.presentation.Fig fig)
fig
- The Fig to be removedpublic Vector getEnclosedFigs()
Fig.getEnclosedFigs()
public void elementOrdering(Vector figures)
figures
- in the new orderpublic org.tigris.gef.base.Selection makeSelection()
Fig.makeSelection()
public void paint(Graphics g)
TODO: If g is not a Graphics2D shadows cannot be painted. This is a problem when saving the diagram as SVG.
g
- is a Graphics that we paint this object on.public void paintClarifiers(Graphics g)
ClAttributeCompartment
public ToDoItem hitClarifier(int x, int y)
x
- the x of the hity
- the y of the hit
public String getTipString(MouseEvent me)
Fig.getTipString(java.awt.event.MouseEvent)
public void vetoableChange(PropertyChangeEvent pce)
vetoableChange
in interface VetoableChangeListener
VetoableChangeListener.vetoableChange(java.beans.PropertyChangeEvent)
public void delayedVetoableChange(PropertyChangeEvent pce)
delayedVetoableChange
in interface DelayedVChangeListener
pce
- the eventDelayedVChangeListener.delayedVetoableChange(java.beans.PropertyChangeEvent)
protected void updateBounds()
public void propertyChange(PropertyChangeEvent pve)
propertyChange
in interface PropertyChangeListener
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
protected void textEdited(org.tigris.gef.presentation.FigText ft) throws PropertyVetoException
ft
- the FigText that has been edited and contains the new text
PropertyVetoException
- thrown when new text represents
an unacceptable valuepublic void mouseClicked(MouseEvent me)
mouseClicked
in interface MouseListener
MouseListener.mouseClicked(java.awt.event.MouseEvent)
public void keyPressed(KeyEvent ke)
keyPressed
in interface KeyListener
KeyListener.keyPressed(java.awt.event.KeyEvent)
public void keyReleased(KeyEvent ke)
keyReleased
in interface KeyListener
not used, do nothing.
public void keyTyped(KeyEvent ke)
keyTyped
in interface KeyListener
not used, do nothing.
protected void modelChanged(PropertyChangeEvent mee)
mee
- the ModelElementEvent that caused the changeprotected void createFeatureIn(org.tigris.gef.presentation.FigGroup fg, InputEvent me)
fg
- The fig group to which this appliesme
- The input event that triggered us. In the current
implementation a mouse double click.protected boolean isPartlyOwner(Object o)
o
- the given object
protected boolean isPartlyOwner(org.tigris.gef.presentation.Fig fig, Object o)
fig
- the given fig (may be a group)o
- the given object
public void deleteFromModel()
Fig.deleteFromModel()
public void setOwner(Object own)
Fig.setOwner(java.lang.Object)
protected void updateStereotypeText()
protected void updateNameText()
protected void updateListeners(Object newOwner)
newOwner
- the new owner for the listenerspublic NotationName getContextNotation()
getContextNotation
in interface NotationContext
NotationContext.getContextNotation()
public void notationChanged(ArgoNotationEvent event)
ArgoNotationEventListener
notationChanged
in interface ArgoNotationEventListener
event
- ArgoNotationEvent
describing the change.ArgoNotationEventListener.notationChanged(org.argouml.application.events.ArgoNotationEvent)
public void notationAdded(ArgoNotationEvent event)
ArgoNotationEventListener
notationAdded
in interface ArgoNotationEventListener
event
- ArgoNotationEvent
describing the added notation.ArgoNotationEventListener.notationAdded(org.argouml.application.events.ArgoNotationEvent)
public void notationRemoved(ArgoNotationEvent event)
ArgoNotationEventListener
notationRemoved
in interface ArgoNotationEventListener
event
- ArgoNotationEvent
describing the removed notation.ArgoNotationEventListener.notationRemoved(org.argouml.application.events.ArgoNotationEvent)
public void notationProviderAdded(ArgoNotationEvent event)
ArgoNotationEventListener
notationProviderAdded
in interface ArgoNotationEventListener
event
- ArgoNotationEvent
describing
the added notation provider.ArgoNotationEventListener.notationProviderAdded(org.argouml.application.events.ArgoNotationEvent)
public void notationProviderRemoved(ArgoNotationEvent event)
ArgoNotationEventListener
notationProviderRemoved
in interface ArgoNotationEventListener
event
- ArgoNotationEvent
describing
the removed notation provider.ArgoNotationEventListener.notationProviderRemoved(org.argouml.application.events.ArgoNotationEvent)
public void renderingChanged()
public void calcBounds()
Fig.calcBounds()
public void enableSizeChecking(boolean flag)
flag
- the new valueprotected Dimension updateFigGroupSize(org.tigris.gef.presentation.FigGroup fg, int x, int y, int w, int h)
This method has side effects that are sometimes used.
fg
- the FigGroup to be updatedx
- xy
- yw
- wh
- h
public void setShadowSize(int size)
size
- the new shadow sizepublic int getShadowSize()
public boolean hit(Rectangle r)
Fig.hit(Rectangle)
public void removeFromDiagram()
Fig.removeFromDiagram()
public void damage()
Fig.damage()
public void postLoad()
Fig.postLoad()
public void addFig(org.tigris.gef.presentation.Fig f)
TODO: remove this once GEF0.10 is in place and tested
protected void setStereotypeFig(org.tigris.gef.presentation.Fig fig)
fig
- the stereotype Figprotected org.tigris.gef.presentation.Fig getStereotypeFig()
protected org.tigris.gef.presentation.FigText getStereotypeFigText()
public void setStereotype(String stereotype)
stereotype
- the stereotype textpublic String getStereotype()
public static Font getLabelFont()
public static Font getItalicLabelFont()
protected void setBigPort(org.tigris.gef.presentation.Fig bp)
bp
- The _bigPort to set.protected org.tigris.gef.presentation.Fig getBigPort()
protected boolean isCheckSize()
protected void setEncloser(org.tigris.gef.presentation.Fig e)
e
- The _encloser to set.protected org.tigris.gef.presentation.Fig getEncloser()
protected boolean isReadyToEdit()
protected void setReadyToEdit(boolean v)
v
- if ready to editprotected void setSuppressCalcBounds(boolean scb)
scb
- The suppressCalcBounds to set.public void redrawEnclosedFigs()
public void displace(int xInc, int yInc)
xInc
- the increment in the x directionyInc
- the increment in the y directionprotected void allowRemoveFromDiagram(boolean allowed)
allowed
- true if the function RemoveFromDiagram is allowed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |