/*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* - Neither the name of Oracle nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This source code is provided to illustrate the usage of a given feature
* or technique and has been deliberately simplified. Additional steps
* required for a production-quality application, such as security checks,
* input validation and proper error handling, might not be present in
* this sample code.
*/
@SuppressWarnings("serial")
setLayout(new BorderLayout());
//p.setLayout(new BorderLayout());
b.addActionListener(al);
p.add(b);
b = new Button("previous");
b.addActionListener(al);
p.add(b);
c.addItemListener(il);
p.add(c);
c.addItem("Arc");
c.addItem("Oval");
c.addItem("Polygon");
c.addItem("Rect");
c.addItem("RoundRect");
add("North", p);
}
}
}
@SuppressWarnings("serial")
implements ActionListener, ItemListener {
public void init() {
setLayout(new BorderLayout());
}
public void destroy() {
}
}
}
}
}
return "An interactive demonstration of some graphics.";
}
} // end class GraphicsTest
@SuppressWarnings("serial")
public GraphicsCards() {
setLayout(new CardLayout());
}
} // end class GraphicsCards
@SuppressWarnings("serial")
public ArcCard() {
add(new ArcDegreePanel(true));
add(new ArcDegreePanel(false));
}
} // end class ArcCard
@SuppressWarnings("serial")
boolean filled;
}
int step,
int x,
int y,
int w,
int h,
int a1 = 0;
int progress = 0;
} else {
}
if (filled) {
} else {
}
} // end for
if (progress != 360) {
if (filled) {
} else {
}
} // end if
} // end arcSteps()
arcSteps(g,
2,
r.width / 4,
r.height / 4,
r.width / 2,
r.height / 2,
arcSteps(g,
1,
r.width / 4,
r.height / 4,
} // end paint()
} // end class ArcDegreePanel
@SuppressWarnings("serial")
boolean filled;
}
if (filled) {
} else {
}
if (filled) {
} else {
}
if (filled) {
} else {
}
if (filled) {
} else {
}
if (filled) {
} else {
}
if (filled) {
} else {
}
if (filled) {
} else {
}
if (filled) {
} else {
}
} // end paint()
} // end class ArcPanel
abstract class Shape {
}
g.drawRect(x, y, w, h);
}
g.fillRect(x, y, w, h);
}
}
g.drawOval(x, y, w, h);
}
g.fillOval(x, y, w, h);
}
}
}
}
}
// class variables
Polygon p;
public PolygonShape() {
}
void scalePolygon(float w, float h) {
p = new Polygon();
}
}
try {
ng.drawPolygon(p);
} finally {
}
}
try {
ng.fillPolygon(p);
} finally {
}
}
}
@SuppressWarnings("serial")
int step;
}
this(shape, 10);
}
}
} else {
}
} // end for
} // end paint()
} // end class ShapeTest
class ColorUtils {
}
}
}