|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Export
Export to external formats.
It is possible to export a Graph to a diferent fortmats.
Nowadays, these are the available formats:
Export.Type.GRAPHVIZ:
Graphviz home page.Export.Type.GRAPHML:
GraphML home page.Export.Type.YGRAPHML:
It is a GraphML
export plus a set of yWorks
extensions. Thus, it allows for the visualization of the exported
graph with the public yEd
visualization tool.
| YGRAPHML | GRAPHVIZ | GRAPHML | DEFAULT VALUE | |
| Node label | X | X | null | |
| Node shape | X | Export.NodeExport.Shape.BOX |
||
| Node color | X | 0xa5c3f6 | ||
| Node label color | X | Color.BLACK |
||
| Node label font size | X | 10 | ||
| Node width | X | 25 | ||
| Node height | X | 25 | ||
| Fit node size | X | true | ||
| Edge label | X | X | null | |
| Edge direction | X | Export.EdgeExport.Direction.DIRECTED |
||
| Edge color | X | Color.LIGHT_GRAY |
||
| Edge label color | X | Color.BLACK |
||
| Edge label font size | X | 10 | ||
| Edge width | X | 5 |
private final class DefaultExport implements Export {
private GraphExport gExp = new GraphExport();
private NodeExport nExp = new NodeExport();
private EdgeExport eExp = new EdgeExport();
private Graph graph = null;
public void prepare(Graph graph) {
this.graph = graph;
}
public void release() {
}
public GraphExport getGraph() {
gExp.setLabel(graph.getGraphPool().getAlias());
return gExp;
}
public NodeExport getNodeType(int type) {
return nExp;
}
public EdgeExport getEdgeType(int type) {
return eExp;
}
public NodeExport getNode(long node) {
nExp.setLabel("" + node);
return nExp;
}
public EdgeExport getEdge(long edge) {
eExp.setColor(Color.LIGHT_GRAY);
eExp.setLabel("" + edge);
int t = graph.getType(edge);
if (graph.isEdgeTypeDirected(t)) {
eExp.setDirection(EdgeExport.Direction.DIRECTED);
} else {
eExp.setDirection(EdgeExport.Direction.UNDIRECTED);
}
return eExp;
}
public boolean enableType(int type) {
return true;
}
}
| Nested Class Summary | |
|---|---|
static class |
Export.EdgeExport
Stores edge exporting values. |
static class |
Export.GraphExport
Stores the graph exporting values. |
static class |
Export.NodeExport
Stores the node exporting values. |
static class |
Export.Type
Export type. |
| Method Summary | |
|---|---|
boolean |
enableType(int type)
Gets whether a node or edge type must be exported or not. |
Export.EdgeExport |
getEdge(long edge)
Gets the edge export definition. |
Export.EdgeExport |
getEdgeType(int type)
Gets the edge export definition of the type. Export#getEdge(long) has more priority than this function.Only if Export#getEdge(int) return null the
Export.EdgeExport of this function is used. |
Export.GraphExport |
getGraph()
Gets the graph export definition. |
Export.NodeExport |
getNode(long node)
Gets the node export definition. |
Export.NodeExport |
getNodeType(int type)
Gets the node export definition of the type. Export#getNode(long) has more priority than this function.Only if Export#getNode(long) return null the
Export.NodeExport of this function is used. |
void |
prepare(Graph graph)
Prepares the graph for the export process. |
void |
release()
Ends the export process. |
| Method Detail |
|---|
void prepare(Graph graph)
It is called once before the export process.
graph - Graph to be exported.void release()
It is called once after the export process.
Export.GraphExport getGraph()
Export.GraphExport which defines
how to export the graph.Export.NodeExport getNodeType(int type)
Export#getNode(long) has more priority than this function.Export#getNode(long) return null the
Export.NodeExport of this function is used.
type - Node type identifier
Export.NodeExport which defines
how to export the nodes of the given type.Export.EdgeExport getEdgeType(int type)
Export#getEdge(long) has more priority than this function.Export#getEdge(int) return null the
Export.EdgeExport of this function is used.
type - Edge type identifier
Export.EdgeExport which defines
how to export the edges of the given type.Export.NodeExport getNode(long node)
node - Node to be exported.
Export.NodeExport which defines
how to export the node.Export.EdgeExport getEdge(long edge)
edge - Edge to be exported.
Export.EdgeExport which defines
how to export the edge.boolean enableType(int type)
type - Node or edge type.
true all objects of the
given type will be exported, otherwise they
will not be exported.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||