Changeset 3691 in josm


Ignore:
Timestamp:
Dec 3, 2010 12:36:07 AM (2 years ago)
Author:
framm
Message:
  • add preference to draw outlines for polygons only, overriding any style settings. this helps tracing from aerial imagery when you have landuse=residential everywhere obscuring the view.
Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java

    r3291 r3691  
    2929    private boolean fillTaggedNode; 
    3030    private boolean fillConnectionNode; 
     31    private boolean outlineOnly; 
    3132    private Color selectedColor; 
    3233    private Color relationSelectedColor; 
     
    7879        fillTaggedNode = Main.pref.getBoolean("mappaint.node.fill-tagged", true); 
    7980        fillConnectionNode = Main.pref.getBoolean("mappaint.node.fill-connection", false); 
     81 
     82        outlineOnly = Main.pref.getBoolean("draw.data.area_outline_only", false); 
     83 
    8084    } 
    8185 
     
    187191        return fillTaggedNode; 
    188192    } 
     193 
     194    public boolean isOutlineOnly() { 
     195        return outlineOnly; 
     196    } 
    189197} 
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java

    r3653 r3691  
    2828 
    2929public class MapPainter { 
     30 
    3031    private final Graphics2D g; 
    3132    private final NavigatableComponent nc; 
     
    3536    private final boolean showNames; 
    3637    private final boolean showIcons; 
     38    private final boolean outlineOnly; 
    3739 
    3840    private final Color inactiveColor; 
     
    5860    private static final double sinPHI = Math.sin(PHI); 
    5961 
    60     public MapPainter(MapPaintSettings settings, Graphics2D g, boolean inactive, NavigatableComponent nc, boolean virtual, double dist, double circum) { 
     62    public MapPainter(MapPaintSettings settings, Graphics2D g,  
     63        boolean inactive, NavigatableComponent nc, boolean virtual,  
     64        double dist, double circum) { 
     65 
    6166        this.g = g; 
    6267        this.inactive = inactive; 
     
    6570        this.showNames = settings.getShowNamesDistance() > dist; 
    6671        this.showIcons = settings.getShowIconsDistance() > dist; 
     72        this.outlineOnly = settings.isOutlineOnly(); 
    6773 
    6874        this.inactiveColor = PaintColors.INACTIVE.get(); 
     
    249255        /* set the opacity (alpha) level of the filled polygon */ 
    250256        g.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), fillAlpha)); 
    251         g.fillPolygon(polygon); 
     257 
     258        if (outlineOnly) { 
     259            g.drawPolygon(polygon); 
     260        } else { 
     261            g.fillPolygon(polygon); 
     262        } 
     263             
    252264 
    253265        if (name != null) { 
  • trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java

    r3427 r3691  
    6060    private JCheckBox useAntialiasing = new JCheckBox(tr("Smooth map graphics (antialiasing)")); 
    6161    private JCheckBox makeAutoMarkers = new JCheckBox(tr("Create markers when reading GPX.")); 
     62    private JCheckBox outlineOnly = new JCheckBox(tr("Draw only outlines of areas")); 
    6263    private JComboBox waypointLabel = new JComboBox(new String[] {tr("Auto"), /* gpx data field name */ trc("gpx_field", "Name"), 
    6364                                      /* gpx data field name */ trc("gpx_field", "Desc(ription)"), tr("Both"), tr("None")}); 
     
    277278        panel.add(inactive, GBC.eop().insets(20,0,0,0)); 
    278279 
     280        // outlineOnly 
     281        outlineOnly.setSelected(Main.pref.getBoolean("draw.data.area_outline_only", false)); 
     282        outlineOnly.setToolTipText(tr("This option suppresses the filling of areas, overriding anything specified in the selected style.")); 
     283        panel.add(outlineOnly, GBC.eol().insets(20,0,0,5)); 
     284 
    279285        panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH)); 
    280286        scrollpane = new JScrollPane(panel); 
     
    285291    public boolean ok() { 
    286292        Main.pref.put("marker.makeautomarkers", makeAutoMarkers.isSelected()); 
     293        Main.pref.put("draw.data.area_outline_only", outlineOnly.isSelected()); 
    287294        Main.pref.put("draw.rawgps.lines", drawRawGpsLinesAll.isSelected()); 
    288295        Main.pref.put("draw.rawgps.lines.localfiles", drawRawGpsLinesLocal.isSelected()); 
Note: See TracChangeset for help on using the changeset viewer.