本文整理汇总了Java中guru.nidi.graphviz.model.Label类的典型用法代码示例。如果您正苦于以下问题:Java Label类的具体用法?Java Label怎么用?Java Label使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Label类属于guru.nidi.graphviz.model包,在下文中一共展示了Label类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connectorRstTest
import guru.nidi.graphviz.model.Label; //导入依赖的package包/类
DynamicTest connectorRstTest(ConnectorTemplate connectorTemplate, final String templateName, final File parentDirectory) {
if (!parentDirectory.isDirectory()) {
parentDirectory.mkdirs();
}
return dynamicTest(connectorTemplate.getSimpleName(), () -> {
final File graphOutputFile = new File(parentDirectory, connectorTemplate.getDiagramFileName());
final Graph g;
if (connectorTemplate instanceof SourceConnectorTemplate) {
g = graph()
.graphAttr().with(RankDir.LEFT_TO_RIGHT)
.directed()
.with(
node(connectorTemplate.getSimpleName()).with(Shape.RECTANGLE)
.link(
to(node("Kafka Connect").with(Shape.RECTANGLE).link(to(node("Kafka").with(Shape.RECTANGLE)).with(Label.of("Writes messages to")))).with(Label.of("Hosted by"))
)
);
} else {
g = graph()
.graphAttr().with(RankDir.LEFT_TO_RIGHT)
.directed()
.with(
node("Kafka").with(Shape.RECTANGLE)
.link(
to(node("Kafka Connect").with(Shape.RECTANGLE).link(to(node(connectorTemplate.getSimpleName()).with(Shape.RECTANGLE)).with(Label.of("Writes data to")))).with(Label.of("Pulls Data from"))
)
);
}
Graphviz.fromGraph(g)
.width(350)
.render(Format.SVG_STANDALONE)
.toFile(graphOutputFile);
final File outputFile = new File(parentDirectory, connectorTemplate.getSimpleName() + ".rst");
Template template = configuration.getTemplate(templateName);
log.info("Writing {}", outputFile);
try (Writer writer = Files.newWriter(outputFile, Charsets.UTF_8)) {
process(writer, template, connectorTemplate);
}
});
}
示例2: emptyStrictDigraph
import guru.nidi.graphviz.model.Label; //导入依赖的package包/类
@Test
void emptyStrictDigraph() throws IOException {
assertEquals(mutGraph(Label.html("bla")).setStrict(true).setDirected(true),
Parser.read("strict digraph <bla>{}"));
}