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 JoinRenderer 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 20 22 if(super.isOpaque()) 23 { 24 g.setColor(super.getBackground()); 25 g.fillRect(b - 1, b - 1, d.width - b, d.height - b); 26 } 27 try 28 { 29 selected = false; 30 super.paint(g); 31 } 32 finally 33 { 34 selected = tmp; 35 } 36 37 if(bordercolor != null) 38 { 39 g.setColor(bordercolor); 40 g2.setStroke(new BasicStroke (b)); 41 g.drawRect(b - 1, b - 1, d.width - b, d.height - b); 43 44 } 45 if(selected) 46 { 47 g2.setStroke(GraphConstants.SELECTION_STROKE); 48 g.setColor(graph.getHighlightColor()); 49 g.drawRect(b - 1, b - 1, d.width - b, d.height - b); 50 } 51 } 52 53 } 54 | Popular Tags |