Package factOrFiction.print

Examples of factOrFiction.print.ListFrame


    return page;
  }

  private void createHeader(PrintFrame header) {
    FlowDownFrame down = new FlowDownFrame( header, 1, 0.23);
      ListFrame text = new ListFrame( down, 1, 1);
      text.setFont("Tahoma", 14, SWT.BOLD);
      text.setAlignment(SWT.CENTER);
      text.setMargin( 0.1, 0.1, 0.0, 0.0);
      text.add( "Highlander Registration Sheet" );
    down = new FlowDownFrame( header, 1, 0.02 );
      BorderFrame border = new BorderFrame( down, 1, 1);
      border.setBackground(SWT.COLOR_GRAY);

    down = new FlowDownFrame( header, 1, 0.25);
        FlowRightFrame right = new FlowRightFrame( down, 0.3, 10);
        text = new ListFrame( right, 1, 1);
        text.setFont("Tahoma", 11, SWT.BOLD);
        text.setAlignment(SWT.CENTER);
        text.setMargin( 0.1, 0.1, 0.0, 0.0);
        text.add( "Player Name: " + deck.get(Deck.FEATURE_PLAYER) );
      right = new FlowRightFrame( down, 0.5, 1.0);
        text = new ListFrame( right, 1, 1);
        text.setFont("Tahoma", 11, SWT.BOLD);
        text.setAlignment(SWT.CENTER);
        text.setMargin( 0.1, 0.1, 0.0, 0.0);
        text.add( "DCI: " + deck.get(Deck.FEATURE_DCI));
      right = new FlowRightFrame( down, 0.2, 1);
        text = new ListFrame( right, 1, 1);
        text.setFont("Tahoma", 11, SWT.BOLD);
        text.setAlignment(SWT.CENTER + SWT.RIGHT);
        text.setMargin( 0.1, 0.1, 0.0, 0.0);
        text.add( "Date: " + deck.get(Deck.FEATURE_TOURNAMENT_DATE) );
   
    down = new FlowDownFrame( header, 1.0, 0.25);
        right = new FlowRightFrame( down, 0.3, 1.0);
        text = new ListFrame( right,1, 1);
        text.setFont("Tahoma", 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER);
        text.setMargin( 0.1, 0.1, 0.0, 0.0);
        text.add( "Tournament: " + deck.get(Deck.FEATURE_TOURNAMENT_TITLE) );
      right = new FlowRightFrame( down, 0.5, 1.0);
        text = new ListFrame( right, 1, 1);
        text.setFont("Tahoma", 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER);
        text.setMargin( 0.1, 0.1, 0.0, 0.0);
        text.add( "City: " + deck.get(Deck.FEATURE_TOURNAMENT_CITY));
      right = new FlowRightFrame( down, 0.2, 1.0);
        text = new ListFrame( right, 1, 1);
        text.setFont("Tahoma", 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER + SWT.RIGHT);
        text.setMargin( 0.1, 0.1, 0.0, 0.0);
        text.add( "Type: " + deck.get(Deck.FEATURE_TOURNAMENT_TYPE) );

    down = new FlowDownFrame( header, 1, 0.25);
      right = new FlowRightFrame( down, 0.5, 1.0);
        text = new ListFrame( right, 1, 1);
        text.setFont("Tahoma", 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER);
        text.setMargin( 0.1, 0.1, 0.0, 0.0);
        text.add( "Deck Name: " + deck.getName() );
 
      right = new FlowRightFrame( down, 0.5, 1.0);
        text = new ListFrame( right, 1, 1);
        text.setFont("Tahoma", 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER + SWT.RIGHT);
        text.setMargin( 0.1, 0.1, 0.0, 0.0);
        text.add( "Deck Designer: " + deck.get(Deck.FEATURE_DESIGNER) );
  }
View Full Code Here


   
    new FlowDownFrame( down, 1, 0.01 );

    List<CardGroup> groups = deck.getChildren();
    FlowRightFrame countFrame = null;
    ListFrame countText = null;
    FlowRightFrame cardFrame = null;
    ListFrame cardText = null;
    for (CardGroup group : groups) {
     
      if( !group.getName().equals(CardGroup.SIDEBOARD) ) {
        List<Card> cards = group.getUniqueCards();
        // figure overflow
        if( countText != null && countText.getLineCount() + cards.size() > 41 ) {
          countFrame = null;
          countText = null;
          cardFrame = null;
          cardText = null;
        }
       
        if(countFrame == null) {
          countFrame = new FlowRightFrame( down, 0.05, 1);   
            countText = new ListFrame( countFrame, 1, 1 );
            countText.setFont("Tahoma", 10, SWT.NORMAL);
            countText.setAlignment(SWT.RIGHT);
            countText.setMargin( 0.2, 0.0, 0.02, 0.02);
         
          cardFrame = new FlowRightFrame( down, 0.28, 1);   
            cardText = new ListFrame( cardFrame, 0.9, 1 );
            cardText.setFont("Tahoma", 10, SWT.NORMAL);
            cardText.setMargin( 0.04, 0.0, 0.02, 0.02);
        }
       
        if( !cards.isEmpty() ) {
          if(countText.getLineCount() > 0) {
            countText.add( "" );
            cardText.add( "" );
          }
          if( !"".equals( group.getName()) ) {
            countText.add( "" );
            cardText.add( group.getName() );
          }
         
          for (Card card : cards) {
            int count = group.count( card );
            countText.add( count+"x" );
            cardText.add( card.getName() );
          }         
        }
      }
    }
   
    down = new FlowDownFrame( frame, 1.0, 0.05 );
      ListFrame text = new ListFrame( down, 1.0, 1.0);
      text.setFont("Tahoma", 11, SWT.BOLD);
      text.setMargin( 0.2, 0.2, 0.0, 0.0);
      text.setAlignment(SWT.CENTER);
      text.add("Sum: " + deck.countMaindeck() + " cards");
  }
