|
|||||||||||
| 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.
| Field Summary | |
protected static int |
ABSTRACT
Used for #buildModifierPopUp(). |
protected static int |
ACTIVE
Used for #buildModifierPopUp(). |
protected boolean |
invisibleAllowed
True of a subclass of FigNodeModelElement is allowed to be invisible. |
protected static int |
LEAF
Used for #buildModifierPopUp(). |
protected NotationProvider4 |
notationProviderName
|
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). |
protected static int |
STEREOHEIGHT
min. |
| Fields inherited from class org.tigris.gef.presentation.FigNode |
_blinkPorts, _highlight, ang135, ang225, ang315, ang45 |
| Fields inherited from class org.tigris.gef.presentation.Fig |
_allowsSaving, _context, _dashes, _dashPeriod, _dashStyle, _filled, _h, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, MIN_SIZE, plotter |
| Constructor Summary | |
FigNodeModelElement()
The main constructor. |
|
FigNodeModelElement(GraphModel gm,
Object node)
Partially construct a new FigNode. |
|
FigNodeModelElement(Object element,
int x,
int y)
Construct a figure at a specific position for a given model element. |
|
| Method Summary | |
protected void |
addElementListener(Object element)
Add an element listener and remember the registration. |
protected void |
addElementListener(Object element,
String property)
Add a listener for a given property name and remember the registration. |
protected void |
addElementListener(Object element,
String[] property)
Add a listener for an array of property names and remember the registration. |
void |
addEnclosedFig(Fig fig)
|
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(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. |
protected void |
finalize()
|
void |
forceRepaintShadow()
Force painting the shadow. |
Fig |
getBigPort()
|
NotationName |
getContextNotation()
Deprecated. by MVW in V0.21.3. Replaced by ProjectSettings.getNotationName() |
DiElement |
getDiElement()
|
Vector |
getEnclosedFigs()
|
protected Fig |
getEncloser()
|
Fig |
getEnclosingFig()
|
static Font |
getItalicLabelFont()
|
ItemUID |
getItemUID()
|
static Font |
getLabelFont()
|
String |
getName()
Get the name of the model element this Fig represents. |
Rectangle |
getNameBounds()
Get the Rectangle in which the model elements name is displayed |
protected FigText |
getNameFig()
Get the Fig that displays the model element name. |
Vector |
getPopUpActions(MouseEvent me)
|
protected static int |
getPopupAddOffset()
|
protected Fig |
getRemoveDelegate()
Subclasses should override this to redirect a remove request from one Fig to another. |
int |
getShadowSize()
|
protected Fig |
getStereotypeFig()
Get the Fig 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 void |
initNotationProviders(Object own)
Create the NotationProviders. |
protected boolean |
isCheckSize()
|
boolean |
isDragConnectable()
|
boolean |
isEditable()
Determine if this node can be edited. |
protected boolean |
isPartlyOwner(Fig fig,
Object o)
|
protected boolean |
isPartlyOwner(Object o)
|
boolean |
isPathVisible()
Determine if the path is visible. |
protected boolean |
isReadyToEdit()
|
void |
keyPressed(KeyEvent ke)
|
void |
keyReleased(KeyEvent ke)
|
void |
keyTyped(KeyEvent ke)
|
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)
|
protected void |
removeAllElementListeners()
Unregister all listeners registered through addElementListener |
protected void |
removeElementListener(Object element)
Remove an element listener and remember the registration. |
void |
removeEnclosedFig(Fig fig)
|
void |
removeFromDiagram()
|
protected void |
removeFromDiagramImpl()
|
void |
renderingChanged()
Rerenders the fig. |
protected void |
setBigPort(Fig bp)
|
void |
setContextNotation(NotationName nn)
|
void |
setDiElement(DiElement element)
|
protected void |
setEditable(boolean editable)
By default a node is directly editable by simply selecting that node and starting to type. |
protected void |
setEncloser(Fig e)
|
void |
setEnclosingFig(Fig newEncloser)
Updates the modelelement container if the fig is moved in or out another fig. |
void |
setItemUID(ItemUID id)
|
void |
setLayer(Layer lay)
|
void |
setName(String n)
Change the name of the model element this Fig represents. |
protected void |
setNameFig(FigText fig)
Set the Fig that displays the model element name. |
void |
setOwner(Object own)
In ArgoUML, for every Fig, this setOwner() function may only be called twice: Once after the fig is created, with a non-null argument, and once at end-of-life of the Fig, with a null argument. |
void |
setPathVisible(boolean visible)
Set the visibility of the path. |
protected void |
setReadyToEdit(boolean v)
|
void |
setShadowSize(int size)
|
protected void |
setShadowSizeFriend(int size)
Deprecated. do not use. Delete as soon as its single reference is gone. |
protected void |
setSuppressCalcBounds(boolean scb)
|
void |
setVisible(boolean visible)
|
protected void |
showHelp(String s)
Utility function to localize the given string with help text, and show it in the status bar of the ArgoUML window. |
protected void |
textEdited(FigText ft)
This method is called after the user finishes editing a text field that is in the FigNodeModelElement. |
protected void |
textEditStarted(FigText ft)
This method is called when the user doubleclicked on the text field, and starts editing. |
protected void |
updateBounds()
set some new bounds. |
protected void |
updateListeners(Object oldOwner,
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, dispose, endTrans, getFigEdges, getFigEdges, getHighlight, getPortFig, getPortFigs, getPortSector, hidePorts, hitPort, hitPort, isBlinkPorts, mouseEntered, mouseExited, mousePressed, mouseReleased, paint, removeFigEdge, removePort, setBlinkPorts, setBoundsImpl, setHighlight, showPorts, superTranslate, translateImpl, updateEdges |
| Methods inherited from class org.tigris.gef.presentation.FigGroup |
addFig, addFigs, deepSelect, elements, getDisplayedFigs, getExtraFrameSpace, getFigAt, getFigCount, getFigPosn, getFigs, getFont, getFontFamily, getFontSize, getPrivateData, 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 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.argouml.cognitive.Highlightable |
getHighlight, setHighlight |
| Methods inherited from interface org.tigris.gef.di.GraphicElement |
getId, getOwner, routingRect |
| Field Detail |
protected NotationProvider4 notationProviderName
protected boolean invisibleAllowed
protected static final int ROWHEIGHT
protected static final int STEREOHEIGHT
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
| Constructor Detail |
public FigNodeModelElement()
public FigNodeModelElement(GraphModel gm,
Object node)
gm - ignorednode - the owning UML element
public FigNodeModelElement(Object element,
int x,
int y)
element - ModelElement associated with figurex - y - | Method Detail |
protected void finalize()
throws Throwable
ThrowableObject.finalize()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()
protected FigText getNameFig()
public Rectangle getNameBounds()
protected void setNameFig(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 PopupGeneratorPopupGenerator.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 Fig getEnclosingFig()
Fig.getEnclosingFig()public void setEnclosingFig(Fig newEncloser)
Fig.setEnclosingFig(Fig)public void addEnclosedFig(Fig fig)
fig - The fig to be addedpublic void removeEnclosedFig(Fig fig)
fig - The Fig to be removedpublic Vector getEnclosedFigs()
Fig.getEnclosedFigs()public void elementOrdering(Vector figures)
figures - in the new orderpublic 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)
g - the graphics deviceClAttributeCompartment
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 VetoableChangeListenerVetoableChangeListener.vetoableChange(java.beans.PropertyChangeEvent)public void delayedVetoableChange(PropertyChangeEvent pce)
delayedVetoableChange in interface DelayedVChangeListenerpce - the eventDelayedVChangeListener.delayedVetoableChange(java.beans.PropertyChangeEvent)protected void updateBounds()
public void propertyChange(PropertyChangeEvent pve)
propertyChange in interface PropertyChangeListenerPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)protected void textEditStarted(FigText ft)
It is also possible to alter the text to be edited
already here, e.g. by adding the stereotype in front of the name,
by calling
notationProviderName.putValue("fullyHandleStereotypes",
true);, but that seems not user-friendly. See issue 3838.
ft - the FigText that will be edited and contains the start-textprotected void showHelp(String s)
s - the given string to be localized and shown
protected void textEdited(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 MouseListenerMouseListener.mouseClicked(java.awt.event.MouseEvent)public void keyPressed(KeyEvent ke)
keyPressed in interface KeyListenerKeyListener.keyPressed(java.awt.event.KeyEvent)public void keyReleased(KeyEvent ke)
keyReleased in interface KeyListenerKeyListener.keyReleased(java.awt.event.KeyEvent)public void keyTyped(KeyEvent ke)
keyTyped in interface KeyListenerKeyListener.keyTyped(java.awt.event.KeyEvent)protected void modelChanged(PropertyChangeEvent mee)
mee - the ModelElementEvent that caused the change
protected void createFeatureIn(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(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)
Hence, during the lifetime of this Fig object, the owner shall go from null to some UML object, and to null again.
Fig.setOwner(java.lang.Object)protected void initNotationProviders(Object own)
own - the current ownerprotected void updateStereotypeText()
protected void updateNameText()
public boolean isPathVisible()
PathContainer
isPathVisible in interface PathContainerPathContainer.isPathVisible()public void setPathVisible(boolean visible)
PathContainer
setPathVisible in interface PathContainervisible - the new path status.PathContainer.setPathVisible(boolean)public String classNameAndBounds()
protected void updateListeners(Object oldOwner,
Object newOwner)
An explanation of the original purpose of this method is given in issue 1321.
This function is used in UMLDiagram, which removes all listeners to all Figs when a diagram is not displayed, and restore them when it becomes visible again.
In this case, it is imperative that indeed ALL listeners are updated, since they are ALL removed by the call to removeElementListener.
Additionally, this function may be used by the modelChanged() function.
In this case, it is also imperative that all listeners get removed / added.
newOwner - null, or the owner of this.
The former means that listeners have to be removed,
the latter that they have to be set.
TODO: Should this not be boolean, to clarify?public NotationName getContextNotation()
ProjectSettings.getNotationName()
getContextNotation in interface NotationContextNotationContext.getContextNotation()public void setContextNotation(NotationName nn)
setContextNotation in interface NotationContextnn - the new notationNameNotationContext.setContextNotation(org.argouml.notation.NotationName)public void notationChanged(ArgoNotationEvent event)
ArgoNotationEventListener
notationChanged in interface ArgoNotationEventListenerevent - ArgoNotationEvent describing the change.ArgoNotationEventListener.notationChanged(org.argouml.application.events.ArgoNotationEvent)public void notationAdded(ArgoNotationEvent event)
ArgoNotationEventListener
notationAdded in interface ArgoNotationEventListenerevent - ArgoNotationEvent describing the added notation.ArgoNotationEventListener.notationAdded(org.argouml.application.events.ArgoNotationEvent)public void notationRemoved(ArgoNotationEvent event)
ArgoNotationEventListener
notationRemoved in interface ArgoNotationEventListenerevent - ArgoNotationEvent describing the removed notation.ArgoNotationEventListener.notationRemoved(org.argouml.application.events.ArgoNotationEvent)public void notationProviderAdded(ArgoNotationEvent event)
ArgoNotationEventListener
notationProviderAdded in interface ArgoNotationEventListenerevent - ArgoNotationEvent describing
the added notation provider.ArgoNotationEventListener.notationProviderAdded(org.argouml.application.events.ArgoNotationEvent)public void notationProviderRemoved(ArgoNotationEvent event)
ArgoNotationEventListener
notationProviderRemoved in interface ArgoNotationEventListenerevent - ArgoNotationEvent describing
the removed notation provider.ArgoNotationEventListener.notationProviderRemoved(org.argouml.application.events.ArgoNotationEvent)public void renderingChanged()
This functionality was originally the functionality of modelChanged but modelChanged takes the event now into account.
public void calcBounds()
Fig.calcBounds()public void enableSizeChecking(boolean flag)
flag - the new valuepublic void setShadowSize(int size)
size - the new shadow size
TODO: Move the shadow stuff into GEFprotected void setShadowSizeFriend(int size)
size - public int getShadowSize()
public boolean hit(Rectangle r)
Fig.hit(Rectangle)public final void removeFromDiagram()
Fig.removeFromDiagram()protected Fig getRemoveDelegate()
protected void removeFromDiagramImpl()
public void damage()
Fig.damage()public void postLoad()
Fig.postLoad()protected Fig getStereotypeFig()
public static Font getLabelFont()
public static Font getItalicLabelFont()
protected void setBigPort(Fig bp)
bp - The _bigPort to set.public Fig getBigPort()
protected boolean isCheckSize()
public boolean isDragConnectable()
FigNode.isDragConnectable()protected void setEncloser(Fig e)
e - The _encloser to set.protected 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 setVisible(boolean visible)
public void setLayer(Layer lay)
Fig.setLayer(org.tigris.gef.base.Layer)
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 allowedpublic void forceRepaintShadow()
public void setDiElement(DiElement element)
public DiElement getDiElement()
protected static int getPopupAddOffset()
public boolean isEditable()
protected void setEditable(boolean editable)
editable - new state, false = editing disabled.protected void addElementListener(Object element)
element - element to listen for changes onModelEventPump.addModelEventListener(PropertyChangeListener, Object, String)
protected void addElementListener(Object element,
String property)
element - element to listen for changes onproperty - name of property to listen for changes ofModelEventPump.addModelEventListener(PropertyChangeListener,
Object, String)
protected void addElementListener(Object element,
String[] property)
element - element to listen for changes onproperty - array of property names (Strings) to listen for changes ofModelEventPump.addModelEventListener(PropertyChangeListener,
Object, String)protected void removeElementListener(Object element)
element - element to listen for changes onModelEventPump.addModelEventListener(PropertyChangeListener, Object, String)protected void removeAllElementListeners()
addElementListener(Object, String)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ArgoUML © 1996-2006 | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |