|
|||||||||||
| 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.FigEdge
org.tigris.gef.presentation.FigEdgePoly
org.argouml.uml.diagram.ui.FigEdgeModelElement
Abstract class to display diagram lines (edges) for UML ModelElements that look like lines and that have editable names.
| Field Summary | |
protected NotationProvider4 |
notationProviderName
|
| Fields inherited from class org.tigris.gef.presentation.FigEdgePoly |
_initiallyLaidOut |
| Fields inherited from class org.tigris.gef.presentation.FigEdge |
_arrowHeadEnd, _arrowHeadStart, _destFigNode, _highlight, _pathItems, _sourceFigNode, _useNearest |
| 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 | |
FigEdgeModelElement()
Partially construct a new FigNode. |
|
FigEdgeModelElement(Object edge)
The constructor that hooks the Fig into the UML 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 and remember the registration. |
protected void |
addElementListener(Object element,
String[] property)
Add a listener and remember the registration. |
protected void |
allowRemoveFromDiagram(boolean allowed)
|
protected boolean |
canEdit(Fig f)
|
void |
damage()
|
void |
delayedVetoableChange(PropertyChangeEvent pce)
|
void |
deleteFromModel()
|
protected Action[] |
getApplyStereotypeActions()
Get the set of Actions which valid for adding/removing Stereotypes on the ModelElement of this Fig's owner. |
NotationName |
getContextNotation()
Deprecated. by MVW in V0.21.3. Replaced by ProjectSettings.getNotationName() |
protected Object |
getDestination()
Returns the destination of the edge. |
DiElement |
getDiElement()
|
FigEdgePort |
getEdgePort()
|
static Font |
getItalicLabelFont()
|
ItemUID |
getItemUID()
Getter for the UID |
static Font |
getLabelFont()
|
String |
getName()
|
Rectangle |
getNameBounds()
Get the Rectangle in which the model elements name is displayed |
protected FigText |
getNameFig()
Getter for name, the name Fig |
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. |
protected Object |
getSource()
Returns the source of the edge. |
protected int |
getSquaredDistance(Point p1,
Point p2)
distance formula: (x-h)^2 + (y-k)^2 = distance^2 |
protected Fig |
getStereotypeFig()
Getter for stereo, the stereotype Fig |
String |
getTipString(MouseEvent me)
|
boolean |
hit(Rectangle r)
|
ToDoItem |
hitClarifier(int x,
int y)
The user clicked on the clarifier. |
protected void |
indicateBounds(FigText f,
Graphics g)
|
protected void |
initNotationProviders(Object own)
Create the NotationProviders. |
void |
keyPressed(KeyEvent ke)
|
void |
keyReleased(KeyEvent ke)
|
void |
keyTyped(KeyEvent ke)
|
void |
makeEdgePort()
Create a FigCommentPort if needed |
Selection |
makeSelection()
Returns a SelectionRerouteEdge object that manages selection
and rerouting of the edge. |
protected void |
modelChanged(PropertyChangeEvent e)
This is called after any part of the UML ModelElement has changed. |
void |
mouseClicked(MouseEvent me)
If the user double clicks on anu part of this FigNode, pass it down to one of the internal Figs. |
void |
mouseEntered(MouseEvent me)
|
void |
mouseExited(MouseEvent me)
|
void |
mousePressed(MouseEvent me)
|
void |
mouseReleased(MouseEvent me)
|
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. |
protected void |
paintClarifiers(Graphics g)
|
void |
postLoad()
|
void |
propertyChange(PropertyChangeEvent pve)
|
protected void |
removeAllElementListeners()
Unregister all listeners registered through addElementListener |
protected void |
removeElementListener(Object element)
Add an element listener and remember the registration. |
void |
removeFromDiagram()
|
protected void |
removeFromDiagramImpl()
|
protected void |
renderingChanged()
Rerenders the fig if needed. |
void |
setContextNotation(NotationName nn)
|
void |
setDiElement(DiElement element)
Set the associated Diagram Interchange element. |
void |
setItemUID(ItemUID newId)
Setter for the UID |
void |
setLayer(Layer lay)
|
void |
setOwner(Object newOwner)
This method should only be called once for any one Fig instance that represents a model element (ie not for a FigEdgeNote). |
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 |
superRemoveFromDiagram()
|
protected void |
textEdited(FigText ft)
This method is called after the user finishes editing a text field that is in the FigEdgeModelElement. |
protected void |
textEditStarted(FigText ft)
This method is called when the user doubleclicked on the text field, and starts editing. |
protected boolean |
updateClassifiers()
Updates the classifiers the edge is attached to. |
protected void |
updateListeners(Object oldOwner,
Object newOwner)
Implementations of this method should register/unregister the fig for all (model)events. |
protected void |
updateNameText()
generate the notation for the modelelement and stuff it into the text Fig |
protected void |
updateStereotypeText()
generate the notation for the stereotype and stuff it into the text Fig |
void |
vetoableChange(PropertyChangeEvent pce)
|
| Methods inherited from class org.tigris.gef.presentation.FigEdgePoly |
computeRouteImpl, findAvoidPt, getPolygon, insertPoint, layoutEdge, makeEdgeFig, moveVertex, paint, routingRectPoint, segOK, setEndPoints, setInitiallyLaidOut, setPoint, setPolygon, tryRoute |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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
| Constructor Detail |
public FigEdgeModelElement()
public FigEdgeModelElement(Object edge)
edge - the UML element| Method Detail |
public void makeEdgePort()
public FigEdgePort getEdgePort()
public void setItemUID(ItemUID newId)
newId - the new UIDpublic ItemUID getItemUID()
public String getTipString(MouseEvent me)
Fig.getTipString(java.awt.event.MouseEvent)public Vector getPopUpActions(MouseEvent me)
getPopUpActions in interface PopupGeneratorPopupGenerator.getPopUpActions(java.awt.event.MouseEvent)protected Action[] getApplyStereotypeActions()
protected int getSquaredDistance(Point p1,
Point p2)
p1 - pointp2 - point
protected void paintClarifiers(Graphics g)
g - the Graphics object
protected void indicateBounds(FigText f,
Graphics g)
f - the fig to indicate the bounds ofg - the graphics
public ToDoItem hitClarifier(int x,
int y)
x - the x of the point clickedy - the y of the point clicked
public Selection makeSelection()
SelectionRerouteEdge object that manages selection
and rerouting of the edge.
protected FigText getNameFig()
public Rectangle getNameBounds()
public String getName()
protected Fig getStereotypeFig()
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)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, but that seems not user-friendly.
ft - the FigText that will be edited and contains the start-textprotected void showHelp(String s)
s - the given string to be localized and shownprotected void textEdited(FigText ft)
ft - the text Fig that has been editedprotected boolean canEdit(Fig f)
f - the Fig
public void mousePressed(MouseEvent me)
mousePressed in interface MouseListenerMouseListener.mousePressed(java.awt.event.MouseEvent)public void mouseReleased(MouseEvent me)
mouseReleased in interface MouseListenerMouseListener.mouseReleased(java.awt.event.MouseEvent)public void mouseEntered(MouseEvent me)
mouseEntered in interface MouseListenerMouseListener.mouseEntered(java.awt.event.MouseEvent)public void mouseExited(MouseEvent me)
mouseExited in interface MouseListenerMouseListener.mouseExited(java.awt.event.MouseEvent)public 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 renderingChanged()
NOTE: If you override this method you probably also want to override the modelChanged() method TODO: Call this method something sensible. What it does rather than one example of when it is called. Its purpose seems to be to update everything if anything has changed. Not very efficient.
protected void modelChanged(PropertyChangeEvent e)
e - the eventprotected void updateNameText()
protected void updateStereotypeText()
public void setOwner(Object newOwner)
IllegalArgumentException - if the owner given is not a model
elementFig.setOwner(java.lang.Object)protected void initNotationProviders(Object own)
own - the current owner
protected void updateListeners(Object oldOwner,
Object newOwner)
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 not imperative that indeed ALL listeners are updated, as long as the ones removed get added again and vice versa.
Additionally, this function may be used by the modelChanged() function.
In this case, it IS imperative that all listeners get removed / added.
newOwner - the new owner for the listenerspublic void setLayer(Layer lay)
Fig.setLayer(org.tigris.gef.base.Layer)public void deleteFromModel()
Fig.deleteFromModel()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 boolean hit(Rectangle r)
Fig.hit(java.awt.Rectangle)public final void removeFromDiagram()
Fig.removeFromDiagram()protected Fig getRemoveDelegate()
protected void removeFromDiagramImpl()
protected void superRemoveFromDiagram()
public void damage()
Fig.damage()protected boolean updateClassifiers()
Updates the classifiers the edge is attached to.
Calls a helper method (layoutThisToSelf) to avoid this edge disappearing if the new source and dest are the same node.
protected Object getSource()
protected Object getDestination()
public void postLoad()
Fig.postLoad()public static Font getLabelFont()
public static Font getItalicLabelFont()
protected void allowRemoveFromDiagram(boolean allowed)
allowed - true if the function RemoveFromDiagram is allowedpublic void setDiElement(DiElement element)
element - the element to be associated with this Figpublic DiElement getDiElement()
protected static int getPopupAddOffset()
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 |