/** Invoked when this window is about to close. */ protected void onWindowClose() { if (ClassicPrefs.getSaveWindowProperties()) { ClassicPrefs.setWindowMaximized((getExtendedState() & MAXIMIZED_BOTH) == MAXIMIZED_BOTH); setVisible(false); if (ClassicPrefs.getWindowMaximized()) { // setExtendedState(getExtendedState() & ~MAXIMIZED_BOTH); CC.cleanExit(); return; } java.awt.Point p = getLocation(); Dimension d = getSize(); StringBuffer sb = new StringBuffer(); sb.append(p.x).append(',').append(p.y).append(','); sb.append(d.width).append(',').append(d.height); ClassicPrefs.setWindowSizeAndLocation(sb.toString()); ClassicPrefs.setHSplitDividerLocation(hSplitPane.getDividerLocation()); } if (ClassicPrefs.getSaveLeftPaneState()) { int idx = 0; for (int i = 0; i < getLeftPane().getPages().length; i++) { if (getLeftPane().getPages()[i] == getLeftPane().getCurrentPage()) { idx = i; break; } } ClassicPrefs.setLeftPanePageIndex(idx); idx = getLeftPane().getOrchestrasPage().getCurrentOrchestraIndex(); if (idx >= 0 && idx < CC.getOrchestras().getOrchestraCount()) ClassicPrefs.setCurrentOrchestraIndex(idx); } StringBuffer sb = new StringBuffer(); for (String s : recentScripts) sb.append(s).append("\n"); ClassicPrefs.setRecentScripts(sb.toString()); LSConsoleModel model = getLSConsoleModel(); sb = new StringBuffer(); for (String s : model.getCommandHistory()) sb.append(s).append("\n"); ClassicPrefs.setLSConsoleHistory(sb.toString()); ClassicPrefs.setShowLSConsole(isLSConsoleShown()); ClassicPrefs.setLSConsolePopOut(isLSConsolePopOut()); ClassicPrefs.setVSplitDividerLocation(vSplitPane.getDividerLocation()); super.onWindowClose(); }
private void showBottomPane(boolean b) { if (!b) ClassicPrefs.setVSplitDividerLocation(vSplitPane.getDividerLocation()); rightPane.remove(vSplitPane); rightPane.remove(channelsPane); if (b) { vSplitPane.setTopComponent(channelsPane); rightPane.add(vSplitPane); vSplitPane.setDividerLocation(ClassicPrefs.getVSplitDividerLocation()); } else { rightPane.add(channelsPane); } validate(); repaint(); }