- Timestamp:
- 2009-06-07T15:04:28+02:00 (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.classpath
r1595 r1650 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry excluding="build/|dist/|src/|test/" including="images/|presets/|styles/" kind="src" path=""/> 4 <classpathentry kind="src" path="test/unit"/> 5 <classpathentry kind="src" path="test/functional"/> 6 <classpathentry excluding="build/|dist/|src/|test/|test/unit/|test/functional/" including="images/|presets/|styles/" kind="src" path=""/> 5 7 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 6 8 <classpathentry kind="lib" path="lib/metadata-extractor-2.3.1-nosun.jar"/> … … 9 11 <classpathentry kind="lib" path="lib/josm-translation.jar"/> 10 12 <classpathentry kind="lib" path="lib/gettext-commons-0.9.6.jar"/> 13 <classpathentry kind="lib" path="test/lib/fest/debug-1.0.jar"/> 14 <classpathentry kind="lib" path="test/lib/fest/fest-assert-1.0.jar"/> 15 <classpathentry kind="lib" path="test/lib/fest/fest-reflect-1.1.jar"/> 16 <classpathentry kind="lib" path="test/lib/fest/fest-swing-1.1.jar"/> 17 <classpathentry kind="lib" path="test/lib/fest/fest-util-1.0.jar"/> 18 <classpathentry kind="lib" path="test/lib/fest/jcip-annotations-1.0.jar"/> 19 <classpathentry kind="lib" path="test/lib/fest/MRJToolkitStubs-1.0.jar"/> 11 20 <classpathentry kind="output" path="bin"/> 12 21 </classpath> -
trunk/.settings/org.eclipse.jdt.core.prefs
r981 r1650 1 #S un Sep 07 19:15:59 CEST 20081 #Sat Jun 06 11:00:10 CEST 2009 2 2 eclipse.preferences.version=1 3 3 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning … … 101 101 org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false 102 102 org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false 103 org.eclipse.jdt.core.formatter.comment.format_block_comments= false103 org.eclipse.jdt.core.formatter.comment.format_block_comments=true 104 104 org.eclipse.jdt.core.formatter.comment.format_comments=true 105 105 org.eclipse.jdt.core.formatter.comment.format_header=false 106 106 org.eclipse.jdt.core.formatter.comment.format_html=false 107 org.eclipse.jdt.core.formatter.comment.format_javadoc_comments= false108 org.eclipse.jdt.core.formatter.comment.format_line_comments= false107 org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true 108 org.eclipse.jdt.core.formatter.comment.format_line_comments=true 109 109 org.eclipse.jdt.core.formatter.comment.format_source_code=false 110 110 org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -
trunk/.settings/org.eclipse.jdt.ui.prefs
r608 r1650 1 # Wed Apr 16 17:01:39 CEST 20081 #Sat Jun 06 11:00:10 CEST 2009 2 2 eclipse.preferences.version=1 3 3 formatter_profile=_josm 4 formatter_settings_version=10 5 org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">// License\: GPL. \n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">// License\: GPL. For details, see LICENSE file.\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> 4 formatter_settings_version=11 5 org.eclipse.jdt.ui.javadoc=false 6 org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">// License\: GPL. \r\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">// License\: GPL. For details, see LICENSE file.\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> -
trunk/build.xml
r1584 r1650 96 96 <delete dir="dist" /> 97 97 </target> 98 99 <target name="dev-deploy" depends="dist"> 100 <copy file="dist/josm-custom.jar" todir="C:\data\projekte\osm\tag-editor-plugin"/> 101 </target> 102 98 103 99 104 </project> -
trunk/src/org/openstreetmap/josm/gui/conflict/ConflictResolver.java
r1642 r1650 93 93 tabbedPane.setIconAt(0, mergeIncomplete); 94 94 } 95 } else if (evt.getPropertyName().equals(ListMergeModel. PROP_FROZEN)) {95 } else if (evt.getPropertyName().equals(ListMergeModel.FROZEN_PROP)) { 96 96 boolean frozen = (Boolean)evt.getNewValue(); 97 97 if (frozen && evt.getSource() == nodeListMerger.getModel()) { -
trunk/src/org/openstreetmap/josm/gui/conflict/ListMergeModel.java
r1642 r1650 2 2 package org.openstreetmap.josm.gui.conflict; 3 3 4 import static org.openstreetmap.josm.gui.conflict.ComparePairType.MY_WITH_MERGED; 5 import static org.openstreetmap.josm.gui.conflict.ComparePairType.MY_WITH_THEIR; 6 import static org.openstreetmap.josm.gui.conflict.ComparePairType.THEIR_WITH_MERGED; 7 import static org.openstreetmap.josm.gui.conflict.ListRole.MERGED_ENTRIES; 8 import static org.openstreetmap.josm.gui.conflict.ListRole.MY_ENTRIES; 9 import static org.openstreetmap.josm.gui.conflict.ListRole.THEIR_ENTRIES; 4 10 import static org.openstreetmap.josm.tools.I18n.tr; 5 11 … … 7 13 import java.beans.PropertyChangeListener; 8 14 import java.util.ArrayList; 9 import java.util.List; 15 import java.util.HashMap; 16 import java.util.Observable; 10 17 import java.util.logging.Logger; 11 18 19 import javax.swing.AbstractListModel; 20 import javax.swing.ComboBoxModel; 12 21 import javax.swing.DefaultListSelectionModel; 13 22 import javax.swing.table.DefaultTableModel; … … 36 45 * ListMergeModel is an abstract class. Three methods have to be implemented by subclasses: 37 46 * <ul> 38 * <li>{@see ListMergeModel#cloneEntry (Object)} - clones an entry of type T</li>47 * <li>{@see ListMergeModel#cloneEntryForMergedList(Object)} - clones an entry of type T</li> 39 48 * <li>{@see ListMergeModel#isEqualEntry(Object, Object)} - checks whether two entries are equals </li> 40 49 * <li>{@see ListMergeModel#setValueAt(DefaultTableModel, Object, int, int)} - handles values edited in … … 46 55 * @see ListMerger 47 56 */ 48 public abstract class ListMergeModel<T> {57 public abstract class ListMergeModel<T> extends Observable { 49 58 private static final Logger logger = Logger.getLogger(ListMergeModel.class.getName()); 50 59 51 public static final String PROP_FROZEN = ListMergeModel.class.getName() + ".frozen"; 52 53 protected ArrayList<T> myEntries; 54 protected ArrayList<T> theirEntries; 55 protected ArrayList<T> mergedEntries; 56 60 public static final String FROZEN_PROP = ListMergeModel.class.getName() + ".frozen"; 61 62 protected HashMap<ListRole, ArrayList<T>> entries; 57 63 58 64 protected DefaultTableModel myEntriesTableModel; … … 60 66 protected DefaultTableModel mergedEntriesTableModel; 61 67 62 protected EntriesSelectionModel <T>myEntriesSelectionModel;63 protected EntriesSelectionModel <T>theirEntriesSelectionModel;64 protected EntriesSelectionModel <T>mergedEntriesSelectionModel;68 protected EntriesSelectionModel myEntriesSelectionModel; 69 protected EntriesSelectionModel theirEntriesSelectionModel; 70 protected EntriesSelectionModel mergedEntriesSelectionModel; 65 71 66 72 private final ArrayList<PropertyChangeListener> listeners; 67 73 private boolean isFrozen = false; 68 69 /** 70 * Clones an entry of type T 74 private final ComparePairListModel comparePairListModel; 75 76 77 78 /** 79 * Creates a clone of an entry of type T suitable to be included in the 80 * list of merged entries 81 * 71 82 * @param entry the entry 72 83 * @return the cloned entry 73 84 */ 74 protected abstract T cloneEntry (T entry);85 protected abstract T cloneEntryForMergedList(T entry); 75 86 76 87 /** … … 99 110 100 111 protected void buildMyEntriesTableModel() { 101 myEntriesTableModel = new EntriesTableModel <T>(myEntries);112 myEntriesTableModel = new EntriesTableModel(MY_ENTRIES); 102 113 } 103 114 104 115 protected void buildTheirEntriesTableModel() { 105 theirEntriesTableModel = new EntriesTableModel <T>(theirEntries);116 theirEntriesTableModel = new EntriesTableModel(THEIR_ENTRIES); 106 117 } 107 118 108 119 protected void buildMergedEntriesTableModel() { 109 mergedEntriesTableModel = new EntriesTableModel<T>(mergedEntries); 120 mergedEntriesTableModel = new EntriesTableModel(MERGED_ENTRIES); 121 } 122 123 protected ArrayList<T> getMergedEntries() { 124 return entries.get(MERGED_ENTRIES); 125 } 126 protected ArrayList<T> getMyEntries() { 127 return entries.get(MY_ENTRIES); 128 } 129 protected ArrayList<T> getTheirEntries() { 130 return entries.get(THEIR_ENTRIES); 131 } 132 133 public int getMyEntriesSize() { 134 return getMyEntries().size(); 135 } 136 137 public int getMergedEntriesSize() { 138 return getMergedEntries().size(); 139 } 140 141 public int getTheirEntriesSize() { 142 return getTheirEntries().size(); 110 143 } 111 144 112 145 public ListMergeModel() { 113 myEntries = new ArrayList<T>(); 114 theirEntries = new ArrayList<T>(); 115 mergedEntries = new ArrayList<T>(); 146 entries = new HashMap<ListRole, ArrayList<T>>(); 147 for (ListRole role : ListRole.values()) { 148 entries.put(role, new ArrayList<T>()); 149 } 116 150 117 151 buildMyEntriesTableModel(); … … 119 153 buildMergedEntriesTableModel(); 120 154 121 myEntriesSelectionModel = new EntriesSelectionModel <T>(myEntries);122 theirEntriesSelectionModel = new EntriesSelectionModel <T>(theirEntries);123 mergedEntriesSelectionModel = new EntriesSelectionModel <T>(mergedEntries);155 myEntriesSelectionModel = new EntriesSelectionModel(entries.get(MY_ENTRIES)); 156 theirEntriesSelectionModel = new EntriesSelectionModel(entries.get(THEIR_ENTRIES)); 157 mergedEntriesSelectionModel = new EntriesSelectionModel(entries.get(MERGED_ENTRIES)); 124 158 125 159 listeners = new ArrayList<PropertyChangeListener>(); 160 comparePairListModel = new ComparePairListModel(); 126 161 127 162 setFrozen(true); 128 163 } 129 130 164 131 165 public void addPropertyChangeListener(PropertyChangeListener listener) { … … 147 181 protected void fireFrozenChanged(boolean oldValue, boolean newValue) { 148 182 synchronized(listeners) { 149 PropertyChangeEvent evt = new PropertyChangeEvent(this, PROP_FROZEN, oldValue, newValue);183 PropertyChangeEvent evt = new PropertyChangeEvent(this, FROZEN_PROP, oldValue, newValue); 150 184 for (PropertyChangeListener listener: listeners) { 151 185 listener.propertyChange(evt); … … 188 222 } 189 223 190 191 224 protected void fireModelDataChanged() { 192 225 myEntriesTableModel.fireTableDataChanged(); 193 226 theirEntriesTableModel.fireTableDataChanged(); 194 227 mergedEntriesTableModel.fireTableDataChanged(); 195 } 196 197 protected void copyToTop(List<T> source, int []rows) { 228 setChanged(); 229 notifyObservers(); 230 } 231 232 protected void copyToTop(ListRole role, int []rows) { 198 233 if (rows == null || rows.length == 0) 199 234 return; 200 235 for (int i = rows.length - 1; i >= 0; i--) { 201 236 int row = rows[i]; 202 T n = source.get(row);203 mergedEntries.add(0, cloneEntry(n));237 T n = entries.get(role).get(row); 238 entries.get(MERGED_ENTRIES).add(0, cloneEntryForMergedList(n)); 204 239 } 205 240 fireModelDataChanged(); … … 215 250 */ 216 251 public void copyMyToTop(int [] rows) { 217 copyToTop( myEntries, rows);252 copyToTop(MY_ENTRIES, rows); 218 253 } 219 254 … … 226 261 */ 227 262 public void copyTheirToTop(int [] rows) { 228 copyToTop( theirEntries, rows);263 copyToTop(THEIR_ENTRIES, rows); 229 264 } 230 265 … … 238 273 */ 239 274 240 public void copyToEnd(List <T>source, int [] rows) {275 public void copyToEnd(ListRole source, int [] rows) { 241 276 if (rows == null || rows.length == 0) 242 277 return; 278 ArrayList<T> mergedEntries = getMergedEntries(); 243 279 for (int row : rows) { 244 T n = source.get(row);245 mergedEntries.add(cloneEntry (n));280 T n = entries.get(source).get(row); 281 mergedEntries.add(cloneEntryForMergedList(n)); 246 282 } 247 283 fireModelDataChanged(); … … 258 294 */ 259 295 public void copyMyToEnd(int [] rows) { 260 copyToEnd( myEntries, rows);296 copyToEnd(MY_ENTRIES, rows); 261 297 } 262 298 … … 269 305 */ 270 306 public void copyTheirToEnd(int [] rows) { 271 copyToEnd( theirEntries, rows);307 copyToEnd(THEIR_ENTRIES, rows); 272 308 } 273 309 … … 282 318 * 283 319 */ 284 protected void copyBeforeCurrent(List <T>source, int [] rows, int current) {320 protected void copyBeforeCurrent(ListRole source, int [] rows, int current) { 285 321 if (rows == null || rows.length == 0) 286 322 return; 323 ArrayList<T> mergedEntries = getMergedEntries(); 287 324 if (current < 0 || current >= mergedEntries.size()) 288 325 throw new IllegalArgumentException(tr("parameter current out of range: got {0}", current)); 289 326 for (int i=rows.length -1; i>=0; i--) { 290 327 int row = rows[i]; 291 T n = source.get(row);292 mergedEntries.add(current, cloneEntry (n));328 T n = entries.get(source).get(row); 329 mergedEntries.add(current, cloneEntryForMergedList(n)); 293 330 } 294 331 fireModelDataChanged(); … … 306 343 */ 307 344 public void copyMyBeforeCurrent(int [] rows, int current) { 308 copyBeforeCurrent( myEntries,rows,current);345 copyBeforeCurrent(MY_ENTRIES,rows,current); 309 346 } 310 347 … … 319 356 */ 320 357 public void copyTheirBeforeCurrent(int [] rows, int current) { 321 copyBeforeCurrent( theirEntries,rows,current);358 copyBeforeCurrent(THEIR_ENTRIES,rows,current); 322 359 } 323 360 … … 332 369 * 333 370 */ 334 protected void copyAfterCurrent(List <T>source, int [] rows, int current) {371 protected void copyAfterCurrent(ListRole source, int [] rows, int current) { 335 372 if (rows == null || rows.length == 0) 336 373 return; 374 ArrayList<T> mergedEntries = getMergedEntries(); 375 337 376 if (current < 0 || current >= mergedEntries.size()) 338 377 throw new IllegalArgumentException(tr("parameter current out of range: got {0}", current)); 339 378 if (current == mergedEntries.size() -1) { 340 if (source == myEntries) { 341 copyMyToEnd(rows); 342 } else if (source == theirEntries) { 343 copyTheirToEnd(rows); 344 } 379 copyToEnd(source, rows); 345 380 } else { 346 381 for (int i=rows.length -1; i>=0; i--) { 347 382 int row = rows[i]; 348 T n = source.get(row);349 mergedEntries.add(current+1, cloneEntry (n));383 T n = entries.get(source).get(row); 384 mergedEntries.add(current+1, cloneEntryForMergedList(n)); 350 385 } 351 386 } 352 387 fireModelDataChanged(); 353 388 mergedEntriesSelectionModel.setSelectionInterval(current+1, current + rows.length-1); 389 notifyObservers(); 354 390 } 355 391 … … 364 400 */ 365 401 public void copyMyAfterCurrent(int [] rows, int current) { 366 copyAfterCurrent( myEntries, rows, current);402 copyAfterCurrent(MY_ENTRIES, rows, current); 367 403 } 368 404 … … 377 413 */ 378 414 public void copyTheirAfterCurrent(int [] rows, int current) { 379 copyAfterCurrent( theirEntries, rows, current);415 copyAfterCurrent(THEIR_ENTRIES, rows, current); 380 416 } 381 417 … … 393 429 // can't move up 394 430 return; 431 ArrayList<T> mergedEntries = getMergedEntries(); 395 432 for (int row: rows) { 396 433 T n = mergedEntries.get(row); … … 399 436 } 400 437 fireModelDataChanged(); 438 notifyObservers(); 401 439 mergedEntriesSelectionModel.clearSelection(); 402 440 for (int row: rows) { … … 414 452 if (rows == null || rows.length == 0) 415 453 return; 454 ArrayList<T> mergedEntries = getMergedEntries(); 416 455 if (rows[rows.length -1] == mergedEntries.size() -1) 417 456 // can't move down … … 424 463 } 425 464 fireModelDataChanged(); 465 notifyObservers(); 426 466 mergedEntriesSelectionModel.clearSelection(); 427 467 for (int row: rows) { … … 439 479 if (rows == null || rows.length == 0) 440 480 return; 481 482 ArrayList<T> mergedEntries = getMergedEntries(); 483 441 484 for (int i = rows.length-1; i>=0;i--) { 442 485 mergedEntries.remove(rows[i]); 443 486 } 444 487 fireModelDataChanged(); 488 notifyObservers(); 445 489 mergedEntriesSelectionModel.clearSelection(); 446 490 } … … 454 498 */ 455 499 protected boolean myAndTheirEntriesEqual() { 456 if (myEntries.size() != theirEntries.size()) 500 501 if (getMyEntries().size() != getTheirEntries().size()) 457 502 return false; 458 for (int i=0; i < myEntries.size(); i++) {459 if (! isEqualEntry( myEntries.get(i), theirEntries.get(i)))503 for (int i=0; i < getMyEntries().size(); i++) { 504 if (! isEqualEntry(getMyEntries().get(i), getTheirEntries().get(i))) 460 505 return false; 461 506 } … … 464 509 465 510 466 protected class EntriesTableModel<T1> extends DefaultTableModel { 467 private final ArrayList<T1> entries; 468 469 public EntriesTableModel(ArrayList<T1> nodes) { 470 this.entries = nodes; 511 /** 512 * This an adapter between a {@see JTable} and one of the three entry lists 513 * in the role {@see ListRole} managed by the {@see ListMergeModel}. 514 * 515 * From the point of view of the {@see JTable} it is a {@see TableModel}. 516 * 517 * @param <T> 518 * @see ListMergeModel#getMyTableModel() 519 * @see ListMergeModel#getTheirTableModel() 520 * @see ListMergeModel#getMergedTableModel() 521 */ 522 public class EntriesTableModel extends DefaultTableModel { 523 private final ListRole role; 524 525 /** 526 * 527 * @param role the role 528 */ 529 public EntriesTableModel(ListRole role) { 530 this.role = role; 471 531 } 472 532 473 533 @Override 474 534 public int getRowCount() { 475 int count = myEntries.size(); 476 count = Math.max(count, mergedEntries.size()); 477 count = Math.max(count, theirEntries.size()); 535 int count = Math.max(getMyEntries().size(), getMergedEntries().size()); 536 count = Math.max(count, getTheirEntries().size()); 478 537 return count; 479 538 } … … 481 540 @Override 482 541 public Object getValueAt(int row, int column) { 483 if (row < entries. size())484 return entries.get(ro w);542 if (row < entries.get(role).size()) 543 return entries.get(role).get(row); 485 544 return null; 486 545 } … … 495 554 ListMergeModel.this.setValueAt(this, value,row,col); 496 555 } 497 } 498 499 protected class EntriesSelectionModel<T1> extends DefaultListSelectionModel { 500 private final ArrayList<T1> entries; 501 502 public EntriesSelectionModel(ArrayList<T1> nodes) { 556 557 public ListMergeModel getListMergeModel() { 558 return ListMergeModel.this; 559 } 560 561 /** 562 * replies true if the {@see ListRole} of this {@see EntriesTableModel} 563 * participates in the current {@see ComparePairType} 564 * 565 * @return true, if the if the {@see ListRole} of this {@see EntriesTableModel} 566 * participates in the current {@see ComparePairType} 567 * 568 * @see ComparePairListModel#getSelectedComparePair() 569 */ 570 public boolean isParticipatingInCurrentComparePair() { 571 return getComparePairListModel() 572 .getSelectedComparePair() 573 .isParticipatingIn(role); 574 } 575 576 /** 577 * replies true if the entry at <code>row</code> is equal to the entry at the 578 * same position in the opposite list of the current {@see ComparePairType}. 579 * 580 * @param row the row number 581 * @return true if the entry at <code>row</code> is equal to the entry at the 582 * same position in the opposite list of the current {@see ComparePairType} 583 * @exception IllegalStateException thrown, if this model is not participating in the 584 * current {@see ComparePairType} 585 * @see ComparePairType#getOppositeRole(ListRole) 586 * @see #getRole() 587 * @see #getOppositeEntries() 588 */ 589 public boolean isSamePositionInOppositeList(int row) { 590 if (!isParticipatingInCurrentComparePair()) 591 throw new IllegalStateException(tr("list in role {0} is currently not participating in a compare pair", role.toString())); 592 if (row >= getEntries().size()) return false; 593 if (row >= getOppositeEntries().size()) return false; 594 595 T e1 = getEntries().get(row); 596 T e2 = getOppositeEntries().get(row); 597 return isEqualEntry(e1, e2); 598 } 599 600 /** 601 * replies true if the entry at the current position is present in the opposite list 602 * of the current {@see ComparePairType}. 603 * 604 * @param row the current row 605 * @return true if the entry at the current position is present in the opposite list 606 * of the current {@see ComparePairType}. 607 * @exception IllegalStateException thrown, if this model is not participating in the 608 * current {@see ComparePairType} 609 * @see ComparePairType#getOppositeRole(ListRole) 610 * @see #getRole() 611 * @see #getOppositeEntries() 612 */ 613 public boolean isIncludedInOppositeList(int row) { 614 if (!isParticipatingInCurrentComparePair()) 615 throw new IllegalStateException(tr("list in role {0} is currently not participating in a compare pair", role.toString())); 616 617 if (row >= getEntries().size()) return false; 618 T e1 = getEntries().get(row); 619 for (T e2: getOppositeEntries()) { 620 if (isEqualEntry(e1, e2)) return true; 621 } 622 return false; 623 } 624 625 protected ArrayList<T> getEntries() { 626 return entries.get(role); 627 } 628 629 /** 630 * replies the opposite list of entries with respect to the current {@see ComparePairType} 631 * 632 * @return the opposite list of entries 633 */ 634 protected ArrayList<T> getOppositeEntries() { 635 ListRole opposite = getComparePairListModel().getSelectedComparePair().getOppositeRole(role); 636 return entries.get(opposite); 637 } 638 639 public ListRole getRole() { 640 return role; 641 } 642 } 643 644 /** 645 * This is the selection model to be used in a {@see JTable} which displays 646 * an entry list managed by {@see ListMergeModel}. 647 * 648 * The model ensures that only rows displaying an entry in the entry list 649 * can be selected. "Empty" rows can't be selected. 650 * 651 * @see ListMergeModel#getMySelectionModel() 652 * @see ListMergeModel#getMergedSelectionModel() 653 * @see ListMergeModel#getTheirSelectionModel() 654 * 655 */ 656 protected class EntriesSelectionModel extends DefaultListSelectionModel { 657 private final ArrayList<T> entries; 658 659 public EntriesSelectionModel(ArrayList<T> nodes) { 503 660 this.entries = nodes; 504 661 } … … 584 741 } 585 742 } 743 744 public ComparePairListModel getComparePairListModel() { 745 return this.comparePairListModel; 746 } 747 748 public class ComparePairListModel extends AbstractListModel implements ComboBoxModel { 749 750 private int selectedIdx; 751 private final ArrayList<ComparePairType> compareModes; 752 753 public ComparePairListModel() { 754 this.compareModes = new ArrayList<ComparePairType>(); 755 compareModes.add(MY_WITH_THEIR); 756 compareModes.add(MY_WITH_MERGED); 757 compareModes.add(THEIR_WITH_MERGED); 758 selectedIdx = 0; 759 } 760 761 public Object getElementAt(int index) { 762 if (index < compareModes.size()) 763 return compareModes.get(index); 764 throw new IllegalArgumentException(tr("unexpected value of parameter \"index\". Got {0}", index)); 765 } 766 767 public int getSize() { 768 return compareModes.size(); 769 } 770 771 public Object getSelectedItem() { 772 return compareModes.get(selectedIdx); 773 } 774 775 public void setSelectedItem(Object anItem) { 776 int i = compareModes.indexOf(anItem); 777 if (i < 0) 778 throw new IllegalStateException(tr("item {0} not found in list", anItem)); 779 selectedIdx = i; 780 fireModelDataChanged(); 781 } 782 783 public ComparePairType getSelectedComparePair() { 784 return compareModes.get(selectedIdx); 785 } 786 } 586 787 } -
trunk/src/org/openstreetmap/josm/gui/conflict/ListMerger.java
r1642 r1650 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 import static org.openstreetmap.josm.tools.I18n.trn; 4 5 5 6 import java.awt.Adjustable; … … 26 27 import javax.swing.JButton; 27 28 import javax.swing.JCheckBox; 29 import javax.swing.JComboBox; 28 30 import javax.swing.JLabel; 29 31 import javax.swing.JPanel; … … 42 44 * @see ListMergeModel 43 45 */ 44 public abstract class ListMerger<T> extends JPanel implements PropertyChangeListener {46 public abstract class ListMerger<T> extends JPanel implements PropertyChangeListener, Observer { 45 47 private static final Logger logger = Logger.getLogger(ListMerger.class.getName()); 46 48 … … 72 74 private JCheckBox cbLockMergedScrolling; 73 75 private JCheckBox cbLockTheirScrolling; 76 77 private JLabel lblMyVersion; 78 private JLabel lblMergedVersion; 79 private JLabel lblTheirVersion; 80 81 82 private JLabel lblFrozenState; 74 83 75 84 abstract protected JScrollPane buildMyElementsTable(); … … 204 213 pnl.add(new JButton(removeMergedAction), gc); 205 214 206 gc.gridx = 0;207 gc.gridy = 1;208 gc.gridwidth = 3;209 gc.weightx = 1.0;210 freezeAction = new FreezeAction();211 JToggleButton btn = new JToggleButton(freezeAction);212 freezeAction.adapt(btn);213 btn.setName("button.freeze");214 btn.addItemListener(freezeAction);215 pnl.add(btn, gc);216 217 215 return pnl; 218 216 } … … 224 222 panel.add(cb); 225 223 return panel; 224 } 225 226 protected JPanel buildComparePairSelectionPanel() { 227 JPanel p = new JPanel(); 228 p.setLayout(new FlowLayout(FlowLayout.LEFT)); 229 p.add(new JLabel(tr("Compare "))); 230 JComboBox cbComparePair =new JComboBox(model.getComparePairListModel()); 231 cbComparePair.setRenderer(new ComparePairListCellRenderer()); 232 p.add(cbComparePair); 233 return p; 234 } 235 236 protected JPanel buildFrozeStateControlPanel() { 237 JPanel p = new JPanel(); 238 p.setLayout(new FlowLayout(FlowLayout.LEFT)); 239 lblFrozenState = new JLabel(); 240 p.add(lblFrozenState); 241 freezeAction = new FreezeAction(); 242 JToggleButton btn = new JToggleButton(freezeAction); 243 freezeAction.adapt(btn); 244 btn.setName("button.freeze"); 245 p.add(btn); 246 247 return p; 226 248 } 227 249 … … 239 261 gc.weightx = 0.0; 240 262 gc.weighty = 0.0; 241 gc.insets = new Insets(10,0, 10,0);242 JLabel lbl= new JLabel(tr("My version"));243 lbl .setToolTipText(tr("List of elements in my dataset, i.e. the local dataset"));244 add(lbl , gc);263 gc.insets = new Insets(10,0,0,0); 264 lblMyVersion = new JLabel(tr("My version")); 265 lblMyVersion.setToolTipText(tr("List of elements in my dataset, i.e. the local dataset")); 266 add(lblMyVersion, gc); 245 267 246 268 gc.gridx = 2; 247 269 gc.gridy = 0; 248 lbl = new JLabel(tr("Merged version"));249 lbl .setToolTipText(tr("List of merged elements. They will replace the my elements when the merge decisions are applied."));250 add(lbl , gc);270 lblMergedVersion = new JLabel(tr("Merged version")); 271 lblMergedVersion.setToolTipText(tr("List of merged elements. They will replace the my elements when the merge decisions are applied.")); 272 add(lblMergedVersion, gc); 251 273 252 274 gc.gridx = 4; 253 275 gc.gridy = 0; 254 lbl = new JLabel(tr("Their version"));255 lbl .setToolTipText(tr("List of elements in their dataset, i.e. the server dataset"));256 add(lbl , gc);276 lblTheirVersion = new JLabel(tr("Their version")); 277 lblTheirVersion.setToolTipText(tr("List of elements in their dataset, i.e. the server dataset")); 278 add(lblTheirVersion, gc); 257 279 258 280 // ------------------------------ … … 343 365 add(buildMergedListControlButtons(), gc); 344 366 367 // ----------------------------------- 368 gc.gridx = 0; 369 gc.gridy = 4; 370 gc.gridwidth = 2; 371 gc.gridheight = 1; 372 gc.fill = GridBagConstraints.HORIZONTAL; 373 gc.anchor = GridBagConstraints.LINE_START; 374 gc.weightx = 0.0; 375 gc.weighty = 0.0; 376 add(buildComparePairSelectionPanel(), gc); 377 378 gc.gridx = 2; 379 gc.gridy = 4; 380 gc.gridwidth = 3; 381 gc.gridheight = 1; 382 gc.fill = GridBagConstraints.HORIZONTAL; 383 gc.anchor = GridBagConstraints.LINE_START; 384 gc.weightx = 0.0; 385 gc.weighty = 0.0; 386 add(buildFrozeStateControlPanel(), gc); 387 388 345 389 wireActionsToSelectionModels(); 346 390 } … … 348 392 public ListMerger(ListMergeModel<T> model) { 349 393 this.model = model; 394 model.addObserver(this); 350 395 build(); 351 396 model.addPropertyChangeListener(this); … … 714 759 int state = e.getStateChange(); 715 760 if (state == ItemEvent.SELECTED) { 716 model.setFrozen(true);717 761 putValue(Action.NAME, tr("Unfreeze")); 718 762 putValue(Action.SHORT_DESCRIPTION, tr("Unfreeze the list of merged elements and start merging")); 763 model.setFrozen(true); 719 764 } else if (state == ItemEvent.DESELECTED) { 720 model.setFrozen(false);721 765 putValue(Action.NAME, tr("Freeze")); 722 766 putValue(Action.SHORT_DESCRIPTION, tr("Freeze the current list of merged elements")); 767 model.setFrozen(false); 723 768 } 724 769 boolean isSelected = (Boolean)getValue(PROP_SELECTED); … … 737 782 mergedEntriesTable.getSelectionModel().clearSelection(); 738 783 mergedEntriesTable.setEnabled(!newValue); 739 freezeAction.putValue(FreezeActionProperties.PROP_SELECTED, newValue); 740 } 741 784 if (freezeAction != null) { 785 freezeAction.putValue(FreezeActionProperties.PROP_SELECTED, newValue); 786 } 787 if (newValue) { 788 lblFrozenState.setText( 789 tr("<html>Click <strong>{0}</strong> to start merging my and their entries</html>", 790 freezeAction.getValue(Action.NAME)) 791 ); 792 } else { 793 lblFrozenState.setText( 794 tr("<html>Click <strong>{0}</strong> to finish merging my and their entries</html>", 795 freezeAction.getValue(Action.NAME)) 796 ); 797 } 798 } 742 799 743 800 public void propertyChange(PropertyChangeEvent evt) { 744 if (evt.getPropertyName().equals(ListMergeModel. PROP_FROZEN)) {801 if (evt.getPropertyName().equals(ListMergeModel.FROZEN_PROP)) { 745 802 handlePropertyChangeFrozen((Boolean)evt.getOldValue(), (Boolean)evt.getNewValue()); 746 803 } … … 749 806 public ListMergeModel<T> getModel() { 750 807 return model; 808 } 809 810 811 public void update(Observable o, Object arg) { 812 lblMyVersion.setText( 813 tr("My version ") 814 + trn("({0} entry)", "({0} entries)", model.getMyEntriesSize(), model.getMyEntriesSize()) 815 ); 816 lblMergedVersion.setText( 817 tr("Merged version ") 818 + trn("({0} entry)", "({0} entries)", model.getMergedEntriesSize(), model.getMergedEntriesSize()) 819 ); 820 lblTheirVersion.setText( 821 tr("Their version ") 822 + trn("({0} entry)", "({0} entries)", model.getTheirEntriesSize(), model.getTheirEntriesSize()) 823 ); 751 824 } 752 825 -
trunk/src/org/openstreetmap/josm/gui/conflict/nodes/NodeListColumnModel.java
r1642 r1650 17 17 col = new TableColumn(0); 18 18 col.setHeaderValue(""); 19 col.setResizable( false);19 col.setResizable(true); 20 20 col.setWidth(30); 21 col.set MaxWidth(30);21 col.setPreferredWidth(30); 22 22 col.setCellRenderer(renderer); 23 23 addColumn(col); -
trunk/src/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModel.java
r1631 r1650 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.conflict.nodes; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.util.ArrayList; … … 11 13 import org.openstreetmap.josm.data.osm.Way; 12 14 import org.openstreetmap.josm.gui.conflict.ListMergeModel; 15 import org.openstreetmap.josm.gui.conflict.ListRole; 13 16 14 17 public class NodeListMergeModel extends ListMergeModel<Node>{ … … 28 31 public void populate(Way my, Way their) { 29 32 if (my == null) 30 throw new IllegalArgumentException( "parameter 'way' must not be null");33 throw new IllegalArgumentException(tr("parameter \"way\" must not be null")); 31 34 if (their == null) 32 throw new IllegalArgumentException( "parameter 'their' must not be null");33 mergedEntries.clear();34 myEntries.clear();35 theirEntries.clear();35 throw new IllegalArgumentException(tr("parameter \"their\" must not be null")); 36 getMergedEntries().clear(); 37 getMyEntries().clear(); 38 getTheirEntries().clear(); 36 39 for (Node n : my.nodes) { 37 myEntries.add(n);40 getMyEntries().add(n); 38 41 } 39 42 for (Node n : their.nodes) { 40 theirEntries.add(n);43 getTheirEntries().add(n); 41 44 } 42 45 if (myAndTheirEntriesEqual()) { 43 mergedEntries = new ArrayList<Node>(myEntries);46 entries.put(ListRole.MERGED_ENTRIES, new ArrayList<Node>(getMyEntries())); 44 47 setFrozen(true); 45 48 } else { … … 62 65 public WayNodesConflictResolverCommand buildResolveCommand(Way my, Way their) { 63 66 if (my == null) 64 throw new IllegalArgumentException( "parameter my most not be null");67 throw new IllegalArgumentException(tr("parameter \"my\" most not be null")); 65 68 if (their == null) 66 throw new IllegalArgumentException( "parameter my most not be null");69 throw new IllegalArgumentException(tr("parameter \"my\" most not be null")); 67 70 if (! isFrozen()) 68 throw new IllegalArgumentException( "merged nodes not frozen yet. Can't build resolution command");69 return new WayNodesConflictResolverCommand(my, their, mergedEntries);71 throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Can't build resolution command")); 72 return new WayNodesConflictResolverCommand(my, their, getMergedEntries()); 70 73 } 71 74 … … 73 76 @Override 74 77 public boolean isEqualEntry(Node e1, Node e2) { 75 return e1.id == e2.id; 78 if (e1.id > 0) 79 return e1.id == e2.id; 80 else 81 return e1 == e2; 76 82 } 77 83 … … 82 88 83 89 @Override 84 protected Node cloneEntry(Node entry) { 85 Node n = new Node(entry.id); 86 n.cloneFrom(entry); 87 return n; 90 protected Node cloneEntryForMergedList(Node entry) { 91 return entry; 88 92 } 89 93 } -
trunk/src/org/openstreetmap/josm/gui/conflict/nodes/NodeListTableCellRenderer.java
r1642 r1650 7 7 import java.awt.Component; 8 8 import java.text.DecimalFormat; 9 import java.util.ArrayList; 10 import java.util.Collections; 11 import java.util.logging.Logger; 9 12 10 13 import javax.swing.BorderFactory; … … 16 19 17 20 import org.openstreetmap.josm.data.osm.Node; 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 import org.openstreetmap.josm.gui.conflict.ListMergeModel; 18 23 import org.openstreetmap.josm.tools.ImageProvider; 19 24 … … 23 28 */ 24 29 public class NodeListTableCellRenderer extends JLabel implements TableCellRenderer { 30 static private final Logger logger = Logger.getLogger(NodeListTableCellRenderer.class.getName()); 25 31 private static DecimalFormat COORD_FORMATTER = new DecimalFormat("###0.0000"); 26 32 public final static Color BGCOLOR_SELECTED = new Color(143,170,255); 27 33 public final static Color BGCOLOR_EMPTY_ROW = new Color(234,234,234); 28 29 private ImageIcon icon = null; 30 private Border rowNumberBorder = null; 34 public final static Color BGCOLOR_FROZEN = new Color(234,234,234); 35 public final static Color BGCOLOR_PARTICIPAING_IN_COMPARISON = Color.BLACK; 36 public final static Color FGCOLOR_PARTICIPAING_IN_COMPARISON = Color.WHITE; 37 38 public final static Color BGCOLOR_NOT_IN_OPPOSITE = new Color(255,197,197); 39 public final static Color BGCOLOR_IN_OPPOSITE = new Color(255,234,213); 40 public final static Color BGCOLOR_SAME_POSITION_IN_OPPOSITE = new Color(217,255,217); 41 42 private final ImageIcon icon; 43 private final Border rowNumberBorder; 31 44 32 45 /** … … 68 81 } 69 82 83 84 public String buildToolTipText(OsmPrimitive primitive) { 85 StringBuilder sb = new StringBuilder(); 86 sb.append("<html>"); 87 sb.append("<strong>id</strong>=") 88 .append(primitive.id) 89 .append("<br>"); 90 ArrayList<String> keyList = new ArrayList<String>(primitive.keySet()); 91 Collections.sort(keyList); 92 for (int i = 0; i < keyList.size(); i++) { 93 if (i > 0) { 94 sb.append("<br>"); 95 } 96 String key = keyList.get(i); 97 sb.append("<strong>") 98 .append(key) 99 .append("</strong>") 100 .append("="); 101 String value = primitive.get(key); 102 while(value.length() != 0) { 103 sb.append(value.substring(0,Math.min(50, value.length()))); 104 if (value.length() > 50) { 105 sb.append("<br>"); 106 value = value.substring(50); 107 } else { 108 value = ""; 109 } 110 } 111 } 112 sb.append("</html>"); 113 return sb.toString(); 114 } 115 70 116 /** 71 117 * reset the renderer … … 76 122 } 77 123 124 125 78 126 /** 79 127 * render a node 128 * @param model the model 80 129 * @param node the node 81 * @param isSelected 82 */ 83 protected void renderNode( Node node, boolean isSelected) {130 * @param isSelected true, if the current row is selected 131 */ 132 protected void renderNode(ListMergeModel<Node>.EntriesTableModel model, Node node, int row, boolean isSelected) { 84 133 setIcon(icon); 85 134 setBorder(null); 86 if (isSelected) { 135 if (model.getListMergeModel().isFrozen()) { 136 setBackground(BGCOLOR_FROZEN); 137 } else if (isSelected) { 87 138 setBackground(BGCOLOR_SELECTED); 139 } else if (model.isParticipatingInCurrentComparePair()) { 140 if (model.isSamePositionInOppositeList(row)) { 141 setBackground(BGCOLOR_SAME_POSITION_IN_OPPOSITE); 142 } else if (model.isIncludedInOppositeList(row)) { 143 setBackground(BGCOLOR_IN_OPPOSITE); 144 } else { 145 setBackground(BGCOLOR_NOT_IN_OPPOSITE); 146 } 88 147 } 89 148 setText(getDisplayName(node)); 90 } 91 149 setToolTipText(buildToolTipText(node)); 150 } 151 152 /** 153 * render an empty row 154 */ 92 155 protected void renderEmptyRow() { 93 156 setIcon(null); … … 98 161 /** 99 162 * render the row id 163 * @param model the model 100 164 * @param row the row index 101 * @param isSelected 102 */ 103 protected void renderRowId( int row, boolean isSelected) {165 * @param isSelected true, if the current row is selected 166 */ 167 protected void renderRowId( ListMergeModel<Node>.EntriesTableModel model, int row, boolean isSelected) { 104 168 setIcon(null); 105 169 setBorder(rowNumberBorder); 106 if (isSelected) { 107 setBackground(BGCOLOR_SELECTED); 170 if (model.getListMergeModel().isFrozen()) { 171 setBackground(BGCOLOR_FROZEN); 172 } else if (model.isParticipatingInCurrentComparePair()) { 173 setBackground(BGCOLOR_PARTICIPAING_IN_COMPARISON); 174 setForeground(FGCOLOR_PARTICIPAING_IN_COMPARISON); 108 175 } 109 176 setText(Integer.toString(row+1)); … … 117 184 switch(column) { 118 185 case 0: 119 renderRowId( row, isSelected);186 renderRowId(getModel(table),row, isSelected); 120 187 break; 121 188 case 1: … … 123 190 renderEmptyRow(); 124 191 } else { 125 renderNode( node,isSelected);192 renderNode(getModel(table), node, row, isSelected); 126 193 } 127 194 break; … … 132 199 return this; 133 200 } 201 202 /** 203 * replies the model 204 * @param table the table 205 * @return the table model 206 */ 207 protected ListMergeModel<Node>.EntriesTableModel getModel(JTable table) { 208 return (ListMergeModel.EntriesTableModel)table.getModel(); 209 } 134 210 } -
trunk/src/org/openstreetmap/josm/gui/conflict/relation/RelationMemberListColumnModel.java
r1642 r1650 16 16 col = new TableColumn(0); 17 17 col.setHeaderValue(""); 18 col.setResizable( false);18 col.setResizable(true); 19 19 col.setWidth(20); 20 col.set MaxWidth(20);20 col.setPreferredWidth(20); 21 21 col.setCellRenderer(renderer); 22 22 addColumn(col); -
trunk/src/org/openstreetmap/josm/gui/conflict/relation/RelationMemberListMergeModel.java
r1642 r1650 9 9 10 10 import org.openstreetmap.josm.command.RelationMemberConflictResolverCommand; 11 import org.openstreetmap.josm.data.osm.Node;12 11 import org.openstreetmap.josm.data.osm.Relation; 13 12 import org.openstreetmap.josm.data.osm.RelationMember; 14 import org.openstreetmap.josm.data.osm.Way;15 13 import org.openstreetmap.josm.gui.conflict.ListMergeModel; 14 import org.openstreetmap.josm.gui.conflict.ListRole; 16 15 /** 17 16 * The model for merging two lists of relation members … … 25 24 @Override 26 25 public boolean isEqualEntry(RelationMember e1, RelationMember e2) { 27 return 28 ( (e1.role == null && e2.role == null) 29 || (e1.role != null && e1.role.equals(e2.role)) 30 ) 31 && e1.member.id == e2.member.id; 26 boolean ret = 27 ( (e1.role == null && e2.role == null) 28 || (e1.role != null && e1.role.equals(e2.role)) 29 ); 30 if (e1.member.id > 0 ) { 31 ret = ret && (e1.member.id == e2.member.id); 32 } else { 33 ret = ret && (e1 == e2); 34 } 35 return ret; 32 36 } 33 37 … … 37 41 // editing cells in the first column 38 42 // 39 mergedEntriesTableModel = this.new EntriesTableModel <RelationMember>(mergedEntries) {43 mergedEntriesTableModel = this.new EntriesTableModel(ListRole.MERGED_ENTRIES) { 40 44 @Override 41 45 public boolean isCellEditable(int row, int column) { … … 51 55 protected void setValueAt(DefaultTableModel model, Object value, int row, int col) { 52 56 if (model == getMergedTableModel() && col == 1) { 53 RelationMember member = mergedEntries.get(row);57 RelationMember member = getMergedEntries().get(row); 54 58 member.role = (String)value; 55 59 fireModelDataChanged(); … … 72 76 throw new IllegalArgumentException(tr("parameter their must not be null")); 73 77 74 mergedEntries.clear();75 myEntries.clear();76 theirEntries.clear();78 getMergedEntries().clear(); 79 getMyEntries().clear(); 80 getTheirEntries().clear(); 77 81 78 82 for (RelationMember n : my.members) { 79 myEntries.add(n);83 getMyEntries().add(n); 80 84 } 81 85 for (RelationMember n : their.members) { 82 theirEntries.add(n);86 getTheirEntries().add(n); 83 87 } 84 88 if (myAndTheirEntriesEqual()) { 85 for (RelationMember m : myEntries) {86 mergedEntries.add(cloneEntry(m));89 for (RelationMember m : getMyEntries()) { 90 getMergedEntries().add(cloneEntryForMergedList(m)); 87 91 } 88 92 setFrozen(true); … … 95 99 96 100 @Override 97 protected RelationMember cloneEntry (RelationMember entry) {101 protected RelationMember cloneEntryForMergedList(RelationMember entry) { 98 102 RelationMember member = new RelationMember(); 99 103 member.role = entry.role; 100 if (entry.member instanceof Node) { 101 member.member = new Node(entry.member.id); 102 } else if (entry.member instanceof Way) { 103 member.member = new Way(entry.member.id); 104 } else if (entry.member instanceof Relation) { 105 member.member = new Relation(entry.member.id); 106 } 107 member.member.cloneFrom(entry.member); 104 member.member = entry.member; 108 105 return member; 109 106 } … … 126 123 if (! isFrozen()) 127 124 throw new IllegalArgumentException(tr("merged nodes not frozen yet. Can't build resolution command")); 128 return new RelationMemberConflictResolverCommand(my, their, mergedEntries);125 return new RelationMemberConflictResolverCommand(my, their, getMergedEntries()); 129 126 } 130 127 } -
trunk/src/org/openstreetmap/josm/gui/conflict/relation/RelationMemberTableCellRenderer.java
r1642 r1650 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.conflict.relation; 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 3 6 4 import java.awt.Color; 7 5 import java.awt.Component; 8 6 import java.text.DecimalFormat; 7 import java.util.ArrayList; 8 import java.util.Collections; 9 9 10 10 import javax.swing.BorderFactory; … … 20 20 import org.openstreetmap.josm.data.osm.RelationMember; 21 21 import org.openstreetmap.josm.data.osm.Way; 22 import org.openstreetmap.josm.gui.conflict.ListMergeModel; 22 23 import org.openstreetmap.josm.tools.ImageProvider; 23 24 … … 31 32 public final static Color BGCOLOR_EMPTY_ROW = new Color(234,234,234); 32 33 34 public final static Color BGCOLOR_NOT_IN_OPPOSITE = new Color(255,197,197); 35 public final static Color BGCOLOR_IN_OPPOSITE = new Color(255,234,213); 36 public final static Color BGCOLOR_SAME_POSITION_IN_OPPOSITE = new Color(217,255,217); 37 38 public final static Color BGCOLOR_PARTICIPAING_IN_COMPARISON = Color.BLACK; 39 public final static Color FGCOLOR_PARTICIPAING_IN_COMPARISON = Color.WHITE; 40 41 public final static Color BGCOLOR_FROZEN = new Color(234,234,234); 42 33 43 private ImageIcon nodeIcon; 34 44 private ImageIcon wayIcon; … … 57 67 } 58 68 69 70 public String buildToolTipText(OsmPrimitive primitive) { 71 StringBuilder sb = new StringBuilder(); 72 sb.append("<html>"); 73 sb.append("<strong>id</strong>=") 74 .append(primitive.id) 75 .append("<br>"); 76 ArrayList<String> keyList = new ArrayList<String>(primitive.keySet()); 77 Collections.sort(keyList); 78 for (int i = 0; i < keyList.size(); i++) { 79 if (i > 0) { 80 sb.append("<br>"); 81 } 82 String key = keyList.get(i); 83 sb.append("<strong>") 84 .append(key) 85 .append("</strong>") 86 .append("="); 87 String value = primitive.get(key); 88 while(value.length() != 0) { 89 sb.append(value.substring(0,Math.min(50, value.length()))); 90 if (value.length() > 50) { 91 sb.append("<br>"); 92 value = value.substring(50); 93 } else { 94 value = ""; 95 } 96 } 97 } 98 sb.append("</html>"); 99 return sb.toString(); 100 } 101 59 102 /** 60 103 * creates the display name for a node. The name is derived from the nodes id, … … 67 110 StringBuilder sb = new StringBuilder(); 68 111 OsmPrimitive primitive = member.member; 69 if (primitive instanceof Node) {70 sb.append(tr("Node"));71 } else if (primitive instanceof Way) {72 sb.append(tr("Way"));73 } else if (primitive instanceof Relation) {74 sb.append(tr("Relation"));75 }76 sb.append(" ");77 112 if (primitive.get("name") != null) { 78 113 sb.append(primitive.get("name")); … … 110 145 111 146 112 protected void setBackground(boolean isSelected) { 113 Color bgc = isSelected ? BGCOLOR_SELECTED : Color.WHITE; 147 protected void renderBackground(ListMergeModel<Node>.EntriesTableModel model, RelationMember member, int row, int col, boolean isSelected) { 148 Color bgc = Color.WHITE; 149 if (col == 0) { 150 if (model.getListMergeModel().isFrozen()) { 151 bgc = BGCOLOR_FROZEN; 152 } else if (model.isParticipatingInCurrentComparePair()) { 153 bgc = BGCOLOR_PARTICIPAING_IN_COMPARISON; 154 } else if (isSelected) { 155 bgc = BGCOLOR_SELECTED; 156 } 157 } else { 158 if (model.getListMergeModel().isFrozen()) { 159 bgc = BGCOLOR_FROZEN; 160 } else if (member == null) { 161 bgc = BGCOLOR_EMPTY_ROW; 162 } else if (isSelected) { 163 bgc = BGCOLOR_SELECTED; 164 } else { 165 if (model.isParticipatingInCurrentComparePair()) { 166 if (model.isSamePositionInOppositeList(row)) { 167 bgc = BGCOLOR_SAME_POSITION_IN_OPPOSITE; 168 } else if (model.isIncludedInOppositeList(row)) { 169 bgc = BGCOLOR_IN_OPPOSITE; 170 } else { 171 bgc = BGCOLOR_NOT_IN_OPPOSITE; 172 } 173 } 174 } 175 } 114 176 setBackground(bgc); 177 } 178 179 protected void renderForeground(ListMergeModel<Node>.EntriesTableModel model, RelationMember member, int row, int col, boolean isSelected) { 180 Color fgc = Color.BLACK; 181 if (col == 0 && model.isParticipatingInCurrentComparePair() && ! model.getListMergeModel().isFrozen()) { 182 fgc = Color.WHITE; 183 } 184 setForeground(fgc); 115 185 } 116 186 … … 123 193 String displayName = getDisplayName(member); 124 194 setText(displayName); 125 setToolTipText( displayName);195 setToolTipText(buildToolTipText(member.member)); 126 196 if (member.member instanceof Node) { 127 197 setIcon(nodeIcon); … … 141 211 * @param isSelected 142 212 */ 143 protected void renderRowId(int row , boolean isSelected) {213 protected void renderRowId(int row) { 144 214 setBorder(rowNumberBorder); 145 215 setText(Integer.toString(row+1)); … … 158 228 RelationMember member = (RelationMember)value; 159 229 reset(); 160 setBackground(isSelected); 230 renderBackground(getModel(table), member, row, column, isSelected); 231 renderForeground(getModel(table), member, row, column, isSelected); 161 232 switch(column) { 162 233 case 0: 163 renderRowId(row , isSelected);234 renderRowId(row); 164 235 break; 165 236 case 1: … … 183 254 } 184 255 256 /** 257 * replies the model 258 * @param table the table 259 * @return the table model 260 */ 261 protected ListMergeModel<Node>.EntriesTableModel getModel(JTable table) { 262 return (ListMergeModel.EntriesTableModel)table.getModel(); 263 } 185 264 } -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java
r1631 r1650 3 3 4 4 import static org.fest.reflect.core.Reflection.field; 5 import static org.fest.reflect.core.Reflection.method; 5 6 import static org.junit.Assert.assertEquals; 6 7 import static org.junit.Assert.assertTrue; … … 21 22 22 23 protected List<Node> inspectNodeList(NodeListMergeModel model, String name) { 23 return field(name).ofType(ArrayList.class) 24 return method("get" + name + "Entries") 25 .withReturnType(List.class) 24 26 .in(model) 25 . get();27 .invoke(); 26 28 } 27 29 … … 69 71 model.copyMyToTop(new int[]{0}); 70 72 71 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");73 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 72 74 73 75 assertEquals(1, mergedNodes.size()); … … 92 94 model.populate(myWay, theirWay); 93 95 94 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");96 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 95 97 mergedNodes.add(new Node(1)); 96 98 97 99 model.copyMyToTop(new int[]{0}); 98 100 99 mergedNodes = inspectNodeList(model, " mergedEntries");101 mergedNodes = inspectNodeList(model, "Merged"); 100 102 assertEquals(2, mergedNodes.size()); 101 103 assertEquals(2, mergedNodes.get(0).id); … … 123 125 model.populate(myWay, theirWay); 124 126 125 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");127 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 126 128 mergedNodes.add(new Node(1)); 127 129 128 130 model.copyMyToTop(new int[]{1}); // copy node 3 129 131 130 mergedNodes = inspectNodeList(model, " mergedEntries");132 mergedNodes = inspectNodeList(model, "Merged"); 131 133 assertEquals(2, mergedNodes.size()); 132 134 assertEquals(3, mergedNodes.get(0).id); // my node 3 at position 0 … … 150 152 model.populate(myWay, theirWay); 151 153 152 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");154 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 153 155 mergedNodes.add(new Node(1)); 154 156 155 157 model.copyMyToTop(new int[]{1,2}); // copy node 3 and 4 156 158 157 mergedNodes = inspectNodeList(model, " mergedEntries");159 mergedNodes = inspectNodeList(model, "Merged"); 158 160 assertEquals(3, mergedNodes.size()); 159 161 assertEquals(3, mergedNodes.get(0).id); // my node 3 at position 0 … … 178 180 model.copyMyToEnd(new int[]{0}); 179 181 180 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");182 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 181 183 182 184 assertEquals(1, mergedNodes.size()); … … 198 200 model.populate(myWay, theirWay); 199 201 200 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");202 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 201 203 mergedNodes.add(new Node(1)); 202 204 203 205 model.copyMyToEnd(new int[]{0}); 204 206 205 mergedNodes = inspectNodeList(model, " mergedEntries");207 mergedNodes = inspectNodeList(model, "Merged"); 206 208 assertEquals(2, mergedNodes.size()); 207 209 assertEquals(1, mergedNodes.get(0).id); // already merged node 1 at position 0 … … 224 226 model.populate(myWay, theirWay); 225 227 226 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");228 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 227 229 mergedNodes.add(new Node(1)); 228 230 229 231 model.copyMyToEnd(new int[]{1}); // copy node 3 230 232 231 mergedNodes = inspectNodeList(model, " mergedEntries");233 mergedNodes = inspectNodeList(model, "Merged"); 232 234 assertEquals(2, mergedNodes.size()); 233 235 assertEquals(1, mergedNodes.get(0).id); // already merged node 1 at position 0 … … 252 254 model.populate(myWay, theirWay); 253 255 254 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");256 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 255 257 mergedNodes.add(new Node(1)); 256 258 257 259 model.copyMyToEnd(new int[]{1,2}); // copy node 3 and 4 258 260 259 mergedNodes = inspectNodeList(model, " mergedEntries");261 mergedNodes = inspectNodeList(model, "Merged"); 260 262 assertEquals(3, mergedNodes.size()); 261 263 assertEquals(1, mergedNodes.get(0).id); // already merged node 1 at position 0 … … 282 284 283 285 model.populate(myWay, theirWay); 284 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");286 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 285 287 mergedNodes.add(new Node(10)); 286 288 mergedNodes.add(new Node(11)); … … 310 312 311 313 model.populate(myWay, theirWay); 312 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");314 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 313 315 mergedNodes.add(new Node(10)); 314 316 mergedNodes.add(new Node(11)); … … 338 340 339 341 model.populate(myWay, theirWay); 340 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");342 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 341 343 mergedNodes.add(new Node(10)); 342 344 mergedNodes.add(new Node(11)); … … 371 373 372 374 model.populate(myWay, theirWay); 373 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");375 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 374 376 mergedNodes.add(new Node(10)); 375 377 mergedNodes.add(new Node(11)); … … 400 402 401 403 model.populate(myWay, theirWay); 402 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");404 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 403 405 mergedNodes.add(new Node(10)); 404 406 mergedNodes.add(new Node(11)); … … 430 432 431 433 model.populate(myWay, theirWay); 432 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");434 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 433 435 mergedNodes.add(new Node(10)); 434 436 mergedNodes.add(new Node(11)); … … 458 460 459 461 model.populate(myWay, theirWay); 460 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");462 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 461 463 mergedNodes.add(new Node(10)); 462 464 mergedNodes.add(new Node(11)); … … 491 493 492 494 model.populate(myWay, theirWay); 493 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");495 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 494 496 mergedNodes.add(new Node(10)); 495 497 mergedNodes.add(new Node(11)); … … 517 519 518 520 model.populate(myWay, theirWay); 519 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");521 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 520 522 mergedNodes.add(new Node(10)); 521 523 mergedNodes.add(new Node(11)); … … 547 549 548 550 model.populate(myWay, theirWay); 549 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");551 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 550 552 mergedNodes.add(new Node(10)); 551 553 mergedNodes.add(new Node(11)); … … 580 582 581 583 model.populate(myWay, theirWay); 582 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");584 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 583 585 mergedNodes.add(new Node(10)); 584 586 mergedNodes.add(new Node(11)); … … 606 608 607 609 model.populate(myWay, theirWay); 608 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");610 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 609 611 mergedNodes.add(new Node(10)); 610 612 mergedNodes.add(new Node(11)); … … 636 638 637 639 model.populate(myWay, theirWay); 638 List<Node> mergedNodes = inspectNodeList(model, " mergedEntries");640 List<Node> mergedNodes = inspectNodeList(model, "Merged"); 639 641 mergedNodes.add(new Node(10)); 640 642 mergedNodes.add(new Node(11));
Note:
See TracChangeset
for help on using the changeset viewer.