From: Frederick W. <fre...@us...> - 2012-02-08 17:17:51
|
LocalisedText.properties | 14 - rails/ui/swing/GameUIManager.java | 2 rails/ui/swing/ORPanel.java | 19 + rails/ui/swing/ORWindow.java | 276 ++--------------------- rails/ui/swing/UpgradesPanel.java | 2 rails/ui/swing/elements/DockingFrame.java | 346 ++++++++++++++++++++++++++++++ 6 files changed, 402 insertions(+), 257 deletions(-) New commits: commit 85873585f82f47e4a5f752195b76412eb12edd33 Author: Frederick Weld <fre...@gm...> Date: Wed Feb 8 18:17:01 2012 +0100 Corrected comment for ORPanel's add JSpinner to Grid diff --git a/rails/ui/swing/ORPanel.java b/rails/ui/swing/ORPanel.java index ab3bf8f..bd3ea58 100644 --- a/rails/ui/swing/ORPanel.java +++ b/rails/ui/swing/ORPanel.java @@ -604,9 +604,9 @@ implements ActionListener, KeyListener, RevenueListener { f = revenue[i] = new Field(c.getLastRevenueModel()); addField(f, revXOffset, revYOffset + i, 1, 1, 0, visible); f = revenueSelect[i] = new Spinner(0, 0, 0, 10); - //zero-border so that size matches revenue field (thus, averting or panel resize) + //align spinner size with field size + //(so that changes to visibility don't affect panel sizing) f.setPreferredSize(revenue[i].getPreferredSize()); - //f.setBorder(new javax.swing.border.EmptyBorder(0,0,0,0)); addField(f, revXOffset, revYOffset + i, 1, 1, 0, false); // deactived below, as this caused problems by gridpanel rowvisibility function -- sfy // revenue[i].addDependent(revenueSelect[i]); commit d0bc83b44b210e1f9dc0cddb32dc543a4067ef84 Author: Frederick Weld <fre...@gm...> Date: Tue Feb 7 19:49:01 2012 +0100 Reworked dockingframe logging / popups Now: - logging entry instead of popup for layout save. - no popup during initial tentative layout load. diff --git a/rails/ui/swing/elements/DockingFrame.java b/rails/ui/swing/elements/DockingFrame.java index 8452ce0..8cc1203 100644 --- a/rails/ui/swing/elements/DockingFrame.java +++ b/rails/ui/swing/elements/DockingFrame.java @@ -158,7 +158,7 @@ public abstract class DockingFrame extends JFrame { */ protected void initLayout() { control.save(layoutName_initial); - loadLayout(); + loadLayout(getLayoutFile(),true); } /** @@ -199,17 +199,16 @@ public abstract class DockingFrame extends JFrame { control.writeXML(layoutFile); log.info("Layout saved to " + layoutFile.getName()); } catch (Exception e) { - JOptionPane.showMessageDialog(this, - "Unable to save layout to " + layoutFile.getName()); + log.error("Layout could not be saved to " + layoutFile.getName()); return; } } - private void loadLayout() { - loadLayout(getLayoutFile()); - } - - private void loadLayout(File layoutFile) { + /** + * @param isTentative If true, then method only tries to load specified layout + * but would not produce any error popup. + */ + private void loadLayout(File layoutFile, boolean isTentative) { if (!isDockingFrameworkEnabled) return; try { @@ -217,8 +216,11 @@ public abstract class DockingFrame extends JFrame { control.load(layoutName_current); log.info("Layout loaded from " + layoutFile.getName()); } catch (Exception e) { - JOptionPane.showMessageDialog(this, - "Unable to load layout from " + layoutFile.getName()); + if (!isTentative) { + JOptionPane.showMessageDialog(this, + "Unable to load layout from " + layoutFile.getName()); + } + log.error("Layout could not be loaded from " + layoutFile.getName()); return; } @@ -245,7 +247,7 @@ public abstract class DockingFrame extends JFrame { JFileChooser jfc = new JFileChooser(); jfc.setCurrentDirectory(getLayoutDirectory()); if (jfc.showOpenDialog(getContentPane()) != JFileChooser.APPROVE_OPTION) return; // cancel pressed - loadLayout(jfc.getSelectedFile()); + loadLayout(jfc.getSelectedFile(),false); } /** commit 21afe1d386c3a4d3d5b2987f8dab27d2c01698b0 Author: Frederick Weld <fre...@gm...> Date: Tue Feb 7 17:49:58 2012 +0100 Added docking features: apply template, logging, error popups Added feature to pick existing docking layouts as template. Menu item is called "Apply from..." and lets the user choose from the list of persisted layouts. Logging and error popups are added to the steps of loading/saving docking layouts. diff --git a/rails/ui/swing/elements/DockingFrame.java b/rails/ui/swing/elements/DockingFrame.java index 52375d0..8452ce0 100644 --- a/rails/ui/swing/elements/DockingFrame.java +++ b/rails/ui/swing/elements/DockingFrame.java @@ -1,6 +1,3 @@ -/** - * - */ package rails.ui.swing.elements; import java.awt.BorderLayout; @@ -10,9 +7,11 @@ import java.io.File; import java.util.Locale; import javax.swing.JComponent; +import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JMenuBar; import javax.swing.JMenuItem; +import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import rails.common.LocalText; @@ -40,6 +39,8 @@ import bibliothek.gui.dock.facile.menu.RootMenuPiece; import bibliothek.gui.dock.facile.menu.SubmenuPiece; import bibliothek.gui.dock.station.LayoutLocked; +import org.apache.log4j.Logger; + /** * Superclass for all application frames that want to use the docking * framework for managing its panels. @@ -53,12 +54,13 @@ import bibliothek.gui.dock.station.LayoutLocked; */ public abstract class DockingFrame extends JFrame { private static final long serialVersionUID = 1L; - private static final String layoutFolderName = "DockableLayout"; + private static final String layoutDirectoryName = "DockableLayout"; private static final String layoutFileSuffix = "_layout.rails_ini"; private static final String layoutName_initial = "InitialLayout"; private static final String layoutName_current = "CurrentLayout"; private static final String defaultTheme = ThemeMap.KEY_BASIC_THEME; - + private static Logger log = Logger.getLogger(DockingFrame.class.getPackage().getName()); + private boolean isDockingFrameworkEnabled; private CControl control = null; private CGrid gridLayout = null; @@ -140,7 +142,7 @@ public abstract class DockingFrame extends JFrame { LocalText.getText("DockingFrame.menu.layout.applyFrom")); applyFromMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - //TODO: apply from + loadLayoutUserDefined(); } }); layoutMenu.getMenu().add(applyFromMenuItem); @@ -165,31 +167,41 @@ public abstract class DockingFrame extends JFrame { */ abstract protected String getLayoutFileName(); - private File getLayoutFile() { + /** + * get layout directory (and ensure that it is available) + */ + private File getLayoutDirectory() { try { - //get layout folder (and ensure that it is available) - File layoutFolder = new File(Config.get("save.directory"),layoutFolderName); - if (!layoutFolder.isDirectory()) { - layoutFolder.mkdirs(); + File layoutDirectory = new File(Config.get("save.directory"),layoutDirectoryName); + if (!layoutDirectory.isDirectory()) { + layoutDirectory.mkdirs(); } - File layoutFile = new File(layoutFolder, - getLayoutFileName() + layoutFileSuffix ); - return layoutFile; - } catch (Exception e) { + return layoutDirectory; + } + catch (Exception e) { //return no valid file if anything goes wrong return null; } } + private File getLayoutFile() { + File layoutFile = new File(getLayoutDirectory(), + getLayoutFileName() + layoutFileSuffix ); + return layoutFile; + } + public void saveLayout() { if (!isDockingFrameworkEnabled) return; File layoutFile = getLayoutFile(); - if (layoutFile != null) { - try { - control.save(layoutName_current); - control.writeXML(layoutFile); - } catch (Exception e) {} //skip in case of issue + try { + control.save(layoutName_current); + control.writeXML(layoutFile); + log.info("Layout saved to " + layoutFile.getName()); + } catch (Exception e) { + JOptionPane.showMessageDialog(this, + "Unable to save layout to " + layoutFile.getName()); + return; } } @@ -200,11 +212,14 @@ public abstract class DockingFrame extends JFrame { private void loadLayout(File layoutFile) { if (!isDockingFrameworkEnabled) return; - if (layoutFile != null) { - try { - control.readXML(layoutFile); - control.load(layoutName_current); - } catch (Exception e) {} //skip if layout not found + try { + control.readXML(layoutFile); + control.load(layoutName_current); + log.info("Layout loaded from " + layoutFile.getName()); + } catch (Exception e) { + JOptionPane.showMessageDialog(this, + "Unable to load layout from " + layoutFile.getName()); + return; } //ensure that all dockables that are externalized according to layout @@ -224,6 +239,16 @@ public abstract class DockingFrame extends JFrame { } /** + * Lets user choose a layout in a file chooser popup and then loads/applies it + */ + private void loadLayoutUserDefined() { + JFileChooser jfc = new JFileChooser(); + jfc.setCurrentDirectory(getLayoutDirectory()); + if (jfc.showOpenDialog(getContentPane()) != JFileChooser.APPROVE_OPTION) return; // cancel pressed + loadLayout(jfc.getSelectedFile()); + } + + /** * The behavior of the specified CControl is altered by the following: * If a dockable is detached / externalized, it would normally put directly * under the ScreenDockStation - thus inhibiting any docking to/from this @@ -316,4 +341,4 @@ public abstract class DockingFrame extends JFrame { } } -} +} \ No newline at end of file commit b19b2c0926fceec643a42074a657975a12072555 Author: Frederick Weld <fre...@gm...> Date: Tue Feb 7 17:49:27 2012 +0100 Merged OR panel's menu bar into ORWindow's menu bar (docking layout) diff --git a/rails/ui/swing/ORPanel.java b/rails/ui/swing/ORPanel.java index 357d208..ab3bf8f 100644 --- a/rails/ui/swing/ORPanel.java +++ b/rails/ui/swing/ORPanel.java @@ -233,7 +233,11 @@ implements ActionListener, KeyListener, RevenueListener { zoomMenu.add(calibrateMap); menuBar.add(zoomMenu); - add(menuBar, BorderLayout.NORTH); + // only add menu bar for conventional layout + // (otherwise part of DockingFrame) + if (!parent.isDockingFrameworkEnabled()) { + add(menuBar, BorderLayout.NORTH); + } setVisible(true); @@ -1353,4 +1357,7 @@ implements ActionListener, KeyListener, RevenueListener { return buttonPanel; } + public JMenuBar getMenuBar() { + return menuBar; + } } \ No newline at end of file diff --git a/rails/ui/swing/ORWindow.java b/rails/ui/swing/ORWindow.java index f9d4d4f..278e9b0 100644 --- a/rails/ui/swing/ORWindow.java +++ b/rails/ui/swing/ORWindow.java @@ -90,8 +90,8 @@ public class ORWindow extends DockingFrame implements ActionPerformer { 0, 95, 100, 5); deployDockables(); - //create the frame menu - JMenuBar menuBar = new JMenuBar(); + //take over or panel's menu bar as the frame menu bar + JMenuBar menuBar = orPanel.getMenuBar(); addDockingFrameMenu(menuBar); setJMenuBar( menuBar ); @@ -268,4 +268,4 @@ public class ORWindow extends DockingFrame implements ActionPerformer { + gameUIManager.getGameManager().getGameName() ; } -} +} \ No newline at end of file commit 477e51b07cf09c0ed71e96af6f2a6c072ad6441c Author: Frederick Weld <fre...@gm...> Date: Mon Feb 6 18:24:40 2012 +0100 Refactored docking logic - separated it from ORWin to separate class Now, ORWindow inherits from this new class (elements.DockingFrame). As a result, ORWindow does not have any single reference to the DockingFrame framework - the new class acts both as a facade and as a rails-aware decorator to the framework's features. During refactoring, the following was also done: - Enablement of config option is only tested once (at the beginning) - due to potential issues when changing during a game - Enhanced scope of layout menu item "reset" - now also encompasses resetting the theme - Menu items "Look and Feel" and "Preferences" are dropped - they could not be reset properly - they had side-effects on other windows diff --git a/LocalisedText.properties b/LocalisedText.properties index 4f46859..4f344b2 100644 --- a/LocalisedText.properties +++ b/LocalisedText.properties @@ -292,15 +292,14 @@ DoesNotExist=Item does not exist DoesNotForm={0} does not form DoesNotHaveTheShares=Does not have the shares Dockable.orWindow.buttonPanel = Commands -Dockable.orWindow.menu.appearance = Appearance -Dockable.orWindow.menu.appearance.lookAndFeel = Look and Feel -Dockable.orWindow.menu.appearance.theme = Theme -Dockable.orWindow.menu.appearance.preferences = Preferences -Dockable.orWindow.menu.appearance.resetLayout = Reset Layout Dockable.orWindow.mapPanel = Map Dockable.orWindow.messagePanel = Messages Dockable.orWindow.orPanel = Companies Dockable.orWindow.upgradePanel = Upgrades +DockingFrame.menu.layout = Layout +DockingFrame.menu.layout.applyFrom = Apply From... +DockingFrame.menu.layout.theme = Theme +DockingFrame.menu.layout.reset = Reset Done=Done DoubleHeadingModifier1825={0} are two {1}-trains running as a {2}-train (double heading). ShortORExecuted=A short OR has been held, in which only the sold privates have paid out. diff --git a/rails/ui/swing/GameUIManager.java b/rails/ui/swing/GameUIManager.java index f281034..1440df6 100644 --- a/rails/ui/swing/GameUIManager.java +++ b/rails/ui/swing/GameUIManager.java @@ -126,7 +126,7 @@ public class GameUIManager implements DialogOwner { public void terminate () { getWindowSettings ().save(); - if (orWindow != null) orWindow.saveDockableLayout(); + if (orWindow != null) orWindow.saveLayout(); System.exit(0); } diff --git a/rails/ui/swing/ORPanel.java b/rails/ui/swing/ORPanel.java index 453db01..357d208 100644 --- a/rails/ui/swing/ORPanel.java +++ b/rails/ui/swing/ORPanel.java @@ -163,7 +163,7 @@ implements ActionListener, KeyListener, RevenueListener { add(statusPanel, BorderLayout.CENTER); //only add button panel directly for conventional layout - if (!parent.isDockablePanelsEnabled()) { + if (!parent.isDockingFrameworkEnabled()) { add(buttonPanel, BorderLayout.SOUTH); } @@ -314,7 +314,7 @@ implements ActionListener, KeyListener, RevenueListener { redoButton.setEnabled(false); //choose button panel layout depending on whether panel becomes a dockable - if (orWindow.isDockablePanelsEnabled()) { + if (orWindow.isDockingFrameworkEnabled()) { //customized panel for dockable layout //the minimal size is defined by the size of one button @@ -357,7 +357,7 @@ implements ActionListener, KeyListener, RevenueListener { //for dockable button panel, ensure that all buttons have the same size //(necessary, otherwise vertical/box layout will look ugly) - if (orWindow.isDockablePanelsEnabled()) { + if (orWindow.isDockingFrameworkEnabled()) { //get maximum size Dimension maxSize = new Dimension(); diff --git a/rails/ui/swing/ORWindow.java b/rails/ui/swing/ORWindow.java index 057e6a2..f9d4d4f 100644 --- a/rails/ui/swing/ORWindow.java +++ b/rails/ui/swing/ORWindow.java @@ -2,61 +2,31 @@ package rails.ui.swing; import java.awt.BorderLayout; -import java.awt.MenuItem; import java.awt.Rectangle; import java.awt.event.*; -import java.io.File; import java.util.ArrayList; import java.util.List; -import java.util.Locale; import javax.swing.JFrame; -import javax.swing.JMenu; import javax.swing.JMenuBar; -import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; import org.apache.log4j.Logger; -import bibliothek.gui.DockController; -import bibliothek.gui.Dockable; -import bibliothek.gui.DockStation; -import bibliothek.gui.dock.ScreenDockStation; -import bibliothek.gui.dock.SplitDockStation; -import bibliothek.gui.dock.common.CControl; -import bibliothek.gui.dock.common.CGrid; -import bibliothek.gui.dock.common.CStation; -import bibliothek.gui.dock.common.DefaultSingleCDockable; -import bibliothek.gui.dock.common.action.predefined.CBlank; -import bibliothek.gui.dock.common.event.CDockableStateListener; -import bibliothek.gui.dock.common.intern.CDockable; -import bibliothek.gui.dock.common.intern.DefaultCDockable; -import bibliothek.gui.dock.common.intern.ui.CSingleParentRemover; -import bibliothek.gui.dock.common.menu.CLayoutChoiceMenuPiece; -import bibliothek.gui.dock.common.menu.CLookAndFeelMenuPiece; -import bibliothek.gui.dock.common.menu.CPreferenceMenuPiece; -import bibliothek.gui.dock.common.menu.CThemeMenuPiece; -import bibliothek.gui.dock.common.mode.ExtendedMode; -import bibliothek.gui.dock.common.theme.ThemeMap; -import bibliothek.gui.dock.event.DockStationAdapter; -import bibliothek.gui.dock.facile.menu.RootMenuPiece; -import bibliothek.gui.dock.facile.menu.SubmenuPiece; -import bibliothek.gui.dock.station.LayoutLocked; - import rails.common.GuiDef; import rails.common.LocalText; import rails.common.parser.Config; import rails.game.GameManager; import rails.game.OperatingRound; import rails.game.action.*; +import rails.ui.swing.elements.DockingFrame; /** * This Window displays the available operations that may be performed during an * Operating Round. This window also contains the Game Map. */ -public class ORWindow extends JFrame implements ActionPerformer { +public class ORWindow extends DockingFrame implements ActionPerformer { private static final long serialVersionUID = 1L; protected GameUIManager gameUIManager; protected ORUIManager orUIManager; @@ -72,17 +42,11 @@ public class ORWindow extends JFrame implements ActionPerformer { List<LayTile> allowedTileLays = new ArrayList<LayTile>(); List<LayToken> allowedTokenLays = new ArrayList<LayToken>(); - CControl orWindowControl = null; - - private static final String layoutFolderName = "DockableLayout"; - private static final String layoutFileSuffix = "_layout.rails_ini"; - private static final String initialLayoutName = "InitialDockableLayout"; - protected static Logger log = Logger.getLogger(ORWindow.class.getPackage().getName()); public ORWindow(GameUIManager gameUIManager) { - super(); + super( "yes".equals(Config.get("or.window.dockablePanels")) ); this.gameUIManager = gameUIManager; String orUIManagerClassName = gameUIManager.getClassName(GuiDef.ClassName.OR_UI_MANAGER); @@ -109,93 +73,27 @@ public class ORWindow extends JFrame implements ActionPerformer { orPanel = new ORPanel(this, orUIManager); - //create docking / conventional layout depending config - if (isDockablePanelsEnabled()) { - //DOCKABLE LAYOUT - - //build the docking layout - orWindowControl = new CControl( this ); - add( orWindowControl.getContentArea() ); - CGrid orWindowLayout = new CGrid( orWindowControl ); - - //ensure that externalized dockables get a split station as parent - //necessary, otherwise externalized dockables cannot be docked together - alwaysAddStationsToExternalizedDockables(orWindowControl); - - //set docks tooltip language - if ("en_us".equalsIgnoreCase(Config.get("locale"))) { - //hard setting to default in case of US as this is DockingFrames default language - //don't use Locale constant as it is en_US (case sensitive) - orWindowControl.setLanguage(new Locale("")); - } - - //add message panel - String dockableName = LocalText.getText("Dockable.orWindow.messagePanel"); - DefaultSingleCDockable singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); - singleDockable.add( slider, BorderLayout.CENTER ); - singleDockable.setCloseable( false ); - orWindowLayout.add( 0, 0, 100, 10, singleDockable ); + //create docking / conventional layout + if (isDockingFrameworkEnabled()) { - //add upgrade panel - dockableName = LocalText.getText("Dockable.orWindow.upgradePanel"); - singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); - singleDockable.add( upgradePanel, BorderLayout.CENTER ); - singleDockable.setCloseable( false ); - orWindowLayout.add( 0, 10, 20, 70, singleDockable ); - - //add map panel - dockableName = LocalText.getText("Dockable.orWindow.mapPanel"); - singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); - singleDockable.add( mapPanel, BorderLayout.CENTER ); - singleDockable.setCloseable( false ); - orWindowLayout.add( 20, 10, 80, 70, singleDockable ); - - //add or panel - dockableName = LocalText.getText("Dockable.orWindow.orPanel"); - singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); - singleDockable.add( orPanel, BorderLayout.CENTER ); - singleDockable.setCloseable( false ); - orWindowLayout.add( 0, 80, 100, 15, singleDockable ); - - //add button panel of or panel - dockableName = LocalText.getText("Dockable.orWindow.buttonPanel"); - singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); - singleDockable.add( orPanel.getButtonPanel(), BorderLayout.CENTER ); - singleDockable.setCloseable( false ); - orWindowLayout.add( 0, 95, 100, 5, singleDockable ); - - //deploy layout to control's content area - orWindowControl.getContentArea().deploy( orWindowLayout ); + //generate layout + addDockable ( slider, LocalText.getText("Dockable.orWindow.messagePanel"), + 0, 0, 100, 10); + addDockable ( upgradePanel, LocalText.getText("Dockable.orWindow.upgradePanel"), + 0, 10, 20, 70); + addDockable ( mapPanel, LocalText.getText("Dockable.orWindow.mapPanel"), + 20, 10, 80, 70); + addDockable ( orPanel, LocalText.getText("Dockable.orWindow.orPanel"), + 0, 80, 100, 15); + addDockable ( orPanel.getButtonPanel(), + LocalText.getText("Dockable.orWindow.buttonPanel"), + 0, 95, 100, 5); + deployDockables(); //create the frame menu - JMenuBar menubar = new JMenuBar(); - RootMenuPiece appearanceMenu = new RootMenuPiece( - LocalText.getText("Dockable.orWindow.menu.appearance"), - false); - appearanceMenu.add( new SubmenuPiece( - LocalText.getText("Dockable.orWindow.menu.appearance.lookAndFeel"), - false, - new CLookAndFeelMenuPiece( orWindowControl ) - )); - appearanceMenu.add( new SubmenuPiece( - LocalText.getText("Dockable.orWindow.menu.appearance.theme"), - false, - new CThemeMenuPiece( orWindowControl ) - )); - appearanceMenu.add( CPreferenceMenuPiece.setup( orWindowControl )); - appearanceMenu.getMenu().addSeparator(); - JMenuItem resetLayoutMenuItem = new JMenuItem ( - LocalText.getText("Dockable.orWindow.menu.appearance.resetLayout")); - resetLayoutMenuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - orWindowControl.load(initialLayoutName); - } - }); - appearanceMenu.getMenu().add(resetLayoutMenuItem); - - //deploy menu - menubar.add( appearanceMenu.getMenu() ); - setJMenuBar( menubar ); + JMenuBar menuBar = new JMenuBar(); + addDockingFrameMenu(menuBar); + setJMenuBar( menuBar ); } else { // CONVENTIONAL LAYOUT @@ -230,9 +128,9 @@ public class ORWindow extends JFrame implements ActionPerformer { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { - saveDockableLayout(); + saveLayout(); StatusWindow.uncheckMenuItemBox(StatusWindow.MAP_CMD); - if (!isDockablePanelsEnabled()) { + if (!isDockingFrameworkEnabled()) { frame.dispose(); } else { setVisible(false); @@ -251,7 +149,7 @@ public class ORWindow extends JFrame implements ActionPerformer { }); //rearrange layout only if no docking framework active - if (!isDockablePanelsEnabled()) { + if (!isDockingFrameworkEnabled()) { pack(); } @@ -263,11 +161,7 @@ public class ORWindow extends JFrame implements ActionPerformer { gameUIManager.reportWindow.updateLog(); - //dockable panes: save initial layout and restore former layout - if (isDockablePanelsEnabled()) { - orWindowControl.save(initialLayoutName); - loadDockableLayout(); - } + if (isDockingFrameworkEnabled()) initLayout(); } public ORUIManager getORUIManager() { @@ -319,7 +213,7 @@ public class ORWindow extends JFrame implements ActionPerformer { public void repaintORPanel() { //rearrange layout only if no docking framework active - if (!isDockablePanelsEnabled()) { + if (!isDockingFrameworkEnabled()) { orPanel.revalidate(); } } @@ -335,7 +229,7 @@ public class ORWindow extends JFrame implements ActionPerformer { numORs )); //rearrange layout only if no docking framework active - if (!isDockablePanelsEnabled()) { + if (!isDockingFrameworkEnabled()) { pack(); if (lastBounds != null) { Rectangle newBounds = getBounds(); @@ -368,160 +262,10 @@ public class ORWindow extends JFrame implements ActionPerformer { messagePanel.setMessage(""); setTitle(LocalText.getText("MapWindowTitle")); } - - public boolean isDockablePanelsEnabled() { - return "yes".equals(Config.get("or.window.dockablePanels")); - } - - - private String getLayoutName() { + + protected String getLayoutFileName() { return getClass().getSimpleName() + "_" + gameUIManager.getGameManager().getGameName() ; } - - private File getLayoutFile() { - try { - //get layout folder (and ensure that it is available) - File layoutFolder = new File(Config.get("save.directory"),layoutFolderName); - if (!layoutFolder.isDirectory()) { - layoutFolder.mkdirs(); - } - File layoutFile = new File(layoutFolder, - getLayoutName() + layoutFileSuffix ); - return layoutFile; - } catch (Exception e) { - //return no valid file if anything goes wrong - return null; - } - } - - public void saveDockableLayout() { - if (!isDockablePanelsEnabled()) return; - - File layoutFile = getLayoutFile(); - if (layoutFile != null) { - try { - orWindowControl.save(getLayoutName()); - orWindowControl.writeXML(layoutFile); - } catch (Exception e) {} //skip in case of issue - } - } - - private void loadDockableLayout() { - if (!isDockablePanelsEnabled()) return; - - File layoutFile = getLayoutFile(); - if (layoutFile != null) { - try { - orWindowControl.readXML(layoutFile); - orWindowControl.load(getLayoutName()); - } catch (Exception e) {} //skip if layout not found - } - - //ensure that all dockables that are externalized according to layout - //information don't have the deault maximize button (as it won't work - //for the adjusted externalization setup) - for (int i = 0 ; i < orWindowControl.getCDockableCount() ; i++ ) { - CDockable d = orWindowControl.getCDockable(i); - if (d instanceof DefaultCDockable) { - DefaultCDockable dd = (DefaultCDockable)d; - if (ExtendedMode.EXTERNALIZED.equals(d.getExtendedMode())) { - dd.putAction( CDockable.ACTION_KEY_MAXIMIZE, CBlank.BLANK ); - } - } - } - } - - /** - * The behavior of the specified CControl is altered by the following: - * If a dockable is detached / externalized, it would normally put directly - * under the ScreenDockStation - thus inhibiting any docking to/from this - * dockable. This is changed such that a split station (that would allow for - * that) is put in between the ScreenDockStation and the Dockable. - */ - private void alwaysAddStationsToExternalizedDockables(CControl cc) { - // access the DockStation which shows our detached (externalized) items - CStation<?> screen = (CStation<?>) - cc.getStation( CControl.EXTERNALIZED_STATION_ID ); - - // remove the standard maximize action when externalizing - // and adds it back when unexternalizing - // (as maximize won't work for the adjusted externalization setup) - cc.addStateListener( new CDockableStateListener() { - public void visibilityChanged( CDockable cd ){ - // ignore - } - - public void extendedModeChanged( CDockable cd, ExtendedMode mode ){ - if( cd instanceof DefaultCDockable ) { - DefaultCDockable dockable = (DefaultCDockable) cd; - if( mode.equals( ExtendedMode.EXTERNALIZED ) ) { - dockable.putAction( CDockable.ACTION_KEY_MAXIMIZE, CBlank.BLANK ); - } - else { - dockable.putAction( CDockable.ACTION_KEY_MAXIMIZE, null ); - } - } - } - }); - - // if a Dockable is added to that station... - screen.getStation().addDockStationListener( new ScreenDockStationListener()); - - // make sure a SplitDockStation with one child and a parent - // that is a ScreenDockStation does not get removed - cc.intern().getController().setSingleParentRemover( - new CSingleParentRemover( cc ){ - @Override - protected boolean shouldTest( DockStation station ){ - if( station instanceof SplitDockStation ) { - SplitDockStation split = (SplitDockStation) station; - if( split.getDockParent() instanceof ScreenDockStation ) { - // but we want to remove the station if it does - // not have any children at all - return split.getDockableCount() == 0; - } - } - return super.shouldTest( station ); - } - } ); - } - - @LayoutLocked(locked = false) - private class ScreenDockStationListener extends DockStationAdapter { - public void dockableAdded( DockStation station, final Dockable dockable ){ - // ... and the new child is not a SplitDockStation ... - if( !(dockable instanceof SplitDockStation) ) { - SwingUtilities.invokeLater( new Runnable(){ - public void run(){ - checkAndReplace( dockable ); - } - } ); - } - } - private void checkAndReplace( Dockable dockable ){ - DockStation station = dockable.getDockParent(); - if( !(station instanceof ScreenDockStation) ) { - // cancel - return; - } - - // .. then we just insert a SplitDockStation - SplitDockStation split = new SplitDockStation(); - DockController controller = station.getController(); - - try { - // disable events while rearranging our layout - controller.freezeLayout(); - - station.replace( dockable, split ); - split.drop( dockable ); - } - finally { - // and enable events after we finished - controller.meltLayout(); - } - } - } } diff --git a/rails/ui/swing/UpgradesPanel.java b/rails/ui/swing/UpgradesPanel.java index 02556b6..edf24a2 100644 --- a/rails/ui/swing/UpgradesPanel.java +++ b/rails/ui/swing/UpgradesPanel.java @@ -409,7 +409,7 @@ public class UpgradesPanel extends Box implements MouseListener, ActionListener * could be necessary when displaying tiles of an arbitrary size */ private int getZoomStep() { - if (orUIManager.getORWindow().isDockablePanelsEnabled()) { + if (orUIManager.getORWindow().isDockingFrameworkEnabled()) { return hexMap.getZoomStep(); } else { return UPGRADE_TILE_ZOOM_STEP; diff --git a/rails/ui/swing/elements/DockingFrame.java b/rails/ui/swing/elements/DockingFrame.java new file mode 100644 index 0000000..52375d0 --- /dev/null +++ b/rails/ui/swing/elements/DockingFrame.java @@ -0,0 +1,319 @@ +/** + * + */ +package rails.ui.swing.elements; + +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.util.Locale; + +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.SwingUtilities; + +import rails.common.LocalText; +import rails.common.parser.Config; + +import bibliothek.gui.DockController; +import bibliothek.gui.DockStation; +import bibliothek.gui.Dockable; +import bibliothek.gui.dock.ScreenDockStation; +import bibliothek.gui.dock.SplitDockStation; +import bibliothek.gui.dock.common.CControl; +import bibliothek.gui.dock.common.CGrid; +import bibliothek.gui.dock.common.CStation; +import bibliothek.gui.dock.common.DefaultSingleCDockable; +import bibliothek.gui.dock.common.action.predefined.CBlank; +import bibliothek.gui.dock.common.event.CDockableStateListener; +import bibliothek.gui.dock.common.intern.CDockable; +import bibliothek.gui.dock.common.intern.DefaultCDockable; +import bibliothek.gui.dock.common.intern.ui.CSingleParentRemover; +import bibliothek.gui.dock.common.menu.CThemeMenuPiece; +import bibliothek.gui.dock.common.mode.ExtendedMode; +import bibliothek.gui.dock.common.theme.ThemeMap; +import bibliothek.gui.dock.event.DockStationAdapter; +import bibliothek.gui.dock.facile.menu.RootMenuPiece; +import bibliothek.gui.dock.facile.menu.SubmenuPiece; +import bibliothek.gui.dock.station.LayoutLocked; + +/** + * Superclass for all application frames that want to use the docking + * framework for managing its panels. + * + * All references to the docking framework are private by purpose. This + * enforces that any sub-class must not deal with any framework related + * issues (this superclass acts as a facade to the framework). + * + * @author Frederick Weld + * + */ +public abstract class DockingFrame extends JFrame { + private static final long serialVersionUID = 1L; + private static final String layoutFolderName = "DockableLayout"; + private static final String layoutFileSuffix = "_layout.rails_ini"; + private static final String layoutName_initial = "InitialLayout"; + private static final String layoutName_current = "CurrentLayout"; + private static final String defaultTheme = ThemeMap.KEY_BASIC_THEME; + + private boolean isDockingFrameworkEnabled; + private CControl control = null; + private CGrid gridLayout = null; + + /** + * Decision whether docking framework should be activated for a frame + * has to be done at the beginning as later switching is not supported + */ + protected DockingFrame(boolean isDockingFrameworkEnabled) { + this.isDockingFrameworkEnabled = isDockingFrameworkEnabled; + if (!isDockingFrameworkEnabled) return; + + //init the ccontrol + control = new CControl( this ); + control.setTheme(defaultTheme); + add( control.getContentArea() ); + if ("en_us".equalsIgnoreCase(Config.get("locale"))) { + //hard setting to default in case of US as this is DockingFrames default language + //don't use Locale constant as it is en_US (case sensitive) + control.setLanguage(new Locale("")); + } + + //init the grid layout + gridLayout = new CGrid( control ); + + //ensure that externalized dockables get a split station as parent + //necessary, otherwise externalized dockables cannot be docked together + alwaysAddStationsToExternalizedDockables(control); + + + } + + public boolean isDockingFrameworkEnabled() { + return isDockingFrameworkEnabled; + } + + /** + * Registers a component that is to become a dockable. + * The dockable is only deployed to the frame if deployDockables is called. + */ + protected void addDockable(JComponent c, String dockableTitle, int x, int y, int width, int height) { + DefaultSingleCDockable d = new DefaultSingleCDockable( + dockableTitle, dockableTitle ); + d.add( c, BorderLayout.CENTER ); + d.setCloseable( false ); + gridLayout.add( x, y, width, height, d ); + } + + /** + * Deploys to the frame all dockables that have been added before + */ + protected void deployDockables() { + control.getContentArea().deploy( gridLayout ); + } + + /** + * Creates a generic layout menu and adds it to the specified menu bar + */ + protected void addDockingFrameMenu(JMenuBar menuBar) { + RootMenuPiece layoutMenu = new RootMenuPiece( + LocalText.getText("DockingFrame.menu.layout"), + false); + layoutMenu.add( new SubmenuPiece( + LocalText.getText("DockingFrame.menu.layout.theme"), + false, + new CThemeMenuPiece( control ) + )); + layoutMenu.getMenu().addSeparator(); + JMenuItem resetMenuItem = new JMenuItem ( + LocalText.getText("DockingFrame.menu.layout.reset")); + resetMenuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + control.load(layoutName_initial); + control.setTheme(defaultTheme); + } + }); + layoutMenu.getMenu().add(resetMenuItem); + JMenuItem applyFromMenuItem = new JMenuItem ( + LocalText.getText("DockingFrame.menu.layout.applyFrom")); + applyFromMenuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + //TODO: apply from + } + }); + layoutMenu.getMenu().add(applyFromMenuItem); + + //deploy menu + menuBar.add( layoutMenu.getMenu() ); + } + + /** + * May only be called once the docking frame's layout has been constructed. + * Remembers that layout as the initial one. + * Loads a former layout if that was persisted in a prior session. + */ + protected void initLayout() { + control.save(layoutName_initial); + loadLayout(); + } + + /** + * @return The file name which is to be used for storing the layout upon exit + * and restoring prior layout when entering a session. + */ + abstract protected String getLayoutFileName(); + + private File getLayoutFile() { + try { + //get layout folder (and ensure that it is available) + File layoutFolder = new File(Config.get("save.directory"),layoutFolderName); + if (!layoutFolder.isDirectory()) { + layoutFolder.mkdirs(); + } + File layoutFile = new File(layoutFolder, + getLayoutFileName() + layoutFileSuffix ); + return layoutFile; + } catch (Exception e) { + //return no valid file if anything goes wrong + return null; + } + } + + public void saveLayout() { + if (!isDockingFrameworkEnabled) return; + + File layoutFile = getLayoutFile(); + if (layoutFile != null) { + try { + control.save(layoutName_current); + control.writeXML(layoutFile); + } catch (Exception e) {} //skip in case of issue + } + } + + private void loadLayout() { + loadLayout(getLayoutFile()); + } + + private void loadLayout(File layoutFile) { + if (!isDockingFrameworkEnabled) return; + + if (layoutFile != null) { + try { + control.readXML(layoutFile); + control.load(layoutName_current); + } catch (Exception e) {} //skip if layout not found + } + + //ensure that all dockables that are externalized according to layout + //information don't have the default maximize button (as it won't work + //for the adjusted externalization setup) + for (int i = 0 ; i < control.getCDockableCount() ; i++ ) { + CDockable d = control.getCDockable(i); + if (d instanceof DefaultCDockable) { + DefaultCDockable dd = (DefaultCDockable)d; + if (ExtendedMode.EXTERNALIZED.equals(d.getExtendedMode())) { + dd.putAction( CDockable.ACTION_KEY_MAXIMIZE, CBlank.BLANK ); + } else { + dd.putAction( CDockable.ACTION_KEY_MAXIMIZE, null ); + } + } + } + } + + /** + * The behavior of the specified CControl is altered by the following: + * If a dockable is detached / externalized, it would normally put directly + * under the ScreenDockStation - thus inhibiting any docking to/from this + * dockable. This is changed such that a split station (that would allow for + * that) is put in between the ScreenDockStation and the Dockable. + */ + private void alwaysAddStationsToExternalizedDockables(CControl cc) { + + // access the DockStation which shows our detached (externalized) items + CStation<?> screen = (CStation<?>) + cc.getStation( CControl.EXTERNALIZED_STATION_ID ); + + // remove the standard maximize action when externalizing + // and adds it back when unexternalizing + // (as maximize won't work for the adjusted externalization setup) + cc.addStateListener( new CDockableStateListener() { + public void visibilityChanged( CDockable cd ){ + // ignore + } + + public void extendedModeChanged( CDockable cd, ExtendedMode mode ){ + if( cd instanceof DefaultCDockable ) { + DefaultCDockable dockable = (DefaultCDockable) cd; + if( mode.equals( ExtendedMode.EXTERNALIZED ) ) { + dockable.putAction( CDockable.ACTION_KEY_MAXIMIZE, CBlank.BLANK ); + } + else { + dockable.putAction( CDockable.ACTION_KEY_MAXIMIZE, null ); + } + } + } + }); + + // if a Dockable is added to that station... + screen.getStation().addDockStationListener( new ScreenDockStationListener()); + + // make sure a SplitDockStation with one child and a parent + // that is a ScreenDockStation does not get removed + cc.intern().getController().setSingleParentRemover( + new CSingleParentRemover( cc ){ + @Override + protected boolean shouldTest( DockStation station ){ + if( station instanceof SplitDockStation ) { + SplitDockStation split = (SplitDockStation) station; + if( split.getDockParent() instanceof ScreenDockStation ) { + // but we want to remove the station if it does + // not have any children at all + return split.getDockableCount() == 0; + } + } + return super.shouldTest( station ); + } + } ); + } + + @LayoutLocked(locked = false) + private class ScreenDockStationListener extends DockStationAdapter { + public void dockableAdded( DockStation station, final Dockable dockable ){ + // ... and the new child is not a SplitDockStation ... + if( !(dockable instanceof SplitDockStation) ) { + SwingUtilities.invokeLater( new Runnable(){ + public void run(){ + checkAndReplace( dockable ); + } + } ); + } + } + private void checkAndReplace( Dockable dockable ){ + DockStation station = dockable.getDockParent(); + if( !(station instanceof ScreenDockStation) ) { + // cancel + return; + } + + // .. then we just insert a SplitDockStation + SplitDockStation split = new SplitDockStation(); + DockController controller = station.getController(); + + try { + // disable events while rearranging our layout + controller.freezeLayout(); + + station.replace( dockable, split ); + split.drop( dockable ); + } + finally { + // and enable events after we finished + controller.meltLayout(); + } + } + } + +} commit 862f6ee2affe8b2400bb615dca8854bb8f835534 Author: Frederick Weld <fre...@gm...> Date: Sun Feb 5 19:34:30 2012 +0100 Added OR Window menu (for dockables) incl. reset layout Apart from reset layout (restores standard rails layout of the OR window), further appearance options of DockingFrames are exposed. diff --git a/LocalisedText.properties b/LocalisedText.properties index 6aaa145..4f46859 100644 --- a/LocalisedText.properties +++ b/LocalisedText.properties @@ -291,11 +291,16 @@ DiscardsBaseToken={0} discards a {1} base token on {2} DoesNotExist=Item does not exist DoesNotForm={0} does not form DoesNotHaveTheShares=Does not have the shares -DockableTitle.orWindow.messagePanel = Messages -DockableTitle.orWindow.upgradePanel = Upgrades -DockableTitle.orWindow.mapPanel = Map -DockableTitle.orWindow.orPanel = Companies -DockableTitle.orWindow.buttonPanel = Commands +Dockable.orWindow.buttonPanel = Commands +Dockable.orWindow.menu.appearance = Appearance +Dockable.orWindow.menu.appearance.lookAndFeel = Look and Feel +Dockable.orWindow.menu.appearance.theme = Theme +Dockable.orWindow.menu.appearance.preferences = Preferences +Dockable.orWindow.menu.appearance.resetLayout = Reset Layout +Dockable.orWindow.mapPanel = Map +Dockable.orWindow.messagePanel = Messages +Dockable.orWindow.orPanel = Companies +Dockable.orWindow.upgradePanel = Upgrades Done=Done DoubleHeadingModifier1825={0} are two {1}-trains running as a {2}-train (double heading). ShortORExecuted=A short OR has been held, in which only the sold privates have paid out. diff --git a/rails/ui/swing/ORWindow.java b/rails/ui/swing/ORWindow.java index 441be07..057e6a2 100644 --- a/rails/ui/swing/ORWindow.java +++ b/rails/ui/swing/ORWindow.java @@ -2,6 +2,7 @@ package rails.ui.swing; import java.awt.BorderLayout; +import java.awt.MenuItem; import java.awt.Rectangle; import java.awt.event.*; import java.io.File; @@ -10,6 +11,9 @@ import java.util.List; import java.util.Locale; import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.SwingUtilities; @@ -30,9 +34,15 @@ import bibliothek.gui.dock.common.event.CDockableStateListener; import bibliothek.gui.dock.common.intern.CDockable; import bibliothek.gui.dock.common.intern.DefaultCDockable; import bibliothek.gui.dock.common.intern.ui.CSingleParentRemover; +import bibliothek.gui.dock.common.menu.CLayoutChoiceMenuPiece; +import bibliothek.gui.dock.common.menu.CLookAndFeelMenuPiece; +import bibliothek.gui.dock.common.menu.CPreferenceMenuPiece; +import bibliothek.gui.dock.common.menu.CThemeMenuPiece; import bibliothek.gui.dock.common.mode.ExtendedMode; import bibliothek.gui.dock.common.theme.ThemeMap; import bibliothek.gui.dock.event.DockStationAdapter; +import bibliothek.gui.dock.facile.menu.RootMenuPiece; +import bibliothek.gui.dock.facile.menu.SubmenuPiece; import bibliothek.gui.dock.station.LayoutLocked; import rails.common.GuiDef; @@ -66,6 +76,7 @@ public class ORWindow extends JFrame implements ActionPerformer { private static final String layoutFolderName = "DockableLayout"; private static final String layoutFileSuffix = "_layout.rails_ini"; + private static final String initialLayoutName = "InitialDockableLayout"; protected static Logger log = Logger.getLogger(ORWindow.class.getPackage().getName()); @@ -104,7 +115,6 @@ public class ORWindow extends JFrame implements ActionPerformer { //build the docking layout orWindowControl = new CControl( this ); - orWindowControl.setTheme( ThemeMap.KEY_SMOOTH_THEME ); add( orWindowControl.getContentArea() ); CGrid orWindowLayout = new CGrid( orWindowControl ); @@ -120,42 +130,73 @@ public class ORWindow extends JFrame implements ActionPerformer { } //add message panel - String dockableName = LocalText.getText("DockableTitle.orWindow.messagePanel"); + String dockableName = LocalText.getText("Dockable.orWindow.messagePanel"); DefaultSingleCDockable singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); singleDockable.add( slider, BorderLayout.CENTER ); singleDockable.setCloseable( false ); orWindowLayout.add( 0, 0, 100, 10, singleDockable ); //add upgrade panel - dockableName = LocalText.getText("DockableTitle.orWindow.upgradePanel"); + dockableName = LocalText.getText("Dockable.orWindow.upgradePanel"); singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); singleDockable.add( upgradePanel, BorderLayout.CENTER ); singleDockable.setCloseable( false ); orWindowLayout.add( 0, 10, 20, 70, singleDockable ); //add map panel - dockableName = LocalText.getText("DockableTitle.orWindow.mapPanel"); + dockableName = LocalText.getText("Dockable.orWindow.mapPanel"); singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); singleDockable.add( mapPanel, BorderLayout.CENTER ); singleDockable.setCloseable( false ); orWindowLayout.add( 20, 10, 80, 70, singleDockable ); //add or panel - dockableName = LocalText.getText("DockableTitle.orWindow.orPanel"); + dockableName = LocalText.getText("Dockable.orWindow.orPanel"); singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); singleDockable.add( orPanel, BorderLayout.CENTER ); singleDockable.setCloseable( false ); orWindowLayout.add( 0, 80, 100, 15, singleDockable ); //add button panel of or panel - dockableName = LocalText.getText("DockableTitle.orWindow.buttonPanel"); + dockableName = LocalText.getText("Dockable.orWindow.buttonPanel"); singleDockable = new DefaultSingleCDockable( dockableName, dockableName ); singleDockable.add( orPanel.getButtonPanel(), BorderLayout.CENTER ); singleDockable.setCloseable( false ); orWindowLayout.add( 0, 95, 100, 5, singleDockable ); + //deploy layout to control's content area orWindowControl.getContentArea().deploy( orWindowLayout ); + //create the frame menu + JMenuBar menubar = new JMenuBar(); + RootMenuPiece appearanceMenu = new RootMenuPiece( + LocalText.getText("Dockable.orWindow.menu.appearance"), + false); + appearanceMenu.add( new SubmenuPiece( + LocalText.getText("Dockable.orWindow.menu.appearance.lookAndFeel"), + false, + new CLookAndFeelMenuPiece( orWindowControl ) + )); + appearanceMenu.add( new SubmenuPiece( + LocalText.getText("Dockable.orWindow.menu.appearance.theme"), + false, + new CThemeMenuPiece( orWindowControl ) + )); + appearanceMenu.add( CPreferenceMenuPiece.setup( orWindowControl )); + appearanceMenu.getMenu().addSeparator(); + JMenuItem resetLayoutMenuItem = new JMenuItem ( + LocalText.getText("Dockable.orWindow.menu.appearance.resetLayout")); + resetLayoutMenuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + orWindowControl.load(initialLayoutName); + } + }); + appearanceMenu.getMenu().add(resetLayoutMenuItem); + + //deploy menu + menubar.add( appearanceMenu.getMenu() ); + setJMenuBar( menubar ); + } else { // CONVENTIONAL LAYOUT @@ -222,8 +263,11 @@ public class ORWindow extends JFrame implements ActionPerformer { gameUIManager.reportWindow.updateLog(); - //dockable panes: restore former layout (depending on game variant) - loadDockableLayout(); + //dockable panes: save initial layout and restore former layout + if (isDockablePanelsEnabled()) { + orWindowControl.save(initialLayoutName); + loadDockableLayout(); + } } public ORUIManager getORUIManager() { |