Examples of CardButton


Examples of Project1.GUI.CardButton

    Board = new CardButton[BoardSize][BoardSize];
    LinkedList<CardButton> Pool = new LinkedList<CardButton>();
    LinkedList<Integer> Considered = new LinkedList<Integer>();
   
    // Every board should have two creepers :)
    Pool.add(new CardButton(Card.getByID(Card.CREEPER)));
    Pool.add(new CardButton(Card.getByID(Card.CREEPER)));
    Considered.add(Card.CREEPER);
   
    // If the board is big, add Herobrine ;)
    if (BoardSize > Options.toInt(GameSize.C6)) {
      Considered.add(Card.HEROBRINE);
      Pool.add(new CardButton(Card.getByID(Card.HEROBRINE)));
     
      // If the board is bigger, add another Herobrine ;)
      if (BoardSize == Options.toInt(GameSize.C8)) {
        Pool.add(new CardButton(Card.getByID(Card.HEROBRINE)));
      }
    }
   
    // Fill the rest of the pool randomly
    Random rand = new Random(); int randInt;
    while (Pool.size() < Math.pow(BoardSize, 2)) {
      // Randomized range of size-1 because this doesn't include Herobrine
      // Helps limit excess loops, even if just a little :)
      randInt = rand.nextInt(Card.Collection.size() - 1);
      if (!Considered.contains(randInt)) {
        Pool.add(new CardButton(Card.getByID(randInt)));
        Pool.add(new CardButton(Card.getByID(randInt)));
        Considered.add(randInt);
      }
    }
   
    // Shuffle the pool in
View Full Code Here

Examples of de.mhus.lib.vaadin.CardButton

public class DefaultNavigation extends VerticalLayout implements XLayElement, DesktopInject, Observer, Button.ClickListener {

  private Desktop desktop;

  protected Button historyButton(NavigationNode n, boolean isSelected) {
    CardButton b = new CardButton(n.getTitle());
    if (isSelected) {
      b.setBackgroundColor("#000");
      b.setForegroundColor("#fff");
    } else {
      b.setBackgroundColor("#aaa");
      b.setForegroundColor("#000");
    }
    b.setBorder(new Border(1,0,1,0));
    b.setMargin(new Border(1,0,0,0));
    b.setWidth("100%");
    b.setHeight("40px");
    b.updateCaption();
    b.setData(n);
    b.addListener(this);
   
    return b;
  }
View Full Code Here

Examples of de.mhus.lib.vaadin.CardButton

   
    return b;
  }
 
  protected Button childButton(NavigationNode n, boolean isSelected) {
    CardButton b = new CardButton(n.getTitle());
    if (isSelected) {
      b.setBackgroundColor("#000");
      b.setForegroundColor("#fff");
    } else {
      b.setBackgroundColor("#ccc");
      b.setForegroundColor("#000");
    }
    b.setBorder(new Border(1,0,1,0));
    b.setMargin(new Border(1,0,0,20));
    b.setWidth("100%");
    b.setHeight("40px");
    b.updateCaption();
    b.setData(n);
    b.addListener(this);

    return b;
  }
View Full Code Here

Examples of de.mhus.lib.vaadin.CardButton

    out.setHeight("30px");
    return out;
  }

  protected Button historyButton(NavigationNode n) {
    CardButton b = new CardButton(n.getTitle());
//    b.setBackgroundColor("#aaa");
    b.setForegroundColor("#000");
//    b.setBorder(new Border(1,0,1,0));
    b.setMargin(new Border(1,0,0,0));
    //b.setWidth("100%");
    b.setHeight("30px");
    b.updateCaption();
    b.setData(n);
    b.addListener(this);
   
    return b;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.