Skin update:
- Can now fully customize progress bar coloring - Minor fixes to SplashFrame - Minor fixes to FRoundedPanel - Improved FButton images in rebel skin - Streamlined skin instantiation: previously instantiated 4 times, now only 1
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 5.0 KiB |
@@ -8,6 +8,8 @@ import java.awt.RenderingHints;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import forge.AllZone;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* FRoundedPanel.
|
||||
@@ -20,12 +22,9 @@ import javax.swing.JPanel;
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class FRoundedPanel extends JPanel {
|
||||
|
||||
/** The corners. */
|
||||
private boolean[] corners = { true, true, true, true }; // NW, SW, SE, NE
|
||||
|
||||
private Color shadowColor = new Color(150, 150, 150, 150);
|
||||
private Color borderColor = Color.black;
|
||||
private Color borderColor = AllZone.getSkin().getClrBorders();
|
||||
private int shadowOffset = 5;
|
||||
private int cornerRadius = 10;
|
||||
private boolean showShadow = false;
|
||||
@@ -58,14 +57,11 @@ public class FRoundedPanel extends JPanel {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* FRoundedPanel.
|
||||
* </p>
|
||||
* paintComponent is the guts of FRoundedPanel. It paints the borders
|
||||
* and rounded corners determined by the conditional arrays <b>borders[ ]</b>
|
||||
* and <b>corners[ ]</b>.
|
||||
*
|
||||
* Constructor.
|
||||
*
|
||||
* @param g
|
||||
* the g
|
||||
* @param g   Graphics obj
|
||||
*/
|
||||
@Override
|
||||
protected void paintComponent(final Graphics g) {
|
||||
|
||||
@@ -79,6 +79,18 @@ public class FSkin {
|
||||
/** Color of text in skin. */
|
||||
private Color clrText = Color.red;
|
||||
|
||||
/** Color of background in progress bar if unfilled. */
|
||||
private Color clrProgress1 = Color.red;
|
||||
|
||||
/** Color of text in progress bar if filled. */
|
||||
private Color clrProgress2 = Color.red;
|
||||
|
||||
/** Color of background in progress bar if unfilled. */
|
||||
private Color clrProgress3 = Color.red;
|
||||
|
||||
/** Color of text in progress bar if filled. */
|
||||
private Color clrProgress4 = Color.red;
|
||||
|
||||
/** Name of skin. */
|
||||
private String name = "default";
|
||||
|
||||
@@ -124,11 +136,7 @@ public class FSkin {
|
||||
* the exception
|
||||
*/
|
||||
public FSkin(final String skinName) throws Exception {
|
||||
this.loadFontAndImages("default");
|
||||
|
||||
if (!skinName.equals("default")) {
|
||||
this.loadFontAndImages(skinName);
|
||||
}
|
||||
this.loadFontAndImages(skinName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,6 +176,10 @@ public class FSkin {
|
||||
this.setClrActive(this.getColorFromPixel(image.getRGB(60, 90)));
|
||||
this.setClrInactive(this.getColorFromPixel(image.getRGB(60, 110)));
|
||||
this.setClrText(this.getColorFromPixel(image.getRGB(60, 130)));
|
||||
this.setClrProgress1(this.getColorFromPixel(image.getRGB(55, 145)));
|
||||
this.setClrProgress2(this.getColorFromPixel(image.getRGB(65, 145)));
|
||||
this.setClrProgress3(this.getColorFromPixel(image.getRGB(55, 155)));
|
||||
this.setClrProgress4(this.getColorFromPixel(image.getRGB(65, 155)));
|
||||
} catch (final IOException e) {
|
||||
System.err.println(this.notfound + this.paletteFile);
|
||||
}
|
||||
@@ -331,10 +343,10 @@ public class FSkin {
|
||||
|
||||
/**
|
||||
* Color of zebra striping in grid displays.
|
||||
* @param clrZebra0   an image icon
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrZebra(Color clrZebra0) {
|
||||
this.clrZebra = clrZebra0;
|
||||
public void setClrZebra(Color clr0) {
|
||||
this.clrZebra = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,10 +359,10 @@ public class FSkin {
|
||||
|
||||
/**
|
||||
* Color of elements in mouseover state.
|
||||
* @param clrHover0   an image icon
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrHover(Color clrHover0) {
|
||||
this.clrHover = clrHover0;
|
||||
public void setClrHover(Color clr0) {
|
||||
this.clrHover = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -363,10 +375,10 @@ public class FSkin {
|
||||
|
||||
/**
|
||||
* Color of active (currently selected) elements.
|
||||
* @param clrActive0   an image icon
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrActive(Color clrActive0) {
|
||||
this.clrActive = clrActive0;
|
||||
public void setClrActive(Color clr0) {
|
||||
this.clrActive = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,10 +391,10 @@ public class FSkin {
|
||||
|
||||
/**
|
||||
* Color of inactive (not currently selected) elements.
|
||||
* @param clrInactive0   an image icon
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrInactive(Color clrInactive0) {
|
||||
this.clrInactive = clrInactive0;
|
||||
public void setClrInactive(Color clr0) {
|
||||
this.clrInactive = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -395,10 +407,74 @@ public class FSkin {
|
||||
|
||||
/**
|
||||
* Color of text in skin.
|
||||
* @param clrText0   an image icon
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrText(Color clrText0) {
|
||||
this.clrText = clrText0;
|
||||
public void setClrText(Color clr0) {
|
||||
this.clrText = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Background of progress bar, "unfilled" state.
|
||||
* @return {@link javax.awt.Color} clrProgress1
|
||||
*/
|
||||
public Color getClrProgress1() {
|
||||
return clrProgress1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Background of progress bar, "unfilled" state.
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrProgress1(Color clr0) {
|
||||
this.clrProgress1 = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Text of progress bar, "unfilled" state.
|
||||
* @return {@link javax.awt.Color} clrProgress1
|
||||
*/
|
||||
public Color getClrProgress2() {
|
||||
return clrProgress2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Text of progress bar, "unfilled" state.
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrProgress2(Color clr0) {
|
||||
this.clrProgress2 = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Background of progress bar, "filled" state.
|
||||
* @return {@link javax.awt.Color} clrProgress1
|
||||
*/
|
||||
public Color getClrProgress3() {
|
||||
return clrProgress3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Background of progress bar, "filled" state.
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrProgress3(Color clr0) {
|
||||
this.clrProgress3 = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Text of progress bar, "filled" state.
|
||||
* @return {@link javax.awt.Color} clrProgress1
|
||||
*/
|
||||
public Color getClrProgress4() {
|
||||
return clrProgress4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Text of progress bar, "filled" state.
|
||||
* @param clr0   Color obj
|
||||
*/
|
||||
public void setClrProgress4(Color clr0) {
|
||||
this.clrProgress4 = clr0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ApplicationView implements FView {
|
||||
OldGuiNewGame.getUpldDrftCheckBox().setSelected(preferences.isUploadDraftAI());
|
||||
OldGuiNewGame.getFoilRandomCheckBox().setSelected(preferences.isRandCFoil());
|
||||
|
||||
AllZone.setSkin(new FSkin(preferences.getSkin()));
|
||||
AllZone.setSkin(AllZone.getSkin());
|
||||
|
||||
} catch (final Exception exn) {
|
||||
Log.error("Error loading preferences: " + exn);
|
||||
|
||||
@@ -16,6 +16,7 @@ import javax.swing.KeyStroke;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.border.LineBorder;
|
||||
|
||||
import net.slightlymagic.braids.util.progress_monitor.BraidsProgressMonitor;
|
||||
import forge.gui.skin.FSkin;
|
||||
@@ -128,9 +129,12 @@ public class SplashFrame extends JFrame {
|
||||
|
||||
contentPane.getActionMap().put("escAction", new CloseAction());
|
||||
|
||||
// Set UI to color splash bar fill with theme colors
|
||||
UIManager.put("ProgressBar.foreground", skin.getClrTheme()); // When filled
|
||||
UIManager.put("ProgressBar.selectionForeground", skin.getClrText()); // When filled
|
||||
// Set UI to color splash bar fill with skin colors
|
||||
UIManager.put("ProgressBar.background", skin.getClrProgress1()); // Unfilled state
|
||||
UIManager.put("ProgressBar.selectionBackground", skin.getClrProgress2()); // Unfilled state
|
||||
UIManager.put("ProgressBar.foreground", skin.getClrProgress3()); // Filled state
|
||||
UIManager.put("ProgressBar.selectionForeground", skin.getClrProgress4()); // Filled state
|
||||
UIManager.put("ProgressBar.border", new LineBorder(skin.getClrTheme(), 0));
|
||||
|
||||
// Instantiate model and view and tie together.
|
||||
this.monitorModel = new SplashProgressModel();
|
||||
@@ -149,8 +153,7 @@ public class SplashFrame extends JFrame {
|
||||
final JLabel bgLabel = new JLabel(bgIcon);
|
||||
|
||||
// Do not pass Integer.MIN_VALUE directly here; it must be packaged in
|
||||
// an Integer
|
||||
// instance. Otherwise, GUI components will not draw unless moused over.
|
||||
// an Integer instance. Otherwise, GUI components will not draw unless moused over.
|
||||
this.getLayeredPane().add(bgLabel, Integer.valueOf(Integer.MIN_VALUE));
|
||||
|
||||
bgLabel.setBounds(0, 0, splashWidthPx, splashHeightPx);
|
||||
|
||||