|
14 | 14 | */ |
15 | 15 | package net.rptools.maptool.client; |
16 | 16 |
|
17 | | -import com.jidesoft.plaf.LookAndFeelFactory; |
18 | 17 | import com.jidesoft.plaf.UIDefaultsLookup; |
19 | 18 | import com.jidesoft.plaf.basic.ThemePainter; |
20 | 19 | import io.sentry.EventProcessor; |
@@ -1266,62 +1265,63 @@ public static MapToolFrame getFrame() { |
1266 | 1265 | return clientFrame; |
1267 | 1266 | } |
1268 | 1267 |
|
1269 | | - private static void configureJide() { |
1270 | | - LookAndFeelFactory.UIDefaultsCustomizer uiDefaultsCustomizer = |
1271 | | - defaults -> { |
1272 | | - ThemePainter painter = (ThemePainter) UIDefaultsLookup.get("Theme.painter"); |
1273 | | - defaults.put("OptionPaneUI", "com.jidesoft.plaf.basic.BasicJideOptionPaneUI"); |
1274 | | - |
1275 | | - // show banner or not. default is true |
1276 | | - defaults.put("OptionPane.showBanner", Boolean.FALSE); |
1277 | | - defaults.put("OptionPane.bannerIcon", RessourceManager.getSmallIcon(Icons.MAPTOOL)); |
1278 | | - defaults.put("OptionPane.bannerFontSize", 13); |
1279 | | - defaults.put("OptionPane.bannerFontStyle", Font.BOLD); |
1280 | | - defaults.put("OptionPane.bannerMaxCharsPerLine", 60); |
1281 | | - // you should adjust this if banner background is not the default gradient paint |
1282 | | - defaults.put( |
1283 | | - "OptionPane.bannerForeground", |
1284 | | - painter != null ? painter.getOptionPaneBannerForeground() : null); |
1285 | | - defaults.put("OptionPane.bannerBorder", null); // use default border |
1286 | | - |
1287 | | - // set both bannerBackgroundDk and bannerBackgroundLt to null if you don't want |
1288 | | - // gradient |
1289 | | - defaults.put( |
1290 | | - "OptionPane.bannerBackgroundDk", |
1291 | | - painter != null ? painter.getOptionPaneBannerDk() : null); |
1292 | | - defaults.put( |
1293 | | - "OptionPane.bannerBackgroundLt", |
1294 | | - painter != null ? painter.getOptionPaneBannerLt() : null); |
1295 | | - // default is true |
1296 | | - defaults.put("OptionPane.bannerBackgroundDirection", Boolean.TRUE); |
1297 | | - |
1298 | | - // optionally, you can set a Paint object for BannerPanel. If so, the three |
1299 | | - // UIDefaults |
1300 | | - // related to banner background above will be ignored. |
1301 | | - defaults.put("OptionPane.bannerBackgroundPaint", null); |
1302 | | - |
1303 | | - defaults.put("OptionPane.buttonAreaBorder", BorderFactory.createEmptyBorder(6, 6, 6, 6)); |
1304 | | - defaults.put("OptionPane.buttonOrientation", SwingConstants.RIGHT); |
1305 | | - |
1306 | | - defaults.put( |
1307 | | - "DockableFrame.inactiveTitleBackground", |
1308 | | - UIManager.getColor("InternalFrame.inactiveTitleBackground")); |
1309 | | - defaults.put( |
1310 | | - "DockableFrame.inactiveTitleForeground", |
1311 | | - UIManager.getColor("InternalFrame.inactiveTitleForeground")); |
1312 | | - defaults.put( |
1313 | | - "DockableFrame.activeTitleBackground", |
1314 | | - UIManager.getColor("InternalFrame.activeTitleBackground")); |
1315 | | - defaults.put( |
1316 | | - "DockableFrame.activeTitleForeground", |
1317 | | - UIManager.getColor("InternalFrame.activeTitleForeground")); |
1318 | | - defaults.put("DockableFrame.background", UIManager.getColor("Panel.background")); |
1319 | | - defaults.put( |
1320 | | - "DockableFrame.border", |
1321 | | - BorderFactory.createLineBorder(UIManager.getColor("Panel.background"))); |
1322 | | - defaults.put("DockableFrameTitlePane.showIcon", true); |
1323 | | - }; |
1324 | | - uiDefaultsCustomizer.customize(UIManager.getDefaults()); |
| 1268 | + private static void configureLaf() { |
| 1269 | + final var defaults = UIManager.getDefaults(); |
| 1270 | + |
| 1271 | + // region JIDE LAF |
| 1272 | + ThemePainter painter = (ThemePainter) UIDefaultsLookup.get("Theme.painter"); |
| 1273 | + defaults.put("OptionPaneUI", "com.jidesoft.plaf.basic.BasicJideOptionPaneUI"); |
| 1274 | + |
| 1275 | + // show banner or not. default is true |
| 1276 | + defaults.put("OptionPane.showBanner", Boolean.FALSE); |
| 1277 | + defaults.put("OptionPane.bannerIcon", RessourceManager.getSmallIcon(Icons.MAPTOOL)); |
| 1278 | + defaults.put("OptionPane.bannerFontSize", 13); |
| 1279 | + defaults.put("OptionPane.bannerFontStyle", Font.BOLD); |
| 1280 | + defaults.put("OptionPane.bannerMaxCharsPerLine", 60); |
| 1281 | + // you should adjust this if banner background is not the default gradient paint |
| 1282 | + defaults.put( |
| 1283 | + "OptionPane.bannerForeground", |
| 1284 | + painter != null ? painter.getOptionPaneBannerForeground() : null); |
| 1285 | + defaults.put("OptionPane.bannerBorder", null); // use default border |
| 1286 | + |
| 1287 | + // set both bannerBackgroundDk and bannerBackgroundLt to null if you don't want |
| 1288 | + // gradient |
| 1289 | + defaults.put( |
| 1290 | + "OptionPane.bannerBackgroundDk", painter != null ? painter.getOptionPaneBannerDk() : null); |
| 1291 | + defaults.put( |
| 1292 | + "OptionPane.bannerBackgroundLt", painter != null ? painter.getOptionPaneBannerLt() : null); |
| 1293 | + // default is true |
| 1294 | + defaults.put("OptionPane.bannerBackgroundDirection", Boolean.TRUE); |
| 1295 | + |
| 1296 | + // optionally, you can set a Paint object for BannerPanel. If so, the three |
| 1297 | + // UIDefaults |
| 1298 | + // related to banner background above will be ignored. |
| 1299 | + defaults.put("OptionPane.bannerBackgroundPaint", null); |
| 1300 | + |
| 1301 | + defaults.put("OptionPane.buttonAreaBorder", BorderFactory.createEmptyBorder(6, 6, 6, 6)); |
| 1302 | + defaults.put("OptionPane.buttonOrientation", SwingConstants.RIGHT); |
| 1303 | + |
| 1304 | + defaults.put( |
| 1305 | + "DockableFrame.inactiveTitleBackground", |
| 1306 | + UIManager.getColor("InternalFrame.inactiveTitleBackground")); |
| 1307 | + defaults.put( |
| 1308 | + "DockableFrame.inactiveTitleForeground", |
| 1309 | + UIManager.getColor("InternalFrame.inactiveTitleForeground")); |
| 1310 | + defaults.put( |
| 1311 | + "DockableFrame.activeTitleBackground", |
| 1312 | + UIManager.getColor("InternalFrame.activeTitleBackground")); |
| 1313 | + defaults.put( |
| 1314 | + "DockableFrame.activeTitleForeground", |
| 1315 | + UIManager.getColor("InternalFrame.activeTitleForeground")); |
| 1316 | + defaults.put("DockableFrame.background", UIManager.getColor("Panel.background")); |
| 1317 | + defaults.put( |
| 1318 | + "DockableFrame.border", |
| 1319 | + BorderFactory.createLineBorder(UIManager.getColor("Panel.background"))); |
| 1320 | + defaults.put("DockableFrameTitlePane.showIcon", true); |
| 1321 | + // endregion |
| 1322 | + |
| 1323 | + defaults.put("Table.showHorizontalLines", Boolean.TRUE); |
| 1324 | + defaults.put("Table.showVerticalLines", Boolean.TRUE); |
1325 | 1325 | } |
1326 | 1326 |
|
1327 | 1327 | private static void postInitialize() { |
@@ -1731,7 +1731,7 @@ public SentryEvent process(@Nonnull SentryEvent event, @Nullable Hint hint) { |
1731 | 1731 | com.jidesoft.utils.Lm.verifyLicense( |
1732 | 1732 | "Trevor Croft", "rptools", "5MfIVe:WXJBDrToeLWPhMv3kI2s3VFo"); |
1733 | 1733 |
|
1734 | | - configureJide(); |
| 1734 | + configureLaf(); |
1735 | 1735 | } catch (Exception e) { |
1736 | 1736 | MapTool.showError("msg.error.lafSetup", e); |
1737 | 1737 | System.exit(1); |
|
0 commit comments