forked from External/mage
Cards lazy loading
This commit is contained in:
parent
c630ecd2d5
commit
653f236c65
6 changed files with 98 additions and 52 deletions
|
|
@ -27,13 +27,14 @@
|
|||
*/
|
||||
package mage.client.deckeditor.collection.viewer;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.swing.JComponent;
|
||||
import mage.client.MagePane;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Collection viewer pane.
|
||||
* Contains background and components container.
|
||||
|
|
@ -79,5 +80,13 @@ public class CollectionViewerPane extends MagePane {
|
|||
pack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean aFlag) {
|
||||
super.setVisible(aFlag);
|
||||
if (collectionViewerPanel != null) {
|
||||
collectionViewerPanel.showCards();
|
||||
}
|
||||
}
|
||||
|
||||
private CollectionViewerPanel collectionViewerPanel;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,6 +215,12 @@ public final class CollectionViewerPanel extends JPanel {
|
|||
private javax.swing.JScrollPane jScrollPane1;
|
||||
}
|
||||
|
||||
public void showCards() {
|
||||
if (mageBook != null) {
|
||||
mageBook.showCards();
|
||||
}
|
||||
}
|
||||
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private mage.client.cards.BigCard bigCard;
|
||||
|
|
|
|||
|
|
@ -135,13 +135,6 @@ public class MageBook extends JComponent {
|
|||
add(jPanelRight, BorderLayout.LINE_END);
|
||||
|
||||
cardDimensions = new CardDimensions(0.45d);
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showCards();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void addLeftRightPageButtons() {
|
||||
|
|
@ -212,7 +205,7 @@ public class MageBook extends JComponent {
|
|||
}
|
||||
}
|
||||
|
||||
private void showCards() {
|
||||
public void showCards() {
|
||||
jLayeredPane.removeAll();
|
||||
addLeftRightPageButtons();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue