- STYLE_STROKECOLOR:線の色
- STYLE_FILLCOLOR:塗りつぶし色
- STYLE_OPACITY:不透明度
- STYLE_TEXT_OPACITY:テキストの不透明度
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 - transparent vertices", visible: true, size: [300, 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_STROKECOLOR): "#ffffbb", (mxConstants.STYLE_FILLCOLOR): "#ffffbb", (mxConstants.STYLE_OPACITY): "50", (mxConstants.STYLE_TEXT_OPACITY): "50" ] stylesheet.putCellStyle("style1", style1) def v1 = graph.insertVertex(parent, null, "処理1", 20, 20, 80, 30) def v2 = graph.insertVertex(parent, null, "処理2", 70, 30, 80, 30, "style1") } finally { graph.model.endUpdate() } }実行結果
関連情報
JGraphxのダウンロードページ
0 件のコメント:
コメントを投稿