uic.themes
Class UICTheme
java.lang.Object
javax.swing.plaf.metal.MetalTheme
javax.swing.plaf.metal.DefaultMetalTheme
uic.themes.UICTheme
- Direct Known Subclasses:
- UICThemeBigFonts
- public class UICTheme
- extends DefaultMetalTheme
The UICTheme for lots of usability fixes.
Use this theme by setting it just before you create a JFrame or similar
root window.
// Set our theme to make it look better.
try {
//The following line is needed when starting the application from WebStart (only on Windows)
javax.swing.plaf.metal.MetalLookAndFeel.setCurrentTheme(new uic.themes.UICTheme());
UIManager.setLookAndFeel(UIManager.getLookAndFeel());
} catch(Exception e) {
e.printStackTrace();
}
try {
final JFrame frame = new JFrame("myTitle");
Runnable r = new Runnable() {
public void run() {
// update LaF for the toplevel frame, too
javax.swing.SwingUtilities.updateComponentTreeUI(frame);
}
};
javax.swing.SwingUtilities.invokeLater(r);
} catch (Exception e) {
e.printStackTrace();
} // end setting theme.
// finish initialistion of frame.
frame.show();
This not only changes colors and look and feel, but also fixes some problems
on how widgets behave, this should not influence your application; but those fixes
are needed for the layouter used in UICompiler to do its job.
See the SwingBugs text file for a list of
problems detected while writing UICompiler.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
userSettings
protected Properties userSettings
useAntiAlias
protected static boolean useAntiAlias
UICTheme
public UICTheme()
UICTheme
public UICTheme(Properties userSettings)
getName
public String getName()
getUserSettings
public Properties getUserSettings()
getUserColor
protected Color getUserColor(String name,
String defaultColor)
getUserFont
protected Font getUserFont(String name)
getDefaults
protected Properties getDefaults()
- The hardcoded defaults for UICTheme are programmed here so its easy to alter
them in extending classes.
For example you can do:
protected Properties getDefaults() {
Properties defaults = super.getDefaults();
defaults.put("color.oddrow", "#111111");
return defaults;
}
setUserSettings
public void setUserSettings(Properties settings)
addCustomEntriesToTable
public void addCustomEntriesToTable(UIDefaults table)
- Add changes to the table
- Parameters:
table
- the table to be changed
getFocusColor
public ColorUIResource getFocusColor()
getDesktopColor
public ColorUIResource getDesktopColor()
getControl
public ColorUIResource getControl()
getControlShadow
public ColorUIResource getControlShadow()
getControlDarkShadow
public ColorUIResource getControlDarkShadow()
getControlInfo
public ColorUIResource getControlInfo()
getControlHighlight
public ColorUIResource getControlHighlight()
getControlDisabled
public ColorUIResource getControlDisabled()
getPrimaryControl
public ColorUIResource getPrimaryControl()
getPrimaryControlShadow
public ColorUIResource getPrimaryControlShadow()
getPrimaryControlDarkShadow
public ColorUIResource getPrimaryControlDarkShadow()
getPrimaryControlInfo
public ColorUIResource getPrimaryControlInfo()
getPrimaryControlHighlight
public ColorUIResource getPrimaryControlHighlight()
getSystemTextColor
public ColorUIResource getSystemTextColor()
getControlTextColor
public ColorUIResource getControlTextColor()
getInactiveControlTextColor
public ColorUIResource getInactiveControlTextColor()
getInactiveSystemTextColor
public ColorUIResource getInactiveSystemTextColor()
getUserTextColor
public ColorUIResource getUserTextColor()
getTextHighlightColor
public ColorUIResource getTextHighlightColor()
getHighlightedTextColor
public ColorUIResource getHighlightedTextColor()
getWindowBackground
public ColorUIResource getWindowBackground()
getWindowTitleBackground
public ColorUIResource getWindowTitleBackground()
getWindowTitleForeground
public ColorUIResource getWindowTitleForeground()
getWindowTitleInactiveBackground
public ColorUIResource getWindowTitleInactiveBackground()
getWindowTitleInactiveForeground
public ColorUIResource getWindowTitleInactiveForeground()
getMenuBackground
public ColorUIResource getMenuBackground()
getMenuForeground
public ColorUIResource getMenuForeground()
getMenuSelectedBackground
public ColorUIResource getMenuSelectedBackground()
getMenuSelectedForeground
public ColorUIResource getMenuSelectedForeground()
getMenuDisabledForeground
public ColorUIResource getMenuDisabledForeground()
getSeparatorBackground
public ColorUIResource getSeparatorBackground()
getSeparatorForeground
public ColorUIResource getSeparatorForeground()
getAcceleratorForeground
public ColorUIResource getAcceleratorForeground()
getAcceleratorSelectedForeground
public ColorUIResource getAcceleratorSelectedForeground()
getOddRow
public ColorUIResource getOddRow()
getEvenRow
public ColorUIResource getEvenRow()
getControlTextFont
public FontUIResource getControlTextFont()
getSystemTextFont
public FontUIResource getSystemTextFont()
getUserTextFont
public FontUIResource getUserTextFont()
getMenuTextFont
public FontUIResource getMenuTextFont()
getWindowTitleFont
public FontUIResource getWindowTitleFont()
getSubTextFont
public FontUIResource getSubTextFont()
setAntialiasEnabled
public void setAntialiasEnabled(boolean on)
- Turn antialias on or off for all widgets.
- Since:
- 1.1
getAntialiasEnabled
public static boolean getAntialiasEnabled()
- Check if global antialias is enabled.
Note that this is a static due to implementation details of Swing, this means that
you can not configure antialias per theme, the last change is for the whole JVM.
- Since:
- 1.1
store
public void store()
Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence