com.mxgraph.view.mxGraph.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中com.mxgraph.view.mxGraph.<init>()方法的一些代码示例,展示了mxGraph.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.<init>()方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:<init>

mxGraph.<init>介绍

[英]Constructs a new graph with an empty com.mxgraph.model.mxGraphModel.
[中]用空com构造一个新图形。mxgraph。模型mxGraphModel。

代码示例

代码示例来源:origin: Activiti/Activiti

  1. protected void layout(FlowElementsContainer flowElementsContainer) {
  2. graph = new mxGraph();
  3. cellParent = graph.getDefaultParent();
  4. graph.getModel().beginUpdate();

代码示例来源:origin: org.solovyev/common-other

  1. public static mxGraph toMxGraph(Graph<?, ?> g, int displayWidth, int displayHeight, int xStartPos, int yStartPos) {
  2. mxGraph graph = new mxGraph();
  3. setMxGraph(g, displayWidth, displayHeight, xStartPos, yStartPos, graph);
  4. return graph;
  5. }

代码示例来源:origin: stackoverflow.com

  1. mxGraph graph = new mxGraph();
  2. Map<String, Object> style = graph.getStylesheet().getDefaultEdgeStyle();
  3. style.put(mxConstants.STYLE_ROUNDED, true);
  4. style.put(mxConstants.STYLE_EDGE, mxConstants.EDGESTYLE_ENTITY_RELATION);

代码示例来源:origin: stackoverflow.com

  1. mxGraph graph = new mxGraph() {
  2. @Override
  3. public boolean isCellSelectable(Object cell) {
  4. if (cell != null) {
  5. if (cell instanceof mxCell) {
  6. mxCell myCell = (mxCell) cell;
  7. if (myCell.isEdge())
  8. return false;
  9. }
  10. }
  11. return super.isCellSelectable(cell);
  12. }
  13. };

代码示例来源:origin: stackoverflow.com

  1. mxGraph graph = new mxGraph();
  2. try
  3. {
  4. Document document = mxXmlUtils.parseXml(mxUtils.readFile(filePath));
  5. mxCodec codec = new mxCodec(document);
  6. codec.decode(document.getDocumentElement(), graph.getModel());
  7. }
  8. catch (Exception ex)
  9. {
  10. ex.printStackTrace();
  11. }

代码示例来源:origin: stackoverflow.com

  1. Document doc = mxXmlUtils.parseXml(erXmlString);
  2. mxGraph graph = new mxGraph();
  3. mxCodec codec = new mxCodec(doc);
  4. codec.decode(doc.getDocumentElement(), graph.getModel());
  5. mxGraphComponent graphComponent = new mxGraphComponent(graph);
  6. BufferedImage image = mxCellRenderer.createBufferedImage(graphComponent.getGraph(), null, 1, Color.WHITE, graphComponent.isAntiAlias(), null, graphComponent.getCanvas());
  7. mxPngEncodeParam param = mxPngEncodeParam.getDefaultEncodeParam(image);
  8. param.setCompressedText(new String[] { "mxGraphModel", erXmlString });
  9. FileOutputStream outputStream = new FileOutputStream(new File(filename));
  10. mxPngImageEncoder encoder = new mxPngImageEncoder(outputStream, param);
  11. if (image != null) {
  12. encoder.encode(image);
  13. return image;
  14. }
  15. outputStream.close();
  16. return null;
  17. }

代码示例来源:origin: stackoverflow.com

  1. public class TelaPrincipalController {
  2. @FXML
  3. private SwingNode swingComponentWrapper ;
  4. public void initialize() {
  5. SwingUtilities.invokeLater(this::createMxGraph);
  6. }
  7. private void createMxGraph() {
  8. mxGraph grafo = new mxGraph();
  9. Object parent = grafo.getDefaultParent();
  10. Object v1 = grafo.insertVertex(parent, null, "Brazil", 100, 100, 50, 40);
  11. Object v2 = grafo.insertVertex(parent, null, "Soccer", 240, 150, 50, 40);
  12. Object a1 = grafo.insertEdge(parent, null, "loves", v1, v2);
  13. mxGraphComponent graphComponent = new mxGraphComponent(grafo);
  14. swingComponentWrapper.setContent(graphComponent);
  15. }
  16. @FXML
  17. private void selecionarNo() {
  18. // ...
  19. }
  20. // etc etc...
  21. }

代码示例来源:origin: stackoverflow.com

  1. mxGraph graph = new mxGraph()

代码示例来源:origin: org.gdl-lang.gdl-tools/gdl-graph

  1. private mxGraph getGraph() {
  2. if (graph == null) {
  3. mxGraphModel model = new mxGraphModel();
  4. graph = new mxGraph(model);
  5. graph.setCellsDeletable(true);
  6. graph.getSelectionModel().setSingleSelection(false);
  7. graph.setHtmlLabels(true);
  8. graph.setAllowDanglingEdges(false);
  9. }
  10. return graph;
  11. }

代码示例来源:origin: stackoverflow.com

  1. super("Hello, World!");
  2. mxGraph graph = new mxGraph();
  3. Object parent = graph.getDefaultParent();

代码示例来源:origin: stackoverflow.com

  1. frame.getMaximumSize().height);
  2. final mxGraph graph = new mxGraph();
  3. Object parent = graph.getDefaultParent();
  4. graph.getModel().beginUpdate();

