⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guigeneral.java

📁 Java编写的蓝牙手机遥控器
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
    {
      return (paramMyTitleCanvas.textPos = paramInt);
    }

    private class ScrollTimerTask extends TimerTask
    {
      private final GUIGeneral.MyTitleCanvas this$1;

      public ScrollTimerTask()
      {
        this.this$1 = paramMyTitleCanvas;
      }

      public void run()
      {
        if (GUIGeneral.MyTitleCanvas.access$1900(this.this$1))
          switch (GUIGeneral.MyTitleCanvas.access$2000(this.this$1))
          {
          case 0:
            if (GUIGeneral.MyTitleCanvas.access$2100(this.this$1) <= 0)
              return;
            GUIGeneral.MyTitleCanvas.access$2110(this.this$1);
            this.this$1.repaint();
            break;
          case 2:
            if (GUIGeneral.MyTitleCanvas.access$2100(this.this$1) < GUIGeneral.MyTitleCanvas.access$2200(this.this$1).size() - 3)
            {
              GUIGeneral.MyTitleCanvas.access$2108(this.this$1);
              this.this$1.repaint();
              return;
            }
            GUIGeneral.MyTitleCanvas.access$2102(this.this$1, 0);
            this.this$1.repaint();
          }
      }
    }
  }

  public class MyImageCanvas extends Canvas
    implements CommandListener
  {
    private int w;
    private int h;
    private int boxHight;
    private int backGroundColor;
    private int borderColor;
    private Font font;
    private int fontHeight;
    private Image image;
    private Image offScreen;
    private final GUIGeneral this$0;

    public MyImageCanvas()
    {
      this.this$0 = paramGUIGeneral;
      if (!(isDoubleBuffered()))
        this.offScreen = Image.createImage(getWidth(), getHeight());
    }

    public void setImage(, int paramInt1, int paramInt2)
    {
      this.image = Image.createImage(paramArrayOfByte, paramInt1, paramInt2);
    }

    public void commandAction(, Displayable paramDisplayable)
    {
    }

    public void setColor(, int paramInt2, int paramInt3)
    {
      this.backGroundColor = paramInt1;
      this.borderColor = paramInt3;
      if (this.backGroundColor == this.borderColor)
        this.borderColor = paramInt2;
      if (this.backGroundColor == this.borderColor)
      {
        this.backGroundColor = 0;
        this.borderColor = 16777215;
      }
    }

    private void addOptions()
    {
      this.w = paramGraphics.getClipWidth();
      this.h = paramGraphics.getClipHeight();
      this.font = Font.getFont(0, 0, 8);
      paramGraphics.setFont(this.font);
      this.fontHeight = this.font.getHeight();
      this.boxHight = (this.fontHeight + 4);
      paramGraphics.setColor(this.borderColor);
      paramGraphics.fillRect(0, this.h - this.boxHight, this.w, this.boxHight);
      paramGraphics.setColor(this.backGroundColor);
      paramGraphics.drawString("OK", 2, this.h - (this.boxHight - this.fontHeight) / 2, 36);
      paramGraphics.drawString("BACK", this.w - 2, this.h - (this.boxHight - this.fontHeight) / 2, 40);
    }

    protected void keyPressed()
    {
      BluetoothRemoteControl.debug("keyPressed");
      int i = getGameAction(paramInt);
      boolean bool = GUIGeneral.access$500(this.this$0, paramInt, 4, i);
      if (!(bool))
      {
        if (GUIGeneral.access$600(this.this$0).leftSoftKey(paramInt))
        {
          GUIGeneral.access$600(this.this$0).sendOK();
          return;
        }
        if (GUIGeneral.access$600(this.this$0).rightSoftKey(paramInt))
        {
          GUIGeneral.access$600(this.this$0).sendBack();
          return;
        }
      }
    }

    protected void keyReleased()
    {
      BluetoothRemoteControl.debug("keyReleased");
      int i = getGameAction(paramInt);
      GUIGeneral.access$500(this.this$0, paramInt, 5, i);
    }

    public void show()
    {
      Display.getDisplay(GUIGeneral.access$700(this.this$0)).setCurrent(this);
      repaint();
    }

    public void paint()
    {
      try
      {
        Graphics localGraphics = (this.offScreen == null) ? paramGraphics : this.offScreen.getGraphics();
        this.w = localGraphics.getClipWidth();
        this.h = localGraphics.getClipHeight();
        localGraphics.drawImage(this.image, 0, 0, 20);
        addOptions(localGraphics);
        if (this.offScreen != null)
          paramGraphics.drawImage(this.offScreen, 0, 0, 24);
      }
    }
  }

  public class MyCanvas extends Canvas
    implements CommandListener
  {
    private String[] text;
    private String[] tempText;
    private int numOfString;
    private Font font;
    private String tempString;
    private int i;
    private int height;
    private int x;
    private int y;
    private int w;
    private int h;
    private int fontHeight;
    private int fontWidth;
    private int backGroundColor;
    private int foreGroundColor;
    private int borderColor;
    private int boxHight;
    private GUIGeneral.MyCanvas.ScrollTimerTask scrollTimerTask;
    private Timer scrollTimer;
    private int scrollPos;
    private boolean scrolling;
    private int timerCount;
    private int timerTreshold;
    private final int TIMER_DELAY;
    protected Image offscreen;
    private String oldScrollText;
    private boolean timerPaint;
    private int duration;
    private int playerPos;
    private int seconds;
    private int minutes;
    private String tempTime;
    private boolean neg;
    private int steps;
    private int buttonStatus;
    private final int BUTTON_STOP;
    private final int BUTTON_PLAY;
    private final int BUTTON_PAUSE;
    private int shuffleStatus;
    private final int SHUFFLE_OFF;
    private final int SHUFFLE_ON;
    private int repeatStatus;
    private final int REPEAT_OFF;
    private final int REPEAT_ON;
    private int muteStatus;
    private final int MUTE_OFF;
    private final int MUTE_ON;
    private final GUIGeneral this$0;

    public MyCanvas()
    {
      this.this$0 = paramGUIGeneral;
      this.TIMER_DELAY = 35;
      this.BUTTON_STOP = 1;
      this.BUTTON_PLAY = 2;
      this.BUTTON_PAUSE = 3;
      this.SHUFFLE_OFF = 0;
      this.SHUFFLE_ON = 1;
      this.REPEAT_OFF = 0;
      this.REPEAT_ON = 1;
      this.MUTE_OFF = 0;
      this.MUTE_ON = 1;
      this.text = new String[60];
      this.tempText = new String[1];
      if (!(isDoubleBuffered()))
        this.offscreen = Image.createImage(getWidth(), getHeight());
      this.backGroundColor = 16777215;
      this.foreGroundColor = 0;
      setFullScreenMode(true);
      this.scrollPos = 0;
      this.scrolling = false;
      this.timerCount = 0;
      this.timerTreshold = 35;
      this.scrollTimerTask = new GUIGeneral.MyCanvas.ScrollTimerTask(this);
      this.scrollTimer = new Timer();
      this.scrollTimer.schedule(this.scrollTimerTask, 300L, 150L);
      this.oldScrollText = "";
      this.timerPaint = false;
      this.duration = 0;
      this.playerPos = 0;
      this.buttonStatus = 0;
      this.shuffleStatus = 0;
      this.repeatStatus = 0;
      this.muteStatus = 0;
    }

    public void setText(, int paramInt)
    {
      int k = 0;
      String str = "";
      this.numOfString = paramInt;
      for (int j = 0; j < paramInt; ++j)
      {
        this.text[j] = paramArrayOfString[j];
        if (GUIGeneral.access$000(this.this$0, this.text[j]))
        {
          str = this.text[j];
          k = 1;
        }
        if (j > 57)
          break;
      }
      if (k == 0)
      {
        this.scrolling = false;
        this.timerCount = 0;
        this.timerTreshold = 35;
        this.scrollPos = 0;
      }
      else
      {
        if (!(str.equals(this.oldScrollText)))
        {
          this.timerTreshold = 35;
          this.timerCount = 0;
          this.scrollPos = 0;
        }
        this.scrolling = true;
      }
      this.oldScrollText = str;
    }

    public void setTimerBar(, int paramInt2)
    {
      this.duration = paramInt1;
      this.playerPos = paramInt2;
    }

    public void setButtonStatus()
    {
      this.buttonStatus = paramInt;
    }

    public void setShuffleButton()
    {
      this.shuffleStatus = paramInt;
    }

    public void setRepeatButton()
    {
      this.repeatStatus = paramInt;
    }

    public void setMuteStatus()
    {
      this.muteStatus = paramInt;
    }

    public void setColor(, int paramInt2, int paramInt3)
    {
      this.backGroundColor = paramInt1;
      this.foreGroundColor = paramInt2;
      this.borderColor = paramInt3;
      if (this.backGroundColor == this.borderColor)
        this.borderColor = this.foreGroundColor;
      if (this.backGroundColor == this.foreGroundColor)
      {
        this.backGroundColor = 16777215;
        this.foreGroundColor = 0;
        this.borderColor = 0;
      }
    }

    private void addOptions()
    {
      this.w = paramGraphics.getClipWidth();
      this.h = paramGraphics.getClipHeight();
      this.font = Font.getFont(0, 0, 8);
      paramGraphics.setFont(this.font);
      this.fontHeight = this.font.getHeight();
      this.fontWidth = this.font.stringWidth("Back");
      this.boxHight = (this.fontHeight + 4);
      paramGraphics.setColor(this.borderColor);
      paramGraphics.fillRect(0, this.h - this.boxHight, this.w, this.boxHight);
      paramGraphics.setColor(this.backGroundColor);
      paramGraphics.drawString("OK", 2, this.h - (this.boxHight - this.fontHeight) / 2, 36);
      paramGraphics.drawString("BACK", this.w - 2, this.h - (this.boxHight - this.fontHeight) / 2, 40);
    }

    private void addTimeBar()
    {
      this.w = paramGraphics.getClipWidth();
      this.h = paramGraphics.getClipHeight();
      this.font = Font.getFont(0, 0, 8);
      paramGraphics.setFont(this.font);
      this.fontHeight = this.font.getHeight();
      paramGraphics.setColor(this.foreGroundColor);
      paramGraphics.drawString(toTime(this.playerPos), 2, this.h - this.boxHight - (this.boxHight - this.fontHeight) / 2, 36);
      paramGraphics.drawString(toTime(this.playerPos - this.duration), this.w - 2, this.h - this.boxHight - (this.boxHight - this.fontHeight) / 2, 40);
      paramGraphics.setColor(this.borderColor);
      paramGraphics.fillRect(2, this.h - 2 * this.boxHight - this.fontHeight, this.w - 4, this.fontHeight);
      paramGraphics.setColor(this.backGroundColor);
      paramGraphics.fillRect(3, this.h - 2 * this.boxHight - this.fontHeight + 1, this.w - 6, this.fontHeight - 2);
      this.steps = ((this.w - 6) * 1000 / this.duration);
      paramGraphics.setColor(this.borderColor);
      paramGraphics.fillRect(3, this.h - 2 * this.boxHight - this.fontHeight + 1, this.steps * this.playerPos / 1000, this.fontHeight - 2);
    }

    private void addStatusButton()
    {
      this.font = Font.getFont(0, 0, 8);
      this.fontHeight = this.font.getHeight();
      this.w = paramGraphics.getClipWidth();
      this.fontHeight -= 4;
      if (this.fontHeight < 4)
        this.fontHeight = 4;
      paramGraphics.setColor(this.borderColor);
      switch (this.buttonStatus)
      {
      case 1:
        paramGraphics.fillRect(2, this.h - 3 * this.boxHight - this.fontHeight, this.fontHeight, this.fontHeight);
        break;
      case 2:
        paramGraphics.fillTriangle(2, this.h - 3 * this.boxHight - this.fontHeight, 2, this.h - 3 * this.boxHight, 2 + this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight / 2);
        if (this.muteStatus == 1)
        {
          paramGraphics.drawLine(2 + this.fontHeight + 2, this.h - 3 * this.boxHight - this.fontHeight, 2 + this.fontHeight + 2, this.h - 3 * this.boxHight);
          paramGraphics.drawLine(2 + this.fontHeight + 2 + 1, this.h - 3 * this.boxHight - this.fontHeight, 2 + this.fontHeight + 2 + 1, this.h - 3 * this.boxHight);
        }
        break;
      case 3:
        paramGraphics.fillRect(2, this.h - 3 * this.boxHight - this.fontHeight, this.fontHeight / 3, this.fontHeight);
        paramGraphics.fillRect(2 + this.fontHeight / 3 + 2, this.h - 3 * this.boxHight - this.fontHeight, this.fontHeight / 3, this.fontHeight);
      }
      if (this.shuffleStatus == 1)
      {
        paramGraphics.drawLine(this.w - 4 - 2 * this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight, this.w - 4 - this.fontHeight, this.h - 3 * this.boxHight);
        paramGraphics.drawLine(this.w - 4 - this.fontHeight, this.h - 3 * this.boxHight, this.w - 4, this.h - 3 * this.boxHight);
        paramGraphics.drawLine(this.w - 4 - 2, this.h - 3 * this.boxHight - 2, this.w - 4, this.h - 3 * this.boxHight);
        paramGraphics.drawLine(this.w - 4 - 2, this.h - 3 * this.boxHight + 2, this.w - 4, this.h - 3 * this.boxHight);
        paramGraphics.drawLine(this.w - 4 - 2 * this.fontHeight, this.h - 3 * this.boxHight, this.w - 4 - this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight);
        paramGraphics.drawLine(this.w - 4 - this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight, this.w - 4, this.h - 3 * this.boxHight - this.fontHeight);
        paramGraphics.drawLine(this.w - 4 - 2, this.h - 3 * this.boxHight - this.fontHeight - 2, this.w - 4, this.h - 3 * this.boxHight - this.fontHeight);
        paramGraphics.drawLine(this.w - 4 - 2, this.h - 3 * this.boxHight - this.fontHeight + 2, this.w - 4, this.h - 3 * this.boxHight - this.fontHeight);
      }
      if (this.repeatStatus == 1)
      {
        paramGraphics.drawLine(this.w - 8 - 4 * this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight, this.w - 8 - 2 * this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight);
        paramGraphics.drawLine(this.w - 8 - 2 * this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight, this.w - 8 - 2 * this.fontHeight, this.h - 3 * this.boxHight - 2);
        paramGraphics.drawLine(this.w - 8 - 2 * this.fontHeight - 2, this.h - 3 * this.boxHight - 2 - 2, this.w - 8 - 2 * this.fontHeight, this.h - 3 * this.boxHight - 2);
        paramGraphics.drawLine(this.w - 8 - 2 * this.fontHeight + 2, this.h - 3 * this.boxHight - 2 - 2, this.w - 8 - 2 * this.fontHeight, this.h - 3 * this.boxHight - 2);
        paramGraphics.drawLine(this.w - 8 - 4 * this.fontHeight, this.h - 3 * this.boxHight, this.w - 8 - 2 * this.fontHeight, this.h - 3 * this.boxHight);
        paramGraphics.drawLine(this.w - 8 - 4 * this.fontHeight, this.h - 3 * this.boxHight, this.w - 8 - 4 * this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight + 2);
        paramGraphics.drawLine(this.w - 8 - 4 * this.fontHeight - 2, this.h - 3 * this.boxHight - this.fontHeight + 2 + 2, this.w - 8 - 4 * this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight + 2);
        paramGraphics.drawLine(this.w - 8 - 4 * this.fontHeight + 2, this.h - 3 * this.boxHight - this.fontHeight + 2 + 2, this.w - 8 - 4 * this.fontHeight, this.h - 3 * this.boxHight - this.fontHeight + 2);
      }
    }

    private String toTime()
    {
      this.neg = false;
      if (paramInt < 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -