|
|||||||||||
| 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(). |
private Fig |
bigPort
|
private int |
cachedHeight
|
private int |
cachedWidth
|
private boolean |
checkSize
Needed for loading. |
private NotationName |
currentNotationName
|
private DiElement |
diElement
|
private Vector |
enclosedFigs
EnclosedFigs are the Figs that are enclosed by this figure. |
private Fig |
encloser
The figure enclosing this figure. |
private boolean |
forceRepaint
Set this to force a repaint of the shadow. |
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
Logger. |
private FigText |
nameFig
use getNameFig() and setNameFig() to access the Figs. |
protected NotationProvider4 |
notationProviderName
|
private boolean |
pathVisible
Flag that indicates if the full namespace path should be shown in front of the name. |
private static int |
popupAddOffset
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
|
protected static int |
STEREOHEIGHT
min. |
private Fig |
stereotypeFig
use getter/setter getStereotypeFig() and setStereoTypeFig() to access the Figs. |
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 |
|
| 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 |
| Constructor Summary | |
FigNodeModelElement()
The main constructor. |
|
FigNodeModelElement(GraphModel gm,
Object node)
Partially construct a new FigNode. |
|
| Method Summary | |
private static void |
addAllUniqueModelElementsFrom(Set elements,
Set paths,
Collection source)
Helper method for buildModelList. |
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()
Returns the notation name for this fig. |
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. |
FigText |
getNameFig()
Get the Fig that displays the model element name. |
Vector |
getPopUpActions(MouseEvent me)
|
protected static int |
getPopupAddOffset()
|
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)
|
protected boolean |
isCheckSize()
|
boolean |
isDragConnectable()
|
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)
|
void |
removeEnclosedFig(Fig fig)
|
void |
removeFromDiagram()
|
void |
renderingChanged()
Rerenders the fig if needed. |
protected void |
setBigPort(Fig bp)
|
void |
setContextNotation(NotationName nn)
|
void |
setDiElement(DiElement diElement)
|
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)
|
void |
setPathVisible(boolean visible)
Set the visibility of the path. |
protected void |
setReadyToEdit(boolean v)
|
void |
setShadowSize(int size)
|
protected void |
setSuppressCalcBounds(boolean scb)
|
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 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, 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, 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 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 DiElement diElement
private NotationName currentNotationName
private static final Font LABEL_FONT
private static final Font ITALIC_LABEL_FONT
protected NotationProvider4 notationProviderName
protected static final int ROWHEIGHT
protected static final int STEREOHEIGHT
private boolean checkSize
private static int popupAddOffset
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 Fig bigPort
private FigText nameFig
private Fig stereotypeFig
private Vector enclosedFigs
private Fig encloser
private boolean readyToEdit
private boolean suppressCalcBounds
private int shadowSize
private ItemUID itemUid
private boolean removeFromDiagram
private boolean forceRepaint
private boolean pathVisible
| Constructor Detail |
public FigNodeModelElement()
public FigNodeModelElement(GraphModel gm,
Object node)
gm - ignorednode - the owning UML element| Method Detail |
protected void finalize()
Object.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()
public FigText getNameFig()
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)
private static void addAllUniqueModelElementsFrom(Set elements,
Set paths,
Collection source)
Adds those elements from source that do not have the same path as any path in paths to elements, and its path to paths. Thus elements will never contain two objects with the same path, unless they are added by other means.
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 KeyListenernot used, do nothing.public void keyTyped(KeyEvent ke)
keyTyped in interface KeyListenernot used, do nothing.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)
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 newOwner)
newOwner - the new owner for the listenerspublic NotationName getContextNotation()
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()
public void calcBounds()
Fig.calcBounds()public void enableSizeChecking(boolean flag)
flag - the new valuepublic 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()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 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 diElement)
public DiElement getDiElement()
protected static int getPopupAddOffset()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ArgoUML © 1996-2005 | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |