Package mdes.slick.sui.event

Examples of mdes.slick.sui.event.ActionListener


        m_hp[i].setSize(72, 5);
        m_hp[i].setLocation(m_hpBar[i].getX() + 23, m_hpBar[i].getY() + 3);
        if (i != 0) {
          m_switchUp[i] = new SimpleArrowButton(
              SimpleArrowButton.FACE_UP);
          m_switchUp[i].addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              GameClient.getInstance().getPacketGenerator().writeTcpMessage("s" + String.valueOf(j)
                  + ","+String.valueOf(j - 1));
              //reinitialize the gui
              getContentPane().removeAll();
              allocateVariables();
              loadImages(m_pokes);
              initGUI();
            }
          });
          m_switchUp[i].setHeight(16);
          m_switchUp[i].setWidth(16);
          m_container[i].add(m_switchUp[i]);
        }
        if (i != 5) {
          m_switchDown[i] = new SimpleArrowButton(
              SimpleArrowButton.FACE_DOWN);
          m_switchDown[i].addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              GameClient.getInstance().getPacketGenerator().writeTcpMessage("s" + String.valueOf(j)
                  + ","+String.valueOf(j + 1));
              //reinitialize the gui
              getContentPane().removeAll();
View Full Code Here


     */
  public ChatWidget(){
    m_up = new SimpleArrowButton(SimpleArrowButton.FACE_UP);
    m_down = new SimpleArrowButton(SimpleArrowButton.FACE_DOWN);

    m_up.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
        scroll(-1);
      }
    });

    m_down.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
        scroll(1);
      }
    });
  }
View Full Code Here

      m_save = new Button(translated.get(18));
      m_save.setSize(50, 25);
      m_save.setLocation(88, 108);
      getContentPane().add(m_save);

      m_save.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          try {
            List<String> translated = Translator.translate("_GUI");
            /*
             * options.remove("learnColor");
 
View Full Code Here

    Button cancel = new Button("Cancel");
    cancel.pack();
    cancel.setLocation(130, 280);
    getContentPane().add(cancel);

    cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        GameClient.getInstance().getDisplay().remove(thisDialog);
      }
    });

    use.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        GameClient.getInstance().getDisplay().remove(thisDialog);

        final ConfirmationDialog confirm = new ConfirmationDialog("Are you sure you want to change sprites?\nIt'll cost you P500!");
        confirm.addYesListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            confirm.setVisible(false);
            GameClient.getInstance().getDisplay().remove(confirm);

            GameClient.getInstance().getPacketGenerator().writeTcpMessage(
                "S" + m_spriteList.getSelectedName());
          }
        });
        confirm.addNoListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            confirm.setVisible(false);
            GameClient.getInstance().getDisplay().remove(confirm);
          }
        });
View Full Code Here

    // start attackPane
    attackPane.add(move1);
    move1.setLocation(7, 10);
    move1.setSize(116, 51);
    move1.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        useMove(0);
      }
    });
    pp1 = new Label();
    pp1.setHorizontalAlignment(Label.RIGHT_ALIGNMENT);
    pp1.setBounds(0, move1.getHeight() - 20, move1.getWidth() - 5, 20);
    move1.add(pp1);

    attackPane.add(move2);
    move2.setLocation(130, 10);
    move2.setSize(116, 51);
    move2.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        useMove(1);
      }
    });
    pp2 = new Label();
    pp2.setHorizontalAlignment(Label.RIGHT_ALIGNMENT);
    pp2.setBounds(0, move2.getHeight() - 20, move2.getWidth() - 5, 20);
    move2.add(pp2);

    attackPane.add(move3);
    move3.setLocation(7, 65);
    move3.setSize(116, 51);
    move3.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        useMove(2);
      }
    });
    pp3 = new Label();
    pp3.setHorizontalAlignment(Label.RIGHT_ALIGNMENT);
    pp3.setBounds(0, move3.getHeight() - 20, move3.getWidth() - 5, 20);
    move3.add(pp3);

    attackPane.add(move4);
    move4.setLocation(130, 65);
    move4.setSize(116, 51);
    move4.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        useMove(3);
      }
    });
    pp4 = new Label();
    pp4.setHorizontalAlignment(Label.RIGHT_ALIGNMENT);
    pp4.setBounds(0, move4.getHeight() - 20, move4.getWidth() - 5, 20);
    move4.add(pp4);

    pp1.setFont(GameClient.getFontSmall());
    pp2.setFont(GameClient.getFontSmall());
    pp3.setFont(GameClient.getFontSmall());
    pp4.setFont(GameClient.getFontSmall());
   
    pp1.setForeground(Color.white);
    pp2.setForeground(Color.white);
    pp3.setForeground(Color.white);
    pp4.setForeground(Color.white);
   
    m_moveButtons.add(move1);
    m_moveButtons.add(move2);
    m_moveButtons.add(move3);
    m_moveButtons.add(move4);

    m_ppLabels.add(pp1);
    m_ppLabels.add(pp2);
    m_ppLabels.add(pp3);
    m_ppLabels.add(pp4);

    btnRun = BattleButtonFactory.getSmallButton("Run");
    btnRun.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        run();
      }
    });
    attackPane.add(btnRun);

    btnRun.setBounds(97, 148, 60, 47);

    btnBag = BattleButtonFactory.getSmallButton("Bag");
    attackPane.add(btnBag);
    btnBag.setLocation(3, 122);
    btnBag.setSize(82, 48);

    btnBag.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        showBag();
      }
    });

    btnPoke = BattleButtonFactory.getSmallButton("Pokemon");
    attackPane.add(btnPoke);
    btnPoke.setLocation(168, 122);
    btnPoke.setSize(82, 48);

    btnPoke.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        showPokePane(false);
      }
    });

    cancel = BattleButtonFactory.getSmallButton("Cancel");
    attackPane.add(cancel);
    cancel.setVisible(false);
    cancel.setLocation(162, 110);
    cancel.setSize(82, 48);

    cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {

      }
    });

    attackPane.setBounds(2, 140, 257, 201);
    getContentPane().add(attackPane);
    // end attackPane

    // start pokesContainer
    pokesContainer = new Container();
    pokesContainer.setBackground(new Color(0, 0, 0, 0));
    pokesContainer.setBounds(2, 140, 257, 201);

    pokeBtn1 = BattleButtonFactory.getButton(" ");
    pokesContainer.add(pokeBtn1);
    pokeBtn1.setBounds(8, 8, 116, 51);

    pokeBtn1.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        switchPoke(0);
      }
    });

    pokeBtn2 = BattleButtonFactory.getButton(" ");
    pokesContainer.add(pokeBtn2);
    pokeBtn2.setBounds(128, 8, 116, 51);

    pokeBtn2.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        switchPoke(1);
      }
    });

    pokeBtn3 = BattleButtonFactory.getButton(" ");
    pokesContainer.add(pokeBtn3);
    pokeBtn3.setBounds(8, 59, 116, 51);

    pokeBtn3.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        switchPoke(2);
      }
    });

    pokeBtn4 = BattleButtonFactory.getButton(" ");
    pokesContainer.add(pokeBtn4);
    pokeBtn4.setBounds(128, 59, 116, 51);

    pokeBtn4.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        switchPoke(3);
      }
    });

    pokeBtn5 = BattleButtonFactory.getButton(" ");
    pokesContainer.add(pokeBtn5);
    pokeBtn5.setBounds(8, 110, 116, 51);

    pokeBtn5.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        switchPoke(4);
      }
    });

    pokeBtn6 = BattleButtonFactory.getButton(" ");
    pokesContainer.add(pokeBtn6);
    pokeBtn6.setBounds(128, 110, 116, 51);

    pokeBtn6.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        switchPoke(5);
      }
    });

    m_pokeButtons.add(pokeBtn1);
    m_pokeButtons.add(pokeBtn2);
    m_pokeButtons.add(pokeBtn3);
    m_pokeButtons.add(pokeBtn4);
    m_pokeButtons.add(pokeBtn5);
    m_pokeButtons.add(pokeBtn6);

    for (int i = 0; i < 6; i++){
      Label status = new Label();
      status.setSize(30, 12);
      status.setGlassPane(true);
      m_pokeButtons.get(i).add(status);
      status.setLocation(6, 5);
     
      Label info = new Label();
      m_pokeButtons.get(i).add(info);
      info.setText("                               ");
      info.setLocation(3, 34);
      info.setSize(107, 14);
      info.setForeground(Color.white);
      info.setGlassPane(true);
      info.setFont(GameClient.getFontSmall());
      m_pokeInfo.add(info);
    }

    pokeCancelBtn = BattleButtonFactory.getSmallButton("Cancel");
    pokesContainer.add(pokeCancelBtn);
    pokeCancelBtn.setLocation(162, 161);
    pokeCancelBtn.setSize(82, 48);
   
    pokeCancelBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        showAttack();
      }
    });
    pokesContainer.setVisible(false);
    getContentPane().add(pokesContainer);
    // End pokesContainer

    endPane = new Container();
    endPane.setBackground(new Color(0, 0, 0, 0));
    getContentPane().add(endPane);
    endPane.setBounds(0, 154, 253, 192);

    close = new Button();
    close.setVisible(true);
    endPane.add(close);
    close.setText("Close");
    close.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        setVisible(false);
      }
    });
View Full Code Here

     
      m_openAbout = new Button(translated.get(3));
      m_openAbout.setSize(64, 32);
      m_openAbout.setLocation(800 - 64 - 8, 8);
      m_openAbout.setVisible(false);
      m_openAbout.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          showAbout();
        }
      });
      this.add(m_openAbout);
     
      m_openToS = new Button(translated.get(4));
      m_openToS.setSize(64, 32);
      m_openToS.setLocation(800 - 64 - 8, 40);
      m_openToS.setVisible(false);
      m_openToS.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
          showToS();
        }
      });
      this.add(m_openToS);
View Full Code Here

    label.setLocation(5, 15);
    this.setResizable(false);
    this.setSize(label.getWidth() + 10, label.getHeight() + 90);
    ok.setSize(50, 25);
    ok.setLocation(this.getWidth()/2-25, this.getHeight()- 60);
    ok.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        setVisible(false);
      }
    });
    this.setLocation((container.getDisplay().getWidth()/2)-(this.getWidth()/2),
View Full Code Here

   * Lays out the scroll buttons
   */
  public void layoutScrollButtons(){
    int buttonWidth = 16;
    m_up = new SimpleArrowButton(SimpleArrowButton.FACE_UP);
    m_up.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
        scroll(-1);
      }
    });
    m_up.setEnabled(false);
    m_up.setSize(buttonWidth, buttonWidth);
    m_up.setLocation(getWidth() - buttonWidth, 0);
   
    m_down = new SimpleArrowButton(SimpleArrowButton.FACE_DOWN);
    m_down.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
        scroll(1);
      }
    });
    m_down.setSize(buttonWidth, buttonWidth);
View Full Code Here

    // start attackPane
    m_movePane.add(move1);
    move1.setLocation(7, 10);
    move1.setSize(116, 51);
    move1.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        replaceMove(0);
      }
    });
    pp1 = new Label();
    pp1.setHorizontalAlignment(Label.RIGHT_ALIGNMENT);
    pp1.setBounds(7, 40, 110, 20);
    m_movePane.add(pp1);

    m_movePane.add(move2);
    move2.setLocation(130, 10);
    move2.setSize(116, 51);
    move2.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        replaceMove(1);
      }
    });
    pp2 = new Label();
    pp2.setHorizontalAlignment(Label.RIGHT_ALIGNMENT);
    pp2.setBounds(130, 40, 110, 20);
    m_movePane.add(pp2);

    m_movePane.add(move3);
    move3.setLocation(7, 65);
    move3.setSize(116, 51);
    move3.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        replaceMove(2);
      }
    });
    pp3 = new Label();
    pp3.setHorizontalAlignment(Label.RIGHT_ALIGNMENT);
    pp3.setBounds(7, 95, 110, 20);
    m_movePane.add(pp3);

    m_movePane.add(move4);
    move4.setLocation(130, 65);
    move4.setSize(116, 51);
    move4.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        replaceMove(3);
      }
    });
    pp4 = new Label();
    pp4.setHorizontalAlignment(Label.RIGHT_ALIGNMENT);
    pp4.setBounds(130, 95, 110, 20);
    m_movePane.add(pp4);

    m_moveButtons.add(move1);
    m_moveButtons.add(move2);
    m_moveButtons.add(move3);
    m_moveButtons.add(move4);

    m_pp.add(pp1);
    m_pp.add(pp2);
    m_pp.add(pp3);
    m_pp.add(pp4);

    m_cancel = new Button("Cancel");
    m_cancel.setBounds(3, 122, 246, 77);
    m_cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        MoveLearningManager.getInstance().removeMoveLearning();
        GameClient.getInstance().getPacketGenerator().writeTcpMessage(
            "PM" + m_pokeIndex + m_move);
      }
View Full Code Here

        m_replace = new ConfirmationDialog(
            "Are you sure you want to forget "
            + m_moveButtons.get(i).getText() + " to learn "
            + m_move + "?");
        m_replace.setAlwaysOnTop(true);
        ActionListener yes = new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            GameClient.getInstance().getOurPlayer().getPokemon()[m_pokeIndex].setMoves(j, m_move);
            BattleManager.getInstance().updateMoves();
            GameClient.getInstance().getPacketGenerator().writeTcpMessage(
                "Pm" + m_pokeIndex + j + m_move);
            GameClient.getInstance().getDisplay().remove(m_replace);
            m_replace = null;
            MoveLearningManager.getInstance().removeMoveLearning();
          }
        };
        ActionListener no = new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            GameClient.getInstance().getDisplay().remove(m_replace);
            m_replace = null;
            setAlwaysOnTop(true);
          }
View Full Code Here

TOP

Related Classes of mdes.slick.sui.event.ActionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.