Changeset 23916 in osm
- Timestamp:
- 2010-10-30T16:35:28+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressEditAction.java
r23891 r23916 8 8 import java.util.Collection; 9 9 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.actions.JosmAction; 12 11 import org.openstreetmap.josm.data.SelectionChangedListener; -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressNode.java
r23915 r23916 15 15 16 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 import org.openstreetmap.josm.plugins.addressEdit.gui.GuessAddressDataAction;18 17 19 18 public class AddressNode extends NodeEntityBase { … … 77 76 this.guessedStreetName = guessedStreetName; 78 77 fireEntityChanged(this); 78 } 79 80 public boolean hasGuessedStreetName() { 81 return !StringUtils.isNullOrEmpty(guessedStreetName); 79 82 } 80 83 … … 176 179 } 177 180 181 /** 182 * Applies the guessed street name to the addr:street tag value. 183 */ 178 184 public void applyGuessedStreet() { 179 if ( !StringUtils.isNullOrEmpty(getGuessedStreetName())) {185 if (hasGuessedStreetName()) { 180 186 setOSMTag(TagUtils.ADDR_STREET_TAG, guessedStreetName); 181 187 } -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/NodeEntityBase.java
r23915 r23916 112 112 newNode.put(tag, newValue); 113 113 Main.main.undoRedo.add( new ChangeCommand(oldNode, newNode)); 114 fireEntityChanged(this); 114 115 } 115 116 -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/AddressEditDialog.java
r23915 r23916 115 115 unresolvedTable.getSelectionModel().addListSelectionListener(this); 116 116 unresolvedTable.getSelectionModel().addListSelectionListener(new IncompleteAddressListener()); 117 unresolvedTable.addMouseListener(new IncompleteAddressesMouseListener()); 117 118 118 119 JScrollPane scroll2 = new JScrollPane(unresolvedTable); -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/AddressEditTableModel.java
r23915 r23916 20 20 import org.openstreetmap.josm.plugins.addressEdit.INodeEntity; 21 21 22 public class AddressEditTableModel extends DefaultTableModel implements IAddressEditContainerListener{22 public abstract class AddressEditTableModel extends DefaultTableModel implements IAddressEditContainerListener{ 23 23 24 24 /** … … 43 43 fireTableDataChanged(); 44 44 } 45 46 /** 47 * Gets the node entity for the given row or null; if row contains no entity. 48 * @param row The row to get the entity object for. 49 * @return 50 */ 51 public abstract INodeEntity getEntityOfRow(int row); 45 52 } -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/IncompleteAddressesTableModel.java
r23915 r23916 18 18 import org.openstreetmap.josm.plugins.addressEdit.AddressEditContainer; 19 19 import org.openstreetmap.josm.plugins.addressEdit.AddressNode; 20 import org.openstreetmap.josm.plugins.addressEdit.INodeEntity; 20 21 import org.openstreetmap.josm.plugins.addressEdit.StringUtils; 21 22 … … 58 59 59 60 @Override 60 public Object getValueAt(int row, int column) { 61 if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) { 61 public Object getValueAt(int row, int column) { 62 AddressNode aNode = (AddressNode) getEntityOfRow(row); 63 64 if (aNode == null) { 62 65 return null; 63 66 } 64 if (row < 0 || row > addressContainer.getNumberOfIncompleteAddresses()) {65 return null;66 }67 AddressNode aNode = addressContainer.getIncompleteAddresses().get(row);68 67 69 68 switch (column) { … … 100 99 return false; 101 100 } 101 102 @Override 103 public INodeEntity getEntityOfRow(int row) { 104 if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) { 105 return null; 106 } 107 if (row < 0 || row > addressContainer.getNumberOfIncompleteAddresses()) { 108 return null; 109 } 110 return addressContainer.getIncompleteAddresses().get(row); 111 } 102 112 } -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/StreetTableModel.java
r23849 r23916 17 17 18 18 import org.openstreetmap.josm.plugins.addressEdit.AddressEditContainer; 19 import org.openstreetmap.josm.plugins.addressEdit.INodeEntity; 19 20 import org.openstreetmap.josm.plugins.addressEdit.StreetNode; 20 21 … … 77 78 */ 78 79 @Override 79 public Object getValueAt(int row, int column) { 80 if (addressContainer == null || addressContainer.getStreetList() == null) { 80 public Object getValueAt(int row, int column) { 81 StreetNode sNode = (StreetNode) getEntityOfRow(row); 82 83 if (sNode == null) { 81 84 return null; 82 85 } 83 if (row < 0 || row > addressContainer.getNumberOfStreets()) {84 return null;85 }86 StreetNode sNode = addressContainer.getStreetList().get(row);87 86 88 87 switch (column) { … … 106 105 return false; 107 106 } 107 108 @Override 109 public INodeEntity getEntityOfRow(int row) { 110 if (addressContainer == null || addressContainer.getStreetList() == null) { 111 return null; 112 } 113 if (row < 0 || row > addressContainer.getNumberOfStreets()) { 114 return null; 115 } 116 return addressContainer.getStreetList().get(row); 117 } 108 118 } -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/UnresolvedAddressesTableModel.java
r23915 r23916 33 33 import org.openstreetmap.josm.plugins.addressEdit.AddressEditContainer; 34 34 import org.openstreetmap.josm.plugins.addressEdit.AddressNode; 35 import org.openstreetmap.josm.plugins.addressEdit. StringUtils;35 import org.openstreetmap.josm.plugins.addressEdit.INodeEntity; 36 36 37 37 /** … … 83 83 @Override 84 84 public Object getValueAt(int row, int column) { 85 if (addressContainer == null || addressContainer.getUnresolvedAddresses() == null) { 85 AddressNode aNode = (AddressNode) getEntityOfRow(row); 86 87 if (aNode == null) { 86 88 return null; 87 89 } 88 if (row < 0 || row > addressContainer.getNumberOfUnresolvedAddresses()) {89 return null;90 }91 AddressNode aNode = addressContainer.getUnresolvedAddresses().get(row);92 90 93 91 switch (column) { … … 95 93 String guessed = aNode.getGuessedStreetName(); 96 94 String cur = aNode.getStreet(); 97 if (!StringUtils.isNullOrEmpty(guessed) && 98 AddressNode.MISSING_TAG.equals(cur)) { 99 95 if (aNode.hasGuessedStreetName() && AddressNode.MISSING_TAG.equals(cur)) { 100 96 return "*" + guessed; 101 97 } else { … … 126 122 return false; 127 123 } 124 125 @Override 126 public INodeEntity getEntityOfRow(int row) { 127 if (addressContainer == null || addressContainer.getUnresolvedAddresses() == null) { 128 return null; 129 } 130 if (row < 0 || row > addressContainer.getNumberOfUnresolvedAddresses()) { 131 return null; 132 } 133 return addressContainer.getUnresolvedAddresses().get(row); 134 } 128 135 }
Note:
See TracChangeset
for help on using the changeset viewer.