Advanced card image loading: thumbnails (slow on first run). Updated mage-card-plugin. Disabled foil cards.

This commit is contained in:
magenoxx 2011-05-11 17:17:15 +04:00
parent 539cf2552f
commit 6e3a7ede39
6 changed files with 52 additions and 9 deletions

View file

@ -126,7 +126,7 @@ public class BigCard extends JComponent {
@Override
public void paintComponent(Graphics graphics) {
if (foilState) {
/*if (foilState) {
if (source != null) {
synchronized (BigCard.class) {
if (source != null) {
@ -138,6 +138,9 @@ public class BigCard extends JComponent {
if (bigImage != null) {
graphics.drawImage(bigImage, 0, 0, this);
}
}*/
if (bigImage != null) {
graphics.drawImage(bigImage, 0, 0, this);
}
super.paintComponent(graphics);
}
@ -154,7 +157,7 @@ public class BigCard extends JComponent {
}
public void setFoil(boolean foil) {
if (foilThread == null) {
/*if (foilThread == null) {
synchronized (this) {
if (foilThread == null) {
foilThread = getFoilThread();
@ -171,7 +174,8 @@ public class BigCard extends JComponent {
}
}
}
repaint();
*/
repaint();
}
private Thread getFoilThread() {

View file

@ -90,6 +90,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
i.remove();
}
}
System.gc();
drawCards(sortBy, piles);
this.setVisible(true);
}
@ -189,10 +190,12 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
if (comp instanceof Card) {
if (((Card)comp).getCardId().equals(cardId)) {
remove(comp);
comp = null;
}
} else if (comp instanceof MageCard) {
if (((MageCard)comp).getOriginal().getId().equals(cardId)) {
remove(comp);
comp = null;
}
}
}