View Full Code Here

    return page;
  }

  private void createHeader(PrintFrame header) {
    FlowDownFrame down = new FlowDownFrame(header, 1, 0.23);
      ListFrame text = new ListFrame(down, 1, 1);
      text.setFont(DEFAULTFONT, 14, SWT.BOLD);
      text.setAlignment(SWT.CENTER);
      text.setMargin(0.1, 0.1, 0.0, 0.0);
      text.add("Deck Registration Sheet");
   
    down = new FlowDownFrame(header, 1, 0.02);
      BorderFrame border = new BorderFrame(down, 1, 1);
      border.setBackground(SWT.COLOR_GRAY);

    down = new FlowDownFrame(header, 1, 0.25);
      FlowRightFrame right = new FlowRightFrame(down, 0.3, 1);
        text = new ListFrame(right, 1, 1);
        text.setFont(DEFAULTFONT, 11, SWT.BOLD);
        text.setAlignment(SWT.CENTER);
        text.setMargin(0.1, 0.1, 0.0, 0.0);
        text.add("Player Name: " + deck.get(DeckConstants.FEATURE_PLAYER));
      right = new FlowRightFrame(down, 0.5, 1);
        text = new ListFrame(right, 1, 1);
        text.setFont(DEFAULTFONT, 11, SWT.BOLD);
        text.setAlignment(SWT.CENTER);
        text.setMargin(0.1, 0.1, 0.0, 0.0);
        text.add("DCI: " + deck.get(DeckConstants.FEATURE_DCI));
      right = new FlowRightFrame(down, 0.2, 1.0);
        text = new ListFrame(right, 1, 1);
        text.setFont(DEFAULTFONT, 11, SWT.BOLD);
        text.setAlignment(SWT.CENTER + SWT.RIGHT);
        text.setMargin(0.1, 0.1, 0.0, 0.0);
        text.add("Date: " + deck.get(DeckConstants.FEATURE_TOURNAMENT_DATE));

    down = new FlowDownFrame(header, 1.0, 0.25);
      right = new FlowRightFrame(down, 0.3, 1.0);
        text = new ListFrame(right, 1, 1);
        text.setFont(DEFAULTFONT, 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER);
        text.setMargin(0.1, 0.1, 0.0, 0.0);
        text.add("Tournament: " + deck.get(DeckConstants.FEATURE_TOURNAMENT_TITLE));
      right = new FlowRightFrame(down, 0.5, 1.0);
        text = new ListFrame(right, 1, 1);
        text.setFont(DEFAULTFONT, 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER);
        text.setMargin(0.1, 0.1, 0.0, 0.0);
        text.add("City: " + deck.get(DeckConstants.FEATURE_TOURNAMENT_CITY));
      right = new FlowRightFrame(down, 0.2, 1.0);
        text = new ListFrame(right, 1, 1);
        text.setFont(DEFAULTFONT, 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER + SWT.RIGHT);
        text.setMargin(0.1, 0.1, 0.0, 0.0);
        text.add("Type: " + deck.get(DeckConstants.FEATURE_TOURNAMENT_TYPE));

    down = new FlowDownFrame(header, 1, 0.25);
      right = new FlowRightFrame(down, 0.5, 1.0);
        text = new ListFrame(right, 1, 1);
        text.setFont(DEFAULTFONT, 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER);
        text.setMargin(0.1, 0.1, 0.0, 0.0);
        text.add("Deck Name: " + deck.getName());

      right = new FlowRightFrame(down, 0.5, 1.0);
        text = new ListFrame(right, 1, 1);
        text.setFont(DEFAULTFONT, 11, SWT.NORMAL);
        text.setAlignment(SWT.CENTER + SWT.RIGHT);
        text.setMargin(0.1, 0.1, 0.0, 0.0);
        text.add("Deck Designer: " + deck.get(DeckConstants.FEATURE_DESIGNER));
  }
