summaryrefslogtreecommitdiff
path: root/testautomation/global/input/java/Clock.java
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/global/input/java/Clock.java')
-rwxr-xr-xtestautomation/global/input/java/Clock.java46
1 files changed, 23 insertions, 23 deletions
diff --git a/testautomation/global/input/java/Clock.java b/testautomation/global/input/java/Clock.java
index d99baaf603a7..50348de629fa 100755
--- a/testautomation/global/input/java/Clock.java
+++ b/testautomation/global/input/java/Clock.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* 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.
- *
+ *
* -Redistribution in binary form must reproduct the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
@@ -27,14 +27,14 @@
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN
* IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that Software is not designed, licensed or intended for
* use in the design, construction, operation or maintenance of any nuclear
* facility.
*/
/*
- * @(#)Clock.java 1.13 03/12/19
+ * @(#)Clock.java 1.13 03/12/19
*/
import java.util.*;
@@ -51,7 +51,7 @@ import java.text.*;
public class Clock extends Applet implements Runnable {
private volatile Thread timer; // The thread that displays clock
private int lastxs, lastys, lastxm,
- lastym, lastxh, lastyh; // Dimensions used to draw hands
+ lastym, lastxh, lastyh; // Dimensions used to draw hands
private SimpleDateFormat formatter; // Formats the date displayed
private String lastdate; // String to hold date displayed
private Font clockFaceFont; // Font for number display on clock
@@ -63,7 +63,7 @@ public class Clock extends Applet implements Runnable {
public void init() {
int x,y;
lastxs = lastys = lastxm = lastym = lastxh = lastyh = 0;
- formatter = new SimpleDateFormat ("EEE MMM dd hh:mm:ss yyyy",
+ formatter = new SimpleDateFormat ("EEE MMM dd hh:mm:ss yyyy",
Locale.getDefault());
currentDate = new Date();
lastdate = formatter.format(currentDate);
@@ -99,7 +99,7 @@ public class Clock extends Applet implements Runnable {
String today;
currentDate = new Date();
-
+
formatter.applyPattern("s");
try {
s = Integer.parseInt(formatter.format(currentDate));
@@ -111,14 +111,14 @@ public class Clock extends Applet implements Runnable {
m = Integer.parseInt(formatter.format(currentDate));
} catch (NumberFormatException n) {
m = 10;
- }
+ }
formatter.applyPattern("h");
try {
h = Integer.parseInt(formatter.format(currentDate));
} catch (NumberFormatException n) {
h = 10;
}
-
+
// Set position of the ends of the hands
xs = (int) (Math.cos(s * Math.PI / 30 - Math.PI / 2) * 45 + xcenter);
ys = (int) (Math.sin(s * Math.PI / 30 - Math.PI / 2) * 45 + ycenter);
@@ -128,7 +128,7 @@ public class Clock extends Applet implements Runnable {
+ xcenter);
yh = (int) (Math.sin((h*30 + m / 2) * Math.PI / 180 - Math.PI / 2) * 30
+ ycenter);
-
+
// Get the date to print at the bottom
formatter.applyPattern("EEE MMM dd HH:mm:ss yyyy");
today = formatter.format(currentDate);
@@ -142,16 +142,16 @@ public class Clock extends Applet implements Runnable {
}
if (xm != lastxm || ym != lastym) {
g.drawLine(xcenter, ycenter-1, lastxm, lastym);
- g.drawLine(xcenter-1, ycenter, lastxm, lastym);
+ g.drawLine(xcenter-1, ycenter, lastxm, lastym);
}
if (xh != lastxh || yh != lastyh) {
g.drawLine(xcenter, ycenter-1, lastxh, lastyh);
- g.drawLine(xcenter-1, ycenter, lastxh, lastyh);
+ g.drawLine(xcenter-1, ycenter, lastxh, lastyh);
}
// Draw date and hands
g.setColor(numberColor);
- g.drawString(today, 5, 125);
+ g.drawString(today, 5, 125);
g.drawLine(xcenter, ycenter, xs, ys);
g.setColor(handColor);
g.drawLine(xcenter, ycenter-1, xm, ym);
@@ -171,20 +171,20 @@ public class Clock extends Applet implements Runnable {
g.setColor(handColor);
g.drawArc(xcenter-50, ycenter-50, 100, 100, 0, 360);
g.setColor(numberColor);
- g.drawString("9", xcenter-45, ycenter+3);
+ g.drawString("9", xcenter-45, ycenter+3);
g.drawString("3", xcenter+40, ycenter+3);
g.drawString("12", xcenter-5, ycenter-37);
g.drawString("6", xcenter-3, ycenter+45);
// Draw date and hands
g.setColor(numberColor);
- g.drawString(lastdate, 5, 125);
+ g.drawString(lastdate, 5, 125);
g.drawLine(xcenter, ycenter, lastxs, lastys);
g.setColor(handColor);
g.drawLine(xcenter, ycenter-1, lastxm, lastym);
g.drawLine(xcenter-1, ycenter, lastxm, lastym);
g.drawLine(xcenter, ycenter-1, lastxh, lastyh);
- g.drawLine(xcenter-1, ycenter, lastxh, lastyh);
+ g.drawLine(xcenter-1, ycenter, lastxh, lastyh);
}
public void start() {
@@ -212,14 +212,14 @@ public class Clock extends Applet implements Runnable {
+ "Author: Rachel Gollub, 1995 \n"
+ "An analog clock.";
}
-
+
public String[][] getParameterInfo() {
String[][] info = {
- {"bgcolor", "hexadecimal RGB number",
+ {"bgcolor", "hexadecimal RGB number",
"The background color. Default is the color of your browser."},
- {"fgcolor1", "hexadecimal RGB number",
+ {"fgcolor1", "hexadecimal RGB number",
"The color of the hands and dial. Default is blue."},
- {"fgcolor2", "hexadecimal RGB number",
+ {"fgcolor2", "hexadecimal RGB number",
"The color of the second hand and numbers. Default is dark gray."}
};
return info;