home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Canvas;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.Polygon;
- import java.awt.image.ImageObserver;
-
- class SpinDemo3 extends Canvas implements Runnable {
- String label;
- private boolean isdisplay;
- // $FF: renamed from: ji java.lang.Thread
- private Thread field_0;
- private SpinDemo1 dad;
- private int waitval;
- private int arc_count;
- private boolean setonce;
- private boolean cycle;
- private boolean nnmj = true;
- private boolean mouse_is_down;
- String gogo = "nothing selected";
- Color UsersChoice;
- // $FF: renamed from: gg java.awt.Font
- Font field_1;
- Color linkColor;
- private Image ghy;
- private Dimension ghjb;
- private Graphics ghyb;
-
- public boolean mouseEnter(Event evt, int x, int y) {
- if (this.mouse_is_down) {
- this.set_nnmj(false);
- }
-
- return true;
- }
-
- public void stop() {
- if (this.field_0 != null) {
- this.field_0.stop();
- this.field_0 = null;
- }
-
- }
-
- public void hyhyxx(String ntext) {
- this.gogo = ntext;
- ((Component)this).repaint();
- }
-
- public boolean mouseExit(Event evt, int x, int y) {
- if (this.mouse_is_down) {
- this.set_nnmj(true);
- }
-
- return true;
- }
-
- public void zxzx(Graphics g, boolean butup) {
- int offset;
- if (butup) {
- offset = 0;
- } else {
- offset = 1;
- }
-
- int xmid = ((Component)this).size().width / 2 - 1;
- int ymid = ((Component)this).size().height / 2 - 1;
- g.setColor(Color.black);
- g.drawArc(xmid - 18 + offset, ymid - 18 + offset, 36, 36, 0, 360);
- g.setColor(Color.gray);
- g.drawArc(xmid - 19 + offset, ymid - 19 + offset, 38, 38, 50, 180);
- g.setColor(Color.white);
- g.drawArc(xmid - 19 + offset, ymid - 19 + offset, 38, 38, 240, 165);
- if (butup) {
- g.setColor(Color.green);
- } else {
- g.setColor(Color.red);
- }
-
- g.drawArc(xmid - 18 + offset, ymid - 18 + offset, 36, 36, -this.arc_count, 200);
- Polygon oli = new Polygon();
- oli.addPoint(xmid - 9 + offset, ymid - 13 + offset);
- oli.addPoint(xmid + 14 + offset, ymid + offset);
- oli.addPoint(xmid - 9 + offset, ymid + 13 + offset);
- oli.addPoint(xmid - 2 + offset, ymid + offset);
- g.fillPolygon(oli);
- }
-
- public void paint(Graphics g) {
- g.setFont(this.field_1);
- if (this.isdisplay) {
- g.setColor(Color.black);
- g.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
- g.setColor(this.linkColor);
- g.drawString(this.gogo, 5, 14);
- } else {
- this.dad.activatebrother();
- g.setColor(Color.lightGray);
- g.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
- g.setColor(Color.lightGray);
- if (this.nnmj) {
- this.paintUp(g);
- } else {
- this.paintUp(g);
- this.bhytx(g);
- }
-
- this.zxzx(g, this.nnmj);
- }
- }
-
- public void bhytx(Graphics g) {
- g.setColor(Color.lightGray);
- g.fillRect(6, 6, ((Component)this).size().width - 13, ((Component)this).size().height - 13);
- g.setColor(Color.gray);
- g.drawLine(6, 6, ((Component)this).size().width - 8, 6);
- g.drawLine(6, 6, 6, ((Component)this).size().height - 8);
- }
-
- public boolean mouseUp(Event evt, int x, int y) {
- this.set_nnmj(true);
- if (this.mouse_is_down) {
- this.Xxxx();
- }
-
- this.mouse_is_down = false;
- return true;
- }
-
- public void set_nnmj(boolean state) {
- if (this.nnmj != state) {
- this.nnmj = state;
- ((Component)this).repaint();
- }
-
- }
-
- public void Xxxx() {
- this.dad.Xx();
- }
-
- public final synchronized void update(Graphics g) {
- Dimension d = ((Component)this).size();
- if (this.ghy == null || d.width != this.ghjb.width || d.height != this.ghjb.height) {
- this.ghy = ((Component)this).createImage(d.width, d.height);
- this.ghjb = d;
- this.ghyb = this.ghy.getGraphics();
- }
-
- this.paint(this.ghyb);
- g.drawImage(this.ghy, 0, 0, (ImageObserver)null);
- }
-
- public void setUserval(Color UserCol) {
- this.UsersChoice = Color.black;
- }
-
- public void paintUp(Graphics g) {
- g.setColor(Color.lightGray);
- if (this.dad.bn != null) {
- g.drawImage(this.dad.bn, 0, 0, this);
- }
-
- g.draw3DRect(0, 0, ((Component)this).size().width - 1, ((Component)this).size().height - 1, true);
- g.setColor(Color.lightGray);
- g.fill3DRect(4, 4, ((Component)this).size().width - 9, ((Component)this).size().height - 9, false);
- g.fill3DRect(6, 6, ((Component)this).size().width - 13, ((Component)this).size().height - 13, true);
- g.setColor(Color.black);
- g.drawRect(5, 5, ((Component)this).size().width - 12, ((Component)this).size().height - 12);
- }
-
- public SpinDemo3(SpinDemo1 mum, boolean disp, Font dd, Color lincol) {
- this.UsersChoice = Color.red;
- this.field_1 = new Font("TimesRoman", 0, 14);
- this.linkColor = lincol;
- if (disp) {
- this.isdisplay = true;
- this.field_1 = dd;
- }
-
- this.dad = mum;
- ((Component)this).resize(55, 55);
- this.start();
- this.waitval = 100;
- }
-
- public void start() {
- if (this.field_0 == null) {
- this.field_0 = new Thread(this);
- this.field_0.start();
- }
-
- }
-
- public boolean mouseDown(Event evt, int x, int y) {
- this.set_nnmj(false);
- this.mouse_is_down = true;
- return true;
- }
-
- public void run() {
- while(true) {
- try {
- this.arc_count += 10;
- if (this.arc_count >= 360) {
- this.arc_count = 0;
- }
-
- if (this.cycle) {
- this.cycle = false;
- } else if (!this.cycle) {
- this.cycle = true;
- }
-
- ((Component)this).repaint();
- Thread.sleep((long)this.waitval);
- } catch (InterruptedException var3) {
- this.stop();
- }
- }
- }
-
- public void setLabel(String label) {
- this.label = label;
- ((Component)this).repaint();
- }
- }
-