use of javax.swing.LookAndFeel in project jdk8u_jdk by JetBrains.
the class XToolkit method initUIDefaults.
static void initUIDefaults() {
try {
// Load Defaults from MotifLookAndFeel
// This dummy load is necessary to get SystemColor initialized. !!!!!!
Color c = SystemColor.text;
LookAndFeel lnf = new XAWTLookAndFeel();
uidefaults = lnf.getDefaults();
} catch (Exception e) {
e.printStackTrace();
}
}
use of javax.swing.LookAndFeel in project pcgen by PCGen.
the class LookAndFeelManager method setSkinLAF.
private static void setSkinLAF() {
try {
//path += File.separator + selectedTheme;
LookAndFeel laf = createSkinLAF(selectedTheme);
UIManager.setLookAndFeel(laf);
ConfigurationSettings.setSystemProperty("lookAndFeel", "Skinned");
ConfigurationSettings.setSystemProperty("selectedThemePack", selectedTheme);
currentTheme = selectedTheme;
currentLAF = "Skinned";
} catch (Exception ex) {
if ("Skinned".equals(currentLAF)) {
try {
//fall back to old theme
//path += File.separator + currentTheme;
LookAndFeel laf = createSkinLAF(currentTheme);
UIManager.setLookAndFeel(laf);
} catch (Exception ex1) {
setLookAndFeel("Java");
}
} else {
setLookAndFeel(currentLAF);
}
}
}
use of javax.swing.LookAndFeel in project adempiere by adempiere.
the class PLAFEditor method setLFSelection.
// dynInit
/**
* Set Picks From Environment
*/
private void setLFSelection() {
m_setting = true;
// Search for PLAF
ValueNamePair plaf = null;
LookAndFeel lookFeel = UIManager.getLookAndFeel();
String look = lookFeel.getClass().getName();
for (int i = 0; i < AdempierePLAF.getPLAFs().length; i++) {
ValueNamePair vp = AdempierePLAF.getPLAFs()[i];
if (vp.getValue().equals(look)) {
plaf = vp;
break;
}
}
if (plaf != null)
lfField.setSelectedItem(plaf);
// Search for Theme
MetalTheme metalTheme = null;
ValueNamePair theme = null;
boolean metal = UIManager.getLookAndFeel() instanceof MetalLookAndFeel;
themeField.setModel(new DefaultComboBoxModel(AdempierePLAF.getThemes()));
if (metal) {
theme = null;
AppContext context = AppContext.getAppContext();
metalTheme = (MetalTheme) context.get("currentMetalTheme");
if (metalTheme != null) {
String lookTheme = metalTheme.getName();
for (int i = 0; i < AdempierePLAF.getThemes().length; i++) {
ValueNamePair vp = AdempierePLAF.getThemes()[i];
if (vp.getName().equals(lookTheme)) {
theme = vp;
break;
}
}
}
if (theme != null)
themeField.setSelectedItem(theme);
}
m_setting = false;
log.info(lookFeel + " - " + metalTheme);
}
use of javax.swing.LookAndFeel in project adempiere by adempiere.
the class PreviewPanel method lookAndFeelSelectionChanged.
/**
* Handle look and feel selection changed
* @param e
*/
protected void lookAndFeelSelectionChanged(ListSelectionEvent e) {
if (m_setting)
return;
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
ValueNamePair laf = (ValueNamePair) lookList.getSelectedValue();
LookAndFeel currentLaf = UIManager.getLookAndFeel();
MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme();
AdempierePLAF.setPLAF(laf, null, false);
previewPanel.refresh(currentLaf, currentTheme);
SwingUtilities.updateComponentTreeUI(previewPanel);
updatePreviewComponents();
setLFSelection();
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
this.repaint();
}
use of javax.swing.LookAndFeel in project adempiere by adempiere.
the class PreviewPanel method themeSelectionChanged.
/**
* Handle theme selection changed
* @param e
*/
protected void themeSelectionChanged(ListSelectionEvent e) {
if (m_setting)
return;
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
ValueNamePair laf = (ValueNamePair) lookList.getSelectedValue();
ValueNamePair theme = (ValueNamePair) themeList.getSelectedValue();
LookAndFeel currentLaf = UIManager.getLookAndFeel();
MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme();
AdempierePLAF.setPLAF(laf, theme, false);
previewPanel.refresh(currentLaf, currentTheme);
SwingUtilities.updateComponentTreeUI(previewPanel);
updatePreviewComponents();
setLFSelection();
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
this.repaint();
}
Aggregations