forked from External/mage
Some more changes to GUI to better support high screen resolutions.
This commit is contained in:
parent
2ce5e00c6d
commit
706d319f81
25 changed files with 376 additions and 229 deletions
|
|
@ -1,5 +1,11 @@
|
|||
package mage.client.plugins;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import javax.swing.*;
|
||||
import mage.cards.MageCard;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.cards.action.ActionCallback;
|
||||
|
|
@ -7,31 +13,41 @@ import mage.client.cards.BigCard;
|
|||
import mage.view.CardView;
|
||||
import mage.view.PermanentView;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface MagePlugins {
|
||||
|
||||
void loadPlugins();
|
||||
|
||||
void shutdown();
|
||||
|
||||
void updateGamePanel(Map<String, JComponent> ui);
|
||||
|
||||
JComponent updateTablePanel(Map<String, JComponent> ui);
|
||||
|
||||
MagePermanent getMagePermanent(PermanentView card, BigCard bigCard, Dimension dimension, UUID gameId, boolean loadImage);
|
||||
|
||||
MageCard getMageCard(CardView card, BigCard bigCard, Dimension dimension, UUID gameId, boolean loadImage);
|
||||
|
||||
boolean isThemePluginLoaded();
|
||||
|
||||
boolean isCardPluginLoaded();
|
||||
|
||||
boolean isCounterPluginLoaded();
|
||||
|
||||
int sortPermanents(Map<String, JComponent> ui, Collection<MagePermanent> permanents);
|
||||
|
||||
void downloadSymbols();
|
||||
|
||||
int getGamesPlayed();
|
||||
|
||||
void addGamesPlayed();
|
||||
Image getManaSymbolImage(String symbol);
|
||||
|
||||
void onAddCard(MagePermanent card, int count);
|
||||
|
||||
void onRemoveCard(MagePermanent card, int count);
|
||||
|
||||
JComponent getCardInfoPane();
|
||||
|
||||
BufferedImage getOriginalImage(CardView card);
|
||||
|
||||
ActionCallback getActionCallback();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package mage.client.plugins.impl;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
|
@ -32,12 +31,11 @@ import org.apache.log4j.Logger;
|
|||
import org.mage.plugins.card.CardPluginImpl;
|
||||
import org.mage.plugins.theme.ThemePluginImpl;
|
||||
|
||||
|
||||
public class Plugins implements MagePlugins {
|
||||
|
||||
public static final String PLUGINS_DIRECTORY = "plugins/";
|
||||
|
||||
private static final MagePlugins fINSTANCE = new Plugins();
|
||||
private static final MagePlugins fINSTANCE = new Plugins();
|
||||
private static final Logger logger = Logger.getLogger(Plugins.class);
|
||||
private static PluginManager pm;
|
||||
|
||||
|
|
@ -107,8 +105,6 @@ public class Plugins implements MagePlugins {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isCardPluginLoaded() {
|
||||
return this.cardPlugin != null;
|
||||
|
|
@ -135,7 +131,7 @@ public class Plugins implements MagePlugins {
|
|||
@Override
|
||||
public int getGamesPlayed() {
|
||||
if (this.counterPlugin != null) {
|
||||
synchronized(Plugins.class) {
|
||||
synchronized (Plugins.class) {
|
||||
try {
|
||||
return this.counterPlugin.getGamePlayed();
|
||||
} catch (PluginException e) {
|
||||
|
|
@ -150,7 +146,7 @@ public class Plugins implements MagePlugins {
|
|||
@Override
|
||||
public void addGamesPlayed() {
|
||||
if (this.counterPlugin != null) {
|
||||
synchronized(Plugins.class) {
|
||||
synchronized (Plugins.class) {
|
||||
try {
|
||||
this.counterPlugin.addGamePlayed();
|
||||
} catch (PluginException e) {
|
||||
|
|
@ -171,14 +167,6 @@ public class Plugins implements MagePlugins {
|
|||
return this.themePlugin != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getManaSymbolImage(String symbol) {
|
||||
if (this.cardPlugin != null) {
|
||||
return this.cardPlugin.getManaSymbolImage(symbol);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAddCard(MagePermanent card, int count) {
|
||||
if (this.cardPlugin != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue