Changeset 14388 in josm for trunk


Ignore:
Timestamp:
2018-10-30T23:05:04+01:00 (6 years ago)
Author:
simon04
Message:

Add checkbox to main menu to toggle hatched background rendering of areas outside of the downloaded areas

This is useful, e.g, for mapping public transport relations when one
downloads a relation modify by id and missing stops by bbox.

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainMenu.java

    r14221 r14388  
    5353import org.openstreetmap.josm.actions.FullscreenToggleAction;
    5454import org.openstreetmap.josm.actions.GpxExportAction;
     55import org.openstreetmap.josm.actions.HatchAreaOutsideDownloadAction;
    5556import org.openstreetmap.josm.actions.HelpAction;
    5657import org.openstreetmap.josm.actions.HistoryInfoAction;
     
    221222    /** View / Wireframe View */
    222223    public final WireframeToggleAction wireFrameToggleAction = new WireframeToggleAction();
     224    /** View / Hatch area outside download */
     225    public final HatchAreaOutsideDownloadAction hatchAreaOutsideDownloadAction = new HatchAreaOutsideDownloadAction();
    223226    /** View / Advanced info */
    224227    public final InfoAction info = new InfoAction();
     
    651654     * @since 10340
    652655     */
     656    // CHECKSTYLE.OFF: ExecutableStatementCountCheck
    653657    public void initialize() {
    654658        moreToolsMenu.setVisible(false);
     
    715719        wireframe.setAccelerator(wireFrameToggleAction.getShortcut().getKeyStroke());
    716720        wireFrameToggleAction.addButtonModel(wireframe.getModel());
     721        final JCheckBoxMenuItem hatchAreaOutsideDownloadMenuItem = hatchAreaOutsideDownloadAction.getCheckbox();
     722        viewMenu.add(hatchAreaOutsideDownloadMenuItem);
     723        ExpertToggleAction.addVisibilitySwitcher(hatchAreaOutsideDownloadMenuItem);
    717724
    718725        viewMenu.add(new MapPaintMenu());
     
    838845        new PresetsMenuEnabler(presetsMenu);
    839846    }
     847    // CHECKSTYLE.ON: ExecutableStatementCountCheck
    840848
    841849    /**
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r14349 r14388  
    4444
    4545import org.openstreetmap.josm.actions.ExpertToggleAction;
     46import org.openstreetmap.josm.actions.HatchAreaOutsideDownloadAction;
    4647import org.openstreetmap.josm.actions.RenameLayerAction;
    4748import org.openstreetmap.josm.actions.ToggleUploadDiscouragedLayerAction;
     
    499500            }
    500501            try {
    501                 g.fill(a);
     502                if (HatchAreaOutsideDownloadAction.isHatchEnabled()) {
     503                    g.fill(a);
     504                }
    502505            } catch (ArrayIndexOutOfBoundsException e) {
    503506                // #16686 - AIOOBE in java.awt.TexturePaintContext$Int.setRaster
Note: See TracChangeset for help on using the changeset viewer.