19 package org.sleuthkit.autopsy.corecomponents;
22 import java.awt.Insets;
24 import java.util.TreeMap;
25 import java.util.logging.Level;
26 import javax.swing.BorderFactory;
27 import javax.swing.SwingUtilities;
28 import javax.swing.UIManager;
29 import javax.swing.UIManager.LookAndFeelInfo;
30 import javax.swing.UnsupportedLookAndFeelException;
31 import org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI;
32 import org.openide.modules.ModuleInstall;
33 import org.openide.windows.WindowManager;
48 if (null == instance) {
61 SwingUtilities.invokeLater(() -> {
64 UIManager.put(
"ViewTabDisplayerUI",
"org.sleuthkit.autopsy.corecomponents.NoTabsTabDisplayerUI");
65 UIManager.put(DefaultTabbedContainerUI.KEY_VIEW_CONTENT_BORDER, BorderFactory.createEmptyBorder());
66 UIManager.put(
"TabbedPane.contentBorderInsets",
new Insets(0, 0, 0, 0));
67 WindowManager.getDefault().invokeWhenUIReady(() -> {
78 if (System.getProperty(
"os.name").toLowerCase().contains(
"mac")) {
81 }
else if (System.getProperty(
"os.name").toLowerCase().contains(
"nux")){
93 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
94 }
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
95 logger.log(Level.WARNING,
"Error setting OS-X look-and-feel", ex);
100 final String[] UI_MENU_ITEM_KEYS =
new String[]{
"MenuBarUI",};
101 Map<Object, Object> uiEntries =
new TreeMap<>();
102 for (String key : UI_MENU_ITEM_KEYS) {
103 uiEntries.put(key, UIManager.get(key));
107 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
108 if (
"Nimbus".equals(info.getName())) {
110 UIManager.setLookAndFeel(info.getClassName());
111 }
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
112 logger.log(Level.WARNING,
"Error setting OS-X look-and-feel", ex);
119 uiEntries.entrySet().stream().forEach((entry) -> {
120 UIManager.put(entry.getKey(), entry.getValue());
124 private static void setUIFont (javax.swing.plaf.FontUIResource f){
125 java.util.Enumeration<Object> keys = UIManager.getDefaults().keys();
126 while (keys.hasMoreElements()) {
127 Object key = keys.nextElement();
128 Object value = UIManager.getDefaults().get(key);
129 if (value instanceof javax.swing.plaf.FontUIResource)
130 UIManager.put(key, f);
145 UIManager.put(
"swing.boldMetal", Boolean.FALSE);
146 UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
147 setUIFont (
new javax.swing.plaf.FontUIResource(
"DejaVu Sans Condensed", Font.PLAIN, 11));
149 }
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
150 logger.log(Level.WARNING,
"Error setting crossplatform look-and-feel, setting default look-and-feel",ex);
static Installer instance
void setModuleSettings(String value)
static final Logger logger
static synchronized Installer getDefault()
void setUnixLookAndFeel()
static boolean makeConfigFile(String moduleName)
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
static final long serialVersionUID
static void setUIFont(javax.swing.plaf.FontUIResource f)
static boolean configExists(String moduleName)
synchronized static Logger getLogger(String name)
static StartupWindowProvider getInstance()