Examples of Deck


Examples of factOrFiction.model.Deck

      boolean state = false;
      currentSelection  = (IStructuredSelection)selection;
     
      if(currentSelection.getFirstElement() instanceof CardGroup) {
        CardGroup group = (CardGroup)currentSelection.getFirstElement();
        Deck deck = (Deck)group.getParent();
        CardGroup prior = deck.getPrior(group);
       
        state = ( prior != null) && (prior != deck.main ) && (group != deck.sideboard );
      }
      action.setEnabled( state );
    }
View Full Code Here

Examples of factOrFiction.model.Deck

  public void run(IAction action) {
    CardGroup group = (CardGroup)currentSelection.getFirstElement();
   
    if(group != null) {
   
      Deck deck = (Deck)group.getParent();
      CardGroup prior = deck.getPrior(group);
     
      deck.moveGroupAfter(prior, group);
     
      editor.getSite().getSelectionProvider().setSelection( new StructuredSelection( group ) );
    }
  }
View Full Code Here

Examples of factOrFiction.model.Deck

    boldFont.dispose();
    italicFont.dispose();
  }

  private void updateStatusLine() {
    Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

    if (deck != null) {
      if (statusLineSideboard != null) {
        int num = deck.countSideboard();
        statusLineSideboard.setText("Sideboard: " + num + " cards");
      }
      if (statusLineMain != null) {
        int num = deck.countMaindeck();
        statusLineMain.setText("Main: " + num + " cards");
      }
      if (statusLineMain != null) {
        int num = deck.countLands();
        statusLineLand.setText("Land: " + num);
      }
    }
  }
View Full Code Here

Examples of factOrFiction.model.Deck

    label.setText("Version:");
    deckVersion = new Text(bannerGroup, SWT.BORDER);
    deckVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckVersion.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          setDirty(true);
          deck.set(DeckConstants.FEATURE_VERSION, deckVersion.getText());
        }
      }
    });

    label = new Label(bannerGroup, SWT.NONE);
    label.setFont(largeFont);
    label.setBackground(darkGray);
    label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    label.setText("Player:");
    deckPlayer = new Text(bannerGroup, SWT.BORDER);
    deckPlayer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckPlayer.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          setDirty(true);
          deck.set(DeckConstants.FEATURE_PLAYER, deckPlayer.getText());
        }
      }
    });

    label = new Label(bannerGroup, SWT.NONE);
    label.setFont(largeFont);
    label.setBackground(darkGray);
    label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    label.setText("DCI:");
    deckDCI = new Text(bannerGroup, SWT.BORDER);
    deckDCI.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckDCI.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          setDirty(true);
          deck.set(DeckConstants.FEATURE_DCI, deckDCI.getText());
        }
      }
    });

    label = new Label(bannerGroup, SWT.NONE);
    label.setFont(largeFont);
    label.setBackground(darkGray);
    label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    label.setText("Tournament Title:");
    deckTournamentTitle = new Text(bannerGroup, SWT.BORDER);
    deckTournamentTitle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckTournamentTitle.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          setDirty(true);
          deck.set(DeckConstants.FEATURE_TOURNAMENT_TITLE, deckTournamentTitle.getText());
        }
      }
    });

    label = new Label(bannerGroup, SWT.NONE);
    label.setFont(largeFont);
    label.setBackground(darkGray);
    label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    label.setText("Tournament Type:");
    deckTournamentType = new Text(bannerGroup, SWT.BORDER);
    deckTournamentType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckTournamentType.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          setDirty(true);
          deck.set(DeckConstants.FEATURE_TOURNAMENT_TYPE, deckTournamentType.getText());
        }
      }
    });

    label = new Label(bannerGroup, SWT.NONE);
    label.setFont(largeFont);
    label.setBackground(darkGray);
    label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    label.setText("Tournament City:");
    deckTournamentCity = new Text(bannerGroup, SWT.BORDER);
    deckTournamentCity.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckTournamentCity.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          setDirty(true);
          deck.set(DeckConstants.FEATURE_TOURNAMENT_CITY, deckTournamentCity.getText());
        }
      }
    });

    label = new Label(bannerGroup, SWT.NONE);
    label.setFont(largeFont);
    label.setBackground(darkGray);
    label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    label.setText("Tournament Date:");
    deckTournamentDate = new Text(bannerGroup, SWT.BORDER);
    deckTournamentDate.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckTournamentDate.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          setDirty(true);
          deck.set(DeckConstants.FEATURE_TOURNAMENT_DATE, deckTournamentDate.getText());
        }
      }
    });
   
    // don't show
