Changeset 11090 in josm


Ignore:
Timestamp:
2016-10-07T19:57:30+02:00 (8 months ago)
Author:
simon04
Message:

fix #13743 - Draw segment order numbers on selected way

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

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

    r11060 r11090  
    2626    /** Preference: should the segment numbers of ways be displayed */
    2727    private boolean showOrderNumber;
     28    /** Preference: should the segment numbers of ways be displayed on selected way */
     29    private boolean showOrderNumberOnSelectedWay;
    2830    /** Preference: should only the last arrow of a way be displayed */
    2931    private boolean showHeadArrowOnly;
     
    9092
    9193        showOrderNumber = Main.pref.getBoolean("draw.segment.order_number", false);
     94        showOrderNumberOnSelectedWay = Main.pref.getBoolean("draw.segment.order_number.on_selected", false);
    9295        showHeadArrowOnly = Main.pref.getBoolean("draw.segment.head_only", false);
    9396
     
    233236    public boolean isShowOrderNumber() {
    234237        return showOrderNumber;
     238    }
     239
     240    /**
     241     * Determines if the segment numbers of the selected way should be displayed
     242     * @return {@code true} if the segment numbers of the selected way should be displayed
     243     */
     244    public boolean isShowOrderNumberOnSelectedWay() {
     245        return showOrderNumberOnSelectedWay;
    235246    }
    236247
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java

    r10884 r11090  
    6060    /** Preference: should the segment numbers of ways be displayed */
    6161    protected boolean showOrderNumber;
     62    /** Preference: should the segment numbers of the selected be displayed */
     63    protected boolean showOrderNumberOnSelectedWay;
    6264    /** Preference: should selected nodes be filled */
    6365    protected boolean fillSelectedNode;
     
    134136        showHeadArrowOnly = settings.isShowHeadArrowOnly();
    135137        showOrderNumber = settings.isShowOrderNumber();
     138        showOrderNumberOnSelectedWay = settings.isShowOrderNumberOnSelectedWay();
    136139        selectedNodeSize = settings.getSelectedNodeSize();
    137140        unselectedNodeSize = settings.getUnselectedNodeSize();
     
    321324                    drawSegment(lastP, p, wayColor,
    322325                            showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow);
    323                     if (showOrderNumber && !isInactiveMode) {
     326                    if ((showOrderNumber || (showOrderNumberOnSelectedWay && w.isSelected())) && !isInactiveMode) {
    324327                        drawOrderNumber(lastP, p, orderNumber, g.getColor());
    325328                    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java

    r10748 r11090  
    116116                showOnlyHeadArrowOnly, showOneway, onewayReversed);
    117117
    118         if (paintSettings.isShowOrderNumber() && !painter.isInactiveMode()) {
     118        if ((paintSettings.isShowOrderNumber() || (paintSettings.isShowOrderNumberOnSelectedWay() && selected))
     119                && !painter.isInactiveMode()) {
    119120            int orderNumber = 0;
    120121            lastN = null;
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java

    r10611 r11090  
    4343    private final JCheckBox onewayArrow = new JCheckBox(tr("Draw oneway arrows."));
    4444    private final JCheckBox segmentOrderNumber = new JCheckBox(tr("Draw segment order numbers"));
     45    private final JCheckBox segmentOrderNumberOnSelectedWay = new JCheckBox(tr("Draw segment order numbers on selected way"));
    4546    private final JCheckBox sourceBounds = new JCheckBox(tr("Draw boundaries of downloaded data"));
    4647    private final JCheckBox virtualNodes = new JCheckBox(tr("Draw virtual nodes in select mode"));
     
    9293        segmentOrderNumber.setToolTipText(tr("Draw the order numbers of all segments within their way."));
    9394        segmentOrderNumber.setSelected(Main.pref.getBoolean("draw.segment.order_number", false));
     95        segmentOrderNumberOnSelectedWay.setToolTipText(tr("Draw the order numbers of all segments within their way."));
     96        segmentOrderNumberOnSelectedWay.setSelected(Main.pref.getBoolean("draw.segment.order_number.on_selected", false));
    9497
    9598        // downloaded area
     
    136139        panel.add(onewayArrow, GBC.eop().insets(20, 0, 0, 0));
    137140        panel.add(segmentOrderNumber, GBC.eop().insets(20, 0, 0, 0));
     141        panel.add(segmentOrderNumberOnSelectedWay, GBC.eop().insets(20, 0, 0, 0));
    138142
    139143        panel.add(new JLabel(tr("Select and draw mode options")),
     
    176180        Main.pref.put("draw.oneway", onewayArrow.isSelected());
    177181        Main.pref.put("draw.segment.order_number", segmentOrderNumber.isSelected());
     182        Main.pref.put("draw.segment.order_number.on_selected", segmentOrderNumberOnSelectedWay.isSelected());
    178183        Main.pref.put("draw.data.downloaded_area", sourceBounds.isSelected());
    179184        Main.pref.put("draw.data.inactive_color", inactive.isSelected());
Note: See TracChangeset for help on using the changeset viewer.