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

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

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

mxGraph.setStylesheet介绍

[英]Sets the stylesheet that provides the style.
[中]设置提供样式的样式表。

代码示例

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

  1. private static void style(mxGraph graph) {
  2. final mxStylesheet foo = new mxStylesheet();
  3. final Map<String, Object> stil = new HashMap<>();
  4. stil.put(mxConstants.STYLE_ROUNDED, Boolean.TRUE);
  5. stil.put(mxConstants.STYLE_EDGE, mxConstants.EDGESTYLE_ORTHOGONAL);
  6. stil.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_CONNECTOR);
  7. stil.put(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_CLASSIC);
  8. stil.put(mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER);
  9. stil.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_BOTTOM);
  10. stil.put(mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_BOTTOM);
  11. stil.put(mxConstants.STYLE_STROKECOLOR, "#6482B9");
  12. stil.put(mxConstants.STYLE_FONTCOLOR, "#446299");
  13. foo.setDefaultEdgeStyle(stil);
  14. addStyleIcon(foo, "TIMER", "timer.png");
  15. addStyleIcon(foo, "END", "terminate.png");
  16. addStyleIcon(foo, "MESSAGE", "message_intermediate.png");
  17. addStyleIcon(foo, "START", "start.png");
  18. addStyleIcon(foo, "JAVA", "gear.png");
  19. addStyleIcon(foo, "HUMAN", "pessoinha.png");
  20. graph.setStylesheet(foo);
  21. }

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

  1. private static void style(mxGraph graph) {
  2. final mxStylesheet foo = new mxStylesheet();
  3. final Map<String, Object> stil = new HashMap<>();
  4. stil.put(mxConstants.STYLE_ROUNDED, Boolean.TRUE);
  5. stil.put(mxConstants.STYLE_EDGE, mxConstants.EDGESTYLE_ORTHOGONAL);
  6. stil.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_CONNECTOR);
  7. stil.put(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_CLASSIC);
  8. stil.put(mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER);
  9. stil.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_BOTTOM);
  10. stil.put(mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_BOTTOM);
  11. stil.put(mxConstants.STYLE_STROKECOLOR, "#6482B9");
  12. stil.put(mxConstants.STYLE_FONTCOLOR, "#446299");
  13. foo.setDefaultEdgeStyle(stil);
  14. addStyleIcon(foo, "TIMER", "timer.png");
  15. addStyleIcon(foo, "END", "terminate.png");
  16. addStyleIcon(foo, "MESSAGE", "message_intermediate.png");
  17. addStyleIcon(foo, "START", "start.png");
  18. addStyleIcon(foo, "JAVA", "gear.png");
  19. addStyleIcon(foo, "HUMAN", "pessoinha.png");
  20. graph.setStylesheet(foo);
  21. }

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

  1. private static void style(mxGraph graph) {
  2. final mxStylesheet foo = new mxStylesheet();
  3. final Map<String, Object> stil = new HashMap<>();
  4. stil.put(mxConstants.STYLE_ROUNDED, true);
  5. stil.put(mxConstants.STYLE_EDGE, mxConstants.EDGESTYLE_ENTITY_RELATION);
  6. stil.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_CONNECTOR);
  7. stil.put(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_CLASSIC);
  8. stil.put(mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_MIDDLE);
  9. stil.put(mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER);
  10. stil.put(mxConstants.STYLE_STROKECOLOR, "#6482B9");
  11. stil.put(mxConstants.STYLE_FONTCOLOR, "#446299");
  12. foo.setDefaultEdgeStyle(stil);
  13. addStyleIcone(foo, "TIMER", "timer.png");
  14. addStyleIcone(foo, "END", "terminate.png");
  15. addStyleIcone(foo, "MESSAGE", "message_intermediate.png");
  16. addStyleIcone(foo, "START", "event.png");
  17. addStyleIcone(foo, "JAVA", "gear.png");
  18. graph.setStylesheet(foo);
  19. }

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

  1. private static void style(mxGraph graph) {
  2. final mxStylesheet foo = new mxStylesheet();
  3. final Map<String, Object> stil = new HashMap<>();
  4. stil.put(mxConstants.STYLE_ROUNDED, Boolean.TRUE);
  5. stil.put(mxConstants.STYLE_EDGE, mxConstants.EDGESTYLE_ORTHOGONAL);
  6. stil.put(mxConstants.STYLE_SHAPE, mxConstants.SHAPE_CONNECTOR);
  7. stil.put(mxConstants.STYLE_ENDARROW, mxConstants.ARROW_CLASSIC);
  8. stil.put(mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER);
  9. stil.put(mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_BOTTOM);
  10. stil.put(mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_BOTTOM);
  11. stil.put(mxConstants.STYLE_STROKECOLOR, "#6482B9");
  12. stil.put(mxConstants.STYLE_FONTCOLOR, "#446299");
  13. foo.setDefaultEdgeStyle(stil);
  14. addStyleIcon(foo, "TIMER", "timer.png");
  15. addStyleIcon(foo, "END", "terminate.png");
  16. addStyleIcon(foo, "MESSAGE", "message_intermediate.png");
  17. addStyleIcon(foo, "START", "start.png");
  18. addStyleIcon(foo, "JAVA", "gear.png");
  19. addStyleIcon(foo, "HUMAN", "pessoinha.png");
  20. graph.setStylesheet(foo);
  21. }

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

  1. /**
  2. * Constructs a new graph for the specified model. If no model is
  3. * specified, then a new, empty {@link com.mxgraph.model.mxGraphModel} is
  4. * used.
  5. *
  6. * @param model Model that contains the graph data
  7. */
  8. public mxGraph(mxIGraphModel model, mxStylesheet stylesheet)
  9. {
  10. selectionModel = createSelectionModel();
  11. setModel((model != null) ? model : new mxGraphModel());
  12. setStylesheet((stylesheet != null) ? stylesheet : createStylesheet());
  13. setView(createGraphView());
  14. }

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

  1. /**
  2. * Constructs a new graph for the specified model. If no model is
  3. * specified, then a new, empty {@link com.mxgraph.model.mxGraphModel} is
  4. * used.
  5. *
  6. * @param model Model that contains the graph data
  7. */
  8. public mxGraph(mxIGraphModel model, mxStylesheet stylesheet)
  9. {
  10. selectionModel = createSelectionModel();
  11. setModel((model != null) ? model : new mxGraphModel());
  12. setStylesheet((stylesheet != null) ? stylesheet : createStylesheet());
  13. setView(createGraphView());
  14. }

代码示例来源:origin: SmartDataAnalytics/DL-Learner

  1. stylesheet.setDefaultVertexStyle(nodeStyle);
  2. graph.setStylesheet(stylesheet);

相关文章

mxGraph类方法