Package mdes.slick.sui

Examples of mdes.slick.sui.Label


    this.getTitleBar().getCloseButton().setVisible(false);
   
    /*
     * Create the info label
     */
    m_info = new Label(translate.get(1));
    m_info.pack();
    m_info.setLocation(24, 8);
    m_info.setForeground(new Color(255, 255, 255));
    this.add(m_info);
   
View Full Code Here


      m_container[i].setOpaque(true);
      String respath = System.getProperty("res.path");
      if(respath==null)
        respath="";
      try {
        Label tempLabel = new Label();
        if (i ==0) {
          f = FileLoader.loadFile(respath+"res/ui/party_info/partyActive.png");
          tempLabel = new Label(new Image(f, respath+"res/ui/party_info/partyActive.png", false));
        } else {
          f = FileLoader.loadFile(respath+"res/ui/party_info/partyInactive.png");
          tempLabel = new Label(new Image(f, respath+"res/ui/party_info/partyInactive.png", false));
        }
        tempLabel.setSize(170, 42);
        tempLabel.setY(-4);
        m_container[i].add(tempLabel);
      } catch (Exception e) {e.printStackTrace();}
     
      try{
        f = FileLoader.loadFile(respath+"res/ui/party_info/HPBar.png");
        m_hpBar[i] = new Label(new Image(f, respath+"res/ui/party_info/HPBar.png", false));
        m_hpBar[i].setSize(98, 11);
        m_hpBar[i].setVisible(false);
        m_container[i].add(m_hpBar[i]);
      } catch (Exception e) {e.printStackTrace();}
     
View Full Code Here

   */
  public void loadImages(OurPokemon[] pokes) {
    LoadingList.setDeferredLoading(true);
    InputStream f;
    for (int i = 0; i < 6; i++) {
      m_pokeIcon[i] = new Label();
      m_pokeBall[i] = new Label();
      m_pokeName[i] = new Label();

      m_level[i] = new Label();
      m_hp[i] = new ProgressBar(0, 0);
      m_hp[i].setForeground(Color.green);

      m_pokeIcon[i].setSize(32, 32);

View Full Code Here

    }

    // Add new lines
    int y = 0;
      for (int i = 0; i < m_maxLines; i++){
        m_shownChat.add(new Label());
        m_shownChat.get(i).setFont(GameClient.getFontSmall());
        m_shownChat.get(i).setForeground(m_foreColor);
        m_shownChat.get(i).setLocation(0, y);
        try {
          // Make system messages red
View Full Code Here

      while(s.hasNextLine()) {
        m_sprites.remove(s.nextLine());
      }
      s.close();
     
      m_spriteDisplay = new Label();
      m_spriteDisplay.setSize(124, 204);
      m_spriteDisplay.setLocation(105, 20);
      getContentPane().add(m_spriteDisplay);

      m_spriteList = new ListBox(m_sprites, false) {
View Full Code Here

    String respath = System.getProperty("res.path");
    if(respath==null)
      respath="";
    try {
      f = FileLoader.loadFile(respath+"res/ui/bg.png");
      m_bg = new Label(new Image(f, respath+"res/ui/bg.png", false));
    } catch (SlickException e) {
      e.printStackTrace();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    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);
View Full Code Here

        f = new FileInputStream(respath+"res/pokenet_summer.png");
      } else {
        /* Show normal login screen */
        f = new FileInputStream(respath+"res/pokenet_normal.png");
      }
      m_bg = new Label(new Image(f, "bg", false));
      m_bg.pack();
      m_bg.setLocation(0, 0);
      m_bg.setVisible(true);
      this.add(m_bg);
     
      /*
       * Create the server selector container
       */
      m_select = new ServerDialog();
      this.add(m_select);
      /*
       * Create the language selector container
       */
      m_lang = new LanguageDialog();
      this.add(m_lang);
     
     
      /*
       * Create the login container
       */
      m_login = new LoginDialog();
      this.add(m_login);
     
      m_register = new RegisterDialog();
      this.add(m_register);
     
      m_about = new AboutDialog();
      this.add(m_about);
     
      m_terms = new ToSDialog();
      this.add(m_terms);
     
      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);
     
      setClientRevision();
     
      m_serverRev = new Label("Server Version: ?");
      m_serverRev.setFont(GameClient.getFontSmall());
      m_serverRev.setForeground(new Color(255, 255, 255));
      m_serverRev.pack();
      m_serverRev.setLocation(m_clientRev.getX() + m_clientRev.getWidth() + 16,
          m_clientRev.getY());
View Full Code Here

        Scanner s = new Scanner(f);
        s.nextLine();
        s.nextLine();
        s.nextLine();

        m_clientRev = new Label("Client Version: svn:" + s.nextLine());
        f = new File(path + "rev.txt");
        s = new Scanner(f);
        m_clientRev.setText(m_clientRev.getText() + " // rev:" + s.nextLine());
       
      } else {
        f = new File(path + "rev.txt");
        Scanner s;
        s = new Scanner(f);

        m_clientRev = new Label("Client Version: r" + s.nextLine());
      }
    } catch (Exception e) {
      System.out.println(e.getMessage());
      m_clientRev = new Label("Client Version: ?");
    }
   
    m_clientRev.setFont(GameClient.getFontSmall());
    m_clientRev.setForeground(new Color(255, 255, 255));
    m_clientRev.pack();
View Full Code Here

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

          remove(m_shownLabels[i]);
          m_shownLabels[i] = null;
        } catch (NullPointerException e){}

        try{
          m_shownLabels[i] = new Label(m_items.get(i + m_scrollIndex));
          //Creates the Labels for each item and creates mouse listeners.
          final int idx = m_items.size();
          m_shownLabels[i].addMouseListener(new MouseAdapter() {
            @Override
            public void mouseReleased(MouseEvent e) {
              itemClicked(m_shownLabels[j].getText(), idx);
            }
          });
          m_shownLabels[i].setOpaque(true);
          m_shownLabels[i].setHorizontalAlignment(Label.LEFT_ALIGNMENT);
          m_shownLabels[i].pack();
          if (m_shownLabels[i].getWidth() > maxWidth)
            maxWidth = (int)m_shownLabels[i].getWidth();
          else
            m_shownLabels[i].setWidth(maxWidth);
          m_shownLabels[i].setHeight(17);
          m_shownLabels[i].setLocation(2, m_bottomY);
          m_bottomY += m_shownLabels[i].getHeight();
       
          if (m_shownLabels[i].getText().equals(m_selectedName))
            m_shownLabels[i].setBackground(m_selectedColor);
        } catch (Exception e) {
          m_shownLabels[i] = null;
          m_shownLabels[i] = new Label();
        }
        add(m_shownLabels[i]);
        y += 17;
        m_shownLabels[i].setLocation(2, y);
      }
View Full Code Here

TOP

Related Classes of mdes.slick.sui.Label

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.