View Full Code Here

Examples of factOrFiction.model.Deck

        }
      }
      editor.getSite().getSelectionProvider().setSelection( new StructuredSelection(toSelect) );
    } else if(groupCount == 1) {
      CardGroup group = (CardGroup)currentSelection.getFirstElement();
      Deck deck = (Deck)group.getParent();
     
      deck.remove(group);
    }

  }
View Full Code Here

Examples of factOrFiction.model.Deck

    deckName = new Text(banner, SWT.BORDER);
    deckName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckName.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        setDirty(true);
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          deck.set(DeckConstants.FEATURE_NAME, deckName.getText());
        }
      }
    });

    label = new Label(banner, SWT.NONE);
    label.setFont(largeFont);
    label.setBackground(darkGray);
    label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    label.setText("Designer:");
    deckDesigner = new Text(banner, SWT.BORDER);
    deckDesigner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckDesigner.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        setDirty(true);
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          deck.set(DeckConstants.FEATURE_DESIGNER, deckDesigner.getText());
        }
      }
    });
   
   
    label = new Label(banner, SWT.NONE);
    label.setFont(largeFont);
    label.setBackground(darkGray);
    label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
    label.setText("Legality:");
    deckLegality = new Combo(banner, SWT.DROP_DOWN | SWT.READ_ONLY);
      deckLegality.add("");
      // gather all MetaInfo Provider
    ExtensionHandler<IMetaEnhancer> tournamentFormatPluginhandler = new ExtensionHandler<IMetaEnhancer>("factOrFiction.tournamentformat");
    List<IMetaEnhancer> enhancer = tournamentFormatPluginhandler.createExecutables();
        for (IMetaEnhancer metaEnhancer : enhancer) {
          deckLegality.add(metaEnhancer.getMetaValue());
        }
    deckLegality.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    deckLegality.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        setDirty(true);
        Deck deck = (Deck) getEditorInput().getAdapter(Deck.class);

        if (deck != null) {
          deck.set(DeckConstants.FEATURE_TOURNAMENT_LEGALITY, deckLegality.getText());
        }
      }
    });
    deckLegality.addFocusListener(new FocusListener() {
      public void focusGained(FocusEvent e) {
View Full Code Here

Examples of factOrFiction.model.Deck

  public void run(IAction action) {
    if(editor == null)
      return;
   
    Deck deck = (Deck)editor.getEditorInput().getAdapter(Deck.class);
   
    if(deck != null) {
      deck.clear();
    }
  }
View Full Code Here

Examples of factOrFiction.model.Deck

  @Override
  public void run() {
    if(editor == null)
      return;
   
    Deck deck = (Deck)editor.getEditorInput().getAdapter(Deck.class);
    if( deck == null)
      return;

    Object clazz = createExecutable();
 
View Full Code Here

Examples of factOrFiction.model.Deck

        card.addUpdateListener(this);
        viewer.refresh(card, updateLabels);
        viewer.expandToLevel(card, AbstractTreeViewer.ALL_LEVELS);
        updateStatusLine();
      } else if (source instanceof Deck) {
        Deck deck = (Deck) source;
        deck.addUpdateListener(this);
        viewer.refresh(deck, updateLabels);
        updateStatusLine();
      } else {
        System.err.println("WTF");
      }
View Full Code Here

Examples of factOrFiction.model.Deck

    Object clazz = createExecutable();
 
    if (clazz !=  null && clazz instanceof IPrintDeck) {
      IPrintDeck print = (IPrintDeck)clazz;
     
      Deck deck = (Deck)editor.getEditorInput().getAdapter(Deck.class);
      if( deck == null)
        return;
     
          try {
            PageFrame page = print.getPrintable(deck);
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.