|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GraphSemantics
Semantic methods for the interpretation of an xmlgraph. This interface has to be implemented by the application, and handed over to the parser.
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.
Note that the function replaceNodeComponent should be implemented even if the application does not implement the full editing semantics. Indeed, this method is called if there are postdefinite nodes, like in the following example:
<edge name="something" source="name1" target="name2"> <node name="name1"> . . . </node>The parser will create the node "name1" first as a simple (empty) node, and will then invoke the replaceNodeComponent to fill in the components.
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. |
Method Detail |
---|
void handlePI(java.lang.String target, java.util.HashMap props)
target
- the target of the pi, ie the string appearing after "" and before
the first whitespaceprops
- the key-value pairs appearing in the processing instructionvoid initGraphXML(ApplicationData applData, Extensions ext, ParserError parserError)
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.void closeGraphXML()
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.
id
- graph IDattrs
- all the attributes of the graphapplData
- application data (label, data, data references)ext
- possible extensionsstyle
- visual styleicon
- icon imagesize
- size informationvoid closeGraph()
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)
name
- Name of the nodexml_class
- Class of the nodemetanode
- whether this is a metanodereference
- reference data for a metanodeappldata
- application data (label, data, icons, data references, extensions)ext
- possible extensionsvis_props
- Visual Propertiesattrs
- additional attributesposition
- Position of the nodesize
- Node sizetransform
- Tranformation matrix for a metanodevoid newNode(java.lang.String name)
name
- Name of the nodevoid 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)
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 edgeappldata
- application data (label, data, data references)ext
- possible extensionsvis_props
- Visual Propertiesattrs
- additional propertiespath
- geometric pathvoid 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)
name
- name of the edgexml_class
- class of the edgesource
- source node of the edgetarget
- target node of the edgeappldata
- application data (label, data, data references)ext
- possible extensionsvis_props
- Visual Propertiesattrs
- additional propertiespath
- geometric pathvoid newEdge(java.lang.String name, java.lang.String source, java.lang.String target, Reference sourceReference, Reference targetReference)
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 edgevoid newEdge(java.lang.String name, java.lang.String source, java.lang.String target)
name
- Name of the nodesource
- Source of the edgetarget
- Target of the edgevoid newRemoveBlock(java.lang.String id, Reference reference, AttributeProperties attrs)
id
- Id of the edit blockreference
- reference data for the graph to be editedattrs
- additional propertiesvoid newReplaceBlock(java.lang.String id, Reference reference, AttributeProperties attrs)
id
- Id of the edit blockreference
- reference data for the graph to be editedattrs
- additional propertiesvoid closeRemoveBlock()
void closeReplaceBlock()
void newEditBundle()
void closeEditBundle()
void removeNode(java.lang.String name)
name
- Node namevoid replaceNode(java.lang.String name, java.lang.String xml_class, boolean metanode, Reference reference)
name
- name of the nodexml_class
- class of the nodemetanode
- whether this is a metanodereference
- reference data for a metanodevoid removeNodeComponent(java.lang.String name, ApplicationData applData, Extensions ext, VisualProperties vis_props, AttributeProperties attrs, Style subgraphStyle, Position position, Size size, Transform transform)
name
- Name of the nodeappldata
- application data (label, data, data references)ext
- possible extensionsvis_props
- Visual Propertiesattrs
- additional attributesposition
- Position of the nodesize
- Node sizetransform
- Tranformation matrix for a metanodevoid 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)
name
- Name of the nodexml_class
- Class of the nodemetanode
- whether this is a metanodereference
- reference data for a metanodeappldata
- application data (label, data, data references)ext
- possible extensionsvis_props
- Visual Propertiesattrs
- additional propertiesposition
- Position of the nodesize
- Node sizetransform
- Tranformation matrix for a metanodevoid removeEdge(java.lang.String name, java.lang.String source, java.lang.String target)
name
- Name of the edgesource
- source node of the edgetarget
- target node of the edgevoid replaceEdge(java.lang.String name, java.lang.String xml_class, java.lang.String source, java.lang.String target)
name
- name of the edgeclass
- class of the edgesource
- source node of the edgetarget
- target node of the edgevoid removeEdgeComponent(java.lang.String name, java.lang.String source, java.lang.String target, ApplicationData applData, Extensions ext, VisualProperties vis_props, AttributeProperties attrs, Path path)
name
- Name of the edgesource
- source node of the edgetarget
- target node of the edgeappldata
- application data (label, data, data references)ext
- possible extensionsvis_props
- Visual Propertiesattrs
- additional attributespath
- geometric pathvoid 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)
name
- name of the edgexml_class
- class of the edgesource
- source node of the edgetarget
- target node of the edgeappldata
- application data (label, data, data references)ext
- 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 |