Package factOrFiction.model

Examples of factOrFiction.model.Card


    }
   
    CardGroup group = deck.main;
   
    for (Iterator<Card> iter = cards.iterator(); iter.hasNext();) {
      Card card = iter.next();
      String genericType = card.getGenericType();
     
      if(genericType == null) {
        group = deck.main;
      }
      else  {
View Full Code Here


    columnAmount.getColumn().setWidth(60);
    columnAmount.setLabelProvider( new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        if(element instanceof Card) {
          Card card = (Card)element;
          String meta = deckLegality.getText();
          boolean restricted = CardPool.instance().lookupMetaInfo(card.getName(), meta+"restricted");
         
          return Integer.toString(((CardGroup) card.getParent()).count(card)) + (restricted ? "*": "");
        }
        return null;
      }
      @Override
      public Color getForeground(Object element) {
        String meta = deckLegality.getText();
        if (element instanceof Card && meta.length()>0) {
          Card card = (Card)element;
          boolean legal = CardPool.instance().lookupMetaInfo(card.getName(), meta);
         
          if(legal)
            return darkGreen;
          return red;
        }
View Full Code Here

   

    if(cardCount > 0) {
      List<Card> toSelect = new ArrayList<Card>(currentSelection.size());
      for (Iterator it = currentSelection.iterator(); it.hasNext(); ) {
        Card card = (Card)it.next();
       
        if(card != null) {
          CardGroup group = (CardGroup)card.getParent();
         
          group.remove( card );
          toSelect.addAll(group.lookup(card));
        }
      }
View Full Code Here

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

   
    List<DeckParticle> toSelect = new ArrayList<DeckParticle>(currentSelection.size());

    if(cardCount > 0) {
      for (Iterator it = currentSelection.iterator(); it.hasNext(); ) {
        Card card = (Card)it.next();
       
        if(card != null) {
          CardGroup group = (CardGroup)card.getParent();
         
          group.addAfter( Card.newInstance(card), card );
          toSelect.addAll(group.lookup( card ));
        }
      }     
View Full Code Here

  }
 
  private boolean performCardTemplateDrop(CardTemplate template) {
    int location = getCurrentLocation();
   
    Card targetCard = null;
    CardGroup targetGroup = null;
   
    Card card = Card.newInstance(template);
   
    // COPY card on card
    if( getCurrentTarget() instanceof Card ) {
      targetCard = (Card)getCurrentTarget();
      targetGroup = (CardGroup)targetCard.getParent();
View Full Code Here

    CardGroup targetGroup = null;
   
    for (CardGroup group : groups) {
      // MOVE/COPY card on card
      if( getCurrentTarget() instanceof Card ) {
        Card targetCard = (Card)getCurrentTarget();
        targetGroup = (CardGroup)targetCard.getParent();
      // MOVE/COPY card on group
      } else if( getCurrentTarget() instanceof CardGroup ) {
        targetGroup = (CardGroup)getCurrentTarget();
      }     
     
View Full Code Here

  }
 
  private boolean performCardDrop(Card[] cards) {
    int location = getCurrentLocation();
   
    Card targetCard = null;
    CardGroup targetGroup = null;
   
    // MOVE/COPY card on card
    if( getCurrentTarget() instanceof Card ) {
      targetCard = (Card)getCurrentTarget();
      targetGroup = (CardGroup)targetCard.getParent();
    // MOVE/COPY card on group
    } else if( getCurrentTarget() instanceof CardGroup ) {
      targetGroup = (CardGroup)getCurrentTarget();
     
      if( location == LOCATION_BEFORE) {
View Full Code Here

                if(deck != null)
                  group = deck.main;
              }
             
              if(group != null) {
                Card toAdd = Card.newInstance(newCard);
                group.add(toAdd);
               
                List<Card> list = group.lookup(toAdd);
                provider.setSelection( new StructuredSelection(list) );
              }
View Full Code Here

TOP

Related Classes of factOrFiction.model.Card

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.