|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.auburn.VGJ.graph.Graph | +--EDU.utwente.CoCompose.lang.Model
Represents a design model made in the CoCompose language.
Field Summary | |
protected UniqueRealm |
typeRealm
The composite type unique realm. |
Fields inherited from class EDU.auburn.VGJ.graph.Graph |
edges_, idHash_, lastTopId_, nodeList_ |
Constructor Summary | |
Model()
Constructs an empty Model. |
|
Model(java.lang.String uri,
java.lang.String name)
Constructs a Model from an XML document. |
Method Summary | |
void |
accept(ModelVisitor visitor)
Accepts a ModelVisitor. |
void |
addTransPriority(java.lang.String language,
java.lang.String form)
Adds a concept form translation priority to the user defined heuristic. |
protected void |
applyCorrectnessConstraint(Link link)
Enforces correctness constraints for the AbstractConcepts in the link. |
void |
checkCompleteness()
Checks the completeness of the entire model. |
void |
checkCorrectness()
Checks the correctness of the entire model. |
void |
clearTransPriorities()
Clears the translation priority user defined heuristics. |
java.lang.Object |
clone()
Creates a deep copy of the model using only persistent attributes (XML). |
void |
copyTransPriorities(Model from)
Copies the translation priorities from another model. |
Composite |
firstComposite()
Gets first composite from the model. |
CompositePartConcept |
firstCompositePartConcept()
Gets first composite part concept from the model. |
Concept |
firstConcept()
Gets first concept from the model. |
Node |
firstFreeNode()
Gets first free, non-contained node from the model. |
AbstractConcept |
getAbstractConcept(java.lang.String name,
java.lang.String namespace)
Gets the AbstractConcept with the given name in the given unique realm. |
java.util.Collection |
getAbstractConcepts()
Gets the contained AbstractConcepts. |
java.util.Collection |
getAbstractConcepts(AbstractConcept copiedFrom)
Gets the AbstractConcepts that were copied from the given AbstractConcept. |
java.util.Collection |
getAbstractConcepts(AbstractConcept copiedFrom,
UniqueRealm inRealm)
Gets the AbstractConcepts that were copied from the given AbstractConcept. |
boolean |
getAlignToGrid()
Gets align to grid attribute. |
AppliedPatterns |
getAppliedPatterns()
Gets the applied solution patterns for this model. |
int |
getCompositeCount()
Gets composite count. |
int |
getFreeNodeCount()
Gets free nodes count, which is the number of nodes excluding all contained nodes, such as composite roles. |
java.util.Collection |
getLinkedNodes(java.lang.Object node)
Gets a collection of nodes linked to the given node. |
java.util.Enumeration |
getLinks()
Gets all links in the model. |
java.util.Enumeration |
getLinks(java.lang.Object node)
Gets all links connected to the given node. |
java.lang.String |
getName()
Gets the name of the model/unique realm. |
Node |
getNodeAt(DPoint3 pos)
Gets the node at the given position. |
java.lang.String |
getTargetLanguage()
Gets target language to translate the model to. |
java.util.Enumeration |
getTransLanguages()
Gets the list of target languages for which translation priorities have been defined. |
java.util.Enumeration |
getTransPriorities(java.lang.String language)
Gets the concept form translation priorities for the target language. |
void |
insertLink(Link link)
Inserts a link, if it is legal. |
int |
insertNode()
Insert a new Node object in the model. |
int |
insertNode(Node node)
Insert a node in the model. |
void |
insertTransPriority(java.lang.String language,
java.lang.String form,
int index)
Inserts a concept form translation priority to the user defined heuristic. |
boolean |
isUnique(java.lang.String value)
Checks whether the given value is unique within the realm. |
void |
linkNodes(Node node,
java.util.Collection nodes)
Links nodes to the given node. |
protected void |
linkToXML(org.xml.sax.helpers.DefaultHandler handler,
Link link)
Create XML from link using a SAX DefaultHandler. |
protected boolean |
newLinkOk(Link link)
Checks whether a new link can be made between these nodes. |
Composite |
nextComposite(Node prev_node)
Gets next composite from the model. |
CompositePartConcept |
nextCompositePartConcept(Node prev_node)
Gets next composite part concept from the model. |
Concept |
nextConcept(Node prev_node)
Gets next concept from the model. |
Node |
nextFreeNode(Node prev_node)
Gets next free, non-contained node from the model. |
int |
numberOfEdges()
Gets the number of edges in the model. |
void |
refreshFromComposite(Composite fromComp)
Updates all the composites in the model using the given composite type data. |
void |
register(java.lang.String value)
Registers a new value in the realm. |
void |
removeEdge(int n1,
int n2)
Remove the connection from n1 to n2 but leave the nodes in place. |
void |
removeNode(int n)
Remove the node from the graph (also removes the links connected to it). |
void |
removeNodeFromId(int id)
Remove the node from the graph (also removes the links connected to it). |
void |
removeTransPriority(java.lang.String language,
java.lang.String form)
Removes a concept form translation priority from the user defined heuristic. |
void |
replaceNode(int n,
Node node)
Replaces the node at position n by the given node, keeping the links. |
java.lang.Object |
safeClone()
Creates a deep copy of the model. |
void |
saveStates()
Calls saveState for each Node and Link in the model. |
void |
setAlignToGrid(boolean align)
Sets align to grid attribute. |
void |
setInsertNode(Node node_in)
Sets a Node object for insertion in the model. |
void |
setName(java.lang.String name)
Sets the name of the model/unique realm. |
void |
setTargetLanguage(java.lang.String language)
Sets target language to translate the model to. |
protected static java.lang.String |
SystemPath(java.lang.String systemId,
java.lang.String modelPath)
Calculates the path to the system DTD. |
void |
toXML(org.xml.sax.helpers.DefaultHandler handler,
boolean selectedOnly,
java.lang.String path)
Create an XML document from the model using a SAX DefaultHandler. |
void |
unRegister(java.lang.String value)
Unregisters a value from the realm. |
Methods inherited from class EDU.auburn.VGJ.graph.Graph |
children, copy, dummysToEdgePaths, firstAvailable, firstNode, firstNodeIndex, getEdge, getEdgePathPoints, getEdges, getIndexFromNode, getNodeFromId, getNodeFromIndex, group, highestIndex, insertEdge, insertEdge, insertEdge, insertEdge, insertNode, insertNodeAt, isDirected, killGroup, nextNode, nextNodeIndex, nodeFromIndex, numberOfNodes, pack, parents, removeEdge, removeEdgePaths, removeGroups, removeNode, setDirected, setGMLvalues, setNodeGroup |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected UniqueRealm typeRealm
Constructor Detail |
public Model()
public Model(java.lang.String uri, java.lang.String name) throws CoComposeException
uri
- Location of the XML document.name
- The model nameCoComposeException
- if the Model could not be created.Method Detail |
protected static java.lang.String SystemPath(java.lang.String systemId, java.lang.String modelPath)
systemId
- - the system DTD relative to application executable path.protected void linkToXML(org.xml.sax.helpers.DefaultHandler handler, Link link) throws org.xml.sax.SAXException
handler
- The SAX DefaultHandler.link
- The link to get the GML data from.org.xml.sax.SAXException
- if an XML handler error occurs.protected boolean newLinkOk(Link link)
link
- The link to check.protected void applyCorrectnessConstraint(Link link) throws CoComposeException
link
- The link of which to check the involved AbstractConcepts.CoComposeException
- if correctness constraints did not apply.public void linkNodes(Node node, java.util.Collection nodes) throws CoComposeException
node
- The node to link the other nodes to.nodes
- A collection of other nodes to link.CoComposeException
- if not all links could be made.public void insertLink(Link link) throws CoComposeException
link
- The link to insert.CoComposeException
- if the link is illegal.public void removeEdge(int n1, int n2)
removeEdge
in class Graph
n1
- index of the first node on the edgen2
- index of the second node on the edgepublic void saveStates()
public boolean getAlignToGrid()
public void setAlignToGrid(boolean align)
align
- The align to grid attribute.public void setInsertNode(Node node_in)
node_in
- The Node to insert.public int insertNode()
insertNode
in class Graph
public int insertNode(Node node)
node
- The Node object to insert.public void removeNode(int n)
removeNode
in class Graph
n
- The node index.public void removeNodeFromId(int id)
id
- The id of the node to remove.public void replaceNode(int n, Node node) throws CoComposeException
n
- The index of the node to be replaced.node
- The node to be inserted in place.CoComposeException
- if one of the new links is illegal.public java.util.Enumeration getLinks()
public java.util.Enumeration getLinks(java.lang.Object node)
node
- The node to which the links should connect.public AbstractConcept getAbstractConcept(java.lang.String name, java.lang.String namespace)
name
- The name of the AbstractConcept.namespace
- The namespace of the AbstractConcept name.public java.util.Collection getAbstractConcepts(AbstractConcept copiedFrom)
copiedFrom
- The AbstractConcept that was copied.public java.util.Collection getAbstractConcepts(AbstractConcept copiedFrom, UniqueRealm inRealm)
copiedFrom
- The AbstractConcept that was copied.inRealm
- Target AbstractConcept should reside within this realm.public java.util.Collection getAbstractConcepts()
public void addTransPriority(java.lang.String language, java.lang.String form)
language
- The target language in which the concept form is defined.form
- The concept form to add to the priority list.public void insertTransPriority(java.lang.String language, java.lang.String form, int index)
language
- The target language in which the concept form is defined.form
- The concept form to add to the priority list.index
- The list index to insert the concept form at.public void removeTransPriority(java.lang.String language, java.lang.String form)
language
- The target language in which the concept form is defined.form
- The concept form to remove from the priority list.public void clearTransPriorities()
public java.util.Enumeration getTransPriorities(java.lang.String language)
language
- The target language for which to get the priority list.public java.util.Enumeration getTransLanguages()
public void copyTransPriorities(Model from)
from
- - the model to copy frompublic void toXML(org.xml.sax.helpers.DefaultHandler handler, boolean selectedOnly, java.lang.String path) throws org.xml.sax.SAXException
handler
- - the SAX DefaultHandler.selectedOnly
- - if true, only creates XML for selected nodes.path
- - the path to the XML file to be written or null.org.xml.sax.SAXException
- if an XML handler error occurs.public java.lang.Object clone()
clone
in class Graph
public java.lang.Object safeClone() throws java.lang.Exception
java.lang.Exception
- - if cloning failed.public boolean isUnique(java.lang.String value)
isUnique
in interface UniqueRealm
value
- The value to check.public void register(java.lang.String value)
register
in interface UniqueRealm
value
- The value to register.public void unRegister(java.lang.String value)
unRegister
in interface UniqueRealm
value
- The value to unregister.public java.lang.String getName()
getName
in interface UniqueRealm
public void setName(java.lang.String name)
name
- The name of the model/unique realm.public java.util.Collection getLinkedNodes(java.lang.Object node)
node
- The node to find links of.public int getFreeNodeCount()
public int getCompositeCount()
public Node firstFreeNode()
public Node nextFreeNode(Node prev_node)
prev_node
- The previous node.public Composite firstComposite()
public Composite nextComposite(Node prev_node)
prev_node
- The previous node.public Concept firstConcept()
public Concept nextConcept(Node prev_node)
prev_node
- The previous node.public CompositePartConcept firstCompositePartConcept()
public CompositePartConcept nextCompositePartConcept(Node prev_node)
prev_node
- The previous node.public java.lang.String getTargetLanguage()
public void setTargetLanguage(java.lang.String language)
language
- The target language.public Node getNodeAt(DPoint3 pos)
pos
- The position to look at.public int numberOfEdges()
public void checkCompleteness() throws CoComposeException
CoComposeException
- if a ConstrainedConcept is not completely
specified.public void checkCorrectness() throws CoComposeException
CoComposeException
- if a ConstrainedConcept is not correctly
specified.public void refreshFromComposite(Composite fromComp) throws CoComposeException
ctype
- The composite type from which to copy the data.CoComposeException
- if one or more composites could not be
successfully refreshed.public AppliedPatterns getAppliedPatterns()
public void accept(ModelVisitor visitor) throws CoComposeException
visitor
- The visitor object to accept.CoComposeException
- if visiting operation failed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |