|
|||||||||||
| 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.
| Nested Class Summary |
| Nested classes inherited from class org.tigris.gef.presentation.FigEdge |
|
| Field Summary | |
private FigCommentPort |
commentPort
|
private NotationName |
currentNotationName
The current notation for this fig. |
private DiElement |
diElement
|
private static Font |
ITALIC_LABEL_FONT
|
private ItemUID |
itemUid
|
private static Font |
LABEL_FONT
|
private static Logger |
LOG
|
private FigText |
name
The Fig that displays the name of this model element. |
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 |
removeFromDiagram
Set the removeFromDiagram to false if this edge may not be removed from the diagram. |
private Fig |
stereotypeFig
The Fig that displays the stereotype of this model element. |
| 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 |
| 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 |
allowRemoveFromDiagram(boolean allowed)
|
protected boolean |
canEdit(Fig f)
|
void |
damage()
|
void |
delayedVetoableChange(PropertyChangeEvent pce)
|
void |
deleteFromModel()
|
protected void |
finalize()
|
protected Action[] |
getApplyStereotypeActions()
|
FigCommentPort |
getCommentPort()
|
NotationName |
getContextNotation()
This default implementation simply requests the default notation. |
protected Object |
getDestination()
Returns the destination of the edge. |
DiElement |
getDiElement()
|
static Font |
getItalicLabelFont()
|
ItemUID |
getItemUID()
Getter for the UID |
static Font |
getLabelFont()
|
FigText |
getNameFig()
Getter for name, the name Fig |
Vector |
getPopUpActions(MouseEvent me)
|
protected static int |
getPopupAddOffset()
|
protected Object |
getSource()
Returns the source of the edge. |
int |
getSquaredDistance(Point p1,
Point p2)
distance formula: (x-h)^2 + (y-k)^2 = distance^2 |
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. |
void |
keyPressed(KeyEvent ke)
|
void |
keyReleased(KeyEvent ke)
|
void |
keyTyped(KeyEvent ke)
|
private void |
layoutThisToSelf()
helper method for updateClassifiers() in order to automatically layout an edge that is now from and to the same node type. |
void |
makeCommentPort()
|
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. |
void |
paintClarifiers(Graphics g)
|
void |
postLoad()
|
void |
propertyChange(PropertyChangeEvent pve)
|
void |
removeFromDiagram()
|
void |
renderingChanged()
Rerenders the fig if needed. |
void |
setContextNotation(NotationName nn)
|
void |
setDiElement(DiElement diElement)
|
void |
setItemUID(ItemUID newId)
Setter for the UID |
void |
setLayer(Layer lay)
|
void |
setOwner(Object newOwner)
|
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 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 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 |
computeRoute, findAvoidPt, insertPoint, layoutEdge, makeEdgeFig, moveVertex, paint, routingRectPoint, segOK, setEndPoints, setInitiallyLaidOut, setPoint, tryRoute |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.tigris.gef.ui.Highlightable |
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
private static final Logger LOG
private DiElement diElement
private boolean removeFromDiagram
private static final Font LABEL_FONT
private static final Font ITALIC_LABEL_FONT
private static int popupAddOffset
private FigText name
private Fig stereotypeFig
private FigCommentPort commentPort
private ItemUID itemUid
private NotationName currentNotationName
| Constructor Detail |
public FigEdgeModelElement()
public FigEdgeModelElement(Object edge)
edge - the UML element| Method Detail |
protected void finalize()
Object.finalize()public void makeCommentPort()
public FigCommentPort getCommentPort()
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()
public int getSquaredDistance(Point p1,
Point p2)
p1 - pointp2 - point
public void paintClarifiers(Graphics g)
g - the Graphics object
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.
public FigText getNameFig()
public 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 KeyListenerNot used, do nothing.public void keyTyped(KeyEvent ke)
keyTyped in interface KeyListenerKeyListener.keyTyped(java.awt.event.KeyEvent)protected void modelChanged(PropertyChangeEvent e)
e - the eventprotected void updateNameText()
protected void updateStereotypeText()
public void setOwner(Object newOwner)
Fig.setOwner(java.lang.Object)protected void updateListeners(Object newOwner)
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()
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 boolean hit(Rectangle r)
Fig.hit(java.awt.Rectangle)public void removeFromDiagram()
Fig.removeFromDiagram()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.
private void layoutThisToSelf()
adapted from SelectionWButtons from line 280
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 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 |