* Fixed a problem that the enlarged card view could stay open after a game or draft were finished.

This commit is contained in:
LevelX2 2016-10-23 23:13:02 +02:00
parent bd0e288087
commit 070a0ca3fa
5 changed files with 2319 additions and 2305 deletions

View file

@ -336,7 +336,7 @@ public class DraftPanel extends javax.swing.JPanel {
if (view != null) {
loadCardsToPickedCardsArea(view.getPicks());
draftBooster.loadBooster(EMPTY_VIEW, bigCard);
Plugins.getInstance().getActionCallback().hideTooltipPopup();
Plugins.getInstance().getActionCallback().hideOpenComponents();
setMessage("Waiting for other players");
}
}

View file

@ -31,6 +31,7 @@ import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import static java.awt.Component.LEFT_ALIGNMENT;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
@ -341,7 +342,7 @@ public final class GamePanel extends javax.swing.JPanel {
pickTargetDialog.cleanUp();
pickTargetDialog.removeDialog();
}
Plugins.getInstance().getActionCallback().hideTooltipPopup();
Plugins.getInstance().getActionCallback().hideOpenComponents();
try {
Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER);
popupContainer.setVisible(false);

View file

@ -419,11 +419,16 @@ public class MageActionCallback implements ActionCallback {
}
}
@Override
public void hideOpenComponents() {
this.hideTooltipPopup();
this.hideEnlargedCard();
}
/**
* Hides the text popup window
*
*/
@Override
public void hideTooltipPopup() {
this.tooltipCard = null;
if (tooltipPopup != null) {

View file

@ -4,14 +4,23 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
public interface ActionCallback {
void mouseClicked(MouseEvent e, TransferData data);
void mousePressed(MouseEvent e, TransferData data);
void mouseReleased(MouseEvent e, TransferData data);
void mouseMoved(MouseEvent e, TransferData data);
void mouseDragged(MouseEvent e, TransferData data);
void mouseEntered(MouseEvent e, TransferData data);
void mouseExited(MouseEvent e, TransferData data);
void mouseWheelMoved(MouseWheelEvent e, TransferData data);
void hideTooltipPopup();
void hideOpenComponents();
}

View file

@ -1,10 +1,9 @@
package mage.cards.action.impl;
import mage.cards.action.ActionCallback;
import mage.cards.action.TransferData;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import mage.cards.action.ActionCallback;
import mage.cards.action.TransferData;
/**
* Callback that does nothing on any action
@ -35,7 +34,7 @@ public class EmptyCallback implements ActionCallback {
}
@Override
public void hideTooltipPopup() {
public void hideOpenComponents() {
}
@Override