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

📄 d.java

📁 microtik tool to vie another router in a network
💻 JAVA
字号:
package com.hoya.games.sp;

import com.hoya.client.f;
import com.hoya.games.common.a;
import com.hoya.util.code.h;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.PrintStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Hashtable;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.JTextField;
import javax.swing.Timer;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;

public final class D extends JDialog
  implements ActionListener, KeyListener
{
  private Timer g;
  public static SimpleDateFormat a = new SimpleDateFormat("HH:mm:ss");
  private JPanel h;
  private BorderLayout i;
  private JPanel j;
  private JPanel k;
  private JButton l;
  private JButton m;
  private JPanel n;
  private GridLayout o;
  private EmptyBorder p;
  private TitledBorder q;
  private JPanel r;
  private GridLayout s;
  private JLabel t;
  private JLabel u;
  private JLabel v;
  private JLabel w;
  private JLabel z;
  private JLabel A;
  private JTextField B;
  private JTextField C;
  private JTextField D;
  private JComboBox E;
  private JTextField F;
  private JTextField G;
  private GridBagLayout H;
  private JLabel I;
  String b;
  String c;
  String d;
  String e;
  private JLabel J;
  f f;

  public D(Frame paramFrame)
  {
    super(paramFrame, "Registration Form", true);
    this.g = new Timer(100, this);
    this.h = new JPanel();
    this.i = new BorderLayout();
    this.j = new JPanel();
    this.k = new JPanel();
    this.l = new JButton();
    this.m = new JButton();
    this.n = new JPanel();
    this.o = new GridLayout();
    this.p = new EmptyBorder(10, 10, 2, 10);
    this.q = new TitledBorder(new LineBorder(Color.white, 2), "  Registration Form  ");
    this.r = new JPanel();
    this.s = new GridLayout();
    this.t = new JLabel();
    this.u = new JLabel();
    this.v = new JLabel();
    this.w = new JLabel();
    this.z = new JLabel();
    this.A = new JLabel();
    this.B = new JTextField();
    this.C = new JTextField();
    this.D = new JTextField();
    this.E = new JComboBox(new String[] { "BCA" });
    this.F = new JTextField();
    this.G = new JTextField();
    this.H = new GridBagLayout();
    this.I = new JLabel();
    this.b = " All fields are required. ";
    this.c = "Nickname minimal 3 character, maximal 8 character, \n and must use numerals and letters.";
    this.d = "Found new version, game will close and start auto update program.";
    this.e = "_";
    this.J = new JLabel();
    try
    {
      d();
    }
    catch (Exception localException2)
    {
      Exception localException1;
      (localException1 = localException2).printStackTrace();
    }
    this.f = new f(lx.bp, lx.br, this.e, "_", "R");
    this.g.start();
  }

  public D()
  {
    this(null);
  }

  public final void actionPerformed(ActionEvent paramActionEvent)
  {
    if (paramActionEvent.getSource() == this.m)
    {
      if (!(c()))
        return;
      b();
      return;
    }
    if (paramActionEvent.getSource() == this.l)
    {
      dispose();
      return;
    }
    while ((this.f != null) && (this.f.b() != 0))
    {
      a locala = this.f.c();
      a(locala);
    }
    if ((lx.Q) && (this.f != null))
      this.f.a();
  }

  public final void a()
  {
    this.g.stop();
    if (this.f != null)
      this.f.a();
  }

  private void a(a parama)
  {
    a("=============== " + a.format(new Date()) + " ===============");
    a("in processEvent(" + parama.c() + ")(" + parama.e() + "),msg:" + parama.b());
    a("(###11111###receiveTime-sendtime):" + (System.currentTimeMillis() - lx.b));
    String str = parama.b();
    new StringBuffer().append(parama.e()).append("==>").append(str);
    if (parama.c() == 1005)
      return;
    if (parama.c() == 2307)
    {
      this.m.setEnabled(true);
      JOptionPane.showMessageDialog(this, "Account is created, \npassword will send to that cellphone.");
      dispose();
      return;
    }
    if (parama.c() == 2309)
    {
      this.m.setEnabled(true);
      JOptionPane.showMessageDialog(this, "Nickname had been taken, please change other nickname.");
      if (lx.aS != 2)
        return;
      show();
      return;
    }
    if ((lx.aS == 2) && (parama.c() == 2310))
    {
      this.m.setEnabled(true);
      JOptionPane.showMessageDialog(this, "Sorry, one bank account just for one member.");
      if (lx.aS != 2)
        return;
      show();
      return;
    }
    if (parama.c() == 2321)
    {
      a();
      JOptionPane.showMessageDialog(this, this.d);
      lx.bt = str;
      lx.a();
    }
  }

  private void b()
  {
    a("sgccSponsor is null?" + (this.f == null));
    a("sgccSponsor isConnected?" + this.f.d());
    a("sgccSponsor isLogined?" + this.f.e());
    if ((this.f != null) && (this.f.d()))
    {
      String str = this.B.getText().trim();
      str = str + "+@|" + this.C.getText().trim();
      str = str + "+@|" + this.E.getItemAt(this.E.getSelectedIndex());
      str = str + "+@|" + this.F.getText().trim();
      str = str + "+@|" + this.G.getText().trim();
      str = str + "+@|" + this.D.getText().trim();
      a("register data to send==>" + str);
      str = h.a(str, null);
      a("register data encoded==>" + str);
      this.f.a(2305, str);
      this.m.setEnabled(false);
      hide();
      show();
      hide();
    }
  }

  private boolean c()
  {
    this.B.setText(this.B.getText().trim());
    this.C.setText(this.C.getText().trim());
    this.F.setText(this.F.getText().trim());
    this.G.setText(this.G.getText().trim());
    this.D.setText(this.D.getText().trim());
    if (a(this.B))
    {
      JOptionPane.showMessageDialog(this, this.b);
      return false;
    }
    if (this.C.getText().trim().length() < 3)
    {
      this.C.setText(this.C.getText().trim());
      JOptionPane.showMessageDialog(this, this.c);
      return false;
    }
    char[] arrayOfChar = this.C.getText().trim().toCharArray();
    int i1 = 1;
    Hashtable localHashtable = new Hashtable();
    for (int i2 = 0; i2 < arrayOfChar.length; ++i2)
    {
      localHashtable.put(new Character(arrayOfChar[i2]), "");
      int i3 = 0;
      if ((arrayOfChar[i2] >= '0') && (arrayOfChar[i2] <= '9'))
        i3 = 1;
      if ((arrayOfChar[i2] >= 'a') && (arrayOfChar[i2] <= 'z'))
        i3 = 1;
      if (i3 == 0)
      {
        i1 = 0;
        break;
      }
    }
    if (i1 == 0)
    {
      JOptionPane.showMessageDialog(this, this.c);
      return false;
    }
    if (a(this.F))
    {
      JOptionPane.showMessageDialog(this, this.b);
      return false;
    }
    if (a(this.G))
    {
      JOptionPane.showMessageDialog(this, this.b);
      return false;
    }
    if (a(this.D))
    {
      JOptionPane.showMessageDialog(this, this.b);
      return false;
    }
    return true;
  }

  private static boolean a(JTextField paramJTextField)
  {
    if (paramJTextField.getText().trim().length() == 0)
    {
      paramJTextField.setText(paramJTextField.getText().trim());
      return true;
    }
    return false;
  }

  private void d()
    throws Exception
  {
    this.J.setForeground(Color.red);
    this.J.setText("Password will be sent to the registered cellphone.");
    getContentPane().add(this.h, "Center");
    this.h.setLayout(this.i);
    setResizable(false);
    this.B.addKeyListener(this);
    this.C.addKeyListener(this);
    this.D.addKeyListener(this);
    this.F.addKeyListener(this);
    this.G.addKeyListener(this);
    this.B.setBackground(Color.black);
    this.B.setForeground(Color.white);
    this.B.setCaretColor(Color.white);
    this.C.setBackground(Color.black);
    this.C.setForeground(Color.white);
    this.C.setCaretColor(Color.white);
    this.F.setBackground(Color.black);
    this.F.setForeground(Color.white);
    this.F.setCaretColor(Color.white);
    this.G.setBackground(Color.black);
    this.G.setForeground(Color.white);
    this.G.setCaretColor(Color.white);
    this.D.setBackground(Color.black);
    this.D.setForeground(Color.white);
    this.D.setCaretColor(Color.white);
    this.E.setBackground(Color.black);
    this.E.setForeground(Color.white);
    this.m.addActionListener(this);
    this.m.setMnemonic('O');
    this.m.setPreferredSize(new Dimension(80, 20));
    this.m.setText("OK");
    getRootPane().setDefaultButton(this.m);
    this.l.setText("Cancel");
    this.l.addActionListener(this);
    this.l.setMnemonic('C');
    this.l.setPreferredSize(new Dimension(80, 20));
    this.t.setHorizontalAlignment(4);
    this.r.setBackground(Color.black);
    this.n.setBackground(Color.black);
    this.k.setBackground(Color.black);
    this.t.setForeground(Color.gray);
    this.u.setForeground(Color.gray);
    this.v.setForeground(Color.gray);
    this.w.setForeground(Color.gray);
    this.z.setForeground(Color.gray);
    this.A.setForeground(Color.gray);
    this.j.setLayout(this.o);
    this.n.setBorder(this.p);
    this.n.setLayout(this.s);
    this.q.setTitleColor(Color.gray);
    this.r.setBorder(this.q);
    this.r.setLayout(this.H);
    this.t.setText("Full Name : ");
    this.u.setText("Nickname : ");
    this.v.setText("  Cellular Phone : ");
    this.w.setText("Bank : ");
    this.z.setText("Bank Acc Name : ");
    this.A.setText("Bank Acc Number : ");
    this.I.setPreferredSize(new Dimension(10, 22));
    this.t.setPreferredSize(new Dimension(75, 22));
    this.B.setPreferredSize(new Dimension(180, 22));
    this.C.setPreferredSize(new Dimension(180, 22));
    this.D.setPreferredSize(new Dimension(180, 22));
    this.F.setPreferredSize(new Dimension(100, 22));
    this.G.setPreferredSize(new Dimension(100, 22));
    this.h.add(this.j, "Center");
    this.j.add(this.n);
    this.n.add(this.r);
    this.h.add(this.k, "South");
    this.k.add(this.m);
    this.k.add(this.l);
    this.r.add(this.t, new GridBagConstraints(0, 0, 1, 1, 1D, 0D, 13, 2, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.B, new GridBagConstraints(1, 0, 1, 1, 0D, 0D, 17, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.I, new GridBagConstraints(2, 0, 1, 1, 1D, 0D, 10, 2, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.u, new GridBagConstraints(0, 1, 1, 1, 0D, 0D, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.C, new GridBagConstraints(1, 1, 1, 1, 0D, 0D, 17, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.v, new GridBagConstraints(0, 6, 1, 1, 0D, 0D, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.D, new GridBagConstraints(1, 6, 1, 1, 0D, 0D, 17, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.w, new GridBagConstraints(0, 3, 1, 1, 0D, 0D, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.E, new GridBagConstraints(1, 3, 1, 1, 0D, 0D, 17, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.z, new GridBagConstraints(0, 4, 1, 1, 0D, 0D, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.F, new GridBagConstraints(1, 4, 1, 1, 0D, 0D, 17, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.A, new GridBagConstraints(0, 5, 1, 1, 0D, 0D, 13, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.G, new GridBagConstraints(1, 5, 1, 1, 0D, 0D, 17, 0, new Insets(0, 0, 0, 0), 0, 0));
    this.r.add(this.J, new GridBagConstraints(0, 7, 3, 1, 0D, 0D, 10, 0, new Insets(5, 0, 3, 0), 0, 0));
  }

  public final void keyTyped(KeyEvent paramKeyEvent)
  {
  }

  public final void keyPressed(KeyEvent paramKeyEvent)
  {
  }

  public final void keyReleased(KeyEvent paramKeyEvent)
  {
    if (paramKeyEvent.getSource() == this.C)
    {
      a(this.C, 8);
      this.C.setText(this.C.getText().toLowerCase());
      return;
    }
    if (paramKeyEvent.getSource() == this.D)
      a(this.D, 20);
  }

  private static void a(JTextField paramJTextField, int paramInt)
  {
    if (paramJTextField.getText().trim().length() > paramInt)
      paramJTextField.setText(paramJTextField.getText().trim().substring(0, paramInt));
  }

  private static void a(String paramString)
  {
    if (lx.aJ)
      System.out.println(paramString);
  }
}

⌨️ 快捷键说明

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