Changeset 27751 in osm
- Timestamp:
- 2012-02-12T07:09:05+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/conflation/build.xml
r27742 r27751 44 44 <property name="plugin.dist.dir" value="../../dist"/> 45 45 <property name="ant.build.javac.target" value="1.5"/> 46 <property name="ant.build.javac.source" value="1.5"/> 46 47 <property name="plugin.dist.dir" value="../../dist"/> 47 48 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> -
applications/editors/josm/plugins/conflation/src/org/openstreetmap/josm/plugins/conflation/ConflationLayer.java
r27742 r27751 173 173 selectedCandidate = c; 174 174 } 175 176 public ConflationCandidate getSelectedCandidate() { 177 return selectedCandidate; 178 } 175 179 } -
applications/editors/josm/plugins/conflation/src/org/openstreetmap/josm/plugins/conflation/ConflationOptionsPanel.form
r27742 r27751 12 12 <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 13 13 <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 14 <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0, 2,4,0,0,2,-102"/>14 <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,24,0,0,1,-80"/> 15 15 </AuxValues> 16 16 … … 30 30 </Constraints> 31 31 32 <Layout> 33 <DimensionLayout dim="0"> 34 <Group type="103" groupAlignment="0" attributes="0"> 35 <Group type="102" attributes="0"> 36 <Group type="103" groupAlignment="0" attributes="0"> 37 <Component id="nonRefSetPanel" alignment="0" max="32767" attributes="0"/> 38 <Component id="refSetPanel" alignment="0" max="32767" attributes="0"/> 39 <Group type="102" alignment="1" attributes="0"> 40 <EmptySpace max="-2" attributes="0"/> 41 <Component id="objectTabCancelButton" min="-2" max="-2" attributes="0"/> 42 <EmptySpace min="-2" pref="81" max="-2" attributes="0"/> 43 <Component id="objectTabNextButton" min="-2" max="-2" attributes="0"/> 44 </Group> 45 </Group> 46 <EmptySpace max="-2" attributes="0"/> 47 </Group> 48 </Group> 49 </DimensionLayout> 50 <DimensionLayout dim="1"> 51 <Group type="103" groupAlignment="0" attributes="0"> 52 <Group type="102" attributes="0"> 53 <Component id="refSetPanel" min="-2" max="-2" attributes="0"/> 54 <EmptySpace max="-2" attributes="0"/> 55 <Component id="nonRefSetPanel" min="-2" max="-2" attributes="0"/> 56 <EmptySpace max="-2" attributes="0"/> 57 <Group type="103" groupAlignment="3" attributes="0"> 58 <Component id="objectTabNextButton" alignment="3" min="-2" max="-2" attributes="0"/> 59 <Component id="objectTabCancelButton" alignment="3" min="-2" max="-2" attributes="0"/> 60 </Group> 61 <EmptySpace min="-2" pref="55" max="-2" attributes="0"/> 62 </Group> 63 </Group> 64 </DimensionLayout> 32 <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"> 33 <Property name="axis" type="int" value="3"/> 65 34 </Layout> 66 35 <SubComponents> … … 74 43 </Properties> 75 44 76 <Layout> 77 <DimensionLayout dim="0"> 78 <Group type="103" groupAlignment="0" attributes="0"> 79 <Group type="102" attributes="0"> 80 <EmptySpace max="-2" attributes="0"/> 81 <Group type="103" groupAlignment="0" attributes="0"> 82 <Group type="102" attributes="0"> 83 <Component id="freezeMySetButton" min="-2" max="-2" attributes="0"/> 84 <EmptySpace pref="387" max="32767" attributes="0"/> 85 <Component id="restoreMySetButton" min="-2" max="-2" attributes="0"/> 86 </Group> 87 <Group type="102" alignment="0" attributes="0"> 88 <Group type="103" groupAlignment="0" attributes="0"> 89 <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> 90 <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> 91 <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> 92 <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> 93 </Group> 94 <EmptySpace type="unrelated" max="-2" attributes="0"/> 95 <Group type="103" groupAlignment="0" attributes="0"> 96 <Component id="myLayerLabel" alignment="0" min="-2" max="-2" attributes="0"/> 97 <Component id="myNodeCountLabel" alignment="0" min="-2" max="-2" attributes="0"/> 98 <Component id="myWayCountLabel" alignment="0" min="-2" max="-2" attributes="0"/> 99 <Component id="myRelationCountLabel" alignment="0" min="-2" max="-2" attributes="0"/> 100 </Group> 101 </Group> 102 </Group> 103 <EmptySpace max="-2" attributes="0"/> 104 </Group> 105 </Group> 106 </DimensionLayout> 107 <DimensionLayout dim="1"> 108 <Group type="103" groupAlignment="0" attributes="0"> 109 <Group type="102" alignment="0" attributes="0"> 110 <EmptySpace max="-2" attributes="0"/> 111 <Group type="103" groupAlignment="3" attributes="0"> 112 <Component id="freezeMySetButton" alignment="3" min="-2" max="-2" attributes="0"/> 113 <Component id="restoreMySetButton" alignment="3" min="-2" max="-2" attributes="0"/> 114 </Group> 115 <EmptySpace type="unrelated" max="-2" attributes="0"/> 116 <Group type="103" groupAlignment="3" attributes="0"> 117 <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> 118 <Component id="myLayerLabel" alignment="3" min="-2" max="-2" attributes="0"/> 119 </Group> 120 <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> 121 <Group type="103" groupAlignment="3" attributes="0"> 122 <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> 123 <Component id="myNodeCountLabel" alignment="3" min="-2" pref="14" max="-2" attributes="0"/> 124 </Group> 125 <EmptySpace type="unrelated" max="-2" attributes="0"/> 126 <Group type="103" groupAlignment="3" attributes="0"> 127 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> 128 <Component id="myWayCountLabel" alignment="3" min="-2" max="-2" attributes="0"/> 129 </Group> 130 <EmptySpace type="unrelated" max="-2" attributes="0"/> 131 <Group type="103" groupAlignment="3" attributes="0"> 132 <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> 133 <Component id="myRelationCountLabel" alignment="3" min="-2" max="-2" attributes="0"/> 134 </Group> 135 <EmptySpace pref="38" max="32767" attributes="0"/> 136 </Group> 137 </Group> 138 </DimensionLayout> 139 </Layout> 45 <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> 140 46 <SubComponents> 141 47 <Component class="javax.swing.JButton" name="freezeMySetButton"> … … 147 53 </Events> 148 54 </Component> 55 <Container class="javax.swing.JPanel" name="jPanel3"> 56 57 <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout"> 58 <Property name="columns" type="int" value="2"/> 59 <Property name="horizontalGap" type="int" value="2"/> 60 <Property name="rows" type="int" value="0"/> 61 </Layout> 62 <SubComponents> 63 <Component class="javax.swing.JLabel" name="jLabel2"> 64 <Properties> 65 <Property name="text" type="java.lang.String" value="Layer"/> 66 </Properties> 67 </Component> 68 <Component class="javax.swing.JLabel" name="myLayerLabel"> 69 <Properties> 70 <Property name="text" type="java.lang.String" value="(invalid)"/> 71 </Properties> 72 </Component> 73 <Component class="javax.swing.JLabel" name="jLabel1"> 74 <Properties> 75 <Property name="text" type="java.lang.String" value="Nodes"/> 76 </Properties> 77 </Component> 78 <Component class="javax.swing.JLabel" name="myNodeCountLabel"> 79 <Properties> 80 <Property name="text" type="java.lang.String" value="0"/> 81 </Properties> 82 </Component> 83 <Component class="javax.swing.JLabel" name="jLabel3"> 84 <Properties> 85 <Property name="text" type="java.lang.String" value="Ways"/> 86 </Properties> 87 </Component> 88 <Component class="javax.swing.JLabel" name="myWayCountLabel"> 89 <Properties> 90 <Property name="text" type="java.lang.String" value="0"/> 91 </Properties> 92 </Component> 93 <Component class="javax.swing.JLabel" name="jLabel4"> 94 <Properties> 95 <Property name="text" type="java.lang.String" value="Relations"/> 96 </Properties> 97 </Component> 98 <Component class="javax.swing.JLabel" name="myRelationCountLabel"> 99 <Properties> 100 <Property name="text" type="java.lang.String" value="0"/> 101 </Properties> 102 </Component> 103 </SubComponents> 104 </Container> 149 105 <Component class="javax.swing.JButton" name="restoreMySetButton"> 150 106 <Properties> … … 154 110 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="restoreMySetButtonActionPerformed"/> 155 111 </Events> 156 </Component>157 <Component class="javax.swing.JLabel" name="jLabel1">158 <Properties>159 <Property name="text" type="java.lang.String" value="Nodes"/>160 </Properties>161 </Component>162 <Component class="javax.swing.JLabel" name="jLabel2">163 <Properties>164 <Property name="text" type="java.lang.String" value="Layer"/>165 </Properties>166 </Component>167 <Component class="javax.swing.JLabel" name="jLabel3">168 <Properties>169 <Property name="text" type="java.lang.String" value="Ways"/>170 </Properties>171 </Component>172 <Component class="javax.swing.JLabel" name="jLabel4">173 <Properties>174 <Property name="text" type="java.lang.String" value="Relations"/>175 </Properties>176 </Component>177 <Component class="javax.swing.JLabel" name="myRelationCountLabel">178 <Properties>179 <Property name="text" type="java.lang.String" value="0"/>180 </Properties>181 </Component>182 <Component class="javax.swing.JLabel" name="myWayCountLabel">183 <Properties>184 <Property name="text" type="java.lang.String" value="0"/>185 </Properties>186 </Component>187 <Component class="javax.swing.JLabel" name="myNodeCountLabel">188 <Properties>189 <Property name="text" type="java.lang.String" value="0"/>190 </Properties>191 </Component>192 <Component class="javax.swing.JLabel" name="myLayerLabel">193 <Properties>194 <Property name="text" type="java.lang.String" value="(invalid)"/>195 </Properties>196 112 </Component> 197 113 </SubComponents> … … 206 122 </Properties> 207 123 208 <Layout> 209 <DimensionLayout dim="0"> 210 <Group type="103" groupAlignment="0" attributes="0"> 211 <Group type="102" attributes="0"> 212 <EmptySpace max="-2" attributes="0"/> 213 <Group type="103" groupAlignment="0" attributes="0"> 214 <Group type="102" alignment="1" attributes="0"> 215 <Component id="freezeTheirSelectionButton" min="-2" max="-2" attributes="0"/> 216 <EmptySpace pref="387" max="32767" attributes="0"/> 217 <Component id="restoreTheirSetButton" min="-2" max="-2" attributes="0"/> 218 </Group> 219 <Group type="102" alignment="0" attributes="0"> 220 <Group type="103" groupAlignment="0" attributes="0"> 221 <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> 222 <Component id="jLabel9" alignment="0" min="-2" max="-2" attributes="0"/> 223 <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> 224 <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> 225 </Group> 226 <EmptySpace type="unrelated" max="-2" attributes="0"/> 227 <Group type="103" groupAlignment="0" attributes="0"> 228 <Component id="theirLayerLabel" alignment="0" min="-2" max="-2" attributes="0"/> 229 <Component id="theirNodeCountLabel" alignment="0" min="-2" max="-2" attributes="0"/> 230 <Component id="theirWayCountLabel" alignment="0" min="-2" max="-2" attributes="0"/> 231 <Component id="theirRelationCountLabel" alignment="0" min="-2" max="-2" attributes="0"/> 232 </Group> 233 </Group> 234 </Group> 235 <EmptySpace max="-2" attributes="0"/> 236 </Group> 237 </Group> 238 </DimensionLayout> 239 <DimensionLayout dim="1"> 240 <Group type="103" groupAlignment="0" attributes="0"> 241 <Group type="102" alignment="0" attributes="0"> 242 <EmptySpace max="-2" attributes="0"/> 243 <Group type="103" groupAlignment="3" attributes="0"> 244 <Component id="freezeTheirSelectionButton" alignment="3" min="-2" max="-2" attributes="0"/> 245 <Component id="restoreTheirSetButton" alignment="3" min="-2" max="-2" attributes="0"/> 246 </Group> 247 <EmptySpace type="unrelated" max="-2" attributes="0"/> 248 <Group type="103" groupAlignment="3" attributes="0"> 249 <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> 250 <Component id="theirLayerLabel" alignment="3" min="-2" max="-2" attributes="0"/> 251 </Group> 252 <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> 253 <Group type="103" groupAlignment="3" attributes="0"> 254 <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> 255 <Component id="theirNodeCountLabel" alignment="3" min="-2" pref="14" max="-2" attributes="0"/> 256 </Group> 257 <EmptySpace type="unrelated" max="-2" attributes="0"/> 258 <Group type="103" groupAlignment="3" attributes="0"> 259 <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> 260 <Component id="theirWayCountLabel" alignment="3" min="-2" max="-2" attributes="0"/> 261 </Group> 262 <EmptySpace type="unrelated" max="-2" attributes="0"/> 263 <Group type="103" groupAlignment="3" attributes="0"> 264 <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> 265 <Component id="theirRelationCountLabel" alignment="3" min="-2" max="-2" attributes="0"/> 266 </Group> 267 <EmptySpace pref="32" max="32767" attributes="0"/> 268 </Group> 269 </Group> 270 </DimensionLayout> 271 </Layout> 124 <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> 272 125 <SubComponents> 273 126 <Component class="javax.swing.JButton" name="freezeTheirSelectionButton"> … … 279 132 </Events> 280 133 </Component> 134 <Container class="javax.swing.JPanel" name="jPanel4"> 135 136 <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout"> 137 <Property name="columns" type="int" value="2"/> 138 <Property name="horizontalGap" type="int" value="2"/> 139 <Property name="rows" type="int" value="0"/> 140 </Layout> 141 <SubComponents> 142 <Component class="javax.swing.JLabel" name="jLabel6"> 143 <Properties> 144 <Property name="text" type="java.lang.String" value="Layer"/> 145 </Properties> 146 </Component> 147 <Component class="javax.swing.JLabel" name="theirLayerLabel"> 148 <Properties> 149 <Property name="text" type="java.lang.String" value="(invalid)"/> 150 </Properties> 151 </Component> 152 <Component class="javax.swing.JLabel" name="jLabel7"> 153 <Properties> 154 <Property name="text" type="java.lang.String" value="Nodes"/> 155 </Properties> 156 </Component> 157 <Component class="javax.swing.JLabel" name="theirNodeCountLabel"> 158 <Properties> 159 <Property name="text" type="java.lang.String" value="0"/> 160 </Properties> 161 </Component> 162 <Component class="javax.swing.JLabel" name="jLabel9"> 163 <Properties> 164 <Property name="text" type="java.lang.String" value="Ways"/> 165 </Properties> 166 </Component> 167 <Component class="javax.swing.JLabel" name="theirWayCountLabel"> 168 <Properties> 169 <Property name="text" type="java.lang.String" value="0"/> 170 </Properties> 171 </Component> 172 <Component class="javax.swing.JLabel" name="jLabel5"> 173 <Properties> 174 <Property name="text" type="java.lang.String" value="Relations"/> 175 </Properties> 176 </Component> 177 <Component class="javax.swing.JLabel" name="theirRelationCountLabel"> 178 <Properties> 179 <Property name="text" type="java.lang.String" value="0"/> 180 </Properties> 181 </Component> 182 </SubComponents> 183 </Container> 281 184 <Component class="javax.swing.JButton" name="restoreTheirSetButton"> 282 185 <Properties> … … 286 189 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="restoreTheirSetButtonActionPerformed"/> 287 190 </Events> 288 </Component>289 <Component class="javax.swing.JLabel" name="jLabel5">290 <Properties>291 <Property name="text" type="java.lang.String" value="Relations"/>292 </Properties>293 </Component>294 <Component class="javax.swing.JLabel" name="jLabel6">295 <Properties>296 <Property name="text" type="java.lang.String" value="Layer"/>297 </Properties>298 </Component>299 <Component class="javax.swing.JLabel" name="jLabel7">300 <Properties>301 <Property name="text" type="java.lang.String" value="Nodes"/>302 </Properties>303 </Component>304 <Component class="javax.swing.JLabel" name="jLabel9">305 <Properties>306 <Property name="text" type="java.lang.String" value="Ways"/>307 </Properties>308 </Component>309 <Component class="javax.swing.JLabel" name="theirNodeCountLabel">310 <Properties>311 <Property name="text" type="java.lang.String" value="0"/>312 </Properties>313 </Component>314 <Component class="javax.swing.JLabel" name="theirLayerLabel">315 <Properties>316 <Property name="text" type="java.lang.String" value="(invalid)"/>317 </Properties>318 </Component>319 <Component class="javax.swing.JLabel" name="theirWayCountLabel">320 <Properties>321 <Property name="text" type="java.lang.String" value="0"/>322 </Properties>323 </Component>324 <Component class="javax.swing.JLabel" name="theirRelationCountLabel">325 <Properties>326 <Property name="text" type="java.lang.String" value="0"/>327 </Properties>328 191 </Component> 329 192 </SubComponents> … … 357 220 </Constraints> 358 221 359 <Layout> 360 <DimensionLayout dim="0"> 361 <Group type="103" groupAlignment="0" attributes="0"> 362 <Group type="102" attributes="0"> 363 <EmptySpace max="-2" attributes="0"/> 364 <Group type="103" groupAlignment="0" attributes="0"> 365 <Group type="102" alignment="1" attributes="0"> 366 <EmptySpace min="0" pref="568" max="32767" attributes="0"/> 367 <Component id="criteriaTabConflateButton" min="-2" max="-2" attributes="0"/> 368 </Group> 369 <Group type="102" alignment="0" attributes="0"> 370 <Component id="jPanel2" min="-2" max="-2" attributes="0"/> 371 <EmptySpace min="0" pref="282" max="32767" attributes="0"/> 372 </Group> 373 </Group> 374 <EmptySpace max="-2" attributes="0"/> 375 </Group> 376 </Group> 377 </DimensionLayout> 378 <DimensionLayout dim="1"> 379 <Group type="103" groupAlignment="0" attributes="0"> 380 <Group type="102" alignment="1" attributes="0"> 381 <EmptySpace max="-2" attributes="0"/> 382 <Component id="jPanel2" min="-2" max="-2" attributes="0"/> 383 <EmptySpace pref="217" max="32767" attributes="0"/> 384 <Component id="criteriaTabConflateButton" min="-2" max="-2" attributes="0"/> 385 <EmptySpace max="-2" attributes="0"/> 386 </Group> 387 </Group> 388 </DimensionLayout> 222 <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"> 223 <Property name="axis" type="int" value="3"/> 389 224 </Layout> 390 225 <SubComponents> 391 <Component class="javax.swing.JButton" name="criteriaTabConflateButton">392 <Properties>393 <Property name="mnemonic" type="int" value="102"/>394 <Property name="text" type="java.lang.String" value="Conflate"/>395 </Properties>396 <Events>397 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="criteriaTabConflateButtonActionPerformed"/>398 </Events>399 </Component>400 226 <Container class="javax.swing.JPanel" name="jPanel2"> 401 227 <Properties> … … 410 236 <DimensionLayout dim="0"> 411 237 <Group type="103" groupAlignment="0" attributes="0"> 412 <Group type="102" a lignment="0" attributes="0">238 <Group type="102" attributes="0"> 413 239 <EmptySpace max="-2" attributes="0"/> 414 240 <Component id="jCheckBox1" min="-2" max="-2" attributes="0"/> 415 <EmptySpace pref=" 282" max="32767" attributes="0"/>241 <EmptySpace pref="350" max="32767" attributes="0"/> 416 242 </Group> 417 243 </Group> … … 422 248 <EmptySpace max="-2" attributes="0"/> 423 249 <Component id="jCheckBox1" min="-2" max="-2" attributes="0"/> 424 <EmptySpace pref="19 2" max="32767" attributes="0"/>250 <EmptySpace pref="195" max="32767" attributes="0"/> 425 251 </Group> 426 252 </Group> … … 432 258 <Property name="selected" type="boolean" value="true"/> 433 259 <Property name="text" type="java.lang.String" value="Distance"/> 260 <Property name="enabled" type="boolean" value="false"/> 434 261 </Properties> 435 262 <Events> … … 439 266 </SubComponents> 440 267 </Container> 268 <Component class="javax.swing.JButton" name="criteriaTabConflateButton"> 269 <Properties> 270 <Property name="mnemonic" type="int" value="102"/> 271 <Property name="text" type="java.lang.String" value="Conflate"/> 272 </Properties> 273 <Events> 274 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="criteriaTabConflateButtonActionPerformed"/> 275 </Events> 276 </Component> 441 277 </SubComponents> 442 278 </Container> … … 500 336 <EmptySpace type="unrelated" max="-2" attributes="0"/> 501 337 <Component id="jButton1" min="-2" max="-2" attributes="0"/> 502 <EmptySpace pref=" 252" max="32767" attributes="0"/>338 <EmptySpace pref="14" max="32767" attributes="0"/> 503 339 </Group> 504 340 </Group> … … 535 371 <Component class="javax.swing.JButton" name="useTheirTagsButton"> 536 372 <Properties> 537 <Property name="text" type="java.lang.String" value="Their Tags"/> 538 </Properties> 373 <Property name="text" type="java.lang.String" value="Merge tags"/> 374 </Properties> 375 <Events> 376 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="useTheirTagsButtonActionPerformed"/> 377 </Events> 539 378 </Component> 540 379 <Component class="javax.swing.JButton" name="jButton1"> -
applications/editors/josm/plugins/conflation/src/org/openstreetmap/josm/plugins/conflation/ConflationOptionsPanel.java
r27742 r27751 33 33 import org.openstreetmap.josm.data.osm.OsmPrimitive; 34 34 import org.openstreetmap.josm.data.osm.TagCollection; 35 import org.openstreetmap.josm.data.osm.event.*; 35 36 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 37 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 36 38 import org.openstreetmap.josm.gui.layer.Layer; 37 39 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 38 40 39 import org.openstreetmap.josm.plugins.conflation.ConflationUtils.*;41 import utilsplugin2.dumbutils.ReplaceGeometryAction; 40 42 41 43 /** … … 43 45 * @author Josh 44 46 */ 45 public class ConflationOptionsPanel extends javax.swing.JPanel implements IConflictListener {47 public class ConflationOptionsPanel extends javax.swing.JPanel implements DataSetListener { 46 48 ConflationOptionsDialog dlg = null; 47 49 ConflationLayer conflationLayer = null; … … 49 51 DataSet sourceDataSet = null; 50 52 ArrayList<OsmPrimitive> targetSelection = null; 51 ArrayList<OsmPrimitive> theirSelection = null;53 ArrayList<OsmPrimitive> sourceSelection = null; 52 54 OsmDataLayer targetLayer = null; 53 OsmDataLayer theirLayer = null;55 OsmDataLayer sourceLayer = null; 54 56 MatchTableModel tableModel; 55 57 List<ConflationCandidate> candidates = null; … … 66 68 67 69 // FIXME: doesn't work right now 68 ColorTableCellRenderer cr = new ColorTableCellRenderer("Tags"); 69 resultsTable.getColumnModel().getColumn(4).setCellRenderer(cr); 70 resultsTable.getColumnModel().getColumn(0).setCellRenderer(new OsmPrimitivRenderer()); 71 resultsTable.getColumnModel().getColumn(1).setCellRenderer(new OsmPrimitivRenderer()); 72 resultsTable.getColumnModel().getColumn(4).setCellRenderer(new ColorTableCellRenderer("Tags")); 70 73 71 74 this.dlg = dlg; … … 94 97 refSetPanel = new javax.swing.JPanel(); 95 98 freezeMySetButton = new javax.swing.JButton(); 96 restoreMySetButton = new javax.swing.JButton(); 99 jPanel3 = new javax.swing.JPanel(); 100 jLabel2 = new javax.swing.JLabel(); 101 myLayerLabel = new javax.swing.JLabel(); 97 102 jLabel1 = new javax.swing.JLabel(); 98 jLabel2= new javax.swing.JLabel();103 myNodeCountLabel = new javax.swing.JLabel(); 99 104 jLabel3 = new javax.swing.JLabel(); 105 myWayCountLabel = new javax.swing.JLabel(); 100 106 jLabel4 = new javax.swing.JLabel(); 101 107 myRelationCountLabel = new javax.swing.JLabel(); 102 myWayCountLabel = new javax.swing.JLabel(); 103 myNodeCountLabel = new javax.swing.JLabel(); 104 myLayerLabel = new javax.swing.JLabel(); 108 restoreMySetButton = new javax.swing.JButton(); 105 109 nonRefSetPanel = new javax.swing.JPanel(); 106 110 freezeTheirSelectionButton = new javax.swing.JButton(); 111 jPanel4 = new javax.swing.JPanel(); 112 jLabel6 = new javax.swing.JLabel(); 113 theirLayerLabel = new javax.swing.JLabel(); 114 jLabel7 = new javax.swing.JLabel(); 115 theirNodeCountLabel = new javax.swing.JLabel(); 116 jLabel9 = new javax.swing.JLabel(); 117 theirWayCountLabel = new javax.swing.JLabel(); 118 jLabel5 = new javax.swing.JLabel(); 119 theirRelationCountLabel = new javax.swing.JLabel(); 107 120 restoreTheirSetButton = new javax.swing.JButton(); 108 jLabel5 = new javax.swing.JLabel();109 jLabel6 = new javax.swing.JLabel();110 jLabel7 = new javax.swing.JLabel();111 jLabel9 = new javax.swing.JLabel();112 theirNodeCountLabel = new javax.swing.JLabel();113 theirLayerLabel = new javax.swing.JLabel();114 theirWayCountLabel = new javax.swing.JLabel();115 theirRelationCountLabel = new javax.swing.JLabel();116 121 objectTabCancelButton = new javax.swing.JButton(); 117 122 objectTabNextButton = new javax.swing.JButton(); 118 123 criteriaTabPanel = new javax.swing.JPanel(); 119 criteriaTabConflateButton = new javax.swing.JButton();120 124 jPanel2 = new javax.swing.JPanel(); 121 125 jCheckBox1 = new javax.swing.JCheckBox(); 126 criteriaTabConflateButton = new javax.swing.JButton(); 122 127 resultsPanel = new javax.swing.JPanel(); 123 128 jScrollPane1 = new javax.swing.JScrollPane(); … … 132 137 setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.LINE_AXIS)); 133 138 139 objectTabPanel.setLayout(new javax.swing.BoxLayout(objectTabPanel, javax.swing.BoxLayout.PAGE_AXIS)); 140 134 141 refSetPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Target Selection")); 142 refSetPanel.setLayout(new javax.swing.BoxLayout(refSetPanel, javax.swing.BoxLayout.LINE_AXIS)); 135 143 136 144 freezeMySetButton.setText("Freeze Selection"); … … 140 148 } 141 149 }); 150 refSetPanel.add(freezeMySetButton); 151 152 jPanel3.setLayout(new java.awt.GridLayout(0, 2, 2, 0)); 153 154 jLabel2.setText("Layer"); 155 jPanel3.add(jLabel2); 156 157 myLayerLabel.setText("(invalid)"); 158 jPanel3.add(myLayerLabel); 159 160 jLabel1.setText("Nodes"); 161 jPanel3.add(jLabel1); 162 163 myNodeCountLabel.setText("0"); 164 jPanel3.add(myNodeCountLabel); 165 166 jLabel3.setText("Ways"); 167 jPanel3.add(jLabel3); 168 169 myWayCountLabel.setText("0"); 170 jPanel3.add(myWayCountLabel); 171 172 jLabel4.setText("Relations"); 173 jPanel3.add(jLabel4); 174 175 myRelationCountLabel.setText("0"); 176 jPanel3.add(myRelationCountLabel); 177 178 refSetPanel.add(jPanel3); 142 179 143 180 restoreMySetButton.setText("Restore Selection"); … … 147 184 } 148 185 }); 149 150 jLabel1.setText("Nodes"); 151 152 jLabel2.setText("Layer"); 153 154 jLabel3.setText("Ways"); 155 156 jLabel4.setText("Relations"); 157 158 myRelationCountLabel.setText("0"); 159 160 myWayCountLabel.setText("0"); 161 162 myNodeCountLabel.setText("0"); 163 164 myLayerLabel.setText("(invalid)"); 165 166 javax.swing.GroupLayout refSetPanelLayout = new javax.swing.GroupLayout(refSetPanel); 167 refSetPanel.setLayout(refSetPanelLayout); 168 refSetPanelLayout.setHorizontalGroup( 169 refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 170 .addGroup(refSetPanelLayout.createSequentialGroup() 171 .addContainerGap() 172 .addGroup(refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 173 .addGroup(refSetPanelLayout.createSequentialGroup() 174 .addComponent(freezeMySetButton) 175 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 392, Short.MAX_VALUE) 176 .addComponent(restoreMySetButton)) 177 .addGroup(refSetPanelLayout.createSequentialGroup() 178 .addGroup(refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 179 .addComponent(jLabel4) 180 .addComponent(jLabel3) 181 .addComponent(jLabel1) 182 .addComponent(jLabel2)) 183 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 184 .addGroup(refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 185 .addComponent(myLayerLabel) 186 .addComponent(myNodeCountLabel) 187 .addComponent(myWayCountLabel) 188 .addComponent(myRelationCountLabel)))) 189 .addContainerGap()) 190 ); 191 refSetPanelLayout.setVerticalGroup( 192 refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 193 .addGroup(refSetPanelLayout.createSequentialGroup() 194 .addContainerGap() 195 .addGroup(refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 196 .addComponent(freezeMySetButton) 197 .addComponent(restoreMySetButton)) 198 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 199 .addGroup(refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 200 .addComponent(jLabel2) 201 .addComponent(myLayerLabel)) 202 .addGap(11, 11, 11) 203 .addGroup(refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 204 .addComponent(jLabel1) 205 .addComponent(myNodeCountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)) 206 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 207 .addGroup(refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 208 .addComponent(jLabel3) 209 .addComponent(myWayCountLabel)) 210 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 211 .addGroup(refSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 212 .addComponent(jLabel4) 213 .addComponent(myRelationCountLabel)) 214 .addContainerGap(38, Short.MAX_VALUE)) 215 ); 186 refSetPanel.add(restoreMySetButton); 187 188 objectTabPanel.add(refSetPanel); 216 189 217 190 nonRefSetPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Source Selection")); 191 nonRefSetPanel.setLayout(new javax.swing.BoxLayout(nonRefSetPanel, javax.swing.BoxLayout.LINE_AXIS)); 218 192 219 193 freezeTheirSelectionButton.setText("Freeze Selection"); … … 223 197 } 224 198 }); 199 nonRefSetPanel.add(freezeTheirSelectionButton); 200 201 jPanel4.setLayout(new java.awt.GridLayout(0, 2, 2, 0)); 202 203 jLabel6.setText("Layer"); 204 jPanel4.add(jLabel6); 205 206 theirLayerLabel.setText("(invalid)"); 207 jPanel4.add(theirLayerLabel); 208 209 jLabel7.setText("Nodes"); 210 jPanel4.add(jLabel7); 211 212 theirNodeCountLabel.setText("0"); 213 jPanel4.add(theirNodeCountLabel); 214 215 jLabel9.setText("Ways"); 216 jPanel4.add(jLabel9); 217 218 theirWayCountLabel.setText("0"); 219 jPanel4.add(theirWayCountLabel); 220 221 jLabel5.setText("Relations"); 222 jPanel4.add(jLabel5); 223 224 theirRelationCountLabel.setText("0"); 225 jPanel4.add(theirRelationCountLabel); 226 227 nonRefSetPanel.add(jPanel4); 225 228 226 229 restoreTheirSetButton.setText("Restore Selection"); … … 230 233 } 231 234 }); 232 233 jLabel5.setText("Relations"); 234 235 jLabel6.setText("Layer"); 236 237 jLabel7.setText("Nodes"); 238 239 jLabel9.setText("Ways"); 240 241 theirNodeCountLabel.setText("0"); 242 243 theirLayerLabel.setText("(invalid)"); 244 245 theirWayCountLabel.setText("0"); 246 247 theirRelationCountLabel.setText("0"); 248 249 javax.swing.GroupLayout nonRefSetPanelLayout = new javax.swing.GroupLayout(nonRefSetPanel); 250 nonRefSetPanel.setLayout(nonRefSetPanelLayout); 251 nonRefSetPanelLayout.setHorizontalGroup( 252 nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 253 .addGroup(nonRefSetPanelLayout.createSequentialGroup() 254 .addContainerGap() 255 .addGroup(nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 256 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, nonRefSetPanelLayout.createSequentialGroup() 257 .addComponent(freezeTheirSelectionButton) 258 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 392, Short.MAX_VALUE) 259 .addComponent(restoreTheirSetButton)) 260 .addGroup(nonRefSetPanelLayout.createSequentialGroup() 261 .addGroup(nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 262 .addComponent(jLabel5) 263 .addComponent(jLabel9) 264 .addComponent(jLabel7) 265 .addComponent(jLabel6)) 266 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 267 .addGroup(nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 268 .addComponent(theirLayerLabel) 269 .addComponent(theirNodeCountLabel) 270 .addComponent(theirWayCountLabel) 271 .addComponent(theirRelationCountLabel)))) 272 .addContainerGap()) 273 ); 274 nonRefSetPanelLayout.setVerticalGroup( 275 nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 276 .addGroup(nonRefSetPanelLayout.createSequentialGroup() 277 .addContainerGap() 278 .addGroup(nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 279 .addComponent(freezeTheirSelectionButton) 280 .addComponent(restoreTheirSetButton)) 281 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 282 .addGroup(nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 283 .addComponent(jLabel6) 284 .addComponent(theirLayerLabel)) 285 .addGap(11, 11, 11) 286 .addGroup(nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 287 .addComponent(jLabel7) 288 .addComponent(theirNodeCountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)) 289 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 290 .addGroup(nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 291 .addComponent(jLabel9) 292 .addComponent(theirWayCountLabel)) 293 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 294 .addGroup(nonRefSetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 295 .addComponent(jLabel5) 296 .addComponent(theirRelationCountLabel)) 297 .addContainerGap(32, Short.MAX_VALUE)) 298 ); 235 nonRefSetPanel.add(restoreTheirSetButton); 236 237 objectTabPanel.add(nonRefSetPanel); 299 238 300 239 objectTabCancelButton.setText("Cancel"); … … 304 243 } 305 244 }); 245 objectTabPanel.add(objectTabCancelButton); 306 246 307 247 objectTabNextButton.setMnemonic('N'); … … 312 252 } 313 253 }); 314 315 javax.swing.GroupLayout objectTabPanelLayout = new javax.swing.GroupLayout(objectTabPanel); 316 objectTabPanel.setLayout(objectTabPanelLayout); 317 objectTabPanelLayout.setHorizontalGroup( 318 objectTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 319 .addGroup(objectTabPanelLayout.createSequentialGroup() 320 .addGroup(objectTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 321 .addComponent(nonRefSetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 322 .addComponent(refSetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 323 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, objectTabPanelLayout.createSequentialGroup() 324 .addContainerGap() 325 .addComponent(objectTabCancelButton) 326 .addGap(81, 81, 81) 327 .addComponent(objectTabNextButton))) 328 .addContainerGap()) 329 ); 330 objectTabPanelLayout.setVerticalGroup( 331 objectTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 332 .addGroup(objectTabPanelLayout.createSequentialGroup() 333 .addComponent(refSetPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 334 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 335 .addComponent(nonRefSetPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 336 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 337 .addGroup(objectTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 338 .addComponent(objectTabNextButton) 339 .addComponent(objectTabCancelButton)) 340 .addGap(55, 55, 55)) 341 ); 254 objectTabPanel.add(objectTabNextButton); 342 255 343 256 resultsTabPanel.addTab("Object selection", objectTabPanel); 344 257 345 criteriaTabConflateButton.setMnemonic('f'); 346 criteriaTabConflateButton.setText("Conflate"); 347 criteriaTabConflateButton.addActionListener(new java.awt.event.ActionListener() { 348 public void actionPerformed(java.awt.event.ActionEvent evt) { 349 criteriaTabConflateButtonActionPerformed(evt); 350 } 351 }); 258 criteriaTabPanel.setLayout(new javax.swing.BoxLayout(criteriaTabPanel, javax.swing.BoxLayout.PAGE_AXIS)); 352 259 353 260 jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); … … 355 262 jCheckBox1.setSelected(true); 356 263 jCheckBox1.setText("Distance"); 264 jCheckBox1.setEnabled(false); 357 265 jCheckBox1.addActionListener(new java.awt.event.ActionListener() { 358 266 public void actionPerformed(java.awt.event.ActionEvent evt) { … … 368 276 .addContainerGap() 369 277 .addComponent(jCheckBox1) 370 .addContainerGap( 282, Short.MAX_VALUE))278 .addContainerGap(350, Short.MAX_VALUE)) 371 279 ); 372 280 jPanel2Layout.setVerticalGroup( … … 375 283 .addContainerGap() 376 284 .addComponent(jCheckBox1) 377 .addContainerGap(19 2, Short.MAX_VALUE))285 .addContainerGap(195, Short.MAX_VALUE)) 378 286 ); 379 287 380 javax.swing.GroupLayout criteriaTabPanelLayout = new javax.swing.GroupLayout(criteriaTabPanel); 381 criteriaTabPanel.setLayout(criteriaTabPanelLayout); 382 criteriaTabPanelLayout.setHorizontalGroup( 383 criteriaTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 384 .addGroup(criteriaTabPanelLayout.createSequentialGroup() 385 .addContainerGap() 386 .addGroup(criteriaTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 387 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, criteriaTabPanelLayout.createSequentialGroup() 388 .addGap(0, 568, Short.MAX_VALUE) 389 .addComponent(criteriaTabConflateButton)) 390 .addGroup(criteriaTabPanelLayout.createSequentialGroup() 391 .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 392 .addGap(0, 282, Short.MAX_VALUE))) 393 .addContainerGap()) 394 ); 395 criteriaTabPanelLayout.setVerticalGroup( 396 criteriaTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 397 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, criteriaTabPanelLayout.createSequentialGroup() 398 .addContainerGap() 399 .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 400 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 217, Short.MAX_VALUE) 401 .addComponent(criteriaTabConflateButton) 402 .addContainerGap()) 403 ); 288 criteriaTabPanel.add(jPanel2); 289 290 criteriaTabConflateButton.setMnemonic('f'); 291 criteriaTabConflateButton.setText("Conflate"); 292 criteriaTabConflateButton.addActionListener(new java.awt.event.ActionListener() { 293 public void actionPerformed(java.awt.event.ActionEvent evt) { 294 criteriaTabConflateButtonActionPerformed(evt); 295 } 296 }); 297 criteriaTabPanel.add(criteriaTabConflateButton); 404 298 405 299 resultsTabPanel.addTab("Matching criteria", criteriaTabPanel); … … 434 328 jLabel8.setText("Resolve using:"); 435 329 436 useTheirTagsButton.setText("Their Tags"); 330 useTheirTagsButton.setText("Merge tags"); 331 useTheirTagsButton.addActionListener(new java.awt.event.ActionListener() { 332 public void actionPerformed(java.awt.event.ActionEvent evt) { 333 useTheirTagsButtonActionPerformed(evt); 334 } 335 }); 437 336 438 337 jButton1.setText("Not a match"); … … 452 351 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 453 352 .addComponent(jButton1) 454 .addContainerGap( 252, Short.MAX_VALUE))353 .addContainerGap(14, Short.MAX_VALUE)) 455 354 ); 456 355 jPanel1Layout.setVerticalGroup( … … 490 389 // some initialization 491 390 int n = targetSelection.size(); 492 int m = theirSelection.size();391 int m = sourceSelection.size(); 493 392 int maxLen = Math.max(n, m); 494 393 double cost[][] = new double[maxLen][maxLen]; … … 497 396 for (int i = 0; i < n; i++) { 498 397 for (int j = 0; j < m; j++) { 499 cost[i][j] = calcCost(targetSelection.get(i), theirSelection.get(j));398 cost[i][j] = calcCost(targetSelection.get(i), sourceSelection.get(j)); 500 399 } 501 400 } … … 506 405 candidates = new LinkedList<ConflationCandidate>(); 507 406 for (int i = 0; i < maxLen; i++) { 508 if (assignment[i][0] < n) 509 target = targetSelection.get(assignment[i][0]); 407 int tgtIdx = assignment[i][0]; 408 int srcIdx = assignment[i][1]; 409 if (tgtIdx < n) 410 target = targetSelection.get(tgtIdx); 510 411 else 511 412 target = null; 512 if ( assignment[i][1]< m)513 source = theirSelection.get(assignment[i][1]);413 if (srcIdx < m) 414 source = sourceSelection.get(srcIdx); 514 415 else 515 416 source = null; … … 517 418 if (target != null && source != null) { 518 419 // TODO: do something! 519 candidates.add(new ConflationCandidate(source, target)); 420 candidates.add(new ConflationCandidate(source, target, cost[tgtIdx][srcIdx])); 520 421 } 521 422 } … … 534 435 // print list of matched pairsalong with distance 535 436 // upon selection of one pair, highlight them and draw arrow 437 438 if (resultsPanel != null) 439 resultsTabPanel.setSelectedComponent(resultsPanel); 536 440 }//GEN-LAST:event_criteriaTabConflateButtonActionPerformed 537 441 … … 550 454 551 455 private void restoreTheirSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_restoreTheirSetButtonActionPerformed 552 if ( theirLayer != null && sourceDataSet != null &&theirSelection != null && !theirSelection.isEmpty()) {553 Main.map.mapView.setActiveLayer( theirLayer);554 theirLayer.setVisible(true);555 sourceDataSet.setSelected( theirSelection);456 if (sourceLayer != null && sourceDataSet != null && sourceSelection != null && !sourceSelection.isEmpty()) { 457 Main.map.mapView.setActiveLayer(sourceLayer); 458 sourceLayer.setVisible(true); 459 sourceDataSet.setSelected(sourceSelection); 556 460 } 557 461 }//GEN-LAST:event_restoreTheirSetButtonActionPerformed 558 462 559 463 private void freezeTargetSelectionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_freezeTargetSelectionActionPerformed 464 if (targetDataSet != null && targetDataSet == Main.main.getCurrentDataSet()) { 465 targetDataSet.removeDataSetListener(this); 466 } 560 467 targetDataSet = Main.main.getCurrentDataSet(); 468 targetDataSet.addDataSetListener(this); 561 469 targetLayer = Main.main.getEditLayer(); 562 470 if (targetDataSet == null || targetLayer == null) { … … 590 498 591 499 private void freezeSourceSelectionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_freezeSourceSelectionActionPerformed 500 if (sourceDataSet != null && sourceDataSet == Main.main.getCurrentDataSet()) { 501 sourceDataSet.removeDataSetListener(this); 502 } 592 503 sourceDataSet = Main.main.getCurrentDataSet(); 593 theirLayer = Main.main.getEditLayer(); 594 if (sourceDataSet == null || theirLayer == null) { 504 sourceDataSet.addDataSetListener(this); 505 sourceLayer = Main.main.getEditLayer(); 506 if (sourceDataSet == null || sourceLayer == null) { 595 507 JOptionPane.showMessageDialog(Main.parent, tr("No valid OSM data layer present."), 596 508 tr("Error freezing selection"), JOptionPane.ERROR_MESSAGE); 597 509 return; 598 510 } 599 theirSelection = new ArrayList<OsmPrimitive>(sourceDataSet.getSelected());600 if ( theirSelection.isEmpty()) {511 sourceSelection = new ArrayList<OsmPrimitive>(sourceDataSet.getSelected()); 512 if (sourceSelection.isEmpty()) { 601 513 JOptionPane.showMessageDialog(Main.parent, tr("Nothing is selected, please try again."), 602 514 tr("Empty selection"), JOptionPane.ERROR_MESSAGE); … … 607 519 int numWays = 0; 608 520 int numRelations = 0; 609 for (OsmPrimitive p: theirSelection) {521 for (OsmPrimitive p: sourceSelection) { 610 522 switch(p.getType()) { 611 523 case NODE: numNodes++; break; … … 615 527 } 616 528 617 theirLayerLabel.setText( theirLayer.getName());529 theirLayerLabel.setText(sourceLayer.getName()); 618 530 theirNodeCountLabel.setText(Integer.toString(numNodes)); 619 531 theirWayCountLabel.setText(Integer.toString(numWays)); … … 631 543 632 544 private void replaceGeometryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_replaceGeometryButtonActionPerformed 633 545 ReplaceGeometryAction rg = new ReplaceGeometryAction(); 546 ConflationCandidate c = conflationLayer.getSelectedCandidate(); 547 rg.replace(c.getSource(), c.getTarget()); 634 548 }//GEN-LAST:event_replaceGeometryButtonActionPerformed 549 550 private void useTheirTagsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useTheirTagsButtonActionPerformed 551 // TODO add your handling code here: 552 }//GEN-LAST:event_useTheirTagsButtonActionPerformed 635 553 636 554 static public class LayerListCellRenderer extends DefaultListCellRenderer { … … 659 577 * now, later we can also use dissimilarity between tags. 660 578 * 661 * @param refPrimthe reference <code>OsmPrimitive</code>.662 * @param nonRefPrimthe non-reference <code>OsmPrimitive</code>.579 * @param source the reference <code>OsmPrimitive</code>. 580 * @param target the non-reference <code>OsmPrimitive</code>. 663 581 */ 664 public double calcCost(OsmPrimitive refPrim, OsmPrimitivenonRefPrim) {582 public double calcCost(OsmPrimitive source, OsmPrimitive target) { 665 583 double dist; 666 584 try { 667 dist = getCenter( refPrim).distance(getCenter(nonRefPrim));585 dist = getCenter(source).distance(getCenter(target)); 668 586 } catch (Exception e) { 669 587 dist = 1000; // FIXME: what number to use? … … 692 610 693 611 public Object getValueAt(int row, int col) { 612 ConflationCandidate c = candidates.get(row); 694 613 if (col == 0) 695 return candidates.get(row).getSource(); 696 if (col == 1) 697 return candidates.get(row).getTarget(); 614 return c.getSource(); 615 else if (col == 1) 616 return c.getTarget(); 617 else if (col == 2) 618 return c.getDistance(); 619 else if (col == 3) 620 return c.getCost(); 698 621 if (col == 4) { 699 622 HashSet<OsmPrimitive> set = new HashSet<OsmPrimitive>(); 700 set.add(c andidates.get(row).getSource());701 set.add(c andidates.get(row).getTarget());623 set.add(c.getSource()); 624 set.add(c.getTarget()); 702 625 TagCollection tags = TagCollection.unionOfAllPrimitives(set); 703 626 Set<String> keys = tags.getKeysWithMultipleValues(); … … 761 684 762 685 // only one item selected, show tags and zoom/center map 763 if (!lsm.isSelectionEmpty() && firstIndex == lastIndex) { 686 if (!lsm.isSelectionEmpty() && firstIndex == lastIndex && firstIndex < candidates.size()) { 764 687 ConflationCandidate c = candidates.get(firstIndex); 765 688 … … 789 712 } 790 713 791 public void onConflictsAdded(ConflictCollection conflicts) { 714 @Override 715 public void primitivesAdded(PrimitivesAddedEvent event) { 716 } 717 718 @Override 719 public void primitivesRemoved(PrimitivesRemovedEvent event) { 720 List<? extends OsmPrimitive> prims = event.getPrimitives(); 721 for (OsmPrimitive p : prims) { 722 for (ConflationCandidate c : candidates) { 723 if (c.getSource().equals(p) || c.getTarget().equals(p)) { 724 candidates.remove(c); 725 break; 726 } 727 } 728 } 792 729 refreshView(); 793 730 } 794 795 public void onConflictsRemoved(ConflictCollection conflicts) {796 System.err.println("1 conflict has been resolved.");797 refreshView();798 }799 731 732 @Override 733 public void tagsChanged(TagsChangedEvent event) {} 734 735 @Override 736 public void nodeMoved(NodeMovedEvent event) {} 737 738 @Override 739 public void wayNodesChanged(WayNodesChangedEvent event) {} 740 741 @Override 742 public void relationMembersChanged(RelationMembersChangedEvent event) {} 743 744 @Override 745 public void otherDatasetChange(AbstractDatasetChangedEvent event) {} 746 747 @Override 748 public void dataChanged(DataChangedEvent event) {} 749 800 750 public class ConflationCandidate { 801 751 protected OsmPrimitive source; 802 752 protected OsmPrimitive target; 753 protected double cost; 754 protected double distance; 803 755 804 public ConflationCandidate(OsmPrimitive source, OsmPrimitive target) { 756 public ConflationCandidate(OsmPrimitive source, OsmPrimitive target, double cost) { 805 757 if (source == null || target == null) { 806 758 throw new IllegalArgumentException("Invalid source or target"); … … 808 760 this.source = source; 809 761 this.target = target; 762 this.cost = cost; 763 // TODO: use distance calculated in cost function, and make sure it's in meters? 764 this.distance = getCenter(source).distance(getCenter(target)); 810 765 } 811 766 … … 816 771 public OsmPrimitive getTarget() { 817 772 return target; 773 } 774 775 private Object getCost() { 776 return cost; 777 } 778 779 private Object getDistance() { 780 return distance; 818 781 } 819 782 } … … 837 800 private javax.swing.JPanel jPanel1; 838 801 private javax.swing.JPanel jPanel2; 802 private javax.swing.JPanel jPanel3; 803 private javax.swing.JPanel jPanel4; 839 804 private javax.swing.JScrollPane jScrollPane1; 840 805 private javax.swing.JLabel myLayerLabel; -
applications/editors/josm/plugins/utilsplugin2/build.xml
r27616 r27751 43 43 <property name="plugin.dist.dir" value="../../dist"/> 44 44 <property name="ant.build.javac.target" value="1.5"/> 45 <property name="ant.build.javac.source" value="1.5"/> 45 46 <property name="plugin.dist.dir" value="../../dist"/> 46 47 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
Note:
See TracChangeset
for help on using the changeset viewer.