Changeset 20489 in osm for applications


Ignore:
Timestamp:
2010-03-15T12:48:23+01:00 (15 years ago)
Author:
guggis
Message:

Second version of the turn restrictions plugin

Location:
applications/editors/josm/plugins/turnrestrictions
Files:
22 added
3 edited
8 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnrestrictions/build.xml

    r20378 r20489  
    3131
    3232        <!-- enter the SVN commit message -->
    33         <property name="commit.message" value="Commit message" />
     33        <property name="commit.message" value="Second version of turnrestriction plugin. Still under development." />
    3434        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    35         <property name="plugin.main.version" value="" />
    36 
     35        <property name="plugin.main.version" value="3136" />
    3736
    3837        <!--
  • applications/editors/josm/plugins/turnrestrictions/data/test-data-set-1.osm

    r20384 r20489  
    22<osm version='0.6' generator='JOSM'>
    33  <bounds minlat='46.9185552' minlon='7.3901081' maxlat='46.9271138' maxlon='7.4086475' origin='OpenStreetMap server' />
    4   <node id='-86' action='modify' visible='true' lat='46.920401695281015' lon='7.392672484176534' />
    5   <node id='-84' action='modify' visible='true' lat='46.91947481836078' lon='7.394608244994619' />
    6   <node id='-82' visible='true' lat='46.91947481836078' lon='7.392692440473628' />
    7   <node id='-81' visible='true' lat='46.9194611876982' lon='7.391036067814855' />
    8   <node id='-71' visible='true' lat='46.920906018634135' lon='7.399118368137783' />
    9   <node id='-69' visible='true' lat='46.921737460284035' lon='7.40135347341227' />
    10   <node id='-67' visible='true' lat='46.921737460284035' lon='7.39909841184069' />
    11   <node id='-66' visible='true' lat='46.921737460284035' lon='7.3971426947255114' />
    12   <node id='-56' action='modify' visible='true' lat='46.92280059638277' lon='7.392991784930033' />
    13   <node id='-54' action='modify' visible='true' lat='46.92175109036751' lon='7.394767895371367' />
    14   <node id='-52' action='modify' visible='true' lat='46.92175109036752' lon='7.393011741227126' />
    15   <node id='-51' action='modify' visible='true' lat='46.921737460284014' lon='7.390916330032293' />
    16   <node id='-41' action='modify' visible='true' lat='46.92375467491946' lon='7.391245608934339' />
    17   <node id='-40' action='modify' visible='true' lat='46.92378193405656' lon='7.394298922389664' />
    18   <node id='-38' visible='true' lat='46.92450429613562' lon='7.394298922389665' />
    19   <node id='-37' action='modify' visible='true' lat='46.924517925515175' lon='7.391285521528527' />
    20   <node id='-28' visible='true' lat='46.925969434589156' lon='7.404077507965554' />
    21   <node id='-26' visible='true' lat='46.925955805578894' lon='7.401802490096877' />
    22   <node id='-25' visible='true' lat='46.925955805578894' lon='7.39940773444564' />
    23   <node id='-12' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92569685372496' lon='7.3913653467169' />
    24   <node id='-10' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92566959556225' lon='7.393261194940797' />
    25   <node id='-8' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92662362300419' lon='7.39328115123789' />
    26   <node id='-6' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.9265827364623' lon='7.395296737244347' />
    27   <node id='-4' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.9265827364623' lon='7.397511886221743' />
    28   <node id='-2' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.925560562772716' lon='7.397471973627557' />
    29   <way id='-88' action='modify' visible='true'>
    30     <nd ref='-82' />
    31     <nd ref='-84' />
     4  <node id='-106' action='modify' visible='true' lat='46.92028078273882' lon='7.401045898188405' />
     5  <node id='-104' action='modify' visible='true' lat='46.919302014885396' lon='7.401068288768116'>
     6    <tag k='name' v='node 8.3' />
     7  </node>
     8  <node id='-103' action='modify' visible='true' lat='46.91930201488541' lon='7.399142698913044' />
     9  <node id='-50' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.925560562772716' lon='7.397471973627557' />
     10  <node id='-48' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.9265827364623' lon='7.397511886221743' />
     11  <node id='-46' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.9265827364623' lon='7.395296737244347' />
     12  <node id='-44' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92662362300419' lon='7.39328115123789' />
     13  <node id='-42' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92566959556225' lon='7.393261194940797' />
     14  <node id='-40' timestamp='2010-03-09T09:06:53Z' visible='true' lat='46.92569685372496' lon='7.3913653467169' />
     15  <node id='-38' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.925955805578894' lon='7.39940773444564' />
     16  <node id='-36' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.925955805578894' lon='7.401802490096877' />
     17  <node id='-34' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.925969434589156' lon='7.404077507965554' />
     18  <node id='-32' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.924517925515175' lon='7.391285521528527' />
     19  <node id='-30' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92450429613562' lon='7.394298922389665' />
     20  <node id='-28' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92378193405656' lon='7.394298922389664' />
     21  <node id='-26' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92375467491946' lon='7.391245608934339' />
     22  <node id='-24' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.921737460284014' lon='7.390916330032293' />
     23  <node id='-22' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92175109036752' lon='7.393011741227126' />
     24  <node id='-20' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92175109036751' lon='7.394767895371367' />
     25  <node id='-18' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.92280059638277' lon='7.392991784930033' />
     26  <node id='-16' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.921737460284035' lon='7.3971426947255114' />
     27  <node id='-14' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.921737460284035' lon='7.39909841184069' />
     28  <node id='-12' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.921737460284035' lon='7.40135347341227' />
     29  <node id='-10' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.920906018634135' lon='7.399118368137783' />
     30  <node id='-8' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.9194611876982' lon='7.391036067814855' />
     31  <node id='-6' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.91947481836078' lon='7.392692440473628' />
     32  <node id='-4' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.91947481836078' lon='7.394608244994619' />
     33  <node id='-2' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true' lat='46.920401695281015' lon='7.392672484176534' />
     34  <way id='-107' action='modify' visible='true'>
     35    <nd ref='-104' />
     36    <nd ref='-106' />
     37    <tag k='name' v='way.8.2' />
     38  </way>
     39  <way id='-105' action='modify' visible='true'>
     40    <nd ref='-103' />
     41    <nd ref='-104' />
     42    <tag k='name' v='way.8.1' />
     43  </way>
     44  <way id='-86' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
     45    <nd ref='-48' />
     46    <nd ref='-50' />
     47    <tag k='name' v='Weg 2.2' />
     48  </way>
     49  <way id='-84' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
     50    <nd ref='-46' />
     51    <nd ref='-48' />
     52    <tag k='name' v='Weg 2.1' />
     53  </way>
     54  <way id='-82' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
     55    <nd ref='-42' />
     56    <nd ref='-44' />
     57    <tag k='name' v='Weg 1.2' />
     58  </way>
     59  <way id='-80' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
     60    <nd ref='-40' />
     61    <nd ref='-42' />
     62    <tag k='name' v='Weg 1.1' />
     63  </way>
     64  <way id='-78' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     65    <nd ref='-38' />
     66    <nd ref='-36' />
     67    <tag k='name' v='Weg 3.1' />
     68  </way>
     69  <way id='-76' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     70    <nd ref='-36' />
     71    <nd ref='-34' />
     72    <tag k='name' v='Weg 3.2' />
     73  </way>
     74  <way id='-74' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     75    <nd ref='-32' />
     76    <nd ref='-30' />
     77    <tag k='name' v='way 4.1' />
     78  </way>
     79  <way id='-72' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     80    <nd ref='-28' />
     81    <nd ref='-26' />
     82    <tag k='name' v='way 4.2' />
     83  </way>
     84  <way id='-70' timestamp='2010-03-15T09:31:53Z' visible='true'>
     85    <nd ref='-30' />
     86    <nd ref='-28' />
     87  </way>
     88  <way id='-68' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     89    <nd ref='-24' />
     90    <nd ref='-22' />
     91    <tag k='name' v='way 5.1' />
     92  </way>
     93  <way id='-66' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     94    <nd ref='-22' />
     95    <nd ref='-18' />
     96    <tag k='name' v='way 5.2' />
     97  </way>
     98  <way id='-64' timestamp='2010-03-15T09:31:53Z' visible='true'>
     99    <nd ref='-22' />
     100    <nd ref='-20' />
     101  </way>
     102  <way id='-62' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     103    <nd ref='-16' />
     104    <nd ref='-14' />
     105    <tag k='name' v='way 6.1' />
     106  </way>
     107  <way id='-60' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     108    <nd ref='-14' />
     109    <nd ref='-10' />
     110    <tag k='name' v='way 6.2' />
     111  </way>
     112  <way id='-58' timestamp='2010-03-15T09:31:53Z' visible='true'>
     113    <nd ref='-14' />
     114    <nd ref='-12' />
     115  </way>
     116  <way id='-56' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     117    <nd ref='-8' />
     118    <nd ref='-6' />
     119    <tag k='name' v='way 7.1' />
     120  </way>
     121  <way id='-54' timestamp='2010-03-15T09:31:53Z' visible='true'>
     122    <nd ref='-6' />
     123    <nd ref='-2' />
     124  </way>
     125  <way id='-52' action='modify' timestamp='2010-03-15T09:31:53Z' visible='true'>
     126    <nd ref='-6' />
     127    <nd ref='-4' />
    32128    <tag k='name' v='way 7.2' />
    33129  </way>
    34   <way id='-87' visible='true'>
    35     <nd ref='-82' />
    36     <nd ref='-86' />
    37   </way>
    38   <way id='-83' action='modify' visible='true'>
    39     <nd ref='-81' />
    40     <nd ref='-82' />
    41     <tag k='name' v='way 7.1' />
    42   </way>
    43   <way id='-73' visible='true'>
    44     <nd ref='-67' />
    45     <nd ref='-69' />
    46   </way>
    47   <way id='-72' action='modify' visible='true'>
    48     <nd ref='-67' />
    49     <nd ref='-71' />
    50     <tag k='name' v='way 6.2' />
    51   </way>
    52   <way id='-68' action='modify' visible='true'>
    53     <nd ref='-66' />
    54     <nd ref='-67' />
    55     <tag k='name' v='way 6.1' />
    56   </way>
    57   <way id='-59' visible='true'>
    58     <nd ref='-52' />
    59     <nd ref='-54' />
    60   </way>
    61   <way id='-57' action='modify' visible='true'>
    62     <nd ref='-52' />
    63     <nd ref='-56' />
    64     <tag k='name' v='way 5.2' />
    65   </way>
    66   <way id='-53' action='modify' visible='true'>
    67     <nd ref='-51' />
    68     <nd ref='-52' />
    69     <tag k='name' v='way 5.1' />
    70   </way>
    71   <way id='-44' visible='true'>
    72     <nd ref='-38' />
    73     <nd ref='-40' />
    74   </way>
    75   <way id='-42' action='modify' visible='true'>
    76     <nd ref='-40' />
    77     <nd ref='-41' />
    78     <tag k='name' v='way 4.2' />
    79   </way>
    80   <way id='-39' action='modify' visible='true'>
    81     <nd ref='-37' />
    82     <nd ref='-38' />
    83     <tag k='name' v='way 4.1' />
    84   </way>
    85   <way id='-30' action='modify' visible='true'>
    86     <nd ref='-26' />
    87     <nd ref='-28' />
    88     <tag k='name' v='Weg 3.2' />
    89   </way>
    90   <way id='-27' action='modify' visible='true'>
    91     <nd ref='-25' />
    92     <nd ref='-26' />
    93     <tag k='name' v='Weg 3.1' />
    94   </way>
    95   <way id='-20' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
    96     <nd ref='-12' />
    97     <nd ref='-10' />
    98     <tag k='name' v='Weg 1.1' />
    99   </way>
    100   <way id='-18' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
    101     <nd ref='-10' />
    102     <nd ref='-8' />
    103     <tag k='name' v='Weg 1.2' />
    104   </way>
    105   <way id='-16' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
    106     <nd ref='-6' />
    107     <nd ref='-4' />
    108     <tag k='name' v='Weg 2.1' />
    109   </way>
    110   <way id='-14' action='modify' timestamp='2010-03-09T09:06:53Z' visible='true'>
    111     <nd ref='-4' />
    112     <nd ref='-2' />
    113     <tag k='name' v='Weg 2.2' />
    114   </way>
    115   <relation id='-96' visible='true'>
    116     <member type='way' ref='-83' role='from' />
    117     <member type='way' ref='-88' role='to' />
    118     <member type='node' ref='-82' role='via' />
     130  <relation id='-100' timestamp='2010-03-09T09:06:53Z' visible='true'>
     131    <member type='way' ref='-84' role='from' />
     132    <member type='way' ref='-86' role='to' />
     133    <tag k='restriction' v='no_right_turn' />
     134    <tag k='type' v='restriction' />
     135  </relation>
     136  <relation id='-98' timestamp='2010-03-09T09:06:53Z' visible='true'>
     137    <member type='way' ref='-80' role='from' />
     138    <member type='way' ref='-82' role='to' />
     139    <tag k='restriction' v='no_left_turn' />
     140    <tag k='type' v='restriction' />
     141  </relation>
     142  <relation id='-96' timestamp='2010-03-15T09:31:53Z' visible='true'>
     143    <member type='way' ref='-78' role='from' />
     144    <member type='way' ref='-76' role='to' />
     145    <tag k='restriction' v='no_straight_on' />
     146    <tag k='type' v='restriction' />
     147  </relation>
     148  <relation id='-94' timestamp='2010-03-15T09:31:53Z' visible='true'>
     149    <member type='way' ref='-74' role='from' />
     150    <member type='way' ref='-72' role='to' />
     151    <member type='way' ref='-70' role='via' />
     152    <tag k='restriction' v='no_u_turn' />
     153    <tag k='type' v='restriction' />
     154  </relation>
     155  <relation id='-92' timestamp='2010-03-15T09:31:53Z' visible='true'>
     156    <member type='way' ref='-68' role='from' />
     157    <member type='way' ref='-66' role='to' />
     158    <member type='node' ref='-22' role='via' />
     159    <tag k='restriction' v='only_left_turn' />
     160    <tag k='type' v='restriction' />
     161  </relation>
     162  <relation id='-90' timestamp='2010-03-15T09:31:53Z' visible='true'>
     163    <member type='way' ref='-62' role='from' />
     164    <member type='way' ref='-60' role='to' />
     165    <member type='node' ref='-14' role='via' />
     166    <tag k='restriction' v='only_right_turn' />
     167    <tag k='type' v='restriction' />
     168  </relation>
     169  <relation id='-88' timestamp='2010-03-15T09:31:53Z' visible='true'>
     170    <member type='way' ref='-56' role='from' />
     171    <member type='way' ref='-52' role='to' />
     172    <member type='node' ref='-6' role='via' />
    119173    <tag k='restriction' v='only_straight_on' />
    120174    <tag k='type' v='restriction' />
    121175  </relation>
    122   <relation id='-80' visible='true'>
    123     <member type='way' ref='-68' role='from' />
    124     <member type='way' ref='-72' role='to' />
    125     <member type='node' ref='-67' role='via' />
    126     <tag k='restriction' v='only_right_turn' />
    127     <tag k='type' v='restriction' />
    128   </relation>
    129   <relation id='-65' visible='true'>
    130     <member type='way' ref='-53' role='from' />
    131     <member type='way' ref='-57' role='to' />
    132     <member type='node' ref='-52' role='via' />
    133     <tag k='restriction' v='only_left_turn' />
    134     <tag k='type' v='restriction' />
    135   </relation>
    136   <relation id='-48' visible='true'>
    137     <member type='way' ref='-39' role='from' />
    138     <member type='way' ref='-42' role='to' />
    139     <member type='way' ref='-44' role='via' />
    140     <tag k='restriction' v='no_u_turn' />
    141     <tag k='type' v='restriction' />
    142   </relation>
    143   <relation id='-36' visible='true'>
    144     <member type='way' ref='-27' role='from' />
    145     <member type='way' ref='-30' role='to' />
    146     <tag k='restriction' v='no_straight_on' />
    147     <tag k='type' v='restriction' />
    148   </relation>
    149   <relation id='-24' timestamp='2010-03-09T09:06:53Z' visible='true'>
    150     <member type='way' ref='-20' role='from' />
    151     <member type='way' ref='-18' role='to' />
    152     <tag k='restriction' v='no_left_turn' />
    153     <tag k='type' v='restriction' />
    154   </relation>
    155   <relation id='-22' timestamp='2010-03-09T09:06:53Z' visible='true'>
    156     <member type='way' ref='-16' role='from' />
    157     <member type='way' ref='-14' role='to' />
    158     <tag k='restriction' v='no_right_turn' />
    159     <tag k='type' v='restriction' />
    160   </relation>
    161176</osm>
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsPlugin.java

    r20384 r20489  
    55import org.openstreetmap.josm.plugins.Plugin;
    66import org.openstreetmap.josm.plugins.PluginInformation;
     7import org.openstreetmap.josm.plugins.turnrestrictions.list.TurnRestrictionsListDialog;
    78import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceEditor;
    89
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/AbstractTurnRestrictionsListView.java

    r20384 r20489  
    1 package org.openstreetmap.josm.plugins.turnrestrictions;
     1package org.openstreetmap.josm.plugins.turnrestrictions.list;
    22
    33import javax.swing.JList;
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionListCellRenderer.java

    r20384 r20489  
    1 package org.openstreetmap.josm.plugins.turnrestrictions;
     1package org.openstreetmap.josm.plugins.turnrestrictions.list;
    22
    33import static org.openstreetmap.josm.tools.I18n.tr;
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java

    r20384 r20489  
    1 package org.openstreetmap.josm.plugins.turnrestrictions;
     1package org.openstreetmap.josm.plugins.turnrestrictions.list;
    22
    33import java.util.Collection;
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java

    r20384 r20489  
    1 package org.openstreetmap.josm.plugins.turnrestrictions;
     1package org.openstreetmap.josm.plugins.turnrestrictions.list;
    22
    33import java.awt.BorderLayout;
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java

    r20384 r20489  
    1 package org.openstreetmap.josm.plugins.turnrestrictions;
     1package org.openstreetmap.josm.plugins.turnrestrictions.list;
    22
    33import java.util.Collection;
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java

    r20384 r20489  
    1 package org.openstreetmap.josm.plugins.turnrestrictions;
     1package org.openstreetmap.josm.plugins.turnrestrictions.list;
    22
    33import java.awt.BorderLayout;
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java

    r20384 r20489  
    1 package org.openstreetmap.josm.plugins.turnrestrictions;
     1package org.openstreetmap.josm.plugins.turnrestrictions.list;
    22
    33import static org.openstreetmap.josm.tools.I18n.tr;
     
    1212import java.util.HashSet;
    1313import java.util.List;
    14 import java.util.Set;
    1514
    1615import javax.swing.AbstractAction;
    17 import javax.swing.JButton;
    1816import javax.swing.JCheckBox;
    1917import javax.swing.JList;
     
    3533import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3634import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
     35import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditor;
     36import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditorManager;
    3737import org.openstreetmap.josm.tools.ImageProvider;
    3838
     
    216216        }
    217217
    218         public void launchEditor(Relation toEdit) {
    219             if (toEdit == null)
    220                 return;
    221             RelationEditor.getEditor(Main.map.mapView.getEditLayer(),toEdit, getMembersForCurrentSelection(toEdit)).setVisible(true);
    222         }
     218                public void launchEditor(Relation toEdit) {
     219                        if (toEdit == null)
     220                                return;
     221                        OsmDataLayer layer = Main.main.getEditLayer();
     222                        TurnRestrictionEditorManager manager = TurnRestrictionEditorManager.getInstance();
     223                        TurnRestrictionEditor editor = manager.getEditorForRelation(layer, toEdit);
     224                        if (editor != null) {
     225                                editor.setVisible(true);
     226                                editor.toFront();
     227                        } else {
     228                                editor = new TurnRestrictionEditor(
     229                                                TurnRestrictionsListDialog.this, layer,toEdit);
     230                                manager.positionOnScreen(editor);
     231                                manager.register(layer, toEdit,editor);
     232                                editor.setVisible(true);
     233                        }
     234                }
    223235
    224236        public void actionPerformed(ActionEvent e) {
     
    283295     *
    284296     */
    285     static class NewAction extends AbstractAction implements EditLayerChangeListener{
     297    class NewAction extends AbstractAction implements EditLayerChangeListener{
    286298        public NewAction() {
    287299            putValue(SHORT_DESCRIPTION,tr("Create a new turn restriction"));
     
    292304
    293305        public void run() {
    294             RelationEditor.getEditor(Main.main.getEditLayer(),null, null).setVisible(true);
     306                 Relation tr = new Relation();
     307                 OsmDataLayer layer =  Main.main.getEditLayer();
     308                 if (layer == null) return;
     309                 TurnRestrictionEditor editor = new TurnRestrictionEditor(TurnRestrictionsListDialog.this, layer);
     310             TurnRestrictionEditorManager.getInstance().positionOnScreen(editor);             
     311             TurnRestrictionEditorManager.getInstance().register(layer, tr, editor);
     312             editor.setVisible(true);
    295313        }
    296314
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java

    r20384 r20489  
    1 package org.openstreetmap.josm.plugins.turnrestrictions;
     1package org.openstreetmap.josm.plugins.turnrestrictions.list;
    22
    33import java.util.ArrayList;
Note: See TracChangeset for help on using the changeset viewer.