dominoclock/PendorDate.jad

135 lines
3.8 KiB
Plaintext
Executable File

// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: PendorDate.java
import java.applet.Applet;
import java.awt.*;
import java.util.Date;
public class PendorDate extends Applet
implements Runnable
{
public void init()
{
String s = getParameter("font");
if(s == null)
s = "Times";
String s1 = getParameter("size");
if(s1 == null)
s1 = "18";
int i = Integer.valueOf(s1).intValue();
String s2 = getParameter("bgcolor");
if(s2 != null && s2.charAt(0) == '#' && s2.length() == 7)
{
Integer integer = new Integer(0);
integer = Integer.valueOf(s2.substring(1, 7), 16);
bgColor = new Color(integer.intValue());
bgColorSet = Boolean.TRUE;
}
String s3 = getParameter("fgcolor");
if(s3 == null || s3.charAt(0) != '#' || s3.length() != 7)
{
fgColor = Color.black;
} else
{
Integer integer1 = new Integer(0);
integer1 = Integer.valueOf(s3.substring(1, 7), 16);
fgColor = new Color(integer1.intValue());
}
font = new Font(s, 0, i);
}
public void paint(Graphics g)
{
Date date = new Date();
String s = new String();
int i = aiMonths[date.getMonth()] + date.getDate();
if(date.getMonth() > 2 && date.getYear() % 4 == 0 && date.getYear() % 2000 != 0)
i++;
i = (i * 24 + date.getHours()) - 16;
int j = date.getYear() + 16;
int k = i / 30;
int l = i % 30;
int i1 = (int)((double)(date.getSeconds() + date.getMinutes() * 60) / 2.25D);
int j1 = i1 / 40;
i1 %= 40;
Dimension dimension = size();
g.setFont(font);
if(bgColorSet == Boolean.TRUE)
{
g.setColor(bgColor);
g.fillRect(0, 0, dimension.width, dimension.height);
}
g.setColor(fgColor);
s = "The time on Pendor is " + String.valueOf(l) + ":";
if(j1 < 10)
s = s + "0";
s = s + String.valueOf(j1) + ":";
if(i1 < 10)
s = s + "0";
s = s + String.valueOf(i1);
int k1;
for(k1 = 0; k1 <= 17; k1++)
if(aiPMonths[k1] >= k)
break;
s = s + " on " + asWNames[(k1 - 1) % 6] + ", " + asMNames[k1 - 1] + " " + String.valueOf(k - aiPMonths[k1 - 1]) + ", 0" + String.valueOf(j);
g.drawString(s, 2, font.getSize());
}
public void start()
{
clock = new Thread(this);
clock.start();
}
public void stop()
{
clock.stop();
}
public void run()
{
do
{
try
{
Thread.sleep(1250L);
}
catch(InterruptedException _ex) { }
repaint();
} while(true);
}
public PendorDate()
{
bgColorSet = Boolean.FALSE;
dateDisplay = Boolean.TRUE;
}
Thread clock;
Font font;
Color bgColor;
Color fgColor;
Boolean bgColorSet;
Boolean dateDisplay;
private static short aiMonths[] = {
0, 31, 59, 90, 120, 151, 181, 212, 243, 273,
304, 334
};
private static short aiPMonths[] = {
0, 1, 25, 49, 73, 97, 121, 145, 146, 147,
171, 195, 211, 243, 267, 291, 292
};
private static String asMNames[] = {
"Yestar", "Narrin", "Nenim", "Sulim", "Virta", "Lothess", "Narnya", "Attendes", "Loende", "Cerim",
"Urim", "Yavar", "Narquel", "Hiss", "Ring", "Mettare"
};
private static String asWNames[] = {
"Seren", "Anar", "Noren", "Aldea", "Erwer", "Elenya"
};
}