本文整理了Java中com.mxgraph.view.mxGraph.<init>()
方法的一些代码示例,展示了mxGraph.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.<init>()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:<init>
[英]Constructs a new graph with an empty com.mxgraph.model.mxGraphModel.
[中]用空com构造一个新图形。mxgraph。模型mxGraphModel。
代码示例来源:origin: Activiti/Activiti
protected void layout(FlowElementsContainer flowElementsContainer) {
graph = new mxGraph();
cellParent = graph.getDefaultParent();
graph.getModel().beginUpdate();
代码示例来源:origin: org.solovyev/common-other
public static mxGraph toMxGraph(Graph<?, ?> g, int displayWidth, int displayHeight, int xStartPos, int yStartPos) {
mxGraph graph = new mxGraph();
setMxGraph(g, displayWidth, displayHeight, xStartPos, yStartPos, graph);
return graph;
}
代码示例来源:origin: stackoverflow.com
mxGraph graph = new mxGraph();
Map<String, Object> style = graph.getStylesheet().getDefaultEdgeStyle();
style.put(mxConstants.STYLE_ROUNDED, true);
style.put(mxConstants.STYLE_EDGE, mxConstants.EDGESTYLE_ENTITY_RELATION);
代码示例来源:origin: stackoverflow.com
mxGraph graph = new mxGraph() {
@Override
public boolean isCellSelectable(Object cell) {
if (cell != null) {
if (cell instanceof mxCell) {
mxCell myCell = (mxCell) cell;
if (myCell.isEdge())
return false;
}
}
return super.isCellSelectable(cell);
}
};
代码示例来源:origin: stackoverflow.com
mxGraph graph = new mxGraph();
try
{
Document document = mxXmlUtils.parseXml(mxUtils.readFile(filePath));
mxCodec codec = new mxCodec(document);
codec.decode(document.getDocumentElement(), graph.getModel());
}
catch (Exception ex)
{
ex.printStackTrace();
}
代码示例来源:origin: stackoverflow.com
Document doc = mxXmlUtils.parseXml(erXmlString);
mxGraph graph = new mxGraph();
mxCodec codec = new mxCodec(doc);
codec.decode(doc.getDocumentElement(), graph.getModel());
mxGraphComponent graphComponent = new mxGraphComponent(graph);
BufferedImage image = mxCellRenderer.createBufferedImage(graphComponent.getGraph(), null, 1, Color.WHITE, graphComponent.isAntiAlias(), null, graphComponent.getCanvas());
mxPngEncodeParam param = mxPngEncodeParam.getDefaultEncodeParam(image);
param.setCompressedText(new String[] { "mxGraphModel", erXmlString });
FileOutputStream outputStream = new FileOutputStream(new File(filename));
mxPngImageEncoder encoder = new mxPngImageEncoder(outputStream, param);
if (image != null) {
encoder.encode(image);
return image;
}
outputStream.close();
return null;
}
代码示例来源:origin: stackoverflow.com
public class TelaPrincipalController {
@FXML
private SwingNode swingComponentWrapper ;
public void initialize() {
SwingUtilities.invokeLater(this::createMxGraph);
}
private void createMxGraph() {
mxGraph grafo = new mxGraph();
Object parent = grafo.getDefaultParent();
Object v1 = grafo.insertVertex(parent, null, "Brazil", 100, 100, 50, 40);
Object v2 = grafo.insertVertex(parent, null, "Soccer", 240, 150, 50, 40);
Object a1 = grafo.insertEdge(parent, null, "loves", v1, v2);
mxGraphComponent graphComponent = new mxGraphComponent(grafo);
swingComponentWrapper.setContent(graphComponent);
}
@FXML
private void selecionarNo() {
// ...
}
// etc etc...
}
代码示例来源:origin: stackoverflow.com
mxGraph graph = new mxGraph()
代码示例来源:origin: org.gdl-lang.gdl-tools/gdl-graph
private mxGraph getGraph() {
if (graph == null) {
mxGraphModel model = new mxGraphModel();
graph = new mxGraph(model);
graph.setCellsDeletable(true);
graph.getSelectionModel().setSingleSelection(false);
graph.setHtmlLabels(true);
graph.setAllowDanglingEdges(false);
}
return graph;
}
代码示例来源:origin: stackoverflow.com
super("Hello, World!");
mxGraph graph = new mxGraph();
Object parent = graph.getDefaultParent();
代码示例来源:origin: stackoverflow.com
frame.getMaximumSize().height);
final mxGraph graph = new mxGraph();
Object parent = graph.getDefaultParent();
graph.getModel().beginUpdate();
代码示例来源:origin: arquillian/arquillian-cube
private FileEntry createDockerCompositionSchema(CubeDockerConfiguration cubeDockerConfiguration, ReporterConfiguration reporterConfiguration) {
final mxGraph graph = new mxGraph();
final Object parent = graph.getDefaultParent();
graph.setAutoSizeCells(true);
graph.getModel().beginUpdate();
try {
final DockerCompositions dockerContainersContent = cubeDockerConfiguration.getDockerContainersContent();
final Map<String, CubeContainer> containers = dockerContainersContent.getContainers();
final Map<String, Object> insertedVertex = new HashMap<>();
for (Map.Entry<String, CubeContainer> containerEntry : containers.entrySet()) {
String containerId = containerEntry.getKey();
CubeContainer cubeContainer = containerEntry.getValue();
updateGraph(graph, parent, insertedVertex, containerId, cubeContainer);
}
} finally {
graph.getModel().endUpdate();
}
mxIGraphLayout layout = new mxHierarchicalLayout(graph, SwingConstants.WEST);
layout.execute(graph.getDefaultParent());
return generateCompositionSchemaImage(graph, reporterConfiguration);
}
代码示例来源:origin: stackoverflow.com
import javax.swing.JFrame;
import com.mxgraph.swing.mxGraphComponent;
import com.mxgraph.view.mxGraph;
public class GraphFrame extends JFrame {
public static void main(String[] args) {
mxGraph graph = new mxGraph();
Object parent = graph.getDefaultParent();
graph.getModel().beginUpdate();
try {
Object v1 = graph.insertVertex(parent, null, "Hello", 20, 20, 80,
30);
Object v2 = graph.insertVertex(parent, null, "World!", 240, 150,
80, 30);
graph.insertEdge(parent, null, "Edge", v1, v2);
} finally {
graph.getModel().endUpdate();
}
mxGraphComponent graphComponent = new mxGraphComponent(graph);
GraphFrame frame = new GraphFrame();
frame.add(graphComponent);
frame.pack();
frame.setVisible(true);
}
}
代码示例来源:origin: stackoverflow.com
public static mxGraph makeHelloWorldGraph() {
mxGraph graph = new mxGraph();
Object parent = graph.getDefaultParent();
graph.getModel().beginUpdate();
try {
Object v1 = graph.insertVertex(parent, null, "", 20, 20, 80,
30,"opacity=0");
Object v2 = graph.insertVertex(parent, null, "World!", 240, 150,
80, 30);
graph.insertEdge(parent, null, "Edge", v1, v2);
} finally {
graph.getModel().endUpdate();
}
return graph;
}
代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout
protected void layout(FlowElementsContainer flowElementsContainer) {
graph = new mxGraph();
cellParent = graph.getDefaultParent();
graph.getModel().beginUpdate();
代码示例来源:origin: org.opensingular/server-commons
private static mxGraph renderGraph(ProcessDefinition<?> definicao) {
final mxGraph graph = new mxGraph();
final Object parent = graph.getDefaultParent();
style(graph);
graph.getModel().beginUpdate();
graph.setAutoSizeCells(true);
final FlowMap fluxo = definicao.getFlowMap();
final Map<String, Object> mapaVertice = new HashMap<>();
for (final MTask<?> task : fluxo.getTasks()) {
final Object v = insertVertex(graph, task);
mapaVertice.put(task.getAbbreviation(), v);
}
for (final MTaskEnd task : fluxo.getEndTasks()) {
final Object v = insertVertex(graph, task);
mapaVertice.put(task.getAbbreviation(), v);
}
addStartTransition(graph, fluxo.getStartTask(), mapaVertice);
for (final MTask<?> task : fluxo.getTasks()) {
for (final MTransition transicao : task.getTransitions()) {
createTransition(graph, transicao, mapaVertice);
}
}
final mxHierarchicalLayout layout = new mxHierarchicalLayout(graph);
layout.setOrientation(SwingConstants.WEST);
layout.execute(parent);
graph.getModel().endUpdate();
return graph;
}
代码示例来源:origin: org.opensingular/singular-requirement-commons
private static mxGraph renderGraph(FlowDefinition<?> definition) {
final mxGraph graph = new mxGraph();
final Object parent = graph.getDefaultParent();
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
Object[] cells = model.cloneCells(aGraph.getChildCells(graph.getDefaultParent(), true, true), true);
mxGraphModel modelCopy = new mxGraphModel();
mxGraph graphCopy = new mxGraph(modelCopy);
Object parentCopy = graphCopy.getDefaultParent();
graphCopy.addCells(cells);
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
mxGraph graphCopy = new mxGraph(modelCopy);
graphCopy.addCells(cells);
mxAnalysisGraph aGraphCopy = new mxAnalysisGraph();
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
mxGraph graphCopy = new mxGraph(modelCopy);
graphCopy.addCells(cells);
mxAnalysisGraph aGraphCopy = new mxAnalysisGraph();
内容来源于网络,如有侵权,请联系作者删除!