agg.xt_basis
Interface Type

All Superinterfaces:
XMLObject
All Known Implementing Classes:
ArcTypeImpl, NodeTypeImpl, TypeImpl

public interface Type
extends XMLObject

Instances of this class are used for dynamic typing of graphobjects. Each type is associated with a name (also called "string representation"). Note that two types with the same name need not be equal.


Field Summary
static int UNDEFINED
           
 
Method Summary
 void addParent(Type t)
           
 boolean addTypeGraphObject(GraphObject nodeOrArc)
          Add the given GraphObject to this type.
 void addTypeUser(GraphObject nodeOrArc)
          Add the specified GraphObject nodeOrArc: in case of Node - to my TypeGraphNode and in case of Arc - to my TypeGraphArc of a TypeGraph, if it exists.
 void addTypeUser(GraphObject nodeOrArc, Graph context)
          Add the specified GraphObject nodeOrArc: in case of Node - to my TypeGraphNode and in case of Arc - to my TypeGraphArc of a TypeGraph, if it exists.
 void addUsingGraphObject(GraphObject nodeOrArc)
          Deprecated. replaced by addTypeUser(GraphObject nodeOrArc)
 void addUsingGraphObject(GraphObject nodeOrArc, Graph g)
          Deprecated. replaced by addTypeUser(GraphObject nodeOrArc, Graph g)
 TypeError check(GraphObject graphObject, int level)
          returns if the given GraphObject is valid typed as defined in the type graph.
 TypeError checkIfNodeCreatable(Graph basisGraph, int levelOfTypeGraphCheck)
           
 TypeError checkIfRemovable(Node node, int level)
          returns if the given node could be removed.
 TypeError checkIfRemovableFromSource(GraphObject node, Arc arc, int level)
          returns if the given arc could be removed from the given node so the node would be valid typed.
 TypeError checkIfRemovableFromTarget(GraphObject node, Arc arc, int level)
          returns if the given arc could be removed from the given node so the node would be valid typed.
 boolean compareTo(Type t)
          compares the given type with this object.
 java.lang.String convertToKey()
          returns a string containing the name, all attributes and the additional string seperated by ":".
 java.lang.String getAdditionalRepr()
          returns the additional string
 java.util.Vector<Type> getAllChildren()
          returns a list with all the children of the current type and itself as first element
 java.util.Vector<Type> getAllParents()
          returns a list with all the parents of the current type and itself as first element
 AttrType getAttrType()
          Returns the associated attribute type.
 java.util.Vector<Type> getChildren()
          Returns its direct children only.
 java.util.List<Type> getCommonParentWith(Type t)
           
 java.lang.String getImageFilename()
           
 java.lang.String getName()
          Returns the name of the type.
 Type getParent()
          Returns the parent.
 java.util.Vector<Type> getParents()
           
 int getSourceMax()
           
 int getSourceMax(Type sourceType, Type targetType)
           
 int getSourceMin()
           
 int getSourceMin(Type sourceType, Type targetType)
           
 java.lang.String getStringRepr()
          Returns the string representation.
 int getTargetMax(Type sourceType, Type targetType)
           
 int getTargetMin(Type sourceType, Type targetType)
           
 java.lang.String getTextualComment()
           
 Arc getTypeGraphArcObject(Type sourceType, Type targetType)
          returns a type graph edge, if it is defined.
 Node getTypeGraphNodeObject()
          returns a type graph node, if it is defined.
 java.util.Vector<GraphObject> getTypeUsers()
           
 boolean hasTypeGraphArc()
           
 boolean hasTypeGraphNode()
           
 boolean isAbstract()
           
 boolean isArcType()
           
 boolean isChildOf(Type t)
          compares the given type with this object and its ancestors
 boolean isNodeType()
           
 boolean isObjectOfTypeGraphArcVisible(Type sourceType, Type targetType)
           
 boolean isObjectOfTypeGraphNodeVisible()
           
 boolean isParentOf(Type t)
          compares the given type and its ancestors with this object
 boolean isRelatedTo(Type t)
          Finds out if there is any relation between this type and the given one.
 boolean isTypeGraphObjectDefined()
          returns true, if there is at least one object in the type graph for this type.
 void removeAllTypeGraphObjects()
          remove type graph objects from this type.
 void removeParent(Type t)
           
 boolean removeTypeGraphObject(GraphObject nodeOrArc)
          Remove the given GraphObject of the type graph from this type.
 boolean removeTypeGraphObject(GraphObject nodeOrArc, boolean forceToRemove)
           
 void removeTypeUser(GraphObject nodeOrArc)
          Remove the specified GraphObject nodeOrArc: in case of Node - from my TypeGraphNode and in case of Arc - from my TypeGraphArc of a TypeGraph, if it exists.
 void removeUsingGraphObject(GraphObject nodeOrArc)
          Deprecated. replaced by removeTypeUser(GraphObject nodeOrArc)
 void setAbstract(boolean b)
           
 void setAdditionalRepr(java.lang.String repr)
          set an additional graphical string, which is saved together with the name string representation.
 void setImageFilename(java.lang.String imageFilename)
           
 void setParent(Type t)
          Sets the parent.
 void setSourceMax(int value)
           
 void setSourceMax(Type sourceType, Type targetType, int value)
           
 void setSourceMin(int value)
           
 void setSourceMin(Type sourceType, Type targetType, int value)
           
 void setStringRepr(java.lang.String n)
          Sets the string representation.
 void setTargetMax(Type sourceType, Type targetType, int value)
           
 void setTargetMin(Type sourceType, Type targetType, int value)
           
 void setTextualComment(java.lang.String comment)
           
 void setVisibilityOfObjectsOfTypeGraphNode(boolean vis)
           
 void setVisibityOfObjectsOfTypeGraphArc(Type sourceType, Type targetType, boolean vis)
           
 