View Full Code Here

      text.add("Sum: " + deck.countMaindeck() + " cards");
  }

  private void createFooter(PrintFrame footer) {
    FlowRightFrame leftFooter = new FlowRightFrame( footer, 0.5, 1.0 );
      ListFrame text1 = new ListFrame( leftFooter, 0.5, 1);
      text1.setFont("Tahoma", 8, SWT.NORMAL);
      text1.setAlignment(SWT.CENTER);
      text1.add( "created with 'Fact or Fiction' - THE Deck Editor by Oliver Wahl");
   
    FlowRightFrame rightFooter = new FlowRightFrame( footer, 0.5, 1.0 );
      ListFrame text2 = new ListFrame( rightFooter, 0.5, 1.0);
      text2.setFont("Tahoma", 8, SWT.NORMAL);
      text2.setAlignment(SWT.CENTER|SWT.RIGHT);
      SimpleDateFormat dateFormat = new SimpleDateFormat("dd. MMMM yyyy");
      text2.add( "printed on " + dateFormat.format(new Date()) );
  }
View Full Code Here

  private void createMainboard(PrintFrame frame) {
    FlowDownFrame down = new FlowDownFrame(frame, 1, 0.95);

    FlowRightFrame countFrame = null;
    ListFrame countText = null;
    FlowRightFrame cardFrame = null;
    ListFrame cardText = null;
   
    for (CardGroup group : deck.getChildren()) {
      if (!group.getName().equals(CardGroup.SIDEBOARD)) {
        List<Card> cards = group.getUniqueCards();

        // figure out when to overflow to second(next) frame
        if (countText != null && countText.getLineCount() + cards.size() + 3 > 30) {
          countFrame = null;
          countText = null;
          cardFrame = null;
          cardText = null;
        }

        // start new frame
        if (countFrame == null) {
          countFrame = new FlowRightFrame(down, 0.10, 1);
            countText = new ListFrame(countFrame, 1, 1);
            countText.setFont(DEFAULTFONT, 11, SWT.NORMAL);
            countText.setAlignment(SWT.RIGHT);
            countText.setMargin(0.2, 0.0, 0.2, 0.2);

          cardFrame = new FlowRightFrame(down, 0.4, 1);
            cardText = new ListFrame(cardFrame, 0.9, 1);
            cardText.setFont(DEFAULTFONT, 11, SWT.NORMAL);
            cardText.setMargin(0.04, 0.0, 0.2, 0.2);
        }

        if (!cards.isEmpty()) {
          if (countText.getLineCount() > 0) {
            countText.add("");
            cardText.add("");
          }
          if (!"".equals(group.getName())) {
            countText.add("");
            cardText.add(group.getName());
          }

          for (Card card : cards) {
            int count = group.count(card);
            countText.add(count + "x");
            cardText.add(card.getName());
          }
        }
      }
    }

    down = new FlowDownFrame(frame, 1.0, 0.05);
      ListFrame text = new ListFrame(down, 1.0, 1.0);
      text.setFont(DEFAULTFONT, 11, SWT.BOLD);
      text.setMargin(0.2, 0.2, 0.0, 0.0);
      text.setAlignment(SWT.CENTER);
      text.add("Sum: " + deck.countMaindeck() + " cards");
  }
View Full Code Here

  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) {
          countFrame = null;
          countText = null;
          cardFrame = null;
          cardText = null;
        }
      }

    down = new FlowDownFrame(frame, 1, 0.09);
      ListFrame sumFrame = new ListFrame(down, 1, 1);
      sumFrame.setFont(DEFAULTFONT, 11, SWT.BOLD);
      sumFrame.setMargin(0.2, 0.2, 0.0, 0.0);
      sumFrame.setAlignment(SWT.CENTER);
      sumFrame.setBackground(SWT.COLOR_GREEN);
      sumFrame.add("Sum: " + deck.countSideboard() + " cards");
    new FlowDownFrame(frame, 1, 0.01);
  }
View Full Code Here

    new FlowDownFrame(frame, 1, 0.01);
  }

  private void createFooter(PrintFrame footer) {
    FlowRightFrame leftFooter = new FlowRightFrame(footer, 0.5, 1.0 );
      ListFrame text1 = new ListFrame(leftFooter, 0.5, 1);
      text1.setFont(DEFAULTFONT, 8, SWT.NORMAL);
      text1.setAlignment(SWT.CENTER);
      text1.add( "created with 'Fact or Fiction' - THE Deck Editor by Oliver Wahl");
   
    ListFrame rightFooter = new ListFrame( footer, 0.5, 1.0);
      rightFooter.setFont(DEFAULTFONT, 8, SWT.NORMAL);
      rightFooter.setAlignment(SWT.CENTER|SWT.RIGHT);
      SimpleDateFormat dateFormat = new SimpleDateFormat("dd. MMMM yyyy");
      rightFooter.add( "printed on " + dateFormat.format(new Date()) );
  }
View Full Code Here

TOP

Related Classes of factOrFiction.print.ListFrame

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.