代码示例来源:origin: arquillian/arquillian-cube

  1. private FileEntry createDockerCompositionSchema(CubeDockerConfiguration cubeDockerConfiguration, ReporterConfiguration reporterConfiguration) {
  2. final mxGraph graph = new mxGraph();
  3. final Object parent = graph.getDefaultParent();
  4. graph.setAutoSizeCells(true);
  5. graph.getModel().beginUpdate();
  6. try {
  7. final DockerCompositions dockerContainersContent = cubeDockerConfiguration.getDockerContainersContent();
  8. final Map<String, CubeContainer> containers = dockerContainersContent.getContainers();
  9. final Map<String, Object> insertedVertex = new HashMap<>();
  10. for (Map.Entry<String, CubeContainer> containerEntry : containers.entrySet()) {
  11. String containerId = containerEntry.getKey();
  12. CubeContainer cubeContainer = containerEntry.getValue();
  13. updateGraph(graph, parent, insertedVertex, containerId, cubeContainer);
  14. }
  15. } finally {
  16. graph.getModel().endUpdate();
  17. }
  18. mxIGraphLayout layout = new mxHierarchicalLayout(graph, SwingConstants.WEST);
  19. layout.execute(graph.getDefaultParent());
  20. return generateCompositionSchemaImage(graph, reporterConfiguration);
  21. }

代码示例来源:origin: stackoverflow.com

  1. import javax.swing.JFrame;
  2. import com.mxgraph.swing.mxGraphComponent;
  3. import com.mxgraph.view.mxGraph;
  4. public class GraphFrame extends JFrame {
  5. public static void main(String[] args) {
  6. mxGraph graph = new mxGraph();
  7. Object parent = graph.getDefaultParent();
  8. graph.getModel().beginUpdate();
  9. try {
  10. Object v1 = graph.insertVertex(parent, null, "Hello", 20, 20, 80,
  11. 30);
  12. Object v2 = graph.insertVertex(parent, null, "World!", 240, 150,
  13. 80, 30);
  14. graph.insertEdge(parent, null, "Edge", v1, v2);
  15. } finally {
  16. graph.getModel().endUpdate();
  17. }
  18. mxGraphComponent graphComponent = new mxGraphComponent(graph);
  19. GraphFrame frame = new GraphFrame();
  20. frame.add(graphComponent);
  21. frame.pack();
  22. frame.setVisible(true);
  23. }
  24. }

代码示例来源:origin: stackoverflow.com

  1. public static mxGraph makeHelloWorldGraph() {
  2. mxGraph graph = new mxGraph();
  3. Object parent = graph.getDefaultParent();
  4. graph.getModel().beginUpdate();
  5. try {
  6. Object v1 = graph.insertVertex(parent, null, "", 20, 20, 80,
  7. 30,"opacity=0");
  8. Object v2 = graph.insertVertex(parent, null, "World!", 240, 150,
  9. 80, 30);
  10. graph.insertEdge(parent, null, "Edge", v1, v2);
  11. } finally {
  12. graph.getModel().endUpdate();
  13. }
  14. return graph;
  15. }

代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-layout

  1. protected void layout(FlowElementsContainer flowElementsContainer) {
  2. graph = new mxGraph();
  3. cellParent = graph.getDefaultParent();
  4. graph.getModel().beginUpdate();

代码示例来源:origin: org.opensingular/server-commons

  1. private static mxGraph renderGraph(ProcessDefinition<?> definicao) {
  2. final mxGraph graph = new mxGraph();
  3. final Object parent = graph.getDefaultParent();
  4. style(graph);
  5. graph.getModel().beginUpdate();
  6. graph.setAutoSizeCells(true);
  7. final FlowMap fluxo = definicao.getFlowMap();
  8. final Map<String, Object> mapaVertice = new HashMap<>();
  9. for (final MTask<?> task : fluxo.getTasks()) {
  10. final Object v = insertVertex(graph, task);
  11. mapaVertice.put(task.getAbbreviation(), v);
  12. }
  13. for (final MTaskEnd task : fluxo.getEndTasks()) {
  14. final Object v = insertVertex(graph, task);
  15. mapaVertice.put(task.getAbbreviation(), v);
  16. }
  17. addStartTransition(graph, fluxo.getStartTask(), mapaVertice);
  18. for (final MTask<?> task : fluxo.getTasks()) {
  19. for (final MTransition transicao : task.getTransitions()) {
  20. createTransition(graph, transicao, mapaVertice);
  21. }
  22. }
  23. final mxHierarchicalLayout layout = new mxHierarchicalLayout(graph);
  24. layout.setOrientation(SwingConstants.WEST);
  25. layout.execute(parent);
  26. graph.getModel().endUpdate();
  27. return graph;
  28. }

代码示例来源:origin: org.opensingular/singular-requirement-commons

  1. private static mxGraph renderGraph(FlowDefinition<?> definition) {
  2. final mxGraph graph = new mxGraph();
  3. final Object parent = graph.getDefaultParent();

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

  1. Object[] cells = model.cloneCells(aGraph.getChildCells(graph.getDefaultParent(), true, true), true);
  2. mxGraphModel modelCopy = new mxGraphModel();
  3. mxGraph graphCopy = new mxGraph(modelCopy);
  4. Object parentCopy = graphCopy.getDefaultParent();
  5. graphCopy.addCells(cells);

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

  1. mxGraph graphCopy = new mxGraph(modelCopy);
  2. graphCopy.addCells(cells);
  3. mxAnalysisGraph aGraphCopy = new mxAnalysisGraph();

代码示例来源:origin: org.tinyjee.jgraphx/jgraphx

  1. mxGraph graphCopy = new mxGraph(modelCopy);
  2. graphCopy.addCells(cells);
  3. mxAnalysisGraph aGraphCopy = new mxAnalysisGraph();

相关文章

mxGraph类方法