|
||||||||||
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 GraphSemantics
target
- the target of the pi, ie the string appearing after "" and before
the first whitespaceprops
- the key-value pairs appearing in the processing instructionpublic void initGraphXML(ApplicationData applData, Extensions ext, ParserError parserError)
initGraphXML
in interface GraphSemantics
applData
- 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 GraphSemantics
id
- 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 GraphSemantics
name
- 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 GraphSemantics
name
- Name of the nodepublic 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 GraphSemantics
name
- 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 pathpublic 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 GraphSemantics
name
- 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 pathpublic void newEdge(java.lang.String name, java.lang.String source, java.lang.String target, Reference sourceReference, Reference targetReference)
newEdge
in interface GraphSemantics
name
- 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 edgepublic void newEdge(java.lang.String name, java.lang.String source, java.lang.String target)
newEdge
in interface GraphSemantics
name
- Name of the nodesource
- Source of the edgetarget
- Target of the edgepublic void newRemoveBlock(java.lang.String id, Reference reference, AttributeProperties attrs)
newRemoveBlock
in interface GraphSemantics
id
- Id of the edit blockreference
- reference data for the graph to be editedattrs
- additional propertiespublic void newReplaceBlock(java.lang.String id, Reference reference, AttributeProperties attrs)
newReplaceBlock
in interface GraphSemantics
id
- Id of the edit blockreference
- reference data for the graph to be editedattrs
- additional propertiespublic void closeRemoveBlock()
closeRemoveBlock
in interface GraphSemantics
public void closeReplaceBlock()
closeReplaceBlock
in interface GraphSemantics
public void newEditBundle()
newEditBundle
in interface GraphSemantics
public void closeEditBundle()
closeEditBundle
in interface GraphSemantics
public void removeNode(java.lang.String name)
removeNode
in interface GraphSemantics
name
- Node namepublic void replaceNode(java.lang.String name, java.lang.String xml_class, boolean metanode, Reference reference)
replaceNode
in interface GraphSemantics
name
- name of the nodexml_class
- class of the nodemetanode
- whether this is a metanodereference
- reference data for a metanodepublic 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 GraphSemantics
name
- Name of the nodeext
- possible extensionsvis_props
- Visual Propertiesattrs
- additional attributesposition
- Position of the nodesize
- Node sizetransform
- Tranformation matrix for a metanodepublic 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 GraphSemantics
name
- 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 metanodepublic void removeEdge(java.lang.String name, java.lang.String source, java.lang.String target)
removeEdge
in interface GraphSemantics
name
- Name of the edgesource
- source node of the edgetarget
- target node of the edgepublic void replaceEdge(java.lang.String name, java.lang.String xml_class, java.lang.String source, java.lang.String target)
replaceEdge
in interface GraphSemantics
name
- name of the edgesource
- source node of the edgetarget
- target node of the edgepublic 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 GraphSemantics
name
- Name of the edgesource
- source node of the edgetarget
- target node of the edgeext
- possible extensionsvis_props
- Visual Propertiesattrs
- additional attributespath
- geometric pathpublic 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 GraphSemantics
name
- 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 |