summaryrefslogtreecommitdiff
path: root/java/gjt/rubberband/RubberbandEllipse.java
blob: 50ddb0cdd6bd889d7836f24ac806e8167f005dd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package gjt.rubberband;

import java.awt.Component;
import java.awt.Graphics;
import java.awt.Rectangle;

/** 
 *  A Rubberband that does ellipses.
 *
 * @version 1.00, 12/27/95
 * @author  David Geary
 * @see     Rubberband
 * @see     gjt.test.RubberbandTest
 */
public class RubberbandEllipse extends Rubberband {
    private final int startAngle = 0;
    private final int endAngle   = 360;

    public RubberbandEllipse(Component component) {
        super(component);
    }
    public void drawLast(Graphics graphics) {
        Rectangle r = lastBounds();
        graphics.drawArc(r.x, r.y, 
            r.width, r.height, startAngle, endAngle);
    }
    public void drawNext(Graphics graphics) {
        Rectangle r = bounds();
        graphics.drawArc(r.x, r.y, 
            r.width, r.height, startAngle, endAngle);
    }
}