Methods inherited from interface agg.util.XMLObject
XreadObject, XwriteObject
 

Field Detail

UNDEFINED

static final int UNDEFINED
See Also:
Constant Field Values
Method Detail

getStringRepr

java.lang.String getStringRepr()
Returns the string representation. Mostly used as the name of the type.


getParent

Type getParent()
Returns the parent.


getParents

java.util.Vector<Type> getParents()

getName

java.lang.String getName()
Returns the name of the type.


setStringRepr

void setStringRepr(java.lang.String n)
Sets the string representation. Mostly used as the name of the type


setParent

void setParent(Type t)
Sets the parent.


addParent

void addParent(Type t)

removeParent

void removeParent(Type t)

getChildren

java.util.Vector<Type> getChildren()
Returns its direct children only.


getAttrType

AttrType getAttrType()
Returns the associated attribute type.


compareTo

boolean compareTo(Type t)
compares the given type with this object.

Returns:
true, if the given type has the same name, attributes and additional string

setAdditionalRepr

void setAdditionalRepr(java.lang.String repr)
set an additional graphical string, which is saved together with the name string representation. Here you can save additional information used in another layer. Predefined additional string: if the specified String repr is "NODE" or "[NODE]", then additionalRepr = ":RECT:java.awt.Color[r=0,g=0,b=0]::[NODE]:" , if the specified String repr is "EDGE" or "[EDGE]", then additionalRepr = ":SOLID_LINE:java.awt.Color[r=0,g=0,b=0]::[EDGE]:" . This format of additional type information is used for the graphical layout information of nodes and edges.


getAdditionalRepr

java.lang.String getAdditionalRepr()
returns the additional string

See Also:
setAdditionalRepr(java.lang.String)

setImageFilename

void setImageFilename(java.lang.String imageFilename)

getImageFilename

java.lang.String getImageFilename()

setTextualComment

void setTextualComment(java.lang.String comment)

getTextualComment

java.lang.String getTextualComment()

isArcType

boolean isArcType()

isNodeType

boolean isNodeType()

setAbstract

void setAbstract(boolean b)

isAbstract

boolean isAbstract()

isChildOf

boolean isChildOf(Type t)
compares the given type with this object and its ancestors

Returns:
true, if the given type or one of its ancestors has the same name, attributes and additional string

isParentOf

boolean isParentOf(Type t)
compares the given type and its ancestors with this object

Returns:
true, if the given type has the same name, attributes and additional string as t or one of its ancestors

isRelatedTo

boolean isRelatedTo(Type t)
Finds out if there is any relation between this type and the given one. Two types are related if they have one common ancestor.


getAllParents

java.util.Vector<Type> getAllParents()
returns a list with all the parents of the current type and itself as first element

Returns:
list of all parents

getCommonParentWith

java.util.List<Type> getCommonParentWith(Type t)

getAllChildren

java.util.Vector<Type> getAllChildren()
returns a list with all the children of the current type and itself as first element

Returns:
list of all children

convertToKey

java.lang.String convertToKey()
returns a string containing the name, all attributes and the additional string seperated by ":".


check

TypeError check(GraphObject graphObject,
                int level)
returns if the given GraphObject is valid typed as defined in the type graph. Before this can be checked, all edges and nodes of the type graph must be added to theire types. The given object will not tested if this is its type.

Parameters:
graphObject - the object to test
level - a type graph check level, as defined in TypeSet.setLevelOfTypeGraphCheck(int)
Returns:
null, if the graphobject is valid typed otherwise a TypeError if there was a mismatch

checkIfRemovable

TypeError checkIfRemovable(Node node,
                           int level)
returns if the given node could be removed. This check makes only sense, if the minimum multiplicity check is activated.

Parameters:
node - the node which will be removed.
level - the actual level. If not set to TypeSet.ENABLED_MAX_MIN this method will do nothing.
Returns:
null, if the node will be valid typed even after removing the arc otherwise a TypeError containing the possible fault.

checkIfRemovableFromSource

TypeError checkIfRemovableFromSource(GraphObject node,
                                     Arc arc,
                                     int level)
returns if the given arc could be removed from the given node so the node would be valid typed. This check makes only sense, if the minimum multiplicity check is activated.

Parameters:
node - the node which will be modified. This node has to be the source of the arc and has to have this type.
arc - the arc which will be removed
level - the actual level. If not set to TypeSet.ENABLED_MAX_MIN this method will do nothing.
Returns:
null, if the node will be valid typed even after removing the arc otherwise a TypeError containing the possible fault.

