venice
Interface VModelElement

All Known Subinterfaces:
VComponent, VDependency, VGeneralization, VInterface, VPackage, VRealization, VRelationship
All Known Implementing Classes:
ZVisualLeafModelElement

public interface VModelElement

VModelElement is a common interface for different kinds of visualized model elements of which the visualized model consists. Using methods in this interface, common parameters to all visualization elements can be accessed. Every visual model element has an ID which should be unique. Name and type does not have to be unique.

Author:
Hannu Laurila

Method Summary
 void addRelationship(VRelationship inRelationship)
          Add the given VRelationship, where this element is either the source or destination, to this element's list of original relationships.
 VRelationship addToCompositeRelationshipList(VRelationship inRel)
          Add the given relationship to this element's list of composite relationships.
 void debugDump()
          Dump information for this node to stdout.
 java.util.LinkedList getCompositeRelationships()
          Returns the list of all composite relationships this element has.
 java.lang.String getId()
          returns the id of the element
 java.lang.String getName()
          returns the name of the element
 java.awt.geom.Point2D getRelationshipConnectPoint()
          get the point where relationships should be attached to.
 java.util.LinkedList getRelationships(VPackage inLeaveThisPackage)
          Returns a linked list of relationships that leave the given VPackage and are attached to this node and are not represented by any other relationship.
 java.lang.String getType()
          returns the type of the element
 boolean getVisible()
          returns true if element is shown in the visualization
 VPackage getVParent()
          get parent package for this node.
 java.awt.geom.Point2D intersectWithLine(java.awt.geom.Line2D inLine)
          Intersect this visualization element with a line.
 void setName(java.lang.String inName)
          sets the name of the element
 void setType(java.lang.String inType)
          sets the type of the element
 void setVisible(boolean inState)
          sets the visibility of the element
 

Method Detail

getId

public java.lang.String getId()
returns the id of the element

getName

public java.lang.String getName()
returns the name of the element

getType

public java.lang.String getType()
returns the type of the element

getVisible

public boolean getVisible()
returns true if element is shown in the visualization

setName

public void setName(java.lang.String inName)
sets the name of the element

setType

public void setType(java.lang.String inType)
sets the type of the element

setVisible

public void setVisible(boolean inState)
sets the visibility of the element

getRelationshipConnectPoint

public java.awt.geom.Point2D getRelationshipConnectPoint()
get the point where relationships should be attached to. Probably element center. This method cannot return null.
Returns:
the point for relationships to attach to

intersectWithLine

public java.awt.geom.Point2D intersectWithLine(java.awt.geom.Line2D inLine)
Intersect this visualization element with a line. If these graphic elements don't intersect, null is returned.
Parameters:
inLine - the line to calculate intersection with
Returns:
the point of intersection or null

getRelationships

public java.util.LinkedList getRelationships(VPackage inLeaveThisPackage)
Returns a linked list of relationships that leave the given VPackage and are attached to this node and are not represented by any other relationship. If this element is a package, relationships from all children that cross the given border are returned also.

Relationships can be original relationships as described in the model or temporary relationships created to reprensent composite relationships that are needed when child nodes move their dependencies to their parents.

If the parameter is null, all relationships attached to this node are returned.

Parameters:
inLeaveThisPackage - the package that all returned relationships must leave
Returns:
linked list of relationships for this node and its children that cross the given package

addRelationship

public void addRelationship(VRelationship inRelationship)
Add the given VRelationship, where this element is either the source or destination, to this element's list of original relationships. Original relationships are those relations that are defined in the GXL model, not created on the fly by the visualization.
Parameters:
inRelationship - add given relation as an original relationship for this model element.

getVParent

public VPackage getVParent()
get parent package for this node.

getCompositeRelationships

public java.util.LinkedList getCompositeRelationships()
Returns the list of all composite relationships this element has.
Returns:
the list of composite relationships for this element

addToCompositeRelationshipList

public VRelationship addToCompositeRelationshipList(VRelationship inRel)
Add the given relationship to this element's list of composite relationships.
Parameters:
inRel - The relationship to add to list of composite relationships.
Returns:
the new composite VRelationship in which inRel was added or null if inRel was added in an old composite VRelationship

debugDump

public void debugDump()
Dump information for this node to stdout.