Changeset 24120 in osm for applications/editors/josm/plugins/FixAddresses/src/org
- Timestamp:
- 2010-11-07T18:14:11+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/ApplyAllGuessesAction.java
r24105 r24120 44 44 } 45 45 46 /* (non-Javadoc) 47 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent) 48 */ 46 49 @Override 47 50 public void addressEditActionPerformed(AddressEditSelectionEvent ev) { 48 if (ev == null || ev.getSelectedUnresolvedAddresses() == null) return; 49 // fix SELECTED items only 50 List<OSMAddress> addrToFix = ev.getSelectedUnresolvedAddresses(); 51 applyGuesses(addrToFix); 51 if (ev == null) return; 52 53 if (ev.getSelectedUnresolvedAddresses() != null) { 54 // fix SELECTED items only 55 List<OSMAddress> addrToFix = ev.getSelectedUnresolvedAddresses(); 56 applyGuesses(addrToFix); 57 } 58 59 if (ev.getSelectedIncompleteAddresses() != null) { 60 // fix SELECTED items only 61 List<OSMAddress> addrToFix = ev.getSelectedIncompleteAddresses(); 62 applyGuesses(addrToFix); 63 } 52 64 } 53 65 66 /* (non-Javadoc) 67 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer) 68 */ 54 69 @Override 55 70 protected void updateEnabledState(AddressEditContainer container) { … … 57 72 } 58 73 74 /** 75 * Apply guesses. 76 * 77 * @param addrToFix the addr to fix 78 */ 59 79 private void applyGuesses(List<OSMAddress> addrToFix) { 60 80 beginTransaction(tr("Applied guessed values")); … … 68 88 } 69 89 90 /* (non-Javadoc) 91 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#updateEnabledState(org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditSelectionEvent) 92 */ 70 93 @Override 71 94 protected void updateEnabledState(AddressEditSelectionEvent event) { 72 // do nothing here 95 setEnabled(event.getSelectedIncompleteAddresses() != null || 96 event.getSelectedIncompleteAddresses() != null); 73 97 } 74 98 99 /* (non-Javadoc) 100 * @see org.openstreetmap.josm.plugins.fixAddresses.gui.actions.AbstractAddressEditAction#addressEditActionPerformed(org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer) 101 */ 75 102 @Override 76 103 public void addressEditActionPerformed(AddressEditContainer container) { … … 79 106 List<OSMAddress> addrToFix = container.getUnresolvedAddresses(); 80 107 applyGuesses(addrToFix); 108 109 addrToFix = container.getIncompleteAddresses(); 110 applyGuesses(addrToFix); 81 111 } 82 112 113 /* (non-Javadoc) 114 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) 115 */ 83 116 @Override 84 117 public void mouseClicked(MouseEvent e) { … … 94 127 beginObjectTransaction(node); 95 128 OSMAddress aNode = (OSMAddress) node; 96 if (aNode.hasGuessedStreetName()) {97 98 }129 130 aNode.applyAllGuesses(); 131 99 132 finishObjectTransaction(node); 100 133 finishTransaction(); … … 104 137 } 105 138 139 /* (non-Javadoc) 140 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent) 141 */ 106 142 @Override 107 143 public void mouseEntered(MouseEvent arg0) { 108 // TODO Auto-generated method stub109 110 144 } 111 145 146 /* (non-Javadoc) 147 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent) 148 */ 112 149 @Override 113 150 public void mouseExited(MouseEvent arg0) { 114 // TODO Auto-generated method stub115 116 151 } 117 152 153 /* (non-Javadoc) 154 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) 155 */ 118 156 @Override 119 157 public void mousePressed(MouseEvent arg0) { 120 // TODO Auto-generated method stub121 122 158 } 123 159 160 /* (non-Javadoc) 161 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent) 162 */ 124 163 @Override 125 164 public void mouseReleased(MouseEvent arg0) { 126 // TODO Auto-generated method stub127 128 165 } 129 166 }
Note:
See TracChangeset
for help on using the changeset viewer.