示例#1
0
 private void updateCardView() {
   final Optional<Card> card = stack.viewTop();
   if (card.isPresent()) {
     cardView.setCard(card.get());
   } else {
     cardView.removeCard();
   }
 }
示例#2
0
  public StackView(
      final Context context, final CardImager imager, final Stage stage, final CardStack stack) {
    super(context);
    this.stack = stack;
    stack.register(this);
    cardView = new CardView(context, imager, stage);
    cardView.setParent(this);
    stackSize = new Label();
    stackSize.getStyleClass().add(STYLE_STACK_SIZE);
    stackSize.setMouseTransparent(true);

    pane = new StackPane();
    pane.getChildren().add(cardView.getPane());
    pane.getChildren().add(stackSize);

    setPane(pane);
    updateStackSizeLabel();
    updateCardView();
  }
示例#3
0
 private void updateStackSizeLabel() {
   stackSize.setText(Integer.toString(stack.size()));
 }