01: /*
02: * Copyright (c) 2005, romain guy (romain.guy@jext.org) and craig wickesser (craig@codecraig.com)
03: * All rights reserved.
04: *
05: * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
06: *
07: * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
08: * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
09: * * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10: *
11: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
12: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
13: * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
15: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
16: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
18: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
19: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20: * POSSIBILITY OF SUCH DAMAGE.
21: */
22:
23: package net.java.swingfx.rubberband.rubberbands;
24:
25: import java.awt.Graphics;
26:
27: import net.java.swingfx.rubberband.canvas.RubberBandCanvas;
28:
29: /**
30: * An Oval {@link RubberBand} which subclasses {@link RectangularRubberBand}
31: * The only difference between the two rubber bands is the
32: * {@link RubberBand#draw(Graphics)} method
33: *
34: * @author rwickesser
35: * @since 1.0
36: * $Revision: 1.1 $
37: */
38: public class OvalRubberBand extends RectangularRubberBand {
39:
40: /**
41: * Creates a new rubber band which is oval
42: *
43: * @param canvas the canvas to draw the rubber band on
44: */
45: public OvalRubberBand(RubberBandCanvas canvas) {
46: super (canvas);
47: }
48:
49: /* (non-Javadoc)
50: * @see gui.rubberband.RubberBand#draw(java.awt.Graphics)
51: */
52: public void draw(Graphics g) {
53: g.drawOval(rubberband.x, rubberband.y, rubberband.width,
54: rubberband.height);
55: }
56: }
|