use of javax.swing.UIManager.LookAndFeelInfo in project pcgen by PCGen.
the class LookAndFeelManager method initLookAndFeel.
//
// public static LookAndFeelManager getInstance()
// {
// if (instance == null)
// {
// instance = new LookAndFeelManager();
// }
// return instance;
// }
/**
* Initialise the look and feel to be used for this session. The look and
* feel used will be the one saved in the preferences, or if none is
* selected, nimbus will be used if present and the screen is a decent
* size, otherwise Java will be used. Nimbus doesn't work so well on small
* screens, hence the test for screen size.
*/
public static void initLookAndFeel() {
//set Java as the fallback look and feel
currentLAF = "Java";
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
LookAndFeelInfo nimbus = getNimbusLaf();
if (screenSize.height > 800 && nimbus != null) {
currentLAF = nimbus.getName();
}
String laf = ConfigurationSettings.initSystemProperty("lookAndFeel", currentLAF);
selectedTheme = ConfigurationSettings.getSystemProperty("selectedThemePack");
setLookAndFeel(laf);
}
use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.
the class bug8033069NoScrollBar method iterateLookAndFeels.
protected static void iterateLookAndFeels(final bug8033069NoScrollBar test) throws Exception {
LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
for (LookAndFeelInfo info : lafInfo) {
try {
UIManager.setLookAndFeel(info.getClassName());
System.out.println("Look and Feel: " + info.getClassName());
test.runTest();
} catch (UnsupportedLookAndFeelException e) {
System.out.println("Skipping unsupported LaF: " + info);
}
}
}
use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.
the class UITest method main.
public static void main(String[] args) {
OSType os = OSInfo.getOSType();
LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
switch(os) {
case WINDOWS:
// Make sure we don't have GTK.
if (hasLAF("gtk", lafInfo)) {
throw new RuntimeException("On windows, but GTK is present");
}
// Make sure we don't have Aqua.
if (hasLAF("mac", lafInfo)) {
throw new RuntimeException("On windows, but Aqua is present");
}
// Make sure we have Windows.
if (!hasLAF("windows", lafInfo)) {
throw new RuntimeException("On windows and don't have Windows");
}
break;
case MACOSX:
// Make sure we don't have GTK.
if (hasLAF("gtk", lafInfo)) {
throw new RuntimeException("On mac, but GTK is present");
}
// Make sure we don't have Windows.
if (hasLAF("windows", lafInfo)) {
throw new RuntimeException("On mac, but Windows is present");
}
// Make sure we have Aqua.
if (!hasLAF("mac", lafInfo)) {
throw new RuntimeException("On mac and don't have Aqua");
}
break;
default:
// Make sure we don't have Windows.
if (hasLAF("windows", lafInfo)) {
throw new RuntimeException("Not on windows and have Windows");
}
// Make sure we don't have Aqua.
if (hasLAF("mac", lafInfo)) {
throw new RuntimeException("Not on mac and have Aqua");
}
// Make sure we have GTK.
if (!hasLAF("gtk", lafInfo)) {
throw new RuntimeException("Not on Windows and Mac and don't have GTK!");
}
}
}
use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.
the class DimensionEncapsulation method main.
public static void main(final String[] args) throws Exception {
for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
SwingUtilities.invokeAndWait(new DimensionEncapsulation());
}
}
use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.
the class bug8080628 method runTest.
private static void runTest() {
try {
LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
for (LookAndFeelInfo info : lafInfo) {
UIManager.setLookAndFeel(info.getClassName());
for (Locale locale : LOCALES) {
for (String key : MNEMONIC_KEYS) {
int mnemonic = SwingUtilities2.getUIDefaultsInt(key, locale);
if (mnemonic != 0) {
throw new RuntimeException("No mnemonic expected (" + mnemonic + ") " + "for '" + key + "' " + "in locale '" + locale + "' " + "in Look-and-Feel '" + UIManager.getLookAndFeel().getClass().getName() + "'");
}
}
}
}
System.out.println("Test passed");
} catch (Exception e) {
exception = e;
}
}
Aggregations