- STYLE_FILLCOLOR:塗りつぶし色
- STYLE_GRADIENTCOLOR:グラデーション色
- STYLE_GRADIENT_DIRECTION:グラデーションの方向
- DIRECTION_EAST:東向き
- DIRECTION_WEST:西向き
- DIRECTION_NORTH:北向き
- DIRECTION_SOUTH:南向き
import java.awt.* import javax.swing.* import groovy.swing.* import com.mxgraph.swing.* import com.mxgraph.view.* import com.mxgraph.util.mxConstants def graph = new mxGraph() def mxgc = new mxGraphComponent(graph) sb = new SwingBuilder() def frm = sb.frame( title: "JGraphX - gradient", visible: true, size: [150, 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_FILLCOLOR): "#7799dd", // グラデーション色 (mxConstants.STYLE_GRADIENTCOLOR): "#ffffff", // グラデーションの方向 //(DIRECTION_EAST, DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_SOUTH) (mxConstants.STYLE_GRADIENT_DIRECTION): mxConstants.DIRECTION_EAST ] stylesheet.putCellStyle("style1", style1) def v1 = graph.insertVertex(parent, null, "処理1", 20, 20, 100, 30, "style1") def v2 = graph.insertVertex(parent, null, "処理2", 20, 90, 100, 30) graph.insertEdge(parent, null, "正常終了", v1, v2) } finally { graph.model.endUpdate() } }実行結果
関連情報
JGraphxのダウンロードページ
0 件のコメント:
コメントを投稿