From 195f1141cb9b25f8822ca5f8595aef3f8470a088 Mon Sep 17 00:00:00 2001 From: Doublestrike Date: Tue, 6 Dec 2011 09:03:43 +0000 Subject: [PATCH] Added dock icons to icon map in FSkin. --- src/main/java/forge/view/match/ViewDock.java | 10 +- src/main/java/forge/view/toolbox/FSkin.java | 115 ++----------------- 2 files changed, 12 insertions(+), 113 deletions(-) diff --git a/src/main/java/forge/view/match/ViewDock.java b/src/main/java/forge/view/match/ViewDock.java index 14c7a5dc05c..4d7e6057f63 100644 --- a/src/main/java/forge/view/match/ViewDock.java +++ b/src/main/java/forge/view/match/ViewDock.java @@ -94,7 +94,7 @@ public class ViewDock extends FRoundedPanel { } }; - final JLabel btnConcede = new DockButton(this.skin.getIconConcede(), "Concede Game"); + final JLabel btnConcede = new DockButton(skin.getIcon("dock.concede"), "Concede Game"); btnConcede.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { @@ -102,7 +102,7 @@ public class ViewDock extends FRoundedPanel { } }); - final JLabel btnShortcuts = new DockButton(this.skin.getIconShortcuts(), "Keyboard Shortcuts"); + final JLabel btnShortcuts = new DockButton(skin.getIcon("dock.shortcuts"), "Keyboard Shortcuts"); btnShortcuts.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { @@ -110,7 +110,7 @@ public class ViewDock extends FRoundedPanel { } }); - final JLabel btnSettings = new DockButton(this.skin.getIconSettings(), "Game Settings"); + final JLabel btnSettings = new DockButton(skin.getIcon("dock.settings"), "Game Settings"); btnSettings.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { @@ -118,7 +118,7 @@ public class ViewDock extends FRoundedPanel { } }); - final JLabel btnEndTurn = new DockButton(this.skin.getIconEndTurn(), "End Turn"); + final JLabel btnEndTurn = new DockButton(skin.getIcon("dock.endturn"), "End Turn"); btnEndTurn.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { @@ -127,7 +127,7 @@ public class ViewDock extends FRoundedPanel { }); //TODO - get an icon for this - final JLabel btnViewDeckList = new DockButton(this.skin.getIconViewDeckList(), "View Deck List"); + final JLabel btnViewDeckList = new DockButton(skin.getIcon("dock.decklist"), "View Deck List"); btnViewDeckList.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { diff --git a/src/main/java/forge/view/toolbox/FSkin.java b/src/main/java/forge/view/toolbox/FSkin.java index a2538f4a99f..e01b64ed11b 100644 --- a/src/main/java/forge/view/toolbox/FSkin.java +++ b/src/main/java/forge/view/toolbox/FSkin.java @@ -81,13 +81,6 @@ public class FSkin { /** Splash screen image. */ private ImageIcon splash = null; - /** Splash screen image. */ - private ImageIcon icoShortcuts = null; - private ImageIcon icoSettings = null; - private ImageIcon icoConcede = null; - private ImageIcon icoEndTurn = null; - private ImageIcon icoViewDeckList = null; - /** Base color used in skin. */ private Color clrTheme = Color.red; @@ -194,7 +187,7 @@ public class FSkin { this.setBtnRdown(this.retrieveImage(dirName + this.btnRdownfile)); this.setSplashBG(this.retrieveImage(dirName + this.splashfile)); - // Color palette + // Sprite final File file = new File(dirName + this.spriteFile); BufferedImage image; try { @@ -210,11 +203,6 @@ public class FSkin { this.setClrProgress2(this.getColorFromPixel(image.getRGB(75, 145))); this.setClrProgress3(this.getColorFromPixel(image.getRGB(65, 155))); this.setClrProgress4(this.getColorFromPixel(image.getRGB(75, 155))); - this.setIconShortcuts(image.getSubimage(160, 0, 80, 80)); - this.setIconEndTurn(image.getSubimage(160, 80, 80, 80)); - this.setIconViewDeckList(image.getSubimage(60, 140, 20, 20)); - this.setIconSettings(image.getSubimage(80, 0, 80, 80)); - this.setIconConcede(image.getSubimage(80, 80, 80, 80)); // All icons should eventually be set and retrieved using this method. // Doublestrike 6-12-11 @@ -231,6 +219,12 @@ public class FSkin { this.setIcon("mana.red", image.getSubimage(240, 80, 40, 40)); this.setIcon("mana.white", image.getSubimage(280, 120, 40, 40)); this.setIcon("mana.colorless", image.getSubimage(280, 80, 40, 40)); + + this.setIcon("dock.shortcuts", image.getSubimage(160, 0, 80, 80)); + this.setIcon("dock.settings", image.getSubimage(160, 80, 80, 80)); + this.setIcon("dock.concede", image.getSubimage(60, 140, 20, 20)); + this.setIcon("dock.endturn", image.getSubimage(80, 0, 80, 80)); + this.setIcon("dock.decklist", image.getSubimage(80, 80, 80, 80)); } catch (final IOException e) { System.err.println(this.notfound + this.spriteFile); } @@ -753,101 +747,6 @@ public class FSkin { return this.name; } - /** - * Sets the icon shortcuts. - * - * @param bi0 - *   BufferedImage - */ - public void setIconShortcuts(final BufferedImage bi0) { - this.icoShortcuts = new ImageIcon(bi0); - } - - /** - * Gets the icon shortcuts. - * - * @return ImageIcon - */ - public ImageIcon getIconShortcuts() { - return this.icoShortcuts; - } - - /** - * Sets the icon settings. - * - * @param bi0 - *   BufferedImage - */ - public void setIconSettings(final BufferedImage bi0) { - this.icoSettings = new ImageIcon(bi0); - } - - /** - * Gets the icon settings. - * - * @return ImageIcon - */ - public ImageIcon getIconSettings() { - return this.icoSettings; - } - - /** - * Sets the icon concede. - * - * @param bi0 - *   BufferedImage - */ - public void setIconConcede(final BufferedImage bi0) { - this.icoConcede = new ImageIcon(bi0); - } - - /** - * Gets the icon concede. - * - * @return ImageIcon - */ - public ImageIcon getIconConcede() { - return this.icoConcede; - } - - /** - * Sets the icon end turn. - * - * @param bi0 - *   BufferedImage - */ - public void setIconEndTurn(final BufferedImage bi0) { - this.icoEndTurn = new ImageIcon(bi0); - } - - /** - * Gets the icon end turn. - * - * @return ImageIcon - */ - public ImageIcon getIconEndTurn() { - return this.icoEndTurn; - } - - /** - * Sets the icon view deck list. - * - * @param bi0 - *   BufferedImage - */ - public void setIconViewDeckList(final BufferedImage bi0) { - this.icoViewDeckList = new ImageIcon(bi0); - } - - /** - * Gets the icon view deck list. - * - * @return ImageIcon - */ - public ImageIcon getIconViewDeckList() { - return this.icoViewDeckList; - } - /** * @param s0   String address * @return ImageIcon