Changeset 5091 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r4721 r5091 11 11 import org.openstreetmap.josm.data.imagery.ImageryInfo; 12 12 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 13 import org.openstreetmap.josm.gui.actionsupport.AlignImageryPanel; 13 14 import org.openstreetmap.josm.gui.layer.ImageryLayer; 14 15 import org.openstreetmap.josm.tools.ImageProvider; … … 44 45 try { 45 46 Main.main.addLayer(ImageryLayer.create(info)); 47 AlignImageryPanel.addNagPanelIfNeeded(); 46 48 } catch (IllegalArgumentException ex) { 47 49 if (ex.getMessage() == null || ex.getMessage().isEmpty()) { -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r5035 r5091 5 5 6 6 import java.awt.BorderLayout; 7 import java.awt.Component; 7 8 import java.awt.Container; 8 9 import java.awt.Dimension; 9 10 import java.awt.Font; 11 import java.awt.GridBagLayout; 10 12 import java.awt.Rectangle; 11 13 import java.awt.event.ActionEvent; … … 65 67 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 66 68 import org.openstreetmap.josm.tools.Destroyable; 69 import org.openstreetmap.josm.tools.GBC; 67 70 68 71 /** … … 113 116 */ 114 117 private List<ToggleDialog> allDialogs = new ArrayList<ToggleDialog>(); 118 private final JPanel leftPanel; 115 119 private final DialogsPanel dialogsPanel; 116 120 … … 140 144 setLayout(new BorderLayout()); 141 145 146 142 147 mapView = new MapView(contentPane); 143 148 144 149 new FileDrop(mapView); 145 150 151 leftPanel = new JPanel(); 152 leftPanel.setLayout(new GridBagLayout()); 153 154 leftPanel.add(mapView, GBC.std().fill()); 155 146 156 // toolbar 147 157 toolBarActions.setFloatable(false); … … 158 168 JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true); 159 169 dialogsPanel = new DialogsPanel(splitPane); 160 splitPane.setLeftComponent( mapView);170 splitPane.setLeftComponent(leftPanel); 161 171 splitPane.setRightComponent(dialogsPanel); 162 172 … … 499 509 Main.pref.putInteger("toggleDialogs.width", dialogsPanel.getWidth()); 500 510 } 511 512 /* 513 * Remove panel from top of MapView by class 514 */ 515 public void removeTopPanel(Class<?> type) { 516 int n = leftPanel.getComponentCount(); 517 for (int i=0; i<n; i++) { 518 Component c = leftPanel.getComponent(i); 519 if (type.isInstance(c)) { 520 leftPanel.remove(i); 521 leftPanel.doLayout(); 522 // repaint(); 523 return; 524 } 525 } 526 } 527 528 /* 529 * Find panel on top of MapView by class 530 */ 531 public <T> T getTopPanel(Class<T> type) { 532 int n = leftPanel.getComponentCount(); 533 for (int i=0; i<n; i++) { 534 Component c = leftPanel.getComponent(i); 535 if (type.isInstance(c)) { 536 return type.cast(c); 537 } 538 } 539 return null; 540 } 541 542 /** 543 * Add component @param c on top of MapView 544 */ 545 public void addTopPanel(Component c) { 546 leftPanel.add(c, GBC.eol().fill(GBC.HORIZONTAL), leftPanel.getComponentCount()-1); 547 leftPanel.doLayout(); 548 c.doLayout(); 549 } 501 550 502 551 /**
Note:
See TracChangeset
for help on using the changeset viewer.