Ticket #9584: cardinaldirections.patch

File cardinaldirections.patch, 29.2 KB (added by mvexel, 12 years ago)
  • .classpath

     
    1 <?xml version="1.0" encoding="UTF-8"?>
    2 <classpath>
    3         <classpathentry kind="src" path="src"/>
    4         <classpathentry kind="src" path="test/unit"/>
    5         <classpathentry kind="src" path="test/functional"/>
    6         <classpathentry excluding="build/|data_nodist/|dist/|doc/|lib/|macosx/|nb/|src/|test/|test/build/|test/functional/|test/performance/|test/unit/|tools/|utils/" kind="src" path=""/>
    7         <classpathentry kind="src" path="test/performance"/>
    8         <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    9         <classpathentry kind="lib" path="test/lib/fest/fest-assert-1.0.jar"/>
    10         <classpathentry kind="lib" path="test/lib/fest/fest-reflect-1.1.jar"/>
    11         <classpathentry kind="lib" path="test/lib/fest/fest-swing-1.1.jar"/>
    12         <classpathentry kind="lib" path="test/lib/fest/fest-util-1.0.jar"/>
    13         <classpathentry kind="lib" path="test/lib/fest/jcip-annotations-1.0.jar"/>
    14         <classpathentry kind="lib" path="test/lib/fest/MRJToolkitStubs-1.0.jar"/>
    15         <classpathentry kind="lib" path="test/lib/jfcunit.jar"/>
    16         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    17         <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
    18         <classpathentry kind="lib" path="test/lib/unitils-core/commons-collections-3.2.jar"/>
    19         <classpathentry kind="lib" path="test/lib/unitils-core/commons-lang-2.3.jar"/>
    20         <classpathentry kind="lib" path="test/lib/unitils-core/commons-logging-1.1.jar"/>
    21         <classpathentry kind="lib" path="test/lib/unitils-core/ognl-2.6.9.jar"/>
    22         <classpathentry kind="lib" path="test/lib/unitils-core/unitils-core-3.3.jar"/>
    23         <classpathentry kind="lib" path="test/lib/fest/debug-1.0.jar"/>
    24         <classpathentry kind="output" path="bin"/>
    25 </classpath>
     1<?xml version="1.0" encoding="UTF-8"?>
     2<classpath>
     3        <classpathentry kind="src" path="src"/>
     4        <classpathentry kind="src" path="test/unit"/>
     5        <classpathentry kind="src" path="test/functional"/>
     6        <classpathentry excluding="build/|data_nodist/|dist/|doc/|lib/|macosx/|nb/|src/|test/|test/build/|test/functional/|test/performance/|test/unit/|tools/|utils/" kind="src" path=""/>
     7        <classpathentry kind="src" path="test/performance"/>
     8        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
     9        <classpathentry kind="lib" path="test/lib/fest/fest-assert-1.0.jar"/>
     10        <classpathentry kind="lib" path="test/lib/fest/fest-reflect-1.1.jar"/>
     11        <classpathentry kind="lib" path="test/lib/fest/fest-swing-1.1.jar"/>
     12        <classpathentry kind="lib" path="test/lib/fest/fest-util-1.0.jar"/>
     13        <classpathentry kind="lib" path="test/lib/fest/jcip-annotations-1.0.jar"/>
     14        <classpathentry kind="lib" path="test/lib/fest/MRJToolkitStubs-1.0.jar"/>
     15        <classpathentry kind="lib" path="test/lib/jfcunit.jar"/>
     16        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
     17        <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
     18        <classpathentry kind="lib" path="test/lib/unitils-core/commons-collections-3.2.jar"/>
     19        <classpathentry kind="lib" path="test/lib/unitils-core/commons-lang-2.3.jar"/>
     20        <classpathentry kind="lib" path="test/lib/unitils-core/commons-logging-1.1.jar"/>
     21        <classpathentry kind="lib" path="test/lib/unitils-core/ognl-2.6.9.jar"/>
     22        <classpathentry kind="lib" path="test/lib/unitils-core/unitils-core-3.3.jar"/>
     23        <classpathentry kind="lib" path="test/lib/fest/debug-1.0.jar"/>
     24        <classpathentry kind="lib" path="test/lib/junit/hamcrest-core-1.3.jar"/>
     25        <classpathentry kind="output" path="bin"/>
     26</classpath>
  • REVISION.XML

     
     1fatal: Not a git repository (or any of the parent directories): .git
  • src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java

     
    149149
    150150    private static final StringSwitcher[] stringSwitchers = new StringSwitcher[] {
    151151        new StringSwitcher("left", "right"),
    152         new StringSwitcher("forwards", "backwards"),
     152        new StringSwitcher("forward", "backward"),
    153153        new StringSwitcher("east", "west"),
    154154        new StringSwitcher("north", "south"),
    155155        FORWARD_BACKWARD, UP_DOWN
     
    193193    @Override
    194194    public Collection<Command> execute(Way oldway, Way way) throws UserCancelException {
    195195        Map<OsmPrimitive, List<TagCorrection>> tagCorrectionsMap =
    196             new HashMap<OsmPrimitive, List<TagCorrection>>();
     196                new HashMap<OsmPrimitive, List<TagCorrection>>();
    197197
    198198        List<TagCorrection> tagCorrections = new ArrayList<TagCorrection>();
    199199        for (String key : way.keySet()) {
     
    219219        }
    220220
    221221        Map<OsmPrimitive, List<RoleCorrection>> roleCorrectionMap =
    222             new HashMap<OsmPrimitive, List<RoleCorrection>>();
     222                new HashMap<OsmPrimitive, List<RoleCorrection>>();
    223223        List<RoleCorrection> roleCorrections = new ArrayList<RoleCorrection>();
    224224
    225225        Collection<OsmPrimitive> referrers = oldway.getReferrers();
  • src/org/openstreetmap/josm/data/validation/tests/ConditionalKeys.java

     
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.validation.tests;
    33
    4 import org.openstreetmap.josm.data.osm.OsmPrimitive;
    5 import org.openstreetmap.josm.data.validation.Severity;
    6 import org.openstreetmap.josm.data.validation.Test;
    7 import org.openstreetmap.josm.data.validation.TestError;
    8 import org.openstreetmap.josm.tools.Predicates;
    9 import org.openstreetmap.josm.tools.Utils;
     4import static org.openstreetmap.josm.tools.I18n.tr;
    105
    116import java.util.ArrayList;
    127import java.util.Arrays;
     
    1712import java.util.regex.Matcher;
    1813import java.util.regex.Pattern;
    1914
    20 import static org.openstreetmap.josm.tools.I18n.tr;
     15import org.openstreetmap.josm.data.osm.OsmPrimitive;
     16import org.openstreetmap.josm.data.validation.Severity;
     17import org.openstreetmap.josm.data.validation.Test;
     18import org.openstreetmap.josm.data.validation.TestError;
     19import org.openstreetmap.josm.tools.Predicates;
     20import org.openstreetmap.josm.tools.Utils;
    2121
    2222public class ConditionalKeys extends Test.TagTest {
    2323
     
    5555    }
    5656
    5757    public static boolean isDirection(String part) {
    58         return "forward".equals(part) || "backward".equals(part);
     58        return "forward".equals(part) || "backward".equals(part) ||
     59                (part != null && (part.startsWith("north") || part.startsWith("south") ||
     60                        part.startsWith("east") || part.startsWith("west")));
    5961    }
    6062
    6163    public boolean isKeyValid(String key) {
     
    6870        return parts.length == 3 && isRestrictionType(parts[0]) && isTransportationMode(parts[1]) && isDirection(parts[2])
    6971                || parts.length == 1 && (isRestrictionType(parts[0]) || isTransportationMode(parts[0]))
    7072                || parts.length == 2 && (
    71                 isRestrictionType(parts[0]) && (isTransportationMode(parts[1]) || isDirection(parts[1]))
     73                        isRestrictionType(parts[0]) && (isTransportationMode(parts[1]) || isDirection(parts[1]))
    7274                        || isTransportationMode(parts[0]) && isDirection(parts[1]));
    7375    }
    7476
  • src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java

     
    120120    }
    121121
    122122    ListSelectionListener highlighterListener = new ListSelectionListener() {
    123             @Override
    124             public void valueChanged(ListSelectionEvent lse) {
    125                 if (Main.isDisplayingMapView()) {
    126                     Collection<RelationMember> sel = getMemberTableModel().getSelectedMembers();
    127                     final List<OsmPrimitive> toHighlight = new ArrayList<OsmPrimitive>();
    128                     for (RelationMember r: sel) {
    129                         if (r.getMember().isUsable()) {
    130                             toHighlight.add(r.getMember());
     123        @Override
     124        public void valueChanged(ListSelectionEvent lse) {
     125            if (Main.isDisplayingMapView()) {
     126                Collection<RelationMember> sel = getMemberTableModel().getSelectedMembers();
     127                final List<OsmPrimitive> toHighlight = new ArrayList<OsmPrimitive>();
     128                for (RelationMember r: sel) {
     129                    if (r.getMember().isUsable()) {
     130                        toHighlight.add(r.getMember());
     131                    }
     132                }
     133                SwingUtilities.invokeLater(new Runnable() {
     134                    @Override
     135                    public void run() {
     136                        if (highlightHelper.highlightOnly(toHighlight)) {
     137                            Main.map.mapView.repaint();
    131138                        }
    132139                    }
    133                     SwingUtilities.invokeLater(new Runnable() {
    134                         @Override
    135                         public void run() {
    136                             if (highlightHelper.highlightOnly(toHighlight)) {
    137                                 Main.map.mapView.repaint();
    138                             }
    139                         }
    140                     });
    141                 }
    142             }};
     140                });
     141            }
     142        }};
    143143
    144     private void initHighlighting() {
    145         highlightEnabled = Main.pref.getBoolean("draw.target-highlight", true);
    146         if (!highlightEnabled) return;
    147         getMemberTableModel().getSelectionModel().addListSelectionListener(highlighterListener);
    148         if (Main.isDisplayingMapView()) {
    149             HighlightHelper.clearAllHighlighted();
    150             Main.map.mapView.repaint();
     144        private void initHighlighting() {
     145            highlightEnabled = Main.pref.getBoolean("draw.target-highlight", true);
     146            if (!highlightEnabled) return;
     147            getMemberTableModel().getSelectionModel().addListSelectionListener(highlighterListener);
     148            if (Main.isDisplayingMapView()) {
     149                HighlightHelper.clearAllHighlighted();
     150                Main.map.mapView.repaint();
     151            }
    151152        }
    152     }
    153153
    154     /**
    155      * Action to be run when the user navigates to the next cell in the table, for instance by
    156      * pressing TAB or ENTER. The action alters the standard navigation path from cell to cell: <ul>
    157      * <li>it jumps over cells in the first column</li> <li>it automatically add a new empty row
    158      * when the user leaves the last cell in the table</li></ul>
    159      *
    160      *
    161      */
    162     class SelectNextColumnCellAction extends AbstractAction {
    163         @Override
    164         public void actionPerformed(ActionEvent e) {
    165             run();
    166         }
    167 
    168         public void run() {
    169             int col = getSelectedColumn();
    170             int row = getSelectedRow();
    171             if (getCellEditor() != null) {
    172                 getCellEditor().stopCellEditing();
     154        /**
     155         * Action to be run when the user navigates to the next cell in the table, for instance by
     156         * pressing TAB or ENTER. The action alters the standard navigation path from cell to cell: <ul>
     157         * <li>it jumps over cells in the first column</li> <li>it automatically add a new empty row
     158         * when the user leaves the last cell in the table</li></ul>
     159         *
     160         *
     161         */
     162        class SelectNextColumnCellAction extends AbstractAction {
     163            @Override
     164            public void actionPerformed(ActionEvent e) {
     165                run();
    173166            }
    174167
    175             if (col == 0 && row < getRowCount() - 1) {
    176                 row++;
    177             } else if (row < getRowCount() - 1) {
    178                 col = 0;
    179                 row++;
    180             } else {
    181                 // go to next component, no more rows in this table
    182                 KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
    183                 manager.focusNextComponent();
    184                 return;
     168            public void run() {
     169                int col = getSelectedColumn();
     170                int row = getSelectedRow();
     171                if (getCellEditor() != null) {
     172                    getCellEditor().stopCellEditing();
     173                }
     174
     175                if (col == 0 && row < getRowCount() - 1) {
     176                    row++;
     177                } else if (row < getRowCount() - 1) {
     178                    col = 0;
     179                    row++;
     180                } else {
     181                    // go to next component, no more rows in this table
     182                    KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
     183                    manager.focusNextComponent();
     184                    return;
     185                }
     186                changeSelection(row, col, false, false);
    185187            }
    186             changeSelection(row, col, false, false);
    187188        }
    188     }
    189189
    190     /**
    191      * Action to be run when the user navigates to the previous cell in the table, for instance by
    192      * pressing Shift-TAB
    193      *
    194      */
    195     private class SelectPreviousColumnCellAction extends AbstractAction {
     190        /**
     191         * Action to be run when the user navigates to the previous cell in the table, for instance by
     192         * pressing Shift-TAB
     193         *
     194         */
     195        private class SelectPreviousColumnCellAction extends AbstractAction {
    196196
    197         @Override
    198         public void actionPerformed(ActionEvent e) {
    199             int col = getSelectedColumn();
    200             int row = getSelectedRow();
    201             if (getCellEditor() != null) {
    202                 getCellEditor().stopCellEditing();
    203             }
     197            @Override
     198            public void actionPerformed(ActionEvent e) {
     199                int col = getSelectedColumn();
     200                int row = getSelectedRow();
     201                if (getCellEditor() != null) {
     202                    getCellEditor().stopCellEditing();
     203                }
    204204
    205             if (col <= 0 && row <= 0) {
    206                 // change nothing
    207             } else if (row > 0) {
    208                 col = 0;
    209                 row--;
     205                if (col <= 0 && row <= 0) {
     206                    // change nothing
     207                } else if (row > 0) {
     208                    col = 0;
     209                    row--;
     210                }
     211                changeSelection(row, col, false, false);
    210212            }
    211             changeSelection(row, col, false, false);
    212213        }
    213     }
    214214
    215     @Override
    216     public void unlinkAsListener() {
    217         super.unlinkAsListener();
    218         MapView.removeLayerChangeListener(zoomToGap);
    219     }
     215        @Override
     216        public void unlinkAsListener() {
     217            super.unlinkAsListener();
     218            MapView.removeLayerChangeListener(zoomToGap);
     219        }
    220220
    221     public void stopHighlighting() {
    222         if (highlighterListener == null) return;
    223         if (!highlightEnabled) return;
    224         getMemberTableModel().getSelectionModel().removeListSelectionListener(highlighterListener);
    225         highlighterListener = null;
    226         if (Main.isDisplayingMapView()) {
    227             HighlightHelper.clearAllHighlighted();
    228             Main.map.mapView.repaint();
     221        public void stopHighlighting() {
     222            if (highlighterListener == null) return;
     223            if (!highlightEnabled) return;
     224            getMemberTableModel().getSelectionModel().removeListSelectionListener(highlighterListener);
     225            highlighterListener = null;
     226            if (Main.isDisplayingMapView()) {
     227                HighlightHelper.clearAllHighlighted();
     228                Main.map.mapView.repaint();
     229            }
    229230        }
    230     }
    231231
    232     private class SelectPreviousGapAction extends AbstractAction {
     232        private class SelectPreviousGapAction extends AbstractAction {
    233233
    234         public SelectPreviousGapAction() {
    235             putValue(NAME, tr("Select previous Gap"));
    236             putValue(SHORT_DESCRIPTION, tr("Select the previous relation member which gives rise to a gap"));
    237         }
     234            public SelectPreviousGapAction() {
     235                putValue(NAME, tr("Select previous Gap"));
     236                putValue(SHORT_DESCRIPTION, tr("Select the previous relation member which gives rise to a gap"));
     237            }
    238238
    239         @Override
    240         public void actionPerformed(ActionEvent e) {
    241             int i = getSelectedRow() - 1;
    242             while (i >= 0 && getMemberTableModel().getWayConnection(i).linkPrev) {
    243                 i--;
     239            @Override
     240            public void actionPerformed(ActionEvent e) {
     241                int i = getSelectedRow() - 1;
     242                while (i >= 0 && getMemberTableModel().getWayConnection(i).linkPrev) {
     243                    i--;
     244                }
     245                if (i >= 0) {
     246                    getSelectionModel().setSelectionInterval(i, i);
     247                }
    244248            }
    245             if (i >= 0) {
    246                 getSelectionModel().setSelectionInterval(i, i);
    247             }
    248249        }
    249     }
    250250
    251     private class SelectNextGapAction extends AbstractAction {
     251        private class SelectNextGapAction extends AbstractAction {
    252252
    253         public SelectNextGapAction() {
    254             putValue(NAME, tr("Select next Gap"));
    255             putValue(SHORT_DESCRIPTION, tr("Select the next relation member which gives rise to a gap"));
    256         }
     253            public SelectNextGapAction() {
     254                putValue(NAME, tr("Select next Gap"));
     255                putValue(SHORT_DESCRIPTION, tr("Select the next relation member which gives rise to a gap"));
     256            }
    257257
    258         @Override
    259         public void actionPerformed(ActionEvent e) {
    260             int i = getSelectedRow() + 1;
    261             while (i < getRowCount() && getMemberTableModel().getWayConnection(i).linkNext) {
    262                 i++;
     258            @Override
     259            public void actionPerformed(ActionEvent e) {
     260                int i = getSelectedRow() + 1;
     261                while (i < getRowCount() && getMemberTableModel().getWayConnection(i).linkNext) {
     262                    i++;
     263                }
     264                if (i < getRowCount()) {
     265                    getSelectionModel().setSelectionInterval(i, i);
     266                }
    263267            }
    264             if (i < getRowCount()) {
    265                 getSelectionModel().setSelectionInterval(i, i);
    266             }
    267268        }
    268     }
    269269
    270     private class ZoomToGapAction extends AbstractAction implements LayerChangeListener, ListSelectionListener {
     270        private class ZoomToGapAction extends AbstractAction implements LayerChangeListener, ListSelectionListener {
    271271
    272         public ZoomToGapAction() {
    273             putValue(NAME, tr("Zoom to Gap"));
    274             putValue(SHORT_DESCRIPTION, tr("Zoom to the gap in the way sequence"));
    275             updateEnabledState();
    276         }
     272            public ZoomToGapAction() {
     273                putValue(NAME, tr("Zoom to Gap"));
     274                putValue(SHORT_DESCRIPTION, tr("Zoom to the gap in the way sequence"));
     275                updateEnabledState();
     276            }
    277277
    278         private WayConnectionType getConnectionType() {
    279             return getMemberTableModel().getWayConnection(getSelectedRows()[0]);
    280         }
     278            private WayConnectionType getConnectionType() {
     279                return getMemberTableModel().getWayConnection(getSelectedRows()[0]);
     280            }
    281281
    282         private final Collection<Direction> connectionTypesOfInterest = Arrays.asList(WayConnectionType.Direction.FORWARD, WayConnectionType.Direction.BACKWARD);
     282            private final Collection<Direction> connectionTypesOfInterest = Arrays.asList(WayConnectionType.Direction.FORWARD, WayConnectionType.Direction.BACKWARD);
    283283
    284         private boolean hasGap() {
    285             WayConnectionType connectionType = getConnectionType();
    286             return connectionTypesOfInterest.contains(connectionType.direction)
    287                     && !(connectionType.linkNext && connectionType.linkPrev);
    288         }
     284            private boolean hasGap() {
     285                WayConnectionType connectionType = getConnectionType();
     286                return connectionTypesOfInterest.contains(connectionType.direction.interpretation())
     287                        && !(connectionType.linkNext && connectionType.linkPrev);
     288            }
    289289
    290         @Override
    291         public void actionPerformed(ActionEvent e) {
    292             WayConnectionType connectionType = getConnectionType();
    293             Way way = (Way) getMemberTableModel().getReferredPrimitive(getSelectedRows()[0]);
    294             if (!connectionType.linkPrev) {
    295                 getLayer().data.setSelected(WayConnectionType.Direction.FORWARD.equals(connectionType.direction)
    296                         ? way.firstNode() : way.lastNode());
    297                 AutoScaleAction.autoScale("selection");
    298             } else if (!connectionType.linkNext) {
    299                 getLayer().data.setSelected(WayConnectionType.Direction.FORWARD.equals(connectionType.direction)
    300                         ? way.lastNode() : way.firstNode());
    301                 AutoScaleAction.autoScale("selection");
     290            @Override
     291            public void actionPerformed(ActionEvent e) {
     292                WayConnectionType connectionType = getConnectionType();
     293                Way way = (Way) getMemberTableModel().getReferredPrimitive(getSelectedRows()[0]);
     294                if (!connectionType.linkPrev) {
     295                    getLayer().data.setSelected(WayConnectionType.Direction.FORWARD.equals(connectionType.direction.interpretation())
     296                            ? way.firstNode() : way.lastNode());
     297                    AutoScaleAction.autoScale("selection");
     298                } else if (!connectionType.linkNext) {
     299                    getLayer().data.setSelected(WayConnectionType.Direction.FORWARD.equals(connectionType.direction.interpretation())
     300                            ? way.lastNode() : way.firstNode());
     301                    AutoScaleAction.autoScale("selection");
     302                }
    302303            }
    303         }
    304304
    305         private void updateEnabledState() {
    306             setEnabled(Main.main != null
    307                     && Main.main.getEditLayer() == getLayer()
    308                     && getSelectedRowCount() == 1
    309                     && hasGap());
    310         }
     305            private void updateEnabledState() {
     306                setEnabled(Main.main != null
     307                        && Main.main.getEditLayer() == getLayer()
     308                        && getSelectedRowCount() == 1
     309                        && hasGap());
     310            }
    311311
    312         @Override
    313         public void valueChanged(ListSelectionEvent e) {
    314             updateEnabledState();
    315         }
     312            @Override
     313            public void valueChanged(ListSelectionEvent e) {
     314                updateEnabledState();
     315            }
    316316
    317         @Override
    318         public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    319             updateEnabledState();
    320         }
     317            @Override
     318            public void activeLayerChange(Layer oldLayer, Layer newLayer) {
     319                updateEnabledState();
     320            }
    321321
    322         @Override
    323         public void layerAdded(Layer newLayer) {
    324             updateEnabledState();
     322            @Override
     323            public void layerAdded(Layer newLayer) {
     324                updateEnabledState();
     325            }
     326
     327            @Override
     328            public void layerRemoved(Layer oldLayer) {
     329                updateEnabledState();
     330            }
    325331        }
    326332
    327         @Override
    328         public void layerRemoved(Layer oldLayer) {
    329             updateEnabledState();
     333        protected MemberTableModel getMemberTableModel() {
     334            return (MemberTableModel) getModel();
    330335        }
    331     }
    332 
    333     protected MemberTableModel getMemberTableModel() {
    334         return (MemberTableModel) getModel();
    335     }
    336336}
  • src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java

     
    161161        /* special icons */
    162162        Image arrow = null;
    163163        switch (value.direction) {
     164        case NORTH:
     165        case EAST:
    164166        case FORWARD:
    165167            arrow = arrowDown;
    166168            break;
     169        case SOUTH:
     170        case WEST:
    167171        case BACKWARD:
    168172            arrow = arrowUp;
    169173            break;
  • src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java

     
    1515    private RelationSortUtils() {
    1616        // Hide default constructor for utils classes
    1717    }
    18    
     18
    1919    /**
    2020     * determine, if the way i is a roundabout and if yes, what type of roundabout
    2121     */
     
    4949    }
    5050
    5151    static boolean isBackward(final RelationMember member){
    52         return member.getRole().equals("backward");
     52        return member.getRole().equals("backward") || member.getRole().startsWith("south") || member.getRole().startsWith("west");
    5353    }
    5454
    5555    static boolean isForward(final RelationMember member){
    56         return member.getRole().equals("forward");
     56        return member.getRole().equals("forward") || member.getRole().startsWith("north") || member.getRole().startsWith("east");
    5757    }
    5858
    5959    static boolean isOneway(final RelationMember member){
  • src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionType.java

     
    2525    public Direction direction;
    2626
    2727    public enum Direction {
    28         FORWARD, BACKWARD, ROUNDABOUT_LEFT, ROUNDABOUT_RIGHT, NONE;
     28        FORWARD {
     29            @Override
     30            public Direction interpretation() {
     31                return FORWARD;
     32            }
     33        },
     34        BACKWARD {
     35            @Override
     36            public Direction interpretation() {
     37                return BACKWARD;
     38            }
     39        },
     40        ROUNDABOUT_LEFT {
     41            @Override
     42            public Direction interpretation() {
     43                return FORWARD;
     44            }
     45        },
     46        ROUNDABOUT_RIGHT {
     47            @Override
     48            public Direction interpretation() {
     49                return BACKWARD;
     50            }
     51        },
     52        NONE {
     53            @Override
     54            public Direction interpretation() {
     55                return FORWARD;
     56            }
     57        },
     58        NORTH {
     59            @Override
     60            public Direction interpretation() {
     61                return FORWARD;
     62            }
     63        },
     64        SOUTH {
     65            @Override
     66            public Direction interpretation() {
     67                return BACKWARD;
     68            }
     69        },
     70        EAST {
     71            @Override
     72            public Direction interpretation() {
     73                return FORWARD;
     74            }
     75        },
     76        WEST {
     77            @Override
     78            public Direction interpretation() {
     79                return BACKWARD;
     80            }
     81        };
    2982
     83        public abstract Direction interpretation();
     84
    3085        public boolean isRoundabout() {
    3186            return this == ROUNDABOUT_RIGHT || this == ROUNDABOUT_LEFT;
    3287        }
  • src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java

     
    248248        List<Node> refNodes= new ArrayList<Node>();
    249249
    250250        switch (ref_direction) {
     251        case NORTH:
     252        case EAST:
    251253        case FORWARD:
    252254            refNodes.add(way_ref.lastNode());
    253255            break;
     256        case SOUTH:
     257        case WEST:
    254258        case BACKWARD:
    255259            refNodes.add(way_ref.firstNode());
    256260            break;
  • src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

     
    171171
    172172        public boolean required = false;
    173173        public long count = 0;
     174       
     175        @Override
     176        public String toString() {
     177            return "[Role key = " + key + ", text = " + text + "]";
     178        }
    174179
    175180        public void setType(String types) throws SAXException {
    176181            this.types = getType(types);