- 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 - text opacity", 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_TEXT_OPACITY): 50, ] stylesheet.putCellStyle("style1", style1) def v1a = graph.insertVertex(parent, null, "処理1a", 20, 20, 40, 30, "style1") def v1b = graph.insertVertex(parent, null, "処理1b", 120, 20, 40, 30, "style1") def v2 = graph.insertVertex(parent, null, "処理2", 70, 100, 40, 30, "style2") graph.insertEdge(parent, null, "正常終了", v1a, v2, "style1") graph.insertEdge(parent, null, "正常終了", v1b, v2, "style1") } finally { graph.model.endUpdate() } }実行結果
関連情報
JGraphxのダウンロードページ
0 件のコメント:
コメントを投稿