01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.bpel.design.decoration.components;
21:
22: import java.awt.BasicStroke;
23: import java.awt.Color;
24: import java.awt.Graphics2D;
25: import java.awt.Paint;
26: import java.awt.Shape;
27: import java.awt.geom.Ellipse2D;
28:
29: /**
30: *
31: * @author aa160298
32: */
33: public class StubIcon2D extends Icon2D {
34:
35: protected void paint(Graphics2D g2) {
36: g2.setPaint(FILL_PAINT);
37: g2.fill(SHAPE);
38: g2.setPaint(STROKE_PAINT);
39: g2.setStroke(STROKE);
40: g2.draw(SHAPE);
41: }
42:
43: protected double getDesignOriginX() {
44: return DESIGN_SIZE / 2;
45: }
46:
47: protected double getDesignOriginY() {
48: return DESIGN_SIZE / 2;
49: }
50:
51: protected double getDesignWidth() {
52: return DESIGN_SIZE;
53: }
54:
55: protected double getDesignHeight() {
56: return DESIGN_SIZE;
57: }
58:
59: private static final Paint FILL_PAINT = new Color(0x999999);
60: private static final Paint STROKE_PAINT = new Color(0xCCCCCC);
61: private static final BasicStroke STROKE = new BasicStroke(1,
62: BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
63:
64: private static final double DESIGN_SIZE = 10;
65:
66: private static final Shape SHAPE = new Ellipse2D.Double(-2, -2, 4,
67: 4);
68: }
|