Examples of Deck


Examples of factOrFiction.model.Deck

  private Deck getDeck()
  {
    if( deck != null)
      return deck;
   
    deck = new Deck( CardPool.instance(), getFile() );

    return deck;
  }
View Full Code Here

Examples of factOrFiction.model.Deck

      }     
    } else if(groupCount == 1) {
      CardGroup group = (CardGroup)currentSelection.getFirstElement();
     
      if(group != null) {
        Deck deck = (Deck)group.getParent();

        CardGroup newGroup = deck.addGroupAfter("New Section", group );
       
        toSelect.add( newGroup );
      }
    }
   
View Full Code Here

Examples of factOrFiction.model.Deck

    // COPY card on group
    } else if( getCurrentTarget() instanceof CardGroup ) {
      targetGroup = (CardGroup)getCurrentTarget();
     
      if( location == LOCATION_BEFORE) {
        Deck deck = (Deck)targetGroup.getParent();
        CardGroup prior = deck.getPrior(targetGroup);
        if( prior != null) {
          targetGroup = prior;
          location = LOCATION_AFTER;
        }
      } else {
View Full Code Here

Examples of factOrFiction.model.Deck

      // MOVE/COPY card on group
      } else if( getCurrentTarget() instanceof CardGroup ) {
        targetGroup = (CardGroup)getCurrentTarget();
      }     
     
      Deck deck = (Deck)group.getParent();
      if( location == LOCATION_BEFORE && targetGroup != deck.main ) {
        targetGroup = deck.getPrior(targetGroup);
        deck.moveGroupAfter( group, targetGroup);
        return true;
      } else if( (location == LOCATION_AFTER || location == LOCATION_ON&& targetGroup != deck.sideboard) {
        deck.moveGroupAfter( group, targetGroup);
        return true;
      }
    }
    return false;
  }
View Full Code Here

Examples of factOrFiction.model.Deck

    // MOVE/COPY card on group
    } else if( getCurrentTarget() instanceof CardGroup ) {
      targetGroup = (CardGroup)getCurrentTarget();
     
      if( location == LOCATION_BEFORE) {
        Deck deck = (Deck)targetGroup.getParent();
        CardGroup prior = deck.getPrior(targetGroup);
        if( prior != null) {
          targetGroup = prior;
          location = LOCATION_AFTER;
        }
      } else {
View Full Code Here

Examples of factOrFiction.model.Deck

  @Override
  public boolean performFinish() {
    IPath path = new Path(page.getFileName()).makeAbsolute()

    DeckEditorInput editorInput = new DeckEditorInput( new File(path.toOSString()) );
    Deck deck = (Deck)editorInput.getAdapter(Deck.class);
   
    deck.set(DeckConstants.FEATURE_NAME, page.getDeckName() );
    deck.set(DeckConstants.FEATURE_DESIGNER, page.getDeckAuthor() );
    deck.set(DeckConstants.FEATURE_VERSION, page.getDeckVersion() );
   
    try {
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, DeckEditor.ID);
    } catch (PartInitException e) {
      MessageDialog.openError(getShell(), "Error", "Error opening deck:" + e.getMessage());
View Full Code Here

Examples of factOrFiction.model.Deck

              if(particle != null && particle instanceof CardGroup) {
                group = (CardGroup)particle;
              } else if(particle != null && particle instanceof Card) {
                group = (CardGroup)particle.getParent();
              } else {
                Deck deck = (Deck)editor.getEditorInput().getAdapter(Deck.class);
               
                if(deck != null)
                  group = deck.main;
              }
             
View Full Code Here

Examples of factOrFiction.model.Deck

    if(selection instanceof IStructuredSelection) {
      currentSelection  = (IStructuredSelection)selection;
     
      if(currentSelection.getFirstElement() instanceof CardGroup) {
        CardGroup group = (CardGroup)currentSelection.getFirstElement();
        Deck deck = (Deck)group.getParent();
        CardGroup next = deck.getNext(group);
       
        state = ( next != null) && (next != deck.sideboard) && (group != deck.main);
      }
      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 next = deck.getNext(group);
     
      deck.moveGroupAfter(group, next);     
     
      editor.getSite().getSelectionProvider().setSelection( new StructuredSelection( group ) );
    }
  }
View Full Code Here

Examples of fr.umlv.card.Deck

import fr.umlv.card.Deck;
import static fr.umlv.card.Suit.*;

public class Main {
    public static void main(String[] args) {
        Deck deck = Deck.fromCardsNumberAndColors(2, SPADE, HEART);
        System.out.println(deck.getCardsList());
    }
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.