Changeset 24089 in osm for applications/editors/josm/plugins/FixAddresses
- Timestamp:
- 2010-11-06T18:35:51+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses
- Files:
-
- 16 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java
r24028 r24089 58 58 * addresses with unknown streets ("unresolved addresses"). 59 59 * 60 * It listens to changes within instances of {@link I NodeEntity} to notify clients on update.60 * It listens to changes within instances of {@link IOSMEntity} to notify clients on update. 61 61 * 62 62 * {@link AddressEditContainer} is the central class used within actions and UI models to show … … 150 150 * Notifies clients that an entity within the address container changed. 151 151 */ 152 protected void fireEntityChanged(I NodeEntity entity) {152 protected void fireEntityChanged(IOSMEntity entity) { 153 153 if (entity == null) throw new RuntimeException("Entity must not be null"); 154 154 … … 256 256 */ 257 257 private void createNodeFromWay(Way w) { 258 I NodeEntity ne = NodeFactory.createNodeFromWay(w);258 IOSMEntity ne = NodeFactory.createNodeFromWay(w); 259 259 260 260 if (!processNode(ne, w)) { … … 287 287 * @return true, if node has been processed 288 288 */ 289 private boolean processNode(I NodeEntity ne, Way w) {289 private boolean processNode(IOSMEntity ne, Way w) { 290 290 if (ne != null) { 291 291 // Node is a street (segment) … … 657 657 658 658 /* (non-Javadoc) 659 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity)660 */ 661 @Override 662 public void entityChanged(I NodeEntity entity) {659 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity) 660 */ 661 @Override 662 public void entityChanged(IOSMEntity entity) { 663 663 fireEntityChanged(entity); 664 664 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressNode.java
r24088 r24089 275 275 */ 276 276 @Override 277 public int compareTo(I NodeEntity o) {277 public int compareTo(IOSMEntity o) { 278 278 if (o == null || !(o instanceof AddressNode)) { 279 279 return -1; -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IAddressEditContainerListener.java
r23933 r24089 25 25 * Notifies clients that an entity has been changed. 26 26 */ 27 public void entityChanged(I NodeEntity node);27 public void entityChanged(IOSMEntity node); 28 28 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/ICommandListener.java
r24088 r24089 23 23 * @param command The command instance to process by the enclosing command listener. 24 24 */ 25 public void commandIssued(I NodeEntity entity, Command command);25 public void commandIssued(IOSMEntity entity, Command command); 26 26 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/IOSMEntity.java
r24087 r24089 26 26 */ 27 27 28 public interface I NodeEntity extends Comparable<INodeEntity> {28 public interface IOSMEntity extends Comparable<IOSMEntity> { 29 29 /** 30 30 * Gets the underlying OSM object. … … 49 49 * @return 50 50 */ 51 public List<I NodeEntity> getChildren();51 public List<IOSMEntity> getChildren(); 52 52 53 53 /** -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/NodeEntityBase.java
r24088 r24089 28 28 29 29 /** 30 * The class NodeEntityBase provides a base implementation for the {@link I NodeEntity} interface.30 * The class NodeEntityBase provides a base implementation for the {@link IOSMEntity} interface. 31 31 * 32 32 * The implementation comprises … … 37 37 * </ol> 38 38 */ 39 public class NodeEntityBase implements I NodeEntity, Comparable<INodeEntity> {39 public class NodeEntityBase implements IOSMEntity, Comparable<IOSMEntity> { 40 40 public static final String ANONYMOUS = tr("No name"); 41 41 private static List<IAddressEditContainerListener> containerListeners = new ArrayList<IAddressEditContainerListener>(); … … 78 78 * Notifies clients that the address container changed. 79 79 */ 80 protected static void fireEntityChanged(I NodeEntity entity) {80 protected static void fireEntityChanged(IOSMEntity entity) { 81 81 for (IAddressEditContainerListener listener : containerListeners) { 82 82 listener.entityChanged(entity); … … 121 121 122 122 @Override 123 public List<I NodeEntity> getChildren() {123 public List<IOSMEntity> getChildren() { 124 124 return null; 125 125 } … … 188 188 */ 189 189 @Override 190 public int compareTo(I NodeEntity o) {190 public int compareTo(IOSMEntity o) { 191 191 if (o == null || !(o instanceof NodeEntityBase)) return -1; 192 192 return this.getName().compareTo(o.getName()); … … 194 194 195 195 /* (non-Javadoc) 196 * @see org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity#getCoor()196 * @see org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity#getCoor() 197 197 */ 198 198 @Override -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/NodeFactory.java
r23967 r24089 49 49 * @return The new node instance or null; if given way is inappropriate. 50 50 */ 51 public static I NodeEntity createNodeFromWay(Way way) {51 public static IOSMEntity createNodeFromWay(Way way) { 52 52 if (TagUtils.hasHighwayTag(way)) { 53 53 return new StreetSegmentNode(way); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StreetNode.java
r23933 r24089 27 27 */ 28 28 public class StreetNode extends NodeEntityBase { 29 private List<I NodeEntity> children;29 private List<IOSMEntity> children; 30 30 private List<AddressNode> addresses; 31 31 … … 37 37 } 38 38 39 public List<I NodeEntity> getChildren() {39 public List<IOSMEntity> getChildren() { 40 40 return children; 41 41 } … … 54 54 private void lazyCreateChildren() { 55 55 if (children == null) { 56 children = new ArrayList<I NodeEntity>();56 children = new ArrayList<IOSMEntity>(); 57 57 } 58 58 } … … 99 99 100 100 int sc = 0; 101 for (I NodeEntity node : children) {101 for (IOSMEntity node : children) { 102 102 if (node instanceof StreetSegmentNode) { 103 103 sc++; … … 115 115 List<String> types = new ArrayList<String>(); 116 116 117 for (I NodeEntity seg : getChildren()) {117 for (IOSMEntity seg : getChildren()) { 118 118 OsmPrimitive osmPrim = seg.getOsmObject(); 119 119 if (TagUtils.hasHighwayTag(osmPrim)) { -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/StreetSegmentNode.java
r23933 r24089 33 33 34 34 @Override 35 public List<I NodeEntity> getChildren() {35 public List<IOSMEntity> getChildren() { 36 36 return null; 37 37 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AbstractAddressEditAction.java
r23970 r24089 25 25 import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener; 26 26 import org.openstreetmap.josm.plugins.fixAddresses.ICommandListener; 27 import org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity;27 import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity; 28 28 import org.openstreetmap.josm.plugins.fixAddresses.StringUtils; 29 29 … … 170 170 171 171 /* (non-Javadoc) 172 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity)173 */ 174 @Override 175 public void entityChanged(I NodeEntity node) {172 * @see org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener#entityChanged(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity) 173 */ 174 @Override 175 public void entityChanged(IOSMEntity node) { 176 176 updateEnabledState(); 177 177 } … … 213 213 * @param entity the entity 214 214 */ 215 public void beginObjectTransaction(I NodeEntity entity) {215 public void beginObjectTransaction(IOSMEntity entity) { 216 216 if (entity != null) { 217 217 entity.addCommandListener(this); … … 226 226 * @param entity the entity 227 227 */ 228 public void finishObjectTransaction(I NodeEntity entity) {228 public void finishObjectTransaction(IOSMEntity entity) { 229 229 if (entity != null) { 230 230 entity.removeCommandListener(this); … … 235 235 236 236 /* (non-Javadoc) 237 * @see org.openstreetmap.josm.plugins.fixAddresses.ICommandListener#commandIssued(org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity, org.openstreetmap.josm.command.Command)238 */ 239 @Override 240 public void commandIssued(I NodeEntity entity, Command command) {237 * @see org.openstreetmap.josm.plugins.fixAddresses.ICommandListener#commandIssued(org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity, org.openstreetmap.josm.command.Command) 238 */ 239 @Override 240 public void commandIssued(IOSMEntity entity, Command command) { 241 241 if (commands == null) { 242 242 throw new RuntimeException("No command list available. Did you forget to call beginTransaction?"); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java
r24024 r24089 52 52 import org.openstreetmap.josm.plugins.fixAddresses.AddressNode; 53 53 import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener; 54 import org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity;54 import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity; 55 55 import org.openstreetmap.josm.plugins.fixAddresses.StreetNode; 56 56 import org.openstreetmap.josm.plugins.fixAddresses.StringUtils; … … 264 264 265 265 //mapViewer.addMapRectangle(new BBoxMapRectangle(bb)); 266 for (I NodeEntity seg : sNode.getChildren()) {266 for (IOSMEntity seg : sNode.getChildren()) { 267 267 Way way = (Way) seg.getOsmObject(); 268 268 //BBox bb = way.getBBox(); … … 316 316 317 317 @Override 318 public void entityChanged(I NodeEntity entity) {318 public void entityChanged(IOSMEntity entity) { 319 319 updateHeaders(); 320 320 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditModel.java
r23933 r24089 23 23 24 24 import org.openstreetmap.josm.plugins.fixAddresses.AddressNode; 25 import org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity;25 import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity; 26 26 import org.openstreetmap.josm.plugins.fixAddresses.StreetNode; 27 27 … … 57 57 58 58 // Add street segment(s) 59 for (I NodeEntity child : sNode.getChildren()) {59 for (IOSMEntity child : sNode.getChildren()) { 60 60 segmentsNode.add(new DefaultMutableTreeNode(child)); 61 61 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditTableModel.java
r23961 r24089 18 18 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; 19 19 import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener; 20 import org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity;20 import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity; 21 21 22 22 public abstract class AddressEditTableModel extends DefaultTableModel implements IAddressEditContainerListener{ … … 40 40 41 41 @Override 42 public void entityChanged(I NodeEntity entity) {42 public void entityChanged(IOSMEntity entity) { 43 43 int row = getRowOfEntity(entity); 44 44 if (row != -1) { // valid row? -> update model … … 53 53 * @return 54 54 */ 55 public abstract I NodeEntity getEntityOfRow(int row);55 public abstract IOSMEntity getEntityOfRow(int row); 56 56 57 57 /** … … 60 60 * @return 61 61 */ 62 public abstract int getRowOfEntity(I NodeEntity entity);62 public abstract int getRowOfEntity(IOSMEntity entity); 63 63 } -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/ApplyAllGuessesAction.java
r24018 r24089 26 26 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; 27 27 import org.openstreetmap.josm.plugins.fixAddresses.AddressNode; 28 import org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity;28 import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity; 29 29 30 30 /** … … 87 87 if (model != null) { 88 88 int row = table.rowAtPoint(p); 89 I NodeEntity node = model.getEntityOfRow(row);89 IOSMEntity node = model.getEntityOfRow(row); 90 90 if (node instanceof AddressNode) { 91 91 beginTransaction(tr("Applied guessed values for ") + node.getOsmObject()); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/IncompleteAddressesTableModel.java
r24025 r24089 18 18 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; 19 19 import org.openstreetmap.josm.plugins.fixAddresses.AddressNode; 20 import org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity;20 import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity; 21 21 22 22 public class IncompleteAddressesTableModel extends AddressEditTableModel { … … 95 95 96 96 @Override 97 public I NodeEntity getEntityOfRow(int row) {97 public IOSMEntity getEntityOfRow(int row) { 98 98 if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) { 99 99 return null; … … 106 106 107 107 @Override 108 public int getRowOfEntity(I NodeEntity entity) {108 public int getRowOfEntity(IOSMEntity entity) { 109 109 if (addressContainer == null || addressContainer.getIncompleteAddresses() == null) { 110 110 return -1; -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/StreetTableModel.java
r23961 r24089 17 17 18 18 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; 19 import org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity;19 import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity; 20 20 import org.openstreetmap.josm.plugins.fixAddresses.StreetNode; 21 21 … … 107 107 108 108 @Override 109 public I NodeEntity getEntityOfRow(int row) {109 public IOSMEntity getEntityOfRow(int row) { 110 110 if (addressContainer == null || addressContainer.getStreetList() == null) { 111 111 return null; … … 118 118 119 119 @Override 120 public int getRowOfEntity(I NodeEntity entity) {120 public int getRowOfEntity(IOSMEntity entity) { 121 121 if (addressContainer == null || addressContainer.getStreetList() == null) { 122 122 return -1; -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/UnresolvedAddressesTableModel.java
r24018 r24089 33 33 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; 34 34 import org.openstreetmap.josm.plugins.fixAddresses.AddressNode; 35 import org.openstreetmap.josm.plugins.fixAddresses.I NodeEntity;35 import org.openstreetmap.josm.plugins.fixAddresses.IOSMEntity; 36 36 import org.openstreetmap.josm.plugins.fixAddresses.StringUtils; 37 37 import org.openstreetmap.josm.plugins.fixAddresses.TagUtils; … … 144 144 */ 145 145 @Override 146 public I NodeEntity getEntityOfRow(int row) {146 public IOSMEntity getEntityOfRow(int row) { 147 147 if (addressContainer == null || addressContainer.getUnresolvedAddresses() == null) { 148 148 return null; … … 155 155 156 156 @Override 157 public int getRowOfEntity(I NodeEntity entity) {157 public int getRowOfEntity(IOSMEntity entity) { 158 158 if (addressContainer == null || addressContainer.getUnresolvedAddresses() == null) { 159 159 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.