Changeset 33027 in osm
- Timestamp:
- 2016-10-04T00:42:54+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteActionList.java
r30737 r33027 28 28 package org.openstreetmap.josm.plugins.mapdust.gui.action.execute; 29 29 30 import static org.openstreetmap.josm.tools.I18n.tr; 30 31 31 import static org.openstreetmap.josm.tools.I18n.tr;32 32 import java.awt.event.ActionEvent; 33 import java.util.ArrayList; 34 import java.util.Iterator; 33 35 34 import javax.swing.JOptionPane; 36 35 import javax.swing.JToggleButton; 36 37 37 import org.openstreetmap.josm.Main; 38 38 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustActionUploader; 39 39 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustActionUploaderException; 40 40 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 41 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustUpdateObservable;42 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustUpdateObserver;43 41 import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState; 44 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBugFilter;45 46 42 47 43 /** … … 53 49 * 54 50 */ 55 public class ExecuteActionList extends MapdustExecuteAction implements 56 MapdustUpdateObservable { 57 58 /** List of MapdustRefreshObserver objects */ 59 private final ArrayList<MapdustUpdateObserver> observers = 60 new ArrayList<>(); 51 public class ExecuteActionList extends MapdustExecuteActionObservable { 61 52 62 53 /** 63 * Builds a <code>Ex ceuteActionList</code> object54 * Builds a <code>ExecuteActionList</code> object 64 55 * 65 56 * @param mapdustGUI The <code>MapdustGUI</code> object … … 92 83 } 93 84 94 /**95 * Adds a new MapDust refresh observer to the list of observers.96 *97 * @param observer The <code>MapdustRefreshObserver</code> object98 */99 @Override100 public void addObserver(MapdustUpdateObserver observer) {101 if (!this.observers.contains(observer)) {102 this.observers.add(observer);103 }104 }105 106 /**107 * Removes the MapDust refresh observer object from the list of observers.108 *109 * @param observer The <code>MapdustRefreshObserver</code> object110 */111 @Override112 public void removeObserver(MapdustUpdateObserver observer) {113 this.observers.remove(observer);114 }115 116 /**117 * Notifies the observers observing this action.118 */119 @Override120 public void notifyObservers(MapdustBugFilter filter, boolean first) {121 Iterator<MapdustUpdateObserver> elements = this.observers.iterator();122 while (elements.hasNext()) {123 (elements.next()).update(filter, false);124 }125 }126 85 127 86 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteFilterBug.java
r32787 r33027 32 32 package org.openstreetmap.josm.plugins.mapdust.gui.action.execute; 33 33 34 import java.awt.event.ActionEvent; 35 import java.util.List; 34 36 35 import java.awt.event.ActionEvent;36 import java.util.ArrayList;37 import java.util.Iterator;38 import java.util.List;39 37 import javax.swing.JButton; 38 40 39 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 41 40 import org.openstreetmap.josm.plugins.mapdust.gui.component.dialog.FilterBugDialog; 42 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustUpdateObservable;43 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustUpdateObserver;44 41 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBugFilter; 45 42 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustRelevance; 46 47 43 48 44 /** … … 52 48 * @author Bea 53 49 */ 54 public class ExecuteFilterBug extends MapdustExecuteAction implements 55 MapdustUpdateObservable { 50 public class ExecuteFilterBug extends MapdustExecuteActionObservable { 56 51 57 52 /** The serial version UID */ 58 53 private static final long serialVersionUID = -2724396161610512502L; 59 60 /** The list MapDustBug filter observers */61 private final ArrayList<MapdustUpdateObserver> observers =62 new ArrayList<>();63 54 64 55 /** … … 109 100 } 110 101 } 111 112 /**113 * Adds a new MapDust bug filter observer to the list of observers.114 *115 * @param observer The <code>MapdustBugFilterObserver</code> object116 */117 @Override118 public void addObserver(MapdustUpdateObserver observer) {119 if (!this.observers.contains(observer)) {120 this.observers.add(observer);121 }122 }123 124 /**125 * Removes the MapDust bug filter observer object from the list of126 * observers.127 *128 * @param observer The <code>MapdustBugFilterObserver</code> object129 */130 @Override131 public void removeObserver(MapdustUpdateObserver observer) {132 this.observers.remove(observer);133 }134 135 /**136 * Notifies the observers observing this action.137 *138 * @param filter The <code>MapdustBugFilter</code> object139 */140 @Override141 public void notifyObservers(MapdustBugFilter filter, boolean first) {142 Iterator<MapdustUpdateObserver> elements = this.observers.iterator();143 while (elements.hasNext()) {144 (elements.next()).update(filter, false);145 }146 }147 148 102 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteWorkOffline.java
r32787 r33027 28 28 package org.openstreetmap.josm.plugins.mapdust.gui.action.execute; 29 29 30 import static org.openstreetmap.josm.tools.I18n.tr; 30 31 31 import static org.openstreetmap.josm.tools.I18n.tr;32 32 import java.awt.event.ActionEvent; 33 import java.util.ArrayList; 34 import java.util.Iterator; 33 35 34 import javax.swing.JOptionPane; 36 35 import javax.swing.JToggleButton; 36 37 37 import org.openstreetmap.josm.Main; 38 38 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustActionUploader; 39 39 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustActionUploaderException; 40 40 import org.openstreetmap.josm.plugins.mapdust.gui.MapdustGUI; 41 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustUpdateObservable;42 import org.openstreetmap.josm.plugins.mapdust.gui.observer.MapdustUpdateObserver;43 41 import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustPluginState; 44 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBugFilter;45 46 42 47 43 /** … … 55 51 * 56 52 */ 57 public class ExecuteWorkOffline extends MapdustExecuteAction implements 58 MapdustUpdateObservable { 53 public class ExecuteWorkOffline extends MapdustExecuteActionObservable { 59 54 60 55 /** The serial version UID */ 61 56 private static final long serialVersionUID = 8792828131813689548L; 62 63 /** The list of MapDust refresh observers */64 private final ArrayList<MapdustUpdateObserver> observers =65 new ArrayList<>();66 57 67 58 /** … … 124 115 } 125 116 } 126 127 /**128 * Adds a new MapDust refresh observer to the list of observers.129 *130 * @param observer The <code>MapdustRefreshObserver</code> object131 */132 @Override133 public void addObserver(MapdustUpdateObserver observer) {134 if (!this.observers.contains(observer)) {135 this.observers.add(observer);136 }137 }138 139 /**140 * Removes the MapDust refresh observer object from the list of observers.141 *142 * @param observer The <code>MapdustRefreshObserver</code> object143 */144 @Override145 public void removeObserver(MapdustUpdateObserver observer) {146 this.observers.remove(observer);147 }148 149 /**150 * Notifies the observers observing this action.151 */152 @Override153 public void notifyObservers(MapdustBugFilter filter, boolean first) {154 Iterator<MapdustUpdateObserver> elements = this.observers.iterator();155 while (elements.hasNext()) {156 (elements.next()).update(filter, false);157 }158 }159 160 117 }
Note:
See TracChangeset
for help on using the changeset viewer.