01: package com.opensymphony.workflow.designer.views;
02:
03: import java.awt.BasicStroke;
04: import java.awt.Dimension;
05: import java.awt.Graphics;
06: import java.awt.Graphics2D;
07:
08: import org.jgraph.graph.GraphConstants;
09: import org.jgraph.graph.VertexRenderer;
10:
11: public class JoinRenderer extends VertexRenderer {
12: public void paint(Graphics g) {
13: int b = borderWidth;
14: Graphics2D g2 = (Graphics2D) g;
15: Dimension d = getSize();
16: boolean tmp = selected;
17:
18: // g.setColor(Color.lightGray);
19:
20: if (super .isOpaque()) {
21: g.setColor(super .getBackground());
22: g.fillRect(b - 1, b - 1, d.width - b, d.height - b);
23: }
24: try {
25: selected = false;
26: super .paint(g);
27: } finally {
28: selected = tmp;
29: }
30:
31: if (bordercolor != null) {
32: g.setColor(bordercolor);
33: g2.setStroke(new BasicStroke(b));
34: // g.drawRoundRect(b - 1, b - 1, d.width - b, d.height - b, arcw, arch);
35: g.drawRect(b - 1, b - 1, d.width - b, d.height - b);
36:
37: }
38: if (selected) {
39: g2.setStroke(GraphConstants.SELECTION_STROKE);
40: g.setColor(graph.getHighlightColor());
41: g.drawRect(b - 1, b - 1, d.width - b, d.height - b);
42: }
43: }
44:
45: }
|