From: <ls...@us...> - 2008-08-06 20:28:45
|
Revision: 4403 http://jnode.svn.sourceforge.net/jnode/?rev=4403&view=rev Author: lsantha Date: 2008-08-06 20:28:42 +0000 (Wed, 06 Aug 2008) Log Message: ----------- Code style fixes. Modified Paths: -------------- trunk/builder/src/configure/org/jnode/configure/Configure.java trunk/gui/src/awt/org/jnode/awt/util/SurfaceGraphics2D.java trunk/gui/src/test/org/jnode/test/gui/FBTest.java Modified: trunk/builder/src/configure/org/jnode/configure/Configure.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/Configure.java 2008-08-06 20:27:23 UTC (rev 4402) +++ trunk/builder/src/configure/org/jnode/configure/Configure.java 2008-08-06 20:28:42 UTC (rev 4403) @@ -27,11 +27,11 @@ /** * The main class for the JNode configuration tool (command line version). - * <p> + * <p/> * The command currently does not use the JNode Command / Syntax APIs. This * should be addressed when we have a compatibility library. A version with a * GUI-based interface would be a good idea too. - * + * * @author cr...@jn... */ public class Configure { @@ -49,10 +49,10 @@ private boolean debug; private boolean verbose; private boolean help; - + private static String USAGE = "configure.sh [--debug] [--verbose] [--help] [<script>]"; - private static String[] DESCRIPTION = new String[] { + private static String[] DESCRIPTION = new String[]{ "Capture configuration properties based on the supplied <script>.", " If no arguments or options are provided, defaults are supplied", " by the wrapper script. A copy of the previous state of each", @@ -63,7 +63,7 @@ " --help output command help then exit", " --debug enable debug output" }; - private static String[] UI_HELP = new String[] { + private static String[] UI_HELP = new String[]{ "The program will prompt you for values for a series of properties,", "showing a list of legal values or a regex. If there is a default", "value, it will be shown in square brackets. At the prompt, type", @@ -114,20 +114,20 @@ print(DESCRIPTION, err); print(UI_HELP, err); } - + private void print(String line, PrintStream stream) { format(stream, line, DISPLAY_NORMAL); } private void print(String[] lines, PrintStream stream) { - for (String line: lines) { + for (String line : lines) { format(stream, line, DISPLAY_NORMAL); } } /** * Parse the command line. - * + * * @param args */ private void parseArguments(String[] args) throws ConfigureException { Modified: trunk/gui/src/awt/org/jnode/awt/util/SurfaceGraphics2D.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/util/SurfaceGraphics2D.java 2008-08-06 20:27:23 UTC (rev 4402) +++ trunk/gui/src/awt/org/jnode/awt/util/SurfaceGraphics2D.java 2008-08-06 20:28:42 UTC (rev 4403) @@ -965,16 +965,16 @@ public void fillRect(int x, int y, int width, int height) { // if(clip2D == null){ - if (paint == null) { - simpleGraphics.fillRect(x, y, width, height); - } else { - x = x + simpleGraphics.origin.x; - y = y + simpleGraphics.origin.y; + if (paint == null) { + simpleGraphics.fillRect(x, y, width, height); + } else { + x = x + simpleGraphics.origin.x; + y = y + simpleGraphics.origin.y; - BufferedImage img = getFillerImage(x, y, width, height); - //org.jnode.vm.Unsafe.debug("SurfaceGraphics2D - 2\n"); - drawImage(img, x, y, background, null); - } + BufferedImage img = getFillerImage(x, y, width, height); + //org.jnode.vm.Unsafe.debug("SurfaceGraphics2D - 2\n"); + drawImage(img, x, y, background, null); + } /* todo attempt to fix metal ocean slider painting (Graphics2D.clip() is used with non-rectangular shape + fillRect() with gradient paint) @@ -984,7 +984,8 @@ af.translate(simpleGraphics.origin.x, simpleGraphics.origin.y); if(paint == null){ org.jnode.vm.Unsafe.debug("SurfaceGraphics2D - 3\n"); - //surface.fill(new Rectangle(x, y, width, height), clip2D, af, simpleGraphics.getColor(), Surface.PAINT_MODE); + //surface.fill(new Rectangle(x, y, width, height), clip2D, af, simpleGraphics.getColor(), + // Surface.PAINT_MODE); x = x + simpleGraphics.origin.x; y = y + simpleGraphics.origin.y; Modified: trunk/gui/src/test/org/jnode/test/gui/FBTest.java =================================================================== --- trunk/gui/src/test/org/jnode/test/gui/FBTest.java 2008-08-06 20:27:23 UTC (rev 4402) +++ trunk/gui/src/test/org/jnode/test/gui/FBTest.java 2008-08-06 20:28:42 UTC (rev 4403) @@ -33,7 +33,6 @@ import java.io.PrintStream; import java.util.ArrayList; import java.util.Collection; - import org.apache.log4j.Logger; import org.jnode.driver.Device; import org.jnode.driver.DeviceUtils; @@ -51,16 +50,16 @@ * @author epr */ public class FBTest extends AbstractCommand { - + private final DeviceArgument ARG_DEVICE = new DeviceArgument( - "device", Argument.OPTIONAL, "the FrameBuffer device to use", FrameBufferAPI.class); - + "device", Argument.OPTIONAL, "the FrameBuffer device to use", FrameBufferAPI.class); + private final IntegerArgument ARG_LOOPS = new IntegerArgument( - "loops", Argument.OPTIONAL, "how many loops each test should perform"); - + "loops", Argument.OPTIONAL, "how many loops each test should perform"); + private final StringArgument ARG_TESTS = new StringArgument( - "tests", Argument.OPTIONAL, "tests to be perform (lREAQ)"); - + "tests", Argument.OPTIONAL, "tests to be perform (lREAQ)"); + public FBTest() { super("Performs tests on the FrameBuffer implementation and outputs performance data"); registerArguments(ARG_DEVICE, ARG_LOOPS, ARG_TESTS); @@ -100,7 +99,7 @@ if (tests.indexOf('Q') >= 0) { log.info("Shape QuadCurve PAINT " + performTest(new DrawShapeQuadTest(), Surface.PAINT_MODE)); //log.info("Shape Arc XOR " + performTest(new DrawShapeArcTest(), Surface.XOR_MODE)); - } + } if (tests.indexOf('C') >= 0) { log.info("Colors " + performTest(new ColorsTest(), Surface.PAINT_MODE)); } @@ -109,10 +108,10 @@ public static void main(String[] args) throws Exception { new FBTest().execute(args); } - + public void execute(CommandLine commandLine, InputStream in, - PrintStream out, PrintStream err) { - + PrintStream out, PrintStream err) { + Device dev = ARG_DEVICE.getValue(); count = ARG_LOOPS.isSet() ? ARG_LOOPS.getValue() : 100; tests = ARG_TESTS.isSet() ? ARG_TESTS.getValue() : "lREAQC"; @@ -134,9 +133,9 @@ g = api.open(conf); this.width = conf.getScreenWidth(); this.height = conf.getScreenHeight(); - + perform(); - + Thread.sleep(30000); } catch (Throwable ex) { log.error("Error in FBTest", ex); @@ -228,16 +227,16 @@ public void perform() { int x = 0; final int width = 50; - for(Color color : colors) { - for(int i = 0 ; i < 10 ; i++) { - final int w = width - 2 * i; + for (Color color : colors) { + for (int i = 0; i < 10; i++) { + final int w = width - 2 * i; g.draw(new Rectangle2D.Double(x + i, i, w, w), null, tx, color, paintMode); - } + } x += width; } } } - + class DrawShapeArcTest implements Test { public void perform() { final int x1 = randomX(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |