Package mdes.slick.sui

Examples of mdes.slick.sui.Container


    this.setFont(GameClient.getFontSmall());
    this.setBackground(new Color(0, 0, 0, 85));
    this.setForeground(new Color(255, 255, 255));
    for (int i = 0; i < 6; i++) {
      final int j = i;
      m_container[i] = new Container();
      m_container[i].setSize(170, 42);
      m_container[i].setVisible(true);
      m_container[i].setLocation(2, y+10);
      m_container[i].setBackground(new Color(0, 0, 0, 0));
      System.out.println("Y: "+y);
View Full Code Here


    }
    m_bg.setSize(256, 203);
    m_bg.setLocation(0, 142);
    getContentPane().add(m_bg);

    attackPane = new Container();
    attackPane.setBackground(new Color(0, 0, 0, 0));

    move1 = BattleButtonFactory.getButton("");
    move2 = BattleButtonFactory.getButton("");
    move3 = BattleButtonFactory.getButton("");
    move4 = BattleButtonFactory.getButton("");

    setResizable(false);

    this.getTitleBar().setVisible(false);

    // 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();
View Full Code Here

     * @param container
     */
  public MessageDialog(String message, Container container){
    getContentPane().setX(getContentPane().getX() - 1);
    getContentPane().setY(getContentPane().getY() + 1);
    Container label = new Container();
    String[] lines = message.split("\n");
   
    int maxWidth = 0;
    int maxHeight = 0;
   
    for (String s : lines) {
      Label line = new Label(s);
      line.pack();
     
      int lineWidth = (int)line.getWidth();
      int lineHeight = (int)line.getHeight();
     
      if (lineWidth > maxWidth)
        maxWidth = lineWidth;
     
      line.setY(maxHeight);
      maxHeight += lineHeight;
     
      label.add(line);
    }
    label.setSize(maxWidth, maxHeight);
   
    Button ok = new Button();
    ok.setText("OK");
    getContentPane().add(label);
    getContentPane().add(ok);
    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);
View Full Code Here

    }
    m_bg.setSize(256, 203);
    m_bg.setLocation(0, 142);
    getContentPane().add(m_bg);

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

    move1 = BattleButtonFactory.getButton("");
    move2 = BattleButtonFactory.getButton("");
View Full Code Here

  public ConfirmationDialog(String text){
    super("Awaiting confirmation");
    getContentPane().setX(getContentPane().getX() - 1);
    getContentPane().setY(getContentPane().getY() + 1);
    Container m_label = new Container();
    String[] m_lines = text.split("\n");
   
    int maxWidth = 0;
    int maxHeight = 0;
   
    for (String s : m_lines) {
      Label line = new Label(s);
      line.pack();
     
      int lineWidth = (int)line.getWidth();
      int lineHeight = (int)line.getHeight();
     
      if (lineWidth > maxWidth)
        maxWidth = lineWidth;
     
      line.setY(maxHeight);
      maxHeight += lineHeight;
     
      m_label.add(line);
    }
    m_label.setSize(maxWidth, maxHeight);
   
    m_yesBtn = new Button();
    m_noBtn = new Button();
   
    m_yesBtn.setText("Yes");
    m_yesBtn.setSize(50, 25);
    m_yesBtn.setY(m_label.getY() + m_label.getHeight() + 20);
   
    m_noBtn.setText("No");
    m_noBtn.setSize(50, 25);
    m_noBtn.setY(m_yesBtn.getY());
   
    getContentPane().add(m_label);
    getContentPane().add(m_yesBtn);
    getContentPane().add(m_noBtn);
   
    m_label.setLocation(5, 15);
   
    this.setResizable(false);
    this.setSize(m_label.getWidth() + 10, m_label.getHeight() + 80);
    m_yesBtn.setX((getWidth() / 2) - (105 / 2));
    m_noBtn.setX(m_yesBtn.getX() + 55);
   
    setCenter();
    this.setVisible(true);
View Full Code Here

   * Initializes the interface
   */
  public void initGUI() {
    int y = 0;
    for (int i = 0; i < 6; i++) {
      m_pokes[i] = new Container();
      m_pokes[i].setSize(170, 42);
      m_pokes[i].setVisible(true);
      m_pokes[i].setLocation(0, y);

      y += 41;
View Full Code Here

      String f;
      while ((f = reader.readLine()) != null) {
        if (f.charAt(0) != '*'){
          final String[] details = f.split(",");
          m_locations.add(details[0]);
          Container m_surface = new Container();
          m_surface.setWidth(Integer.parseInt(details[1]));
          m_surface.setHeight(Integer.parseInt(details[2]));
          m_surface.setX(Integer.parseInt(details[3]) * 8);
          m_surface.setY(Integer.parseInt(details[4]) * 8);
          m_surface.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseReleased(MouseEvent e) {
              super.mouseReleased(e);
            }
View Full Code Here

              m_offerBtn.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent e) {
                  acceptOffer(j);
                }
              });
              m_containers.add(new Container());
              m_containers.get(i).setSize(getWidth(), 25);
              m_containers.get(i).setLocation(0, y);
              m_containers.get(i).add(m_label);
              m_containers.get(i).add(m_offerBtn);
              m_containers.get(i).add(m_cancel);
View Full Code Here

        btn_keys = new MouseOverArea(gameContainer, new Image("res/img/menu/settings/buttons/settings_button_controls_1.png"), 500, 655, 400, 50, this);
        btn_keys.setMouseOverImage(new Image("res/img/menu/settings/buttons/settings_button_controls_2.png"));       
        btn_back = new MouseOverArea(gameContainer, new Image("res/img/menu/main/buttons/mainmenu_button_back_1.png"), 720, 790, 400, 50, this);
        btn_back.setMouseOverImage(new Image("res/img/menu/main/buttons/mainmenu_button_back_2.png"));
       
        Container slider = new Container();
        slider.setSize(250, 10);
        slider.setLocation(575, 575);
       
        volume_slider = new Slider(Slider.HORIZONTAL);
        volume_slider.setLocation(0, 0);
        volume_slider.setHeight(10);
        volume_slider.setWidth(250);
        volume_slider.setOpaque(true);
        volume_slider.setBackground(new Color(0x00762900));
        volume_slider.setForeground(new Color(0x00461800));
        volume_slider.setValue(0.5f);
       
        slider.add(volume_slider);
      
        display.add(slider);
  }
View Full Code Here

TOP

Related Classes of mdes.slick.sui.Container

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.