|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.ZSceneGraphObject | +--edu.umd.cs.jazz.ZNode | +--edu.umd.cs.jazz.ZLeaf | +--edu.umd.cs.jazz.ZVisualLeaf | +--venice.ZVisualLeafModelElement | +--venice.ZRelationship
ZRelationship is an implementation of VRelationship interface using Jazz graphics library. It can't be instantiated directly but you can instantiate one of its subclasses which are just wrappers for ZRelationship
The arrowhead consist of three lines in the following way:
|\ 2 | \ 1 | / |/ 3 1) mArrowHeadUpDownLine 2) mArrowHeadUpLeftLine 3) mArrowHeadDownLeftLine
Field Summary | |
protected static double |
HEADLEN
pixels used to draw the arrowheads. |
private edu.umd.cs.jazz.component.ZLine |
mArrowHeadDownLeftLine
|
private edu.umd.cs.jazz.component.ZLine |
mArrowHeadUpDownLine
|
private edu.umd.cs.jazz.component.ZLine |
mArrowHeadUpLeftLine
visual components used to draw the arrowhead to the line |
private java.util.LinkedList |
mCompositeRelationshipList
The list of relationships which are represented by this relationship |
private edu.umd.cs.jazz.ZNode |
mDst
destination model element of the relationship |
private boolean |
mIsRepresentedByOtherRelationship
Is this relationship represented by some other relationship |
private edu.umd.cs.jazz.component.ZLine |
mLine
visual component used to draw the line from src to dest |
private boolean |
mListenersEnabled
a not-serialized variable telling that no listeners are enabled. after deserialization, the value of this will always be false. |
private boolean |
mPreviousUseDashed
in case of realization, this variable stores last drawing style |
private int |
mRelationshipType
type of this relationship. |
private edu.umd.cs.jazz.ZNode |
mSrc
source model element of the relationship |
private edu.umd.cs.jazz.component.ZLabel |
mTypeLabel
visual component used to draw the label on the line |
private static java.awt.BasicStroke |
stDashedStroke
a Java2D pen stroke used to draw a dashed line (e.g. dependency) |
private static java.awt.BasicStroke |
stSolidStroke
a Java2D pen stroke use to draw a solid line |
protected static int |
TYPE_DEPENDENCY
a constant which tells that this instance is a dependency |
protected static int |
TYPE_GENERALIZATION
a constant which tells that this instance is a generalization |
protected static int |
TYPE_REALIZATION
a constant which tells that this instance is a realization |
Fields inherited from class edu.umd.cs.jazz.ZVisualLeaf |
cacheVolatile, visualComponents |
Fields inherited from class edu.umd.cs.jazz.ZNode |
clientProperties, editorFactory, findable, findable_DEFAULT, hasNodeListener, hasNodeListener_DEFAULT, parent, pickable, pickable_DEFAULT, savable, savable_DEFAULT, selectable, selectable_DEFAULT |
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
bounds, inClone, listenerList, objRefTable, volatileBounds, volatileBounds_DEFAULT |
Constructor Summary | |
ZRelationship(java.lang.String inId,
int inRelationshipType,
boolean inInitialListenersEnabled)
constructor used by subclasses to instantiate a ZRelationship with corrent relationship type |
Method Summary | |
void |
addRelationship(VRelationship inRelationship)
Relationships cannot have relationships attached to themselves so this method does nothing. |
void |
addVRelationshipAsSubrelationship(VRelationship inRel)
Add the given VRelationship as a subrelationship for this VRelationship. |
void |
boundsChanged(edu.umd.cs.jazz.event.ZNodeEvent e)
|
protected void |
dataChanged()
takes care of adjusting the appearance according to changes in information |
VModelElement |
getDestination()
Returns the destination of the relationship |
boolean |
getIsRepresentedBySomeoneElse()
Tells whether this relationship is represented by some other relationship or not. |
java.awt.geom.Point2D |
getRelationshipConnectPoint()
get the point where relationships should be attached to. |
java.util.LinkedList |
getRelationships(VPackage inLeaveThisPackage)
As relationships cannot have relationships attached to themselves, this method will always return null. |
int |
getRelationshipType()
Returns the type of this relationship which may be one of the following: relization, generalization or dependency. |
VModelElement |
getSource()
Returns the source of the relationship |
java.util.LinkedList |
getSubrelationships()
Returns the list of subrelationships if this VRelationship is a composite relationship. |
void |
globalBoundsChanged(edu.umd.cs.jazz.event.ZNodeEvent e)
|
java.awt.geom.Point2D |
intersectWithLine(java.awt.geom.Line2D inLine)
Intersect this visualization element with a line. |
boolean |
isCompositeRelationship()
Tells whether this VRelationship is a composite relationship representing one or more other relationships. |
boolean |
leavesVPackage(VPackage inPackage)
Tells whether this relationship leaves the given VPackage .
|
void |
removeSubrelationship(VRelationship inRelationshipToRemove)
Removes the given relationship from this relationship's list of subrelationships. |
void |
setDestination(VModelElement inElement)
Sets the destination end of the relationship Arrow end is targeted towards the destination |
void |
setIsRepresentedBySomeoneElse(boolean inValue)
Sets whether this relationship is represented by some other relationship or not. |
void |
setLabelVisible(boolean inLabelVisible)
Set whether relationships draw their labels or not. |
void |
setListenersEnabled(boolean inEnabled,
boolean inRecurse)
sets all listeners of this object uses to be either enabled or disabled. |
void |
setSource(VModelElement inElement)
sets the source end of the relationship |
Methods inherited from class edu.umd.cs.jazz.ZVisualLeaf |
addVisualComponent, addVisualComponents, clearVisualComponents, computeBounds, duplicateObject, getFirstVisualComponent, getNumVisualComponents, getVisualComponent, getVisualComponentBounds, getVisualComponentGlobalBounds, getVisualComponents, getVolatileBounds, indexOf, pick, removeVisualComponent, render, setState, setVisualComponent, setVisualComponent, trimToSize, updateObjectReferences, updateVolatility, writeObject, writeObject, writeObjectRecurse |
Methods inherited from class edu.umd.cs.jazz.ZNode |
|
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
addMouseListener, addMouseMotionListener, clone, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getListenerList, hasLisenerOfType, hasMouseListener, processMouseEvent, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, setVolatileBounds |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Methods inherited from interface venice.VModelElement |
addToCompositeRelationshipList, debugDump, getCompositeRelationships, getId, getName, getType, getVisible, getVParent, setName, setType, setVisible |
Field Detail |
protected static final int TYPE_DEPENDENCY
protected static final int TYPE_GENERALIZATION
protected static final int TYPE_REALIZATION
protected static final double HEADLEN
private edu.umd.cs.jazz.ZNode mSrc
private edu.umd.cs.jazz.ZNode mDst
private edu.umd.cs.jazz.component.ZLine mLine
private edu.umd.cs.jazz.component.ZLine mArrowHeadUpLeftLine
private edu.umd.cs.jazz.component.ZLine mArrowHeadDownLeftLine
private edu.umd.cs.jazz.component.ZLine mArrowHeadUpDownLine
private edu.umd.cs.jazz.component.ZLabel mTypeLabel
private int mRelationshipType
private boolean mPreviousUseDashed
private java.util.LinkedList mCompositeRelationshipList
private boolean mIsRepresentedByOtherRelationship
private static java.awt.BasicStroke stDashedStroke
private static java.awt.BasicStroke stSolidStroke
private transient boolean mListenersEnabled
Constructor Detail |
public ZRelationship(java.lang.String inId, int inRelationshipType, boolean inInitialListenersEnabled)
Method Detail |
public VModelElement getSource()
VRelationship
getSource
in interface VRelationship
public VModelElement getDestination()
VRelationship
getDestination
in interface VRelationship
public void setSource(VModelElement inElement)
VRelationship
setSource
in interface VRelationship
public void setDestination(VModelElement inElement)
VRelationship
setDestination
in interface VRelationship
public java.awt.geom.Point2D getRelationshipConnectPoint()
VModelElement
getRelationshipConnectPoint
in interface VModelElement
venice.VModelElement
public void setListenersEnabled(boolean inEnabled, boolean inRecurse)
ListenerStateChangeable
setListenersEnabled
in interface ListenerStateChangeable
venice.ListenerStateChangeable
inEnabled
- new state for listenersinRecurse
- whether to recurse to vmodelelement childrenprotected void dataChanged()
dataChanged
in class ZVisualLeafModelElement
public void boundsChanged(edu.umd.cs.jazz.event.ZNodeEvent e)
boundsChanged
in interface edu.umd.cs.jazz.event.ZNodeListener
public void globalBoundsChanged(edu.umd.cs.jazz.event.ZNodeEvent e)
globalBoundsChanged
in interface edu.umd.cs.jazz.event.ZNodeListener
public java.awt.geom.Point2D intersectWithLine(java.awt.geom.Line2D inLine)
VModelElement
intersectWithLine
in interface VModelElement
venice.VModelElement
inLine
- the line to calculate intersection withpublic java.util.LinkedList getRelationships(VPackage inLeaveThisPackage)
getRelationships
in interface VModelElement
getRelationships
in class ZVisualLeafModelElement
public void addRelationship(VRelationship inRelationship)
addRelationship
in interface VModelElement
addRelationship
in class ZVisualLeafModelElement
venice.VModelElement
inRelationship
- add given relation as an original
relationship for this model element.public boolean leavesVPackage(VPackage inPackage)
VRelationship
VPackage
.
If inPackage is null, this function returns true.leavesVPackage
in interface VRelationship
venice.VRelationship
inPackage
- the package to check for leaving, can be nullpublic void addVRelationshipAsSubrelationship(VRelationship inRel)
VRelationship
addVRelationshipAsSubrelationship
in interface VRelationship
venice.VRelationship
inRel
- the relationship to add as subrelationshippublic boolean isCompositeRelationship()
VRelationship
isCompositeRelationship
in interface VRelationship
venice.VRelationship
public java.util.LinkedList getSubrelationships()
VRelationship
getSubrelationships
in interface VRelationship
venice.VRelationship
public void removeSubrelationship(VRelationship inRelationshipToRemove)
VRelationship
removeSubrelationship
in interface VRelationship
venice.VRelationship
inRelationshipToRemove
- the relationship to remove from
subrelationshipspublic int getRelationshipType()
This is a partial hack solution, because one might argue that type should be represented as a class hierarchy.
public void setIsRepresentedBySomeoneElse(boolean inValue)
VRelationship
setIsRepresentedBySomeoneElse
in interface VRelationship
venice.VRelationship
inValue
- whether this relationship is represented by some other
relationship or notpublic boolean getIsRepresentedBySomeoneElse()
VRelationship
getIsRepresentedBySomeoneElse
in interface VRelationship
venice.VRelationship
public void setLabelVisible(boolean inLabelVisible)
VRelationship
setLabelVisible
in interface VRelationship
venice.VRelationship
inLabelVisible
- whether to draw label or not
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |