/** * Disposes this theme. * * <p>This method must be called in order to dispose the heavyweight AWT components used * internally. */ public void dispose() { if (!disposed) { disposed = true; themeCounter--; if (themeCounter == 0) { titleBarUI.dispose(); PropertyMapManager.runBatch( new Runnable() { public void run() { rootProps .getTabWindowProperties() .getTabbedPanelProperties() .removeSuperObject(tpTheme.getTabbedPanelProperties()); rootProps .getTabWindowProperties() .getTabProperties() .getTitledTabProperties() .removeSuperObject(tpTheme.getTitledTabProperties()); rootProps.getMap().clear(true); } }); tpTheme.dispose(); } } }
public LookAndFeelDockingTheme() { if (themeCounter == 0) { tpTheme = new LookAndFeelTheme(); titleBarUI = new TitleBarUI( new TitleBarUIListener() { public void updating() {} public void updated() { initTheme(false); } }, false); titleBarUI.init(); initTheme(true); } themeCounter++; themeRootProps.addSuperObject(rootProps); }