checkIfRemovableFromTarget

TypeError checkIfRemovableFromTarget(GraphObject node,
                                     Arc arc,
                                     int level)
returns if the given arc could be removed from the given node so the node would be valid typed. This check makes only sense, if the minimum multiplicity check is activated.

Parameters:
node - the node which will be modified. This node has to be the target of the arc and has to have this type.
arc - the arc which will be removed
level - the actual level. If not set to TypeSet.ENABLED_MAX_MIN this method will do nothing.
Returns:
null, if the node will be valid typed even after removing the arc otherwise a TypeError containing the possible fault.

addTypeGraphObject

boolean addTypeGraphObject(GraphObject nodeOrArc)
Add the given GraphObject to this type. The GraphObject is a node or an arc of a TypeGraph. Only one GraphObject of each type is allowed.

Returns:
true, if the graph object could be added.

removeTypeGraphObject

boolean removeTypeGraphObject(GraphObject nodeOrArc)
Remove the given GraphObject of the type graph from this type. The GraphObject must be added before. Returns true if this type graph object is removed, otherwise false (esp. if the type is in use and the type graph check is activated).


removeTypeGraphObject

boolean removeTypeGraphObject(GraphObject nodeOrArc,
                              boolean forceToRemove)

isTypeGraphObjectDefined

boolean isTypeGraphObjectDefined()
returns true, if there is at least one object in the type graph for this type.


getTypeGraphNodeObject

Node getTypeGraphNodeObject()
returns a type graph node, if it is defined.


hasTypeGraphNode

boolean hasTypeGraphNode()

setVisibilityOfObjectsOfTypeGraphNode

void setVisibilityOfObjectsOfTypeGraphNode(boolean vis)

setVisibityOfObjectsOfTypeGraphArc

void setVisibityOfObjectsOfTypeGraphArc(Type sourceType,
                                        Type targetType,
                                        boolean vis)

isObjectOfTypeGraphNodeVisible

boolean isObjectOfTypeGraphNodeVisible()

isObjectOfTypeGraphArcVisible

boolean isObjectOfTypeGraphArcVisible(Type sourceType,
                                      Type targetType)

getTypeGraphArcObject

Arc getTypeGraphArcObject(Type sourceType,
                          Type targetType)
returns a type graph edge, if it is defined.


hasTypeGraphArc

boolean hasTypeGraphArc()

removeAllTypeGraphObjects

void removeAllTypeGraphObjects()
remove type graph objects from this type.


addTypeUser

void addTypeUser(GraphObject nodeOrArc)
Add the specified GraphObject nodeOrArc: in case of Node - to my TypeGraphNode and in case of Arc - to my TypeGraphArc of a TypeGraph, if it exists.

Parameters:
nodeOrArc -

addTypeUser

void addTypeUser(GraphObject nodeOrArc,
                 Graph context)
Add the specified GraphObject nodeOrArc: in case of Node - to my TypeGraphNode and in case of Arc - to my TypeGraphArc of a TypeGraph, if it exists.

Parameters:
nodeOrArc - a node resp. arc of the context graph
context - the context graph of the node resp. arc

addUsingGraphObject

void addUsingGraphObject(GraphObject nodeOrArc)
Deprecated. replaced by addTypeUser(GraphObject nodeOrArc)


addUsingGraphObject

void addUsingGraphObject(GraphObject nodeOrArc,
                         Graph g)
Deprecated. replaced by addTypeUser(GraphObject nodeOrArc, Graph g)


getTypeUsers

java.util.Vector<GraphObject> getTypeUsers()

removeUsingGraphObject

void removeUsingGraphObject(GraphObject nodeOrArc)
Deprecated. replaced by removeTypeUser(GraphObject nodeOrArc)


removeTypeUser

void removeTypeUser(GraphObject nodeOrArc)
Remove the specified GraphObject nodeOrArc: in case of Node - from my TypeGraphNode and in case of Arc - from my TypeGraphArc of a TypeGraph, if it exists.

Parameters:
nodeOrArc -

setSourceMin

void setSourceMin(Type sourceType,
                  Type targetType,
                  int value)

setSourceMax

void setSourceMax(Type sourceType,
                  Type targetType,
                  int value)

setTargetMin

void setTargetMin(Type sourceType,
                  Type targetType,
                  int value)

setTargetMax

void setTargetMax(Type sourceType,
                  Type targetType,
                  int value)

getSourceMin

int getSourceMin(Type sourceType,
                 Type targetType)

getSourceMax

int getSourceMax(Type sourceType,
                 Type targetType)

getTargetMin

int getTargetMin(Type sourceType,
                 Type targetType)

getTargetMax

int getTargetMax(Type sourceType,
                 Type targetType)

setSourceMin

void setSourceMin(int value)

setSourceMax

void setSourceMax(int value)

getSourceMin

int getSourceMin()

getSourceMax

int getSourceMax()

checkIfNodeCreatable

TypeError checkIfNodeCreatable(Graph basisGraph,
                               int levelOfTypeGraphCheck)