// "Counter1.java" Java Counter1 Ver1.10 1999,Feb,06 // copyright: Hiroyuki Murata import java.applet.Applet; import java.awt.*; import java.net.URL; public class Counter1 extends Applet implements Runnable { int digit; // Counter Digit Thread thread; String strDigits="9012345678901"; int Width,WidDig,Height,Hpitch,H10,Hall; int offsetY; Image iroll,ioff; Graphics groll,goff; Graphics[] gsub; char[] charCount; Motionc1[] mv; public void init() { String strCount_ = getParameter("count"); if (strCount_ == null) strCount_ = getParamStr("name", "0"); digit = getParamInt("digit", 4); int digMarX = getParamInt("digmarx", 2); // X Digit Margin int digMarY = getParamInt("digmary", -5); // Y Digit Margin int appMarX = 4; // X Applet Margin int appMarY = 4; // Y Applet Margin Color bgColor = getParamCol("bgcolor", 0); Color fgColor = getParamCol("fgcolor", 0xff4040); Color f0Color = getParamCol("f0color", 0x808080); Color f1Color = getParamCol("f1color", 0xe0e0e0); String fontname = getParamStr("fontname", "TimesRoman"); int fontstyle = getParamInt("fontstyle", 1); int fontsize = getParamInt("fontsize", 30); gsub = new Graphics[digit]; charCount = new char[digit]; mv = new Motionc1[digit]; for (int i=0; i=0) ? fMinDist : fMinDist*2.0; double BrkTime = Dist * 2.0 / fSpeed; // braking time subSpeed = fSpeed / BrkTime; } public double go() { if (brake) { fSpeed -= subSpeed; if (fSpeed<=0.0) { fSpeed = 0.0; brake = false; still = true; } } if (!still) { fN += fSpeed; if (fN >= 10.0) { fN -= 10.0; } } return fN; } } /*************************************************************************/