From: <chr...@us...> - 2006-08-13 13:25:27
|
Revision: 252 Author: christianhujer Date: 2006-08-13 06:25:14 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=252&view=rev Log Message: ----------- Replaced CSplitPane classes with GSplitPane. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/src/app/net/sf/gridarta/gui/GSplitPane.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-08-13 13:24:17 UTC (rev 251) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-08-13 13:25:14 UTC (rev 252) @@ -27,27 +27,25 @@ import cfeditor.arch.ArchObject; import cfeditor.map.MapControl; import java.awt.BorderLayout; -import java.awt.Component; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.beans.PropertyVetoException; -import java.util.List; import java.util.ArrayList; import java.util.Collections; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JOptionPane; -import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; -import cfeditor.GridderException; +import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.help.Help; import org.jetbrains.annotations.Nullable; @@ -111,13 +109,13 @@ private CMainMenu menu; /** The split pane. */ - private CSplitPane splitPane; + private GSplitPane splitPane; /** All open level views. */ - private CSplitPane splitDownPane; + private GSplitPane splitDownPane; /** All open level views. */ - private CSplitPane splitRightPane; + private GSplitPane splitRightPane; /** All open level views. */ private List<MapViewIFrame> mapViews = new ArrayList<MapViewIFrame>(); @@ -214,7 +212,7 @@ if (!mapTileListBottom) { // the map tile list is on the right side - splitRightPane = new CSplitPane(CSplitPane.HORIZONTAL_SPLIT, mapDesktop, mapTileList); + splitRightPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, mapDesktop, mapTileList); splitRightPane.setDividerLocation(divLocationRight); splitRightPane.setDividerSize(BORDER_SIZE); @@ -222,14 +220,14 @@ getContentPane().add(splitRightPane, BorderLayout.CENTER); mapArchPanel = new CMapArchPanel(mainControl, this); - splitDownPane = new CSplitPane(CSplitPane.VERTICAL_SPLIT, splitRightPane, mapArchPanel); + splitDownPane = new GSplitPane(GSplitPane.VERTICAL_SPLIT, splitRightPane, mapArchPanel); splitDownPane.setDividerLocation(divLocationDown); splitDownPane.setDividerSize(BORDER_SIZE); getContentPane().add(splitDownPane, BorderLayout.CENTER); - splitPane = new CSplitPane(CSplitPane.HORIZONTAL_SPLIT, archPanel, splitDownPane); + splitPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, archPanel, splitDownPane); splitPane.setDividerLocation(divLocation); splitPane.setDividerSize(BORDER_SIZE); @@ -237,20 +235,20 @@ } else { // the map tile list is merged into the bottom panel mapArchPanel = new CMapArchPanel(mainControl, this); - splitRightPane = new CSplitPane(CSplitPane.HORIZONTAL_SPLIT, mapArchPanel, mapTileList); + splitRightPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, mapArchPanel, mapTileList); splitRightPane.setDividerLocation(divLocationRight); splitRightPane.setDividerSize(BORDER_SIZE); // split off the bottom panel - splitDownPane = new CSplitPane(CSplitPane.VERTICAL_SPLIT, mapDesktop, splitRightPane); + splitDownPane = new GSplitPane(GSplitPane.VERTICAL_SPLIT, mapDesktop, splitRightPane); splitDownPane.setDividerLocation(divLocationDown); splitDownPane.setDividerSize(BORDER_SIZE); getContentPane().add(splitDownPane, BorderLayout.CENTER); // split off the left arch panel - splitPane = new CSplitPane(CSplitPane.HORIZONTAL_SPLIT, archPanel, splitDownPane); + splitPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, archPanel, splitDownPane); splitPane.setDividerLocation(divLocation); splitPane.setDividerSize(BORDER_SIZE); @@ -746,28 +744,4 @@ public void internalFrameDeactivated(final InternalFrameEvent e) { } - /** Splitpane class that keeps its size even upon L'n'F change. */ - public static final class CSplitPane extends JSplitPane { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - public CSplitPane(final int newOrientation, final Component newLeftComponent, final Component newRightComponent) { - super(newOrientation, newLeftComponent, newRightComponent); - } - - /** - * Overridden to store and restore the divider location upon - * UI change. - */ - @Override public void updateUI() { - final int dividerLocation = getDividerLocation(); - final int dividerSize = getDividerSize(); - super.updateUI(); - setDividerLocation(dividerLocation); - setDividerSize(dividerSize); - } - - } // class CSplitPane - } // class CMainView Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-08-13 13:24:17 UTC (rev 251) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-08-13 13:25:14 UTC (rev 252) @@ -56,6 +56,7 @@ import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; +import net.sf.gridarta.gui.GSplitPane; /** * <code>CMapArchPanel</code> implements the panel that holds information about @@ -106,7 +107,7 @@ private final CMainView mainView; - private final CSplitPane splitPane; + private final GSplitPane splitPane; private final JTabbedPane panelDesktop; @@ -186,8 +187,8 @@ panelDesktop = new JTabbedPane(JTabbedPane.TOP); mapArchPanel.setLayout(new BorderLayout()); - splitPane = new CSplitPane( - CSplitPane.HORIZONTAL_SPLIT, + splitPane = new GSplitPane( + GSplitPane.HORIZONTAL_SPLIT, scrollPane3, scrollPane2); @@ -892,28 +893,4 @@ s_remove.setEnabled(removeButton); } - /** Splitpane class that keeps its size even upon L'n'F change. */ - public final class CSplitPane extends JSplitPane { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - public CSplitPane(final int newOrientation, - final Component newLeftComponent, - final Component newRightComponent) { - super(newOrientation, newLeftComponent, newRightComponent); - } - - /** - * Overridden to store and restore the divider location upon - * UI change. - */ - @Override public void updateUI() { - final int dividerLocation = getDividerLocation(); - final int dividerSize = getDividerSize(); - super.updateUI(); - setDividerLocation(dividerLocation); - setDividerSize(dividerSize); - } - } -} +} // class CMapArchPanel Modified: trunk/src/app/net/sf/gridarta/gui/GSplitPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/GSplitPane.java 2006-08-13 13:24:17 UTC (rev 251) +++ trunk/src/app/net/sf/gridarta/gui/GSplitPane.java 2006-08-13 13:25:14 UTC (rev 252) @@ -55,10 +55,10 @@ // Overridden to store and restore the divider location upon UI change. @Override public void updateUI() { final int dividerLocationBackup = getDividerLocation(); - //final int dividerSizeBackup = getDividerSize(); + final int dividerSizeBackup = getDividerSize(); super.updateUI(); setDividerLocation(dividerLocationBackup); - //setDividerSize(dividerSizeBackup); + setDividerSize(dividerSizeBackup); } } // class DSplitPane This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |