} catch (NoClassDefFoundError e) {
}
}
public static void init() {
renderroot = new Group(graphicsroot, "render", "Rendering Benchmarks");
renderoptroot = new Group(renderroot, "opts", "Rendering Options");
rendertestroot = new Group(renderroot, "tests", "Rendering Tests");
ArrayList paintStrs = new ArrayList();
ArrayList paintDescs = new ArrayList();
paintStrs.add("single");
paintDescs.add("Single Color");
paintStrs.add("random");
paintDescs.add("Random Color");
if (hasGraphics2D) {
paintStrs.add("gradient2");
paintDescs.add("2-color GradientPaint");
if (hasMultiGradient) {
paintStrs.add("linear2");
paintDescs.add("2-color LinearGradientPaint");
paintStrs.add("linear3");
paintDescs.add("3-color LinearGradientPaint");
paintStrs.add("radial2");
paintDescs.add("2-color RadialGradientPaint");
paintStrs.add("radial3");
paintDescs.add("3-color RadialGradientPaint");
}
paintStrs.add("texture20");
paintDescs.add("20x20 TexturePaint");
paintStrs.add("texture32");
paintDescs.add("32x32 TexturePaint");
}
String[] paintStrArr = new String[paintStrs.size()];
paintStrArr = (String[])paintStrs.toArray(paintStrArr);
String[] paintDescArr = new String[paintDescs.size()];
paintDescArr = (String[])paintDescs.toArray(paintDescArr);
paintList =
new Option.ObjectList(renderoptroot,
"paint", "Paint Type",
paintStrArr, paintStrArr,
paintStrArr, paintDescArr,
0x1);
((Option.ObjectList) paintList).setNumRows(5);
// add special RandomColorOpt for backwards compatibility with
// older options files
new RandomColorOpt();
if (hasGraphics2D) {
doAlphaColors =
new Option.Toggle(renderoptroot, "alphacolor",
"Set the alpha of the paint to 0.125",
Option.Toggle.Off);
doAntialias =
new Option.Toggle(renderoptroot, "antialias",
"Render shapes antialiased",
Option.Toggle.Off);
String strokeStrings[] = {
"width0",
"width1",
"width5",
"width20",
"dash0_5",
"dash1_5",
"dash5_20",
"dash20_50",
};
String strokeDescriptions[] = {
"Solid Thin lines",
"Solid Width 1 lines",
"Solid Width 5 lines",
"Solid Width 20 lines",
"Dashed Thin lines",
"Dashed Width 1 lines",
"Dashed Width 5 lines",
"Dashed Width 20 lines",
};
BasicStroke strokeObjects[] = {
new BasicStroke(0f),
new BasicStroke(1f),
new BasicStroke(5f),
new BasicStroke(20f),
new BasicStroke(0f, BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_MITER, 10f,
new float[] { 5f, 5f }, 0f),
new BasicStroke(1f, BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_MITER, 10f,
new float[] { 5f, 5f }, 0f),
new BasicStroke(5f, BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_MITER, 10f,
new float[] { 20f, 20f }, 0f),
new BasicStroke(20f, BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_MITER, 10f,
new float[] { 50f, 50f }, 0f),
};
strokeList =
new Option.ObjectList(renderoptroot,
"stroke", "Stroke Type",
strokeStrings, strokeObjects,
strokeStrings, strokeDescriptions,
0x2);
((Option.ObjectList) strokeList).setNumRows(4);
}
new DrawDiagonalLines();
new DrawHorizontalLines();
new DrawVerticalLines();
new FillRects();
new DrawRects();
new FillOvals();
new DrawOvals();
new FillPolys();
new DrawPolys();
if (hasGraphics2D) {
rendershaperoot = new Group(rendertestroot, "shape",
"Shape Rendering Tests");
new FillCubics();
new DrawCubics();
new FillEllipse2Ds();