Changeset 18755 in josm
- Timestamp:
- 2023-06-14T14:10:09+02:00 (18 months ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DialogsToggleAction.java
r17188 r18755 66 66 MapFrame.SIDE_TOOLBAR_VISIBLE.put(selected); 67 67 } 68 map.mapView.setMapNavigationComponentVisibility(selected || Config.getPref().getBoolean("navigation.always-visible", true)); 68 69 map.mapView.rememberLastPositionOnScreen(); 69 70 } -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r16987 r18755 39 39 import javax.swing.KeyStroke; 40 40 import javax.swing.SwingConstants; 41 import javax.swing.border.Border;42 41 import javax.swing.event.PopupMenuEvent; 43 42 import javax.swing.event.PopupMenuListener; 44 43 import javax.swing.plaf.basic.BasicArrowButton; 45 import javax.swing.plaf.basic.BasicSplitPaneDivider;46 import javax.swing.plaf.basic.BasicSplitPaneUI;47 44 48 45 import org.openstreetmap.josm.actions.ExpertToggleAction; … … 227 224 splitPane.setDividerSize(5); 228 225 splitPane.setBorder(null); 229 splitPane.setUI(new NoBorderSplitPaneUI());230 226 231 227 // JSplitPane supports F6, F8, Home and End shortcuts by default, but we need them for Audio and Image Mapping actions … … 313 309 */ 314 310 public boolean selectSelectTool(boolean onlyIfModeless) { 315 if (onlyIfModeless && !MODELESS.get())311 if (onlyIfModeless && Boolean.FALSE.equals(MODELESS.get())) 316 312 return false; 317 313 … … 325 321 */ 326 322 public boolean selectDrawTool(boolean onlyIfModeless) { 327 if (onlyIfModeless && !MODELESS.get())323 if (onlyIfModeless && Boolean.FALSE.equals(MODELESS.get())) 328 324 return false; 329 325 … … 337 333 */ 338 334 public boolean selectZoomTool(boolean onlyIfModeless) { 339 if (onlyIfModeless && !MODELESS.get())335 if (onlyIfModeless && Boolean.FALSE.equals(MODELESS.get())) 340 336 return false; 341 337 … … 568 564 if (statusLine != null && Config.getPref().getBoolean("statusline.visible", true)) { 569 565 panel.add(statusLine, BorderLayout.SOUTH); 570 }571 }572 573 static final class NoBorderSplitPaneUI extends BasicSplitPaneUI {574 static final class NoBorderBasicSplitPaneDivider extends BasicSplitPaneDivider {575 NoBorderBasicSplitPaneDivider(BasicSplitPaneUI ui) {576 super(ui);577 }578 579 @Override580 public void setBorder(Border b) {581 // Do nothing582 }583 }584 585 @Override586 public BasicSplitPaneDivider createDefaultDivider() {587 return new NoBorderBasicSplitPaneDivider(this);588 566 } 589 567 } … … 685 663 @Override 686 664 public void actionPerformed(ActionEvent e) { 687 if ( (Boolean) getValue(SELECTED_KEY)) {665 if (Boolean.TRUE.equals(getValue(SELECTED_KEY))) { 688 666 t.showButton(); 689 667 } else { -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r18211 r18755 3 3 4 4 import java.awt.AlphaComposite; 5 import java.awt.BasicStroke; 5 6 import java.awt.Color; 6 7 import java.awt.Dimension; … … 10 11 import java.awt.Rectangle; 11 12 import java.awt.Shape; 13 import java.awt.Stroke; 12 14 import java.awt.event.ComponentAdapter; 13 15 import java.awt.event.ComponentEvent; … … 103 105 MainApplication.getLayerManager().getLayers() 104 106 .stream() 105 .filter( layer -> layer instanceof OsmDataLayer)107 .filter(OsmDataLayer.class::isInstance) 106 108 .forEach(Layer::invalidate) 107 109 ); … … 237 239 private transient MapMover mapMover; 238 240 241 private final List<? extends JComponent> mapNavigationComponents; 242 private final Stroke worldBorderStroke = new BasicStroke(1.0f); 243 239 244 /** 240 245 * The listener that listens to invalidations of all layers. … … 294 299 setFocusTraversalKeysEnabled(!Shortcut.findShortcut(KeyEvent.VK_TAB, 0).isPresent()); 295 300 296 for (JComponent c : getMapNavigationComponents(this)) { 301 mapNavigationComponents = getMapNavigationComponents(this); 302 for (JComponent c : mapNavigationComponents) { 297 303 add(c); 298 304 } 299 if ( AutoFilterManager.PROP_AUTO_FILTER_ENABLED.get()) {305 if (Boolean.TRUE.equals(AutoFilterManager.PROP_AUTO_FILTER_ENABLED.get())) { 300 306 AutoFilterManager.getInstance().enableAutoFilterRule(AutoFilterManager.PROP_AUTO_FILTER_RULE.get()); 301 307 } … … 659 665 private void drawWorldBorders(Graphics2D tempG) { 660 666 tempG.setColor(Color.WHITE); 667 tempG.setStroke(worldBorderStroke); 661 668 Bounds b = getProjection().getWorldBoundsLatLon(); 662 669 … … 912 919 return mapMover; 913 920 } 921 922 /** 923 * Set the visibility of the navigation component 924 * @param visible {@code true} to make the navigation component visible 925 * @since 18755 926 */ 927 public void setMapNavigationComponentVisibility(boolean visible) { 928 for (JComponent c : mapNavigationComponents) { 929 c.setVisible(visible); 930 } 931 } 914 932 }
Note:
See TracChangeset
for help on using the changeset viewer.