- STYLE_FOLDABLE:折り畳み可否
import java.awt.* import javax.swing.* import groovy.swing.* import com.mxgraph.swing.* import com.mxgraph.view.* import com.mxgraph.util.mxConstants import com.mxgraph.layout.* def graph = new mxGraph() def mxgc = new mxGraphComponent(graph) sb = new SwingBuilder() def frm = sb.frame( title: "JGraphX - unfoldable", visible: true, size: [200, 200], resizable: true, contentPane: mxgc, defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ parent = graph.getDefaultParent() graph.model.beginUpdate() try { def stylesheet = graph.getStylesheet() // カスタムスタイル def style1 = [ (mxConstants.STYLE_FOLDABLE): 0, // 折りたたみ不可 (mxConstants.STYLE_VERTICAL_ALIGN):mxConstants.ALIGN_TOP ] stylesheet.putCellStyle("style1", style1) def v1 = graph.insertVertex(parent, null, "処理グループ", 20, 10, 140, 120, "style1") def v2 = graph.insertVertex(v1, null, "処理1", 10, 20, 100, 30) def v3 = graph.insertVertex(v1, null, "処理2", 10, 80, 100, 30) graph.insertEdge(parent, null, "正常終了", v2, v3) } finally { graph.model.endUpdate() } }実行結果
関連情報
JGraphxのダウンロードページ
0 件のコメント:
コメントを投稿