/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6296064 6521533
* @summary A simple manual test for visual verification of GradientPaint
* LinearGradientPaint, and RadialGradientPaint.
* @author campbelc
*/
};
private int numColors;
private MultiGradientTest() {
setLayout(new BorderLayout());
gradientPanel = new GradientPanel();
controlsPanel = new ControlsPanel();
}
private float radius;
private GradientPanel() {
startX = 20;
startY = 20;
endX = 100;
endY = 100;
ctrX = 100;
ctrY = 100;
focusX = 100;
focusY = 100;
radius = 100.0f;
makeNewPaint();
MouseAdapter l = new MyMouseAdapter();
addMouseListener(l);
}
int w = getWidth();
int h = getHeight();
switch (shapeType) {
default:
case RECT:
break;
case ELLIPSE:
break;
case MULTIPLE:
p.addPoint(w/2, h);
p.addPoint(w, h);
g2d.fillPolygon(p);
break;
}
switch (paintType) {
default:
case BASIC:
case LINEAR:
break;
case RADIAL:
break;
}
}
private void updatePoints(int x, int y) {
try {
} catch (NoninvertibleTransformException e) {
e.printStackTrace();
}
switch (paintType) {
default:
case BASIC:
case LINEAR:
// pick the closest point to move
startX = x;
startY = y;
} else {
endX = x;
endY = y;
}
break;
case RADIAL:
// pick the closest point to move
ctrX = x;
ctrY = y;
} else {
focusX = x;
focusY = y;
}
break;
}
updatePaint();
}
private void makeNewPaint() {
}
switch (paintType) {
case BASIC:
break;
default:
case LINEAR:
paint =
new AffineTransform());
break;
case RADIAL:
paint =
new AffineTransform());
break;
}
switch (xformType) {
default:
case IDENTITY:
transform = new AffineTransform();
break;
case TRANSLATE:
break;
case SCALE:
break;
case SHEAR:
break;
case ROTATE:
getWidth()/2,
getHeight()/2);
break;
}
}
public void updatePaint() {
makeNewPaint();
repaint();
}
}
}
}
}
}
private ControlsPanel() {
public void stateChanged(ChangeEvent e) {
}
});
}
cmb.addActionListener(this);
return cmb;
}
cb.addActionListener(this);
return cb;
}
} else if (source == cbAntialias) {
}
}
}
extends AbstractListModel
implements ComboBoxModel
{
}
public int getSize() {
}
}
}
public E getSelectedItem() {
return selected;
}
}
public void windowClosing(WindowEvent e) {
}
});
frame.setVisible(true);
}
}