Reconstruct codes
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program.
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.text.ParseException;
|
||||
import java.util.Map;
|
||||
import javax.swing.UIDefaults;
|
||||
import javax.swing.plaf.synth.SynthLookAndFeel;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.NetUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class HelloMinecraftLookAndFeel extends SynthLookAndFeel {
|
||||
|
||||
public static final Map<String, String> DEFAULT_SETTINGS = Theme.BLUE.settings;
|
||||
|
||||
/**
|
||||
* Creates a new instance of NimbusLookAndFeel
|
||||
*
|
||||
* @throws java.text.ParseException error parsing the xml, it must not
|
||||
* happen.
|
||||
*/
|
||||
public HelloMinecraftLookAndFeel() throws ParseException {
|
||||
this(DEFAULT_SETTINGS);
|
||||
}
|
||||
|
||||
public HelloMinecraftLookAndFeel(Map<String, String> settings) throws ParseException {
|
||||
try {
|
||||
String s = NetUtils.getStreamContent(HelloMinecraftLookAndFeel.class.getResourceAsStream("/org/jackhuang/hellominecraft/lookandfeel/synth.xml"), "UTF-8");
|
||||
for (String ss : settings.keySet())
|
||||
s = s.replace("${" + ss + "}", settings.get(ss));
|
||||
load(new ByteArrayInputStream(s.getBytes("UTF-8")), HelloMinecraftLookAndFeel.class);
|
||||
} catch (Throwable ex) {
|
||||
HMCLog.err("This fucking exception should not happen. Retry backup solution.", ex);
|
||||
try {
|
||||
load(HelloMinecraftLookAndFeel.class.getResourceAsStream("/org/jackhuang/hellominecraft/lookandfeel/synth_backup.xml"), HelloMinecraftLookAndFeel.class);
|
||||
} catch (Throwable e) {
|
||||
HMCLog.err("User fault", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UIDefaults uiDefaults;
|
||||
|
||||
@Override
|
||||
public UIDefaults getDefaults() {
|
||||
if (uiDefaults != null)
|
||||
return uiDefaults;
|
||||
uiDefaults = super.getDefaults();
|
||||
//ui.put("Table.selectionForeground", new ColorUIResource(Color.red));
|
||||
//ui.put("Table.focusCellForeground", new ColorUIResource(Color.red));
|
||||
//ui.put("TabbedPane.isTabRollover", false);
|
||||
//ui.put("ComboBox.selectionBackground", new ColorUIResource(Color.red));
|
||||
//ui.put("List.background", new ColorUIResource(Color.red));
|
||||
//uiDefaults.put("TabbedPane.selectedLabelShift", 0);
|
||||
uiDefaults.put("Table.selectionBackground", Color.red);
|
||||
return uiDefaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a short string that identifies this look and feel.
|
||||
*
|
||||
* @return a short string identifying this look and feel.
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return "HelloMinecraftLookAndFeel";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string that identifies this look and feel.
|
||||
*
|
||||
* @return a short string identifying this look and feel.
|
||||
*/
|
||||
@Override
|
||||
public String getID() {
|
||||
return "HelloMinecraftLookAndFeel";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a textual description of this look and feel.
|
||||
*
|
||||
* @return textual description of this look and feel.
|
||||
*/
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "HelloMinecraftLookAndFeel";
|
||||
}
|
||||
}
|
||||
93
HMCLaF/src/main/java/org/jackhuang/hellominecraft/lookandfeel/Theme.java
Executable file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Hello Minecraft! Launcher.
|
||||
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public enum Theme {
|
||||
BLUE(C.i18n("color.blue"), new HashMap<String, String>() {
|
||||
{
|
||||
put("Customized.TabbedPaneTab.selected_foreground", "#106CA3");
|
||||
put("Customized.ComboBox.selected_background", "#A0D8F0");
|
||||
put("Customized.MainFrame.background", "#106CA3");
|
||||
put("Customized.MainFrame.selected_background", "#0C5E91");
|
||||
put("Customized.MainFrame.background_image", "background.jpg");
|
||||
}
|
||||
}),
|
||||
GREEN(C.i18n("color.green"), new HashMap<String, String>() {
|
||||
{
|
||||
put("Customized.TabbedPaneTab.selected_foreground", "#1ABC9C");
|
||||
put("Customized.ComboBox.selected_background", "#1ABC9C");
|
||||
put("Customized.MainFrame.background", "#1ABC9C");
|
||||
put("Customized.MainFrame.selected_background", "#16A085");
|
||||
put("Customized.MainFrame.background_image", "background.jpg");
|
||||
}
|
||||
}),
|
||||
PURPLE(C.i18n("color.purple"), new HashMap<String, String>() {
|
||||
{
|
||||
put("Customized.TabbedPaneTab.selected_foreground", "#9B59B6");
|
||||
put("Customized.ComboBox.selected_background", "#9B59B6");
|
||||
put("Customized.MainFrame.background", "#9B59B6");
|
||||
put("Customized.MainFrame.selected_background", "#8E44AD");
|
||||
put("Customized.MainFrame.background_image", "background.jpg");
|
||||
}
|
||||
}),
|
||||
DARKER_BLUE(C.i18n("color.dark_blue"), new HashMap<String, String>() {
|
||||
{
|
||||
put("Customized.TabbedPaneTab.selected_foreground", "#34495E");
|
||||
put("Customized.ComboBox.selected_background", "#34495E");
|
||||
put("Customized.MainFrame.background", "#34495E");
|
||||
put("Customized.MainFrame.selected_background", "#2C3E50");
|
||||
put("Customized.MainFrame.background_image", "background.jpg");
|
||||
}
|
||||
}),
|
||||
ORANGE(C.i18n("color.orange"), new HashMap<String, String>() {
|
||||
{
|
||||
put("Customized.TabbedPaneTab.selected_foreground", "#E67E22");
|
||||
put("Customized.ComboBox.selected_background", "#F39C12");
|
||||
put("Customized.MainFrame.background", "#E67E22");
|
||||
put("Customized.MainFrame.selected_background", "#D35400");
|
||||
put("Customized.MainFrame.background_image", "background.jpg");
|
||||
}
|
||||
}),
|
||||
RED(C.i18n("color.red"), new HashMap<String, String>() {
|
||||
{
|
||||
put("Customized.TabbedPaneTab.selected_foreground", "#E74C3C");
|
||||
put("Customized.ComboBox.selected_background", "#E74C3C");
|
||||
put("Customized.MainFrame.background", "#E74C3C");
|
||||
put("Customized.MainFrame.selected_background", "#C0392B");
|
||||
put("Customized.MainFrame.background_image", "background.jpg");
|
||||
}
|
||||
});
|
||||
|
||||
public final String localizedName;
|
||||
public final Map<String, String> settings;
|
||||
|
||||
private Theme(String localizedName, Map<String, String> settings) {
|
||||
if (settings == null)
|
||||
throw new NullPointerException("Theme settings map should not be null.");
|
||||
this.localizedName = localizedName;
|
||||
this.settings = settings;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program.
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel.comp;
|
||||
|
||||
import java.awt.Color;
|
||||
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class ConstomButton extends javax.swing.JButton {
|
||||
public Color normalFg = GraphicsUtils.getWebColorWithAlpha("DDDDDD6F"), normalBg = GraphicsUtils.getWebColorWithAlpha("DDDDDD6F"),
|
||||
prelightFg = GraphicsUtils.getWebColorWithAlpha("FFFFFF7F"), prelightBg = GraphicsUtils.getWebColorWithAlpha("FFFFFF7F"),
|
||||
activeFg = GraphicsUtils.getWebColorWithAlpha("EAEDF83F"), activeBg = GraphicsUtils.getWebColorWithAlpha("EAEDF83F");
|
||||
public int drawPercent = 0;
|
||||
public long lastDrawTime = 0;
|
||||
public int radix = 0;
|
||||
public boolean notDraw = false;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program.
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel.comp;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public interface IConstomable {
|
||||
boolean constomBackground();
|
||||
boolean constomForeground();
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
* $Id: MetroGraphicsUtils.java,v 1.9 2005/12/05 15:00:55 kizune Exp $
|
||||
*
|
||||
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
|
||||
* Santa Clara, California 95054, U.S.A. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel.painter;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.geom.RoundRectangle2D;
|
||||
import javax.swing.Timer;
|
||||
import javax.swing.plaf.synth.SynthConstants;
|
||||
import javax.swing.plaf.synth.SynthContext;
|
||||
import javax.swing.plaf.synth.SynthPainter;
|
||||
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
|
||||
import org.jackhuang.hellominecraft.lookandfeel.comp.ConstomButton;
|
||||
|
||||
/**
|
||||
* ButtonPainter - handles painting Nimbus style buttons with Java2D
|
||||
*
|
||||
* @author Created by Jasper Potts (Jan 4, 2007)
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ButtonPainter extends SynthPainter {
|
||||
|
||||
private static final String DEFAULT_NORMAL = "D5D5D5";
|
||||
private static final Color[] DEFAULT_NORMAL_FG = new Color[] {
|
||||
GraphicsUtils.getWebColor(DEFAULT_NORMAL),
|
||||
GraphicsUtils.getWebColor(DEFAULT_NORMAL)
|
||||
};
|
||||
private static final String DEFAULT_PRELIGHT = "A9A9A9";
|
||||
private static final Color[] DEFAULT_PRELIGHT_FG = new Color[] {
|
||||
GraphicsUtils.getWebColor(DEFAULT_PRELIGHT),
|
||||
GraphicsUtils.getWebColor(DEFAULT_PRELIGHT)
|
||||
};
|
||||
private static final String DEFAULT_ACTIVE = "222222";
|
||||
private static final Color[] DEFAULT_ACTIVE_FG = new Color[] {
|
||||
GraphicsUtils.getWebColor(DEFAULT_ACTIVE),
|
||||
GraphicsUtils.getWebColor(DEFAULT_ACTIVE)
|
||||
};
|
||||
|
||||
private static final Color[] DISABLED_BG = new Color[] {
|
||||
GraphicsUtils.getWebColor("E3EFE9"),
|
||||
GraphicsUtils.getMidWebColor("E3EFE9", "DFE2E6"),
|
||||
GraphicsUtils.getWebColor("DFE2E6"),
|
||||
GraphicsUtils.getMidWebColor("DFE2E6", "D6D9DF"),
|
||||
GraphicsUtils.getWebColor("D6D9DF"),
|
||||
GraphicsUtils.getWebColor("D6D9DF"),
|
||||
GraphicsUtils.getMidWebColor("D6D9DF", "D8DBE1"),
|
||||
GraphicsUtils.getWebColor("D8DBE1"),
|
||||
GraphicsUtils.getWebColor("DADDE3")
|
||||
};
|
||||
private static final Color[] DISABLED_FG = new Color[] {
|
||||
GraphicsUtils.getWebColor("C9CCD2"),
|
||||
GraphicsUtils.getWebColor("C9CCD2"),
|
||||
GraphicsUtils.getWebColor("BCBFC5"),
|
||||
GraphicsUtils.getWebColor("BCBFC5")
|
||||
};
|
||||
|
||||
private static boolean processCustomButton(final ConstomButton c, int add) {
|
||||
if (c.drawPercent == 0 || c.drawPercent == 100) {
|
||||
Timer t = new Timer(1, null);
|
||||
t.addActionListener(x -> {
|
||||
c.drawPercent += add;
|
||||
if (c.drawPercent > 100 && add > 0) {
|
||||
c.drawPercent = 100;
|
||||
t.stop();
|
||||
} else if (c.drawPercent < 0 && add < 0) {
|
||||
c.drawPercent = 0;
|
||||
t.stop();
|
||||
} else
|
||||
c.updateUI();
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void paintButtonBackground(SynthContext context, Graphics g, int x, int y, int w, int h) {
|
||||
Graphics2D g2 = (Graphics2D) g.create();
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
Color[] fg, bg;
|
||||
if ((context.getComponentState() & SynthConstants.DEFAULT) != 0)
|
||||
if ((context.getComponentState() & SynthConstants.PRESSED) != 0)
|
||||
if (context.getComponent() instanceof ConstomButton) {
|
||||
ConstomButton c = (ConstomButton) context.getComponent();
|
||||
fg = new Color[] { c.activeFg, c.activeFg };
|
||||
bg = new Color[] { c.activeFg, c.activeFg };
|
||||
} else {
|
||||
fg = DEFAULT_ACTIVE_FG;
|
||||
bg = DEFAULT_ACTIVE_FG;
|
||||
}
|
||||
else if ((context.getComponentState() & SynthConstants.DISABLED) != 0)
|
||||
return; //fg = DISABLED_FG;
|
||||
//bg = DISABLED_BG;
|
||||
else if ((context.getComponentState() & SynthConstants.MOUSE_OVER) != 0)
|
||||
if (context.getComponent() instanceof ConstomButton) {
|
||||
final ConstomButton c = (ConstomButton) context.getComponent();
|
||||
if (!processCustomButton(c, 1))
|
||||
return;
|
||||
Color fgs = GraphicsUtils.getMidWebColor(c.normalFg, c.prelightFg, c.drawPercent);
|
||||
Color bgs = GraphicsUtils.getMidWebColor(c.normalBg, c.prelightBg, c.drawPercent);
|
||||
fg = new Color[] { fgs, fgs };
|
||||
bg = new Color[] { bgs, bgs };
|
||||
} else {
|
||||
fg = DEFAULT_PRELIGHT_FG;
|
||||
bg = DEFAULT_PRELIGHT_FG;
|
||||
}
|
||||
else if (context.getComponent() instanceof ConstomButton) {
|
||||
final ConstomButton c = (ConstomButton) context.getComponent();
|
||||
if (!processCustomButton(c, -1))
|
||||
return;
|
||||
Color fgs = GraphicsUtils.getMidWebColor(c.normalFg, c.prelightFg, c.drawPercent);
|
||||
Color bgs = GraphicsUtils.getMidWebColor(c.normalBg, c.prelightBg, c.drawPercent);
|
||||
fg = new Color[] { fgs, fgs };
|
||||
bg = new Color[] { bgs, bgs };
|
||||
} else {
|
||||
fg = DEFAULT_NORMAL_FG;
|
||||
bg = DEFAULT_NORMAL_FG;
|
||||
}
|
||||
else if ((context.getComponentState() & SynthConstants.PRESSED) != 0)
|
||||
if (context.getComponent() instanceof ConstomButton) {
|
||||
ConstomButton c = (ConstomButton) context.getComponent();
|
||||
fg = new Color[] { c.activeFg, c.activeFg };
|
||||
bg = new Color[] { c.activeFg, c.activeFg };
|
||||
} else {
|
||||
fg = DEFAULT_ACTIVE_FG;
|
||||
bg = DEFAULT_ACTIVE_FG;
|
||||
}
|
||||
else if ((context.getComponentState() & SynthConstants.DISABLED) != 0)
|
||||
return; //fg = DISABLED_FG;
|
||||
//bg = DISABLED_BG;
|
||||
else if ((context.getComponentState() & SynthConstants.MOUSE_OVER) != 0)
|
||||
if (context.getComponent() instanceof ConstomButton) {
|
||||
final ConstomButton c = (ConstomButton) context.getComponent();
|
||||
if (!processCustomButton(c, 1))
|
||||
return;
|
||||
Color fgs = GraphicsUtils.getMidWebColor(c.normalFg, c.prelightFg, c.drawPercent);
|
||||
Color bgs = GraphicsUtils.getMidWebColor(c.normalBg, c.prelightBg, c.drawPercent);
|
||||
fg = new Color[] { fgs, fgs };
|
||||
bg = new Color[] { bgs, bgs };
|
||||
} else if (context.getComponent() instanceof ConstomButton) {
|
||||
ConstomButton c = (ConstomButton) context.getComponent();
|
||||
fg = new Color[] { c.prelightFg, c.prelightFg };
|
||||
bg = new Color[] { c.prelightBg, c.prelightBg };
|
||||
} else {
|
||||
fg = DEFAULT_PRELIGHT_FG;
|
||||
bg = DEFAULT_PRELIGHT_FG;
|
||||
}
|
||||
else if (context.getComponent() instanceof ConstomButton) {
|
||||
final ConstomButton c = (ConstomButton) context.getComponent();
|
||||
if (!processCustomButton(c, -1))
|
||||
return;
|
||||
Color fgs = GraphicsUtils.getMidWebColor(c.normalFg, c.prelightFg, c.drawPercent);
|
||||
Color bgs = GraphicsUtils.getMidWebColor(c.normalBg, c.prelightBg, c.drawPercent);
|
||||
fg = new Color[] { fgs, fgs };
|
||||
bg = new Color[] { bgs, bgs };
|
||||
} else {
|
||||
fg = DEFAULT_NORMAL_FG;
|
||||
bg = DEFAULT_NORMAL_FG;
|
||||
}
|
||||
/*w = w - 2;
|
||||
h = h - 2;
|
||||
|
||||
g2.setPaint(new LinearGradientPaint(x, y, x, y + h,
|
||||
new float[]{0, 1}, bg));
|
||||
g2.fillRect(x, y, w, h);
|
||||
|
||||
g2.setPaint(new LinearGradientPaint(x, y, x, y + h,
|
||||
new float[]{0, 1}, fg));
|
||||
g2.drawRect(x, y, w, h);*/
|
||||
|
||||
int radix = (context.getComponent() instanceof ConstomButton) ? ((ConstomButton) context.getComponent()).radix : 0;
|
||||
|
||||
g2.setColor(fg[0]);
|
||||
RoundRectangle2D fgshape = new RoundRectangle2D.Float(x, y, w, h, radix, radix);
|
||||
g2.draw(fgshape);
|
||||
g2.setColor(bg[0]);
|
||||
RoundRectangle2D bgshape = new RoundRectangle2D.Float(x, y, w, h, radix, radix);
|
||||
g2.fill(bgshape);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintToggleButtonBackground(SynthContext context, Graphics g, int x, int y, int w, int h) {
|
||||
Graphics2D g2 = (Graphics2D) g.create();
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
Color[] fg, bg;
|
||||
if ((context.getComponentState() & SynthConstants.DEFAULT) != 0)
|
||||
if ((context.getComponentState() & SynthConstants.PRESSED) != 0 || (context.getComponentState() & SynthConstants.SELECTED) != 0) {
|
||||
fg = DEFAULT_ACTIVE_FG;
|
||||
bg = DEFAULT_ACTIVE_FG;
|
||||
} else if ((context.getComponentState() & SynthConstants.DISABLED) != 0) {
|
||||
fg = DISABLED_FG;
|
||||
bg = DISABLED_BG;
|
||||
} else if ((context.getComponentState() & SynthConstants.MOUSE_OVER) != 0) {
|
||||
fg = DEFAULT_PRELIGHT_FG;
|
||||
bg = DEFAULT_PRELIGHT_FG;
|
||||
} else {
|
||||
fg = DEFAULT_NORMAL_FG;
|
||||
bg = DEFAULT_NORMAL_FG;
|
||||
}
|
||||
else if ((context.getComponentState() & SynthConstants.PRESSED) != 0 || (context.getComponentState() & SynthConstants.SELECTED) != 0) {
|
||||
fg = DEFAULT_ACTIVE_FG;
|
||||
bg = DEFAULT_ACTIVE_FG;
|
||||
} else if ((context.getComponentState() & SynthConstants.DISABLED) != 0) {
|
||||
fg = DISABLED_FG;
|
||||
bg = DISABLED_BG;
|
||||
} else if ((context.getComponentState() & SynthConstants.MOUSE_OVER) != 0) {
|
||||
fg = DEFAULT_PRELIGHT_FG;
|
||||
bg = DEFAULT_PRELIGHT_FG;
|
||||
} else {
|
||||
fg = DEFAULT_NORMAL_FG;
|
||||
bg = DEFAULT_NORMAL_FG;
|
||||
}
|
||||
g2.setColor(fg[0]);
|
||||
Rectangle2D fgshape = new Rectangle2D.Float(x, y, w, h);
|
||||
g2.draw(fgshape);
|
||||
g2.setColor(bg[0]);
|
||||
Rectangle2D bgshape = new Rectangle2D.Float(x, y, w, h);
|
||||
g2.fill(bgshape);
|
||||
|
||||
/*g2.setPaint(new LinearGradientPaint(x, y, x, y + h,
|
||||
new float[]{0, 1}, bg));
|
||||
g2.fillRect(x, y, w, h);
|
||||
|
||||
g2.setPaint(new LinearGradientPaint(x, y, x, y + h,
|
||||
new float[]{0, 1}, fg));
|
||||
g2.drawRect(x, y, w, h);*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* $Id: MetroGraphicsUtils.java,v 1.9 2005/12/05 15:00:55 kizune Exp $
|
||||
*
|
||||
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
|
||||
* Santa Clara, California 95054, U.S.A. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel.painter;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
|
||||
|
||||
import javax.swing.plaf.synth.SynthContext;
|
||||
import javax.swing.plaf.synth.SynthPainter;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.LinearGradientPaint;
|
||||
|
||||
/**
|
||||
* ProgressPainter - Synth painter for Nimbus progressbars
|
||||
*
|
||||
* @author Created by Jasper Potts (Jan 3, 2007)
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ProgressPainter extends SynthPainter {
|
||||
|
||||
private static final float[] NORMAL_BG_PTS = new float[]{0, 1};
|
||||
private static final Color[] NORMAL_BG = new Color[]{
|
||||
GraphicsUtils.getWebColor("c6c6c6"),
|
||||
GraphicsUtils.getWebColor("c6c6c6")
|
||||
};
|
||||
private static final float[] BAR_FG_PTS = new float[]{0, 1};
|
||||
private static final Color[] BAR_FG = new Color[]{
|
||||
GraphicsUtils.getWebColor("41B1E1"),
|
||||
GraphicsUtils.getWebColor("41B1E1")
|
||||
};
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void paintProgressBarBackground(SynthContext context, Graphics g, int x, int y, int w, int h,
|
||||
int orientation) {
|
||||
Graphics2D g2 = (Graphics2D) g.create();
|
||||
g2.setPaint(new LinearGradientPaint(x, y + 2, x, y + h - 4, NORMAL_BG_PTS, NORMAL_BG));
|
||||
if (x + 2 < w - 5 && y + 2 < h - 5)
|
||||
g2.fillRect(x + 2, y + 2, w - 5, h - 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void paintProgressBarForeground(SynthContext context, Graphics g, int x, int y, int w, int h,
|
||||
int orientation) {
|
||||
Graphics2D g2 = (Graphics2D) g.create();
|
||||
g2.setPaint(new LinearGradientPaint(x, y + 2, x, y + h - 2, BAR_FG_PTS, BAR_FG));
|
||||
if (x + 2 < w - 5 && y + 2 < h - 5)
|
||||
g2.fillRect(x + 2, y + 2, w - 5, h - 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void paintProgressBarBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* $Id: NimbusGraphicsUtils.java,v 1.9 2005/12/05 15:00:55 kizune Exp $
|
||||
*
|
||||
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
|
||||
* Santa Clara, California 95054, U.S.A. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel.painter;
|
||||
|
||||
import javax.swing.plaf.synth.SynthContext;
|
||||
import javax.swing.plaf.synth.SynthPainter;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import javax.swing.plaf.synth.SynthConstants;
|
||||
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
|
||||
|
||||
/**
|
||||
* TextFieldPainter
|
||||
*
|
||||
* @author Created by Jasper Potts (Jan 4, 2007)
|
||||
* @version 1.0
|
||||
*/
|
||||
public class TextFieldPainter extends SynthPainter {
|
||||
|
||||
private boolean fill = true;
|
||||
|
||||
private static final Color DISABLED = GraphicsUtils.getWebColor("F3F3F3"),
|
||||
NORMAL = GraphicsUtils.getWebColor("CCCCCC"),
|
||||
FOCUSED = GraphicsUtils.getWebColor("000000"),
|
||||
OVER = GraphicsUtils.getWebColor("7F7F7F");
|
||||
|
||||
public TextFieldPainter() {
|
||||
}
|
||||
|
||||
public TextFieldPainter(boolean fill) {
|
||||
this.fill = fill;
|
||||
}
|
||||
|
||||
private void paintFieldBackground(SynthContext context, Graphics g, int x, int y, int w, int h) {
|
||||
w--;
|
||||
h--;
|
||||
if (fill) {
|
||||
g.setColor(Color.WHITE);
|
||||
g.fillRect(x, y, w, h);
|
||||
}
|
||||
Color color;
|
||||
if ((context.getComponentState() & SynthConstants.MOUSE_OVER) != 0)
|
||||
color = OVER;
|
||||
else if ((context.getComponentState() & SynthConstants.DISABLED) != 0)
|
||||
color = DISABLED;
|
||||
else if ((context.getComponentState() & SynthConstants.FOCUSED) != 0)
|
||||
color = FOCUSED;
|
||||
else
|
||||
color = NORMAL;
|
||||
g.setColor(color);
|
||||
g.drawLine(x, y, x + w, y);
|
||||
g.drawLine(x, y, x, y + w);
|
||||
g.drawLine(x + w, y, x + w, y + h);
|
||||
g.drawLine(x, y + h, x + w, y + h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintPasswordFieldBackground(SynthContext context, Graphics g, int x, int y, int w, int h) {
|
||||
paintFieldBackground(context, g, x, y, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintTextAreaBackground(SynthContext context, Graphics g, int x, int y, int w, int h) {
|
||||
paintFieldBackground(context, g, x, y, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintTextFieldBackground(SynthContext context, Graphics g, int x, int y, int w, int h) {
|
||||
paintFieldBackground(context, g, x, y, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintTextPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h) {
|
||||
paintFieldBackground(context, g, x, y, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintScrollPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h) {
|
||||
paintFieldBackground(context, g, x, y, w, h);
|
||||
}
|
||||
}
|
||||
280
HMCLaF/src/main/java/org/jackhuang/hellominecraft/lookandfeel/ui/ComboBoxUI.java
Executable file
@@ -0,0 +1,280 @@
|
||||
package org.jackhuang.hellominecraft.lookandfeel.ui;
|
||||
|
||||
import static org.jackhuang.hellominecraft.util.ui.GraphicsUtils.loadImage;
|
||||
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicComboBoxUI;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.ListCellRenderer;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Insets;
|
||||
import java.awt.LayoutManager;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Container;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
/**
|
||||
* NimbusComboBoxUI
|
||||
*
|
||||
* @author Created by Jasper Potts (Feb 1, 2007)
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ComboBoxUI extends BasicComboBoxUI implements MouseListener {
|
||||
|
||||
private static final BufferedImage COMBO_NORMAL = loadImage("combo_normal.png");
|
||||
private static final BufferedImage COMBO_OVER = loadImage("combo_over.png");
|
||||
private static final BufferedImage COMBO_PRESSED = loadImage("combo_pressed.png");
|
||||
private static final BufferedImage COMBO_DISABLED = loadImage("combo_disabled.png");
|
||||
private static final Dimension BTN_SIZE = new Dimension(17, 20);
|
||||
private final Dimension btnSize = new Dimension(BTN_SIZE);
|
||||
|
||||
/**
|
||||
* Creates a new UI deligate for the given component. It is a standard
|
||||
* method that all UI deligates must have.
|
||||
*
|
||||
* @param c The component that the UI is for
|
||||
*
|
||||
* @return a new instance of NimbusComboBoxUI
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent c) {
|
||||
return new ComboBoxUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installUI(JComponent c) {
|
||||
super.installUI(c);
|
||||
c.setOpaque(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void installListeners() {
|
||||
super.installListeners();
|
||||
comboBox.addMouseListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void uninstallListeners() {
|
||||
super.uninstallListeners();
|
||||
comboBox.removeMouseListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* The minumum size is the size of the display area plus insets plus the
|
||||
* button.
|
||||
*
|
||||
* @return the size yeah.
|
||||
*/
|
||||
@Override
|
||||
public Dimension getMinimumSize(JComponent c) {
|
||||
if (!isMinimumSizeDirty)
|
||||
return new Dimension(cachedMinimumSize);
|
||||
Dimension size = getDisplaySize();
|
||||
Insets insets = getInsets();
|
||||
btnSize.height = size.height = Math.max(size.height, BTN_SIZE.height);
|
||||
btnSize.width = (int) ((double) (BTN_SIZE.width / (double) BTN_SIZE.height) * btnSize.height);
|
||||
size.height += insets.top + insets.bottom;
|
||||
size.width += insets.left + insets.right + btnSize.width;
|
||||
|
||||
cachedMinimumSize.setSize(size.width, size.height);
|
||||
isMinimumSizeDirty = false;
|
||||
|
||||
return new Dimension(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JButton createArrowButton() {
|
||||
JButton button = new JButton() {
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
if (comboBox.isEditable()) {
|
||||
BufferedImage img = COMBO_NORMAL;
|
||||
if (mouseDown)
|
||||
img = COMBO_PRESSED;
|
||||
else if (!comboBox.isEnabled())
|
||||
img = COMBO_NORMAL;
|
||||
else if (mouseInside)
|
||||
img = COMBO_OVER;
|
||||
g.drawImage(img,
|
||||
0, 0, getWidth(), getHeight(),
|
||||
0, 0, img.getWidth(), img.getHeight(), comboBox);
|
||||
}
|
||||
}
|
||||
};
|
||||
button.addMouseListener(this);
|
||||
button.setMinimumSize(BTN_SIZE);
|
||||
button.setPreferredSize(BTN_SIZE);
|
||||
button.setMargin(new Insets(0, 0, 0, 0));
|
||||
return button;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g, JComponent c) {
|
||||
hasFocus = comboBox.hasFocus();
|
||||
ListCellRenderer renderer = comboBox.getRenderer();
|
||||
Rectangle r = new Rectangle(0, 0, comboBox.getWidth(), comboBox.getHeight());
|
||||
paintCurrentValueBackground(g, r, hasFocus);
|
||||
if (!comboBox.isEditable()) {
|
||||
if (renderer instanceof JComponent) {
|
||||
((JComponent) renderer).setOpaque(false);
|
||||
((JComponent) renderer).setForeground(comboBox.getForeground());
|
||||
}
|
||||
paintCurrentValue(g, rectangleForCurrentValue(), false);
|
||||
if (renderer instanceof JComponent)
|
||||
((JComponent) renderer).setOpaque(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus) {
|
||||
if (!comboBox.isEditable()) {
|
||||
BufferedImage img = COMBO_NORMAL;
|
||||
if (!comboBox.isEnabled())
|
||||
img = COMBO_DISABLED;
|
||||
else if (mouseDown)
|
||||
img = COMBO_PRESSED;
|
||||
else if (mouseInside)
|
||||
img = COMBO_OVER;
|
||||
g.drawImage(img,
|
||||
bounds.x, bounds.y, bounds.x + 4, bounds.y + bounds.height,
|
||||
0, 0, 1, 26, comboBox);
|
||||
g.drawImage(img,
|
||||
bounds.x + 1, bounds.y, bounds.x + bounds.width - 25, bounds.y + bounds.height,
|
||||
1, 0, 3, 26, comboBox);
|
||||
g.drawImage(img,
|
||||
bounds.x + bounds.width - 25, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height,
|
||||
4, 0, 29, 26, comboBox);
|
||||
} else {
|
||||
/*g.setColor(Color.WHITE);
|
||||
g.fillRect(bounds.x, bounds.y, bounds.width - btnSize.width, bounds.height - 1);
|
||||
int x = bounds.x, y = bounds.y, w = bounds.width - btnSize.width, h = bounds.height - 1;
|
||||
Insets insets = getInsets();
|
||||
g.setColor(new Color(141, 142, 143));
|
||||
g.drawLine(x, y, x + insets.left, y);
|
||||
g.setColor(new Color(203, 203, 204));
|
||||
g.drawLine(x + 1, y + 1, x + insets.left, y + 1);
|
||||
g.setColor(new Color(152, 152, 153));
|
||||
g.drawLine(x, y + 1, x, y + 1);
|
||||
g.setColor(new Color(242, 242, 242));
|
||||
g.drawLine(x + 1, y + 2, x + insets.left, y + 2);
|
||||
g.setColor(new Color(176, 176, 177));
|
||||
g.drawLine(x, y + 2, x, y + 2);
|
||||
g.setColor(new Color(192, 192, 193));
|
||||
g.drawLine(x, y + h, x + insets.left, y + h);
|
||||
g.setColor(new Color(184, 184, 185));
|
||||
g.drawLine(x, y + 3, x, y + h);*/
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LayoutManager createLayoutManager() {
|
||||
return new ComboLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Insets getInsets() {
|
||||
return new Insets(0, 5, 0, 0);
|
||||
}
|
||||
// =================================================================================================================
|
||||
// MouseListener Methods
|
||||
private boolean mouseInside = false;
|
||||
private boolean mouseDown = false;
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
if (comboBox.isEditable()) {
|
||||
if (e.getComponent() == arrowButton)
|
||||
mouseInside = true;
|
||||
} else {
|
||||
mouseInside = true;
|
||||
comboBox.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
if (comboBox.isEditable()) {
|
||||
if (e.getComponent() == arrowButton)
|
||||
mouseInside = false;
|
||||
} else {
|
||||
mouseInside = false;
|
||||
comboBox.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (comboBox.isEditable()) {
|
||||
if (e.getComponent() == arrowButton)
|
||||
mouseDown = true;
|
||||
} else {
|
||||
mouseDown = true;
|
||||
comboBox.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (comboBox.isEditable()) {
|
||||
if (e.getComponent() == arrowButton)
|
||||
mouseDown = false;
|
||||
} else {
|
||||
mouseDown = false;
|
||||
comboBox.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
// =================================================================================================================
|
||||
// LayoutManager
|
||||
private class ComboLayout implements LayoutManager {
|
||||
|
||||
@Override
|
||||
public void addLayoutComponent(String name, Component comp) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLayoutComponent(Component comp) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension preferredLayoutSize(Container parent) {
|
||||
return parent.getPreferredSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension minimumLayoutSize(Container parent) {
|
||||
return parent.getMinimumSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layoutContainer(Container parent) {
|
||||
JComboBox cb = (JComboBox) parent;
|
||||
int width = cb.getWidth();
|
||||
|
||||
Insets insets = getInsets();
|
||||
Rectangle cvb;
|
||||
|
||||
if (arrowButton != null)
|
||||
if (cb.getComponentOrientation().isLeftToRight())
|
||||
arrowButton.setBounds(width - (insets.right + btnSize.width),
|
||||
insets.top,
|
||||
btnSize.width, btnSize.height);
|
||||
else
|
||||
arrowButton.setBounds(insets.left, insets.top,
|
||||
btnSize.width, btnSize.height);
|
||||
if (editor != null) {
|
||||
cvb = rectangleForCurrentValue();
|
||||
editor.setBounds(cvb.x, cvb.y, cvb.width, cvb.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* $Id: NimbusGraphicsUtils.java,v 1.9 2005/12/05 15:00:55 kizune Exp $
|
||||
*
|
||||
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
|
||||
* Santa Clara, California 95054, U.S.A. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel.ui;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.JList;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
|
||||
/**
|
||||
* NimbusListCellRender
|
||||
*
|
||||
* @author Created by Jasper Potts (Jan 19, 2007)
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ListCellRender extends DefaultListCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
|
||||
boolean cellHasFocus) {
|
||||
setOpaque(true);
|
||||
setBackground(Color.magenta);
|
||||
return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel.ui;
|
||||
|
||||
import static org.jackhuang.hellominecraft.util.ui.GraphicsUtils.loadImage;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JScrollBar;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.metal.MetalScrollBarUI;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
/**
|
||||
* NimbusScrollBarUI - A custom scrollbar ui for nimbus. It is special as it handles all the painting for the buttons as
|
||||
* well so that it can cope with the buttons being non-recangular.
|
||||
*
|
||||
* @author Created by Jasper Potts (Jan 17, 2007)
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ScrollBarUI extends MetalScrollBarUI {
|
||||
|
||||
private static final BufferedImage BACKGROUND_ENABLED = loadImage("scroll_enabled.png");
|
||||
private static final BufferedImage BACKGROUND_DISABLED = loadImage("scroll_disabled.png");
|
||||
private static final BufferedImage SCROLL_DEC_NORMAL = loadImage("scroll_dec_normal.png");
|
||||
private static final BufferedImage SCROLL_DEC_OVER = loadImage("scroll_dec_over.png");
|
||||
private static final BufferedImage SCROLL_DEC_PRESSED = loadImage("scroll_dec_pressed.png");
|
||||
private static final BufferedImage SCROLL_INC_NORMAL = loadImage("scroll_inc_normal.png");
|
||||
private static final BufferedImage SCROLL_INC_OVER = loadImage("scroll_inc_over.png");
|
||||
private static final BufferedImage SCROLL_INC_PRESSED = loadImage("scroll_inc_pressed.png");
|
||||
private static final BufferedImage SCROLL_THUMB_NORMAL = loadImage("scroll_thumb_normal.png");
|
||||
private static final BufferedImage SCROLL_THUMB_OVER = loadImage("scroll_thumb_over.png");
|
||||
private static final BufferedImage SCROLL_THUMB_PRESSED = loadImage("scroll_thumb_pressed.png");
|
||||
|
||||
private boolean incBtnMouseOver, incBtnMousePressed;
|
||||
private boolean decBtnMouseOver, decBtnMousePressed;
|
||||
private boolean thumbMousePressed;
|
||||
|
||||
/**
|
||||
* Creates a new UI deligate for the given component. It is a standard method that all UI deligates must have.
|
||||
*
|
||||
* @param c The component that the UI is for
|
||||
* @return a new instance of NimbusScrollBarUI
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent c) {
|
||||
return new ScrollBarUI();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override public void installUI(JComponent c) {
|
||||
super.installUI(c);
|
||||
c.setOpaque(true);
|
||||
c.addMouseListener(new MouseAdapter() {
|
||||
@Override public void mousePressed(MouseEvent e) {
|
||||
if (isThumbRollover()) {
|
||||
thumbMousePressed = true;
|
||||
scrollbar.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void mouseReleased(MouseEvent e) {
|
||||
thumbMousePressed = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override protected Dimension getMinimumThumbSize() {
|
||||
return new Dimension(15, 15);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override protected JButton createDecreaseButton(int orientation) {
|
||||
decreaseButton = new ScrollButton(orientation, scrollBarWidth, isFreeStanding);
|
||||
decreaseButton.addMouseListener(new MouseAdapter() {
|
||||
@Override public void mouseEntered(MouseEvent e) {
|
||||
decBtnMouseOver = true;
|
||||
}
|
||||
|
||||
@Override public void mouseExited(MouseEvent e) {
|
||||
decBtnMouseOver = false;
|
||||
}
|
||||
|
||||
@Override public void mousePressed(MouseEvent e) {
|
||||
decBtnMousePressed = true;
|
||||
}
|
||||
|
||||
@Override public void mouseReleased(MouseEvent e) {
|
||||
decBtnMousePressed = false;
|
||||
}
|
||||
});
|
||||
return decreaseButton;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override protected JButton createIncreaseButton(int orientation) {
|
||||
increaseButton = new ScrollButton(orientation, scrollBarWidth, isFreeStanding);
|
||||
increaseButton.addMouseListener(new MouseAdapter() {
|
||||
@Override public void mouseEntered(MouseEvent e) {
|
||||
incBtnMouseOver = true;
|
||||
}
|
||||
|
||||
@Override public void mouseExited(MouseEvent e) {
|
||||
incBtnMouseOver = false;
|
||||
}
|
||||
|
||||
@Override public void mousePressed(MouseEvent e) {
|
||||
incBtnMousePressed = true;
|
||||
}
|
||||
|
||||
@Override public void mouseReleased(MouseEvent e) {
|
||||
incBtnMousePressed = false;
|
||||
}
|
||||
});
|
||||
return increaseButton;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds) {
|
||||
BufferedImage decImg =
|
||||
decBtnMousePressed ? SCROLL_DEC_PRESSED : decBtnMouseOver ? SCROLL_DEC_OVER : SCROLL_DEC_NORMAL;
|
||||
BufferedImage incImg =
|
||||
incBtnMousePressed ? SCROLL_INC_PRESSED : incBtnMouseOver ? SCROLL_INC_OVER : SCROLL_INC_NORMAL;
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
AffineTransform origTransform = g2.getTransform();
|
||||
int scrollWidth = scrollbar.getWidth();
|
||||
if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
|
||||
scrollWidth = scrollbar.getHeight();
|
||||
g2.scale(1, -1);
|
||||
g2.rotate(-Math.PI / 2, 0, 0);
|
||||
}
|
||||
// draw track & bottons
|
||||
if (scrollbar.isEnabled()) {
|
||||
g.drawImage(decImg, 0, 0, scrollbar);
|
||||
//g.drawImage(BACKGROUND_ENABLED, 15, 0, scrollWidth - 15, 15, 0, 0, 1, 15, scrollbar);
|
||||
g.drawImage(incImg, scrollWidth - 15, 0, scrollbar);
|
||||
} else {
|
||||
//g.drawImage(BACKGROUND_DISABLED, 0, 0, scrollWidth, 15, 0, 0, 1, 15, scrollbar);
|
||||
}
|
||||
// undo any transform
|
||||
g2.setTransform(origTransform);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {
|
||||
if (scrollbar.isEnabled()) {
|
||||
BufferedImage thumbImg = thumbMousePressed ? SCROLL_THUMB_PRESSED :
|
||||
isThumbRollover() ? SCROLL_THUMB_OVER : SCROLL_THUMB_NORMAL;
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
AffineTransform origTransform = g2.getTransform();
|
||||
Rectangle b = thumbBounds;
|
||||
if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
|
||||
b = new Rectangle(thumbBounds.y, thumbBounds.x, thumbBounds.height, thumbBounds.width);
|
||||
g2.scale(1, -1);
|
||||
g2.rotate(-Math.PI / 2, 0, 0);
|
||||
}
|
||||
g.drawImage(thumbImg,
|
||||
b.x, b.y, b.x + 14, b.y + 15,
|
||||
0, 0, 14, 15, scrollbar);
|
||||
g.drawImage(thumbImg,
|
||||
b.x + 14, b.y, b.x + b.width - 14, b.y + 15,
|
||||
16, 0, 17, 15, scrollbar);
|
||||
g.drawImage(thumbImg,
|
||||
b.x + b.width - 14, b.y, b.x + b.width, b.y + 15,
|
||||
24, 0, 38, 15, scrollbar);
|
||||
// undo any transform
|
||||
g2.setTransform(origTransform);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* $Id: NimbusGraphicsUtils.java,v 1.9 2005/12/05 15:00:55 kizune Exp $
|
||||
*
|
||||
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
|
||||
* Santa Clara, California 95054, U.S.A. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.lookandfeel.ui;
|
||||
|
||||
import static javax.swing.SwingConstants.NORTH;
|
||||
import static javax.swing.SwingConstants.SOUTH;
|
||||
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.plaf.metal.MetalScrollButton;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
|
||||
/**
|
||||
* NimbusScrollButton - a fixed size 15x17 vertical 17x15 horizontal transparent
|
||||
* button.
|
||||
*
|
||||
* @author Created by Jasper Potts (Jan 17, 2007)
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ScrollButton extends MetalScrollButton implements SwingConstants {
|
||||
|
||||
private final int btnWidth, btnHeight;
|
||||
|
||||
ScrollButton(int direction, int width, boolean freeStanding) {
|
||||
super(direction, width, freeStanding);
|
||||
setOpaque(false);
|
||||
if (direction == NORTH || direction == SOUTH) {
|
||||
btnWidth = 15;
|
||||
btnHeight = 17;
|
||||
} else {
|
||||
btnWidth = 17;
|
||||
btnHeight = 15;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
return this.getPreferredSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return this.getPreferredSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return new Dimension(btnWidth, btnHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void repaint(long tm, int x, int y, int width, int height) {
|
||||
if (getParent() != null) getParent().repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't paint anything as all painting is done by the scrollbar
|
||||
*
|
||||
* @param g {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 141 B |
|
After Width: | Height: | Size: 141 B |
|
After Width: | Height: | Size: 141 B |
|
After Width: | Height: | Size: 143 B |
|
After Width: | Height: | Size: 436 B |
|
After Width: | Height: | Size: 324 B |
|
After Width: | Height: | Size: 415 B |
|
After Width: | Height: | Size: 327 B |
|
After Width: | Height: | Size: 224 B |
|
After Width: | Height: | Size: 241 B |
|
After Width: | Height: | Size: 230 B |
|
After Width: | Height: | Size: 273 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 433 B |
|
After Width: | Height: | Size: 457 B |
|
After Width: | Height: | Size: 590 B |
|
After Width: | Height: | Size: 491 B |
|
After Width: | Height: | Size: 534 B |
|
After Width: | Height: | Size: 578 B |
|
After Width: | Height: | Size: 632 B |
|
After Width: | Height: | Size: 664 B |
|
After Width: | Height: | Size: 243 B |
|
After Width: | Height: | Size: 241 B |
|
After Width: | Height: | Size: 243 B |
|
After Width: | Height: | Size: 147 B |
|
After Width: | Height: | Size: 151 B |
|
After Width: | Height: | Size: 252 B |
|
After Width: | Height: | Size: 236 B |
|
After Width: | Height: | Size: 252 B |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 365 B |
|
After Width: | Height: | Size: 93 B |
|
After Width: | Height: | Size: 95 B |
|
After Width: | Height: | Size: 381 B |
|
After Width: | Height: | Size: 365 B |
446
HMCLaF/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth.xml
Executable file
@@ -0,0 +1,446 @@
|
||||
<!--
|
||||
Copyright 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program.
|
||||
-->
|
||||
<synth>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- TOP LEVEL CONTAINERS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="default">
|
||||
<state>
|
||||
<color value="#000000" type="FOREGROUND"/>
|
||||
<color value="#9CC5D8" type="TEXT_BACKGROUND"/>
|
||||
<font name="微软雅黑" size="12" />
|
||||
</state>
|
||||
<object id="GraphicsUtils" class="org.jackhuang.hellominecraft.util.ui.GraphicsUtils"/>
|
||||
<graphicsUtils idref="GraphicsUtils"/>
|
||||
</style>
|
||||
<bind style="default" type="region" key=".*"/>
|
||||
|
||||
<style id="RootPane">
|
||||
<state>
|
||||
<color value="#ffffff" type="BACKGROUND"/>
|
||||
<opaque value="true"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="RootPane" type="region" key="RootPane"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- SCROLL BARS & VIEW PORT -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<defaultsProperty key="ScrollBarUI" type="string" value="org.jackhuang.hellominecraft.lookandfeel.ui.ScrollBarUI"/>
|
||||
<defaultsProperty key="ScrollBar.width" type="integer" value="15"/>
|
||||
<defaultsProperty key="ScrollBar.minimumThumbSize" type="dimension" value="29 29"/>
|
||||
<defaultsProperty key="ScrollBar.maximumThumbSize" type="dimension" value="1000 1000"/>
|
||||
|
||||
<style id="Viewport">
|
||||
<insets top="0" left="0" bottom="0" right="0"/>
|
||||
</style>
|
||||
<bind style="Viewport" type="region" key="Viewport"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- BUTTONS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="button">
|
||||
<object id="ButtonPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.ButtonPainter"/>
|
||||
<painter idref="ButtonPainter"/>
|
||||
<state value="DISABLED">
|
||||
<color value="#ACAEB2" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="DEFAULT AND PRESSED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<property key="Button.margin" type="insets" value="4 12 5 12"/>
|
||||
</style>
|
||||
<bind style="button" type="region" key="Button"/>
|
||||
<style id="togglebutton">
|
||||
<object id="ButtonPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.ButtonPainter"/>
|
||||
<painter idref="ButtonPainter"/>
|
||||
<state value="DISABLED">
|
||||
<color value="#ACAEB2" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="PRESSED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<property key="ToggleButton.margin" type="insets" value="4 12 5 12"/>
|
||||
</style>
|
||||
<bind style="togglebutton" type="region" key="ToggleButton"/>
|
||||
|
||||
<style id="checkbox">
|
||||
<insets top="1" left="1" bottom="1" right="1"/>
|
||||
<imageIcon id="check_off" path="images/checkbox_off.png"/>
|
||||
<imageIcon id="check_off_over" path="images/checkbox_off_over.png"/>
|
||||
<imageIcon id="check_off_pressed" path="images/checkbox_off_pressed.png"/>
|
||||
<imageIcon id="check_off_disabled" path="images/checkbox_off_disabled.png"/>
|
||||
<imageIcon id="check_on" path="images/checkbox_on.png"/>
|
||||
<imageIcon id="check_on_over" path="images/checkbox_on_over.png"/>
|
||||
<imageIcon id="check_on_pressed" path="images/checkbox_on_pressed.png"/>
|
||||
<imageIcon id="check_on_disabled" path="images/checkbox_on_disabled.png"/>
|
||||
<property key="CheckBox.icon" value="check_off"/>
|
||||
<state value="DISABLED and SELECTED">
|
||||
<property key="CheckBox.icon" value="check_on_disabled"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<property key="CheckBox.icon" value="check_off_disabled"/>
|
||||
</state>
|
||||
<state value="PRESSED">
|
||||
<property key="CheckBox.icon" value="check_off_pressed"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<property key="CheckBox.icon" value="check_off_over"/>
|
||||
</state>
|
||||
<state value="SELECTED and PRESSED">
|
||||
<property key="CheckBox.icon" value="check_on_pressed"/>
|
||||
</state>
|
||||
<state value="SELECTED and MOUSE_OVER">
|
||||
<property key="CheckBox.icon" value="check_on_over"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<property key="CheckBox.icon" value="check_on"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="checkbox" type="region" key="Checkbox"/>
|
||||
|
||||
<style id="radiobutton">
|
||||
<insets top="2" left="2" bottom="2" right="2"/>
|
||||
<imageIcon id="radio_off" path="images/radio_btn.png"/>
|
||||
<imageIcon id="radio_off_over" path="images/radio_btn_over.png"/>
|
||||
<imageIcon id="radio_off_pressed" path="images/radio_btn_pressed.png"/>
|
||||
<imageIcon id="radio_off_disabled" path="images/radio_btn_disabled_normal.png"/>
|
||||
<imageIcon id="radio_on" path="images/radio_btn_selected.png"/>
|
||||
<imageIcon id="radio_on_over" path="images/radio_btn_selected_over.png"/>
|
||||
<imageIcon id="radio_on_pressed" path="images/radio_btn_selected_pressed.png"/>
|
||||
<imageIcon id="radio_on_disabled" path="images/radio_btn_disabled_selected.png"/>
|
||||
<property key="RadioButton.icon" value="radio_off"/>
|
||||
<state value="DISABLED and SELECTED">
|
||||
<property key="RadioButton.icon" value="radio_on_disabled"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<property key="RadioButton.icon" value="radio_off_disabled"/>
|
||||
</state>
|
||||
<state value="PRESSED">
|
||||
<property key="RadioButton.icon" value="radio_off_pressed"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<property key="RadioButton.icon" value="radio_off_over"/>
|
||||
</state>
|
||||
<state value="SELECTED and PRESSED">
|
||||
<property key="RadioButton.icon" value="radio_on_pressed"/>
|
||||
</state>
|
||||
<state value="SELECTED and MOUSE_OVER">
|
||||
<property key="RadioButton.icon" value="radio_on_over"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<property key="RadioButton.icon" value="radio_on"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="radiobutton" type="region" key="RadioButton"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- TEXT FIELDS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="textfield">
|
||||
<object id="TextFieldPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.TextFieldPainter"/>
|
||||
<painter idref="TextFieldPainter"/>
|
||||
<state>
|
||||
<font name="微软雅黑" size="12" />
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<insets top="4" left="6" bottom="4" right="6"/>
|
||||
</style>
|
||||
<bind style="textfield" type="region" key="TextField"/>
|
||||
<bind style="textfield" type="region" key="TextArea"/>
|
||||
<bind style="textfield" type="region" key="PasswordField"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- SCROLL PANE -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="scrollpane">
|
||||
<object id="TextFieldPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.TextFieldPainter"/>
|
||||
<painter idref="TextFieldPainter"/>
|
||||
<insets top="4" left="6" bottom="4" right="6"/>
|
||||
</style>
|
||||
<bind style="scrollpane" type="region" key="ScrollPane"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- MENUS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="MenuBar">
|
||||
<insets top="2" left="6" bottom="2" right="6"/>
|
||||
</style>
|
||||
<bind style="MenuBar" type="region" key="MenuBar"/>
|
||||
|
||||
<style id="Menu">
|
||||
<insets top="2" left="2" bottom="3" right="2"/>
|
||||
<state>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="Menu" type="region" key="Menu"/>
|
||||
|
||||
<style id="MenuItem">
|
||||
<insets top="2" left="2" bottom="3" right="2"/>
|
||||
<opaque value="true"/>
|
||||
<state>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
<color value="#D8D8D9" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#C2E6F6" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#E85D00" type="BACKGROUND"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="MenuItem" type="region" key="MenuItem"/>
|
||||
|
||||
<style id="PopupMenuSeparator">
|
||||
<insets top="2" left="0" bottom="2" right="0"/>
|
||||
</style>
|
||||
<bind style="PopupMenuSeparator" type="region" key="PopupMenuSeparator"/>
|
||||
|
||||
<style id="PopupMenu">
|
||||
<insets top="6" left="1" bottom="6" right="1"/>
|
||||
</style>
|
||||
<bind style="PopupMenu" type="region" key="PopupMenu"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- PROGRESS BARS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="progress">
|
||||
<object id="ProgressPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.ProgressPainter" />
|
||||
<painter idref="ProgressPainter"/>
|
||||
<property key="ProgressBar.horizontalSize" type="dimension" value="50 20"/>
|
||||
<property key="ProgressBar.vertictalSize" type="dimension" value="20 50"/>
|
||||
</style>
|
||||
<bind style="progress" type="region" key="ProgressBar"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- TABBED PANE -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="TabbedPaneTab">
|
||||
<insets top="4" left="8" right="8" bottom="4"/>
|
||||
<state>
|
||||
<font name="微软雅黑" size="14" />
|
||||
<color type="TEXT_FOREGROUND" value="#000000" /> <!-- #000000 -->
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color type="TEXT_FOREGROUND" value="${Customized.TabbedPaneTab.selected_foreground}" /> <!-- #106CA3 -->
|
||||
</state>
|
||||
</style>
|
||||
<bind style="TabbedPaneTab" type="region" key="TabbedPaneTab"/>
|
||||
<style id="TabbedPaneTabArea">
|
||||
<insets top="3" left="10" right="10" bottom="5"/>
|
||||
</style>
|
||||
<bind style="TabbedPaneTabArea" type="region" key="TabbedPaneTabArea"/>
|
||||
|
||||
<int id="TabbedPane.selectedLabelShift">0</int>
|
||||
<int id="TabbedPane.labelShift">0</int>
|
||||
<boolean id="TabbedPane.nudgeSelectedLabel">false</boolean>
|
||||
<defaultsProperty key="TabbedPane.selectedLabelShift" type="idref" value="TabbedPane.selectedLabelShift" />
|
||||
<defaultsProperty key="TabbedPane.labelShift" type="idref" value="TabbedPane.labelShift" />
|
||||
<defaultsProperty key="TabbedPane.nudgeSelectedLabel" type="idref" value="TabbedPane.nudgeSelectedLabel" />
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- COMBO BOX -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<color id = "ComboBox.background" value="#EDEFF2" />
|
||||
<defaultsProperty key="ComboBox.background" type="idref" value="ComboBox.background"/>
|
||||
<color id = "ComboBox.selectionForeground" value="#000000" />
|
||||
<defaultsProperty key="ComboBox.selectionForeground" type="idref" value="ComboBox.selectionForeground"/>
|
||||
<color id = "ComboBox.selectionBackground" value="${Customized.ComboBox.selected_background}" /> <!-- #A0D8F0 -->
|
||||
<defaultsProperty key="ComboBox.selectionBackground" type="idref" value="ComboBox.selectionBackground"/>
|
||||
<color id = "ComboBox.foreground" value="#232324" />
|
||||
<defaultsProperty key="ComboBox.foreground" type="idref" value="ComboBox.foreground"/>
|
||||
|
||||
<style id="Combo listRenderer">
|
||||
<insets top="2" left="2" bottom="3" right="2"/>
|
||||
<opaque value="true"/>
|
||||
<state value="DISABLED">
|
||||
<color value="#EDEFF2" type="BACKGROUND"/>
|
||||
<color value="#8E8F91" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="ENABLED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#A0D8F0" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color type="BACKGROUND" value="#A0D8F0" />
|
||||
<color type="TEXT_FOREGROUND" value="#70C5E9" />
|
||||
</state>
|
||||
</style>
|
||||
<!--bind style="combobox" type="region" key="ComboBox" /-->
|
||||
<bind style="Combo listRenderer" type="name" key="ComboBox.listRenderer"/>
|
||||
|
||||
<defaultsProperty key="ComboBoxUI" type="string" value="org.jackhuang.hellominecraft.lookandfeel.ui.ComboBoxUI"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- LIST -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="List">
|
||||
<state>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#E85D00" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<color value="#C1C1C1" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#A0D8F0" type="BACKGROUND"/>
|
||||
</state>
|
||||
<property key="List.rendererUseListColors" type="boolean" value="false"/>
|
||||
</style>
|
||||
<bind style="List" type="region" key="List" />
|
||||
<style id="List listRenderer">
|
||||
<insets top="2" left="2" bottom="3" right="2"/>
|
||||
<opaque value="true"/>
|
||||
<state>
|
||||
<color value="#232324" type="TEXT_FOREGROUND"/>
|
||||
<color value="#EDEFF2" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<color value="#EDEFF2" type="BACKGROUND"/>
|
||||
<color value="#8E8F91" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<color value="#FFFFFF" type="TEXT_FOREGROUND"/>
|
||||
<color value="#3A698A" type="BACKGROUND"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="List listRenderer" type="name" key="List.listRenderer"/>
|
||||
|
||||
|
||||
<color id="List.background" value="#EDEFF2" />
|
||||
<defaultsProperty key="List.background" type="idref" value="List.background"/>
|
||||
<color id="List.selectionForeground" value="#FFFFFF" />
|
||||
<defaultsProperty key="List.selectionForeground" type="idref" value="List.selectionForeground"/>
|
||||
<color id="ListSelectionBackground" value="#0000FF" />
|
||||
<defaultsProperty key="List.selectionBackground" type="idref" value="ListSelectionBackground"/>
|
||||
<color id="List.foreground" value="#232324" />
|
||||
<defaultsProperty key="List.foreground" type="idref" value="List.foreground"/>
|
||||
|
||||
<defaultsProperty key="List.rendererUseListColors" type="boolean" value="false"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- OPTION PANE -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="OptionPane">
|
||||
<imageIcon id="infoIcon" path="images/option_pane_info.png"/>
|
||||
<property key="OptionPane.informationIcon" value="infoIcon"/>
|
||||
<imageIcon id="errorIcon" path="images/option_pane_error.png"/>
|
||||
<property key="OptionPane.errorIcon" value="errorIcon"/>
|
||||
<imageIcon id="warningIcon" path="images/option_pane_warning.png"/>
|
||||
<property key="OptionPane.warningIcon" value="warningIcon"/>
|
||||
<imageIcon id="questionIcon" path="images/option_pane_question.png"/>
|
||||
<property key="OptionPane.questionIcon" value="questionIcon"/>
|
||||
<property key="OptionPane.buttonOrientation" type="integer" value="4"/>
|
||||
<property key="OptionPane.isYesLast" type="boolean" value="false"/>
|
||||
</style>
|
||||
<bind style="OptionPane" type="region" key="OptionPane"/>
|
||||
|
||||
<style id="table">
|
||||
<color id="color" value="#FF0000" />
|
||||
<color id="gridColor" value="#1E7B87" />
|
||||
<defaultsProperty key="Table.gridColor" type="idref" value="gridColor"/>
|
||||
<defaultsProperty key="Table.background" type="idref" value="gridColor"/>
|
||||
<defaultsProperty key="TabbedPane.selectedLabelShift" type="integer" value="0"/>
|
||||
</style>
|
||||
<bind style="table" type="region" key="Table"/>
|
||||
<style id="defaultBackground">
|
||||
<state>
|
||||
<color value="#F1F2F2" type="BACKGROUND"></color>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"></color>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="defaultBackground" type="region" key="Table.*"/>
|
||||
|
||||
<!-- TREE-->
|
||||
<style id="tree">
|
||||
|
||||
<defaultsProperty key="Tree.leftChildIndent" type="integer" value="7"/>
|
||||
<defaultsProperty key="Tree.rightChildIndent" type="integer" value="4"/>
|
||||
<defaultsProperty key="Tree.rowHeight" type="integer" value="20"/>
|
||||
<property key="Tree.leftChildIndent" type="integer" value="7"/>
|
||||
<property key="Tree.rightChildIndent" type="integer" value="4"/>
|
||||
<property key="Tree.rowHeight" type="integer" value="20"/>
|
||||
|
||||
<defaultsProperty key="Tree.scrollsHorizontallyAndVertically" type="boolean" value="true"/>
|
||||
<defaultsProperty key="Tree.rendererUseTreeColors" type="boolean" value="true"/>
|
||||
<property key="Tree.rendererUseTreeColors" type="boolean" value="true"/>
|
||||
|
||||
<property key="Tree.scrollsHorizontallyAndVertically" type="boolean" value="true"/>
|
||||
<property key="Tree.drawHorizontalLines" type="boolean" value="false"/>
|
||||
<property key="Tree.drawVerticalLines" type="boolean" value="false"/>
|
||||
<property key="Tree.repaintWholeRow" type="boolean" value="true"/>
|
||||
|
||||
<color id="Tree.dropLineColor" value="#000000"/>
|
||||
|
||||
<imageIcon id="treeClosedIcon" path="images/tree_closed.gif" />
|
||||
<imageIcon id="treeOpenIcon" path="images/tree_open.gif" />
|
||||
<imageIcon id="treecollapsedicon" path="images/tree_collapsed.gif"/>
|
||||
<imageIcon id="treeexpandedicon" path="images/tree_expanded.gif"/>
|
||||
<imageIcon id="treeleaficon" path="images/tree_leaf.gif"/>
|
||||
|
||||
<property key="Tree.collapsedIcon" value="treecollapsedicon"/>
|
||||
<property key="Tree.expandedIcon" value="treeexpandedicon"/>
|
||||
|
||||
<defaultsProperty key="Tree.openIcon" value="treeOpenIcon"/>
|
||||
<defaultsProperty key="Tree.closedIcon" value="treeClosedIcon"/>
|
||||
<defaultsProperty key="Tree.leafIcon" value="treeleaficon"/>
|
||||
|
||||
<insets top="3" left="8" bottom="3" right="8"/>
|
||||
</style>
|
||||
<bind style="tree" type="region" key="Tree"/>
|
||||
|
||||
<style id="treecell" >
|
||||
<opaque value="false"/>
|
||||
|
||||
<state>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color value="#EEEEEE" type="BACKGROUND"/>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="treecell" type="region" key="TreeCell"/>
|
||||
</synth>
|
||||
@@ -0,0 +1,437 @@
|
||||
<!--
|
||||
Copyright 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program.
|
||||
-->
|
||||
<synth>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- TOP LEVEL CONTAINERS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="default">
|
||||
<state>
|
||||
<color value="#000000" type="FOREGROUND"/>
|
||||
<color value="#9CC5D8" type="TEXT_BACKGROUND"/>
|
||||
<font name="微软雅黑" size="12" />
|
||||
</state>
|
||||
<object id="GraphicsUtils" class="org.jackhuang.hellominecraft.util.ui.GraphicsUtils"/>
|
||||
<graphicsUtils idref="GraphicsUtils"/>
|
||||
</style>
|
||||
<bind style="default" type="region" key=".*"/>
|
||||
|
||||
<style id="RootPane">
|
||||
<state>
|
||||
<color value="#ffffff" type="BACKGROUND"/>
|
||||
<opaque value="true"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="RootPane" type="region" key="RootPane"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- SCROLL BARS & VIEW PORT -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<defaultsProperty key="ScrollBarUI" type="string" value="org.jackhuang.hellominecraft.lookandfeel.ui.ScrollBarUI"/>
|
||||
<defaultsProperty key="ScrollBar.width" type="integer" value="15"/>
|
||||
<defaultsProperty key="ScrollBar.minimumThumbSize" type="dimension" value="29 29"/>
|
||||
<defaultsProperty key="ScrollBar.maximumThumbSize" type="dimension" value="1000 1000"/>
|
||||
|
||||
<style id="Viewport">
|
||||
<insets top="0" left="0" bottom="0" right="0"/>
|
||||
</style>
|
||||
<bind style="Viewport" type="region" key="Viewport"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- BUTTONS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="button">
|
||||
<object id="ButtonPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.ButtonPainter"/>
|
||||
<painter idref="ButtonPainter"/>
|
||||
<state value="DISABLED">
|
||||
<color value="#ACAEB2" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="DEFAULT AND PRESSED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<property key="Button.margin" type="insets" value="4 12 5 12"/>
|
||||
</style>
|
||||
<bind style="button" type="region" key="Button"/>
|
||||
<style id="togglebutton">
|
||||
<object id="ButtonPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.ButtonPainter"/>
|
||||
<painter idref="ButtonPainter"/>
|
||||
<state value="DISABLED">
|
||||
<color value="#ACAEB2" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="PRESSED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<property key="ToggleButton.margin" type="insets" value="4 12 5 12"/>
|
||||
</style>
|
||||
<bind style="togglebutton" type="region" key="ToggleButton"/>
|
||||
|
||||
<style id="checkbox">
|
||||
<insets top="1" left="1" bottom="1" right="1"/>
|
||||
<imageIcon id="check_off" path="images/checkbox_off.png"/>
|
||||
<imageIcon id="check_off_over" path="images/checkbox_off_over.png"/>
|
||||
<imageIcon id="check_off_pressed" path="images/checkbox_off_pressed.png"/>
|
||||
<imageIcon id="check_off_disabled" path="images/checkbox_off_disabled.png"/>
|
||||
<imageIcon id="check_on" path="images/checkbox_on.png"/>
|
||||
<imageIcon id="check_on_over" path="images/checkbox_on_over.png"/>
|
||||
<imageIcon id="check_on_pressed" path="images/checkbox_on_pressed.png"/>
|
||||
<imageIcon id="check_on_disabled" path="images/checkbox_on_disabled.png"/>
|
||||
<property key="CheckBox.icon" value="check_off"/>
|
||||
<state value="DISABLED and SELECTED">
|
||||
<property key="CheckBox.icon" value="check_on_disabled"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<property key="CheckBox.icon" value="check_off_disabled"/>
|
||||
</state>
|
||||
<state value="PRESSED">
|
||||
<property key="CheckBox.icon" value="check_off_pressed"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<property key="CheckBox.icon" value="check_off_over"/>
|
||||
</state>
|
||||
<state value="SELECTED and PRESSED">
|
||||
<property key="CheckBox.icon" value="check_on_pressed"/>
|
||||
</state>
|
||||
<state value="SELECTED and MOUSE_OVER">
|
||||
<property key="CheckBox.icon" value="check_on_over"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<property key="CheckBox.icon" value="check_on"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="checkbox" type="region" key="Checkbox"/>
|
||||
|
||||
<style id="radiobutton">
|
||||
<insets top="2" left="2" bottom="2" right="2"/>
|
||||
<imageIcon id="radio_off" path="images/radio_btn.png"/>
|
||||
<imageIcon id="radio_off_over" path="images/radio_btn_over.png"/>
|
||||
<imageIcon id="radio_off_pressed" path="images/radio_btn_pressed.png"/>
|
||||
<imageIcon id="radio_off_disabled" path="images/radio_btn_disabled_normal.png"/>
|
||||
<imageIcon id="radio_on" path="images/radio_btn_selected.png"/>
|
||||
<imageIcon id="radio_on_over" path="images/radio_btn_selected_over.png"/>
|
||||
<imageIcon id="radio_on_pressed" path="images/radio_btn_selected_pressed.png"/>
|
||||
<imageIcon id="radio_on_disabled" path="images/radio_btn_disabled_selected.png"/>
|
||||
<property key="RadioButton.icon" value="radio_off"/>
|
||||
<state value="DISABLED and SELECTED">
|
||||
<property key="RadioButton.icon" value="radio_on_disabled"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<property key="RadioButton.icon" value="radio_off_disabled"/>
|
||||
</state>
|
||||
<state value="PRESSED">
|
||||
<property key="RadioButton.icon" value="radio_off_pressed"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<property key="RadioButton.icon" value="radio_off_over"/>
|
||||
</state>
|
||||
<state value="SELECTED and PRESSED">
|
||||
<property key="RadioButton.icon" value="radio_on_pressed"/>
|
||||
</state>
|
||||
<state value="SELECTED and MOUSE_OVER">
|
||||
<property key="RadioButton.icon" value="radio_on_over"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<property key="RadioButton.icon" value="radio_on"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="radiobutton" type="region" key="RadioButton"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- TEXT FIELDS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="textfield">
|
||||
<object id="TextFieldPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.TextFieldPainter"/>
|
||||
<painter idref="TextFieldPainter"/>
|
||||
<state>
|
||||
<font name="微软雅黑" size="12" />
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<insets top="4" left="6" bottom="4" right="6"/>
|
||||
</style>
|
||||
<bind style="textfield" type="region" key="TextField"/>
|
||||
<bind style="textfield" type="region" key="TextArea"/>
|
||||
<bind style="textfield" type="region" key="PasswordField"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- SCROLL PANE -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="scrollpane">
|
||||
<object id="TextFieldPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.TextFieldPainter"/>
|
||||
<painter idref="TextFieldPainter"/>
|
||||
<insets top="4" left="6" bottom="4" right="6"/>
|
||||
</style>
|
||||
<bind style="scrollpane" type="region" key="ScrollPane"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- MENUS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="MenuBar">
|
||||
<insets top="2" left="6" bottom="2" right="6"/>
|
||||
</style>
|
||||
<bind style="MenuBar" type="region" key="MenuBar"/>
|
||||
|
||||
<style id="Menu">
|
||||
<insets top="2" left="2" bottom="3" right="2"/>
|
||||
<state>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="Menu" type="region" key="Menu"/>
|
||||
|
||||
<style id="MenuItem">
|
||||
<insets top="2" left="2" bottom="3" right="2"/>
|
||||
<opaque value="true"/>
|
||||
<state>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
<color value="#D8D8D9" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#C2E6F6" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#E85D00" type="BACKGROUND"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="MenuItem" type="region" key="MenuItem"/>
|
||||
|
||||
<style id="PopupMenuSeparator">
|
||||
<insets top="2" left="0" bottom="2" right="0"/>
|
||||
</style>
|
||||
<bind style="PopupMenuSeparator" type="region" key="PopupMenuSeparator"/>
|
||||
|
||||
<style id="PopupMenu">
|
||||
<insets top="6" left="1" bottom="6" right="1"/>
|
||||
</style>
|
||||
<bind style="PopupMenu" type="region" key="PopupMenu"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- PROGRESS BARS -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="progress">
|
||||
<object id="ProgressPainter" class="org.jackhuang.hellominecraft.lookandfeel.painter.ProgressPainter" />
|
||||
<painter idref="ProgressPainter"/>
|
||||
<property key="ProgressBar.horizontalSize" type="dimension" value="50 20"/>
|
||||
<property key="ProgressBar.vertictalSize" type="dimension" value="20 50"/>
|
||||
</style>
|
||||
<bind style="progress" type="region" key="ProgressBar"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- TABBED PANE -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="TabbedPaneTab">
|
||||
<insets top="4" left="8" right="8" bottom="4"/>
|
||||
<state>
|
||||
<font name="微软雅黑" size="14" />
|
||||
<color type="TEXT_FOREGROUND" value="#000000" /> <!-- #000000 -->
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color type="TEXT_FOREGROUND" value="#106CA3" />
|
||||
</state>
|
||||
</style>
|
||||
<bind style="TabbedPaneTab" type="region" key="TabbedPaneTab"/>
|
||||
<style id="TabbedPaneTabArea">
|
||||
<insets top="3" left="10" right="10" bottom="5"/>
|
||||
</style>
|
||||
<bind style="TabbedPaneTabArea" type="region" key="TabbedPaneTabArea"/>
|
||||
|
||||
<int id="TabbedPane.selectedLabelShift">0</int>
|
||||
<int id="TabbedPane.labelShift">0</int>
|
||||
<boolean id="TabbedPane.nudgeSelectedLabel">false</boolean>
|
||||
<defaultsProperty key="TabbedPane.selectedLabelShift" type="idref" value="TabbedPane.selectedLabelShift" />
|
||||
<defaultsProperty key="TabbedPane.labelShift" type="idref" value="TabbedPane.labelShift" />
|
||||
<defaultsProperty key="TabbedPane.nudgeSelectedLabel" type="idref" value="TabbedPane.nudgeSelectedLabel" />
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- COMBO BOX -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<color id = "ComboBox.background" value="#EDEFF2" />
|
||||
<defaultsProperty key="ComboBox.background" type="idref" value="ComboBox.background"/>
|
||||
<color id = "ComboBox.selectionForeground" value="#000000" />
|
||||
<defaultsProperty key="ComboBox.selectionForeground" type="idref" value="ComboBox.selectionForeground"/>
|
||||
<color id = "ComboBox.selectionBackground" value="#A0D8F0" />
|
||||
<defaultsProperty key="ComboBox.selectionBackground" type="idref" value="ComboBox.selectionBackground"/>
|
||||
<color id = "ComboBox.foreground" value="#232324" />
|
||||
<defaultsProperty key="ComboBox.foreground" type="idref" value="ComboBox.foreground"/>
|
||||
|
||||
<style id="Combo listRenderer">
|
||||
<insets top="2" left="2" bottom="3" right="2"/>
|
||||
<opaque value="true"/>
|
||||
<state value="DISABLED">
|
||||
<color value="#EDEFF2" type="BACKGROUND"/>
|
||||
<color value="#8E8F91" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="ENABLED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#A0D8F0" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color type="BACKGROUND" value="#A0D8F0" />
|
||||
<color type="TEXT_FOREGROUND" value="#70C5E9" />
|
||||
</state>
|
||||
</style>
|
||||
<!--bind style="combobox" type="region" key="ComboBox" /-->
|
||||
<bind style="Combo listRenderer" type="name" key="ComboBox.listRenderer"/>
|
||||
|
||||
<defaultsProperty key="ComboBoxUI" type="string" value="org.jackhuang.hellominecraft.lookandfeel.ui.ComboBoxUI"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- LIST -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="List">
|
||||
<state>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#E85D00" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<color value="#C1C1C1" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#A0D8F0" type="BACKGROUND"/>
|
||||
</state>
|
||||
<property key="List.rendererUseListColors" type="boolean" value="false"/>
|
||||
</style>
|
||||
<bind style="List" type="region" key="List" />
|
||||
<style id="List listRenderer">
|
||||
<insets top="2" left="2" bottom="3" right="2"/>
|
||||
<opaque value="true"/>
|
||||
<state>
|
||||
<color value="#232324" type="TEXT_FOREGROUND"/>
|
||||
<color value="#EDEFF2" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="DISABLED">
|
||||
<color value="#EDEFF2" type="BACKGROUND"/>
|
||||
<color value="#8E8F91" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
<state value="MOUSE_OVER">
|
||||
<color value="#FFFFFF" type="TEXT_FOREGROUND"/>
|
||||
<color value="#3A698A" type="BACKGROUND"/>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="List listRenderer" type="name" key="List.listRenderer"/>
|
||||
|
||||
|
||||
<color id="List.background" value="#EDEFF2" />
|
||||
<defaultsProperty key="List.background" type="idref" value="List.background"/>
|
||||
<color id="List.selectionForeground" value="#FFFFFF" />
|
||||
<defaultsProperty key="List.selectionForeground" type="idref" value="List.selectionForeground"/>
|
||||
<color id="ListSelectionBackground" value="#0000FF" />
|
||||
<defaultsProperty key="List.selectionBackground" type="idref" value="ListSelectionBackground"/>
|
||||
<color id="List.foreground" value="#232324" />
|
||||
<defaultsProperty key="List.foreground" type="idref" value="List.foreground"/>
|
||||
|
||||
<defaultsProperty key="List.rendererUseListColors" type="boolean" value="false"/>
|
||||
|
||||
<!-- ########################################################################################################### -->
|
||||
<!-- OPTION PANE -->
|
||||
<!-- ########################################################################################################### -->
|
||||
|
||||
<style id="OptionPane">
|
||||
<imageIcon id="infoIcon" path="images/option_pane_info.png"/>
|
||||
<property key="OptionPane.informationIcon" value="infoIcon"/>
|
||||
<imageIcon id="errorIcon" path="images/option_pane_error.png"/>
|
||||
<property key="OptionPane.errorIcon" value="errorIcon"/>
|
||||
<imageIcon id="warningIcon" path="images/option_pane_warning.png"/>
|
||||
<property key="OptionPane.warningIcon" value="warningIcon"/>
|
||||
<imageIcon id="questionIcon" path="images/option_pane_question.png"/>
|
||||
<property key="OptionPane.questionIcon" value="questionIcon"/>
|
||||
<property key="OptionPane.buttonOrientation" type="integer" value="4"/>
|
||||
<property key="OptionPane.isYesLast" type="boolean" value="false"/>
|
||||
</style>
|
||||
<bind style="OptionPane" type="region" key="OptionPane"/>
|
||||
|
||||
<style id="table">
|
||||
<color id="color" value="#FF0000" />
|
||||
<color id="gridColor" value="#1E7B87" />
|
||||
<defaultsProperty key="Table.gridColor" type="idref" value="gridColor"/>
|
||||
<defaultsProperty key="Table.background" type="idref" value="gridColor"/>
|
||||
</style>
|
||||
<bind style="table" type="region" key="Table"/>
|
||||
<style id="defaultBackground">
|
||||
<state>
|
||||
<color value="#F1F2F2" type="BACKGROUND"></color>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"></color>
|
||||
</state>
|
||||
</style>
|
||||
<bind style="defaultBackground" type="region" key="Table.*"/>
|
||||
|
||||
<int id="Tree.leftChildIndent">6</int>
|
||||
<!-- TREE -->
|
||||
<style id="tree">
|
||||
<!-- Adding child indentation adn scrolling policy -->
|
||||
<property key="Tree.rightChildIndent" type="integer" value="12"/>
|
||||
<property key="Tree.scrollsHorizontallyAndVertically" type="boolean" value="true"/>
|
||||
|
||||
<imageIcon id="treeClosedIcon" path="images/tree_closed.gif" />
|
||||
<imageIcon id="treeOpenIcon" path="images/tree_open.gif" />
|
||||
<imageIcon id="treecollapsedicon" path="images/tree_collapsed.png"/>
|
||||
<imageIcon id="treeexpandedicon" path="images/tree_expanded.png"/>
|
||||
<imageIcon id="treeleaficon" path="images/tree_leaf.gif"/>
|
||||
|
||||
<property key="Tree.collapsedIcon" value="treecollapsedicon"/>
|
||||
<property key="Tree.expandedIcon" value="treeexpandedicon"/>
|
||||
|
||||
<defaultsProperty key="Tree.openIcon" value="treeOpenIcon"/>
|
||||
<defaultsProperty key="Tree.closedIcon" value="treeClosedIcon"/>
|
||||
<defaultsProperty key="Tree.leafIcon" value="treeleaficon"/>
|
||||
|
||||
<state>
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
<color value="#A0A0A0" type="FOREGROUND"/>
|
||||
</state>
|
||||
|
||||
<insets top="3" left="8" bottom="3" right="8"/>
|
||||
</style>
|
||||
<bind style="tree" type="region" key="Tree"/>
|
||||
|
||||
<style id="treecell" >
|
||||
<opaque value="true"/>
|
||||
|
||||
<state>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
<color value="#FFFFFF" type="BACKGROUND"/>
|
||||
</state>
|
||||
<state value="SELECTED">
|
||||
<color value="#EEEEEE" type="BACKGROUND"/>
|
||||
<color value="#000000" type="TEXT_FOREGROUND"/>
|
||||
</state>
|
||||
</style>
|
||||
<defaultsProperty key="TreeUI" type="string" value="javax.swing.plaf.metal.MetalTreeUI"/>
|
||||
<!--bind style="treecell" type="region" key="TreeCell"/-->
|
||||
</synth>
|
||||