Changeset 14648 in josm


Ignore:
Timestamp:
2019-01-05T22:03:23+01:00 (4 months ago)
Author:
simon04
Message:

fix #17067 - Duplicate settings for display of hatching area

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

Legend:

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

    r14629 r14648  
    5353import org.openstreetmap.josm.actions.FullscreenToggleAction;
    5454import org.openstreetmap.josm.actions.GpxExportAction;
    55 import org.openstreetmap.josm.actions.HatchAreaOutsideDownloadAction;
     55import org.openstreetmap.josm.actions.DrawBoundariesOfDownloadedDataAction;
    5656import org.openstreetmap.josm.actions.HelpAction;
    5757import org.openstreetmap.josm.actions.HistoryInfoAction;
     
    223223    public final WireframeToggleAction wireFrameToggleAction = new WireframeToggleAction();
    224224    /** View / Hatch area outside download */
    225     public final HatchAreaOutsideDownloadAction hatchAreaOutsideDownloadAction = new HatchAreaOutsideDownloadAction();
     225    public final DrawBoundariesOfDownloadedDataAction drawBoundariesOfDownloadedDataAction = new DrawBoundariesOfDownloadedDataAction();
    226226    /** View / Advanced info */
    227227    public final InfoAction info = new InfoAction();
     
    719719        wireframe.setAccelerator(wireFrameToggleAction.getShortcut().getKeyStroke());
    720720        wireFrameToggleAction.addButtonModel(wireframe.getModel());
    721         final JCheckBoxMenuItem hatchAreaOutsideDownloadMenuItem = hatchAreaOutsideDownloadAction.getCheckbox();
     721        final JCheckBoxMenuItem hatchAreaOutsideDownloadMenuItem = drawBoundariesOfDownloadedDataAction.getCheckbox();
    722722        viewMenu.add(hatchAreaOutsideDownloadMenuItem);
    723723        ExpertToggleAction.addVisibilitySwitcher(hatchAreaOutsideDownloadMenuItem);
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r14556 r14648  
    4747
    4848import org.openstreetmap.josm.actions.ExpertToggleAction;
    49 import org.openstreetmap.josm.actions.HatchAreaOutsideDownloadAction;
    5049import org.openstreetmap.josm.actions.RenameLayerAction;
    5150import org.openstreetmap.josm.actions.ToggleUploadDiscouragedLayerAction;
     
    108107import org.openstreetmap.josm.gui.io.importexport.OsmImporter;
    109108import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
     109import org.openstreetmap.josm.gui.preferences.display.DrawingPreference;
    110110import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    111111import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
     
    481481        // draw the hatched area for non-downloaded region. only draw if we're the active
    482482        // and bounds are defined; don't draw for inactive layers or loaded GPX files etc
    483         if (active && Config.getPref().getBoolean("draw.data.downloaded_area", true) && !data.getDataSources().isEmpty()) {
     483        if (active && DrawingPreference.SOURCE_BOUNDS_PROP.get() && !data.getDataSources().isEmpty()) {
    484484            // initialize area with current viewport
    485485            Rectangle b = mv.getBounds();
     
    508508            }
    509509            try {
    510                 if (HatchAreaOutsideDownloadAction.isHatchEnabled()) {
    511                     g.fill(a);
    512                 }
     510                g.fill(a);
    513511            } catch (ArrayIndexOutOfBoundsException e) {
    514512                // #16686 - AIOOBE in java.awt.TexturePaintContext$Int.setRaster
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java

    r14492 r14648  
    1414
    1515import org.openstreetmap.josm.actions.ExpertToggleAction;
     16import org.openstreetmap.josm.data.preferences.BooleanProperty;
    1617import org.openstreetmap.josm.gui.autofilter.AutoFilterManager;
    1718import org.openstreetmap.josm.gui.autofilter.AutoFilterRule;
     
    4142        }
    4243    }
     44
     45    /**
     46     * Property controlling whether to draw boundaries of downloaded data
     47     * @since 14648
     48     */
     49    public static final BooleanProperty SOURCE_BOUNDS_PROP = new BooleanProperty("draw.data.downloaded_area", true);
    4350
    4451    private GPXSettingsPanel gpxPanel;
     
    107114        // downloaded area
    108115        sourceBounds.setToolTipText(tr("Draw the boundaries of data loaded from the server."));
    109         sourceBounds.setSelected(Config.getPref().getBoolean("draw.data.downloaded_area", true));
     116        sourceBounds.setSelected(SOURCE_BOUNDS_PROP.get());
    110117
    111118        // virtual nodes
     
    210217        Config.getPref().putBoolean("draw.segment.order_number", segmentOrderNumber.isSelected());
    211218        Config.getPref().putBoolean("draw.segment.order_number.on_selected", segmentOrderNumberOnSelectedWay.isSelected());
    212         Config.getPref().putBoolean("draw.data.downloaded_area", sourceBounds.isSelected());
     219        SOURCE_BOUNDS_PROP.put(sourceBounds.isSelected());
    213220        Config.getPref().putBoolean("draw.data.inactive_color", inactive.isSelected());
    214221        Config.getPref().putBoolean("mappaint.use-antialiasing", useAntialiasing.isSelected());
Note: See TracChangeset for help on using the changeset viewer.