|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcwi.GraphXML.GraphSemanticsAdapter
A simple implementation of the GraphSemantics interface; all methods are void. Applications may subclass from this adapter, and implement only those methods which they want. For example, the editing methods might be left empty, if the application does not support them.
Important warning: all methods have to be programmed very defensively with regard to null values. Anything which is not specified by the xmlgraph file is forwarded through null values, instead of creating essentially empty objects. For example, application values are collected in a separate object, but if no application value is specified for a given element, the corresponding object reference in the call is null. Although this is a bit disagreeable for the application programmer, this avoid the creation of unnecessary objects, which could significantly slow down the parser for a large graph file.
| Constructor Summary | |
|---|---|
GraphSemanticsAdapter()
|
|
| Method Summary | |
|---|---|
void |
closeEditBundle()
Close edit bundle. |
void |
closeGraph()
Close current graph |
void |
closeGraphXML()
Close GraphXML. |
void |
closeRemoveBlock()
Close remove block |
void |
closeReplaceBlock()
Close replace block |
void |
handlePI(java.lang.String target,
java.util.HashMap props)
Handle a processing instruction. |
void |
initGraphXML(ApplicationData applData,
Extensions ext,
ParserError parserError)
Init GraphXML. |
void |
newEdge(java.lang.String name,
java.lang.String source,
java.lang.String target)
New edge with no additional information. |
void |
newEdge(java.lang.String name,
java.lang.String source,
java.lang.String target,
Reference sourceReference,
Reference targetReference)
New edge with no additional information. |
void |
newEdge(java.lang.String name,
java.lang.String xml_class,
java.lang.String source,
java.lang.String target,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Path path)
New edge in a graph definition. |
void |
newEdge(java.lang.String name,
java.lang.String xml_class,
java.lang.String source,
java.lang.String target,
Reference sourceReference,
Reference targetReference,
ApplicationData applData,
Extensions ext,
VisualProperties style,
AttributeProperties attrs,
Path path)
New edge in a graph definition. |
void |
newEditBundle()
New edit bundle starts. |
void |
newGraph(java.lang.String id,
AttributeProperties attrs,
ApplicationData applData,
Extensions ext,
Style style,
Picture icon,
Size size)
New graph. |
void |
newNode(java.lang.String name)
New node with no additional information. |
void |
newNode(java.lang.String name,
java.lang.String xml_class,
boolean metanode,
Reference reference,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Style subgraphStyle,
Position position,
Size size,
Transform transform)
New node in a graph definition. |
void |
newRemoveBlock(java.lang.String id,
Reference reference,
AttributeProperties attrs)
New remove block starts |
void |
newReplaceBlock(java.lang.String id,
Reference reference,
AttributeProperties attrs)
New replace block starts |
void |
removeEdge(java.lang.String name,
java.lang.String source,
java.lang.String target)
Remove an edge |
void |
removeEdgeComponent(java.lang.String name,
java.lang.String source,
java.lang.String target,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Path path)
Remove edge components |
void |
removeNode(java.lang.String name)
Remove a Node |
void |
removeNodeComponent(java.lang.String name,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Style subgraphStyle,
Position position,
Size size,
Transform transform)
Remove components of a node. |
void |
replaceEdge(java.lang.String name,
java.lang.String xml_class,
java.lang.String source,
java.lang.String target)
Replace an edge |
void |
replaceEdgeComponent(java.lang.String name,
java.lang.String xml_class,
java.lang.String source,
java.lang.String target,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Path path)
Replace edge components |
void |
replaceNode(java.lang.String name,
java.lang.String xml_class,
boolean metanode,
Reference reference)
Replace a Node |
void |
replaceNodeComponent(java.lang.String name,
java.lang.String xml_class,
boolean metanode,
Reference reference,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Style subgraphStyle,
Position position,
Size size,
Transform transform)
Replace components of a node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GraphSemanticsAdapter()
| Method Detail |
public void handlePI(java.lang.String target,
java.util.HashMap props)
handlePI in interface GraphSemanticstarget - the target of the pi, ie the string appearing after "" and before
the first whitespaceprops - the key-value pairs appearing in the processing instruction
public void initGraphXML(ApplicationData applData,
Extensions ext,
ParserError parserError)
initGraphXML in interface GraphSemanticsapplData - the application element data which may be associated with the
full GraphXML fileext - user defined extensions to the GraphXML structureparserError - the parser in charge; used to generate error messages.public void closeGraphXML()
closeGraphXML in interface GraphSemantics
public void newGraph(java.lang.String id,
AttributeProperties attrs,
ApplicationData applData,
Extensions ext,
Style style,
Picture icon,
Size size)
The visual style appearing in the call is "reconciled" with the file-level style, ie, a input argument value is the (semantic) merge of the file level and graph level style.
newGraph in interface GraphSemanticsid - graph IDattrs - all the attributes of the graphapplData - application data (label, data, data references)ext - possible extensionsstyle - visual styleicon - icon imagesize - size informationpublic void closeGraph()
closeGraph in interface GraphSemantics
public void newNode(java.lang.String name,
java.lang.String xml_class,
boolean metanode,
Reference reference,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Style subgraphStyle,
Position position,
Size size,
Transform transform)
newNode in interface GraphSemanticsname - Name of the nodexml_class - Class of the nodemetanode - whether this is a metanodereference - reference data for a metanodeext - possible extensionsvis_props - Visual Propertiesattrs - additional attributesposition - Position of the nodesize - Node sizetransform - Tranformation matrix for a metanodepublic void newNode(java.lang.String name)
newNode in interface GraphSemanticsname - Name of the node
public void newEdge(java.lang.String name,
java.lang.String xml_class,
java.lang.String source,
java.lang.String target,
Reference sourceReference,
Reference targetReference,
ApplicationData applData,
Extensions ext,
VisualProperties style,
AttributeProperties attrs,
Path path)
newEdge in interface GraphSemanticsname - name of the edgexml_class - class of the edgesource - source node of the edgetarget - target node of the edgesourceReference - Cross-reference to source of the edgetargetReference - Cross-reference to target of the edgeext - possible extensionsattrs - additional propertiespath - geometric path
public void newEdge(java.lang.String name,
java.lang.String xml_class,
java.lang.String source,
java.lang.String target,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Path path)
newEdge in interface GraphSemanticsname - name of the edgexml_class - class of the edgesource - source node of the edgetarget - target node of the edgeext - possible extensionsvis_props - Visual Propertiesattrs - additional propertiespath - geometric path
public void newEdge(java.lang.String name,
java.lang.String source,
java.lang.String target,
Reference sourceReference,
Reference targetReference)
newEdge in interface GraphSemanticsname - Name of the nodesource - Source of the edgetarget - Target of the edgesourceReference - Cross-reference to source of the edgetargetReference - Cross-reference to target of the edge
public void newEdge(java.lang.String name,
java.lang.String source,
java.lang.String target)
newEdge in interface GraphSemanticsname - Name of the nodesource - Source of the edgetarget - Target of the edge
public void newRemoveBlock(java.lang.String id,
Reference reference,
AttributeProperties attrs)
newRemoveBlock in interface GraphSemanticsid - Id of the edit blockreference - reference data for the graph to be editedattrs - additional properties
public void newReplaceBlock(java.lang.String id,
Reference reference,
AttributeProperties attrs)
newReplaceBlock in interface GraphSemanticsid - Id of the edit blockreference - reference data for the graph to be editedattrs - additional propertiespublic void closeRemoveBlock()
closeRemoveBlock in interface GraphSemanticspublic void closeReplaceBlock()
closeReplaceBlock in interface GraphSemanticspublic void newEditBundle()
newEditBundle in interface GraphSemanticspublic void closeEditBundle()
closeEditBundle in interface GraphSemanticspublic void removeNode(java.lang.String name)
removeNode in interface GraphSemanticsname - Node name
public void replaceNode(java.lang.String name,
java.lang.String xml_class,
boolean metanode,
Reference reference)
replaceNode in interface GraphSemanticsname - name of the nodexml_class - class of the nodemetanode - whether this is a metanodereference - reference data for a metanode
public void removeNodeComponent(java.lang.String name,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Style subgraphStyle,
Position position,
Size size,
Transform transform)
removeNodeComponent in interface GraphSemanticsname - Name of the nodeext - possible extensionsvis_props - Visual Propertiesattrs - additional attributesposition - Position of the nodesize - Node sizetransform - Tranformation matrix for a metanode
public void replaceNodeComponent(java.lang.String name,
java.lang.String xml_class,
boolean metanode,
Reference reference,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Style subgraphStyle,
Position position,
Size size,
Transform transform)
replaceNodeComponent in interface GraphSemanticsname - Name of the nodexml_class - Class of the nodemetanode - whether this is a metanodereference - reference data for a metanodeext - possible extensionsvis_props - Visual Propertiesattrs - additional propertiesposition - Position of the nodesize - Node sizetransform - Tranformation matrix for a metanode
public void removeEdge(java.lang.String name,
java.lang.String source,
java.lang.String target)
removeEdge in interface GraphSemanticsname - Name of the edgesource - source node of the edgetarget - target node of the edge
public void replaceEdge(java.lang.String name,
java.lang.String xml_class,
java.lang.String source,
java.lang.String target)
replaceEdge in interface GraphSemanticsname - name of the edgesource - source node of the edgetarget - target node of the edge
public void removeEdgeComponent(java.lang.String name,
java.lang.String source,
java.lang.String target,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Path path)
removeEdgeComponent in interface GraphSemanticsname - Name of the edgesource - source node of the edgetarget - target node of the edgeext - possible extensionsvis_props - Visual Propertiesattrs - additional attributespath - geometric path
public void replaceEdgeComponent(java.lang.String name,
java.lang.String xml_class,
java.lang.String source,
java.lang.String target,
ApplicationData applData,
Extensions ext,
VisualProperties vis_props,
AttributeProperties attrs,
Path path)
replaceEdgeComponent in interface GraphSemanticsname - name of the edgexml_class - class of the edgesource - source node of the edgetarget - target node of the edgeext - possible extensionsvis_props - Visual Propertiesattrs - additional attributespath - geometric path
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||