mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
[cl.viewer] bigCard update issue fix.
This commit is contained in:
parent
5252255891
commit
5a0ca8025d
2 changed files with 12 additions and 5 deletions
|
|
@ -106,6 +106,10 @@ public class BigCard extends JComponent {
|
||||||
return cardId;
|
return cardId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetCardId() {
|
||||||
|
this.cardId = null;
|
||||||
|
}
|
||||||
|
|
||||||
private void drawText(java.util.List<String> strings) {
|
private void drawText(java.util.List<String> strings) {
|
||||||
text.setText("");
|
text.setText("");
|
||||||
StyledDocument doc = text.getStyledDocument();
|
StyledDocument doc = text.getStyledDocument();
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,8 @@ public class MageActionCallback implements ActionCallback {
|
||||||
protected static DefaultActionCallback defaultCallback = DefaultActionCallback.getInstance();
|
protected static DefaultActionCallback defaultCallback = DefaultActionCallback.getInstance();
|
||||||
protected static Session session = MageFrame.getSession();
|
protected static Session session = MageFrame.getSession();
|
||||||
private CardView popupCard;
|
private CardView popupCard;
|
||||||
private Thread t;
|
|
||||||
private int state = 0;
|
|
||||||
private JComponent cardInfoPane;
|
private JComponent cardInfoPane;
|
||||||
|
private volatile boolean state = false;
|
||||||
|
|
||||||
public MageActionCallback() {
|
public MageActionCallback() {
|
||||||
}
|
}
|
||||||
|
|
@ -186,14 +185,17 @@ public class MageActionCallback implements ActionCallback {
|
||||||
}
|
}
|
||||||
|
|
||||||
MageCard card = (MageCard) data.component;
|
MageCard card = (MageCard) data.component;
|
||||||
if (card.getOriginal().getId() != bigCard.getCardId()) {
|
if (!state || card.getOriginal().getId() != bigCard.getCardId()) {
|
||||||
synchronized (MageActionCallback.class) {
|
synchronized (MageActionCallback.class) {
|
||||||
if (card.getOriginal().getId() != bigCard.getCardId()) {
|
if (!state || card.getOriginal().getId() != bigCard.getCardId()) {
|
||||||
|
if (!state) {
|
||||||
|
bigCard.resetCardId();
|
||||||
|
}
|
||||||
|
state = true;
|
||||||
Image image = card.getImage();
|
Image image = card.getImage();
|
||||||
if (image != null && image instanceof BufferedImage) {
|
if (image != null && image instanceof BufferedImage) {
|
||||||
image = ImageHelper.getResizedImage((BufferedImage) image, bigCard.getWidth(), bigCard.getHeight());
|
image = ImageHelper.getResizedImage((BufferedImage) image, bigCard.getWidth(), bigCard.getHeight());
|
||||||
bigCard.setCard(card.getOriginal().getId(), image, card.getOriginal().getRules(), card.isFoil());
|
bigCard.setCard(card.getOriginal().getId(), image, card.getOriginal().getRules(), card.isFoil());
|
||||||
bigCard.showTextComponent();
|
|
||||||
if (card.getOriginal().isAbility()) {
|
if (card.getOriginal().isAbility()) {
|
||||||
bigCard.showTextComponent();
|
bigCard.showTextComponent();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -232,6 +234,7 @@ public class MageActionCallback implements ActionCallback {
|
||||||
@Override
|
@Override
|
||||||
public void mouseExited(MouseEvent e, final TransferData data) {
|
public void mouseExited(MouseEvent e, final TransferData data) {
|
||||||
hidePopup();
|
hidePopup();
|
||||||
|
this.state = false;
|
||||||
ArrowBuilder.removeAllArrows();
|
ArrowBuilder.removeAllArrows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue