text.setAlignment(SWT.CENTER);
text.add("Sum: " + deck.countMaindeck() + " cards");
}
private void createSideboard(PrintFrame frame) {
CardGroup group = deck.findGroup(CardGroup.SIDEBOARD);
new FlowDownFrame(frame, 1, 0.01);
FlowDownFrame down = new FlowDownFrame(frame, 1, 0.09);
ListFrame text = new ListFrame(down, 1, 1);
text.setFont(DEFAULTFONT, 11, SWT.BOLD);
text.setAlignment(SWT.CENTER);
text.setMargin(0.2, 0.2, 0.0, 0.0);
text.setBackground(SWT.COLOR_GREEN);
text.add(group.getName());
down = new FlowDownFrame(frame, 1, 0.8);
FlowRightFrame countFrame = null;
ListFrame countText = null;
FlowRightFrame cardFrame = null;
ListFrame cardText = null;
List<Card> cards = group.getUniqueCards();
for (Card card : cards) {
// create the two column frames
if (countFrame == null && cardFrame == null) {
countFrame = new FlowRightFrame(down, 0.10, 1);
countText = new ListFrame(countFrame, 1.0, 1.0);
countText.setFont(DEFAULTFONT, 11, SWT.NORMAL);
countText.setAlignment(SWT.RIGHT);
countText.setMargin(0.2, 0.0, 0.2, 0.2);
countText.setBackground(SWT.COLOR_GREEN);
cardFrame = new FlowRightFrame(down, 0.40, 1);
cardText = new ListFrame(cardFrame, 1, 1);
cardText.setFont(DEFAULTFONT, 11, SWT.NORMAL);
cardText.setMargin(0.04, 0.0, 0.2, 0.2);
cardText.setBackground(SWT.COLOR_GREEN);
}
int count = group.count(card);
countText.add(count + "x");
cardText.add(card.getName());
// figure overflow
if (countText.getLineCount() >= cards.size() / 2) {