Changeset 12128 in josm
- Timestamp:
- 2017-05-12T20:18:02+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r12127 r12128 38 38 import javax.swing.JComponent; 39 39 import javax.swing.JOptionPane; 40 import javax.swing.JPanel;41 40 import javax.swing.KeyStroke; 42 41 import javax.swing.LookAndFeel; … … 208 207 209 208 /** 209 * The private content pane of {@code MainFrame}, required to be static for shortcut handling. 210 */ 211 protected static JComponent contentPanePrivate; 212 213 /** 210 214 * The file watcher service. 211 215 */ … … 637 641 } 638 642 } 639 640 protected static final JPanel contentPanePrivate = new JPanel(new BorderLayout());641 643 642 644 public static void redirectToMainContentPane(JComponent source) { … … 770 772 } 771 773 toolbar = new ToolbarPreferences(); 772 contentPanePrivate.updateUI();773 774 774 775 UIManager.put("OptionPane.okIcon", ImageProvider.get("ok")); -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12127 r12128 38 38 39 39 import javax.net.ssl.SSLSocketFactory; 40 import javax.swing.JComponent; 40 41 import javax.swing.JOptionPane; 41 42 import javax.swing.RepaintManager; … … 313 314 args.getSingle(Option.GEOMETRY).orElse(null), 314 315 !args.hasOption(Option.NO_MAXIMIZE) && Main.pref.getBoolean("gui.maximized", false)); 315 final MainFrame mainFrame = new MainFrame(contentPanePrivate, geometry); 316 final MainFrame mainFrame = new MainFrame(geometry); 317 Main.contentPanePrivate = (JComponent) mainFrame.getContentPane(); 316 318 Main.mainPanel = mainFrame.getPanel(); 317 319 Main.parent = mainFrame; -
trunk/src/org/openstreetmap/josm/gui/MainFrame.java
r12127 r12128 6 6 import java.awt.BorderLayout; 7 7 import java.awt.Component; 8 import java.awt.Container;9 8 import java.awt.Image; 10 9 import java.awt.Rectangle; … … 56 55 */ 57 56 public MainFrame() { 58 this(new JPanel(), new WindowGeometry(new Rectangle(10, 10, 500, 500))); 59 } 60 61 /** 62 * Create a new main window. The parameters will be removed in the future. 63 * @param contentPanePrivate The content 57 this(new WindowGeometry(new Rectangle(10, 10, 500, 500))); 58 } 59 60 /** 61 * Create a new main window. The parameter will be removed in the future. 64 62 * @param geometry The inital geometry to use. 65 * @since 1 171366 */ 67 public MainFrame( Container contentPanePrivate,WindowGeometry geometry) {63 * @since 12127 64 */ 65 public MainFrame(WindowGeometry geometry) { 68 66 super(); 69 67 this.geometry = geometry; 70 68 this.panel = new MainPanel(Main.getLayerManager()); 71 setContentPane( contentPanePrivate);69 setContentPane(new JPanel(new BorderLayout())); 72 70 } 73 71 -
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r12125 r12128 6 6 import static org.junit.Assert.fail; 7 7 8 import java.awt.BorderLayout; 8 9 import java.io.File; 9 10 import java.io.IOException; … … 14 15 import java.util.TimeZone; 15 16 17 import javax.swing.JPanel; 18 16 19 import org.openstreetmap.josm.data.projection.Projections; 17 20 import org.openstreetmap.josm.gui.MainApplication; 21 import org.openstreetmap.josm.gui.MainPanel; 18 22 import org.openstreetmap.josm.gui.layer.LayerManagerTest.TestLayer; 19 23 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences; … … 146 150 assertNull(Main.getLayerManager().getActiveLayer()); 147 151 152 if (Main.contentPanePrivate == null) { 153 Main.contentPanePrivate = new JPanel(new BorderLayout()); 154 } 155 if (Main.mainPanel == null) { 156 Main.mainPanel = new MainPanel(Main.getLayerManager()); 157 } 148 158 if (Main.toolbar == null) { 149 159 Main.toolbar = new ToolbarPreferences();
Note:
See TracChangeset
for help on using the changeset viewer.