Package mdes.slick.sui

Examples of mdes.slick.sui.Label


   * Packs the ListBox
   */
    public void pack() {
      maxWidth = 30;
      for (String x : m_items) {
        Label l = new Label(x);
        l.pack();
        if (l.getWidth() > maxWidth)
          maxWidth = (int)l.getWidth();
        else
          l.setWidth(maxWidth);
        l.setHeight(17);
      }
      setWidth(maxWidth);
      setHeight(m_bottomY);
      ensureZOrder();
    }
View Full Code Here


   * @param isMoveLearning
   */
  public void initGUI() {
    // TRUE = Move Learning
    // FALSE = Evolution
    m_bg = new Label();
    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", 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);

    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("");
    move3 = BattleButtonFactory.getButton("");
    move4 = BattleButtonFactory.getButton("");

    setResizable(false);
    getTitleBar().setVisible(false);

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

    this.add(bg);
    setY(1);
  }

  public void draw(int pokeIndex) {
    poke = new Label(GameClient.getInstance().getOurPlayer().getPokemon()[pokeIndex].getSprite());
    poke.setSize(80, 80);
    poke.setLocation(getWidth() / 2 - 40, getHeight() / 2 - 40);
    this.add(poke);
  }
View Full Code Here

      this.setBackground(new Color(255, 255, 255, 70));
      this.setLocation(0, -32);
      this.setResizable(false);
      this.getTitleBar().setVisible(false);
     
      m_bg = new Label(new Image(respath+"res/ui/loading.png", false));
      m_bg.pack();
      m_bg.setLocation(400 - (m_bg.getWidth() / 2), 300 - (m_bg.getHeight() /2));
      m_bg.setVisible(true);
      this.add(m_bg);
     
View Full Code Here

          m_itemSelector.destroy();
          m_itemSelector = null;
        }
      }
    });
    m_item = new Label("");
    add(m_arrow);
    add(m_item);
  }
View Full Code Here

    setSize(width, m_amountShown * 20);
   
    m_shownItems = new Label[m_amountShown];
    for (int i = 0; i < m_amountShown; i++){
      m_shownItems[i] = new Label();
    }

    m_up = new SimpleArrowButton(SimpleArrowButton.FACE_UP);
    m_up.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
View Full Code Here

      if (m_shownItems[i] != null){
        getContentPane().remove(m_shownItems[i]);
        m_shownItems[i] = null;
      }
      try{
        m_shownItems[i] = new Label(m_items[i + m_index]);
      } catch (Exception e) {
        m_shownItems[i] = new Label();
      }
      m_shownItems[i].pack();
      m_shownItems[i].addMouseListener(new MouseAdapter(){
        @Override
        public void mouseEntered(MouseEvent e) {
View Full Code Here

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

    getContentPane().setX(getContentPane().getX() - 1);
    getContentPane().setY(getContentPane().getY() + 1);
    this.setSize(96, 64);
    this.setBackground(new Color(0, 0, 0, 75));
   
    m_text = new Label(message);
    m_text.pack();
   
  }
View Full Code Here

        confirm.getCloseButton().setVisible(false);

        confirm.setResizable(false);
        confirm.setSize(370, 70);
        confirm.setLocationRelativeTo(null);
        Label yousure = new Label(
            "Are you sure you want to release your Pokemon?");
        yousure.pack();
        Button yes = new Button("Release");
        yes.pack();
        yes.setLocation(0, confirm.getHeight()
            - confirm.getTitleBar().getHeight() - yes.getHeight());
        yes.addActionListener(new ActionListener() {
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.