Package mage.cards

Examples of mage.cards.MageCard


    this.callback.reportResult(card1, card2);
  }

  @Override
  public void mouseEntered(MouseEvent arg0, TransferData arg1) {
    MageCard card = (MageCard)arg1.component;
    Image image = card.getImage();
    if (image != null && image instanceof BufferedImage) {
      image = ImageHelper.getResizedImage((BufferedImage) image, bigCard.getWidth(), bigCard.getHeight());
      bigCard.setCard(card.getOriginal().getId(), image, card.getOriginal().getRules());
      bigCard.showTextComponent();
      if (card.getOriginal().isAbility()) {
        bigCard.showTextComponent();
      } else {
        bigCard.hideTextComponent();
      }
    } else {
      JXPanel panel = GuiDisplayUtil.getDescription(card.getOriginal(), bigCard.getWidth(), bigCard.getHeight());
      panel.setVisible(true);
      bigCard.hideTextComponent();
      bigCard.addJXPanel(card.getOriginal().getId(), panel);
    }
  }
View Full Code Here


  @Override
  public void mouseMoved(MouseEvent e, TransferData data) {
    if (!Plugins.getInstance().isCardPluginLoaded()) {return;}
    if (bigCard == null) {return;}

    MageCard card = (MageCard) data.component;
    if (card.getOriginal().getId() != bigCard.getCardId()) {
      synchronized (MageActionCallback.class) {
        if (card.getOriginal().getId() != bigCard.getCardId()) {
          Image image = card.getImage();
          if (image != null && image instanceof BufferedImage) {
            image = ImageHelper.getResizedImage((BufferedImage) image, bigCard.getWidth(), bigCard.getHeight());
            bigCard.setCard(card.getOriginal().getId(), image, card.getOriginal().getRules());
            bigCard.showTextComponent();
            if (card.getOriginal().isAbility()) {
              bigCard.showTextComponent();
            } else {
              bigCard.hideTextComponent();
            }
          } else {
            JXPanel panel = GuiDisplayUtil.getDescription(card.getOriginal(), bigCard.getWidth(), bigCard.getHeight());
            panel.setVisible(true);
            bigCard.hideTextComponent();
            bigCard.addJXPanel(card.getOriginal().getId(), panel);
          }
        }
      }
    }
  }
View Full Code Here

   
    return changed;
  }

  private void addCard(CardView card, BigCard bigCard, UUID gameId) {
    MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, Config.dimensions, gameId);
    cards.put(card.getId(), cardImg);
    cardArea.add(cardImg);
  }
View Full Code Here

      tmp.setIsAbility(true);
      tmp.overrideTargets(card.getTargets());
      tmp.setAbility(card); // cross-reference, required for ability picker
      card = tmp;
    }
    MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, dimension, gameId);
    cardImg.setBounds(rectangle);
    cardArea.add(cardImg);
    cardArea.moveToFront(cardImg);
    cardImg.update(card);
    cardImg.addMouseListener(this);
    cardImg.setCardBounds(rectangle.x, rectangle.y, Config.dimensions.frameWidth, Config.dimensions.frameHeight);
  }
View Full Code Here

    drawCards();
    this.setVisible(true);
  }
 
  private void addCard(CardView card, BigCard bigCard, UUID gameId) {
    MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, Config.dimensions, gameId);
    cards.put(card.getId(), cardImg);
    cardImg.addMouseListener(this);
    add(cardImg);
    cardImg.update(card);
    cards.put(card.getId(), cardImg);
  }
View Full Code Here

    this.repaint();
    this.setVisible(true);
  }

  private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle) {
    MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, Config.dimensions, gameId);
    cardImg.setBounds(rectangle);
    cardArea.add(cardImg);
    cardArea.moveToFront(cardImg);
    cardImg.update(card);
    cardImg.addMouseListener(this);
    cardImg.setCardBounds(rectangle.x, rectangle.y, Config.dimensions.frameWidth, Config.dimensions.frameHeight);
  }
View Full Code Here

                j++;
                dx = 0;
            }

            CardView card = cardList.get(i);
            MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, getCardDimension(), gameId, true);

            cardImg.setLocation(dx, dy + j*(height + 30));
            add(cardImg);

            dx += (width + 20);
        }

View Full Code Here

                tmp.overrideTargets(card.getTargets());
                tmp.overrideId(card.getId());
                card = tmp;
            }

            MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, getCardDimension(), gameId, true);
            //cardImg.setBorder(BorderFactory.createLineBorder(Color.red));
            cardImg.setLocation(dx, dy);

            jLayeredPane.add(cardImg, JLayeredPane.DEFAULT_LAYER, 1);

            dx -= (SettingsManager.getInstance().getCardSize().width + 15);
        }
View Full Code Here

    private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle) {
        if (cardDimension == null) {
            cardDimension = new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
        }
        final MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, cardDimension, gameId, true);
        cardImg.setBounds(rectangle);
        jLayeredPane.add(cardImg, JLayeredPane.DEFAULT_LAYER, 10);
        cardImg.update(card);
        cardImg.setCardBounds(rectangle.x, rectangle.y, cardDimensions.frameWidth, cardDimensions.frameHeight);

        boolean implemented = !card.getRarity().equals(Rarity.NA);

        GlowText label = new GlowText();
        label.setGlow(implemented ? Color.green : NOT_IMPLEMENTED, 12, 0.0f);
View Full Code Here

        }
        if (bigCard == null) {
            return;
        }

        MageCard mageCard = (MageCard) transferData.component;
        if (!popupTextWindowOpen || mageCard.getOriginal().getId() != bigCard.getCardId()) {
            if (bigCard.getWidth() > 0) {
                synchronized (MageActionCallback.class) {
                    if (!popupTextWindowOpen || mageCard.getOriginal().getId() != bigCard.getCardId()) {
                        if (!popupTextWindowOpen) {
                            bigCard.resetCardId();
                        }
                        popupTextWindowOpen = true;
                        Image image = mageCard.getImage();
                        displayCardInfo(mageCard, image, bigCard);
                    }
                }
            } else {
                popupTextWindowOpen = true;
            }
            if (!enlargedWindowState.equals(EnlargedWindowState.CLOSED)) {
                displayEnlargedCard(mageCard.getOriginal(), transferData);
            }
        }
    }
View Full Code Here

TOP

Related Classes of mage.cards.MageCard

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.