diff --git a/Mage.Client/plugins/mage-theme-plugin.jar b/Mage.Client/plugins/mage-theme-plugin.jar index fcc59c78a5..f563f3277e 100644 Binary files a/Mage.Client/plugins/mage-theme-plugin.jar and b/Mage.Client/plugins/mage-theme-plugin.jar differ diff --git a/Mage.Common/src/mage/components/ImagePanel.java b/Mage.Common/src/mage/components/ImagePanel.java index 248ccd0178..b2d323aba8 100644 --- a/Mage.Common/src/mage/components/ImagePanel.java +++ b/Mage.Common/src/mage/components/ImagePanel.java @@ -1,11 +1,6 @@ package mage.components; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.RenderingHints; +import java.awt.*; import java.awt.image.BufferedImage; import java.awt.image.BufferedImageOp; import java.awt.image.ConvolveOp; @@ -22,16 +17,16 @@ public class ImagePanel extends JPanel { public static final int SCALED = 1; public static final int ACTUAL = 2; - private BufferedImage image; + private Image image; private int style; private float alignmentX = 0.5f; private float alignmentY = 0.5f; - public ImagePanel(BufferedImage image) { + public ImagePanel(Image image) { this(image, TILED); } - public ImagePanel(BufferedImage image, int style) { + public ImagePanel(Image image, int style) { this.image = image; this.style = style; setLayout(new BorderLayout()); @@ -103,8 +98,8 @@ public class ImagePanel extends JPanel { private void drawActual(Graphics g) { Dimension d = getSize(); - float x = (d.width - image.getWidth()) * alignmentX; - float y = (d.height - image.getHeight()) * alignmentY; + float x = (d.width - image.getWidth(null)) * alignmentX; + float y = (d.height - image.getHeight(null)) * alignmentY; g.drawImage(image, (int) x, (int) y, this); } } diff --git a/Mage.Plugins/Mage.Theme.Plugin/src/main/java/org/mage/plugins/theme/ThemePluginImpl.java b/Mage.Plugins/Mage.Theme.Plugin/src/main/java/org/mage/plugins/theme/ThemePluginImpl.java index f23ec176d3..d557c97ac8 100644 --- a/Mage.Plugins/Mage.Theme.Plugin/src/main/java/org/mage/plugins/theme/ThemePluginImpl.java +++ b/Mage.Plugins/Mage.Theme.Plugin/src/main/java/org/mage/plugins/theme/ThemePluginImpl.java @@ -34,7 +34,7 @@ public class ThemePluginImpl implements ThemePlugin { } public String toString() { - return "[Theme plugin, version 0.3]"; + return "[Theme plugin, version 0.4]"; } public void applyInGame(Map ui) { @@ -74,7 +74,7 @@ public class ThemePluginImpl implements ThemePlugin { } public JComponent updateTable(Map ui) { - String filename = "/regret.jpg"; + String filename = "/background.png"; try { InputStream is = this.getClass().getResourceAsStream(filename); @@ -86,7 +86,7 @@ public class ThemePluginImpl implements ThemePlugin { if (background == null) throw new FileNotFoundException("Couldn't find " + filename + " in resources."); - ImagePanel bgPanel = new ImagePanel(background, ImagePanel.TILED); + ImagePanel bgPanel = new ImagePanel(background, ImagePanel.SCALED); unsetOpaque(ui.get("jScrollPane1")); unsetOpaque(ui.get("jPanel1")); diff --git a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/background.png b/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/background.png new file mode 100644 index 0000000000..a6eb1cbadb Binary files /dev/null and b/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/background.png differ diff --git a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/regret.jpg b/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/regret.jpg deleted file mode 100644 index 8489d3b8b2..0000000000 Binary files a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/regret.jpg and /dev/null differ