本文整理汇总了Java中org.jgrapht.ext.IntegerNameProvider类的典型用法代码示例。如果您正苦于以下问题:Java IntegerNameProvider类的具体用法?Java IntegerNameProvider怎么用?Java IntegerNameProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntegerNameProvider类属于org.jgrapht.ext包,在下文中一共展示了IntegerNameProvider类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toDOT
import org.jgrapht.ext.IntegerNameProvider; //导入依赖的package包/类
void toDOT(File file, DirectedGraph<AddonVertex, AddonDependencyEdge> graph)
{
DOTExporter<AddonVertex, AddonDependencyEdge> exporter = new DOTExporter<>(
new IntegerNameProvider<AddonVertex>(),
new AddonVertexNameProvider(),
new AddonDependencyEdgeNameProvider());
try (FileWriter fw = new FileWriter(file))
{
exporter.export(fw, graph);
fw.flush();
}
catch (IOException e)
{
e.printStackTrace();
}
}
示例2: toDOT
import org.jgrapht.ext.IntegerNameProvider; //导入依赖的package包/类
public void toDOT(File file)
{
FileWriter fw = null;
try
{
DOTExporter<AddonVertex, AddonDependencyEdge> exporter = new DOTExporter<AddonVertex, AddonDependencyEdge>(
new IntegerNameProvider<AddonVertex>(),
new AddonVertexNameProvider(),
new AddonDependencyEdgeNameProvider());
fw = new FileWriter(file);
exporter.export(fw, graph);
fw.flush();
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
Streams.closeQuietly(fw);
}
}
示例3: toDot
import org.jgrapht.ext.IntegerNameProvider; //导入依赖的package包/类
private void toDot(String filename) {
// TODO check if graphviz/dot is actually available on the current
// machine
try {
FileWriter fstream = new FileWriter(filename);
BufferedWriter out = new BufferedWriter(fstream);
if (!graph.vertexSet().isEmpty()) {
// FrameVertexNameProvider nameprovider = new
// FrameVertexNameProvider(mn.instructions);
// DOTExporter<Integer,DefaultEdge> exporter = new
// DOTExporter<Integer,DefaultEdge>();
// DOTExporter<Integer,DefaultEdge> exporter = new
// DOTExporter<Integer,DefaultEdge>(new IntegerNameProvider(),
// nameprovider, new IntegerEdgeNameProvider());
// DOTExporter<Integer,DefaultEdge> exporter = new
// DOTExporter<Integer,DefaultEdge>(new LineNumberProvider(),
// new LineNumberProvider(), new IntegerEdgeNameProvider());
DOTExporter<V, E> exporter = new DOTExporter<V, E>(
new IntegerNameProvider<V>(),
new StringNameProvider<V>(),
new StringEdgeNameProvider<E>(),
vertexAttributeProvider, edgeAttributeProvider);
// new IntegerEdgeNameProvider<E>());
exporter.export(out, graph);
logger.info("exportet " + getName());
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例4: export
import org.jgrapht.ext.IntegerNameProvider; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void export(String filename){
VertexNameProvider<ApplicationVertex> vertID = new IntegerNameProvider<ApplicationVertex>();
VertexNameProvider<ApplicationVertex> vertName = new IntegerNameProvider<ApplicationVertex>();
EdgeNameProvider<ApplicationEdge> edgeName = new StringEdgeNameProvider<ApplicationEdge>();
@SuppressWarnings({ "unchecked", "rawtypes" })
DOTExporter t = new DOTExporter(vertID,vertName,edgeName);
try {
t.export(new FileWriter(filename), this.graph );
} catch (IOException e) {
System.out.println("Eccezione");
e.printStackTrace();
}
}
示例5: exportGraph
import org.jgrapht.ext.IntegerNameProvider; //导入依赖的package包/类
public static void exportGraph(Graph<StringLabeledObject,StringLabeledObject> g, File f) throws IOException{
GmlExporter<StringLabeledObject,StringLabeledObject> export =
new GmlExporter<StringLabeledObject,StringLabeledObject>(
new IntegerNameProvider<StringLabeledObject>(), null,
new IntegerEdgeNameProvider<StringLabeledObject>(), null);
export.setPrintLabels(GmlExporter.PRINT_EDGE_VERTEX_LABELS);
FileWriter out = new FileWriter(f);
if(g instanceof DirectedGraph){
export.export(out, (DirectedGraph<StringLabeledObject, StringLabeledObject>) g);
} else if(g instanceof UndirectedGraph){
export.export(out, (UndirectedGraph<StringLabeledObject, StringLabeledObject>) g);
}
out.close();
}
示例6: DOTExporter
import org.jgrapht.ext.IntegerNameProvider; //导入依赖的package包/类
/**
* Constructs a new DOTExporter object with an integer name provider for the
* vertex IDs and null providers for the vertex and edge labels.
*/
public DOTExporter()
{
this(new IntegerNameProvider<V>(), null, null);
}
示例7: toGraphML
import org.jgrapht.ext.IntegerNameProvider; //导入依赖的package包/类
public void toGraphML(Writer writer) throws SAXException, TransformerConfigurationException {
GraphMLExporter gme = new GraphMLExporter(new IntegerNameProvider(), new StringNameProvider(), new IntegerEdgeNameProvider(), new StringEdgeNameProvider());
gme.export(writer, this);
}
示例8: toGML
import org.jgrapht.ext.IntegerNameProvider; //导入依赖的package包/类
public void toGML(Writer writer) {
GmlExporter gme = new GmlExporter(new IntegerNameProvider(), new StringNameProvider(), new IntegerEdgeNameProvider(), new StringEdgeNameProvider());
gme.setPrintLabels(GmlExporter.PRINT_EDGE_VERTEX_LABELS);
gme.export(writer, this);
}