Now if there is big image (card.plugin), rules box is not displayed.

This commit is contained in:
magenoxx 2010-11-19 09:01:47 +00:00
parent 3b9b92ed0b
commit 502b21fddb
5 changed files with 15 additions and 8 deletions

View file

@ -56,10 +56,6 @@ public class BigCard extends javax.swing.JPanel {
public BigCard() {
initComponents();
}
public void removeTextComponent() {
remove(this.scrollPane);
}
public void setCard(UUID cardId, Image image, List<String> strings) {
if (this.cardId == null || !this.cardId.equals(cardId)) {
@ -92,6 +88,18 @@ public class BigCard extends javax.swing.JPanel {
graphics.drawImage(bigImage, 0, 0, this);
super.paintComponent(graphics);
}
public void removeTextComponent() {
remove(this.scrollPane);
}
public void hideTextComponent() {
this.scrollPane.setVisible(false);
}
public void showTextComponent() {
this.scrollPane.setVisible(true);
}
/** This method is called from within the constructor to

View file

@ -345,6 +345,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis
@Override
public void mouseMoved(MouseEvent arg0) {
this.bigCard.showTextComponent();
this.bigCard.setCard(card.getId(), image, getRules());
}

View file

@ -89,9 +89,6 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane implements Compon
public void init(UUID gameId, BigCard bigCard) {
this.gameId = gameId;
this.bigCard = bigCard;
/*if (Plugins.getInstance().isCardPluginLoaded()) {
bigCard.removeTextComponent();
}*/
addMouseListener(new MageMouseAdapter(this, gameId));
addMouseMotionListener(new MageMouseMotionAdapter(this, bigCard));
}

View file

@ -33,6 +33,7 @@ public class MageMouseMotionAdapter extends MouseMotionAdapter {
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.hideTextComponent();
} else {
//TODO: add description panel
}