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 InitialActionRenderer 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: if (super .isOpaque()) {
18: g.setColor(super .getBackground());
19: g.fillOval(b - 1, b - 1, d.width - b, d.height - b);
20: }
21: try {
22: setBorder(null);
23: setOpaque(false);
24: selected = false;
25: super .paint(g);
26: } finally {
27: selected = tmp;
28: }
29: if (bordercolor != null) {
30: g.setColor(bordercolor);
31: g2.setStroke(new BasicStroke(b));
32: g.drawOval(b - 1, b - 1, d.width - b, d.height - b);
33: }
34: if (selected) {
35: g2.setStroke(GraphConstants.SELECTION_STROKE);
36: g.setColor(graph.getHighlightColor());
37: g.drawOval(b - 1, b - 1, d.width - b, d.height - b);
38: }
39: }
40: }
|