1 package net.sf.openrocket.gui.figureelements;
4 import java.awt.geom.Area;
5 import java.awt.geom.Ellipse2D;
8 * A mark indicating the position of the center of pressure. It is a red filled circle
9 * inside a slightly larger red circle.
11 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
14 public class CPCaret extends Caret {
15 private static final float RADIUS = 7;
17 private static Area caret = null;
20 * Create a new CPCaret at the specified coordinates.
22 public CPCaret(double x, double y) {
27 * Returns the Area object of the caret. The Area object is created only once,
28 * after which new copies are cloned from it.
31 protected Area getCaret() {
33 return (Area)caret.clone();
36 Ellipse2D.Float e = new Ellipse2D.Float(-RADIUS,-RADIUS,2*RADIUS,2*RADIUS);
39 caret.subtract(new Area(new Ellipse2D.Float(-RADIUS*0.9f,-RADIUS*0.9f,
40 2*0.9f*RADIUS,2*0.9f*RADIUS)));
42 caret.add(new Area(new Ellipse2D.Float(-RADIUS*0.75f,-RADIUS*0.75f,
43 2*0.75f*RADIUS,2*0.75f*RADIUS)));
45 return (Area) caret.clone();
50 * Return the color of the caret (red).
53 protected Color getColor() {