- EDGE_SELECTION_COLOR:線を選択した時の色
- EDGE_SELECTION_STROKE:線を選択した時のStroke
- HANDLE_BORDERCOLOR:ハンドルの線の色
- CONNECT_HANDLE_FILLCOLOR:コネクタの塗りつぶし色
import java.awt.* import javax.swing.* import groovy.swing.* import com.mxgraph.swing.* import com.mxgraph.swing.util.mxSwingConstants import com.mxgraph.view.* def graph = new mxGraph() def mxgc = new mxGraphComponent(graph) mxSwingConstants.EDGE_SELECTION_COLOR = new Color(0xff, 0xff, 0xff) mxSwingConstants.EDGE_SELECTION_STROKE = new BasicStroke() mxSwingConstants.HANDLE_BORDERCOLOR = new Color(0xff, 0x00, 0x00) mxSwingConstants.CONNECT_HANDLE_FILLCOLOR = new Color(0x80, 0x80, 0x80) sb = new SwingBuilder() def frm = sb.frame( title: "JGraphX - selection color for edges", visible: true, size: [300, 200], resizable: true, contentPane: mxgc, defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE ){ parent = graph.getDefaultParent() graph.model.beginUpdate() try { def v1 = graph.insertVertex(parent, null, "処理1", 20, 20, 80, 30) def v2 = graph.insertVertex(parent, null, "処理2", 170, 20, 80, 30) graph.insertEdge(parent, null, "正常終了", v1, v2) } finally { graph.model.endUpdate() } }実行結果
関連情報
JGraphxのダウンロードページ
0 件のコメント:
コメントを投稿