1 package com.opensymphony.workflow.designer.views; 2 3 import java.awt.BasicStroke ; 4 import java.awt.Dimension ; 5 import java.awt.Graphics ; 6 import java.awt.Graphics2D ; 7 8 import org.jgraph.graph.GraphConstants; 9 import org.jgraph.graph.VertexRenderer; 10 11 public class InitialActionRenderer extends VertexRenderer 12 { 13 public void paint(Graphics g) 14 { 15 int b = borderWidth; 16 Graphics2D g2 = (Graphics2D )g; 17 Dimension d = getSize(); 18 boolean tmp = selected; 19 if(super.isOpaque()) 20 { 21 g.setColor(super.getBackground()); 22 g.fillOval(b - 1, b - 1, d.width - b, d.height - b); 23 } 24 try 25 { 26 setBorder(null); 27 setOpaque(false); 28 selected = false; 29 super.paint(g); 30 } 31 finally 32 { 33 selected = tmp; 34 } 35 if(bordercolor != null) 36 { 37 g.setColor(bordercolor); 38 g2.setStroke(new BasicStroke (b)); 39 g.drawOval(b - 1, b - 1, d.width - b, d.height - b); 40 } 41 if(selected) 42 { 43 g2.setStroke(GraphConstants.SELECTION_STROKE); 44 g.setColor(graph.getHighlightColor()); 45 g.drawOval(b - 1, b - 1, d.width - b, d.height - b); 46 } 47 } 48 } 49 | Popular Tags |