Ticket #8902: override.diff
| File override.diff, 387.8 KB (added by , 12 years ago) |
|---|
-
src/org/openstreetmap/josm/Main.java
572 572 protected static int windowState = JFrame.NORMAL; 573 573 574 574 private final CommandQueueListener redoUndoListener = new CommandQueueListener(){ 575 @Override 575 576 public void commandChanged(final int queueSize, final int redoSize) { 576 577 menu.undo.setEnabled(queueSize > 0); 577 578 menu.redo.setEnabled(redoSize > 0); -
src/org/openstreetmap/josm/actions/AboutAction.java
46 46 KeyEvent.VK_F1, Shortcut.SHIFT), true); 47 47 } 48 48 49 @Override 49 50 public void actionPerformed(ActionEvent e) { 50 51 final JTabbedPane about = new JTabbedPane(); 51 52 -
src/org/openstreetmap/josm/actions/AbstractInfoAction.java
147 147 } 148 148 } 149 149 150 @Override 150 151 public void actionPerformed(ActionEvent e) { 151 152 launchInfoBrowsersForSelectedPrimitives(); 152 153 } -
src/org/openstreetmap/josm/actions/AddNodeAction.java
29 29 putValue("help", ht("/Action/AddNode")); 30 30 } 31 31 32 @Override 32 33 public void actionPerformed(ActionEvent e) { 33 34 if (!isEnabled()) 34 35 return; -
src/org/openstreetmap/josm/actions/AlignInCircleAction.java
84 84 } 85 85 } 86 86 87 @Override 87 88 public void actionPerformed(ActionEvent e) { 88 89 if (!isEnabled()) 89 90 return; -
src/org/openstreetmap/josm/actions/AlignInLineAction.java
99 99 /** 100 100 * Operation depends on the selected objects: 101 101 */ 102 @Override 102 103 public void actionPerformed(ActionEvent e) { 103 104 if (!isEnabled()) 104 105 return; -
src/org/openstreetmap/josm/actions/AutoScaleAction.java
165 165 putValue("active", true); 166 166 } 167 167 168 @Override 168 169 public void actionPerformed(ActionEvent e) { 169 170 autoScale(); 170 171 } … … 301 302 * Adapter for zoom change events 302 303 */ 303 304 private class ZoomChangeAdapter implements MapView.ZoomChangeListener { 305 @Override 304 306 public void zoomChanged() { 305 307 updateEnabledState(); 306 308 } -
src/org/openstreetmap/josm/actions/ChangesetManagerToggleAction.java
74 74 } 75 75 } 76 76 77 @Override 77 78 public void actionPerformed(ActionEvent e) { 78 79 toggleSelectedState(); 79 80 } -
src/org/openstreetmap/josm/actions/CloseChangesetAction.java
42 42 putValue("help", ht("/Action/CloseChangeset")); 43 43 44 44 } 45 @Override 45 46 public void actionPerformed(ActionEvent e) { 46 47 Main.worker.submit(new DownloadOpenChangesetsTask()); 47 48 } … … 91 92 protected void finish() { 92 93 SwingUtilities.invokeLater( 93 94 new Runnable() { 95 @Override 94 96 public void run() { 95 97 if (lastException != null) { 96 98 ExceptionDialogUtil.explainException(lastException); -
src/org/openstreetmap/josm/actions/CombineWayAction.java
190 190 return new Pair<Way, Command>(targetWay, sequenceCommand); 191 191 } 192 192 193 @Override 193 194 public void actionPerformed(ActionEvent event) { 194 195 if (getCurrentDataSet() == null) 195 196 return; … … 219 220 if(selectedWay != null) 220 221 { 221 222 Runnable guiTask = new Runnable() { 223 @Override 222 224 public void run() { 223 225 getCurrentDataSet().setSelected(selectedWay); 224 226 } -
src/org/openstreetmap/josm/actions/CreateCircleAction.java
74 74 return a; 75 75 } 76 76 77 @Override 77 78 public void actionPerformed(ActionEvent e) { 78 79 if (!isEnabled()) 79 80 return; -
src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
59 59 * 60 60 * @param e Action Event 61 61 */ 62 @Override 62 63 public void actionPerformed(ActionEvent e) { 63 64 if (Main.main.getEditLayer() == null) { 64 65 JOptionPane.showMessageDialog(Main.parent, tr("No data loaded.")); … … 111 112 // uses 'SwingUtilities.invokeLater' to fire events so we have to do 112 113 // the same.) 113 114 SwingUtilities.invokeLater(new Runnable() { 115 @Override 114 116 public void run() { 115 117 Main.map.relationListDialog.selectRelation(relation); 116 118 } -
src/org/openstreetmap/josm/actions/DeleteAction.java
20 20 putValue("help", ht("/Action/Delete")); 21 21 } 22 22 23 @Override 23 24 public void actionPerformed(ActionEvent e) { 24 25 if (!isEnabled()) 25 26 return; -
src/org/openstreetmap/josm/actions/DistributeAction.java
45 45 * that are furthest apart, and then to distribute all other selected 46 46 * nodes along the straight line between these nodes. 47 47 */ 48 @Override 48 49 public void actionPerformed(ActionEvent e) { 49 50 if (!isEnabled()) 50 51 return; -
src/org/openstreetmap/josm/actions/DownloadAction.java
31 31 putValue("help", ht("/Action/Download")); 32 32 } 33 33 34 @Override 34 35 public void actionPerformed(ActionEvent e) { 35 36 DownloadDialog dialog = DownloadDialog.getInstance(); 36 37 dialog.restoreSettings(); -
src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java
51 51 putValue("help", ht("/Action/DownloadObject")); 52 52 } 53 53 54 @Override 54 55 public void actionPerformed(ActionEvent e) { 55 56 56 57 DownloadObjectDialog dialog = new DownloadObjectDialog(); -
src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
78 78 Main.worker.submit(new DownloadReferrersTask(targetLayer, id, type)); 79 79 } 80 80 81 @Override 81 82 public void actionPerformed(ActionEvent e) { 82 83 if (!isEnabled() || ! Main.isDisplayingMapView()) 83 84 return; -
src/org/openstreetmap/josm/actions/DuplicateAction.java
23 23 putValue("help", ht("/Action/Duplicate")); 24 24 } 25 25 26 @Override 26 27 public void actionPerformed(ActionEvent e) { 27 28 Main.main.menu.paste.pasteData(new PrimitiveDeepCopy(getCurrentDataSet().getSelected()), getEditLayer(), e); 28 29 } -
src/org/openstreetmap/josm/actions/ExitAction.java
25 25 putValue("help", ht("/Action/Exit")); 26 26 } 27 27 28 @Override 28 29 public void actionPerformed(ActionEvent e) { 29 30 Main.exitJosm(true); 30 31 } -
src/org/openstreetmap/josm/actions/ExpertToggleAction.java
159 159 notifySelectedState(); 160 160 } 161 161 162 @Override 162 163 public void actionPerformed(ActionEvent e) { 163 164 toggleSelectedState(); 164 165 } -
src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
92 92 filters, 93 93 new Comparator<ExtensionFileFilter>() { 94 94 private AllFormatsImporter all = new AllFormatsImporter(); 95 @Override 95 96 public int compare(ExtensionFileFilter o1, ExtensionFileFilter o2) { 96 97 if (o1.getDescription().equals(all.filter.getDescription())) return 1; 97 98 if (o2.getDescription().equals(all.filter.getDescription())) return -1; -
src/org/openstreetmap/josm/actions/FullscreenToggleAction.java
120 120 frame.getJMenuBar().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, 0), "none"); 121 121 } 122 122 123 @Override 123 124 public void actionPerformed(ActionEvent e) { 124 125 toggleSelectedState(); 125 126 } -
src/org/openstreetmap/josm/actions/GpxExportAction.java
44 44 return (layer instanceof GpxLayer || layer instanceof OsmDataLayer) ? layer : null; 45 45 } 46 46 47 @Override 47 48 public void actionPerformed(ActionEvent e) { 48 49 if (!isEnabled()) 49 50 return; -
src/org/openstreetmap/josm/actions/HelpAction.java
26 26 putValue("toolbar", "help"); 27 27 } 28 28 29 @Override 29 30 public void actionPerformed(ActionEvent e) { 30 31 if (e.getActionCommand() == null) { 31 32 String topic; -
src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
32 32 putValue("help", ht("/Action/JoinNodeWay")); 33 33 } 34 34 35 @Override 35 36 public void actionPerformed(ActionEvent e) { 36 37 if (!isEnabled()) 37 38 return; -
src/org/openstreetmap/josm/actions/JosmAction.java
230 230 } 231 231 }); 232 232 } 233 @Override 233 234 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 234 235 updateEnabledStateInEDT(); 235 236 } 236 237 238 @Override 237 239 public void layerAdded(Layer newLayer) { 238 240 updateEnabledStateInEDT(); 239 241 } 240 242 243 @Override 241 244 public void layerRemoved(Layer oldLayer) { 242 245 updateEnabledStateInEDT(); 243 246 } … … 248 251 * 249 252 */ 250 253 private class SelectionChangeAdapter implements SelectionChangedListener { 254 @Override 251 255 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 252 256 updateEnabledState(newSelection); 253 257 } -
src/org/openstreetmap/josm/actions/MergeLayerAction.java
72 72 doMerge(targetLayers, Collections.singleton(sourceLayer)); 73 73 } 74 74 75 @Override 75 76 public void actionPerformed(ActionEvent e) { 76 77 Layer sourceLayer = Main.main.getEditLayer(); 77 78 if (sourceLayer == null) -
src/org/openstreetmap/josm/actions/MergeNodesAction.java
57 57 putValue("help", ht("/Action/MergeNodes")); 58 58 } 59 59 60 @Override 60 61 public void actionPerformed(ActionEvent event) { 61 62 if (!isEnabled()) 62 63 return; -
src/org/openstreetmap/josm/actions/MergeSelectionAction.java
48 48 ((OsmDataLayer)targetLayer).mergeFrom(builder.build()); 49 49 } 50 50 51 @Override 51 52 public void actionPerformed(ActionEvent e) { 52 53 if (getEditLayer() == null || getEditLayer().data.getAllSelected().isEmpty()) 53 54 return; -
src/org/openstreetmap/josm/actions/MirrorAction.java
37 37 putValue("help", ht("/Action/Mirror")); 38 38 } 39 39 40 @Override 40 41 public void actionPerformed(ActionEvent e) { 41 42 Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 42 43 HashSet<Node> nodes = new HashSet<Node>(); -
src/org/openstreetmap/josm/actions/MoveAction.java
78 78 Main.toolbar.register(this); 79 79 } 80 80 81 @Override 81 82 public void actionPerformed(ActionEvent event) { 82 83 83 84 if (!Main.isDisplayingMapView()) -
src/org/openstreetmap/josm/actions/MoveNodeAction.java
27 27 putValue("help", ht("/Action/MoveNode")); 28 28 } 29 29 30 @Override 30 31 public void actionPerformed(ActionEvent e) { 31 32 if (!isEnabled() || (getCurrentDataSet().getSelectedNodes().size() != 1)) 32 33 return; -
src/org/openstreetmap/josm/actions/NewAction.java
20 20 putValue("help", ht("/Action/NewLayer")); 21 21 } 22 22 23 @Override 23 24 public void actionPerformed(ActionEvent e) { 24 25 Main.main.addLayer(new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null)); 25 26 } -
src/org/openstreetmap/josm/actions/OpenFileAction.java
62 62 putValue("help", ht("/Action/Open")); 63 63 } 64 64 65 @Override 65 66 public void actionPerformed(ActionEvent e) { 66 67 JFileChooser fc = createAndOpenFileChooser(true, true, null); 67 68 if (fc == null) … … 217 218 if (!chosenImporter.acceptFile(f)) { 218 219 if (f.isDirectory()) { 219 220 SwingUtilities.invokeLater(new Runnable() { 221 @Override 220 222 public void run() { 221 223 JOptionPane.showMessageDialog(Main.parent, tr( 222 224 "<html>Cannot open directory ''{0}''.<br>Please select a file.</html>", -
src/org/openstreetmap/josm/actions/OpenLocationAction.java
86 86 Main.pref.putCollection(getClass().getName() + ".uploadAddressHistory", cbHistory.getHistory()); 87 87 } 88 88 89 @Override 89 90 public void actionPerformed(ActionEvent e) { 90 91 91 92 JCheckBox layer = new JCheckBox(tr("Separate Layer")); -
src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
91 91 Shortcut.SHIFT), 92 92 true, "action/orthogonalize/undo", true); 93 93 } 94 @Override 94 95 public void actionPerformed(ActionEvent e) { 95 96 if (!isEnabled()) 96 97 return; … … 122 123 } 123 124 } 124 125 126 @Override 125 127 public void actionPerformed(ActionEvent e) { 126 128 if (!isEnabled()) 127 129 return; -
src/org/openstreetmap/josm/actions/ParameterizedActionDecorator.java
18 18 this.parameters = new HashMap<String, Object>(parameters); 19 19 } 20 20 21 @Override 21 22 public void addPropertyChangeListener(PropertyChangeListener listener) { 22 23 action.addPropertyChangeListener(listener); 23 24 } 25 @Override 24 26 public Object getValue(String key) { 25 27 return action.getValue(key); 26 28 } 29 @Override 27 30 public boolean isEnabled() { 28 31 return action.isEnabled(); 29 32 } 33 @Override 30 34 public void putValue(String key, Object value) { 31 35 action.putValue(key, value); 32 36 } 37 @Override 33 38 public void removePropertyChangeListener(PropertyChangeListener listener) { 34 39 action.removePropertyChangeListener(listener); 35 40 } 41 @Override 36 42 public void setEnabled(boolean b) { 37 43 action.setEnabled(b); 38 44 } 45 @Override 39 46 public void actionPerformed(ActionEvent e) { 40 47 action.actionPerformed(e, parameters); 41 48 } -
src/org/openstreetmap/josm/actions/PasteAction.java
46 46 Main.pasteBuffer.addPasteBufferChangedListener(this); 47 47 } 48 48 49 @Override 49 50 public void actionPerformed(ActionEvent e) { 50 51 if (!isEnabled()) 51 52 return; -
src/org/openstreetmap/josm/actions/PreferencesAction.java
30 30 /** 31 31 * Launch the preferences dialog. 32 32 */ 33 @Override 33 34 public void actionPerformed(ActionEvent e) { 34 35 run(); 35 36 } 36 37 38 @Override 37 39 public void run() { 38 40 new PreferenceDialog(Main.parent).setVisible(true); 39 41 } -
src/org/openstreetmap/josm/actions/PurgeAction.java
236 236 ImageProvider.get("warning-small"), JLabel.LEFT), GBC.eol().fill(GBC.HORIZONTAL)); 237 237 238 238 Collections.sort(toPurgeAdditionally, new Comparator<OsmPrimitive>() { 239 @Override 239 240 public int compare(OsmPrimitive o1, OsmPrimitive o2) { 240 241 int type = o2.getType().compareTo(o1.getType()); 241 242 if (type != 0) … … 266 267 putValue(SMALL_ICON, ImageProvider.get("dialogs","select")); 267 268 } 268 269 270 @Override 269 271 public void actionPerformed(ActionEvent e) { 270 272 layer.data.addSelected(toPurgeAdditionally); 271 273 } -
src/org/openstreetmap/josm/actions/RedoAction.java
28 28 putValue("help", ht("/Action/Redo")); 29 29 } 30 30 31 @Override 31 32 public void actionPerformed(ActionEvent e) { 32 33 if (Main.map == null) 33 34 return; -
src/org/openstreetmap/josm/actions/RenameLayerAction.java
41 41 this.putValue("help", ht("/Action/RenameLayer")); 42 42 } 43 43 44 @Override 44 45 public void actionPerformed(ActionEvent e) { 45 46 Box panel = Box.createVerticalBox(); 46 47 final JosmTextField name = new JosmTextField(layer.getName()); -
src/org/openstreetmap/josm/actions/RestartAction.java
40 40 setEnabled(isRestartSupported()); 41 41 } 42 42 43 @Override 43 44 public void actionPerformed(ActionEvent e) { 44 45 try { 45 46 restartJOSM(); -
src/org/openstreetmap/josm/actions/ReverseWayAction.java
70 70 putValue("help", ht("/Action/ReverseWays")); 71 71 } 72 72 73 @Override 73 74 public void actionPerformed(ActionEvent e) { 74 75 if (! isEnabled()) 75 76 return; -
src/org/openstreetmap/josm/actions/SelectAllAction.java
17 17 putValue("help", ht("/Action/SelectAll")); 18 18 } 19 19 20 @Override 20 21 public void actionPerformed(ActionEvent e) { 21 22 if (!isEnabled()) 22 23 return; -
src/org/openstreetmap/josm/actions/SessionLoadAction.java
31 31 putValue("help", ht("/Action/SessionLoad")); 32 32 } 33 33 34 @Override 34 35 public void actionPerformed(ActionEvent e) { 35 36 ExtensionFileFilter ff = new ExtensionFileFilter("jos,joz", "jos", tr("Session file (*.jos, *.joz)")); 36 37 JFileChooser fc = createAndOpenFileChooser(true, false, tr("Open session"), Arrays.asList(ff, FileFilterAllFiles.getInstance()), ff, JFileChooser.FILES_ONLY, "lastDirectory"); -
src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
134 134 return text.toString(); 135 135 } 136 136 137 @Override 137 138 public void actionPerformed(ActionEvent e) { 138 139 StringBuilder text = new StringBuilder(); 139 140 String reportHeader = getReportHeader(); -
src/org/openstreetmap/josm/actions/SimplifyWayAction.java
84 84 return ret == 0; 85 85 } 86 86 87 @Override 87 88 public void actionPerformed(ActionEvent e) { 88 89 DataSet ds = getCurrentDataSet(); 89 90 ds.beginUpdate(); -
src/org/openstreetmap/josm/actions/SplitWayAction.java
116 116 * This method performs an expensive check whether the selection clearly defines one 117 117 * of the split actions outlined above, and if yes, calls the splitWay method. 118 118 */ 119 @Override 119 120 public void actionPerformed(ActionEvent e) { 120 121 121 122 Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected(); -
src/org/openstreetmap/josm/actions/ToggleGPXLinesAction.java
18 18 putValue("help", ht("/Action/ToggleGPXLines")); 19 19 } 20 20 21 @Override 21 22 public void actionPerformed(ActionEvent e) { 22 23 Main.pref.put("draw.rawgps.lines", !Main.pref.getBoolean("draw.rawgps.lines", true)); 23 24 if (Main.isDisplayingMapView()) { -
src/org/openstreetmap/josm/actions/UndoAction.java
28 28 putValue("help", ht("/Action/Undo")); 29 29 } 30 30 31 @Override 31 32 public void actionPerformed(ActionEvent e) { 32 33 if (Main.map == null) 33 34 return; -
src/org/openstreetmap/josm/actions/UnselectAllAction.java
19 19 putValue("help", ht("/Action/UnselectAll")); 20 20 } 21 21 22 @Override 22 23 public void actionPerformed(ActionEvent e) { 23 24 if (!isEnabled()) 24 25 return; -
src/org/openstreetmap/josm/actions/UploadAction.java
227 227 // after these events. 228 228 // TODO: find better way to initialize the comment field 229 229 SwingUtilities.invokeLater(new Runnable() { 230 @Override 230 231 public void run() { 231 232 dialog.setDefaultChangesetTags(layer.data.getChangeSetTags()); 232 233 } … … 252 253 ); 253 254 } 254 255 256 @Override 255 257 public void actionPerformed(ActionEvent e) { 256 258 if (!isEnabled()) 257 259 return; -
src/org/openstreetmap/josm/actions/UploadSelectionAction.java
86 86 return ret; 87 87 } 88 88 89 @Override 89 90 public void actionPerformed(ActionEvent e) { 90 91 if (!isEnabled()) 91 92 return; … … 189 190 hull = new HashSet<OsmPrimitive>(); 190 191 } 191 192 193 @Override 192 194 public void visit(Node n) { 193 195 if (n.isNewOrUndeleted() || n.isModified() || n.isDeleted()) { 194 196 // upload new nodes as well as modified and deleted ones … … 196 198 } 197 199 } 198 200 201 @Override 199 202 public void visit(Way w) { 200 203 if (w.isNewOrUndeleted() || w.isModified() || w.isDeleted()) { 201 204 // upload new ways as well as modified and deleted ones … … 208 211 } 209 212 } 210 213 214 @Override 211 215 public void visit(Relation r) { 212 216 if (r.isNewOrUndeleted() || r.isModified() || r.isDeleted()) { 213 217 hull.add(r); … … 223 227 } 224 228 } 225 229 230 @Override 226 231 public void visit(Changeset cs) { 227 232 // do nothing 228 233 } … … 282 287 return; 283 288 } 284 289 Runnable r = new Runnable() { 290 @Override 285 291 public void run() { 286 292 processPostParentChecker(layer, toUpload); 287 293 } -
src/org/openstreetmap/josm/actions/ValidateAction.java
48 48 KeyEvent.VK_V, Shortcut.SHIFT), true); 49 49 } 50 50 51 @Override 51 52 public void actionPerformed(ActionEvent ev) { 52 53 doValidate(ev, true); 53 54 } -
src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java
57 57 Main.map.mapView.viewportFollowing = selected; 58 58 notifySelectedState(); 59 59 } 60 @Override 60 61 public void actionPerformed(ActionEvent e) { 61 62 toggleSelectedState(); 62 63 } -
src/org/openstreetmap/josm/actions/WireframeToggleAction.java
71 71 } 72 72 } 73 73 74 @Override 74 75 public void actionPerformed(ActionEvent e) { 75 76 toggleSelectedState(); 76 77 } -
src/org/openstreetmap/josm/actions/ZoomInAction.java
27 27 KeyEvent.VK_ADD, Shortcut.DIRECT)); 28 28 } 29 29 30 @Override 30 31 public void actionPerformed(ActionEvent e) { 31 32 if (!Main.isDisplayingMapView()) return; 32 33 Main.map.mapView.zoomToFactor(1/Math.sqrt(2)); -
src/org/openstreetmap/josm/actions/ZoomOutAction.java
22 22 KeyEvent.VK_SUBTRACT, Shortcut.DIRECT)); 23 23 } 24 24 25 @Override 25 26 public void actionPerformed(ActionEvent e) { 26 27 if (!Main.isDisplayingMapView()) return; 27 28 Main.map.mapView.zoomToFactor(Math.sqrt(2)); -
src/org/openstreetmap/josm/actions/ZoomToAction.java
60 60 tr("Zooming disabled because there is no selected node")); 61 61 } 62 62 63 @Override 63 64 public void actionPerformed(ActionEvent e) { 64 65 if (! isEnabled()) 65 66 return; … … 90 91 putValue(SHORT_DESCRIPTION, descriptionNominal); 91 92 } 92 93 94 @Override 93 95 public void valueChanged(ListSelectionEvent e) { 94 96 updateEnabledState(); 95 97 } 96 98 99 @Override 97 100 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 98 101 updateEnabledState(); 99 102 } 100 103 104 @Override 101 105 public void layerAdded(Layer newLayer) { 102 106 updateEnabledState(); 103 107 } 104 108 109 @Override 105 110 public void layerRemoved(Layer oldLayer) { 106 111 updateEnabledState(); 107 112 } -
src/org/openstreetmap/josm/actions/audio/AudioBackAction.java
29 29 this.putValue("help", ht("/Action/AudioBack")); 30 30 } 31 31 32 @Override 32 33 public void actionPerformed(ActionEvent e) { 33 34 try { 34 35 if (AudioPlayer.playing() || AudioPlayer.paused()) -
src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java
32 32 multiplier = 1.0 / multiplier; 33 33 } 34 34 35 @Override 35 36 public void actionPerformed(ActionEvent e) { 36 37 double speed = AudioPlayer.speed(); 37 38 if (speed * multiplier <= 0.1) -
src/org/openstreetmap/josm/actions/audio/AudioFwdAction.java
27 27 Shortcut.registerShortcut("audio:forward", tr("Audio: {0}", trc("audio", "Forward")), KeyEvent.VK_F7, Shortcut.DIRECT), true); 28 28 } 29 29 30 @Override 30 31 public void actionPerformed(ActionEvent e) { 31 32 try { 32 33 if (AudioPlayer.playing() || AudioPlayer.paused()) -
src/org/openstreetmap/josm/actions/audio/AudioNextAction.java
26 26 Shortcut.registerShortcut("audio:next", tr("Audio: {0}", trc("audio", "Next Marker")), KeyEvent.VK_F8, Shortcut.DIRECT), true); 27 27 } 28 28 29 @Override 29 30 public void actionPerformed(ActionEvent e) { 30 31 MarkerLayer.playNextMarker(); 31 32 } -
src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java
29 29 Shortcut.registerShortcut("audio:pause", tr("Audio: {0}", trc("audio", "Play/Pause")), KeyEvent.VK_PERIOD, Shortcut.DIRECT), true); 30 30 } 31 31 32 @Override 32 33 public void actionPerformed(ActionEvent e) { 33 34 URL url = AudioPlayer.url(); 34 35 try { -
src/org/openstreetmap/josm/actions/audio/AudioPrevAction.java
26 26 Shortcut.registerShortcut("audio:prev", tr("Audio: {0}", trc("audio", "Previous Marker")), KeyEvent.VK_F5, Shortcut.DIRECT), true); 27 27 } 28 28 29 @Override 29 30 public void actionPerformed(ActionEvent e) { 30 31 MarkerLayer.playPreviousMarker(); 31 32 } -
src/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTask.java
164 164 visitor.merge(); 165 165 SwingUtilities.invokeLater( 166 166 new Runnable() { 167 @Override 167 168 public void run() { 168 169 targetLayer.onPostDownloadFromServer(); 169 170 Main.map.mapView.repaint(); -
src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
58 58 this.futures.addAll(futures); 59 59 } 60 60 61 @Override 61 62 public void run() { 62 63 // wait for all downloads task to finish (by waiting for the futures 63 64 // to return a value) -
src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
396 396 /** 397 397 * This is required to update the cursors when ctrl/shift/alt is pressed 398 398 */ 399 @Override 399 400 public void eventDispatched(AWTEvent e) { 400 401 if(oldEvent == null) 401 402 return; -
src/org/openstreetmap/josm/actions/mapmode/MapMode.java
76 76 /** 77 77 * Call selectMapMode(this) on the parent mapFrame. 78 78 */ 79 @Override 79 80 public void actionPerformed(ActionEvent e) { 80 81 if (Main.isDisplayingMapView()) { 81 82 Main.map.selectMapMode(this); … … 109 110 } 110 111 } 111 112 113 @Override 112 114 public void mouseReleased(MouseEvent e) {requestFocusInMapView();} 115 @Override 113 116 public void mouseExited(MouseEvent e) {} 117 @Override 114 118 public void mousePressed(MouseEvent e) {requestFocusInMapView();} 119 @Override 115 120 public void mouseClicked(MouseEvent e) {} 121 @Override 116 122 public void mouseEntered(MouseEvent e) {} 123 @Override 117 124 public void mouseMoved(MouseEvent e) {} 125 @Override 118 126 public void mouseDragged(MouseEvent e) {} 119 127 } -
src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
210 210 /** 211 211 * This is called whenever the keyboard modifier status changes 212 212 */ 213 @Override 213 214 public void eventDispatched(AWTEvent e) { 214 215 if(oldEvent == null) 215 216 return; … … 444 445 useLastMoveCommandIfPossible(); 445 446 // Schedule a timer to update status line "initialMoveDelay+1" ms in the future 446 447 GuiHelper.scheduleTimer(initialMoveDelay+1, new ActionListener() { 448 @Override 447 449 public void actionPerformed(ActionEvent evt) { 448 450 updateStatusLine(); 449 451 } … … 603 605 // We need to do it like this as otherwise drawAction will see a double 604 606 // click and switch back to SelectMode 605 607 Main.worker.execute(new Runnable() { 608 @Override 606 609 public void run() { 607 610 Main.map.selectDrawTool(true); 608 611 } -
src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java
50 50 /** 51 51 * Zoom to the rectangle on the map. 52 52 */ 53 @Override 53 54 public void selectionEnded(Rectangle r, MouseEvent e) { 54 55 if (r.width >= 3 && r.height >= 3 && Main.isDisplayingMapView()) { 55 56 MapView mv = Main.map.mapView; -
src/org/openstreetmap/josm/actions/search/SearchAction.java
125 125 putValue("help", ht("/Action/Search")); 126 126 } 127 127 128 @Override 128 129 public void actionPerformed(ActionEvent e) { 129 130 if (!isEnabled()) 130 131 return; 131 132 search(); 132 133 } 133 134 135 @Override 134 136 public void actionPerformed(ActionEvent e, Map<String, Object> parameters) { 135 137 if (parameters.get(SEARCH_EXPRESSION) == null) { 136 138 actionPerformed(e); … … 725 727 setEnabled(getEditLayer() != null); 726 728 } 727 729 730 @Override 728 731 public List<ActionParameter<?>> getActionParameters() { 729 732 return Collections.<ActionParameter<?>>singletonList(new SearchSettingsActionParameter(SEARCH_EXPRESSION)); 730 733 } -
src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
20 20 21 21 public class ApiPreconditionCheckerHook implements UploadHook { 22 22 23 @Override 23 24 public boolean checkUpload(APIDataSet apiData) { 24 25 OsmApi api = OsmApi.getOsmApi(); 25 26 try { -
src/org/openstreetmap/josm/actions/upload/FixDataHook.java
42 42 deprecated.add(new FixDataTag("oneway", "1", "oneway", "yes")); 43 43 deprecated.add(new FixDataTag("highway", "stile", "barrier", "stile")); 44 44 deprecated.add(new FixData() { 45 @Override 45 46 public boolean fixKeys(Map<String, String> keys, OsmPrimitive osm) { 46 47 if(osm instanceof Relation && "multipolygon".equals(keys.get("type")) && "administrative".equals(keys.get("boundary"))) { 47 48 keys.put("type", "boundary"); -
src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java
96 96 dialog.showDialog(); 97 97 } 98 98 99 @Override 99 100 public boolean checkUpload(APIDataSet apiDataSet) { 100 101 this.data = apiDataSet; 101 102 try { -
src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
42 42 /** 43 43 * Validate the modified data before uploading 44 44 */ 45 @Override 45 46 public boolean checkUpload(APIDataSet apiDataSet) { 46 47 47 48 Collection<Test> tests = OsmValidator.getEnabledTests(true); -
src/org/openstreetmap/josm/command/Command.java
40 40 private static final class CloneVisitor extends AbstractVisitor { 41 41 public final Map<OsmPrimitive, PrimitiveData> orig = new LinkedHashMap<OsmPrimitive, PrimitiveData>(); 42 42 43 @Override 43 44 public void visit(Node n) { 44 45 orig.put(n, n.save()); 45 46 } 47 @Override 46 48 public void visit(Way w) { 47 49 orig.put(w, w.save()); 48 50 } 51 @Override 49 52 public void visit(Relation e) { 50 53 orig.put(e, e.save()); 51 54 } -
src/org/openstreetmap/josm/corrector/CorrectionTable.java
17 17 public static class BoldRenderer extends JLabel implements 18 18 TableCellRenderer { 19 19 20 @Override 20 21 public Component getTableCellRendererComponent(JTable table, 21 22 Object value, boolean isSelected, boolean hasFocus, int row, 22 23 int column) { … … 45 46 setRowSelectionAllowed(false); 46 47 } 47 48 49 @Override 48 50 public TableCellRenderer getCellRenderer(int row, int column) { 49 51 if (getCorrectionTableModel().isBoldCell(row, column)) { 50 52 if (boldRenderer == null) -
src/org/openstreetmap/josm/corrector/CorrectionTableModel.java
23 23 applyColumn = getColumnCount() - 1; 24 24 } 25 25 26 @Override 26 27 abstract public int getColumnCount(); 27 28 28 29 abstract protected boolean isBoldCell(int row, int column); … … 41 42 return apply[i]; 42 43 } 43 44 45 @Override 44 46 public int getRowCount() { 45 47 return corrections.size(); 46 48 } … … 71 73 apply[rowIndex] = (Boolean)aValue; 72 74 } 73 75 76 @Override 74 77 public Object getValueAt(int rowIndex, int colIndex) { 75 78 if (colIndex == applyColumn) 76 79 return apply[rowIndex]; -
src/org/openstreetmap/josm/corrector/TagCorrectionTableModel.java
31 31 return null; 32 32 } 33 33 34 @Override 34 35 public Object getCorrectionValueAt(int rowIndex, int colIndex) { 35 36 TagCorrection tagCorrection = getCorrections().get(rowIndex); 36 37 … … 47 48 return null; 48 49 } 49 50 51 @Override 50 52 protected boolean isBoldCell(int row, int column) { 51 53 TagCorrection tagCorrection = getCorrections().get(row); 52 54 return (column == 2 && tagCorrection.isKeyChanged()) -
src/org/openstreetmap/josm/data/APIDataSet.java
336 336 Collections.sort( 337 337 ret, 338 338 new Comparator<Relation>() { 339 @Override 339 340 public int compare(Relation o1, Relation o2) { 340 341 return Integer.valueOf(uploadOrder.indexOf(o1)).compareTo(uploadOrder.indexOf(o2)); 341 342 } -
src/org/openstreetmap/josm/data/AutosaveTask.java
334 334 final OpenFileTask openFileTsk = new OpenFileTask(files, null, tr("Restoring files")); 335 335 Main.worker.submit(openFileTsk); 336 336 Main.worker.submit(new Runnable() { 337 @Override 337 338 public void run() { 338 339 for (File f: openFileTsk.getSuccessfullyOpenedFiles()) { 339 340 moveToDeletedLayersFolder(f); -
src/org/openstreetmap/josm/data/CustomConfigurator.java
329 329 330 330 final ReadLocalPluginInformationTask task = new ReadLocalPluginInformationTask(); 331 331 Runnable r = new Runnable() { 332 @Override 332 333 public void run() { 333 334 if (task.isCanceled()) return; 334 335 synchronized (CustomConfigurator.class) { … … 337 338 } catch (InterruptedException ex) { } 338 339 339 340 SwingUtilities.invokeLater(new Runnable() { 341 @Override 340 342 public void run() { 341 343 List<PluginInformation> availablePlugins = task.getAvailablePlugins(); 342 344 List<PluginInformation> toInstallPlugins = new ArrayList<PluginInformation>(); -
src/org/openstreetmap/josm/data/Preferences.java
261 261 this.newValue = newValue; 262 262 } 263 263 264 @Override 264 265 public String getKey() { 265 266 return key; 266 267 } 268 @Override 267 269 public Setting<T> getOldValue() { 268 270 return oldValue; 269 271 } 272 @Override 270 273 public Setting<T> getNewValue() { 271 274 return newValue; 272 275 } … … 1266 1269 if (value == null) return false; 1267 1270 class PutVisitor implements SettingVisitor { 1268 1271 public boolean changed; 1272 @Override 1269 1273 public void visit(StringSetting setting) { 1270 1274 changed = put(key, setting.getValue()); 1271 1275 } 1276 @Override 1272 1277 public void visit(ListSetting setting) { 1273 1278 changed = putCollection(key, setting.getValue()); 1274 1279 } 1280 @Override 1275 1281 public void visit(ListListSetting setting) { 1276 1282 @SuppressWarnings("unchecked") 1277 1283 boolean changed = putArray(key, (Collection) setting.getValue()); 1278 1284 this.changed = changed; 1279 1285 } 1286 @Override 1280 1287 public void visit(MapListSetting setting) { 1281 1288 changed = putListOfStructs(key, setting.getValue()); 1282 1289 } … … 1549 1556 this.key = key; 1550 1557 } 1551 1558 1559 @Override 1552 1560 public void visit(StringSetting setting) { 1553 1561 if (noPassword && key.equals("osm-server.password")) 1554 1562 return; // do not store plain password. … … 1564 1572 } 1565 1573 } 1566 1574 1575 @Override 1567 1576 public void visit(ListSetting setting) { 1568 1577 b.append(" <list key='").append(XmlWriter.encode(key)).append("'>\n"); 1569 1578 for (String s : setting.getValue()) { … … 1572 1581 b.append(" </list>\n"); 1573 1582 } 1574 1583 1584 @Override 1575 1585 public void visit(ListListSetting setting) { 1576 1586 b.append(" <lists key='").append(XmlWriter.encode(key)).append("'>\n"); 1577 1587 for (List<String> list : setting.getValue()) { … … 1584 1594 b.append(" </lists>\n"); 1585 1595 } 1586 1596 1597 @Override 1587 1598 public void visit(MapListSetting setting) { 1588 1599 b.append(" <maps key='").append(XmlWriter.encode(key)).append("'>\n"); 1589 1600 for (Map<String, String> struct : setting.getValue()) { -
src/org/openstreetmap/josm/data/UndoRedoHandler.java
156 156 } 157 157 } 158 158 159 @Override 159 160 public void layerRemoved(Layer oldLayer) { 160 161 clean(oldLayer); 161 162 } 162 163 164 @Override 163 165 public void layerAdded(Layer newLayer) {} 166 @Override 164 167 public void activeLayerChange(Layer oldLayer, Layer newLayer) {} 165 168 166 169 public void removeCommandQueueListener(CommandQueueListener l) { -
src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
265 265 * 266 266 * @return the iterator 267 267 */ 268 @Override 268 269 public Iterator<Conflict<?>> iterator() { 269 270 return conflicts.iterator(); 270 271 } -
src/org/openstreetmap/josm/data/coor/Coordinate.java
31 31 this.x = x; this.y = y; 32 32 } 33 33 34 @Override 34 35 public double getX() { 35 36 return x; 36 37 } 37 38 39 @Override 38 40 public double getY() { 39 41 return y; 40 42 } 41 43 44 @Override 42 45 public void setLocation (double x, double y) { 43 46 this.x = x; 44 47 this.y = y; -
src/org/openstreetmap/josm/data/gpx/ImmutableGpxTrackSegment.java
46 46 return result; 47 47 } 48 48 49 @Override 49 50 public Bounds getBounds() { 50 51 if (bounds == null) 51 52 return null; … … 53 54 return new Bounds(bounds); 54 55 } 55 56 57 @Override 56 58 public Collection<WayPoint> getWayPoints() { 57 59 return wayPoints; 58 60 } 59 61 62 @Override 60 63 public double length() { 61 64 return length; 62 65 } 63 66 67 @Override 64 68 public int getUpdateCount() { 65 69 return 0; 66 70 } -
src/org/openstreetmap/josm/data/gpx/WayPoint.java
112 112 } 113 113 } 114 114 115 @Override 115 116 public int compareTo(WayPoint w) { 116 117 return Double.compare(time, w.time); 117 118 } -
src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java
159 159 this.primitive = primitive; 160 160 } 161 161 162 @Override 162 163 public ChangesetModificationType getModificationType() { 163 164 return modificationType; 164 165 } 165 166 167 @Override 166 168 public HistoryOsmPrimitive getPrimitive() { 167 169 return primitive; 168 170 } … … 175 177 typeIterator = modificationTypes.entrySet().iterator(); 176 178 } 177 179 180 @Override 178 181 public boolean hasNext() { 179 182 return typeIterator.hasNext(); 180 183 } 181 184 185 @Override 182 186 public ChangesetDataSetEntry next() { 183 187 Entry<PrimitiveId, ChangesetModificationType> next = typeIterator.next(); 184 188 ChangesetModificationType type = next.getValue(); … … 186 190 return new DefaultChangesetDataSetEntry(type, primitive); 187 191 } 188 192 193 @Override 189 194 public void remove() { 190 195 throw new UnsupportedOperationException(); 191 196 } -
src/org/openstreetmap/josm/data/osm/DefaultChangesetCacheEvent.java
20 20 removed = new HashSet<Changeset>(); 21 21 } 22 22 23 @Override 23 24 public Collection<Changeset> getAddedChangesets() { 24 25 return Collections.unmodifiableCollection(added); 25 26 } 27 @Override 26 28 public Collection<Changeset> getRemovedChangesets() { 27 29 return Collections.unmodifiableCollection(removed); 28 30 } 31 @Override 29 32 public ChangesetCache getSource() { 30 33 return source; 31 34 } 35 @Override 32 36 public Collection<Changeset> getUpdatedChangesets() { 33 37 return Collections.unmodifiableCollection(modified); 34 38 } -
src/org/openstreetmap/josm/data/osm/OsmPrimitiveComparator.java
54 54 return -1; 55 55 } 56 56 57 @Override 57 58 public int compare(OsmPrimitive a, OsmPrimitive b) { 58 59 if (a.getType().equals(b.getType())) 59 60 return compareName(a, b); -
src/org/openstreetmap/josm/data/osm/PrimitiveDeepCopy.java
48 48 new AbstractVisitor() { 49 49 boolean firstIteration; 50 50 51 @Override 51 52 public void visit(Node n) { 52 53 if (!visitedNodeIds.add(n.getUniqueId())) 53 54 return; 54 55 (firstIteration ? directlyAdded : referenced).add(n.save()); 55 56 } 57 @Override 56 58 public void visit(Way w) { 57 59 if (!visitedWayIds.add(w.getUniqueId())) 58 60 return; … … 62 64 visit(n); 63 65 } 64 66 } 67 @Override 65 68 public void visit(Relation r) { 66 69 if (!visitedRelationIds.add(r.getUniqueId())) 67 70 return; -
src/org/openstreetmap/josm/data/osm/QuadBuckets.java
507 507 { 508 508 clear(); 509 509 } 510 @Override 510 511 public void clear() { 511 512 root = new QBLevel(); 512 513 search_cache = null; … … 516 517 out("root: " + root + " level: " + root.level + " bbox: " + root.bbox()); 517 518 }*/ 518 519 } 520 @Override 519 521 public boolean add(T n) { 520 522 root.add(n); 521 523 size++; 522 524 return true; 523 525 } 524 526 527 @Override 525 528 public boolean retainAll(Collection<?> objects) 526 529 { 527 530 for (T o : this) { … … 533 536 } 534 537 return true; 535 538 } 539 @Override 536 540 public boolean removeAll(Collection<?> objects) 537 541 { 538 542 boolean changed = false; … … 541 545 } 542 546 return changed; 543 547 } 548 @Override 544 549 public boolean addAll(Collection<? extends T> objects) 545 550 { 546 551 boolean changed = false; … … 549 554 } 550 555 return changed; 551 556 } 557 @Override 552 558 public boolean containsAll(Collection<?> objects) 553 559 { 554 560 for (Object o : objects) { … … 557 563 } 558 564 return true; 559 565 } 566 @Override 560 567 public boolean remove(Object o) { 561 568 @SuppressWarnings("unchecked") T t = (T) o; 562 569 search_cache = null; // Search cache might point to one of removed buckets … … 567 574 } else 568 575 return false; 569 576 } 577 @Override 570 578 public boolean contains(Object o) { 571 579 @SuppressWarnings("unchecked") T t = (T) o; 572 580 QBLevel bucket = root.findBucket(t.getBBox()); … … 584 592 }*/ 585 593 return a; 586 594 } 595 @Override 587 596 public Object[] toArray() 588 597 { 589 598 return this.toArrayList().toArray(); 590 599 } 600 @Override 591 601 public <A> A[] toArray(A[] template) 592 602 { 593 603 return this.toArrayList().toArray(template); … … 625 635 }*/ 626 636 iterated_over = 0; 627 637 } 638 @Override 628 639 public boolean hasNext() 629 640 { 630 641 if (this.peek() == null) … … 659 670 return null; 660 671 return current_node.content.get(content_index); 661 672 } 673 @Override 662 674 public T next() 663 675 { 664 676 T ret = peek(); … … 674 686 } 675 687 return ret; 676 688 } 689 @Override 677 690 public void remove() 678 691 { 679 692 // two uses … … 685 698 current_node.remove_content(object); 686 699 } 687 700 } 701 @Override 688 702 public Iterator<T> iterator() 689 703 { 690 704 return new QuadBucketIterator(this); 691 705 } 706 @Override 692 707 public int size() { 693 708 return size; 694 709 } 695 710 711 @Override 696 712 public boolean isEmpty() 697 713 { 698 714 if (this.size() == 0) -
src/org/openstreetmap/josm/data/osm/RelationMember.java
170 170 /** 171 171 * PrimitiveId implementation. Returns the same value as getMember().getType() 172 172 */ 173 @Override 173 174 public OsmPrimitiveType getType() { 174 175 return member.getType(); 175 176 } … … 177 178 /** 178 179 * PrimitiveId implementation. Returns the same value as getMemberType().getUniqueId() 179 180 */ 181 @Override 180 182 public long getUniqueId() { 181 183 return member.getUniqueId(); 182 184 } 183 185 186 @Override 184 187 public boolean isNew() { 185 188 return member.isNew(); 186 189 } -
src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java
14 14 this.type = type; 15 15 } 16 16 17 @Override 17 18 public OsmPrimitiveType getType() { 18 19 return type; 19 20 } 20 21 22 @Override 21 23 public long getUniqueId() { 22 24 return id; 23 25 } 24 26 27 @Override 25 28 public boolean isNew() { 26 29 return id <= 0; 27 30 } -
src/org/openstreetmap/josm/data/osm/Storage.java
89 89 90 90 public static class PrimitiveIdHash implements Hash<PrimitiveId, PrimitiveId> { 91 91 92 @Override 92 93 public int getHashCode(PrimitiveId k) { 93 94 return (int)k.getUniqueId() ^ k.getType().hashCode(); 94 95 } 95 96 97 @Override 96 98 public boolean equals(PrimitiveId key, PrimitiveId value) { 97 99 if (key == null || value == null) return false; 98 100 return key.getUniqueId() == value.getUniqueId() && key.getType() == value.getType(); … … 360 362 */ 361 363 public static <O> Hash<O,O> defaultHash() { 362 364 return new Hash<O,O>() { 365 @Override 363 366 public int getHashCode(O t) { 364 367 return t.hashCode(); 365 368 } 369 @Override 366 370 public boolean equals(O t1, O t2) { 367 371 return t1.equals(t2); 368 372 } … … 388 392 fHash = h; 389 393 } 390 394 395 @Override 391 396 public int size() { 392 397 return Storage.this.size(); 393 398 } 394 399 400 @Override 395 401 public boolean isEmpty() { 396 402 return Storage.this.isEmpty(); 397 403 } 398 404 405 @Override 399 406 public boolean containsKey(Object o) { 400 407 @SuppressWarnings("unchecked") K key = (K) o; 401 408 int bucket = getBucket(fHash, key); 402 409 return bucket >= 0; 403 410 } 404 411 412 @Override 405 413 public boolean containsValue(Object value) { 406 414 return Storage.this.contains(value); 407 415 } 408 416 417 @Override 409 418 public T get(Object o) { 410 419 @SuppressWarnings("unchecked") K key = (K) o; 411 420 int bucket = getBucket(fHash, key); 412 421 return bucket < 0 ? null : data[bucket]; 413 422 } 414 423 424 @Override 415 425 public T put(K key, T value) { 416 426 if (!fHash.equals(key, value)) throw new IllegalArgumentException("inconsistent key"); 417 427 return Storage.this.put(value); 418 428 } 419 429 430 @Override 420 431 public T remove(Object o) { 421 432 modCount++; 422 433 @SuppressWarnings("unchecked") K key = (K) o; … … 425 436 return bucket < 0 ? null : doRemove(bucket); 426 437 } 427 438 439 @Override 428 440 public void putAll(Map<? extends K, ? extends T> m) { 429 441 if (m instanceof Storage.FMap) { 430 442 Storage.this.addAll(((Storage.FMap)m).values()); … … 435 447 } 436 448 } 437 449 450 @Override 438 451 public void clear() { 439 452 Storage.this.clear(); 440 453 } 441 454 455 @Override 442 456 public Set<K> keySet() { 443 457 throw new UnsupportedOperationException(); 444 458 } 445 459 460 @Override 446 461 public Collection<T> values() { 447 462 return Storage.this; 448 463 } 449 464 465 @Override 450 466 public Set<Entry<K, T>> entrySet() { 451 467 throw new UnsupportedOperationException(); 452 468 } … … 460 476 this.data = data; 461 477 } 462 478 479 @Override 463 480 public boolean hasNext() { 464 481 align(); 465 482 return slot < data.length; 466 483 } 467 484 485 @Override 468 486 public T next() { 469 487 if (!hasNext()) throw new NoSuchElementException(); 470 488 return data[slot++]; 471 489 } 472 490 491 @Override 473 492 public void remove() { 474 493 throw new UnsupportedOperationException(); 475 494 } … … 491 510 mods = modCount; 492 511 } 493 512 513 @Override 494 514 public boolean hasNext() { 495 515 align(); 496 516 return slot < data.length; 497 517 } 498 518 519 @Override 499 520 public T next() { 500 521 if (!hasNext()) throw new NoSuchElementException(); 501 522 removeSlot = slot; 502 523 return data[slot++]; 503 524 } 504 525 526 @Override 505 527 public void remove() { 506 528 if (removeSlot == -1) throw new IllegalStateException(); 507 529 -
src/org/openstreetmap/josm/data/osm/TagCollection.java
484 484 * 485 485 * @return the iterator 486 486 */ 487 @Override 487 488 public Iterator<Tag> iterator() { 488 489 return tags.iterator(); 489 490 } -
src/org/openstreetmap/josm/data/osm/event/DataSetListenerAdapter.java
19 19 this.listener = listener; 20 20 } 21 21 22 @Override 22 23 public void dataChanged(DataChangedEvent event) { 23 24 listener.processDatasetEvent(event); 24 25 } 25 26 27 @Override 26 28 public void nodeMoved(NodeMovedEvent event) { 27 29 listener.processDatasetEvent(event); 28 30 } 29 31 32 @Override 30 33 public void primitivesAdded(PrimitivesAddedEvent event) { 31 34 listener.processDatasetEvent(event); 32 35 } 33 36 37 @Override 34 38 public void primitivesRemoved(PrimitivesRemovedEvent event) { 35 39 listener.processDatasetEvent(event); 36 40 } 37 41 42 @Override 38 43 public void relationMembersChanged(RelationMembersChangedEvent event) { 39 44 listener.processDatasetEvent(event); 40 45 } 41 46 47 @Override 42 48 public void tagsChanged(TagsChangedEvent event) { 43 49 listener.processDatasetEvent(event); 44 50 } 45 51 52 @Override 46 53 public void wayNodesChanged(WayNodesChangedEvent event) { 47 54 listener.processDatasetEvent(event); 48 55 } 49 56 57 @Override 50 58 public void otherDatasetChange(AbstractDatasetChangedEvent event) { 51 59 listener.processDatasetEvent(event); 52 60 } -
src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java
97 97 normalListeners.remove(searchListener); 98 98 } 99 99 100 @Override 100 101 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 101 102 if (oldLayer != null) { 102 103 oldLayer.data.removeDataSetListener(myListener); … … 126 127 } 127 128 } 128 129 130 @Override 129 131 public void processDatasetEvent(AbstractDatasetChangedEvent event) { 130 132 fireEvents(normalListeners, event); 131 133 eventsInEDT.add(event); … … 133 135 } 134 136 135 137 private final Runnable edtRunnable = new Runnable() { 138 @Override 136 139 public void run() { 137 140 while (!eventsInEDT.isEmpty()) { 138 141 List<AbstractDatasetChangedEvent> events = new ArrayList<AbstractDatasetChangedEvent>(); -
src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java
67 67 normalListeners.remove(searchListener); 68 68 } 69 69 70 @Override 70 71 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 71 72 fireEvents(normalListeners, newSelection); 72 73 selection = newSelection; … … 80 81 } 81 82 82 83 private final Runnable edtRunnable = new Runnable() { 84 @Override 83 85 public void run() { 84 86 if (selection != null) { 85 87 fireEvents(inEDTListeners, selection); -
src/org/openstreetmap/josm/data/osm/history/History.java
66 66 Collections.sort( 67 67 copy, 68 68 new Comparator<HistoryOsmPrimitive>() { 69 @Override 69 70 public int compare(HistoryOsmPrimitive o1, HistoryOsmPrimitive o2) { 70 71 return o1.compareTo(o2); 71 72 } … … 79 80 Collections.sort( 80 81 copy, 81 82 new Comparator<HistoryOsmPrimitive>() { 83 @Override 82 84 public int compare(HistoryOsmPrimitive o1, HistoryOsmPrimitive o2) { 83 85 return o2.compareTo(o1); 84 86 } … … 91 93 return filter( 92 94 this, 93 95 new FilterPredicate() { 96 @Override 94 97 public boolean matches(HistoryOsmPrimitive primitive) { 95 98 return primitive.getTimestamp().compareTo(fromDate) >= 0; 96 99 } … … 102 105 return filter( 103 106 this, 104 107 new FilterPredicate() { 108 @Override 105 109 public boolean matches(HistoryOsmPrimitive primitive) { 106 110 return primitive.getTimestamp().compareTo(untilDate) <= 0; 107 111 } … … 117 121 return filter( 118 122 this, 119 123 new FilterPredicate() { 124 @Override 120 125 public boolean matches(HistoryOsmPrimitive primitive) { 121 126 return primitive.getVersion() >= fromVersion; 122 127 } … … 128 133 return filter( 129 134 this, 130 135 new FilterPredicate() { 136 @Override 131 137 public boolean matches(HistoryOsmPrimitive primitive) { 132 138 return primitive.getVersion() <= untilVersion; 133 139 } … … 143 149 return filter( 144 150 this, 145 151 new FilterPredicate() { 152 @Override 146 153 public boolean matches(HistoryOsmPrimitive primitive) { 147 154 return primitive.getUser() != null && primitive.getUser().getId() == uid; 148 155 } -
src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java
163 163 /* ------------------------------------------------------------------------------ */ 164 164 /* interface LayerChangeListener */ 165 165 /* ------------------------------------------------------------------------------ */ 166 @Override 166 167 public void activeLayerChange(Layer oldLayer, Layer newLayer) {/* irrelevant in this context */} 168 @Override 167 169 public void layerAdded(Layer newLayer) {/* irrelevant in this context */} 170 @Override 168 171 public void layerRemoved(Layer oldLayer) { 169 172 if (Main.map == null || Main.map.mapView == null) return; 170 173 if (Main.map.mapView.getNumLayers() == 0) { -
src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
148 148 149 149 public abstract OsmPrimitiveType getType(); 150 150 151 @Override 151 152 public int compareTo(HistoryOsmPrimitive o) { 152 153 if (this.id != o.id) 153 154 throw new ClassCastException(tr("Cannot compare primitive with ID ''{0}'' to primitive with ID ''{1}''.", o.id, this.id)); -
src/org/openstreetmap/josm/data/osm/visitor/AbstractVisitor.java
12 12 */ 13 13 public abstract class AbstractVisitor implements Visitor { 14 14 15 @Override 15 16 public void visit(Changeset cs) { 16 17 // do nothing 17 18 } -
src/org/openstreetmap/josm/data/osm/visitor/AllNodesVisitor.java
25 25 /** 26 26 * Nodes have only itself as nodes. 27 27 */ 28 @Override 28 29 public void visit(Node n) { 29 30 nodes.add(n); 30 31 } … … 32 33 /** 33 34 * Ways have their way nodes. 34 35 */ 36 @Override 35 37 public void visit(Way w) { 36 38 if (w.isIncomplete()) return; 37 39 for (Node n : w.getNodes()) … … 43 45 * FIXME: do we want to collect nodes from segs/ways that are relation members? 44 46 * if so, use AutomatchVisitor! 45 47 */ 48 @Override 46 49 public void visit(Relation e) { 47 50 for (RelationMember m : e.getMembers()) 48 51 if (m.isNode()) visit(m.getNode()); -
src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
24 24 25 25 private ProjectionBounds bounds = null; 26 26 27 @Override 27 28 public void visit(Node n) { 28 29 visit(n.getEastNorth()); 29 30 } 30 31 32 @Override 31 33 public void visit(Way w) { 32 34 if (w.isIncomplete()) return; 33 35 for (Node n : w.getNodes()) { … … 35 37 } 36 38 } 37 39 40 @Override 38 41 public void visit(Relation e) { 39 42 // only use direct members 40 43 for (RelationMember m : e.getMembers()) { -
src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java
125 125 mappedPrimitives.put(primitive, clone); 126 126 } 127 127 128 @Override 128 129 public void visit(Node n) { 129 130 rememberNode(n); 130 131 } 131 132 133 @Override 132 134 public void visit(Way w) { 133 135 // remember all nodes this way refers to ... 134 136 // … … 139 141 rememberWay(w); 140 142 } 141 143 144 @Override 142 145 public void visit(Relation r) { 143 146 // first, remember all primitives members refer to (only if necessary, see 144 147 // below) -
src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java
102 102 103 103 } 104 104 105 @Override 105 106 public void preferenceChanged(PreferenceChangeEvent e) { 106 107 load(); 107 108 } -
src/org/openstreetmap/josm/data/osm/visitor/paint/PaintColors.java
38 38 39 39 private static final MapPaintSylesUpdateListener styleOverrideListener = new MapPaintSylesUpdateListener() { 40 40 41 @Override 41 42 public void mapPaintStylesUpdated() { 42 43 backgroundColorCache = null; 43 44 } 44 45 46 @Override 45 47 public void mapPaintStyleEntryUpdated(int idx) { 46 48 mapPaintStylesUpdated(); 47 49 } -
src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
153 153 * @param virtual <code>true</code> if virtual nodes are used 154 154 * @param bounds display boundaries 155 155 */ 156 @Override 156 157 public void render(DataSet data, boolean virtual, Bounds bounds) { 157 158 BBox bbox = new BBox(bounds); 158 159 this.ds = data; -
src/org/openstreetmap/josm/gui/BookmarkList.java
66 66 return name; 67 67 } 68 68 69 @Override 69 70 public int compareTo(Bookmark b) { 70 71 return name.toLowerCase().compareTo(b.name.toLowerCase()); 71 72 } … … 223 224 return sb.toString(); 224 225 225 226 } 227 @Override 226 228 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 227 229 boolean cellHasFocus) { 228 230 -
src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
137 137 * @param node the node 138 138 * @return the name 139 139 */ 140 @Override 140 141 public String format(Node node) { 141 142 StringBuilder name = new StringBuilder(); 142 143 if (node.isIncomplete()) { … … 202 203 } 203 204 }; 204 205 206 @Override 205 207 public Comparator<Node> getNodeComparator() { 206 208 return nodeComparator; 207 209 } … … 213 215 * @param way the way 214 216 * @return the name 215 217 */ 218 @Override 216 219 public String format(Way way) { 217 220 StringBuilder name = new StringBuilder(); 218 221 if (way.isIncomplete()) { … … 292 295 } 293 296 }; 294 297 298 @Override 295 299 public Comparator<Way> getWayComparator() { 296 300 return wayComparator; 297 301 } … … 303 307 * @param relation the relation 304 308 * @return the name 305 309 */ 310 @Override 306 311 public String format(Relation relation) { 307 312 StringBuilder name = new StringBuilder(); 308 313 if (relation.isIncomplete()) { … … 400 405 } 401 406 }; 402 407 408 @Override 403 409 public Comparator<Relation> getRelationComparator() { 404 410 return relationComparator; 405 411 } … … 483 489 * @param changeset the changeset 484 490 * @return the name 485 491 */ 492 @Override 486 493 public String format(Changeset changeset) { 487 494 return tr("Changeset {0}",changeset.getId()); 488 495 } … … 546 553 * @param node the node 547 554 * @return the name 548 555 */ 556 @Override 549 557 public String format(HistoryNode node) { 550 558 StringBuilder sb = new StringBuilder(); 551 559 String name; … … 577 585 * @param way the way 578 586 * @return the name 579 587 */ 588 @Override 580 589 public String format(HistoryWay way) { 581 590 StringBuilder sb = new StringBuilder(); 582 591 String name; … … 618 627 * @param relation the relation 619 628 * @return the name 620 629 */ 630 @Override 621 631 public String format(HistoryRelation relation) { 622 632 StringBuilder sb = new StringBuilder(); 623 633 if (relation.get("type") != null) { -
src/org/openstreetmap/josm/gui/FileDrop.java
74 74 BorderFactory.createMatteBorder( 2, 2, 2, 2, defaultBorderColor ), // Drag border 75 75 true, // Recursive 76 76 new FileDrop.Listener(){ 77 @Override 77 78 public void filesDropped( java.io.File[] files ){ 78 79 // start asynchronous loading of files 79 80 OpenFileAction.OpenFileTask task = new OpenFileAction.OpenFileTask(Arrays.asList(files), null); … … 271 272 if( supportsDnD() ) 272 273 { // Make a drop listener 273 274 dropListener = new java.awt.dnd.DropTargetListener() 274 { public void dragEnter( java.awt.dnd.DropTargetDragEvent evt ) 275 { @Override 276 public void dragEnter( java.awt.dnd.DropTargetDragEvent evt ) 275 277 { log( out, "FileDrop: dragEnter event." ); 276 278 277 279 // Is this an acceptable drag event? … … 298 300 } // end else: drag not ok 299 301 } // end dragEnter 300 302 303 @Override 301 304 public void dragOver( java.awt.dnd.DropTargetDragEvent evt ) 302 305 { // This is called continually as long as the mouse is 303 306 // over the drag target. 304 307 } // end dragOver 305 308 309 @Override 306 310 public void drop( java.awt.dnd.DropTargetDropEvent evt ) 307 311 { log( out, "FileDrop: drop event." ); 308 312 try … … 388 392 } // end finally 389 393 } // end drop 390 394 395 @Override 391 396 public void dragExit( java.awt.dnd.DropTargetEvent evt ) 392 397 { log( out, "FileDrop: dragExit event." ); 393 398 // If it's a Swing component, reset its border … … 398 403 } // end if: JComponent 399 404 } // end dragExit 400 405 406 @Override 401 407 public void dropActionChanged( java.awt.dnd.DropTargetDragEvent evt ) 402 408 { log( out, "FileDrop: dropActionChanged event." ); 403 409 // Is this an acceptable drag event? … … 480 486 481 487 // Listen for hierarchy changes and remove the drop target when the parent gets cleared out. 482 488 c.addHierarchyListener( new java.awt.event.HierarchyListener() 483 { public void hierarchyChanged( java.awt.event.HierarchyEvent evt ) 489 { @Override 490 public void hierarchyChanged( java.awt.event.HierarchyEvent evt ) 484 491 { log( out, "FileDrop: Hierarchy changed." ); 485 492 java.awt.Component parent = c.getParent(); 486 493 if( parent == null ) … … 812 819 * @return An array of supported data flavors 813 820 * @since 1.1 814 821 */ 822 @Override 815 823 public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors() 816 824 { 817 825 if( customFlavor != null ) … … 838 846 * @return The dropped data 839 847 * @since 1.1 840 848 */ 849 @Override 841 850 public Object getTransferData( java.awt.datatransfer.DataFlavor flavor ) 842 851 throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException 843 852 { … … 861 870 * @return Whether or not the flavor is supported 862 871 * @since 1.1 863 872 */ 873 @Override 864 874 public boolean isDataFlavorSupported( java.awt.datatransfer.DataFlavor flavor ) 865 875 { 866 876 // Native object -
src/org/openstreetmap/josm/gui/GettingStarted.java
52 52 addHyperlinkListener(this); 53 53 } 54 54 55 @Override 55 56 public void hyperlinkUpdate(HyperlinkEvent e) { 56 57 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { 57 58 OpenBrowser.displayUrl(e.getDescription()); -
src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
112 112 this.value = value; 113 113 } 114 114 115 @Override 115 116 public void actionPerformed(ActionEvent e) { 116 117 pane.setValue(value); 117 118 dialog.setVisible(false); … … 167 168 b.setToolTipText(tr("Show help information")); 168 169 HelpUtil.setHelpContext(b, helpTopic); 169 170 Action a = new AbstractAction() { 171 @Override 170 172 public void actionPerformed(ActionEvent e) { 171 173 HelpBrowser.setUrlForHelpTopic(helpTopic); 172 174 } … … 270 272 }); 271 273 dialog.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0), "close"); 272 274 dialog.getRootPane().getActionMap().put("close", new AbstractAction() { 275 @Override 273 276 public void actionPerformed(ActionEvent e) { 274 277 pane.setValue(JOptionPane.CLOSED_OPTION); 275 278 dialog.setVisible(false); … … 323 326 */ 324 327 static public void showMessageDialogInEDT(final Component parentComponent, final Object msg, final String title, final int messageType, final String helpTopic) { 325 328 GuiHelper.runInEDT(new Runnable() { 329 @Override 326 330 public void run() { 327 331 showOptionDialog(parentComponent, msg, title, messageType, null, null, null, helpTopic); 328 332 } -
src/org/openstreetmap/josm/gui/IconToggleButton.java
59 59 ExpertToggleAction.addExpertModeChangeListener(this); 60 60 } 61 61 62 @Override 62 63 public void propertyChange(PropertyChangeEvent evt) { 63 64 if (evt.getPropertyName().equals("active")) { 64 65 setSelected((Boolean)evt.getNewValue()); … … 68 69 } 69 70 } 70 71 72 @Override 71 73 public void destroy() { 72 74 Action action = getAction(); 73 75 if (action instanceof Destroyable) { -
src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
238 238 /* ------------------------------------------------------------------- */ 239 239 /* interface PreferenceChangeListener */ 240 240 /* ------------------------------------------------------------------- */ 241 @Override 241 242 public void preferenceChanged(PreferenceChangeEvent evt) { 242 243 if (evt.getKey().equals("osm-server.username")) { 243 244 if (!(evt.getNewValue() instanceof StringSetting)) return; -
src/org/openstreetmap/josm/gui/MainApplet.java
41 41 super(tr("Upload Preferences"), "upload-preferences", tr("Upload the current preferences to the server"), 42 42 Shortcut.registerShortcut("applet:uploadprefs", tr("Upload Preferences"), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true); 43 43 } 44 @Override 44 45 public void actionPerformed(ActionEvent e) { 45 46 ((ServerSidePreferences)Main.pref).upload(); 46 47 } … … 163 164 MainApplet applet = new MainApplet(); 164 165 Main.pref = new ServerSidePreferences(applet.getCodeBase()); 165 166 applet.setStub(new AppletStub() { 167 @Override 166 168 public void appletResize(int w, int h) { 167 169 frame.setSize(w, h); 168 170 } 169 171 172 @Override 170 173 public AppletContext getAppletContext() { 171 174 return null; 172 175 } 173 176 177 @Override 174 178 public URL getCodeBase() { 175 179 try { 176 180 return new File(".").toURI().toURL(); … … 180 184 } 181 185 } 182 186 187 @Override 183 188 public URL getDocumentBase() { 184 189 return getCodeBase(); 185 190 } 186 191 192 @Override 187 193 public String getParameter(String k) { 188 194 return null; 189 195 } 190 196 197 @Override 191 198 public boolean isActive() { 192 199 return true; 193 200 } -
src/org/openstreetmap/josm/gui/MainApplication.java
352 352 toolbar.refreshToolbarControl(); 353 353 354 354 GuiHelper.runInEDT(new Runnable() { 355 @Override 355 356 public void run() { 356 357 splash.setVisible(false); 357 358 splash.dispose(); … … 380 381 final Map<Option, Collection<String>> args_final = args; 381 382 382 383 SwingUtilities.invokeLater(new Runnable() { 384 @Override 383 385 public void run() { 384 386 if (AutosaveTask.PROP_AUTOSAVE_ENABLED.get()) { 385 387 AutosaveTask autosaveTask = new AutosaveTask(); -
src/org/openstreetmap/josm/gui/MapMover.java
39 39 public ZoomerAction(String action) { 40 40 this.action = action; 41 41 } 42 @Override 42 43 public void actionPerformed(ActionEvent e) { 43 44 if (action.equals(".") || action.equals(",")) { 44 45 Point mouse = nc.getMousePosition(); … … 120 121 /** 121 122 * If the right (and only the right) mouse button is pressed, move the map 122 123 */ 124 @Override 123 125 public void mouseDragged(MouseEvent e) { 124 126 int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK; 125 127 if ((e.getModifiersEx() & (MouseEvent.BUTTON3_DOWN_MASK | offMask)) == MouseEvent.BUTTON3_DOWN_MASK) { … … 186 188 * Zoom the map by 1/5th of current zoom per wheel-delta. 187 189 * @param e The wheel event. 188 190 */ 191 @Override 189 192 public void mouseWheelMoved(MouseWheelEvent e) { 190 193 nc.zoomToFactor(e.getX(), e.getY(), Math.pow(Math.sqrt(2), e.getWheelRotation())); 191 194 } … … 193 196 /** 194 197 * Emulates dragging on Mac OSX 195 198 */ 199 @Override 196 200 public void mouseMoved(MouseEvent e) { 197 201 if (!movementInPlace) 198 202 return; -
src/org/openstreetmap/josm/gui/MapScaler.java
45 45 return Main.pref.getColor(marktr("scale"), Color.white); 46 46 } 47 47 48 @Override 48 49 public String helpTopic() { 49 50 return ht("/MapView/Scaler"); 50 51 } -
src/org/openstreetmap/josm/gui/MapSlider.java
28 28 propertyChange(null); 29 29 } 30 30 31 @Override 31 32 public void propertyChange(PropertyChangeEvent evt) { 32 33 if (getModel().getValueIsAdjusting()) return; 33 34 … … 53 54 preventChange=false; 54 55 } 55 56 57 @Override 56 58 public void stateChanged(ChangeEvent e) { 57 59 if (preventChange) return; 58 60 … … 64 66 this.mv.zoomTo(new ProjectionBounds(this.mv.getCenter(), es/fact, n/fact)); 65 67 } 66 68 69 @Override 67 70 public String helpTopic() { 68 71 return ht("/MapView/Slider"); 69 72 } -
src/org/openstreetmap/josm/gui/MapStatus.java
454 454 final Popup staticPopup = popup; 455 455 popup = null; 456 456 EventQueue.invokeLater(new Runnable(){ 457 @Override 457 458 public void run() { 458 459 staticPopup.hide(); 459 460 }}); -
src/org/openstreetmap/josm/gui/MenuScroller.java
598 598 } 599 599 600 600 private class MouseScrollListener implements MouseWheelListener { 601 @Override 601 602 public void mouseWheelMoved(MouseWheelEvent mwe) { 602 603 if (menu.getComponents().length > scrollCount) { 603 604 firstIndex += mwe.getWheelRotation(); -
src/org/openstreetmap/josm/gui/MultiSplitLayout.java
211 211 * @param child the component to be added 212 212 * @see #removeLayoutComponent 213 213 */ 214 @Override 214 215 public void addLayoutComponent(String name, Component child) { 215 216 if (name == null) 216 217 throw new IllegalArgumentException("name not specified"); … … 223 224 * @param child the component to be removed 224 225 * @see #addLayoutComponent 225 226 */ 227 @Override 226 228 public void removeLayoutComponent(Component child) { 227 229 String name = child.getName(); 228 230 if (name != null) { … … 320 322 return new Dimension(width, height); 321 323 } 322 324 325 @Override 323 326 public Dimension preferredLayoutSize(Container parent) { 324 327 Dimension size = preferredNodeSize(getModel()); 325 328 return sizeWithInsets(parent, size); 326 329 } 327 330 331 @Override 328 332 public Dimension minimumLayoutSize(Container parent) { 329 333 Dimension size = minimumNodeSize(getModel()); 330 334 return sizeWithInsets(parent, size); … … 759 763 * the layout model, and then set the bounds of each child component 760 764 * with a matching Leaf Node. 761 765 */ 766 @Override 762 767 public void layoutContainer(Container parent) { 763 768 checkLayout(getModel()); 764 769 Insets insets = parent.getInsets(); -
src/org/openstreetmap/josm/gui/MultiSplitPane.java
156 156 } 157 157 158 158 private class DefaultDividerPainter extends DividerPainter { 159 @Override 159 160 public void paint(Graphics g, Divider divider) { 160 161 if ((divider == activeDivider()) && !isContinuousLayout()) { 161 162 Graphics2D g2d = (Graphics2D)g; … … 201 202 * <p> 202 203 * {@inheritDoc} 203 204 */ 205 @Override 204 206 protected void paintChildren(Graphics g) { 205 207 super.paintChildren(g); 206 208 DividerPainter dp = getDividerPainter(); … … 352 354 353 355 private class InputHandler extends MouseInputAdapter implements KeyListener { 354 356 357 @Override 355 358 public void mouseEntered(MouseEvent e) { 356 359 updateCursor(e.getX(), e.getY(), true); 357 360 } 358 361 362 @Override 359 363 public void mouseMoved(MouseEvent e) { 360 364 updateCursor(e.getX(), e.getY(), true); 361 365 } 362 366 367 @Override 363 368 public void mouseExited(MouseEvent e) { 364 369 updateCursor(e.getX(), e.getY(), false); 365 370 } 366 371 372 @Override 367 373 public void mousePressed(MouseEvent e) { 368 374 startDrag(e.getX(), e.getY()); 369 375 } 376 @Override 370 377 public void mouseReleased(MouseEvent e) { 371 378 finishDrag(e.getX(), e.getY()); 372 379 } 380 @Override 373 381 public void mouseDragged(MouseEvent e) { 374 382 updateDrag(e.getX(), e.getY()); 375 383 } 384 @Override 376 385 public void keyPressed(KeyEvent e) { 377 386 if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { 378 387 cancelDrag(); 379 388 } 380 389 } 390 @Override 381 391 public void keyReleased(KeyEvent e) { } 392 @Override 382 393 public void keyTyped(KeyEvent e) { } 383 394 } 384 395 396 @Override 385 397 public AccessibleContext getAccessibleContext() { 386 398 if( accessibleContext == null ) { 387 399 accessibleContext = new AccessibleMultiSplitPane(); … … 390 402 } 391 403 392 404 protected class AccessibleMultiSplitPane extends AccessibleJPanel { 405 @Override 393 406 public AccessibleRole getAccessibleRole() { 394 407 return AccessibleRole.SPLIT_PANE; 395 408 } -
src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java
41 41 /** 42 42 * Adapter method supporting the ListCellRenderer interface. 43 43 */ 44 @Override 44 45 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 45 46 Component def = defaultListCellRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 46 47 return renderer(def, (OsmPrimitive) value); … … 49 50 /** 50 51 * Adapter method supporting the TableCellRenderer interface. 51 52 */ 53 @Override 52 54 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 53 55 Component def = defaultTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 54 56 if (value instanceof OsmPrimitive) -
src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
66 66 setCustomText(""); 67 67 setLocationRelativeTo(getParent()); 68 68 addComponentListener(new ComponentListener() { 69 @Override 69 70 public void componentHidden(ComponentEvent e) {} 71 @Override 70 72 public void componentMoved(ComponentEvent e) {} 73 @Override 71 74 public void componentShown(ComponentEvent e) {} 75 @Override 72 76 public void componentResized(ComponentEvent ev) { 73 77 int w = getWidth(); 74 78 if(w > 200) { … … 87 91 initDialog(); 88 92 } 89 93 94 @Override 90 95 public void setIndeterminate(boolean newValue) { 91 96 UIManager.put("ProgressBar.cycleTime", UIManager.getInt("ProgressBar.repaintInterval") * 100); 92 97 progressBar.setIndeterminate(newValue); … … 103 108 * Sets a custom text line below currentAction. Can be used to display additional information 104 109 * @param text 105 110 */ 111 @Override 106 112 public void setCustomText(String text) { 107 113 if(text == null || text.trim().length() == 0) { 108 114 customText.setVisible(false); … … 116 122 } 117 123 } 118 124 125 @Override 119 126 public void setCurrentAction(String text) { 120 127 currentAction.setText(text); 121 128 } … … 126 133 * 127 134 * @param message the message to append to the log. Ignore if null or white space only. 128 135 */ 136 @Override 129 137 public void appendLogMessage(String message) { 130 138 if (message == null || message.trim().length() ==0 ) 131 139 return; -
src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java
85 85 finish(); 86 86 } else { 87 87 EventQueue.invokeAndWait(new Runnable() { 88 @Override 88 89 public void run() { 89 90 finish(); 90 91 } … … 102 103 afterFinish(); 103 104 } else { 104 105 EventQueue.invokeAndWait(new Runnable() { 106 @Override 105 107 public void run() { 106 108 afterFinish(); 107 109 } … … 112 114 if (!ignoreException) { 113 115 // Exception has to thrown in EDT to be shown to user 114 116 SwingUtilities.invokeLater(new Runnable() { 117 @Override 115 118 public void run() { 116 119 if (e instanceof RuntimeException) { 117 120 BugReportExceptionHandler.handleException(e); … … 131 134 132 135 } 133 136 137 @Override 134 138 public final void run() { 135 139 if (canceled) 136 140 return; // since realRun isn't executed, do not call to finish 137 141 138 142 if (EventQueue.isDispatchThread()) { 139 143 new Thread(new Runnable() { 144 @Override 140 145 public void run() { 141 146 doRealRun(); 142 147 } … … 146 151 } 147 152 } 148 153 154 @Override 149 155 public void operationCanceled() { 150 156 cancel(); 151 157 } -
src/org/openstreetmap/josm/gui/QuadStateCheckBox.java
40 40 // Reset the keyboard action map 41 41 ActionMap map = new ActionMapUIResource(); 42 42 map.put("pressed", new AbstractAction() { 43 @Override 43 44 public void actionPerformed(ActionEvent e) { 44 45 grabFocus(); 45 46 model.nextState(); … … 134 135 } 135 136 } 136 137 /** Filter: No one may change the armed/selected/pressed status except us. */ 138 @Override 137 139 public void setArmed(boolean b) { } 140 @Override 138 141 public void setSelected(boolean b) { } 142 @Override 139 143 public void setPressed(boolean b) { } 140 144 /** We disable focusing on the component when it is not 141 145 * enabled. */ 146 @Override 142 147 public void setEnabled(boolean b) { 143 148 setFocusable(b); 144 149 other.setEnabled(b); 145 150 } 146 151 /** All these methods simply delegate to the "other" model 147 152 * that is being decorated. */ 153 @Override 148 154 public boolean isArmed() { return other.isArmed(); } 155 @Override 149 156 public boolean isSelected() { return other.isSelected(); } 157 @Override 150 158 public boolean isEnabled() { return other.isEnabled(); } 159 @Override 151 160 public boolean isPressed() { return other.isPressed(); } 161 @Override 152 162 public boolean isRollover() { return other.isRollover(); } 163 @Override 153 164 public void setRollover(boolean b) { other.setRollover(b); } 165 @Override 154 166 public void setMnemonic(int key) { other.setMnemonic(key); } 167 @Override 155 168 public int getMnemonic() { return other.getMnemonic(); } 169 @Override 156 170 public void setActionCommand(String s) { 157 171 other.setActionCommand(s); 158 172 } 173 @Override 159 174 public String getActionCommand() { 160 175 return other.getActionCommand(); 161 176 } 177 @Override 162 178 public void setGroup(ButtonGroup group) { 163 179 other.setGroup(group); 164 180 } 181 @Override 165 182 public void addActionListener(ActionListener l) { 166 183 other.addActionListener(l); 167 184 } 185 @Override 168 186 public void removeActionListener(ActionListener l) { 169 187 other.removeActionListener(l); 170 188 } 189 @Override 171 190 public void addItemListener(ItemListener l) { 172 191 other.addItemListener(l); 173 192 } 193 @Override 174 194 public void removeItemListener(ItemListener l) { 175 195 other.removeItemListener(l); 176 196 } 197 @Override 177 198 public void addChangeListener(ChangeListener l) { 178 199 other.addChangeListener(l); 179 200 } 201 @Override 180 202 public void removeChangeListener(ChangeListener l) { 181 203 other.removeChangeListener(l); 182 204 } 205 @Override 183 206 public Object[] getSelectedObjects() { 184 207 return other.getSelectedObjects(); 185 208 } -
src/org/openstreetmap/josm/gui/ScrollViewport.java
69 69 private List<JButton> buttons = new ArrayList<JButton>(); 70 70 71 71 private Timer timer = new Timer(100, new ActionListener() { 72 @Override 72 73 public void actionPerformed(ActionEvent arg0) { 73 74 ScrollViewport.this.scroll(); 74 75 } -
src/org/openstreetmap/josm/gui/SelectionManager.java
122 122 eventSource.addMouseMotionListener(this); 123 123 selectionEndedListener.addPropertyChangeListener(this); 124 124 eventSource.addPropertyChangeListener("scale", new PropertyChangeListener(){ 125 @Override 125 126 public void propertyChange(PropertyChangeEvent evt) { 126 127 if (mousePosStart != null) { 127 128 paintRect(); … … 145 146 /** 146 147 * If the correct button, from the "drawing rectangle" mode 147 148 */ 149 @Override 148 150 public void mousePressed(MouseEvent e) { 149 151 if (e.getButton() == MouseEvent.BUTTON1) { 150 152 mousePosStart = mousePos = e.getPoint(); … … 157 159 /** 158 160 * If the correct button is hold, draw the rectangle. 159 161 */ 162 @Override 160 163 public void mouseDragged(MouseEvent e) { 161 164 int buttonPressed = e.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); 162 165 … … 187 190 /** 188 191 * Check the state of the keys and buttons and set the selection accordingly. 189 192 */ 193 @Override 190 194 public void mouseReleased(MouseEvent e) { 191 195 if (e.getButton() != MouseEvent.BUTTON1) 192 196 return; … … 272 276 /** 273 277 * If the action goes inactive, remove the selection rectangle from screen 274 278 */ 279 @Override 275 280 public void propertyChange(PropertyChangeEvent evt) { 276 281 if (evt.getPropertyName().equals("active") && !(Boolean)evt.getNewValue() && mousePosStart != null) { 277 282 paintRect(); … … 361 366 this.lassoMode = lassoMode; 362 367 } 363 368 369 @Override 364 370 public void mouseClicked(MouseEvent e) {} 371 @Override 365 372 public void mouseEntered(MouseEvent e) {} 373 @Override 366 374 public void mouseExited(MouseEvent e) {} 375 @Override 367 376 public void mouseMoved(MouseEvent e) {} 368 377 } -
src/org/openstreetmap/josm/gui/SplashScreen.java
153 153 build(); 154 154 } 155 155 156 @Override 156 157 public void setCustomText(String message) { 157 158 if(message.isEmpty()) 158 159 message = " "; /* prevent killing of additional line */ … … 160 161 repaint(); 161 162 } 162 163 164 @Override 163 165 public void setIndeterminate(boolean indeterminate) { 164 166 progressBar.setIndeterminate(indeterminate); 165 167 repaint(); 166 168 } 167 169 170 @Override 168 171 public void setMaximum(int maximum) { 169 172 progressBar.setMaximum(maximum); 170 173 repaint(); … … 178 181 * Stores and displays the {@code MAX_NUMBER_OF_MESSAGES} most recent 179 182 * task titles together with their execution time. 180 183 */ 184 @Override 181 185 public void setTaskTitle(String taskTitle) { 182 186 183 187 while (messages.size() >= MAX_NUMBER_OF_MESSAGES) { … … 206 210 repaint(); 207 211 } 208 212 213 @Override 209 214 public void setValue(int value) { 210 215 progressBar.setValue(value); 211 216 repaint(); -
src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java
174 174 super.setVisible(visible); 175 175 } 176 176 177 @Override 177 178 public void tableChanged(TableModelEvent e) { 178 179 updateMessage(); 179 180 updateTitle(); … … 204 205 data, 205 206 new Comparator<RelationToChildReference>() { 206 207 private NameFormatter nf = DefaultNameFormatter.getInstance(); 208 @Override 207 209 public int compare(RelationToChildReference o1, RelationToChildReference o2) { 208 210 int cmp = o1.getChild().getDisplayName(nf).compareTo(o2.getChild().getDisplayName(nf)); 209 211 if (cmp != 0) return cmp; … … 321 323 putValue(SHORT_DESCRIPTION, tr("Click to close the dialog and remove the object from the relations")); 322 324 } 323 325 326 @Override 324 327 public void actionPerformed(ActionEvent e) { 325 328 setCanceled(false); 326 329 setVisible(false); … … 334 337 putValue(SHORT_DESCRIPTION, tr("Click to close the dialog and to abort deleting the objects")); 335 338 } 336 339 340 @Override 337 341 public void actionPerformed(ActionEvent e) { 338 342 setCanceled(true); 339 343 setVisible(false); -
src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
339 339 PROP_MAPSTYLE.put(tileSource.getName()); // TODO Is name really unique? 340 340 } 341 341 342 @Override 342 343 public Bounds getBoundingBox() { 343 344 return bbox; 344 345 } … … 349 350 * 350 351 * @param bbox the bounding box. null to reset the bounding box 351 352 */ 353 @Override 352 354 public void setBoundingBox(Bounds bbox) { 353 355 if (bbox == null || (bbox.getMin().lat() == 0.0 && bbox.getMin().lon() == 0.0 354 356 && bbox.getMax().lat() == 0.0 && bbox.getMax().lon() == 0.0)) { -
src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
189 189 this.direction = direction; 190 190 } 191 191 192 @Override 192 193 public void actionPerformed(ActionEvent e) { 193 194 moveTask.setDirectionX(direction); 194 195 } … … 202 203 this.direction = direction; 203 204 } 204 205 206 @Override 205 207 public void actionPerformed(ActionEvent e) { 206 208 moveTask.setDirectionY(direction); 207 209 } … … 312 314 313 315 private class ZoomInAction extends AbstractAction { 314 316 317 @Override 315 318 public void actionPerformed(ActionEvent e) { 316 319 iSlippyMapChooser.zoomIn(); 317 320 } … … 319 322 320 323 private class ZoomOutAction extends AbstractAction { 321 324 325 @Override 322 326 public void actionPerformed(ActionEvent e) { 323 327 iSlippyMapChooser.zoomOut(); 324 328 } -
src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
133 133 * Replies the current bounding box. null, if no valid bounding box is currently selected. 134 134 * 135 135 */ 136 @Override 136 137 public Bounds getBoundingBox() { 137 138 return bbox; 138 139 } … … 142 143 * 143 144 * @param bbox the bounding box. null, if this widget isn't initialized with a bounding box 144 145 */ 146 @Override 145 147 public void setBoundingBox(Bounds bbox) { 146 148 pnlTileGrid.initFromBoundingBox(bbox); 147 149 } … … 195 197 * property change events for {@link BBoxChooser#BBOX_PROP} 196 198 */ 197 199 class TileBoundsChangeListener implements PropertyChangeListener { 200 @Override 198 201 public void propertyChange(PropertyChangeEvent evt) { 199 202 if (!evt.getPropertyName().equals(TileGridInputPanel.TILE_BOUNDS_PROP)) return; 200 203 TileBounds tb = (TileBounds)evt.getNewValue(); … … 370 373 spZoomLevel.setValue(tileBounds.zoomLevel); 371 374 } 372 375 376 @Override 373 377 public void propertyChange(PropertyChangeEvent evt) { 374 378 if (evt.getPropertyName().equals(TileAddressInputPanel.TILE_BOUNDS_PROP)) { 375 379 TileBounds tb = (TileBounds)evt.getNewValue(); … … 384 388 } 385 389 386 390 class ZomeLevelChangeHandler implements ChangeListener { 391 @Override 387 392 public void stateChanged(ChangeEvent e) { 388 393 int zoomLevel = (Integer)spZoomLevel.getValue(); 389 394 valMaxX.setZoomLevel(zoomLevel); … … 409 414 fireTileBoundsChanged(tb); 410 415 } 411 416 417 @Override 412 418 public void focusGained(FocusEvent e) {/* irrelevant */} 413 419 420 @Override 414 421 public void focusLost(FocusEvent e) { 415 422 buildTileBounds(); 416 423 } 417 424 425 @Override 418 426 public void actionPerformed(ActionEvent e) { 419 427 buildTileBounds(); 420 428 } 421 429 430 @Override 422 431 public void stateChanged(ChangeEvent e) { 423 432 buildTileBounds(); 424 433 } … … 505 514 putValue(SHORT_DESCRIPTION, tr("Apply the tile address")); 506 515 } 507 516 517 @Override 508 518 public void actionPerformed(ActionEvent e) { 509 519 TileBounds tb = valTileAddress.getTileBounds(); 510 520 if (tb != null) { -
src/org/openstreetmap/josm/gui/conflict/pair/ComparePairListCellRenderer.java
13 13 public ComparePairListCellRenderer() { 14 14 setOpaque(true); 15 15 } 16 @Override 16 17 public Component getListCellRendererComponent( 17 18 JList list, 18 19 Object value, -
src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java
167 167 * @see ListMergeModel 168 168 * @see PropertiesMergeModel 169 169 */ 170 @Override 170 171 public void propertyChange(PropertyChangeEvent evt) { 171 172 if (evt.getPropertyName().equals(TagMergeModel.PROP_NUM_UNDECIDED_TAGS)) { 172 173 int newValue = (Integer)evt.getNewValue(); -
src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
841 841 selectedIdx = 0; 842 842 } 843 843 844 @Override 844 845 public Object getElementAt(int index) { 845 846 if (index < compareModes.size()) 846 847 return compareModes.get(index); 847 848 throw new IllegalArgumentException(tr("Unexpected value of parameter ''index''. Got {0}.", index)); 848 849 } 849 850 851 @Override 850 852 public int getSize() { 851 853 return compareModes.size(); 852 854 } 853 855 856 @Override 854 857 public Object getSelectedItem() { 855 858 return compareModes.get(selectedIdx); 856 859 } 857 860 861 @Override 858 862 public void setSelectedItem(Object anItem) { 859 863 int i = compareModes.indexOf(anItem); 860 864 if (i < 0) -
src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
436 436 setEnabled(false); 437 437 } 438 438 439 @Override 439 440 public void actionPerformed(ActionEvent arg0) { 440 441 int [] rows = myEntriesTable.getSelectedRows(); 441 442 model.copyMyToTop(rows); 442 443 } 443 444 445 @Override 444 446 public void valueChanged(ListSelectionEvent e) { 445 447 setEnabled(!myEntriesTable.getSelectionModel().isSelectionEmpty()); 446 448 } … … 463 465 setEnabled(false); 464 466 } 465 467 468 @Override 466 469 public void actionPerformed(ActionEvent arg0) { 467 470 int [] rows = myEntriesTable.getSelectedRows(); 468 471 model.copyMyToEnd(rows); 469 472 } 470 473 474 @Override 471 475 public void valueChanged(ListSelectionEvent e) { 472 476 setEnabled(!myEntriesTable.getSelectionModel().isSelectionEmpty()); 473 477 } … … 490 494 setEnabled(false); 491 495 } 492 496 497 @Override 493 498 public void actionPerformed(ActionEvent arg0) { 494 499 int [] myRows = myEntriesTable.getSelectedRows(); 495 500 int [] mergedRows = mergedEntriesTable.getSelectedRows(); … … 499 504 model.copyMyBeforeCurrent(myRows, current); 500 505 } 501 506 507 @Override 502 508 public void valueChanged(ListSelectionEvent e) { 503 509 setEnabled( 504 510 !myEntriesTable.getSelectionModel().isSelectionEmpty() … … 524 530 setEnabled(false); 525 531 } 526 532 533 @Override 527 534 public void actionPerformed(ActionEvent arg0) { 528 535 int [] myRows = myEntriesTable.getSelectedRows(); 529 536 int [] mergedRows = mergedEntriesTable.getSelectedRows(); … … 533 540 model.copyMyAfterCurrent(myRows, current); 534 541 } 535 542 543 @Override 536 544 public void valueChanged(ListSelectionEvent e) { 537 545 setEnabled( 538 546 !myEntriesTable.getSelectionModel().isSelectionEmpty() … … 553 561 setEnabled(false); 554 562 } 555 563 564 @Override 556 565 public void actionPerformed(ActionEvent arg0) { 557 566 int [] rows = theirEntriesTable.getSelectedRows(); 558 567 model.copyTheirToTop(rows); 559 568 } 560 569 570 @Override 561 571 public void valueChanged(ListSelectionEvent e) { 562 572 setEnabled(!theirEntriesTable.getSelectionModel().isSelectionEmpty()); 563 573 } … … 575 585 setEnabled(false); 576 586 } 577 587 588 @Override 578 589 public void actionPerformed(ActionEvent arg0) { 579 590 int [] rows = theirEntriesTable.getSelectedRows(); 580 591 model.copyTheirToEnd(rows); 581 592 } 582 593 594 @Override 583 595 public void valueChanged(ListSelectionEvent e) { 584 596 setEnabled(!theirEntriesTable.getSelectionModel().isSelectionEmpty()); 585 597 } … … 597 609 setEnabled(false); 598 610 } 599 611 612 @Override 600 613 public void actionPerformed(ActionEvent arg0) { 601 614 int [] myRows = theirEntriesTable.getSelectedRows(); 602 615 int [] mergedRows = mergedEntriesTable.getSelectedRows(); … … 606 619 model.copyTheirBeforeCurrent(myRows, current); 607 620 } 608 621 622 @Override 609 623 public void valueChanged(ListSelectionEvent e) { 610 624 setEnabled( 611 625 !theirEntriesTable.getSelectionModel().isSelectionEmpty() … … 626 640 setEnabled(false); 627 641 } 628 642 643 @Override 629 644 public void actionPerformed(ActionEvent arg0) { 630 645 int [] myRows = theirEntriesTable.getSelectedRows(); 631 646 int [] mergedRows = mergedEntriesTable.getSelectedRows(); … … 635 650 model.copyTheirAfterCurrent(myRows, current); 636 651 } 637 652 653 @Override 638 654 public void valueChanged(ListSelectionEvent e) { 639 655 setEnabled( 640 656 !theirEntriesTable.getSelectionModel().isSelectionEmpty() … … 651 667 putValue(Action.SHORT_DESCRIPTION, tr("Copy all my elements to the target")); 652 668 } 653 669 670 @Override 654 671 public void actionPerformed(ActionEvent arg0) { 655 672 model.copyAll(ListRole.MY_ENTRIES); 656 673 model.setFrozen(true); … … 660 677 setEnabled(model.getMergedEntries().isEmpty() && !model.isFrozen()); 661 678 } 662 679 680 @Override 663 681 public void update(Observable o, Object arg) { 664 682 updateEnabledState(); 665 683 } 666 684 685 @Override 667 686 public void propertyChange(PropertyChangeEvent evt) { 668 687 updateEnabledState(); 669 688 } … … 677 696 putValue(Action.SHORT_DESCRIPTION, tr("Copy all their elements to the target")); 678 697 } 679 698 699 @Override 680 700 public void actionPerformed(ActionEvent arg0) { 681 701 model.copyAll(ListRole.THEIR_ENTRIES); 682 702 model.setFrozen(true); … … 686 706 setEnabled(model.getMergedEntries().isEmpty() && !model.isFrozen()); 687 707 } 688 708 709 @Override 689 710 public void update(Observable o, Object arg) { 690 711 updateEnabledState(); 691 712 } 692 713 714 @Override 693 715 public void propertyChange(PropertyChangeEvent evt) { 694 716 updateEnabledState(); 695 717 } … … 707 729 setEnabled(false); 708 730 } 709 731 732 @Override 710 733 public void actionPerformed(ActionEvent arg0) { 711 734 int [] rows = mergedEntriesTable.getSelectedRows(); 712 735 model.moveUpMerged(rows); 713 736 } 714 737 738 @Override 715 739 public void valueChanged(ListSelectionEvent e) { 716 740 int [] rows = mergedEntriesTable.getSelectedRows(); 717 741 setEnabled( … … 739 763 setEnabled(false); 740 764 } 741 765 766 @Override 742 767 public void actionPerformed(ActionEvent arg0) { 743 768 int [] rows = mergedEntriesTable.getSelectedRows(); 744 769 model.moveDownMerged(rows); 745 770 } 746 771 772 @Override 747 773 public void valueChanged(ListSelectionEvent e) { 748 774 int [] rows = mergedEntriesTable.getSelectedRows(); 749 775 setEnabled( … … 771 797 setEnabled(false); 772 798 } 773 799 800 @Override 774 801 public void actionPerformed(ActionEvent arg0) { 775 802 int [] rows = mergedEntriesTable.getSelectedRows(); 776 803 model.removeMerged(rows); 777 804 } 778 805 806 @Override 779 807 public void valueChanged(ListSelectionEvent e) { 780 808 int [] rows = mergedEntriesTable.getSelectedRows(); 781 809 setEnabled( … … 802 830 setEnabled(true); 803 831 } 804 832 833 @Override 805 834 public void actionPerformed(ActionEvent arg0) { 806 835 // do nothing 807 836 } … … 817 846 btn.addItemListener(this); 818 847 addPropertyChangeListener( 819 848 new PropertyChangeListener() { 849 @Override 820 850 public void propertyChange(PropertyChangeEvent evt) { 821 851 if (evt.getPropertyName().equals(PROP_SELECTED)) { 822 852 btn.setSelected((Boolean)evt.getNewValue()); … … 826 856 ); 827 857 } 828 858 859 @Override 829 860 public void itemStateChanged(ItemEvent e) { 830 861 int state = e.getStateChange(); 831 862 if (state == ItemEvent.SELECTED) { … … 866 897 } 867 898 } 868 899 900 @Override 869 901 public void propertyChange(PropertyChangeEvent evt) { 870 902 if (evt.getPropertyName().equals(ListMergeModel.FROZEN_PROP)) { 871 903 handlePropertyChangeFrozen((Boolean)evt.getOldValue(), (Boolean)evt.getNewValue()); … … 876 908 return model; 877 909 } 878 910 911 @Override 879 912 public void update(Observable o, Object arg) { 880 913 lblMyVersion.setText( 881 914 trn("My version ({0} entry)", "My version ({0} entries)", model.getMyEntriesSize(), model.getMyEntriesSize()) … … 934 967 * event handler for {@link AdjustmentEvent}s 935 968 * 936 969 */ 970 @Override 937 971 public void adjustmentValueChanged(AdjustmentEvent e) { 938 972 if (! enabledMap.get(e.getAdjustable())) 939 973 return; … … 1000 1034 // register an item lister with the check box 1001 1035 // 1002 1036 view.addItemListener(new ItemListener() { 1037 @Override 1003 1038 public void itemStateChanged(ItemEvent e) { 1004 1039 switch(e.getStateChange()) { 1005 1040 case ItemEvent.SELECTED: … … 1018 1053 1019 1054 observable.addObserver( 1020 1055 new Observer() { 1056 @Override 1021 1057 public void update(Observable o, Object arg) { 1022 1058 boolean sync = isParticipatingInSynchronizedScrolling(adjustable); 1023 1059 if (view.isSelected() != sync) { -
src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMerger.java
52 52 return embeddInScrollPane(theirEntriesTable); 53 53 } 54 54 55 @Override 55 56 public void populate(Conflict<? extends OsmPrimitive> conflict) { 56 57 Way myWay = (Way)conflict.getMy(); 57 58 Way theirWay = (Way)conflict.getTheir(); … … 60 61 theirEntriesTable.setLayer(findLayerFor(theirWay)); 61 62 } 62 63 64 @Override 63 65 public void deletePrimitive(boolean deleted) { 64 66 if (deleted) { 65 67 model.setFrozen(true); -
src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java
150 150 setText(Integer.toString(row+1)); 151 151 } 152 152 153 @Override 153 154 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 154 155 int row, int column) { 155 156 -
src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java
380 380 lblTheirReferrers.setBackground(ConflictColors.BGCOLOR_NO_CONFLICT.get()); 381 381 } 382 382 383 @Override 383 384 public void update(Observable o, Object arg) { 384 385 updateCoordinates(); 385 386 updateDeletedState(); … … 396 397 putValue(Action.SHORT_DESCRIPTION, tr("Keep my coordinates")); 397 398 } 398 399 400 @Override 399 401 public void actionPerformed(ActionEvent e) { 400 402 model.decideCoordsConflict(MergeDecisionType.KEEP_MINE); 401 403 } 402 404 405 @Override 403 406 public void update(Observable o, Object arg) { 404 407 setEnabled(model.hasCoordConflict() && ! model.isDecidedCoord()); 405 408 } … … 411 414 putValue(Action.SHORT_DESCRIPTION, tr("Keep their coordinates")); 412 415 } 413 416 417 @Override 414 418 public void actionPerformed(ActionEvent e) { 415 419 model.decideCoordsConflict(MergeDecisionType.KEEP_THEIR); 416 420 } 417 421 422 @Override 418 423 public void update(Observable o, Object arg) { 419 424 setEnabled(model.hasCoordConflict() && ! model.isDecidedCoord()); 420 425 } … … 426 431 putValue(Action.SHORT_DESCRIPTION, tr("Undecide conflict between different coordinates")); 427 432 } 428 433 434 @Override 429 435 public void actionPerformed(ActionEvent e) { 430 436 model.decideCoordsConflict(MergeDecisionType.UNDECIDED); 431 437 } 432 438 439 @Override 433 440 public void update(Observable o, Object arg) { 434 441 setEnabled(model.hasCoordConflict() && model.isDecidedCoord()); 435 442 } … … 441 448 putValue(Action.SHORT_DESCRIPTION, tr("Keep my deleted state")); 442 449 } 443 450 451 @Override 444 452 public void actionPerformed(ActionEvent e) { 445 453 model.decideDeletedStateConflict(MergeDecisionType.KEEP_MINE); 446 454 } 447 455 456 @Override 448 457 public void update(Observable o, Object arg) { 449 458 setEnabled(model.hasDeletedStateConflict() && ! model.isDecidedDeletedState()); 450 459 } … … 456 465 putValue(Action.SHORT_DESCRIPTION, tr("Keep their deleted state")); 457 466 } 458 467 468 @Override 459 469 public void actionPerformed(ActionEvent e) { 460 470 model.decideDeletedStateConflict(MergeDecisionType.KEEP_THEIR); 461 471 } 462 472 473 @Override 463 474 public void update(Observable o, Object arg) { 464 475 setEnabled(model.hasDeletedStateConflict() && ! model.isDecidedDeletedState()); 465 476 } … … 471 482 putValue(Action.SHORT_DESCRIPTION, tr("Undecide conflict between deleted state")); 472 483 } 473 484 485 @Override 474 486 public void actionPerformed(ActionEvent e) { 475 487 model.decideDeletedStateConflict(MergeDecisionType.UNDECIDED); 476 488 } 477 489 490 @Override 478 491 public void update(Observable o, Object arg) { 479 492 setEnabled(model.hasDeletedStateConflict() && model.isDecidedDeletedState()); 480 493 } 481 494 } 482 495 496 @Override 483 497 public void deletePrimitive(boolean deleted) { 484 498 if (deleted) { 485 499 if (model.getMergedCoords() == null) { … … 490 504 } 491 505 } 492 506 507 @Override 493 508 public void populate(Conflict<? extends OsmPrimitive> conflict) { 494 509 model.populate(conflict); 495 510 } -
src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMerger.java
48 48 return embeddInScrollPane(theirEntriesTable); 49 49 } 50 50 51 @Override 51 52 public void populate(Conflict<? extends OsmPrimitive> conflict) { 52 53 Relation myRel = (Relation)conflict.getMy(); 53 54 Relation theirRel = (Relation)conflict.getTheir(); … … 60 61 super(new RelationMemberListMergeModel()); 61 62 } 62 63 64 @Override 63 65 public void deletePrimitive(boolean deleted) { 64 66 if (deleted) { 65 67 model.clearMerged(); -
src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java
36 36 ); 37 37 } 38 38 39 @Override 39 40 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 40 41 // Do not edit empty or incomplete members ! (fix #5374 and #6315) 41 42 if (value == null) … … 48 49 return editor; 49 50 } 50 51 52 @Override 51 53 public Object getCellEditorValue() { 52 54 return editor.getText(); 53 55 } -
src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRenderer.java
146 146 setText(""); 147 147 } 148 148 149 @Override 149 150 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 150 151 int row, int column) { 151 152 -
src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeTableCellRenderer.java
22 22 setForeground(ConflictColors.FGCOLOR.get()); 23 23 } 24 24 25 @Override 25 26 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, 26 27 int col) { 27 28 -
src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java
279 279 setEnabled(false); 280 280 } 281 281 282 @Override 282 283 public void actionPerformed(ActionEvent arg0) { 283 284 int rows[] = mineTable.getSelectedRows(); 284 285 if (rows == null || rows.length == 0) … … 287 288 selectNextConflict(rows); 288 289 } 289 290 291 @Override 290 292 public void valueChanged(ListSelectionEvent e) { 291 293 setEnabled(mineTable.getSelectedRowCount() > 0); 292 294 } … … 309 311 setEnabled(false); 310 312 } 311 313 314 @Override 312 315 public void actionPerformed(ActionEvent arg0) { 313 316 int rows[] = theirTable.getSelectedRows(); 314 317 if (rows == null || rows.length == 0) … … 317 320 selectNextConflict(rows); 318 321 } 319 322 323 @Override 320 324 public void valueChanged(ListSelectionEvent e) { 321 325 setEnabled(theirTable.getSelectedRowCount() > 0); 322 326 } … … 345 349 adjustable.addAdjustmentListener(this); 346 350 } 347 351 352 @Override 348 353 public void adjustmentValueChanged(AdjustmentEvent e) { 349 354 for (Adjustable a : synchronizedAdjustables) { 350 355 if (a != e.getAdjustable()) { … … 404 409 setEnabled(false); 405 410 } 406 411 412 @Override 407 413 public void actionPerformed(ActionEvent arg0) { 408 414 int rows[] = mergedTable.getSelectedRows(); 409 415 if (rows == null || rows.length == 0) … … 411 417 model.decide(rows, MergeDecisionType.UNDECIDED); 412 418 } 413 419 420 @Override 414 421 public void valueChanged(ListSelectionEvent e) { 415 422 setEnabled(mergedTable.getSelectedRowCount() > 0); 416 423 } 417 424 } 418 425 426 @Override 419 427 public void deletePrimitive(boolean deleted) { 420 428 // Use my entries, as it doesn't really matter 421 429 MergeDecisionType decision = deleted?MergeDecisionType.KEEP_MINE:MergeDecisionType.UNDECIDED; … … 424 432 } 425 433 } 426 434 435 @Override 427 436 public void populate(Conflict<? extends OsmPrimitive> conflict) { 428 437 model.populate(conflict.getMy(), conflict.getTheir()); 429 438 for (JTable table : new JTable[]{mineTable, theirTable}) { -
src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
388 388 setEnabled(true); 389 389 } 390 390 391 @Override 391 392 public void actionPerformed(ActionEvent arg0) { 392 393 setCanceled(true); 393 394 setVisible(false); … … 403 404 updateEnabledState(); 404 405 } 405 406 407 @Override 406 408 public void actionPerformed(ActionEvent arg0) { 407 409 setVisible(false); 408 410 pnlTagConflictResolver.rememberPreferences(); … … 413 415 && pnlRelationMemberConflictResolver.getModel().getNumConflicts() == 0); 414 416 } 415 417 418 @Override 416 419 public void propertyChange(PropertyChangeEvent evt) { 417 420 if (evt.getPropertyName().equals(TagConflictResolverModel.NUM_CONFLICTS_PROP)) { 418 421 updateEnabledState(); … … 443 446 addHierarchyBoundsListener(this); 444 447 } 445 448 449 @Override 446 450 public void ancestorResized(HierarchyEvent e) { 447 451 setDividerLocation((int) (dividerLocation * getHeight())); 448 452 } 449 453 454 @Override 450 455 public void ancestorMoved(HierarchyEvent e) { 451 456 // do nothing 452 457 } 453 458 459 @Override 454 460 public void propertyChange(PropertyChangeEvent evt) { 455 461 if (evt.getPropertyName().equals(JSplitPane.DIVIDER_LOCATION_PROPERTY)) { 456 462 int newVal = (Integer) evt.getNewValue(); -
src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
128 128 } 129 129 } 130 130 131 @Override 131 132 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 132 133 MultiValueResolutionDecision decision = (MultiValueResolutionDecision)value; 133 134 initEditor(decision); … … 135 136 return editor; 136 137 } 137 138 139 @Override 138 140 public Object getCellEditorValue() { 139 141 return editor.getSelectedItem(); 140 142 } … … 179 181 } 180 182 } 181 183 184 @Override 182 185 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 183 186 boolean cellHasFocus) { 184 187 renderColors(isSelected); -
src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRenderer.java
123 123 setText(""); 124 124 } 125 125 126 @Override 126 127 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 127 128 int row, int column) { 128 129 -
src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java
271 271 setEnabled(true); 272 272 } 273 273 274 @Override 274 275 public void actionPerformed(ActionEvent arg0) { 275 276 setVisible(false); 276 277 setCanceled(true); … … 286 287 updateEnabledState(); 287 288 } 288 289 290 @Override 289 291 public void actionPerformed(ActionEvent arg0) { 290 292 setVisible(false); 291 293 } … … 304 306 } 305 307 } 306 308 309 @Override 307 310 public void propertyChange(PropertyChangeEvent evt) { 308 311 if (evt.getPropertyName().equals(TagConflictResolverModel.NUM_CONFLICTS_PROP)) { 309 312 updateEnabledState(); … … 333 336 return resolvers.get(type).getModel().getResolution(); 334 337 } 335 338 339 @Override 336 340 public void propertyChange(PropertyChangeEvent evt) { 337 341 if (evt.getPropertyName().equals(TagConflictResolverModel.NUM_CONFLICTS_PROP)) { 338 342 TagConflictResolverModel model = (TagConflictResolverModel)evt.getSource(); … … 470 474 renderStatistics(info.targetInfo); 471 475 } 472 476 477 @Override 473 478 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, 474 479 boolean hasFocus, int row, int column) { 475 480 reset(); -
src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java
22 22 /* --------------------------------------------------------------------------------- */ 23 23 /* TableCellEditor */ 24 24 /* --------------------------------------------------------------------------------- */ 25 @Override 25 26 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 26 27 setSelectedItem(value); 27 28 this.originalValue = (RelationMemberConflictDecisionType)value; … … 31 32 private TableCellEditorSupport tableCellEditorSupport; 32 33 private RelationMemberConflictDecisionType originalValue; 33 34 35 @Override 34 36 public void addCellEditorListener(CellEditorListener l) { 35 37 tableCellEditorSupport.addCellEditorListener(l); 36 38 } 37 39 40 @Override 38 41 public void cancelCellEditing() { 39 42 setSelectedItem(originalValue); 40 43 tableCellEditorSupport.fireEditingCanceled(); 41 44 } 42 45 46 @Override 43 47 public Object getCellEditorValue() { 44 48 return getSelectedItem(); 45 49 } 46 50 51 @Override 47 52 public boolean isCellEditable(EventObject anEvent) { 48 53 return true; 49 54 } 50 55 56 @Override 51 57 public void removeCellEditorListener(CellEditorListener l) { 52 58 tableCellEditorSupport.removeCellEditorListener(l); 53 59 } 54 60 61 @Override 55 62 public boolean shouldSelectCell(EventObject anEvent) { 56 63 return true; 57 64 } 58 65 66 @Override 59 67 public boolean stopCellEditing() { 60 68 tableCellEditorSupport.fireEditingStopped(); 61 69 return true; -
src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionRenderer.java
39 39 /* --------------------------------------------------------------------------------- */ 40 40 /* TableCellRenderer */ 41 41 /* --------------------------------------------------------------------------------- */ 42 @Override 42 43 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 43 44 int row, int column) { 44 45 resetTableRenderer(); … … 57 58 /* --------------------------------------------------------------------------------- */ 58 59 /* ListCellRenderer */ 59 60 /* --------------------------------------------------------------------------------- */ 61 @Override 60 62 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 61 63 boolean cellHasFocus) { 62 64 resetListRenderer(); -
src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java
147 147 putValue(SHORT_DESCRIPTION, tr("Apply this role to all members")); 148 148 } 149 149 150 @Override 150 151 public void actionPerformed(ActionEvent e) { 151 152 model.applyRole(tfRole.getText()); 152 153 } 153 154 } 154 155 155 156 class ToggleTagRelationsAction implements ChangeListener { 157 @Override 156 158 public void stateChanged(ChangeEvent e) { 157 159 ButtonModel buttonModel = ((AbstractButton) e.getSource()).getModel(); 158 160 tfKey.setEnabled(buttonModel.isSelected()); -
src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTable.java
51 51 * 52 52 */ 53 53 class SelectNextColumnCellAction extends AbstractAction { 54 @Override 54 55 public void actionPerformed(ActionEvent e) { 55 56 run(); 56 57 } … … 81 82 */ 82 83 class SelectPreviousColumnCellAction extends AbstractAction { 83 84 85 @Override 84 86 public void actionPerformed(ActionEvent e) { 85 87 run(); 86 88 } … … 104 106 } 105 107 } 106 108 109 @Override 107 110 public void gotoNextDecision() { 108 111 selectNextColumnCellAction.run(); 109 112 } 110 113 114 @Override 111 115 public void gotoPreviousDecision() { 112 116 selectPreviousColumnCellAction.run(); 113 117 } -
src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java
51 51 pnl.add(cbShowTagsWithMultiValuesOnly = new JCheckBox(tr("Show tags with multiple values only")), gc); 52 52 cbShowTagsWithConflictsOnly.addChangeListener( 53 53 new ChangeListener() { 54 @Override 54 55 public void stateChanged(ChangeEvent e) { 55 56 model.setShowTagsWithConflictsOnly(cbShowTagsWithConflictsOnly.isSelected()); 56 57 cbShowTagsWithMultiValuesOnly.setEnabled(cbShowTagsWithConflictsOnly.isSelected()); … … 62 63 ); 63 64 cbShowTagsWithMultiValuesOnly.addChangeListener( 64 65 new ChangeListener() { 66 @Override 65 67 public void stateChanged(ChangeEvent e) { 66 68 model.setShowTagsWithMultiValuesOnly(cbShowTagsWithMultiValuesOnly.isSelected()); 67 69 } -
src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
64 64 Collections.sort( 65 65 displayedKeys, 66 66 new Comparator<String>() { 67 @Override 67 68 public int compare(String key1, String key2) { 68 69 if (decisions.get(key1).isDecided() && ! decisions.get(key2).isDecided()) 69 70 return 1; -
src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverTable.java
53 53 * 54 54 */ 55 55 class SelectNextColumnCellAction extends AbstractAction { 56 @Override 56 57 public void actionPerformed(ActionEvent e) { 57 58 run(); 58 59 } … … 83 84 */ 84 85 class SelectPreviousColumnCellAction extends AbstractAction { 85 86 87 @Override 86 88 public void actionPerformed(ActionEvent e) { 87 89 run(); 88 90 } … … 106 108 } 107 109 } 108 110 111 @Override 109 112 public void gotoNextDecision() { 110 113 selectNextColumnCellAction.run(); 111 114 } 112 115 116 @Override 113 117 public void gotoPreviousDecision() { 114 118 selectPreviousColumnCellAction.run(); 115 119 } -
src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
267 267 } 268 268 269 269 class FilterChangeHandler implements ItemListener { 270 @Override 270 271 public void itemStateChanged(ItemEvent e) { 271 272 Main.pref.put("changeset-dialog.for-selected-objects-only", cbInSelectionOnly.isSelected()); 272 273 pnlList.removeAll(); … … 304 305 ds.setSelected(sel); 305 306 } 306 307 308 @Override 307 309 public void actionPerformed(ActionEvent e) { 308 310 if (Main.main.getEditLayer() == null) 309 311 return; … … 320 322 setEnabled(getCurrentChangesetList().getSelectedIndices().length > 0); 321 323 } 322 324 325 @Override 323 326 public void itemStateChanged(ItemEvent arg0) { 324 327 updateEnabledState(); 325 328 326 329 } 327 330 331 @Override 328 332 public void valueChanged(ListSelectionEvent e) { 329 333 updateEnabledState(); 330 334 } … … 342 346 updateEnabledState(); 343 347 } 344 348 349 @Override 345 350 public void actionPerformed(ActionEvent arg0) { 346 351 ChangesetListModel model = getCurrentChangesetListModel(); 347 352 Set<Integer> sel = model.getSelectedChangesetIds(); … … 355 360 setEnabled(getCurrentChangesetList().getSelectedIndices().length > 0); 356 361 } 357 362 363 @Override 358 364 public void itemStateChanged(ItemEvent arg0) { 359 365 updateEnabledState(); 360 366 361 367 } 362 368 369 @Override 363 370 public void valueChanged(ListSelectionEvent e) { 364 371 updateEnabledState(); 365 372 } … … 377 384 updateEnabledState(); 378 385 } 379 386 387 @Override 380 388 public void actionPerformed(ActionEvent arg0) { 381 389 List<Changeset> sel = getCurrentChangesetListModel().getSelectedOpenChangesets(); 382 390 if (sel.isEmpty()) … … 388 396 setEnabled(getCurrentChangesetListModel().hasSelectedOpenChangesets()); 389 397 } 390 398 399 @Override 391 400 public void itemStateChanged(ItemEvent arg0) { 392 401 updateEnabledState(); 393 402 } 394 403 404 @Override 395 405 public void valueChanged(ListSelectionEvent e) { 396 406 updateEnabledState(); 397 407 } … … 409 419 updateEnabledState(); 410 420 } 411 421 422 @Override 412 423 public void actionPerformed(ActionEvent arg0) { 413 424 Set<Changeset> sel = getCurrentChangesetListModel().getSelectedChangesets(); 414 425 if (sel.isEmpty()) … … 428 439 setEnabled(getCurrentChangesetList().getSelectedIndices().length > 0); 429 440 } 430 441 442 @Override 431 443 public void itemStateChanged(ItemEvent arg0) { 432 444 updateEnabledState(); 433 445 } 434 446 447 @Override 435 448 public void valueChanged(ListSelectionEvent e) { 436 449 updateEnabledState(); 437 450 } … … 462 475 cm.setSelectedChangesetsById(toSelect); 463 476 } 464 477 478 @Override 465 479 public void actionPerformed(ActionEvent arg0) { 466 480 ChangesetListModel model = getCurrentChangesetListModel(); 467 481 Set<Integer> sel = model.getSelectedChangesetIds(); … … 484 498 } 485 499 486 500 Runnable r = new Runnable() { 501 @Override 487 502 public void run() { 488 503 // first, wait for the download task to finish, if a download 489 504 // task was launched … … 514 529 Main.worker.submit(r); 515 530 } 516 531 532 @Override 517 533 public void itemStateChanged(ItemEvent arg0) { 518 534 } 519 535 536 @Override 520 537 public void valueChanged(ListSelectionEvent e) { 521 538 } 522 539 } -
src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
153 153 this.source = source; 154 154 } 155 155 156 @Override 156 157 public void valueChanged(TreeSelectionEvent e) { 157 158 if (source == undoTree) { 158 159 redoTree.getSelectionModel().removeTreeSelectionListener(redoSelectionListener); … … 181 182 addShowNotifyListener(updater); 182 183 183 184 tree.addTreeSelectionListener(new TreeSelectionListener() { 185 @Override 184 186 public void valueChanged(TreeSelectionEvent e) { 185 187 updater.updateEnabledState(); 186 188 } 187 189 }); 188 190 189 191 tree.getModel().addTreeModelListener(new TreeModelListener() { 192 @Override 190 193 public void treeNodesChanged(TreeModelEvent e) { 191 194 updater.updateEnabledState(); 192 195 } 193 196 197 @Override 194 198 public void treeNodesInserted(TreeModelEvent e) { 195 199 updater.updateEnabledState(); 196 200 } 197 201 202 @Override 198 203 public void treeNodesRemoved(TreeModelEvent e) { 199 204 updater.updateEnabledState(); 200 205 } 201 206 207 @Override 202 208 public void treeStructureChanged(TreeModelEvent e) { 203 209 updater.updateEnabledState(); 204 210 } … … 314 320 FilteredCollection<OsmPrimitive> prims = new FilteredCollection<OsmPrimitive>( 315 321 c.getParticipatingPrimitives(), 316 322 new Predicate<OsmPrimitive>(){ 323 @Override 317 324 public boolean evaluate(OsmPrimitive o) { 318 325 OsmPrimitive p = currentLayer.data.getPrimitiveById(o); 319 326 return p != null && p.isUsable(); … … 323 330 return prims; 324 331 } 325 332 333 @Override 326 334 public void commandChanged(int queueSize, int redoSize) { 327 335 if (!isVisible()) 328 336 return; … … 412 420 } 413 421 } 414 422 423 @Override 415 424 public void actionPerformed(ActionEvent e) { 416 425 lastOperation = type; 417 426 TreePath path = tree.getSelectionPath(); … … 436 445 Main.map.repaint(); 437 446 } 438 447 448 @Override 439 449 public void updateEnabledState() { 440 450 // do not allow execution if nothing is selected or a sub command was selected 441 451 setEnabled(!tree.isSelectionEmpty() && tree.getSelectionPath().getPathCount()==2); -
src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
100 100 lstConflicts.setCellRenderer(new OsmPrimitivRenderer()); 101 101 lstConflicts.addMouseListener(new MouseEventHandler()); 102 102 addListSelectionListener(new ListSelectionListener(){ 103 @Override 103 104 public void valueChanged(ListSelectionEvent e) { 104 105 Main.map.mapView.repaint(); 105 106 } … … 230 231 Visitor conflictPainter = new AbstractVisitor() { 231 232 // Manage a stack of visited relations to avoid infinite recursion with cyclic relations (fix #7938) 232 233 private final Set<Relation> visited = new HashSet<Relation>(); 234 @Override 233 235 public void visit(Node n) { 234 236 Point p = nc.getPoint(n); 235 237 g.drawRect(p.x-1, p.y-1, 2, 2); … … 239 241 Point p2 = nc.getPoint(n2); 240 242 g.drawLine(p1.x, p1.y, p2.x, p2.y); 241 243 } 244 @Override 242 245 public void visit(Way w) { 243 246 Node lastN = null; 244 247 for (Node n : w.getNodes()) { … … 250 253 lastN = n; 251 254 } 252 255 } 256 @Override 253 257 public void visit(Relation e) { 254 258 if (!visited.contains(e)) { 255 259 visited.add(e); … … 271 275 } 272 276 } 273 277 278 @Override 274 279 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 275 280 if (oldLayer != null) { 276 281 oldLayer.getConflicts().removeConflictListener(this); … … 305 310 return conflicts.get(index); 306 311 } 307 312 313 @Override 308 314 public void onConflictsAdded(ConflictCollection conflicts) { 309 315 refreshView(); 310 316 } 311 317 318 @Override 312 319 public void onConflictsRemoved(ConflictCollection conflicts) { 313 320 System.err.println("1 conflict has been resolved."); 314 321 refreshView(); 315 322 } 316 323 324 @Override 317 325 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 318 326 lstConflicts.clearSelection(); 319 327 for (OsmPrimitive osm : newSelection) { … … 354 362 listeners = new CopyOnWriteArrayList<ListDataListener>(); 355 363 } 356 364 365 @Override 357 366 public void addListDataListener(ListDataListener l) { 358 367 if (l != null) { 359 368 listeners.addIfAbsent(l); 360 369 } 361 370 } 362 371 372 @Override 363 373 public void removeListDataListener(ListDataListener l) { 364 374 listeners.remove(l); 365 375 } … … 377 387 } 378 388 } 379 389 390 @Override 380 391 public Object getElementAt(int index) { 381 392 if (index < 0) return null; 382 393 if (index >= getSize()) return null; 383 394 return conflicts.get(index).getMy(); 384 395 } 385 396 397 @Override 386 398 public int getSize() { 387 399 if (conflicts == null) return 0; 388 400 return conflicts.size(); … … 411 423 putValue("help", ht("/Dialog/ConflictList#ResolveAction")); 412 424 } 413 425 426 @Override 414 427 public void actionPerformed(ActionEvent e) { 415 428 resolve(); 416 429 } 417 430 431 @Override 418 432 public void valueChanged(ListSelectionEvent e) { 419 433 ListSelectionModel model = (ListSelectionModel)e.getSource(); 420 434 boolean enabled = model.getMinSelectionIndex() >= 0 … … 431 445 putValue("help", ht("/Dialog/ConflictList#SelectAction")); 432 446 } 433 447 448 @Override 434 449 public void actionPerformed(ActionEvent e) { 435 450 Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>(); 436 451 for (Object o : lstConflicts.getSelectedValues()) { … … 442 457 } 443 458 } 444 459 460 @Override 445 461 public void valueChanged(ListSelectionEvent e) { 446 462 ListSelectionModel model = (ListSelectionModel)e.getSource(); 447 463 boolean enabled = model.getMinSelectionIndex() >= 0 -
src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
142 142 setEnabled(true); 143 143 } 144 144 145 @Override 145 146 public void actionPerformed(ActionEvent arg0) { 146 147 closeDialog(); 147 148 } … … 158 159 setEnabled(true); 159 160 } 160 161 162 @Override 161 163 public void actionPerformed(ActionEvent arg0) { 162 164 HelpBrowser.setUrlForHelpTopic(ht("/Dialog/Conflict")); 163 165 } … … 179 181 setEnabled(resolver.isResolvedCompletely()); 180 182 } 181 183 184 @Override 182 185 public void actionPerformed(ActionEvent arg0) { 183 186 if (! resolver.isResolvedCompletely()) { 184 187 Object[] options = { … … 213 216 closeDialog(); 214 217 } 215 218 219 @Override 216 220 public void propertyChange(PropertyChangeEvent evt) { 217 221 if (evt.getPropertyName().equals(ConflictResolver.RESOLVED_COMPLETELY_PROP)) { 218 222 updateEnabledState(); … … 232 236 } 233 237 } 234 238 239 @Override 235 240 public void propertyChange(PropertyChangeEvent evt) { 236 241 if (evt.getPropertyName().equals(ConflictResolver.MY_PRIMITIVE_PROP)) { 237 242 updateTitle((OsmPrimitive)evt.getNewValue()); -
src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
214 214 215 215 // Toggle filter "enabled" on Enter 216 216 InputMapUtils.addEnterAction(userTable, new AbstractAction() { 217 @Override 217 218 public void actionPerformed(ActionEvent e) { 218 219 int index = userTable.getSelectedRow(); 219 220 if (index<0) return; … … 224 225 225 226 // Toggle filter "hiding" on Spacebar 226 227 InputMapUtils.addSpacebarAction(userTable, new AbstractAction() { 228 @Override 227 229 public void actionPerformed(ActionEvent e) { 228 230 int index = userTable.getSelectedRow(); 229 231 if (index<0) return; … … 255 257 } 256 258 257 259 static class BooleanRenderer extends JCheckBox implements TableCellRenderer { 260 @Override 258 261 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,int row,int column) { 259 262 FilterTableModel model = (FilterTableModel)table.getModel(); 260 263 setSelected(value != null && (Boolean)value); … … 266 269 267 270 public void updateDialogHeader() { 268 271 SwingUtilities.invokeLater(new Runnable() { 272 @Override 269 273 public void run() { 270 274 setTitle(tr("Filter Hidden:{0} Disabled:{1}", filterModel.disabledAndHiddenCount, filterModel.disabledCount)); 271 275 } … … 314 318 return result; 315 319 } 316 320 321 @Override 317 322 public void dataChanged(DataChangedEvent event) { 318 323 filterModel.executeFilters(); 319 324 } 320 325 326 @Override 321 327 public void nodeMoved(NodeMovedEvent event) { 322 328 // Do nothing 323 329 } 324 330 331 @Override 325 332 public void otherDatasetChange(AbstractDatasetChangedEvent event) { 326 333 filterModel.executeFilters(); 327 334 } 328 335 336 @Override 329 337 public void primitivesAdded(PrimitivesAddedEvent event) { 330 338 filterModel.executeFilters(event.getPrimitives()); 331 339 } 332 340 341 @Override 333 342 public void primitivesRemoved(PrimitivesRemovedEvent event) { 334 343 filterModel.executeFilters(); 335 344 } 336 345 346 @Override 337 347 public void relationMembersChanged(RelationMembersChangedEvent event) { 338 348 filterModel.executeFilters(getAffectedPrimitives(event.getPrimitives())); 339 349 } 340 350 351 @Override 341 352 public void tagsChanged(TagsChangedEvent event) { 342 353 filterModel.executeFilters(getAffectedPrimitives(event.getPrimitives())); 343 354 } 344 355 356 @Override 345 357 public void wayNodesChanged(WayNodesChangedEvent event) { 346 358 filterModel.executeFilters(getAffectedPrimitives(event.getPrimitives())); 347 359 } -
src/org/openstreetmap/josm/gui/dialogs/FilterTableModel.java
235 235 return filters.get(i); 236 236 } 237 237 238 @Override 238 239 public int getRowCount() { 239 240 return filters.size(); 240 241 } 241 242 243 @Override 242 244 public int getColumnCount() { 243 245 return 5; 244 246 } … … 305 307 } 306 308 } 307 309 310 @Override 308 311 public Object getValueAt(int row, int column) { 309 312 Filter f = filters.get(row); 310 313 switch (column) { -
src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
133 133 /* ----------------------------------------------------------------------------- */ 134 134 /* interface HistoryDataSetListener */ 135 135 /* ----------------------------------------------------------------------------- */ 136 @Override 136 137 public void historyUpdated(HistoryDataSet source, PrimitiveId primitiveId) { 137 138 model.refresh(); 138 139 } 139 140 141 @Override 140 142 public void historyDataSetCleared(HistoryDataSet source) { 141 143 model.refresh(); 142 144 } … … 206 208 selectPrimitives(selectedPrimitives); 207 209 } 208 210 211 @Override 209 212 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 210 213 data.clear(); 211 214 selectionModel.clearSelection(); … … 267 270 updateEnabledState(); 268 271 } 269 272 273 @Override 270 274 public void actionPerformed(ActionEvent e) { 271 275 int [] rows = historyTable.getSelectedRows(); 272 276 if (rows == null || rows.length == 0) return; … … 281 285 setEnabled(historyTable.getSelectedRowCount() > 0); 282 286 } 283 287 288 @Override 284 289 public void valueChanged(ListSelectionEvent e) { 285 290 updateEnabledState(); 286 291 } … … 307 312 updateEnabledState(); 308 313 } 309 314 315 @Override 310 316 public void actionPerformed(ActionEvent e) { 311 317 int [] rows = historyTable.getSelectedRows(); 312 318 if (rows == null || rows.length == 0) return; … … 317 323 setEnabled(historyTable.getSelectedRowCount() > 0); 318 324 } 319 325 326 @Override 320 327 public void valueChanged(ListSelectionEvent e) { 321 328 updateEnabledState(); 322 329 } -
src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
293 293 } 294 294 295 295 class LatLonInputVerifier implements DocumentListener { 296 @Override 296 297 public void changedUpdate(DocumentEvent e) { 297 298 parseLatLonUserInput(); 298 299 } 299 300 301 @Override 300 302 public void insertUpdate(DocumentEvent e) { 301 303 parseLatLonUserInput(); 302 304 } 303 305 306 @Override 304 307 public void removeUpdate(DocumentEvent e) { 305 308 parseLatLonUserInput(); 306 309 } 307 310 } 308 311 309 312 class EastNorthInputVerifier implements DocumentListener { 313 @Override 310 314 public void changedUpdate(DocumentEvent e) { 311 315 parseEastNorthUserInput(); 312 316 } 313 317 318 @Override 314 319 public void insertUpdate(DocumentEvent e) { 315 320 parseEastNorthUserInput(); 316 321 } 317 322 323 @Override 318 324 public void removeUpdate(DocumentEvent e) { 319 325 parseEastNorthUserInput(); 320 326 } 321 327 } 322 328 323 329 static class TextFieldFocusHandler implements FocusListener { 330 @Override 324 331 public void focusGained(FocusEvent e) { 325 332 Component c = e.getComponent(); 326 333 if (c instanceof JosmTextField) { … … 328 335 tf.selectAll(); 329 336 } 330 337 } 338 @Override 331 339 public void focusLost(FocusEvent e) {} 332 340 } 333 341 -
src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
274 274 275 275 // Activate layer on Enter key press 276 276 InputMapUtils.addEnterAction(layerList, new AbstractAction() { 277 @Override 277 278 public void actionPerformed(ActionEvent e) { 278 279 activateLayerAction.actionPerformed(null); 279 280 layerList.requestFocus(); -
src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java
34 34 putValue("help", ht("/Action/LayerInfo")); 35 35 this.layer = layer; 36 36 } 37 @Override 37 38 public void actionPerformed(ActionEvent e) { 38 39 JOptionPane.showMessageDialog( 39 40 Main.parent, -
src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
118 118 } 119 119 }); 120 120 cbWireframe.addActionListener(new ActionListener() { 121 @Override 121 122 public void actionPerformed(ActionEvent e) { 122 123 Main.main.menu.wireFrameToggleAction.actionPerformed(null); 123 124 } … … 314 315 setVerticalAlignment(SwingConstants.CENTER); 315 316 } 316 317 318 @Override 317 319 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,int row,int column) { 318 320 if (value == null) 319 321 return this; … … 399 401 model.ensureSelectedIsVisible(); 400 402 } 401 403 404 @Override 402 405 public void valueChanged(ListSelectionEvent e) { 403 406 updateEnabledState(); 404 407 } -
src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
234 234 super(name, iconName, tooltip, shortcut, false); 235 235 } 236 236 237 @Override 237 238 public void actionPerformed(ActionEvent e) { 238 239 toggleButtonHook(); 239 240 if(getValue("toolbarbutton") != null && getValue("toolbarbutton") instanceof JButton) { … … 310 311 } 311 312 } 312 313 314 @Override 313 315 public void buttonShown() { 314 316 unfurlDialog(); 315 317 } … … 485 487 buttonsHide.setBorder(BorderFactory.createEmptyBorder()); 486 488 buttonsHide.addActionListener( 487 489 new ActionListener(){ 490 @Override 488 491 public void actionPerformed(ActionEvent e) { 489 492 setIsButtonHiding(buttonHiding == ButtonHiddingType.ALWAYS_SHOWN?ButtonHiddingType.DYNAMIC:ButtonHiddingType.ALWAYS_SHOWN); 490 493 } … … 502 505 pref.setBorder(BorderFactory.createEmptyBorder()); 503 506 pref.addActionListener( 504 507 new ActionListener(){ 508 @Override 505 509 @SuppressWarnings("unchecked") 506 510 public void actionPerformed(ActionEvent e) { 507 511 final PreferenceDialog p = new PreferenceDialog(Main.parent); … … 523 527 sticky.setBorder(BorderFactory.createEmptyBorder()); 524 528 sticky.addActionListener( 525 529 new ActionListener(){ 530 @Override 526 531 public void actionPerformed(ActionEvent e) { 527 532 detach(); 528 533 dialogsPanel.reconstruct(Action.ELEMENT_SHRINKS, null); … … 537 542 close.setBorder(BorderFactory.createEmptyBorder()); 538 543 close.addActionListener( 539 544 new ActionListener(){ 545 @Override 540 546 public void actionPerformed(ActionEvent e) { 541 547 hideDialog(); 542 548 dialogsPanel.reconstruct(Action.ELEMENT_SHRINKS, null); … … 743 749 return preferredHeight; 744 750 } 745 751 752 @Override 746 753 public String helpTopic() { 747 754 String help = getClass().getName(); 748 755 help = help.substring(help.lastIndexOf('.')+1, help.length()-6); -
src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
105 105 * Called when the selection in the dataset changed. 106 106 * @param newSelection The new selection array. 107 107 */ 108 @Override 108 109 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 109 110 refresh(newSelection); 110 111 } 111 112 113 @Override 112 114 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 113 115 if (newLayer instanceof OsmDataLayer) { 114 116 refresh(((OsmDataLayer) newLayer).data.getAllSelected()); … … 117 119 } 118 120 } 119 121 122 @Override 120 123 public void layerAdded(Layer newLayer) { 121 124 // do nothing 122 125 } 123 126 127 @Override 124 128 public void layerRemoved(Layer oldLayer) { 125 129 // do nothing 126 130 } … … 163 167 model.selectPrimitivesOwnedBy(userTable.getSelectedRows()); 164 168 } 165 169 170 @Override 166 171 public void actionPerformed(ActionEvent e) { 167 172 select(); 168 173 } … … 171 176 setEnabled(userTable != null && userTable.getSelectedRowCount() > 0); 172 177 } 173 178 179 @Override 174 180 public void valueChanged(ListSelectionEvent e) { 175 181 updateEnabledState(); 176 182 } … … 233 239 setEnabled(userTable != null && userTable.getSelectedRowCount() > 0); 234 240 } 235 241 242 @Override 236 243 public void valueChanged(ListSelectionEvent e) { 237 244 updateEnabledState(); 238 245 } … … 261 268 this.count=count; 262 269 this.percent = percent; 263 270 } 271 @Override 264 272 public int compareTo(UserInfo o) { 265 273 if (count < o.count) return 1; 266 274 if (count > o.count) return -1; -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java
87 87 setToolTipText(""); 88 88 } 89 89 90 @Override 90 91 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 91 92 int row, int column) { 92 93 if (value == null) -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentDownloadTask.java
203 203 /* ------------------------------------------------------------------------------- */ 204 204 /* interface ChangesetDownloadTask */ 205 205 /* ------------------------------------------------------------------------------- */ 206 @Override 206 207 public Set<Changeset> getDownloadedChangesets() { 207 208 return downloadedChangesets; 208 209 } 209 210 211 @Override 210 212 public boolean isCanceled() { 211 213 return canceled; 212 214 } 213 215 216 @Override 214 217 public boolean isFailed() { 215 218 return lastException != null; 216 219 } -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
166 166 /* ---------------------------------------------------------------------------- */ 167 167 /* interface PropertyChangeListener */ 168 168 /* ---------------------------------------------------------------------------- */ 169 @Override 169 170 public void propertyChange(PropertyChangeEvent evt) { 170 171 if(!evt.getPropertyName().equals(ChangesetCacheManagerModel.CHANGESET_IN_DETAIL_VIEW_PROP)) 171 172 return; … … 184 185 putValue(SHORT_DESCRIPTION, tr("Download the changeset content from the OSM server")); 185 186 } 186 187 188 @Override 187 189 public void actionPerformed(ActionEvent evt) { 188 190 if (currentChangeset == null) return; 189 191 ChangesetContentDownloadTask task = new ChangesetContentDownloadTask(ChangesetContentPanel.this,currentChangeset.getId()); … … 249 251 } 250 252 251 253 Runnable r = new Runnable() { 254 @Override 252 255 public void run() { 253 256 try { 254 257 for (HistoryOsmPrimitive p : primitives) { … … 264 267 } 265 268 } catch (final Exception e) { 266 269 GuiHelper.runInEDT(new Runnable() { 270 @Override 267 271 public void run() { 268 272 BugReportExceptionHandler.handleException(e); 269 273 } … … 279 283 setEnabled(model.hasSelectedPrimitives()); 280 284 } 281 285 286 @Override 282 287 public void actionPerformed(ActionEvent arg0) { 283 288 Set<HistoryOsmPrimitive> selected = model.getSelectedPrimitives(); 284 289 if (selected.isEmpty()) return; 285 290 showHistory(selected); 286 291 } 287 292 293 @Override 288 294 public void valueChanged(ListSelectionEvent e) { 289 295 updateEnabledState(); 290 296 } … … 315 321 ); 316 322 } 317 323 324 @Override 318 325 public void actionPerformed(ActionEvent arg0) { 319 326 if (!isEnabled()) 320 327 return; … … 343 350 setEnabled(model.hasSelectedPrimitives()); 344 351 } 345 352 353 @Override 346 354 public void valueChanged(ListSelectionEvent e) { 347 355 updateEnabledState(); 348 356 } 349 357 358 @Override 350 359 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 351 360 updateEnabledState(); 352 361 } … … 377 386 ); 378 387 } 379 388 389 @Override 380 390 public void actionPerformed(ActionEvent arg0) { 381 391 if (!isEnabled()) 382 392 return; … … 406 416 setEnabled(model.hasSelectedPrimitives()); 407 417 } 408 418 419 @Override 409 420 public void valueChanged(ListSelectionEvent e) { 410 421 updateEnabledState(); 411 422 } 412 423 424 @Override 413 425 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 414 426 updateEnabledState(); 415 427 } … … 446 458 putValue(SMALL_ICON, ImageProvider.get("dialogs/changeset", "downloadchangesetcontent")); 447 459 } 448 460 461 @Override 449 462 public void actionPerformed(ActionEvent evt) { 450 463 if (current == null) return; 451 464 ChangesetContentDownloadTask task = new ChangesetContentDownloadTask(HeaderPanel.this, current.getId()); -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableCellRenderer.java
54 54 setToolTipText(""); 55 55 } 56 56 57 @Override 57 58 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 58 59 int row, int column) { 59 60 if (value == null) -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableModel.java
83 83 Collections.sort( 84 84 data, 85 85 new Comparator<ChangesetDataSetEntry>() { 86 @Override 86 87 public int compare(ChangesetDataSetEntry c1, ChangesetDataSetEntry c2) { 87 88 if (c1.getModificationType().equals(c2.getModificationType())) { 88 89 long id1 = c1.getPrimitive().getId(); … … 114 115 /* -------------------------------------------------------------- */ 115 116 /* interface TableModel */ 116 117 /* -------------------------------------------------------------- */ 118 @Override 117 119 public int getColumnCount() { 118 120 return 3; 119 121 } 120 122 123 @Override 121 124 public int getRowCount() { 122 125 return data.size(); 123 126 } 124 127 128 @Override 125 129 public Object getValueAt(int row, int col) { 126 130 switch(col) { 127 131 case 0: return data.get(row).getModificationType(); … … 147 151 this(entry.getModificationType(), entry.getPrimitive()); 148 152 } 149 153 154 @Override 150 155 public ChangesetModificationType getModificationType() { 151 156 return modificationType; 152 157 } 158 @Override 153 159 public HistoryOsmPrimitive getPrimitive() { 154 160 return primitive; 155 161 } -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
254 254 /* ---------------------------------------------------------------------------- */ 255 255 /* interface PropertyChangeListener */ 256 256 /* ---------------------------------------------------------------------------- */ 257 @Override 257 258 public void propertyChange(PropertyChangeEvent evt) { 258 259 if (! evt.getPropertyName().equals(ChangesetCacheManagerModel.CHANGESET_IN_DETAIL_VIEW_PROP)) 259 260 return; … … 271 272 putValue(SHORT_DESCRIPTION, tr("Remove the changeset in the detail view panel from the local cache")); 272 273 } 273 274 275 @Override 274 276 public void actionPerformed(ActionEvent evt) { 275 277 if (current == null) 276 278 return; … … 293 295 putValue(SHORT_DESCRIPTION, tr("Download the changeset content from the OSM server")); 294 296 } 295 297 298 @Override 296 299 public void actionPerformed(ActionEvent evt) { 297 300 if (current == null) return; 298 301 ChangesetContentDownloadTask task = new ChangesetContentDownloadTask(ChangesetDetailPanel.this,current.getId()); … … 329 332 putValue(SHORT_DESCRIPTION, tr("Update the changeset from the OSM server")); 330 333 } 331 334 335 @Override 332 336 public void actionPerformed(ActionEvent evt) { 333 337 if (current == null) return; 334 338 Main.worker.submit( … … 377 381 ); 378 382 } 379 383 384 @Override 380 385 public void actionPerformed(ActionEvent arg0) { 381 386 if (!isEnabled()) 382 387 return; … … 403 408 setEnabled(current != null); 404 409 } 405 410 411 @Override 406 412 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 407 413 updateEnabledState(); 408 414 } … … 436 442 ); 437 443 } 438 444 445 @Override 439 446 public void actionPerformed(ActionEvent arg0) { 440 447 if (!isEnabled()) 441 448 return; … … 463 470 setEnabled(current != null); 464 471 } 465 472 473 @Override 466 474 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 467 475 updateEnabledState(); 468 476 } -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetHeaderDownloadTask.java
146 146 ExceptionDialogUtil.explainException(lastException); 147 147 } 148 148 Runnable r = new Runnable() { 149 @Override 149 150 public void run() { 150 151 ChangesetCache.getInstance().update(downloadedChangesets); 151 152 } … … 191 192 /* ------------------------------------------------------------------------------- */ 192 193 /* interface ChangesetDownloadTask */ 193 194 /* ------------------------------------------------------------------------------- */ 195 @Override 194 196 public Set<Changeset> getDownloadedChangesets() { 195 197 return downloadedChangesets; 196 198 } 197 199 200 @Override 198 201 public boolean isCanceled() { 199 202 return canceled; 200 203 } 201 204 205 @Override 202 206 public boolean isFailed() { 203 207 return lastException != null; 204 208 } -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetInSelectionListModel.java
18 18 /* ---------------------------------------------------------------------------- */ 19 19 /* Interface SelectionChangeListener */ 20 20 /* ---------------------------------------------------------------------------- */ 21 @Override 21 22 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 22 23 initFromPrimitives(newSelection); 23 24 } … … 25 26 /* ---------------------------------------------------------------------------- */ 26 27 /* Interface LayerChangeListener */ 27 28 /* ---------------------------------------------------------------------------- */ 29 @Override 28 30 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 29 31 if (newLayer == null) { 30 32 setChangesets(null); -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListCellRenderer.java
46 46 setText(sb.toString()); 47 47 } 48 48 49 @Override 49 50 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 50 51 boolean cellHasFocus) { 51 52 Changeset cs = (Changeset)value; -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java
143 143 Collections.sort( 144 144 data, 145 145 new Comparator<Changeset>() { 146 @Override 146 147 public int compare(Changeset cs1, Changeset cs2) { 147 148 if (cs1.getId() > cs2.getId()) return -1; 148 149 if (cs1.getId() == cs2.getId()) return 0; … … 182 183 /* ---------------------------------------------------------------------------- */ 183 184 /* Interface ChangesetCacheListener */ 184 185 /* ---------------------------------------------------------------------------- */ 186 @Override 185 187 public void changesetCacheUpdated(ChangesetCacheEvent event) { 186 188 Set<Changeset> sel = getSelectedChangesets(); 187 189 for(Changeset cs: event.getAddedChangesets()) { -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetTagsPanel.java
46 46 /* ---------------------------------------------------------------------------- */ 47 47 /* interface PropertyChangeListener */ 48 48 /* ---------------------------------------------------------------------------- */ 49 @Override 49 50 public void propertyChange(PropertyChangeEvent evt) { 50 51 if (!evt.getPropertyName().equals(ChangesetCacheManagerModel.CHANGESET_IN_DETAIL_VIEW_PROP)) 51 52 return; -
src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetsInActiveDataLayerListModel.java
28 28 /* ------------------------------------------------------------------------------ */ 29 29 /* interface DataSetListener */ 30 30 /* ------------------------------------------------------------------------------ */ 31 @Override 31 32 public void dataChanged(DataChangedEvent event) { 32 33 initFromDataSet(event.getDataset()); 33 34 } 34 35 36 @Override 35 37 public void primitivesAdded(PrimitivesAddedEvent event) {/* ignored */} 36 38 39 @Override 37 40 public void primitivesRemoved(PrimitivesRemovedEvent event) {/* ignored */} 38 41 42 @Override 39 43 public void otherDatasetChange(AbstractDatasetChangedEvent event) {/* ignored */} 40 44 45 @Override 41 46 public void nodeMoved(NodeMovedEvent event) {/* ignored */} 42 47 48 @Override 43 49 public void relationMembersChanged(RelationMembersChangedEvent event) {/* ignored */} 44 50 51 @Override 45 52 public void tagsChanged(TagsChangedEvent event) {/* ignored */} 46 53 54 @Override 47 55 public void wayNodesChanged(WayNodesChangedEvent event) {/* ignored */} 48 56 49 57 /* ------------------------------------------------------------------------------ */ 50 58 /* interface EditLayerListener */ 51 59 /* ------------------------------------------------------------------------------ */ 60 @Override 52 61 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 53 62 // just init the model content. Don't register as DataSetListener. The mode 54 63 // is already registered to receive DataChangedEvents from the current -
src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java
84 84 updateEnabledState(); 85 85 } 86 86 87 @Override 87 88 public void actionPerformed(ActionEvent arg0) { 88 89 if (!isEnabled()) 89 90 return; … … 100 101 setEnabled(tfChangesetId.readIds()); 101 102 } 102 103 104 @Override 103 105 public void changedUpdate(DocumentEvent arg0) { 104 106 updateEnabledState(); 105 107 } 106 108 109 @Override 107 110 public void insertUpdate(DocumentEvent arg0) { 108 111 updateEnabledState(); 109 112 } 110 113 114 @Override 111 115 public void removeUpdate(DocumentEvent arg0) { 112 116 updateEnabledState(); 113 117 } -
src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
258 258 pnlBoundingBoxRestriction.setVisible(cbBoundingBoxRestriction.isSelected()); 259 259 } 260 260 261 @Override 261 262 public void itemStateChanged(ItemEvent e) { 262 263 if (e.getSource() == cbUserRestriction) { 263 264 userRestrictionStateChanged(); … … 616 617 } 617 618 618 619 class UserRestrictionChangedHandler implements ItemListener { 620 @Override 619 621 public void itemStateChanged(ItemEvent e) { 620 622 tfUid.setEnabled(rbRestrictToUid.isSelected()); 621 623 tfUserName.setEnabled(rbRestrictToUserName.isSelected()); … … 818 820 } 819 821 820 822 class TimeRestrictionChangedHandler implements ItemListener { 823 @Override 821 824 public void itemStateChanged(ItemEvent e) { 822 825 tfClosedAfterDate1.setEnabled(rbClosedAfter.isSelected()); 823 826 tfClosedAfterTime1.setEnabled(rbClosedAfter.isSelected()); -
src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java
244 244 * 245 245 */ 246 246 class SelectQueryHandler implements ItemListener { 247 @Override 247 248 public void itemStateChanged(ItemEvent e) { 248 249 BasicQuery q = getSelectedQuery(); 249 250 if (q == null) return; -
src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryDialog.java
175 175 ); 176 176 } 177 177 178 @Override 178 179 public void actionPerformed(ActionEvent arg0) { 179 180 try { 180 181 switch(tpQueryPanels.getSelectedIndex()) { … … 218 219 setVisible(false); 219 220 } 220 221 222 @Override 221 223 public void actionPerformed(ActionEvent arg0) { 222 224 cancel(); 223 225 } -
src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
79 79 ); 80 80 pnl.getEditorPane().addHyperlinkListener( 81 81 new HyperlinkListener() { 82 @Override 82 83 public void hyperlinkUpdate(HyperlinkEvent e) { 83 84 if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { 84 85 tfUrl.setText(e.getDescription()); … … 193 194 feedbackInvalid(); 194 195 } 195 196 } 197 @Override 196 198 public void changedUpdate(DocumentEvent e) { 197 199 validate(); 198 200 } 199 201 202 @Override 200 203 public void insertUpdate(DocumentEvent e) { 201 204 validate(); 202 205 } 203 206 207 @Override 204 208 public void removeUpdate(DocumentEvent e) { 205 209 validate(); 206 210 } -
src/org/openstreetmap/josm/gui/dialogs/properties/PresetListPanel.java
55 55 tag = t; 56 56 this.presetHandler = presetHandler; 57 57 } 58 @Override 58 59 public void mouseClicked(MouseEvent arg0) { 59 60 Collection<OsmPrimitive> selection = tag.createSelection(presetHandler.getSelection()); 60 61 if (selection == null || selection.isEmpty()) … … 66 67 } 67 68 68 69 } 70 @Override 69 71 public void mouseEntered(MouseEvent arg0) { 70 72 label.setFont(hover); 71 73 } 74 @Override 72 75 public void mouseExited(MouseEvent arg0) { 73 76 label.setFont(normal); 74 77 } 78 @Override 75 79 public void mousePressed(MouseEvent arg0) {} 80 @Override 76 81 public void mouseReleased(MouseEvent arg0) {} 77 82 } 78 83 -
src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
92 92 private String objKey; 93 93 94 94 Comparator<AutoCompletionListItem> defaultACItemComparator = new Comparator<AutoCompletionListItem>() { 95 @Override 95 96 public int compare(AutoCompletionListItem o1, AutoCompletionListItem o2) { 96 97 return String.CASE_INSENSITIVE_ORDER.compare(o1.getValue(), o2.getValue()); 97 98 } … … 308 309 p.add(Box.createHorizontalStrut(10), GBC.std()); 309 310 p.add(values, GBC.eol().fill(GBC.HORIZONTAL)); 310 311 values.getEditor().addActionListener(new ActionListener() { 312 @Override 311 313 public void actionPerformed(ActionEvent e) { 312 314 buttonAction(0, null); // emulate OK button click 313 315 } … … 493 495 protected JPopupMenu popupMenu = new JPopupMenu() { 494 496 JCheckBoxMenuItem fixTagLanguageCb = new JCheckBoxMenuItem( 495 497 new AbstractAction(tr("Use English language for tag by default")){ 498 @Override 496 499 public void actionPerformed(ActionEvent e) { 497 500 boolean sel=((JCheckBoxMenuItem) e.getSource()).getState(); 498 501 PROPERTY_FIX_TAG_LOCALE.put(sel); … … 590 593 selectKeysComboBox(); 591 594 592 595 popupMenu.add(new AbstractAction(tr("Set number of recently added tags")) { 596 @Override 593 597 public void actionPerformed(ActionEvent e) { 594 598 selectNumberOfTags(); 595 599 } 596 600 }); 597 601 JCheckBoxMenuItem rememberLastTags = new JCheckBoxMenuItem( 598 602 new AbstractAction(tr("Remember last used tags")){ 603 @Override 599 604 public void actionPerformed(ActionEvent e) { 600 605 boolean sel=((JCheckBoxMenuItem) e.getSource()).getState(); 601 606 PROPERTY_REMEMBER_TAGS.put(sel); -
src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
199 199 } 200 200 } 201 201 202 @Override 202 203 public void actionPerformed(ActionEvent e) { 203 204 if (!isEnabled()) 204 205 return; 205 206 run(); 206 207 } 207 208 209 @Override 208 210 public void valueChanged(TreeSelectionEvent e) { 209 211 refreshEnabled(); 210 212 } … … 225 227 Main.worker.submit(new DownloadAllChildrenTask(getParentDialog(), (Relation)model.getRoot())); 226 228 } 227 229 230 @Override 228 231 public void actionPerformed(ActionEvent e) { 229 232 if (!isEnabled()) 230 233 return; … … 261 264 Main.worker.submit(new DownloadRelationSetTask(getParentDialog(),relations)); 262 265 } 263 266 267 @Override 264 268 public void actionPerformed(ActionEvent e) { 265 269 if (!isEnabled()) 266 270 return; 267 271 run(); 268 272 } 269 273 274 @Override 270 275 public void valueChanged(TreeSelectionEvent e) { 271 276 updateEnabledState(); 272 277 } … … 415 420 refreshView(r); 416 421 } 417 422 SwingUtilities.invokeLater(new Runnable() { 423 @Override 418 424 public void run() { 419 425 Main.map.repaint(); 420 426 } -
src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java
134 134 135 135 SwingUtilities.invokeLater( 136 136 new Runnable() { 137 @Override 137 138 public void run() { 138 139 curLayer.mergeFrom(dataSet); 139 140 curLayer.onPostDownloadFromServer(); -
src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java
97 97 98 98 SwingUtilities.invokeAndWait( 99 99 new Runnable() { 100 @Override 100 101 public void run() { 101 102 layer.mergeFrom(allDownloads); 102 103 layer.onPostDownloadFromServer(); -
src/org/openstreetmap/josm/gui/dialogs/relation/MemberRoleCellEditor.java
33 33 /** 34 34 * replies the table cell editor 35 35 */ 36 @Override 36 37 public Component getTableCellEditorComponent(JTable table, 37 38 Object value, boolean isSelected, int row, int column) { 38 39 … … 43 44 return editor; 44 45 } 45 46 47 @Override 46 48 public Object getCellEditorValue() { 47 49 return editor.getText(); 48 50 } -
src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableCellRenderer.java
64 64 setForeground(fgc); 65 65 } 66 66 67 @Override 67 68 abstract public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, 68 69 boolean hasFocus, int row, int column); 69 70 -
src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
86 86 /* --------------------------------------------------------------------------- */ 87 87 /* Interface SelectionChangedListener */ 88 88 /* --------------------------------------------------------------------------- */ 89 @Override 89 90 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 90 91 if (Main.main.getEditLayer() != this.layer) return; 91 92 // just trigger a repaint … … 97 98 /* --------------------------------------------------------------------------- */ 98 99 /* Interface DataSetListener */ 99 100 /* --------------------------------------------------------------------------- */ 101 @Override 100 102 public void dataChanged(DataChangedEvent event) { 101 103 // just trigger a repaint - the display name of the relation members may 102 104 // have changed … … 105 107 setSelectedMembers(sel); 106 108 } 107 109 110 @Override 108 111 public void nodeMoved(NodeMovedEvent event) {/* ignore */} 112 @Override 109 113 public void primitivesAdded(PrimitivesAddedEvent event) {/* ignore */} 110 114 115 @Override 111 116 public void primitivesRemoved(PrimitivesRemovedEvent event) { 112 117 // ignore - the relation in the editor might become out of sync with the relation 113 118 // in the dataset. We will deal with it when the relation editor is closed or 114 119 // when the changes in the editor are applied. 115 120 } 116 121 122 @Override 117 123 public void relationMembersChanged(RelationMembersChangedEvent event) { 118 124 // ignore - the relation in the editor might become out of sync with the relation 119 125 // in the dataset. We will deal with it when the relation editor is closed or 120 126 // when the changes in the editor are applied. 121 127 } 122 128 129 @Override 123 130 public void tagsChanged(TagsChangedEvent event) { 124 131 // just refresh the respective table cells 125 132 // … … 132 139 setSelectedMembers(sel); 133 140 } 134 141 142 @Override 135 143 public void wayNodesChanged(WayNodesChangedEvent event) {/* ignore */} 136 144 145 @Override 137 146 public void otherDatasetChange(AbstractDatasetChangedEvent event) {/* ignore */} 138 147 /* --------------------------------------------------------------------------- */ 139 148 … … 163 172 fireTableDataChanged(); 164 173 } 165 174 175 @Override 166 176 public int getColumnCount() { 167 177 return 3; 168 178 } 169 179 180 @Override 170 181 public int getRowCount() { 171 182 return members.size(); 172 183 } 173 184 185 @Override 174 186 public Object getValueAt(int rowIndex, int columnIndex) { 175 187 switch (columnIndex) { 176 188 case 0: … … 725 737 return connectionType.get(i); 726 738 } 727 739 740 @Override 728 741 public void tableChanged(TableModelEvent e) { 729 742 connectionType = null; 730 743 } -
src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
172 172 // 173 173 SwingUtilities.invokeLater( 174 174 new Runnable() { 175 @Override 175 176 public void run() { 176 177 getLayer().onPostDownloadFromServer(); 177 178 } -
src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java
97 97 setEnabled(model.canReload()); 98 98 } 99 99 100 @Override 100 101 public void actionPerformed(ActionEvent e) { 101 102 boolean full = cbReadFull.isSelected(); 102 103 final ParentRelationLoadingTask task = new ParentRelationLoadingTask( … … 107 108 ); 108 109 task.setContinuation( 109 110 new Runnable() { 111 @Override 110 112 public void run() { 111 113 if (task.isCanceled() || task.hasError()) 112 114 return; … … 117 119 Main.worker.submit(task); 118 120 } 119 121 122 @Override 120 123 public void contentsChanged(ListDataEvent e) { 121 124 refreshEnabled(); 122 125 } 123 126 127 @Override 124 128 public void intervalAdded(ListDataEvent e) { 125 129 refreshEnabled(); 126 130 } 127 131 132 @Override 128 133 public void intervalRemoved(ListDataEvent e) { 129 134 refreshEnabled(); 130 135 } … … 146 151 setEnabled(referrers.getSelectionModel().getMinSelectionIndex() >=0); 147 152 } 148 153 154 @Override 149 155 public void actionPerformed(ActionEvent e) { 150 156 run(); 151 157 } … … 159 165 editor.setVisible(true); 160 166 } 161 167 168 @Override 162 169 public void valueChanged(ListSelectionEvent e) { 163 170 refreshEnabled(); 164 171 } -
src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserModel.java
36 36 fireModelUpdate(); 37 37 } 38 38 39 @Override 39 40 public Object getElementAt(int index) { 40 41 return referrers.get(index); 41 42 } 42 43 44 @Override 43 45 public int getSize() { 44 46 return referrers.size(); 45 47 } -
src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java
182 182 * called when a layer is removed 183 183 * 184 184 */ 185 @Override 185 186 public void layerRemoved(Layer oldLayer) { 186 187 if (oldLayer == null || ! (oldLayer instanceof OsmDataLayer)) 187 188 return; … … 199 200 } 200 201 } 201 202 203 @Override 202 204 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 203 205 // do nothing 204 206 } 205 207 208 @Override 206 209 public void layerAdded(Layer newLayer) { 207 210 // do nothing 208 211 } -
src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
80 80 */ 81 81 class LazyRelationLoader implements TreeWillExpandListener { 82 82 83 @Override 83 84 public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException { 84 85 // do nothing 85 86 } 86 87 88 @Override 87 89 public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException { 88 90 TreePath path = event.getPath(); 89 91 Relation parent = (Relation)event.getPath().getLastPathComponent(); … … 140 142 final RelationTreeModel model = (RelationTreeModel)getModel(); 141 143 SwingUtilities.invokeLater( 142 144 new Runnable() { 145 @Override 143 146 public void run() { 144 147 model.refreshNode(path); 145 148 } -
src/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRenderer.java
61 61 setBackground(bgColor); 62 62 } 63 63 64 @Override 64 65 public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, 65 66 boolean leaf, int row, boolean hasFocus) { 66 67 -
src/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeModel.java
188 188 /* ----------------------------------------------------------------------- */ 189 189 /* interface TreeModel */ 190 190 /* ----------------------------------------------------------------------- */ 191 @Override 191 192 public Object getChild(Object parent, int index) { 192 193 return getRelationChildByIdx((Relation)parent, index); 193 194 } 194 195 196 @Override 195 197 public int getChildCount(Object parent) { 196 198 return getNumRelationChildren((Relation)parent); 197 199 } 198 200 201 @Override 199 202 public int getIndexOfChild(Object parent, Object child) { 200 203 return getIndexForRelationChild((Relation)parent, (Relation)child); 201 204 } 202 205 206 @Override 203 207 public Object getRoot() { 204 208 return root; 205 209 } 206 210 211 @Override 207 212 public boolean isLeaf(Object node) { 208 213 Relation r = (Relation)node; 209 214 if (r.isIncomplete()) return false; 210 215 return getNumRelationChildren(r) == 0; 211 216 } 212 217 218 @Override 213 219 public void addTreeModelListener(TreeModelListener l) { 214 220 if (l != null) { 215 221 listeners.addIfAbsent(l); 216 222 } 217 223 } 218 224 225 @Override 219 226 public void removeTreeModelListener(TreeModelListener l) { 220 227 listeners.remove(l); 221 228 } 222 229 230 @Override 223 231 public void valueForPathChanged(TreePath path, Object newValue) { 224 232 // do nothing 225 233 } -
src/org/openstreetmap/josm/gui/dialogs/relation/RunnableAction.java
10 10 public RunnableAction() { 11 11 } 12 12 13 @Override 13 14 public abstract void run(); 14 15 16 @Override 15 17 public void actionPerformed(ActionEvent arg0) { 16 18 run(); 17 19 } -
src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRenderer.java
63 63 setToolTipText(DefaultNameFormatter.getInstance().buildDefaultToolTip(primitive)); 64 64 } 65 65 66 @Override 66 67 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 67 68 int row, int column) { 68 69 -
src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
44 44 MapView.removeLayerChangeListener(this); 45 45 } 46 46 47 @Override 47 48 public int getColumnCount() { 48 49 return 1; 49 50 } 50 51 52 @Override 51 53 public int getRowCount() { 52 54 if (Main.map.mapView.getEditLayer() != layer) 53 55 return 0; 54 56 return cache.size(); 55 57 } 56 58 59 @Override 57 60 public Object getValueAt(int rowIndex, int columnIndex) { 58 61 return cache.get(rowIndex); 59 62 } 60 63 64 @Override 61 65 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 62 66 if (oldLayer == layer) { 63 67 cache.clear(); … … 68 72 fireTableDataChanged(); 69 73 } 70 74 75 @Override 71 76 public void layerAdded(Layer newLayer) { 72 77 // do nothing 73 78 } 74 79 80 @Override 75 81 public void layerRemoved(Layer oldLayer) { 76 82 if (oldLayer == layer) { 77 83 unregister(); … … 80 86 fireTableDataChanged(); 81 87 } 82 88 89 @Override 83 90 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 84 91 if (layer == Main.map.mapView.getEditLayer()) { 85 92 cache.clear(); -
src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
104 104 return pnl; 105 105 } 106 106 107 @Override 107 108 public void addGui(final DownloadDialog gui) { 108 109 JPanel dlg = new JPanel(new GridBagLayout()); 109 110 gui.addDownloadAreaSelector(dlg, tr("Bookmarks")); … … 111 112 112 113 bookmarks = new BookmarkList(); 113 114 bookmarks.getSelectionModel().addListSelectionListener(new ListSelectionListener() { 115 @Override 114 116 public void valueChanged(ListSelectionEvent e) { 115 117 Bookmark b = (Bookmark)bookmarks.getSelectedValue(); 116 118 if (b != null) { … … 160 162 * 161 163 * @param area the download area. 162 164 */ 165 @Override 163 166 public void setDownloadArea(Bounds area) { 164 167 if (area == null) return; 165 168 this.currentArea = area; … … 179 182 putValue(SHORT_DESCRIPTION, tr("Add a bookmark for the currently selected download area")); 180 183 } 181 184 185 @Override 182 186 public void actionPerformed(ActionEvent e) { 183 187 if (currentArea == null) { 184 188 JOptionPane.showMessageDialog( … … 212 216 updateEnabledState(); 213 217 } 214 218 219 @Override 215 220 public void actionPerformed(ActionEvent e) { 216 221 Object[] sels = bookmarks.getSelectedValues(); 217 222 if (sels == null || sels.length == 0) … … 224 229 protected void updateEnabledState() { 225 230 setEnabled(bookmarks.getSelectedIndices().length > 0); 226 231 } 232 @Override 227 233 public void valueChanged(ListSelectionEvent e) { 228 234 updateEnabledState(); 229 235 } … … 237 243 updateEnabledState(); 238 244 } 239 245 246 @Override 240 247 public void actionPerformed(ActionEvent e) { 241 248 Object[] sels = bookmarks.getSelectedValues(); 242 249 if (sels == null || sels.length != 1) … … 260 267 protected void updateEnabledState() { 261 268 setEnabled(bookmarks.getSelectedIndices().length == 1); 262 269 } 270 @Override 263 271 public void valueChanged(ListSelectionEvent e) { 264 272 updateEnabledState(); 265 273 } -
src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
80 80 registerBoundingBoxBuilder(); 81 81 } 82 82 83 @Override 83 84 public void addGui(final DownloadDialog gui) { 84 85 buildDownloadAreaInputFields(); 85 86 final JPanel dlg = new JPanel(new GridBagLayout()); … … 122 123 this.parent = gui; 123 124 } 124 125 126 @Override 125 127 public void setDownloadArea(Bounds area) { 126 128 updateBboxFields(area); 127 129 updateUrl(area); … … 211 213 check(); 212 214 } 213 215 216 @Override 214 217 public void actionPerformed(ActionEvent e) { 215 218 check(); 216 219 } … … 243 246 check(); 244 247 } 245 248 249 @Override 246 250 public void actionPerformed(ActionEvent e) { 247 251 check(); 248 252 } … … 261 265 } 262 266 263 267 class OsmUrlRefresher implements DocumentListener { 268 @Override 264 269 public void changedUpdate(DocumentEvent e) { parseURL(parent); } 270 @Override 265 271 public void insertUpdate(DocumentEvent e) { parseURL(parent); } 272 @Override 266 273 public void removeUpdate(DocumentEvent e) { parseURL(parent); } 267 274 } 268 275 … … 297 304 refreshBounds(); 298 305 } 299 306 307 @Override 300 308 public void actionPerformed(ActionEvent e) { 301 309 refreshBounds(); 302 310 } -
src/org/openstreetmap/josm/gui/download/DownloadDialog.java
135 135 cbStartup = new JCheckBox(tr("Open this dialog on startup")); 136 136 cbStartup.setToolTipText(tr("<html>Autostart ''Download from OSM'' dialog every time JOSM is started.<br>You can open it manually from File menu or toolbar.</html>")); 137 137 cbStartup.addActionListener(new ActionListener() { 138 @Override 138 139 public void actionPerformed(ActionEvent e) { 139 140 Main.pref.put("download.autorun", cbStartup.isSelected()); 140 141 }}); … … 152 153 } 153 154 154 155 /* This should not be necessary, but if not here, repaint is not always correct in SlippyMap! */ 156 @Override 155 157 public void paint(Graphics g) { 156 158 tpDownloadAreaSelectors.getSelectedComponent().paint(g); 157 159 super.paint(g); … … 197 199 KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK), "checkClipboardContents"); 198 200 199 201 getRootPane().getActionMap().put("checkClipboardContents", new AbstractAction() { 202 @Override 200 203 public void actionPerformed(ActionEvent e) { 201 204 String clip = Utils.getClipboardContent(); 202 205 if (clip == null) { … … 399 402 setVisible(false); 400 403 } 401 404 405 @Override 402 406 public void actionPerformed(ActionEvent e) { 403 407 run(); 404 408 } … … 438 442 setVisible(false); 439 443 } 440 444 445 @Override 441 446 public void actionPerformed(ActionEvent e) { 442 447 run(); 443 448 } -
src/org/openstreetmap/josm/gui/download/PlaceSelection.java
132 132 * 133 133 * This method is, for all intents and purposes, the constructor for this class. 134 134 */ 135 @Override 135 136 public void addGui(final DownloadDialog gui) { 136 137 JPanel panel = new JPanel(); 137 138 panel.setLayout(new BorderLayout()); … … 163 164 parent = gui; 164 165 } 165 166 167 @Override 166 168 public void setDownloadArea(Bounds area) { 167 169 tblSearchResults.clearSelection(); 168 170 } … … 290 292 updateEnabledState(); 291 293 } 292 294 295 @Override 293 296 public void actionPerformed(ActionEvent e) { 294 297 if (!isEnabled() || cbSearchExpression.getText().trim().length() == 0) 295 298 return; … … 303 306 setEnabled(cbSearchExpression.getText().trim().length() > 0); 304 307 } 305 308 309 @Override 306 310 public void changedUpdate(DocumentEvent e) { 307 311 updateEnabledState(); 308 312 } 309 313 314 @Override 310 315 public void insertUpdate(DocumentEvent e) { 311 316 updateEnabledState(); 312 317 } 313 318 319 @Override 314 320 public void removeUpdate(DocumentEvent e) { 315 321 updateEnabledState(); 316 322 } … … 472 478 } 473 479 474 480 class ListSelectionHandler implements ListSelectionListener { 481 @Override 475 482 public void valueChanged(ListSelectionEvent lse) { 476 483 SearchResult r = model.getSelectedSearchResult(); 477 484 if (r != null) { … … 523 530 return ret.toString(); 524 531 } 525 532 533 @Override 526 534 public Component getTableCellRendererComponent(JTable table, Object value, 527 535 boolean isSelected, boolean hasFocus, int row, int column) { 528 536 -
src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java
36 36 pnlSlippyMapBBoxChooser.addPropertyChangeListener(this); 37 37 } 38 38 39 @Override 39 40 public void addGui(final DownloadDialog gui) { 40 41 iGui = gui; 41 42 iGui.addDownloadAreaSelector(pnlSlippyMapBBoxChooser, tr("Slippy map")); 42 43 } 43 44 45 @Override 44 46 public void setDownloadArea(Bounds area) { 45 47 pnlSlippyMapBBoxChooser.setBoundingBox(area); 46 48 repaint(); 47 49 } 48 50 51 @Override 49 52 public void propertyChange(PropertyChangeEvent evt) { 50 53 if (evt.getPropertyName().equals(BBoxChooser.BBOX_PROP)) { 51 54 if (iGui != null) { -
src/org/openstreetmap/josm/gui/download/TileSelection.java
30 30 build(); 31 31 } 32 32 33 @Override 33 34 public void addGui(final DownloadDialog gui) { 34 35 gui.addDownloadAreaSelector(chooser, tr("Tile Numbers")); 35 36 parent = gui; 36 37 } 37 38 39 @Override 38 40 public void setDownloadArea(Bounds area) { 39 41 chooser.setBoundingBox(area); 40 42 } 41 43 44 @Override 42 45 public void propertyChange(PropertyChangeEvent evt) { 43 46 if (evt.getPropertyName().equals(BBoxChooser.BBOX_PROP)) { 44 47 Bounds bbox = (Bounds)evt.getNewValue(); -
src/org/openstreetmap/josm/gui/help/ContextSensitiveHelpAction.java
49 49 this.helpTopic = helpTopic; 50 50 } 51 51 52 @Override 52 53 public void actionPerformed(ActionEvent e) { 53 54 if (helpTopic != null) { 54 55 HelpBrowser.setUrlForHelpTopic(helpTopic); -
src/org/openstreetmap/josm/gui/help/HelpBrowser.java
83 83 public static void setUrlForHelpTopic(final String helpTopic) { 84 84 final HelpBrowser browser = getInstance(); 85 85 Runnable r = new Runnable() { 86 @Override 86 87 public void run() { 87 88 browser.openHelpTopic(helpTopic); 88 89 browser.setVisible(true); … … 189 190 p.add(buildToolBar(), BorderLayout.NORTH); 190 191 help.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "Close"); 191 192 help.getActionMap().put("Close", new AbstractAction(){ 193 @Override 192 194 public void actionPerformed(ActionEvent e) { 193 195 setVisible(false); 194 196 } … … 427 429 putValue(SMALL_ICON, ImageProvider.get("help", "internet")); 428 430 } 429 431 432 @Override 430 433 public void actionPerformed(ActionEvent e) { 431 434 OpenBrowser.displayUrl(getUrl()); 432 435 } … … 439 442 putValue(SMALL_ICON,ImageProvider.get("dialogs", "edit")); 440 443 } 441 444 445 @Override 442 446 public void actionPerformed(ActionEvent e) { 443 447 String url = getUrl(); 444 448 if(url == null) … … 471 475 putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh")); 472 476 } 473 477 478 @Override 474 479 public void actionPerformed(ActionEvent e) { 475 480 openUrl(getUrl()); 476 481 } … … 487 492 setEnabled(history.canGoBack()); 488 493 } 489 494 495 @Override 490 496 public void actionPerformed(ActionEvent e) { 491 497 history.back(); 492 498 } 499 @Override 493 500 public void update(Observable o, Object arg) { 494 501 //System.out.println("BackAction: canGoBoack=" + history.canGoBack() ); 495 502 setEnabled(history.canGoBack()); … … 507 514 setEnabled(history.canGoForward()); 508 515 } 509 516 517 @Override 510 518 public void actionPerformed(ActionEvent e) { 511 519 history.forward(); 512 520 } 521 @Override 513 522 public void update(Observable o, Object arg) { 514 523 setEnabled(history.canGoForward()); 515 524 } … … 522 531 putValue(SMALL_ICON, ImageProvider.get("help", "home")); 523 532 } 524 533 534 @Override 525 535 public void actionPerformed(ActionEvent e) { 526 536 openHelpTopic("/"); 527 537 } … … 580 590 return null; 581 591 } 582 592 593 @Override 583 594 public void hyperlinkUpdate(HyperlinkEvent e) { 584 595 if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) 585 596 return; -
src/org/openstreetmap/josm/gui/history/AdjustmentSynchronizer.java
57 57 * event handler for {@link AdjustmentEvent}s 58 58 * 59 59 */ 60 @Override 60 61 public void adjustmentValueChanged(AdjustmentEvent e) { 61 62 if (! enabledMap.get(e.getAdjustable())) 62 63 return; … … 123 124 // register an item lister with the check box 124 125 // 125 126 view.addItemListener(new ItemListener() { 127 @Override 126 128 public void itemStateChanged(ItemEvent e) { 127 129 switch(e.getStateChange()) { 128 130 case ItemEvent.SELECTED: … … 141 143 142 144 observable.addObserver( 143 145 new Observer() { 146 @Override 144 147 public void update(Observable o, Object arg) { 145 148 boolean sync = isParticipatingInSynchronizedScrolling(adjustable); 146 149 if (view.isSelected() != sync) { -
src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
280 280 } 281 281 } 282 282 283 @Override 283 284 public void update(Observable o, Object arg) { 284 285 refresh(); 285 286 } … … 293 294 super(model, PointInTimeType.REFERENCE_POINT_IN_TIME); 294 295 } 295 296 297 @Override 296 298 protected void build() { 297 299 setLayout(new GridBagLayout()); 298 300 setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY)); … … 318 320 lblDistance.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); 319 321 } 320 322 323 @Override 321 324 protected void refresh() { 322 325 HistoryOsmPrimitive p = getPrimitive(); 323 326 HistoryOsmPrimitive opposite = getOppositePrimitive(); -
src/org/openstreetmap/josm/gui/history/HistoryBrowserDialog.java
121 121 /* ---------------------------------------------------------------------------------- */ 122 122 /* interface HistoryDataSetListener */ 123 123 /* ---------------------------------------------------------------------------------- */ 124 @Override 124 125 public void historyUpdated(HistoryDataSet source, PrimitiveId primitiveId) { 125 126 if (primitiveId == null || primitiveId.equals(browser.getHistory().getPrimitiveId())) { 126 127 browser.populate(source.getHistory(browser.getHistory().getPrimitiveId())); 127 128 } 128 129 } 129 130 131 @Override 130 132 public void historyDataSetCleared(HistoryDataSet source) { 131 133 closeAction.run(); 132 134 } … … 145 147 HistoryBrowserDialogManager.getInstance().hide(HistoryBrowserDialog.this); 146 148 } 147 149 150 @Override 148 151 public void actionPerformed(ActionEvent e) { 149 152 run(); 150 153 } … … 157 160 putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh")); 158 161 } 159 162 163 @Override 160 164 public void actionPerformed(ActionEvent e) { 161 165 HistoryLoadTask task = new HistoryLoadTask(); 162 166 task.add(browser.getHistory()); -
src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
123 123 /* ----------------------------------------------------------------------------- */ 124 124 /* LayerChangeListener */ 125 125 /* ----------------------------------------------------------------------------- */ 126 @Override 126 127 public void activeLayerChange(Layer oldLayer, Layer newLayer) {} 128 @Override 127 129 public void layerAdded(Layer newLayer) {} 128 130 131 @Override 129 132 public void layerRemoved(Layer oldLayer) { 130 133 // remove all history browsers if the number of layers drops to 0 131 134 // -
src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
681 681 /* ---------------------------------------------------------------------- */ 682 682 /* DataSetListener */ 683 683 /* ---------------------------------------------------------------------- */ 684 @Override 684 685 public void nodeMoved(NodeMovedEvent event) { 685 686 Node node = event.getNode(); 686 687 if (!node.isNew() && node.getId() == history.getId()) { … … 688 689 } 689 690 } 690 691 692 @Override 691 693 public void primitivesAdded(PrimitivesAddedEvent event) { 692 694 for (OsmPrimitive p: event.getPrimitives()) { 693 695 if (canShowAsLatest(p)) { … … 696 698 } 697 699 } 698 700 701 @Override 699 702 public void primitivesRemoved(PrimitivesRemovedEvent event) { 700 703 for (OsmPrimitive p: event.getPrimitives()) { 701 704 if (!p.isNew() && p.getId() == history.getId()) { … … 704 707 } 705 708 } 706 709 710 @Override 707 711 public void relationMembersChanged(RelationMembersChangedEvent event) { 708 712 Relation r = event.getRelation(); 709 713 if (!r.isNew() && r.getId() == history.getId()) { … … 711 715 } 712 716 } 713 717 718 @Override 714 719 public void tagsChanged(TagsChangedEvent event) { 715 720 OsmPrimitive prim = event.getPrimitive(); 716 721 if (!prim.isNew() && prim.getId() == history.getId()) { … … 718 723 } 719 724 } 720 725 726 @Override 721 727 public void wayNodesChanged(WayNodesChangedEvent event) { 722 728 Way way = event.getChangedWay(); 723 729 if (!way.isNew() && way.getId() == history.getId()) { … … 725 731 } 726 732 } 727 733 734 @Override 728 735 public void dataChanged(DataChangedEvent event) { 729 736 OsmPrimitive primitive = event.getDataset().getPrimitiveById(history.getId(), history.getType()); 730 737 HistoryOsmPrimitive latest; … … 737 744 fireModelChange(); 738 745 } 739 746 747 @Override 740 748 public void otherDatasetChange(AbstractDatasetChangedEvent event) { 741 749 // Irrelevant 742 750 } … … 744 752 /* ---------------------------------------------------------------------- */ 745 753 /* LayerChangeListener */ 746 754 /* ---------------------------------------------------------------------- */ 755 @Override 747 756 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 748 757 if (oldLayer != null && oldLayer instanceof OsmDataLayer) { 749 758 OsmDataLayer l = (OsmDataLayer)oldLayer; … … 767 776 fireModelChange(); 768 777 } 769 778 779 @Override 770 780 public void layerAdded(Layer newLayer) {} 781 @Override 771 782 public void layerRemoved(Layer oldLayer) {} 772 783 773 784 /** … … 777 788 static class HistoryPrimitiveBuilder extends AbstractVisitor { 778 789 private HistoryOsmPrimitive clone; 779 790 791 @Override 780 792 public void visit(Node n) { 781 793 clone = new HistoryNode(n.getId(), n.getVersion(), n.isVisible(), getCurrentUser(), 0, null, n.getCoor(), false); 782 794 clone.setTags(n.getKeys()); 783 795 } 784 796 797 @Override 785 798 public void visit(Relation r) { 786 799 clone = new HistoryRelation(r.getId(), r.getVersion(), r.isVisible(), getCurrentUser(), 0, null, false); 787 800 clone.setTags(r.getKeys()); … … 791 804 } 792 805 } 793 806 807 @Override 794 808 public void visit(Way w) { 795 809 clone = new HistoryWay(w.getId(), w.getVersion(), w.isVisible(), getCurrentUser(), 0, null, false); 796 810 clone.setTags(w.getKeys()); -
src/org/openstreetmap/josm/gui/history/NodeListTableCellRenderer.java
46 46 } 47 47 48 48 // Warning: The model pads with null-rows to match the size of the opposite table. 'value' could be null 49 @Override 49 50 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 50 51 int row, int column) { 51 52 -
src/org/openstreetmap/josm/gui/history/NodeListViewer.java
201 201 putValue(SMALL_ICON, ImageProvider.get("dialogs", "zoomin")); 202 202 } 203 203 204 @Override 204 205 public void actionPerformed(ActionEvent e) { 205 206 if (!isEnabled()) return; 206 207 OsmPrimitive p = getPrimitiveToZoom(); … … 247 248 putValue(SMALL_ICON, ImageProvider.get("dialogs", "history")); 248 249 } 249 250 251 @Override 250 252 public void actionPerformed(ActionEvent e) { 251 253 if (!isEnabled()) return; 252 254 run(); … … 262 264 Main.worker.submit(new HistoryLoadTask().add(primitiveId)); 263 265 } 264 266 Runnable r = new Runnable() { 267 @Override 265 268 public void run() { 266 269 final History h = HistoryDataSet.getInstance().getHistory(primitiveId); 267 270 if (h == null) -
src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java
75 75 } 76 76 77 77 // Warning: The model pads with null-rows to match the size of the opposite table. 'value' could be null 78 @Override 78 79 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 79 80 int row, int column) { 80 81 -
src/org/openstreetmap/josm/gui/history/SelectionSynchronizer.java
25 25 model.addListSelectionListener(this); 26 26 } 27 27 28 @Override 28 29 public void valueChanged(ListSelectionEvent e) { 29 30 DefaultListSelectionModel referenceModel = (DefaultListSelectionModel)e.getSource(); 30 31 int i = referenceModel.getMinSelectionIndex(); -
src/org/openstreetmap/josm/gui/history/TagTableCellRenderer.java
74 74 setFont(font); 75 75 } 76 76 77 @Override 77 78 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 78 79 int row, int column) { 79 80 -
src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
132 132 build(); 133 133 } 134 134 135 @Override 135 136 public void update(Observable o, Object arg) { 136 137 lblInfo.setText(getInfoText()); 137 138 -
src/org/openstreetmap/josm/gui/history/VersionTable.java
81 81 return (HistoryBrowserModel.VersionTableModel) getModel(); 82 82 } 83 83 84 @Override 84 85 public void update(Observable o, Object arg) { 85 86 repaint(); 86 87 } … … 163 164 164 165 public static class RadioButtonRenderer extends JRadioButton implements TableCellRenderer { 165 166 167 @Override 166 168 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,int row,int column) { 167 169 setSelected(value != null && (Boolean)value); 168 170 setHorizontalAlignment(SwingConstants.CENTER); … … 195 197 return btn.isSelected(); 196 198 } 197 199 200 @Override 198 201 public void itemStateChanged(ItemEvent e) { 199 202 fireEditingStopped(); 200 203 } … … 204 207 public AlignedRenderer(int hAlignment) { 205 208 setHorizontalAlignment(hAlignment); 206 209 } 210 @Override 207 211 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,int row,int column) { 208 212 String v = value.toString(); 209 213 setText(v); -
src/org/openstreetmap/josm/gui/io/AbstractIOTask.java
87 87 /** 88 88 * Runs the task 89 89 */ 90 @Override 90 91 public abstract void run(); 91 92 92 93 /** -
src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java
39 39 private CopyOnWriteArrayList<CellEditorListener> listeners; 40 40 41 41 private ActionListener al = new ActionListener() { 42 @Override 42 43 public void actionPerformed(ActionEvent e) { 43 44 fireEditingStopped(); 44 45 } … … 59 60 b.setPreferredSize(new Dimension(b.getPreferredSize().width, 19)); 60 61 b.addActionListener(al); 61 62 am.put(b.getText(), new AbstractAction() { 63 @Override 62 64 public void actionPerformed(ActionEvent e) { 63 65 b.setSelected(!b.isSelected()); 64 66 fireEditingStopped(); … … 84 86 } 85 87 } 86 88 89 @Override 87 90 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 88 91 updateCheckboxes(value); 89 92 return this; 90 93 } 91 94 95 @Override 92 96 public void addCellEditorListener(CellEditorListener l) { 93 97 if (l != null) { 94 98 listeners.addIfAbsent(l); … … 107 111 } 108 112 } 109 113 114 @Override 110 115 public void cancelCellEditing() { 111 116 fireEditingCanceled(); 112 117 } 113 118 119 @Override 114 120 public Object getCellEditorValue() { 115 121 boolean[] values = new boolean[2]; 116 122 values[0] = checkBoxes[0].isSelected(); … … 118 124 return values; 119 125 } 120 126 127 @Override 121 128 public boolean isCellEditable(EventObject anEvent) { 122 129 return true; 123 130 } 124 131 132 @Override 125 133 public void removeCellEditorListener(CellEditorListener l) { 126 134 listeners.remove(l); 127 135 } 128 136 137 @Override 129 138 public boolean shouldSelectCell(EventObject anEvent) { 130 139 return true; 131 140 } 132 141 142 @Override 133 143 public boolean stopCellEditing() { 134 144 fireEditingStopped(); 135 145 return true; 136 146 } 137 147 148 @Override 138 149 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 139 150 updateCheckboxes(value); 140 151 return this; -
src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java
59 59 hcbUploadComment.setPossibleItems(cmtHistory); 60 60 hcbUploadComment.getEditor().addActionListener( 61 61 new ActionListener() { 62 @Override 62 63 public void actionPerformed(ActionEvent e) { 63 64 changesetCommentModel.setComment(hcbUploadComment.getText()); 64 65 } … … 100 101 hcbUploadComment.getEditor().addActionListener(handler); 101 102 hcbUploadComment.getEditor().getEditorComponent().addKeyListener( 102 103 new KeyListener() { 104 @Override 103 105 public void keyTyped(KeyEvent e) { 104 106 if (e.getKeyCode() == KeyEvent.VK_TAB) { 105 107 handler.actionPerformed(new ActionEvent(hcbUploadComment,0, "focusDown")); 106 108 } 107 109 } 110 @Override 108 111 public void keyReleased(KeyEvent e) {} 109 112 113 @Override 110 114 public void keyPressed(KeyEvent e) {} 111 115 } 112 116 ); … … 150 154 * in sync with the current changeset comment 151 155 */ 152 156 class ChangesetCommentObserver implements Observer { 157 @Override 153 158 public void update(Observable o, Object arg) { 154 159 if (!(o instanceof ChangesetCommentModel)) return; 155 160 String newComment = (String)arg; -
src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java
40 40 return sb.toString(); 41 41 } 42 42 43 @Override 43 44 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 44 45 boolean cellHasFocus) { 45 46 Changeset cs = (Changeset)value; -
src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java
221 221 /* ---------------------------------------------------------------------------- */ 222 222 /* Interface ListDataListener */ 223 223 /* ---------------------------------------------------------------------------- */ 224 @Override 224 225 public void contentsChanged(ListDataEvent e) { 225 226 refreshGUI(); 226 227 } 227 228 229 @Override 228 230 public void intervalAdded(ListDataEvent e) { 229 231 refreshGUI(); 230 232 } 231 233 234 @Override 232 235 public void intervalRemoved(ListDataEvent e) { 233 236 refreshGUI(); 234 237 } … … 239 242 * 240 243 */ 241 244 class ChangesetListItemStateListener implements ItemListener { 245 @Override 242 246 public void itemStateChanged(ItemEvent e) { 243 247 Changeset cs = (Changeset)cbOpenChangesets.getSelectedItem(); 244 248 if (cs == null) return; … … 254 258 * 255 259 */ 256 260 class CloseAfterUploadItemStateListener implements ItemListener { 261 @Override 257 262 public void itemStateChanged(ItemEvent e) { 258 263 if (e.getItemSelectable() != cbCloseAfterUpload) 259 264 return; … … 275 280 * 276 281 */ 277 282 class RadioButtonHandler implements ItemListener { 283 @Override 278 284 public void itemStateChanged(ItemEvent e) { 279 285 if (rbUseNew.isSelected()) { 280 286 cbOpenChangesets.setEnabled(false); … … 303 309 putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh")); 304 310 } 305 311 312 @Override 306 313 public void actionPerformed(ActionEvent e) { 307 314 DownloadOpenChangesetsTask task = new DownloadOpenChangesetsTask(ChangesetManagementPanel.this); 308 315 Main.worker.submit(task); … … 321 328 refreshEnabledState(); 322 329 } 323 330 331 @Override 324 332 public void actionPerformed(ActionEvent e) { 325 333 Changeset cs = (Changeset)cbOpenChangesets.getSelectedItem(); 326 334 if (cs == null) return; … … 336 344 ); 337 345 } 338 346 347 @Override 339 348 public void itemStateChanged(ItemEvent e) { 340 349 refreshEnabledState(); 341 350 } -
src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java
121 121 refreshEnabledState(); 122 122 } 123 123 124 @Override 124 125 public void actionPerformed(ActionEvent e) { 125 126 setCanceled(false); 126 127 setVisible(false); … … 130 131 setEnabled(lstOpenChangesets.getSelectedValues() != null && lstOpenChangesets.getSelectedValues().length > 0); 131 132 } 132 133 134 @Override 133 135 public void valueChanged(ListSelectionEvent e) { 134 136 refreshEnabledState(); 135 137 } … … 148 150 setVisible(false); 149 151 } 150 152 153 @Override 151 154 public void actionPerformed(ActionEvent e) { 152 155 cancel(); 153 156 } -
src/org/openstreetmap/josm/gui/io/CloseChangesetTask.java
58 58 } 59 59 SwingUtilities.invokeLater( 60 60 new Runnable() { 61 @Override 61 62 public void run() { 62 63 ChangesetCache.getInstance().update(closedChangesets); 63 64 } -
src/org/openstreetmap/josm/gui/io/DownloadPrimitivesTask.java
80 80 return; 81 81 } 82 82 GuiHelper.runInEDTAndWait(new Runnable() { 83 @Override 83 84 public void run() { 84 85 layer.mergeFrom(ds); 85 86 AutoScaleAction.zoomTo(ds.allPrimitives()); -
src/org/openstreetmap/josm/gui/io/FilenameCellEditor.java
68 68 build(); 69 69 } 70 70 71 @Override 71 72 public void addCellEditorListener(CellEditorListener l) { 72 73 if (l != null) { 73 74 listeners.addIfAbsent(l); … … 86 87 } 87 88 } 88 89 90 @Override 89 91 public void cancelCellEditing() { 90 92 fireEditingCanceled(); 91 93 } 92 94 95 @Override 93 96 public Object getCellEditorValue() { 94 97 return value; 95 98 } 96 99 100 @Override 97 101 public boolean isCellEditable(EventObject anEvent) { 98 102 return true; 99 103 } 100 104 105 @Override 101 106 public void removeCellEditorListener(CellEditorListener l) { 102 107 listeners.remove(l); 103 108 } 104 109 110 @Override 105 111 public boolean shouldSelectCell(EventObject anEvent) { 106 112 return true; 107 113 } 108 114 115 @Override 109 116 public boolean stopCellEditing() { 110 117 if (tfFileName.getText() == null || tfFileName.getText().trim().equals("")) { 111 118 value = null; … … 125 132 } 126 133 } 127 134 135 @Override 128 136 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 129 137 SaveLayerInfo info = (SaveLayerInfo)value; 130 138 setInitialValue(info.getFile()); … … 138 146 putValue(SHORT_DESCRIPTION, tr("Launch a file chooser to select a file")); 139 147 } 140 148 149 @Override 141 150 public void actionPerformed(ActionEvent e) { 142 151 File f = SaveActionBase.createAndOpenSaveFileChooser(tr("Select filename"), "osm"); 143 152 if (f != null) { -
src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
75 75 } 76 76 77 77 /** renderer used while not editing the file path **/ 78 @Override 78 79 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, 79 80 boolean hasFocus, int row, int column) { 80 81 removeAll(); … … 92 93 } 93 94 94 95 /** renderer used while the file path is being edited **/ 96 @Override 95 97 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, 96 98 int row, int column) { 97 99 removeAll(); … … 177 179 return t; 178 180 } 179 181 182 @Override 180 183 public void addCellEditorListener(CellEditorListener l) { 181 184 if (l != null) { 182 185 listeners.addIfAbsent(l); … … 195 198 } 196 199 } 197 200 201 @Override 198 202 public void cancelCellEditing() { 199 203 fireEditingCanceled(); 200 204 } 201 205 206 @Override 202 207 public Object getCellEditorValue() { 203 208 return value; 204 209 } 205 210 211 @Override 206 212 public boolean isCellEditable(EventObject anEvent) { 207 213 return true; 208 214 } 209 215 216 @Override 210 217 public void removeCellEditorListener(CellEditorListener l) { 211 218 listeners.remove(l); 212 219 } 213 220 221 @Override 214 222 public boolean shouldSelectCell(EventObject anEvent) { 215 223 return true; 216 224 } 217 225 226 @Override 218 227 public boolean stopCellEditing() { 219 228 if (tfFilename.getText() == null || tfFilename.getText().trim().equals("")) { 220 229 value = null; … … 231 240 putValue(SHORT_DESCRIPTION, tr("Launch a file chooser to select a file")); 232 241 } 233 242 243 @Override 234 244 public void actionPerformed(ActionEvent e) { 235 245 File f = SaveActionBase.createAndOpenSaveFileChooser(tr("Select filename"), "osm"); 236 246 if (f != null) { -
src/org/openstreetmap/josm/gui/io/OpenChangesetComboBoxModel.java
61 61 /* ------------------------------------------------------------------------------------ */ 62 62 /* ChangesetCacheListener */ 63 63 /* ------------------------------------------------------------------------------------ */ 64 @Override 64 65 public void changesetCacheUpdated(ChangesetCacheEvent event) { 65 66 refresh(); 66 67 } -
src/org/openstreetmap/josm/gui/io/SaveLayerInfo.java
116 116 this.file = file; 117 117 } 118 118 119 @Override 119 120 public int compareTo(SaveLayerInfo o) { 120 121 if (isDoSaveAndUpload()) { 121 122 if (o.isDoSaveAndUpload()) -
src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
324 324 } 325 325 } 326 326 327 @Override 327 328 public void actionPerformed(ActionEvent e) { 328 329 cancel(); 329 330 } … … 346 347 putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete")); 347 348 } 348 349 350 @Override 349 351 public void actionPerformed(ActionEvent e) { 350 352 setUserAction(UserAction.PROCEED); 351 353 closeDialog(); 352 354 } 355 @Override 353 356 public void propertyChange(PropertyChangeEvent evt) { 354 357 if (evt.getPropertyName().equals(SaveLayersModel.MODE_PROP)) { 355 358 Mode mode = (Mode)evt.getNewValue(); … … 404 407 } 405 408 } 406 409 410 @Override 407 411 public void actionPerformed(ActionEvent e) { 408 412 if (! confirmSaveLayerInfosOK()) 409 413 return; 410 414 launchSafeAndUploadTask(); 411 415 } 412 416 417 @Override 413 418 public void propertyChange(PropertyChangeEvent evt) { 414 419 if (evt.getPropertyName().equals(SaveLayersModel.MODE_PROP)) { 415 420 SaveLayersModel.Mode mode = (SaveLayersModel.Mode)evt.getNewValue(); … … 549 554 ); 550 555 } 551 556 557 @Override 552 558 public void run() { 553 559 model.setMode(SaveLayersModel.Mode.UPLOADING_AND_SAVING); 554 560 List<SaveLayerInfo> toUpload = model.getLayersToUpload(); -
src/org/openstreetmap/josm/gui/io/SaveLayersModel.java
64 64 Collections.sort( 65 65 layerInfo, 66 66 new Comparator<SaveLayerInfo>() { 67 @Override 67 68 public int compare(SaveLayerInfo o1, SaveLayerInfo o2) { 68 69 return o1.compareTo(o2); 69 70 } -
src/org/openstreetmap/josm/gui/io/SaveLayersTable.java
18 18 super.getTableHeader().setReorderingAllowed(false); 19 19 } 20 20 21 @Override 21 22 public void propertyChange(PropertyChangeEvent evt) { 22 23 if (evt.getPropertyName().equals(SaveLayersModel.MODE_PROP)) { 23 24 Mode mode = (Mode)evt.getNewValue(); -
src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java
30 30 needsSave.setPreferredSize(new Dimension(needsSave.getPreferredSize().width, 19)); 31 31 } 32 32 33 @Override 33 34 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, 34 35 boolean hasFocus, int row, int column) { 35 36 JPanel panel = new JPanel(new GridBagLayout()); -
src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java
120 120 /* -------------------------------------------------------------------------- */ 121 121 /* Interface TableChangeListener */ 122 122 /* -------------------------------------------------------------------------- */ 123 @Override 123 124 public void tableChanged(TableModelEvent e) { 124 125 String uploadComment = getUploadComment(); 125 126 changesetCommentModel.setComment(uploadComment); … … 131 132 * 132 133 */ 133 134 class ChangesetCommentObserver implements Observer { 135 @Override 134 136 public void update(Observable o, Object arg) { 135 137 if (!(o instanceof ChangesetCommentModel)) return; 136 138 String newValue = (String)arg; -
src/org/openstreetmap/josm/gui/io/UpdatePrimitivesTask.java
78 78 return; 79 79 } 80 80 GuiHelper.runInEDTAndWait(new Runnable() { 81 @Override 81 82 public void run() { 82 83 layer.mergeFrom(ds); 83 84 layer.onPostDownloadFromServer(); -
src/org/openstreetmap/josm/gui/io/UploadAndSaveProgressRenderer.java
54 54 setVisible(false); 55 55 } 56 56 57 @Override 57 58 public void setCustomText(String message) { 58 59 lblCustomText.setText(message); 59 60 repaint(); 60 61 } 61 62 63 @Override 62 64 public void setIndeterminate(boolean indeterminate) { 63 65 progressBar.setIndeterminate(indeterminate); 64 66 repaint(); 65 67 } 66 68 69 @Override 67 70 public void setMaximum(int maximum) { 68 71 progressBar.setMaximum(maximum); 69 72 repaint(); 70 73 } 71 74 75 @Override 72 76 public void setTaskTitle(String taskTitle) { 73 77 lblTaskTitle.setText(taskTitle); 74 78 repaint(); 75 79 } 76 80 81 @Override 77 82 public void setValue(int value) { 78 83 progressBar.setValue(value); 79 84 repaint(); 80 85 } 81 86 87 @Override 82 88 public void propertyChange(PropertyChangeEvent evt) { 83 89 if (evt.getPropertyName().equals(SaveLayersModel.MODE_PROP)) { 84 90 Mode mode = (Mode)evt.getNewValue(); -
src/org/openstreetmap/josm/gui/io/UploadDialog.java
213 213 // 214 214 pnlBasicUploadSettings.getUploadParameterSummaryPanel().setConfigurationParameterRequestListener( 215 215 new ConfigurationParameterRequestHandler() { 216 @Override 216 217 public void handleUploadStrategyConfigurationRequest() { 217 218 tpConfigPanels.setSelectedIndex(3); 218 219 } 220 @Override 219 221 public void handleChangesetConfigurationRequest() { 220 222 tpConfigPanels.setSelectedIndex(2); 221 223 } … … 224 226 225 227 pnlBasicUploadSettings.setUploadCommentDownFocusTraversalHandler( 226 228 new AbstractAction() { 229 @Override 227 230 public void actionPerformed(ActionEvent e) { 228 231 btnUpload.requestFocusInWindow(); 229 232 } … … 439 442 ); 440 443 } 441 444 445 @Override 442 446 public void actionPerformed(ActionEvent e) { 443 447 if (getUploadComment().trim().length() < 10) { 444 448 if (warnUploadComment()) … … 472 476 putValue(SHORT_DESCRIPTION, tr("Cancel the upload and resume editing")); 473 477 } 474 478 479 @Override 475 480 public void actionPerformed(ActionEvent e) { 476 481 setCanceled(true); 477 482 setVisible(false); … … 505 510 /* -------------------------------------------------------------------------- */ 506 511 /* Interface PropertyChangeListener */ 507 512 /* -------------------------------------------------------------------------- */ 513 @Override 508 514 public void propertyChange(PropertyChangeEvent evt) { 509 515 if (evt.getPropertyName().equals(ChangesetManagementPanel.SELECTED_CHANGESET_PROP)) { 510 516 Changeset cs = (Changeset)evt.getNewValue(); … … 519 525 /* -------------------------------------------------------------------------- */ 520 526 /* Interface PreferenceChangedListener */ 521 527 /* -------------------------------------------------------------------------- */ 528 @Override 522 529 public void preferenceChanged(PreferenceChangeEvent e) { 523 530 if (e.getKey() == null || ! e.getKey().equals("osm-server.url")) 524 531 return; -
src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java
182 182 /* --------------------------------------------------------------------- */ 183 183 /* Interface HyperlinkListener 184 184 /* --------------------------------------------------------------------- */ 185 @Override 185 186 public void hyperlinkUpdate(HyperlinkEvent e) { 186 187 if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) { 187 188 if (e.getDescription() == null || configHandler == null) … … 197 198 /* --------------------------------------------------------------------- */ 198 199 /* Interface PropertyChangeListener 199 200 /* --------------------------------------------------------------------- */ 201 @Override 200 202 public void propertyChange(PropertyChangeEvent evt) { 201 203 if (evt.getPropertyName().equals(ChangesetManagementPanel.SELECTED_CHANGESET_PROP)) { 202 204 selectedChangeset = (Changeset)evt.getNewValue(); -
src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
220 220 // partially uploaded. Better run on EDT. 221 221 // 222 222 Runnable r = new Runnable() { 223 @Override 223 224 public void run() { 224 225 layer.cleanupAfterUpload(processedPrimitives); 225 226 layer.onPostUploadToServer(); … … 317 318 // - to the Upload Dialog 318 319 // - to map editing 319 320 GuiHelper.runInEDT(new Runnable() { 321 @Override 320 322 public void run() { 321 323 // if the changeset is still open after this upload we want it to 322 324 // be selected on the next upload -
src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
209 209 data, 210 210 new Comparator<OsmPrimitive>() { 211 211 private DefaultNameFormatter formatter = DefaultNameFormatter.getInstance(); 212 @Override 212 213 public int compare(OsmPrimitive o1, OsmPrimitive o2) { 213 214 int ret = OsmPrimitiveType.from(o1).compareTo(OsmPrimitiveType.from(o2)); 214 215 if (ret != 0) return ret; … … 232 233 } 233 234 } 234 235 236 @Override 235 237 public Object getElementAt(int index) { 236 238 if (data == null) 237 239 return null; 238 240 return data.get(index); 239 241 } 240 242 243 @Override 241 244 public int getSize() { 242 245 if (data == null) 243 246 return 0; … … 269 272 setEnabled(true); 270 273 } 271 274 275 @Override 272 276 public void actionPerformed(ActionEvent e) { 273 277 setCanceled(true); 274 278 setVisible(false); … … 283 287 updateEnabledState(); 284 288 } 285 289 290 @Override 286 291 public void actionPerformed(ActionEvent e) { 287 292 setCanceled(false); 288 293 setVisible(false); … … 293 298 || lstDeletedPrimitives.getSelectedIndex() >= 0); 294 299 } 295 300 301 @Override 296 302 public void valueChanged(ListSelectionEvent e) { 297 303 updateEnabledState(); 298 304 } -
src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
373 373 tfChunkSize.requestFocusInWindow(); 374 374 } 375 375 376 @Override 376 377 public void propertyChange(PropertyChangeEvent evt) { 377 378 if (evt.getPropertyName().equals(UploadedObjectsSummaryPanel.NUM_OBJECTS_TO_UPLOAD_PROP)) { 378 379 setNumUploadedObjects((Integer)evt.getNewValue()); … … 380 381 } 381 382 382 383 static class TextFieldFocusHandler implements FocusListener { 384 @Override 383 385 public void focusGained(FocusEvent e) { 384 386 Component c = e.getComponent(); 385 387 if (c instanceof JosmTextField) { … … 387 389 tf.selectAll(); 388 390 } 389 391 } 392 @Override 390 393 public void focusLost(FocusEvent e) {} 391 394 } 392 395 … … 425 428 } 426 429 } 427 430 431 @Override 428 432 public void changedUpdate(DocumentEvent arg0) { 429 433 valiateChunkSize(); 430 434 } 431 435 436 @Override 432 437 public void insertUpdate(DocumentEvent arg0) { 433 438 valiateChunkSize(); 434 439 } 435 440 441 @Override 436 442 public void removeUpdate(DocumentEvent arg0) { 437 443 valiateChunkSize(); 438 444 } 439 445 446 @Override 440 447 public void propertyChange(PropertyChangeEvent evt) { 441 448 if (evt.getSource() == tfChunkSize 442 449 && evt.getPropertyName().equals("enabled") … … 453 460 firePropertyChange(UPLOAD_STRATEGY_SPECIFICATION_PROP, null, getUploadStrategySpecification()); 454 461 } 455 462 463 @Override 456 464 public void itemStateChanged(ItemEvent e) { 457 465 UploadStrategy strategy = getUploadStrategy(); 458 466 if (strategy == null) return; … … 467 475 notifyStrategy(); 468 476 } 469 477 478 @Override 470 479 public void focusGained(FocusEvent arg0) {} 471 480 481 @Override 472 482 public void focusLost(FocusEvent arg0) { 473 483 notifyStrategy(); 474 484 } 475 485 486 @Override 476 487 public void actionPerformed(ActionEvent arg0) { 477 488 notifyStrategy(); 478 489 } -
src/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanel.java
173 173 fireContentsChanged(this,0,getSize()); 174 174 } 175 175 176 @Override 176 177 public Object getElementAt(int index) { 177 178 if (primitives == null) return null; 178 179 return primitives.get(index); 179 180 } 180 181 182 @Override 181 183 public int getSize() { 182 184 if (primitives == null) return 0; 183 185 return primitives.size(); -
src/org/openstreetmap/josm/gui/layer/Layer.java
378 378 this.layer = layer; 379 379 } 380 380 381 @Override 381 382 public void actionPerformed(ActionEvent e) { 382 383 SaveAction.getInstance().doSave(layer); 383 384 } … … 393 394 this.layer = layer; 394 395 } 395 396 397 @Override 396 398 public void actionPerformed(ActionEvent e) { 397 399 SaveAsAction.getInstance().doSave(layer); 398 400 } … … 408 410 this.layer = layer; 409 411 } 410 412 413 @Override 411 414 public void actionPerformed(ActionEvent e) { 412 415 new GpxExportAction().export(layer); 413 416 } -
src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
137 137 public int deletedWays; 138 138 public int deletedRelations; 139 139 140 @Override 140 141 public void visit(final Node n) { 141 142 nodes++; 142 143 if (n.isDeleted()) { … … 144 145 } 145 146 } 146 147 148 @Override 147 149 public void visit(final Way w) { 148 150 ways++; 149 151 if (w.isDeleted()) { … … 151 153 } 152 154 } 153 155 156 @Override 154 157 public void visit(final Relation r) { 155 158 relations++; 156 159 if (r.isDeleted()) { … … 597 600 super(tr("Convert to GPX layer"), ImageProvider.get("converttogpx")); 598 601 putValue("help", ht("/Action/ConvertToGpxLayer")); 599 602 } 603 @Override 600 604 public void actionPerformed(ActionEvent e) { 601 605 Main.main.addLayer(new GpxLayer(toGpxData(), tr("Converted from: {0}", getName()))); 602 606 Main.main.removeLayer(OsmDataLayer.this); … … 693 697 super(tr("Dataset consistency test")); 694 698 } 695 699 700 @Override 696 701 public void actionPerformed(ActionEvent e) { 697 702 String result = DatasetConsistencyTest.runTests(data); 698 703 if (result.length() == 0) { … … 715 720 DataSet.removeSelectionListener(this); 716 721 } 717 722 723 @Override 718 724 public void processDatasetEvent(AbstractDatasetChangedEvent event) { 719 725 isChanged = true; 720 726 setRequiresSaveToFile(true); 721 727 setRequiresUploadToServer(true); 722 728 } 723 729 730 @Override 724 731 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 725 732 isChanged = true; 726 733 } -
src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
133 133 */ 134 134 private class LoadGpxDataActionListener implements ActionListener { 135 135 136 @Override 136 137 public void actionPerformed(ActionEvent arg0) { 137 138 FileFilter filter = new FileFilter(){ 138 139 @Override public boolean accept(File f) { … … 228 229 ImageDisplay imgDisp; 229 230 JList imgList; 230 231 232 @Override 231 233 public void actionPerformed(ActionEvent arg0) { 232 234 SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 233 235 … … 328 330 panelLst.setLayout(new BorderLayout()); 329 331 330 332 imgList = new JList(new AbstractListModel() { 333 @Override 331 334 public Object getElementAt(int i) { 332 335 return yLayer.data.get(i).getFile().getName(); 333 336 } 334 337 338 @Override 335 339 public int getSize() { 336 340 return yLayer.data.size(); 337 341 } … … 339 343 imgList.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 340 344 imgList.getSelectionModel().addListSelectionListener(new ListSelectionListener() { 341 345 346 @Override 342 347 public void valueChanged(ListSelectionEvent arg0) { 343 348 int index = imgList.getSelectedIndex(); 344 349 Integer orientation = null; … … 367 372 JButton openButton = new JButton(tr("Open another photo")); 368 373 openButton.addActionListener(new ActionListener() { 369 374 375 @Override 370 376 public void actionPerformed(ActionEvent arg0) { 371 377 JFileChooser fc = DiskAccessAction.createAndOpenFileChooser(true, false, null, JpegFileFilter.getInstance(), JFileChooser.FILES_ONLY, "geoimage.lastdirectory"); 372 378 if (fc == null) … … 440 446 } 441 447 } 442 448 449 @Override 443 450 public void actionPerformed(ActionEvent arg0) { 444 451 // Construct the list of loaded GPX tracks 445 452 Collection<Layer> layerLst = Main.map.mapView.getAllLayers(); … … 770 777 this.doRepaint = doRepaint; 771 778 } 772 779 780 @Override 773 781 public void insertUpdate(DocumentEvent ev) { 774 782 updateStatusBar(); 775 783 } 784 @Override 776 785 public void removeUpdate(DocumentEvent ev) { 777 786 updateStatusBar(); 778 787 } 788 @Override 779 789 public void changedUpdate(DocumentEvent ev) { 780 790 } 791 @Override 781 792 public void itemStateChanged(ItemEvent e) { 782 793 updateStatusBar(); 783 794 } 795 @Override 784 796 public void actionPerformed(ActionEvent e) { 785 797 updateStatusBar(); 786 798 } … … 828 840 829 841 RepaintTheMapListener repaintTheMap = new RepaintTheMapListener(); 830 842 private class RepaintTheMapListener implements FocusListener { 843 @Override 831 844 public void focusGained(FocusEvent e) { // do nothing 832 845 } 833 846 847 @Override 834 848 public void focusLost(FocusEvent e) { 835 849 yLayer.updateBufferAndRepaint(); 836 850 } … … 841 855 */ 842 856 private class AdjustActionListener implements ActionListener { 843 857 858 @Override 844 859 public void actionPerformed(ActionEvent arg0) { 845 860 846 861 long diff = delta + Math.round(timezone*60*60); … … 891 906 // This is called whenever one of the sliders is moved. 892 907 // It updates the labels and also calls the "match photos" code 893 908 class sliderListener implements ChangeListener { 909 @Override 894 910 public void stateChanged(ChangeEvent e) { 895 911 // parse slider position into real timezone 896 912 double tz = Math.abs(sldTimezone.getValue()); … … 974 990 975 991 private class AutoGuessActionListener implements ActionListener { 976 992 993 @Override 977 994 public void actionPerformed(ActionEvent arg0) { 978 995 GpxDataWrapper gpxW = selectedGPX(true); 979 996 if (gpxW == null) … … 1095 1112 } 1096 1113 1097 1114 Collections.sort(dateImgLst, new Comparator<ImageEntry>() { 1115 @Override 1098 1116 public int compare(ImageEntry arg0, ImageEntry arg1) { 1099 1117 return arg0.getExifTime().compareTo(arg1.getExifTime()); 1100 1118 } -
src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
763 763 }; 764 764 765 765 mapModeListener = new MapModeChangeListener() { 766 @Override 766 767 public void mapModeChange(MapMode oldMapMode, MapMode newMapMode) { 767 768 if (newMapMode == null || (newMapMode instanceof org.openstreetmap.josm.actions.mapmode.SelectAction)) { 768 769 Main.map.mapView.addMouseListener(mouseAdapter); … … 776 777 mapModeListener.mapModeChange(null, Main.map.mapMode); 777 778 778 779 MapView.addLayerChangeListener(new LayerChangeListener() { 780 @Override 779 781 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 780 782 if (newLayer == GeoImageLayer.this) { 781 783 // only in select mode it is possible to click the images … … 783 785 } 784 786 } 785 787 788 @Override 786 789 public void layerAdded(Layer newLayer) { 787 790 } 788 791 792 @Override 789 793 public void layerRemoved(Layer oldLayer) { 790 794 if (oldLayer == GeoImageLayer.this) { 791 795 if (thumbsloader != null) { … … 809 813 } 810 814 } 811 815 816 @Override 812 817 public void propertyChange(PropertyChangeEvent evt) { 813 818 if (NavigatableComponent.PROPNAME_CENTER.equals(evt.getPropertyName()) || NavigatableComponent.PROPNAME_SCALE.equals(evt.getPropertyName())) { 814 819 updateOffscreenBuffer = true; … … 842 847 return gpxLayer; 843 848 } 844 849 850 @Override 845 851 public void jumpToNextMarker() { 846 852 showNextPhoto(); 847 853 } 848 854 855 @Override 849 856 public void jumpToPreviousMarker() { 850 857 showPreviousPhoto(); 851 858 } -
src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
66 66 this.orientation = orientation == null ? -1 : orientation; 67 67 } 68 68 69 @Override 69 70 public void run() { 70 71 Image img = Toolkit.getDefaultToolkit().createImage(file.getPath()); 71 72 tracker.addImage(img, 1); … … 159 160 160 161 /** Zoom in and out, trying to preserve the point of the image that was under the mouse cursor 161 162 * at the same place */ 163 @Override 162 164 public void mouseWheelMoved(MouseWheelEvent e) { 163 165 File file; 164 166 Image image; … … 231 233 } 232 234 233 235 /** Center the display on the point that has been clicked */ 236 @Override 234 237 public void mouseClicked(MouseEvent e) { 235 238 // Move the center to the clicked point. 236 239 File file; … … 268 271 269 272 /** Initialize the dragging, either with button 1 (simple dragging) or button 3 (selection of 270 273 * a picture part) */ 274 @Override 271 275 public void mousePressed(MouseEvent e) { 272 276 if (image == null) { 273 277 mouseIsDragging = false; … … 302 306 } 303 307 } 304 308 309 @Override 305 310 public void mouseDragged(MouseEvent e) { 306 311 if (! mouseIsDragging && selectedRect == null) 307 312 return; … … 350 355 351 356 } 352 357 358 @Override 353 359 public void mouseReleased(MouseEvent e) { 354 360 if (! mouseIsDragging && selectedRect == null) 355 361 return; … … 413 419 } 414 420 } 415 421 422 @Override 416 423 public void mouseEntered(MouseEvent e) { 417 424 } 418 425 426 @Override 419 427 public void mouseExited(MouseEvent e) { 420 428 } 421 429 430 @Override 422 431 public void mouseMoved(MouseEvent e) { 423 432 } 424 433 -
src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
135 135 return (ImageEntry) c; 136 136 } 137 137 138 @Override 138 139 public int compareTo(ImageEntry image) { 139 140 if (exifTime != null && image.exifTime != null) 140 141 return exifTime.compareTo(image.exifTime); -
src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
167 167 putValue(SMALL_ICON, icon); 168 168 } 169 169 170 @Override 170 171 public void actionPerformed(ActionEvent e) { 171 172 if (COMMAND_NEXT.equals(action)) { 172 173 if (currentLayer != null) { -
src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
34 34 } 35 35 } 36 36 37 @Override 37 38 public void run() { 38 39 System.err.println("Load Thumbnails"); 39 40 tracker = new MediaTracker(Main.map.mapView); -
src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java
42 42 this.data = data; 43 43 } 44 44 45 @Override 45 46 public void actionPerformed(ActionEvent e) { 46 47 final List<LatLon> points = new ArrayList<LatLon>(); 47 48 for (GpxTrack trk : data.tracks) { -
src/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarker.java
54 54 p2.add(scale); 55 55 p.add(p2, BorderLayout.SOUTH); 56 56 scale.addActionListener(new ActionListener(){ 57 @Override 57 58 public void actionPerformed(ActionEvent ev) { 58 59 p.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); 59 60 if (scale.getModel().isSelected()) { -
src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
342 342 return ret; 343 343 } 344 344 345 @Override 345 346 public void jumpToNextMarker() { 346 347 if (currentMarker == null) { 347 348 currentMarker = data.get(0); … … 359 360 Main.map.mapView.zoomTo(currentMarker.getEastNorth()); 360 361 } 361 362 363 @Override 362 364 public void jumpToPreviousMarker() { 363 365 if (currentMarker == null) { 364 366 currentMarker = data.get(data.size() - 1); … … 461 463 } 462 464 463 465 466 @Override 464 467 public void actionPerformed(ActionEvent e) { 465 468 Main.pref.put("marker.show "+layer.getName(), layer.isTextOrIconShown() ? "hide" : "show"); 466 469 Main.map.mapView.repaint(); -
src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
286 286 if (timer == null) { 287 287 animationInterval = Main.pref.getDouble("marker.audioanimationinterval", 1.0); //milliseconds 288 288 timer = new Timer((int)(animationInterval * 1000.0), new ActionListener() { 289 @Override 289 290 public void actionPerformed(ActionEvent e) { 290 291 timerAction(); 291 292 } -
src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
50 50 super(entry); 51 51 } 52 52 53 @Override 53 54 protected void init() { 54 55 super.init(); 55 56 icons.clear(); … … 89 90 } 90 91 } 91 92 93 @Override 92 94 public InputStream getSourceInputStream() throws IOException { 93 95 MirroredInputStream in = new MirroredInputStream(url); 94 96 InputStream zip = in.getZipEntry("xml", "style"); -
src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
280 280 class UseDefaultItemListener implements ItemListener { 281 281 private boolean enabled; 282 282 283 @Override 283 284 public void itemStateChanged(ItemEvent e) { 284 285 if (!enabled) return; 285 286 switch (e.getStateChange()) { -
src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBox.java
75 75 } 76 76 } 77 77 78 @Override 78 79 public Component getListCellRendererComponent(JList list, Object value, int idx, boolean isSelected, boolean hasFocus) { 79 80 AuthorizationProcedure procedure = (AuthorizationProcedure)value; 80 81 renderColors(isSelected); -
src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
339 339 updateEnabledState(); 340 340 } 341 341 342 @Override 342 343 public void actionPerformed(ActionEvent evt) { 343 344 Main.worker.submit(new FullyAutomaticAuthorisationTask(FullyAutomaticAuthorizationUI.this)); 344 345 } … … 347 348 setEnabled(valPassword.isValid() && valUserName.isValid()); 348 349 } 349 350 351 @Override 350 352 public void changedUpdate(DocumentEvent e) { 351 353 updateEnabledState(); 352 354 } 353 355 356 @Override 354 357 public void insertUpdate(DocumentEvent e) { 355 358 updateEnabledState(); 356 359 } 357 360 361 @Override 358 362 public void removeUpdate(DocumentEvent e) { 359 363 updateEnabledState(); 360 364 } … … 370 374 putValue(SMALL_ICON, ImageProvider.get("dialogs", "previous")); 371 375 } 372 376 377 @Override 373 378 public void actionPerformed(ActionEvent arg0) { 374 379 prepareUIForEnteringRequest(); 375 380 } … … 385 390 putValue(SMALL_ICON, ImageProvider.get("about")); 386 391 } 387 392 393 @Override 388 394 public void actionPerformed(ActionEvent arg0) { 389 395 Main.worker.submit(new TestAccessTokenTask( 390 396 FullyAutomaticAuthorizationUI.this, … … 510 516 511 517 protected void handleException(final OsmOAuthAuthorizationException e) { 512 518 Runnable r = new Runnable() { 519 @Override 513 520 public void run() { 514 521 if (e instanceof OsmLoginFailedException) { 515 522 alertLoginFailed((OsmLoginFailedException)e); … … 549 556 getProgressMonitor().worked(1); 550 557 if (canceled)return; 551 558 GuiHelper.runInEDT(new Runnable() { 559 @Override 552 560 public void run() { 553 561 prepareUIForResultDisplay(); 554 562 setAccessToken(accessToken); -
src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java
224 224 setAccessToken(new OAuthToken(tfAccessTokenKey.getText().trim(), tfAccessTokenSecret.getText().trim())); 225 225 } 226 226 } 227 @Override 227 228 public void changedUpdate(DocumentEvent e) { 228 229 build(); 229 230 } 230 231 232 @Override 231 233 public void insertUpdate(DocumentEvent e) { 232 234 build(); 233 235 } 234 236 237 @Override 235 238 public void removeUpdate(DocumentEvent e) { 236 239 build(); 237 240 } … … 248 251 updateEnabledState(); 249 252 } 250 253 254 @Override 251 255 public void actionPerformed(ActionEvent evt) { 252 256 TestAccessTokenTask task = new TestAccessTokenTask( 253 257 ManualAuthorizationUI.this, … … 262 266 setEnabled(hasAccessToken()); 263 267 } 264 268 269 @Override 265 270 public void propertyChange(PropertyChangeEvent evt) { 266 271 if (! evt.getPropertyName().equals(AbstractAuthorizationUI.ACCESS_TOKEN_PROP)) 267 272 return; -
src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java
175 175 spAuthorisationProcedureUI.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); 176 176 spAuthorisationProcedureUI.getVerticalScrollBar().addComponentListener( 177 177 new ComponentListener() { 178 @Override 178 179 public void componentShown(ComponentEvent e) { 179 180 spAuthorisationProcedureUI.setBorder(UIManager.getBorder("ScrollPane.border")); 180 181 } 181 182 183 @Override 182 184 public void componentHidden(ComponentEvent e) { 183 185 spAuthorisationProcedureUI.setBorder(null); 184 186 } 185 187 188 @Override 186 189 public void componentResized(ComponentEvent e) {} 190 @Override 187 191 public void componentMoved(ComponentEvent e) {} 188 192 } 189 193 ); … … 305 309 } 306 310 307 311 class AuthorisationProcedureChangeListener implements ItemListener { 312 @Override 308 313 public void itemStateChanged(ItemEvent arg0) { 309 314 refreshAuthorisationProcedurePanel(); 310 315 } … … 322 327 setVisible(false); 323 328 } 324 329 330 @Override 325 331 public void actionPerformed(ActionEvent evt) { 326 332 cancel(); 327 333 } … … 337 343 updateEnabledState(null); 338 344 } 339 345 346 @Override 340 347 public void actionPerformed(ActionEvent evt) { 341 348 setCanceled(false); 342 349 setVisible(false); … … 346 353 setEnabled(token != null); 347 354 } 348 355 356 @Override 349 357 public void propertyChange(PropertyChangeEvent evt) { 350 358 if (!evt.getPropertyName().equals(AbstractAuthorizationUI.ACCESS_TOKEN_PROP)) 351 359 return; … … 362 370 } 363 371 364 372 static class ExternalBrowserLauncher implements HyperlinkListener { 373 @Override 365 374 public void hyperlinkUpdate(HyperlinkEvent e) { 366 375 if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { 367 376 OpenBrowser.displayUrl(e.getDescription()); -
src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java
127 127 cbShowAdvancedParameters.setSelected(false); 128 128 cbShowAdvancedParameters.addItemListener( 129 129 new ItemListener() { 130 @Override 130 131 public void itemStateChanged(ItemEvent evt) { 131 132 getAdvancedPropertiesPanel().setVisible(evt.getStateChange() == ItemEvent.SELECTED); 132 133 } … … 284 285 putValue(SMALL_ICON, ImageProvider.get("dialogs", "previous")); 285 286 } 286 287 288 @Override 287 289 public void actionPerformed(ActionEvent arg0) { 288 290 transitionToRetrieveRequestToken(); 289 291 } … … 358 360 putValue(SMALL_ICON, ImageProvider.get("dialogs", "previous")); 359 361 } 360 362 363 @Override 361 364 public void actionPerformed(ActionEvent arg0) { 362 365 transitionToRetrieveRequestToken(); 363 366 } … … 379 382 putValue(SHORT_DESCRIPTION, tr("Click to retrieve a Request Token")); 380 383 } 381 384 385 @Override 382 386 public void actionPerformed(ActionEvent evt) { 383 387 final RetrieveRequestTokenTask task = new RetrieveRequestTokenTask( 384 388 SemiAutomaticAuthorizationUI.this, … … 386 390 ); 387 391 Main.worker.submit(task); 388 392 Runnable r = new Runnable() { 393 @Override 389 394 public void run() { 390 395 if (task.isCanceled()) return; 391 396 if (task.getRequestToken() == null) return; 392 397 requestToken = task.getRequestToken(); 393 398 SwingUtilities.invokeLater(new Runnable() { 399 @Override 394 400 public void run() { 395 401 transitionToRetrieveAccessToken(); 396 402 } … … 412 418 putValue(SHORT_DESCRIPTION, tr("Click to retrieve an Access Token")); 413 419 } 414 420 421 @Override 415 422 public void actionPerformed(ActionEvent evt) { 416 423 final RetrieveAccessTokenTask task = new RetrieveAccessTokenTask( 417 424 SemiAutomaticAuthorizationUI.this, … … 420 427 ); 421 428 Main.worker.submit(task); 422 429 Runnable r = new Runnable() { 430 @Override 423 431 public void run() { 424 432 if (task.isCanceled()) return; 425 433 if (task.getAccessToken() == null) return; 426 434 setAccessToken(task.getAccessToken()); 427 435 SwingUtilities.invokeLater(new Runnable() { 436 @Override 428 437 public void run() { 429 438 transitionToShowAccessToken(); 430 439 } … … 446 455 putValue(SHORT_DESCRIPTION, tr("Click to test the Access Token")); 447 456 } 448 457 458 @Override 449 459 public void actionPerformed(ActionEvent evt) { 450 460 TestAccessTokenTask task = new TestAccessTokenTask( 451 461 SemiAutomaticAuthorizationUI.this, -
src/org/openstreetmap/josm/gui/preferences/AudioPreference.java
29 29 public class AudioPreference extends DefaultTabPreferenceSetting { 30 30 31 31 public static class Factory implements PreferenceSettingFactory { 32 @Override 32 33 public PreferenceSetting createPreferenceSetting() { 33 34 return new AudioPreference(); 34 35 } … … 54 55 private JosmTextField audioFastForwardMultiplier = new JosmTextField(8); 55 56 private JosmTextField audioCalibration = new JosmTextField(8); 56 57 58 @Override 57 59 public void addGui(PreferenceTabbedPane gui) { 58 60 JPanel audio = new JPanel(new GridBagLayout()); 59 61 … … 124 126 createPreferenceTabWithScrollPane(gui, audio); 125 127 } 126 128 129 @Override 127 130 public boolean ok() { 128 131 Main.pref.put("audio.menuinvisible", ! audioMenuVisible.isSelected()); 129 132 Main.pref.put("marker.traceaudio", markerAudioTraceVisible.isSelected()); -
src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
55 55 56 56 public class PluginPreference extends DefaultTabPreferenceSetting { 57 57 public static class Factory implements PreferenceSettingFactory { 58 @Override 58 59 public PreferenceSetting createPreferenceSetting() { 59 60 return new PluginPreference(); 60 61 } … … 170 171 return pane; 171 172 } 172 173 174 @Override 173 175 public void addGui(final PreferenceTabbedPane gui) { 174 176 GridBagConstraints gc = new GridBagConstraints(); 175 177 gc.weightx = 1.0; … … 224 226 return model != null ? model.getPluginsScheduledForUpdateOrDownload() : null; 225 227 } 226 228 229 @Override 227 230 public boolean ok() { 228 231 if (! pluginPreferencesActivated) 229 232 return false; … … 246 249 public void readLocalPluginInformation() { 247 250 final ReadLocalPluginInformationTask task = new ReadLocalPluginInformationTask(); 248 251 Runnable r = new Runnable() { 252 @Override 249 253 public void run() { 250 254 if (task.isCanceled()) return; 251 255 SwingUtilities.invokeLater(new Runnable() { 256 @Override 252 257 public void run() { 253 258 model.setAvailablePlugins(task.getAvailablePlugins()); 254 259 pnlPluginPreferences.refreshView(); … … 272 277 putValue(SMALL_ICON, ImageProvider.get("download")); 273 278 } 274 279 280 @Override 275 281 public void actionPerformed(ActionEvent e) { 276 282 final ReadRemotePluginInformationTask task = new ReadRemotePluginInformationTask(Main.pref.getPluginSites()); 277 283 Runnable continuation = new Runnable() { 284 @Override 278 285 public void run() { 279 286 if (task.isCanceled()) return; 280 287 SwingUtilities.invokeLater(new Runnable() { 288 @Override 281 289 public void run() { 282 290 model.updateAvailablePlugins(task.getAvailablePlugins()); 283 291 pnlPluginPreferences.refreshView(); … … 329 337 protected void alertNothingToUpdate() { 330 338 try { 331 339 SwingUtilities.invokeAndWait(new Runnable() { 340 @Override 332 341 public void run() { 333 342 HelpAwareOptionPane.showOptionDialog( 334 343 pnlPluginPreferences, … … 344 353 } 345 354 } 346 355 356 @Override 347 357 public void actionPerformed(ActionEvent e) { 348 358 final List<PluginInformation> toUpdate = model.getSelectedPlugins(); 349 359 // the async task for downloading plugins … … 358 368 // to be run asynchronously after the plugin download 359 369 // 360 370 final Runnable pluginDownloadContinuation = new Runnable() { 371 @Override 361 372 public void run() { 362 373 if (pluginDownloadTask.isCanceled()) 363 374 return; … … 375 386 // to be run asynchronously after the plugin list download 376 387 // 377 388 final Runnable pluginInfoDownloadContinuation = new Runnable() { 389 @Override 378 390 public void run() { 379 391 if (pluginInfoDownloadTask.isCanceled()) 380 392 return; … … 415 427 putValue(SMALL_ICON, ImageProvider.get("dialogs", "settings")); 416 428 } 417 429 430 @Override 418 431 public void actionPerformed(ActionEvent e) { 419 432 configureSites(); 420 433 } … … 434 447 pnlPluginPreferences.refreshView(); 435 448 } 436 449 450 @Override 437 451 public void changedUpdate(DocumentEvent arg0) { 438 452 filter(); 439 453 } 440 454 455 @Override 441 456 public void insertUpdate(DocumentEvent arg0) { 442 457 filter(); 443 458 } 444 459 460 @Override 445 461 public void removeUpdate(DocumentEvent arg0) { 446 462 filter(); 447 463 } … … 462 478 add(new JScrollPane(list), GBC.std().fill()); 463 479 JPanel buttons = new JPanel(new GridBagLayout()); 464 480 buttons.add(new JButton(new AbstractAction(tr("Add")){ 481 @Override 465 482 public void actionPerformed(ActionEvent e) { 466 483 String s = JOptionPane.showInputDialog( 467 484 JOptionPane.getFrameForComponent(PluginConfigurationSitesPanel.this), … … 475 492 } 476 493 }), GBC.eol().fill(GBC.HORIZONTAL)); 477 494 buttons.add(new JButton(new AbstractAction(tr("Edit")){ 495 @Override 478 496 public void actionPerformed(ActionEvent e) { 479 497 if (list.getSelectedValue() == null) { 480 498 JOptionPane.showMessageDialog( … … 500 518 } 501 519 }), GBC.eol().fill(GBC.HORIZONTAL)); 502 520 buttons.add(new JButton(new AbstractAction(tr("Delete")){ 521 @Override 503 522 public void actionPerformed(ActionEvent event) { 504 523 if (list.getSelectedValue() == null) { 505 524 JOptionPane.showMessageDialog( -
src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
47 47 JCheckBox expert = new JCheckBox(tr("Expert mode")); 48 48 expert.setSelected(ExpertToggleAction.isExpert()); 49 49 expert.addActionListener(new ActionListener() { 50 @Override 50 51 public void actionPerformed(ActionEvent e) { 51 52 ExpertToggleAction.getInstance().actionPerformed(null); 52 53 } … … 151 152 tpPreferences.validationListeners.clear(); 152 153 } 153 154 155 @Override 154 156 public void actionPerformed(ActionEvent evt) { 155 157 cancel(); 156 158 } … … 163 165 putValue(SHORT_DESCRIPTION, tr("Save the preferences and close the dialog")); 164 166 } 165 167 168 @Override 166 169 public void actionPerformed(ActionEvent evt) { 167 170 for (ValidationListener listener: tpPreferences.validationListeners) { 168 171 if (!listener.validatePreferences()) -
src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
266 266 // this is the task which will run *after* the plugins are downloaded 267 267 // 268 268 final Runnable continuation = new Runnable() { 269 @Override 269 270 public void run() { 270 271 boolean requiresRestart = false; 271 272 if (task != null && !task.isCanceled()) { … … 331 332 Main.worker.submit(task); 332 333 Main.worker.submit( 333 334 new Runnable() { 335 @Override 334 336 public void run() { 335 337 SwingUtilities.invokeLater(continuation); 336 338 } … … 470 472 * This mouse wheel listener reacts when a scroll is carried out over the 471 473 * tab strip and scrolls one tab/down or up, selecting it immediately. 472 474 */ 475 @Override 473 476 public void mouseWheelMoved(MouseWheelEvent wev) { 474 477 // Ensure the cursor is over the tab strip 475 478 if(super.indexAtLocation(wev.getPoint().x, wev.getPoint().y) < 0) -
src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java
20 20 public class ServerAccessPreference extends DefaultTabPreferenceSetting { 21 21 22 22 public static class Factory implements PreferenceSettingFactory { 23 @Override 23 24 public PreferenceSetting createPreferenceSetting() { 24 25 return new ServerAccessPreference(); 25 26 } … … 105 106 return pnl; 106 107 } 107 108 109 @Override 108 110 public void addGui(PreferenceTabbedPane gui) { 109 111 GridBagConstraints gc = new GridBagConstraints(); 110 112 gc.fill = GridBagConstraints.BOTH; … … 128 130 /** 129 131 * Saves the values to the preferences 130 132 */ 133 @Override 131 134 public boolean ok() { 132 135 pnlApiUrlPreferences.saveToPreferences(); 133 136 pnlAuthPreferences.saveToPreferences(); -
src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
483 483 this.data = new ArrayList<SourceEntry>(); 484 484 } 485 485 486 @Override 486 487 public int getColumnCount() { 487 488 return isMapPaint ? 2 : 1; 488 489 } 489 490 491 @Override 490 492 public int getRowCount() { 491 493 return data == null ? 0 : data.size(); 492 494 } … … 747 749 } 748 750 } 749 751 752 @Override 750 753 public void actionPerformed(ActionEvent e) { 751 754 FileFilter ff; 752 755 if (isMapPaint) { … … 787 790 putValue(SMALL_ICON, ImageProvider.get("dialogs", "add")); 788 791 } 789 792 793 @Override 790 794 public void actionPerformed(ActionEvent evt) { 791 795 EditSourceEntryDialog editEntryDialog = new EditSourceEntryDialog( 792 796 SourceEditor.this, … … 819 823 setEnabled(tblActiveSources.getSelectedRowCount() > 0); 820 824 } 821 825 826 @Override 822 827 public void valueChanged(ListSelectionEvent e) { 823 828 updateEnabledState(); 824 829 } 825 830 831 @Override 826 832 public void actionPerformed(ActionEvent e) { 827 833 activeSourcesModel.removeSelected(); 828 834 } … … 840 846 setEnabled(tblActiveSources.getSelectedRowCount() == 1); 841 847 } 842 848 849 @Override 843 850 public void valueChanged(ListSelectionEvent e) { 844 851 updateEnabledState(); 845 852 } 846 853 854 @Override 847 855 public void actionPerformed(ActionEvent evt) { 848 856 int pos = tblActiveSources.getSelectedRow(); 849 857 if (pos < 0 || pos >= tblActiveSources.getRowCount()) … … 891 899 activeSourcesModel.move(increment); 892 900 } 893 901 902 @Override 894 903 public void valueChanged(ListSelectionEvent e) { 895 904 updateEnabledState(); 896 905 } 897 906 907 @Override 898 908 public void tableChanged(TableModelEvent e) { 899 909 updateEnabledState(); 900 910 } … … 911 921 setEnabled(lstAvailableSources.getSelectedIndices().length > 0); 912 922 } 913 923 924 @Override 914 925 public void valueChanged(ListSelectionEvent e) { 915 926 updateEnabledState(); 916 927 } 917 928 929 @Override 918 930 public void actionPerformed(ActionEvent e) { 919 931 List<ExtendedSourceEntry> sources = availableSourcesModel.getSelected(); 920 932 int josmVersion = Version.getInstance().getVersion(); … … 960 972 putValue(SMALL_ICON, ImageProvider.get("preferences", "reset")); 961 973 } 962 974 975 @Override 963 976 public void actionPerformed(ActionEvent e) { 964 977 activeSourcesModel.setActiveSources(getDefault()); 965 978 } … … 976 989 this.sourceProviders = sourceProviders; 977 990 } 978 991 992 @Override 979 993 public void actionPerformed(ActionEvent e) { 980 994 MirroredInputStream.cleanup(url); 981 995 reloadAvailableSources(url, sourceProviders); … … 991 1005 this.data = new ArrayList<String>(); 992 1006 } 993 1007 1008 @Override 994 1009 public int getColumnCount() { 995 1010 return 1; 996 1011 } 997 1012 1013 @Override 998 1014 public int getRowCount() { 999 1015 return data == null ? 0 : data.size(); 1000 1016 } 1001 1017 1018 @Override 1002 1019 public Object getValueAt(int rowIndex, int columnIndex) { 1003 1020 return data.get(rowIndex); 1004 1021 } … … 1063 1080 Collections.sort( 1064 1081 data, 1065 1082 new Comparator<String>() { 1083 @Override 1066 1084 public int compare(String o1, String o2) { 1067 1085 if (o1.equals("") && o2.equals("")) 1068 1086 return 0; … … 1086 1104 putValue(SMALL_ICON, ImageProvider.get("dialogs", "add")); 1087 1105 } 1088 1106 1107 @Override 1089 1108 public void actionPerformed(ActionEvent e) { 1090 1109 iconPathsModel.addPath(""); 1091 1110 tblIconPaths.editCellAt(iconPathsModel.getRowCount() -1,0); … … 1104 1123 setEnabled(tblIconPaths.getSelectedRowCount() > 0); 1105 1124 } 1106 1125 1126 @Override 1107 1127 public void valueChanged(ListSelectionEvent e) { 1108 1128 updateEnabledState(); 1109 1129 } 1110 1130 1131 @Override 1111 1132 public void actionPerformed(ActionEvent e) { 1112 1133 iconPathsModel.removeSelected(); 1113 1134 } … … 1125 1146 setEnabled(tblIconPaths.getSelectedRowCount() == 1); 1126 1147 } 1127 1148 1149 @Override 1128 1150 public void valueChanged(ListSelectionEvent e) { 1129 1151 updateEnabledState(); 1130 1152 } 1131 1153 1154 @Override 1132 1155 public void actionPerformed(ActionEvent e) { 1133 1156 int row = tblIconPaths.getSelectedRow(); 1134 1157 tblIconPaths.editCellAt(row, 0); … … 1136 1159 } 1137 1160 1138 1161 static class SourceEntryListCellRenderer extends JLabel implements ListCellRenderer { 1162 @Override 1139 1163 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 1140 1164 boolean cellHasFocus) { 1141 1165 String s = value.toString(); … … 1357 1381 build(); 1358 1382 } 1359 1383 1384 @Override 1360 1385 public void addCellEditorListener(CellEditorListener l) { 1361 1386 if (l != null) { 1362 1387 listeners.addIfAbsent(l); … … 1375 1400 } 1376 1401 } 1377 1402 1403 @Override 1378 1404 public void cancelCellEditing() { 1379 1405 fireEditingCanceled(); 1380 1406 } 1381 1407 1408 @Override 1382 1409 public Object getCellEditorValue() { 1383 1410 return value; 1384 1411 } 1385 1412 1413 @Override 1386 1414 public boolean isCellEditable(EventObject anEvent) { 1387 1415 if (anEvent instanceof MouseEvent) 1388 1416 return ((MouseEvent)anEvent).getClickCount() >= 2; 1389 1417 return true; 1390 1418 } 1391 1419 1420 @Override 1392 1421 public void removeCellEditorListener(CellEditorListener l) { 1393 1422 listeners.remove(l); 1394 1423 } 1395 1424 1425 @Override 1396 1426 public boolean shouldSelectCell(EventObject anEvent) { 1397 1427 return true; 1398 1428 } 1399 1429 1430 @Override 1400 1431 public boolean stopCellEditing() { 1401 1432 value = tfFileName.getText(); 1402 1433 fireEditingStopped(); … … 1412 1443 } 1413 1444 } 1414 1445 1446 @Override 1415 1447 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 1416 1448 setInitialValue((String)value); 1417 1449 tfFileName.selectAll(); … … 1450 1482 } 1451 1483 } 1452 1484 1485 @Override 1453 1486 public void actionPerformed(ActionEvent e) { 1454 1487 JFileChooserManager fcm = new JFileChooserManager(true).createFileChooser(); 1455 1488 if (!isFile) { -
src/org/openstreetmap/josm/gui/preferences/ValidatorPreference.java
95 95 testPanel.add(prefOtherUpload, GBC.eol()); 96 96 97 97 ActionListener otherUploadEnabled = new ActionListener() { 98 @Override 98 99 public void actionPerformed(ActionEvent e) { 99 100 prefOtherUpload.setEnabled(prefOther.isSelected()); 100 101 } -
src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java
104 104 } 105 105 106 106 class EntryListModel extends AbstractListModel { 107 @Override 107 108 public Object getElementAt(int index) { 108 109 return (index+1) + ": " + data.get(index).toString(); 109 110 } 110 111 112 @Override 111 113 public int getSize() { 112 114 return data.size(); 113 115 } … … 130 132 putValue(SMALL_ICON, ImageProvider.get("dialogs", "add")); 131 133 } 132 134 135 @Override 133 136 public void actionPerformed(ActionEvent evt) { 134 137 entryModel.add(new ArrayList<String>()); 135 138 } … … 147 150 setEnabled(entryList.getSelectedIndices().length == 1); 148 151 } 149 152 153 @Override 150 154 public void valueChanged(ListSelectionEvent e) { 151 155 updateEnabledState(); 152 156 } 153 157 158 @Override 154 159 public void actionPerformed(ActionEvent e) { 155 160 int idx = entryList.getSelectedIndices()[0]; 156 161 entryModel.remove(idx); … … 158 163 } 159 164 160 165 class EntryListener implements ListSelectionListener { 166 @Override 161 167 public void valueChanged(ListSelectionEvent e) { 162 168 TableCellEditor editor = table.getCellEditor(); 163 169 if (editor != null) { -
src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java
126 126 } 127 127 128 128 class EntryListModel extends AbstractListModel { 129 @Override 129 130 public Object getElementAt(int index) { 130 131 return tr("Entry {0}", index+1); 131 132 } 132 133 134 @Override 133 135 public int getSize() { 134 136 return dataKeys.size(); 135 137 } … … 154 156 putValue(SMALL_ICON, ImageProvider.get("dialogs", "add")); 155 157 } 156 158 159 @Override 157 160 public void actionPerformed(ActionEvent evt) { 158 161 entryModel.add(); 159 162 } … … 171 174 setEnabled(entryList.getSelectedIndices().length == 1); 172 175 } 173 176 177 @Override 174 178 public void valueChanged(ListSelectionEvent e) { 175 179 updateEnabledState(); 176 180 } 177 181 182 @Override 178 183 public void actionPerformed(ActionEvent e) { 179 184 int idx = entryList.getSelectedIndices()[0]; 180 185 entryModel.remove(idx); … … 182 187 } 183 188 184 189 class EntryListener implements ListSelectionListener { 190 @Override 185 191 public void valueChanged(ListSelectionEvent e) { 186 192 TableCellEditor editor = table.getCellEditor(); 187 193 if (editor != null) { -
src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
51 51 public class ColorPreference implements SubPreferenceSetting { 52 52 53 53 public static class Factory implements PreferenceSettingFactory { 54 @Override 54 55 public PreferenceSetting createPreferenceSetting() { 55 56 return new ColorPreference(); 56 57 } … … 140 141 return Main.pref.getColorName(o); 141 142 } 142 143 144 @Override 143 145 public void addGui(final PreferenceTabbedPane gui) { 144 146 fixColorPrefixes(); 145 147 setColorModel(Main.pref.getAllColors()); 146 148 147 149 colorEdit = new JButton(tr("Choose")); 148 150 colorEdit.addActionListener(new ActionListener(){ 151 @Override 149 152 public void actionPerformed(ActionEvent e) { 150 153 int sel = colors.getSelectedRow(); 151 154 JColorChooser chooser = new JColorChooser((Color)colors.getValueAt(sel, 1)); … … 161 164 }); 162 165 defaultSet = new JButton(tr("Set to default")); 163 166 defaultSet.addActionListener(new ActionListener(){ 167 @Override 164 168 public void actionPerformed(ActionEvent e) { 165 169 int sel = colors.getSelectedRow(); 166 170 String name = (String)colors.getValueAt(sel, 0); … … 172 176 }); 173 177 JButton defaultAll = new JButton(tr("Set all to default")); 174 178 defaultAll.addActionListener(new ActionListener(){ 179 @Override 175 180 public void actionPerformed(ActionEvent e) { 176 181 for(int i = 0; i < colors.getRowCount(); ++i) 177 182 { … … 185 190 }); 186 191 remove = new JButton(tr("Remove")); 187 192 remove.addActionListener(new ActionListener(){ 193 @Override 188 194 public void actionPerformed(ActionEvent e) { 189 195 int sel = colors.getSelectedRow(); 190 196 del.add((String)colors.getValueAt(sel, 0)); … … 210 216 colors.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 211 217 final TableCellRenderer oldColorsRenderer = colors.getDefaultRenderer(Object.class); 212 218 colors.setDefaultRenderer(Object.class, new TableCellRenderer(){ 219 @Override 213 220 public Component getTableCellRendererComponent(JTable t, Object o, boolean selected, boolean focus, int row, int column) { 214 221 if (o == null) 215 222 return new JLabel(); … … 261 268 ConflictDialog.getColor(); 262 269 } 263 270 271 @Override 264 272 public boolean ok() { 265 273 Boolean ret = false; 266 274 for(String d : del) { -
src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java
13 13 14 14 public class DisplayPreference extends DefaultTabPreferenceSetting { 15 15 public static class Factory implements PreferenceSettingFactory { 16 @Override 16 17 public PreferenceSetting createPreferenceSetting() { 17 18 return new DisplayPreference(); 18 19 } -
src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java
26 26 public class DrawingPreference implements SubPreferenceSetting { 27 27 28 28 public static class Factory implements PreferenceSettingFactory { 29 @Override 29 30 public PreferenceSetting createPreferenceSetting() { 30 31 return new DrawingPreference(); 31 32 } … … 47 48 private JCheckBox useWireframeAntialiasing = new JCheckBox(tr("Smooth map graphics in wireframe mode (antialiasing)")); 48 49 private JCheckBox outlineOnly = new JCheckBox(tr("Draw only outlines of areas")); 49 50 51 @Override 50 52 public void addGui(PreferenceTabbedPane gui) { 51 53 //gui.display.setPreferredSize(new Dimension(400,600)); 52 54 gpxPanel = new GPXSettingsPanel(); … … 61 63 62 64 // directionHint 63 65 directionHint.addActionListener(new ActionListener(){ 66 @Override 64 67 public void actionPerformed(ActionEvent e) { 65 68 if (directionHint.isSelected()){ 66 69 headArrow.setSelected(Main.pref.getBoolean("draw.segment.head_only", false)); … … 154 157 gui.getDisplayPreference().addSubTab(this, tr("OSM Data"), scrollpane); 155 158 } 156 159 160 @Override 157 161 public boolean ok() { 158 162 gpxPanel.savePreferences(); 159 163 Main.pref.put("draw.data.area_outline_only", outlineOnly.isSelected()); -
src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
127 127 ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesAll); 128 128 129 129 drawRawGpsLinesActionListener = new ActionListener(){ 130 @Override 130 131 public void actionPerformed(ActionEvent e) { 131 132 boolean f=drawRawGpsLinesNone.isSelected()||drawRawGpsLinesGlobal.isSelected(); 132 133 forceRawGpsLines.setEnabled(!f); … … 166 167 167 168 // drawGpsArrows 168 169 drawGpsArrows.addActionListener(new ActionListener(){ 170 @Override 169 171 public void actionPerformed(ActionEvent e) { 170 172 drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled()); 171 173 drawGpsArrowsMinDist.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled()); … … 215 217 colorGroup.add(colorTypeTime); 216 218 217 219 colorTypeVelocity.addChangeListener(new ChangeListener(){ 220 @Override 218 221 public void stateChanged(ChangeEvent e) { 219 222 colorTypeVelocityTune.setEnabled(colorTypeVelocity.isSelected()); 220 223 colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected()); 221 224 } 222 225 }); 223 226 colorTypeDilution.addChangeListener(new ChangeListener(){ 227 @Override 224 228 public void stateChanged(ChangeEvent e) { 225 229 colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected()); 226 230 } -
src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
31 31 public class LafPreference implements SubPreferenceSetting { 32 32 33 33 public static class Factory implements PreferenceSettingFactory { 34 @Override 34 35 public PreferenceSetting createPreferenceSetting() { 35 36 return new LafPreference(); 36 37 } … … 47 48 private JCheckBox modeless = new JCheckBox(tr("Modeless working (Potlatch style)")); 48 49 private JCheckBox dynamicButtons = new JCheckBox(tr("Dynamic buttons in side menus")); 49 50 51 @Override 50 52 public void addGui(PreferenceTabbedPane gui) { 51 53 lafCombo = new JosmComboBox(UIManager.getInstalledLookAndFeels()); 52 54 … … 118 120 gui.getDisplayPreference().addSubTab(this, tr("Look and Feel"), scrollpane); 119 121 } 120 122 123 @Override 121 124 public boolean ok() { 122 125 boolean mod = false; 123 126 Main.pref.put("draw.splashscreen", showSplashScreen.isSelected()); -
src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java
29 29 30 30 public class LanguagePreference implements SubPreferenceSetting { 31 31 public static class Factory implements PreferenceSettingFactory { 32 @Override 32 33 public PreferenceSetting createPreferenceSetting() { 33 34 return new LanguagePreference(); 34 35 } … … 39 40 /** the model for the combo box */ 40 41 private LanguageComboBoxModel model; 41 42 43 @Override 42 44 public void addGui(final PreferenceTabbedPane gui) { 43 45 model = new LanguageComboBoxModel(); 44 46 // Selecting the language BEFORE the JComboBox listens to model changes speed up initialization by ~35ms (see #7386) … … 58 60 tabPref.registerSubTab(this, tabPref.getSubTab(lafPreference)); 59 61 } 60 62 63 @Override 61 64 public boolean ok() { 62 65 if(langCombo.getSelectedItem() == null) 63 66 return Main.pref.put("language", null); -
src/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanel.java
93 93 return sanitize(tmsUrl.getText()); 94 94 } 95 95 96 @Override 96 97 protected boolean isImageryValid() { 97 98 return !getImageryName().isEmpty() && !getTmsUrl().isEmpty(); 98 99 } -
src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
165 165 return sanitize(wmsUrl.getText()); 166 166 } 167 167 168 @Override 168 169 protected boolean isImageryValid() { 169 170 if (getImageryName().isEmpty()) { 170 171 return false; -
src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
426 426 this.type = type; 427 427 } 428 428 429 @Override 429 430 public void actionPerformed(ActionEvent evt) { 430 431 final AddImageryPanel p; 431 432 if (ImageryInfo.ImageryType.WMS.equals(type)) { … … 551 552 putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh")); 552 553 } 553 554 555 @Override 554 556 public void actionPerformed(ActionEvent evt) { 555 557 layerInfo.loadDefaults(true); 556 558 defaultModel.fireTableDataChanged(); -
src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java
84 84 GBC.eop().fill(GBC.HORIZONTAL).insets(5,0,0,0)); 85 85 86 86 ActionListener autosaveEnabled = new ActionListener(){ 87 @Override 87 88 public void actionPerformed(ActionEvent e) { 88 89 boolean enabled = autosave.isSelected(); 89 90 autosaveIntervalLabel.setEnabled(enabled); -
src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
47 47 } 48 48 49 49 public static class Factory implements PreferenceSettingFactory { 50 @Override 50 51 public PreferenceSetting createPreferenceSetting() { 51 52 return new MapPaintPreference(); 52 53 } 53 54 } 54 55 56 @Override 55 57 public void addGui(final PreferenceTabbedPane gui) { 56 58 enableIconDefault = new JCheckBox(tr("Enable built-in icon defaults"), 57 59 Main.pref.getBoolean("mappaint.icon.enable-defaults", true)); … … 71 73 // 72 74 gui.getMapPreference().getTabPane().addChangeListener( 73 75 new ChangeListener() { 76 @Override 74 77 public void stateChanged(ChangeEvent e) { 75 78 if (gui.getMapPreference().getTabPane().getSelectedComponent() == panel) { 76 79 sources.initiallyLoadAvailableSources(); … … 159 162 160 163 } 161 164 165 @Override 162 166 public boolean ok() { 163 167 boolean reload = Main.pref.put("mappaint.icon.enable-defaults", enableIconDefault.isSelected()); 164 168 reload |= sources.finish(); -
src/org/openstreetmap/josm/gui/preferences/map/MapPreference.java
13 13 14 14 public class MapPreference extends DefaultTabPreferenceSetting { 15 15 public static class Factory implements PreferenceSettingFactory { 16 @Override 16 17 public PreferenceSetting createPreferenceSetting() { 17 18 return new MapPreference(); 18 19 } -
src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
173 173 // 174 174 gui.getMapPreference().getTabPane().addChangeListener( 175 175 new ChangeListener() { 176 @Override 176 177 public void stateChanged(ChangeEvent e) { 177 178 if (gui.getMapPreference().getTabPane().getSelectedComponent() == panel) { 178 179 sources.initiallyLoadAvailableSources(); -
src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
121 121 } 122 122 } 123 123 } 124 @Override 124 125 public void actionPerformed(ActionEvent e) { 125 126 // Select/unselect corresponding plugin in the model 126 127 model.setPluginSelected(cb.pi.getName(), cb.isSelected()); … … 227 228 HtmlPanel description = new HtmlPanel(); 228 229 description.setText(pi.getDescriptionAsHtml()); 229 230 description.getEditorPane().addHyperlinkListener(new HyperlinkListener() { 231 @Override 230 232 public void hyperlinkUpdate(HyperlinkEvent e) { 231 233 if(e.getEventType() == EventType.ACTIVATED) { 232 234 OpenBrowser.displayUrl(e.getURL().toString()); -
src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
143 143 Collections.sort( 144 144 availablePlugins, 145 145 new Comparator<PluginInformation>() { 146 @Override 146 147 public int compare(PluginInformation o1, PluginInformation o2) { 147 148 String n1 = o1.getName() == null ? "" : o1.getName().toLowerCase(); 148 149 String n2 = o2.getName() == null ? "" : o2.getName().toLowerCase(); -
src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
239 239 } 240 240 241 241 class TimeBasedPolicyChangeListener implements ChangeListener { 242 @Override 242 243 public void stateChanged(ChangeEvent e) { 243 244 lblUpdateInterval.setEnabled(!rbTimeBasedUpatePolicy.get(Policy.NEVER).isSelected()); 244 245 tfUpdateInterval.setEnabled(!rbTimeBasedUpatePolicy.get(Policy.NEVER).isSelected()); -
src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
56 56 public class ProjectionPreference implements SubPreferenceSetting { 57 57 58 58 public static class Factory implements PreferenceSettingFactory { 59 @Override 59 60 public PreferenceSetting createPreferenceSetting() { 60 61 return new ProjectionPreference(); 61 62 } … … 286 287 */ 287 288 static private GBC projSubPrefPanelGBC = GBC.std().fill(GBC.BOTH).weight(1.0, 1.0); 288 289 290 @Override 289 291 public void addGui(PreferenceTabbedPane gui) { 290 292 ProjectionChoice pc = setupProjectionCombo(); 291 293 … … 449 451 throw new RuntimeException("Couldn't find the current projection in the list of available projections!"); 450 452 451 453 projectionCombo.addActionListener(new ActionListener() { 454 @Override 452 455 public void actionPerformed(ActionEvent e) { 453 456 ProjectionChoice pc = (ProjectionChoice) projectionCombo.getSelectedItem(); 454 457 selectedProjectionChanged(pc); -
src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
136 136 * Listens to changes in the authentication method 137 137 */ 138 138 class AuthenticationMethodChangeListener implements ItemListener { 139 @Override 139 140 public void itemStateChanged(ItemEvent e) { 140 141 if (rbBasicAuthentication.isSelected()) { 141 142 pnlAuthenticationParameteters.removeAll(); … … 150 151 } 151 152 } 152 153 154 @Override 153 155 public void propertyChange(PropertyChangeEvent evt) { 154 156 if (pnlOAuthPreferences != null) { 155 157 pnlOAuthPreferences.propertyChange(evt); -
src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
68 68 cbShowAdvancedParameters.setSelected(false); 69 69 cbShowAdvancedParameters.addItemListener( 70 70 new ItemListener() { 71 @Override 71 72 public void itemStateChanged(ItemEvent evt) { 72 73 pnlAdvancedProperties.setVisible(evt.getStateChange() == ItemEvent.SELECTED); 73 74 } … … 310 311 putValue(SMALL_ICON, ImageProvider.get("oauth", "oauth")); 311 312 312 313 } 314 @Override 313 315 public void actionPerformed(ActionEvent arg0) { 314 316 OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard( 315 317 OAuthAuthenticationPreferencesPanel.this, … … 335 337 putValue(SMALL_ICON, ImageProvider.get("oauth", "oauth")); 336 338 337 339 } 340 @Override 338 341 public void actionPerformed(ActionEvent arg0) { 339 342 OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard( 340 343 OAuthAuthenticationPreferencesPanel.this, … … 361 364 362 365 } 363 366 367 @Override 364 368 public void actionPerformed(ActionEvent evt) { 365 369 OAuthToken token = OAuthAccessTokenHolder.getInstance().getAccessToken(); 366 370 OAuthParameters parameters = OAuthParameters.createFromPreferences(Main.pref); … … 374 378 } 375 379 } 376 380 381 @Override 377 382 public void propertyChange(PropertyChangeEvent evt) { 378 383 if (! evt.getPropertyName().equals(OsmApiUrlInputPanel.API_URL_PROP)) 379 384 return; -
src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
165 165 updateEnabledState(); 166 166 } 167 167 168 @Override 168 169 public void actionPerformed(ActionEvent arg0) { 169 170 final String url = tfOsmServerUrl.getText().trim(); 170 171 final ApiUrlTestTask task = new ApiUrlTestTask(OsmApiUrlInputPanel.this, url); 171 172 Main.worker.submit(task); 172 173 Runnable r = new Runnable() { 174 @Override 173 175 public void run() { 174 176 if (task.isCanceled()) 175 177 return; 176 178 Runnable r = new Runnable() { 179 @Override 177 180 public void run() { 178 181 if (task.isSuccess()) { 179 182 lblValid.setIcon(ImageProvider.get("dialogs/changeset", "valid")); … … 202 205 setEnabled(enabled); 203 206 } 204 207 208 @Override 205 209 public void changedUpdate(DocumentEvent arg0) { 206 210 updateEnabledState(); 207 211 } 208 212 213 @Override 209 214 public void insertUpdate(DocumentEvent arg0) { 210 215 updateEnabledState(); 211 216 } 212 217 218 @Override 213 219 public void removeUpdate(DocumentEvent arg0) { 214 220 updateEnabledState(); 215 221 } … … 258 264 * Handles changes in the default URL 259 265 */ 260 266 class UseDefaultServerUrlChangeHandler implements ItemListener { 267 @Override 261 268 public void itemStateChanged(ItemEvent e) { 262 269 switch(e.getStateChange()) { 263 270 case ItemEvent.SELECTED: … … 279 286 firePropertyChange(API_URL_PROP, null, tfOsmServerUrl.getText()); 280 287 } 281 288 289 @Override 282 290 public void actionPerformed(ActionEvent e) { 283 291 propagate(); 284 292 } -
src/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreference.java
20 20 private String defaultFilter; 21 21 22 22 public static class Factory implements PreferenceSettingFactory { 23 @Override 23 24 public PreferenceSetting createPreferenceSetting() { 24 25 return new ShortcutPreference(); 25 26 } -
src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java
64 64 * Tasks 65 65 =======*/ 66 66 67 @Override 67 68 public void beginTask(String title) { 68 69 beginTask(title, DEFAULT_TICKS); 69 70 } 70 71 72 @Override 71 73 public synchronized void beginTask(String title, int ticks) { 72 74 this.taskTitle = title; 73 75 checkState(State.INIT); … … 77 79 resetState(); 78 80 } 79 81 82 @Override 80 83 public synchronized void finishTask() { 81 84 if (state != State.FINISHED) { 82 85 … … 90 93 } 91 94 } 92 95 96 @Override 93 97 public synchronized void invalidate() { 94 98 if (state == State.INIT) { 95 99 state = State.FINISHED; … … 97 101 } 98 102 } 99 103 104 @Override 100 105 public synchronized void subTask(final String title) { 101 106 if (state == State.IN_SUBTASK) { 102 107 if (title != null) { … … 114 119 } 115 120 } 116 121 122 @Override 117 123 public synchronized void indeterminateSubTask(String title) { 118 124 if (state == State.IN_SUBTASK) { 119 125 if (title != null) { … … 131 137 } 132 138 } 133 139 140 @Override 134 141 public synchronized void setCustomText(String text) { 135 142 if (state == State.IN_SUBTASK) { 136 143 requestedState.customText = text; … … 140 147 } 141 148 } 142 149 150 @Override 143 151 public synchronized void setExtraText(String text) { 144 152 if (state == State.IN_SUBTASK) { 145 153 requestedState.extraText = text; … … 152 160 /** 153 161 * Default implementation is empty. Override in subclasses to display the log messages. 154 162 */ 163 @Override 155 164 public void appendLogMessage(String message) { 156 165 // do nothing 157 166 } … … 176 185 doSetIntermediate(intermediateTask); 177 186 } 178 187 188 @Override 179 189 public void cancel() { 180 190 cancelHandler.cancel(); 181 191 } 182 192 193 @Override 183 194 public boolean isCanceled() { 184 195 return cancelHandler.isCanceled(); 185 196 } 186 197 198 @Override 187 199 public void addCancelListener(CancelListener listener) { 188 200 cancelHandler.addCancelListener(listener); 189 201 } 190 202 203 @Override 191 204 public void removeCancelListener(CancelListener listener) { 192 205 cancelHandler.removeCancelListener(listener); 193 206 } … … 198 211 199 212 abstract void updateProgress(double value); 200 213 214 @Override 201 215 public synchronized void setTicks(int ticks) { 202 216 if (ticks >= ticksCount) { 203 217 ticks = ticksCount - 1; … … 206 220 internalUpdateProgress(0); 207 221 } 208 222 223 @Override 209 224 public synchronized void setTicksCount(int ticks) { 210 225 this.ticksCount = ticks; 211 226 internalUpdateProgress(0); 212 227 } 213 228 229 @Override 214 230 public void worked(int ticks) { 215 231 if (ticks == ALL_TICKS) { 216 232 setTicks(this.ticksCount - 1); … … 227 243 updateProgress(ticksCount == 0?0:(ticks + childProgress * childTicks) / ticksCount); 228 244 } 229 245 246 @Override 230 247 public synchronized int getTicks() { 231 248 return ticks; 232 249 } 233 250 251 @Override 234 252 public synchronized int getTicksCount() { 235 253 return ticksCount; 236 254 } … … 239 257 * Subtasks 240 258 ==========*/ 241 259 260 @Override 242 261 public synchronized ProgressMonitor createSubTaskMonitor(int ticks, boolean internal) { 243 262 if (ticks == ALL_TICKS) { 244 263 ticks = ticksCount - this.ticks; -
src/org/openstreetmap/josm/gui/progress/NullProgressMonitor.java
13 13 14 14 } 15 15 16 @Override 16 17 public void addCancelListener(CancelListener listener) { 17 18 } 18 19 20 @Override 19 21 public void beginTask(String title) { 20 22 } 21 23 24 @Override 22 25 public void beginTask(String title, int ticks) { 23 26 } 24 27 28 @Override 25 29 public void cancel() { 26 30 } 27 31 32 @Override 28 33 public ProgressMonitor createSubTaskMonitor(int ticks, boolean internal) { 29 34 return INSTANCE; 30 35 } 31 36 37 @Override 32 38 public void finishTask() { 33 39 } 34 40 … … 36 42 return null; 37 43 } 38 44 45 @Override 39 46 public int getTicks() { 40 47 return 0; 41 48 } 42 49 50 @Override 43 51 public void indeterminateSubTask(String title) { 44 52 } 45 53 54 @Override 46 55 public void invalidate() { 47 56 } 48 57 58 @Override 49 59 public boolean isCanceled() { 50 60 return false; 51 61 } 52 62 63 @Override 53 64 public void removeCancelListener(CancelListener listener) { 54 65 } 55 66 67 @Override 56 68 public void setCustomText(String text) { 57 69 } 58 70 59 71 public void setErrorMessage(String message) { 60 72 } 61 73 74 @Override 62 75 public void setExtraText(String text) { 63 76 } 64 77 78 @Override 65 79 public void appendLogMessage(String message) { 66 80 } 67 81 68 82 public void setSilent(boolean value) { 69 83 } 70 84 85 @Override 71 86 public void setTicks(int ticks) { 72 87 } 73 88 89 @Override 74 90 public void setTicksCount(int ticks) { 75 91 } 76 92 93 @Override 77 94 public void subTask(String title) { 78 95 } 79 96 97 @Override 80 98 public void worked(int ticks) { 81 99 } 82 100 101 @Override 83 102 public int getTicksCount() { 84 103 return 0; 85 104 } -
src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java
115 115 } 116 116 117 117 private ActionListener cancelListener = new ActionListener(){ 118 @Override 118 119 public void actionPerformed(ActionEvent e) { 119 120 cancel(); 120 121 } … … 149 150 @Override 150 151 public void doBeginTask() { 151 152 doInEDT(new Runnable() { 153 @Override 152 154 public void run() { 153 155 Main.currentProgressMonitor = PleaseWaitProgressMonitor.this; 154 156 if (dialogParent instanceof Frame && dialog == null) { … … 183 185 if (newValue != currentProgressValue) { 184 186 currentProgressValue = newValue; 185 187 doInEDT(new Runnable() { 188 @Override 186 189 public void run() { 187 190 ProgressMonitorDialog dialog = getDialog(); 188 191 if (dialog != null) { … … 198 201 checkState(State.IN_TASK, State.IN_SUBTASK); 199 202 this.customText = title; 200 203 doInEDT(new Runnable() { 204 @Override 201 205 public void run() { 202 206 ProgressMonitorDialog dialog = getDialog(); 203 207 if (dialog != null) { … … 212 216 checkState(State.IN_TASK, State.IN_SUBTASK); 213 217 this.title = title; 214 218 doInEDT(new Runnable() { 219 @Override 215 220 public void run() { 216 221 ProgressMonitorDialog dialog = getDialog(); 217 222 if (dialog != null) { … … 225 230 protected void doSetIntermediate(final boolean value) { 226 231 this.indeterminate = value; 227 232 doInEDT(new Runnable() { 233 @Override 228 234 public void run() { 229 235 // Enable only if progress is at the beginning. Doing intermediate progress in the middle 230 236 // will hide already reached progress … … 239 245 @Override 240 246 public void appendLogMessage(final String message) { 241 247 doInEDT(new Runnable() { 248 @Override 242 249 public void run() { 243 250 ProgressMonitorDialog dialog = getDialog(); 244 251 if (dialog != null) { -
src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java
33 33 @Override 34 34 public void doBeginTask() { 35 35 GuiHelper.runInEDT(new Runnable() { 36 @Override 36 37 public void run() { 37 38 delegate.setCustomText(""); 38 39 delegate.setMaximum(PROGRESS_BAR_MAX); … … 51 52 if (newValue != currentProgressValue) { 52 53 currentProgressValue = newValue; 53 54 GuiHelper.runInEDT(new Runnable() { 55 @Override 54 56 public void run() { 55 57 delegate.setValue(currentProgressValue); 56 58 } … … 62 64 protected void doSetCustomText(final String title) { 63 65 checkState(State.IN_TASK, State.IN_SUBTASK); 64 66 GuiHelper.runInEDT(new Runnable() { 67 @Override 65 68 public void run() { 66 69 delegate.setCustomText(title); 67 70 } … … 72 75 protected void doSetTitle(final String title) { 73 76 checkState(State.IN_TASK, State.IN_SUBTASK); 74 77 GuiHelper.runInEDT(new Runnable() { 78 @Override 75 79 public void run() { 76 80 delegate.setTaskTitle(title); 77 81 } … … 81 85 @Override 82 86 protected void doSetIntermediate(final boolean value) { 83 87 GuiHelper.runInEDT(new Runnable() { 88 @Override 84 89 public void run() { 85 90 delegate.setIndeterminate(value); 86 91 } -
src/org/openstreetmap/josm/gui/tagging/TagCellEditor.java
85 85 /** 86 86 * replies the table cell editor 87 87 */ 88 @Override 88 89 public Component getTableCellEditorComponent(JTable table, 89 90 Object value, boolean isSelected, int row, int column) { 90 91 currentTag = (TagModel) value; … … 114 115 } 115 116 } 116 117 118 @Override 117 119 public Object getCellEditorValue() { 118 120 return editor.getText(); 119 121 } -
src/org/openstreetmap/josm/gui/tagging/TagCellRenderer.java
81 81 * 82 82 * @return the renderer component 83 83 */ 84 @Override 84 85 public Component getTableCellRendererComponent(JTable table, Object value, 85 86 boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) { 86 87 resetRenderer(); -
src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
168 168 editor.setDocument(new AutoCompletingComboBoxDocument(this)); 169 169 editor.addFocusListener( 170 170 new FocusListener() { 171 @Override 171 172 public void focusLost(FocusEvent e) { 172 173 } 174 @Override 173 175 public void focusGained(FocusEvent e) { 174 176 // save unix system selection (middle mouse paste) 175 177 Clipboard sysSel = Toolkit.getDefaultToolkit().getSystemSelection(); … … 304 306 setOpaque(true); 305 307 } 306 308 309 @Override 307 310 public Component getListCellRendererComponent( 308 311 JList list, 309 312 Object value, -
src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
193 193 this.autoCompletionList = autoCompletionList; 194 194 } 195 195 196 @Override 196 197 public Component getEditorComponent() { 197 198 return this; 198 199 } 199 200 201 @Override 200 202 public Object getItem() { 201 203 return getText(); 202 204 } 203 205 206 @Override 204 207 public void setItem(Object anObject) { 205 208 if (anObject == null) { 206 209 setText(""); … … 225 228 private TableCellEditorSupport tableCellEditorSupport; 226 229 private String originalValue; 227 230 231 @Override 228 232 public void addCellEditorListener(CellEditorListener l) { 229 233 tableCellEditorSupport.addCellEditorListener(l); 230 234 } … … 237 241 setText(originalValue); 238 242 } 239 243 244 @Override 240 245 public void removeCellEditorListener(CellEditorListener l) { 241 246 tableCellEditorSupport.removeCellEditorListener(l); 242 247 } 248 @Override 243 249 public void cancelCellEditing() { 244 250 restoreOriginalValue(); 245 251 tableCellEditorSupport.fireEditingCanceled(); 246 252 247 253 } 248 254 255 @Override 249 256 public Object getCellEditorValue() { 250 257 return getText(); 251 258 } 252 259 260 @Override 253 261 public boolean isCellEditable(EventObject anEvent) { 254 262 return true; 255 263 } 256 264 265 @Override 257 266 public boolean shouldSelectCell(EventObject anEvent) { 258 267 return true; 259 268 } 260 269 270 @Override 261 271 public boolean stopCellEditing() { 262 272 tableCellEditorSupport.fireEditingStopped(); 263 273 return true; 264 274 } 265 275 276 @Override 266 277 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 267 278 setText( value == null ? "" : value.toString()); 268 279 rememberOriginalValue(getText()); -
src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPritority.java
62 62 * Imposes an ordering on the priorities. 63 63 * Currently, being in the current DataSet is worth more than being in the Presets. 64 64 */ 65 @Override 65 66 public int compareTo(AutoCompletionItemPritority other) { 66 67 int sel = Boolean.valueOf(selected).compareTo(other.selected); 67 68 if (sel != 0) return sel; -
src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
275 275 fireTableDataChanged(); 276 276 } 277 277 278 @Override 278 279 public int getColumnCount() { 279 280 return 1; 280 281 } 281 282 283 @Override 282 284 public int getRowCount() { 283 285 284 286 return list == null ? 0 : getFilteredSize(); 285 287 } 286 288 289 @Override 287 290 public Object getValueAt(int rowIndex, int columnIndex) { 288 291 return list == null ? null : getFilteredItem(rowIndex); 289 292 } -
src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionListItem.java
115 115 return true; 116 116 } 117 117 118 @Override 118 119 public int compareTo(AutoCompletionListItem other) { 119 120 int ret = other.priority.compareTo(priority); // higher priority items come first in the list 120 121 if (ret != 0) -
src/org/openstreetmap/josm/gui/util/GuiHelper.java
54 54 55 55 public static void executeByMainWorkerInEDT(final Runnable task) { 56 56 Main.worker.submit(new Runnable() { 57 @Override 57 58 public void run() { 58 59 runInEDTAndWait(task); 59 60 } … … 137 138 public static final Component prepareResizeableOptionPane(final Component pane, final Dimension minDimension) { 138 139 if (pane != null) { 139 140 pane.addHierarchyListener(new HierarchyListener() { 141 @Override 140 142 public void hierarchyChanged(HierarchyEvent e) { 141 143 Window window = SwingUtilities.getWindowAncestor(pane); 142 144 if (window instanceof Dialog) { -
src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java
134 134 /* -------------------------------------------------------------------------------- */ 135 135 /* interface FocusListener */ 136 136 /* -------------------------------------------------------------------------------- */ 137 @Override 137 138 public void focusGained(FocusEvent arg0) {} 138 139 140 @Override 139 141 public void focusLost(FocusEvent arg0) { 140 142 validate(); 141 143 } … … 143 145 /* -------------------------------------------------------------------------------- */ 144 146 /* interface ActionListener */ 145 147 /* -------------------------------------------------------------------------------- */ 148 @Override 146 149 public void actionPerformed(ActionEvent arg0) { 147 150 validate(); 148 151 } … … 150 153 /* -------------------------------------------------------------------------------- */ 151 154 /* interface DocumentListener */ 152 155 /* -------------------------------------------------------------------------------- */ 156 @Override 153 157 public void changedUpdate(DocumentEvent arg0) { 154 158 validate(); 155 159 } 156 160 161 @Override 157 162 public void insertUpdate(DocumentEvent arg0) { 158 163 validate(); 159 164 } 160 165 166 @Override 161 167 public void removeUpdate(DocumentEvent arg0) { 162 168 validate(); 163 169 } … … 165 171 /* -------------------------------------------------------------------------------- */ 166 172 /* interface PropertyChangeListener */ 167 173 /* -------------------------------------------------------------------------------- */ 174 @Override 168 175 public void propertyChange(PropertyChangeEvent evt) { 169 176 if (evt.getPropertyName().equals("enabled")) { 170 177 boolean enabled = (Boolean)evt.getNewValue(); -
src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java
202 202 } 203 203 204 204 class OsmUrlRefresher implements DocumentListener { 205 @Override 205 206 public void changedUpdate(DocumentEvent e) { parseURL(); } 207 @Override 206 208 public void insertUpdate(DocumentEvent e) { parseURL(); } 209 @Override 207 210 public void removeUpdate(DocumentEvent e) { parseURL(); } 208 211 } 209 212 } -
src/org/openstreetmap/josm/gui/widgets/ComboBoxHistory.java
79 79 fireHistoryChanged(); 80 80 } 81 81 82 @Override 82 83 public Iterator<AutoCompletionListItem> iterator() { 83 84 return new Iterator<AutoCompletionListItem>() { 84 85 85 86 private int position = -1; 86 87 88 @Override 87 89 public void remove() { 88 90 removeElementAt(position); 89 91 } 90 92 93 @Override 91 94 public boolean hasNext() { 92 95 if(position < getSize()-1 && getSize()>0) 93 96 return true; 94 97 return false; 95 98 } 96 99 100 @Override 97 101 public AutoCompletionListItem next() { 98 102 position++; 99 103 return (AutoCompletionListItem)getElementAt(position); -
src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
166 166 setEnabled(false); 167 167 } 168 168 169 @Override 169 170 public void undoableEditHappened(UndoableEditEvent e) { 170 171 undoManager.addEdit(e.getEdit()); 171 172 setEnabled(undoManager.canUndo()); 172 173 } 173 174 175 @Override 174 176 public void actionPerformed(ActionEvent e) { 175 177 try { 176 178 undoManager.undo(); -
src/org/openstreetmap/josm/gui/widgets/VerticallyScrollablePanel.java
34 34 super(layout); 35 35 } 36 36 37 @Override 37 38 public Dimension getPreferredScrollableViewportSize() { 38 39 return getPreferredSize(); 39 40 } 40 41 42 @Override 41 43 public int getScrollableBlockIncrement(Rectangle arg0, int arg1, int arg2) { 42 44 return 20; 43 45 } 44 46 47 @Override 45 48 public boolean getScrollableTracksViewportHeight() { 46 49 return false; 47 50 } 48 51 52 @Override 49 53 public boolean getScrollableTracksViewportWidth() { 50 54 return true; 51 55 } 52 56 57 @Override 53 58 public int getScrollableUnitIncrement(Rectangle arg0, int arg1, int arg2) { 54 59 return 10; 55 60 } -
src/org/openstreetmap/josm/io/FileImporter.java
102 102 return 0; 103 103 } 104 104 105 @Override 105 106 public int compareTo(FileImporter other) { 106 107 return (new Double(this.getPriority())).compareTo(other.getPriority()); 107 108 } -
src/org/openstreetmap/josm/io/GpxExporter.java
241 241 final JLabel warning) { 242 242 243 243 ActionListener authorActionListener = new ActionListener(){ 244 @Override 244 245 public void actionPerformed(ActionEvent e) { 245 246 boolean b = author.isSelected(); 246 247 authorName.setEnabled(b); … … 277 278 authorName.addKeyListener(authorNameListener); 278 279 279 280 predefined.addActionListener(new ActionListener(){ 281 @Override 280 282 public void actionPerformed(ActionEvent e) { 281 283 final String[] licenses = { 282 284 "Creative Commons By-SA", -
src/org/openstreetmap/josm/io/GpxImporter.java
104 104 public static void addLayers(final GpxImporterData data) { 105 105 // FIXME: remove UI stuff from the IO subsystem 106 106 GuiHelper.runInEDT(new Runnable() { 107 @Override 107 108 public void run() { 108 109 if (data.markerLayer != null) { 109 110 Main.main.addLayer(data.markerLayer); -
src/org/openstreetmap/josm/io/NMEAImporter.java
35 35 final File fileFinal = file; 36 36 37 37 GuiHelper.runInEDT(new Runnable() { 38 @Override 38 39 public void run() { 39 40 Main.main.addLayer(gpxLayer); 40 41 if (Main.pref.getBoolean("marker.makeautomarkers", true)) { -
src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
295 295 if (args.containsKey("addtags")) { 296 296 GuiHelper.executeByMainWorkerInEDT(new Runnable() { 297 297 298 @Override 298 299 public void run() { 299 300 String[] tags = null; 300 301 try { -
src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
79 79 /** 80 80 * The main loop, spawns a {@link RequestProcessor} for each connection 81 81 */ 82 @Override 82 83 public void run() 83 84 { 84 85 Main.info(marktr("RemoteControl::Accepting connections on port {0}"), -
src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
131 131 /** 132 132 * The work is done here. 133 133 */ 134 @Override 134 135 public void run() { 135 136 Writer out = null; 136 137 try { -
src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
130 130 */ 131 131 if (args.containsKey("addtags")) { 132 132 GuiHelper.executeByMainWorkerInEDT(new Runnable() { 133 @Override 133 134 public void run() { 134 135 DataSet ds = Main.main.getCurrentDataSet(); 135 136 if(ds == null) // e.g. download failed … … 143 144 if (args.containsKey("select") && PermissionPrefWithDefault.CHANGE_SELECTION.isAllowed()) { 144 145 // select objects after downloading, zoom to selection. 145 146 GuiHelper.executeByMainWorkerInEDT(new Runnable() { 147 @Override 146 148 public void run() { 147 149 HashSet<OsmPrimitive> newSel = new HashSet<OsmPrimitive>(); 148 150 DataSet ds = Main.main.getCurrentDataSet(); … … 194 196 // make sure this isn't called unless there *is* a MapView 195 197 if (Main.isDisplayingMapView()) { 196 198 GuiHelper.executeByMainWorkerInEDT(new Runnable() { 199 @Override 197 200 public void run() { 198 201 BoundingXYVisitor bbox = new BoundingXYVisitor(); 199 202 bbox.visit(bounds); -
src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java
106 106 } 107 107 108 108 link.addActionListener(new ActionListener() { 109 @Override 109 110 public void actionPerformed(ActionEvent e) { 110 111 cl.show(cards, "link"); 111 112 } 112 113 }); 113 114 include.addActionListener(new ActionListener() { 115 @Override 114 116 public void actionPerformed(ActionEvent e) { 115 117 cl.show(cards, "include"); 116 118 } … … 126 128 p.add(cards, GBC.eol().insets(15,0,3,3)); 127 129 128 130 export.addItemListener(new ItemListener() { 131 @Override 129 132 public void itemStateChanged(ItemEvent e) { 130 133 if (e.getStateChange() == ItemEvent.DESELECTED) { 131 134 GuiHelper.setEnabledRec(p, false); -
src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java
73 73 updateEnabledState(); 74 74 } 75 75 76 @Override 76 77 public void actionPerformed(ActionEvent e) { 77 78 SaveAction.getInstance().doSave(layer); 78 79 updateEnabledState(); … … 138 139 } 139 140 140 141 link.addActionListener(new ActionListener() { 142 @Override 141 143 public void actionPerformed(ActionEvent e) { 142 144 cl.show(cards, "link"); 143 145 } 144 146 }); 145 147 include.addActionListener(new ActionListener() { 148 @Override 146 149 public void actionPerformed(ActionEvent e) { 147 150 cl.show(cards, "include"); 148 151 } … … 158 161 p.add(cards, GBC.eol().insets(15,0,3,3)); 159 162 160 163 export.addItemListener(new ItemListener() { 164 @Override 161 165 public void itemStateChanged(ItemEvent e) { 162 166 if (e.getStateChange() == ItemEvent.DESELECTED) { 163 167 GuiHelper.setEnabledRec(p, false); -
src/org/openstreetmap/josm/plugins/PluginHandler.java
144 144 } 145 145 } 146 146 147 @Override 147 148 public int compareTo(DeprecatedPlugin o) { 148 149 return name.compareTo(o.name); 149 150 } … … 574 575 Collections.sort( 575 576 toLoad, 576 577 new Comparator<PluginInformation>() { 578 @Override 577 579 public int compare(PluginInformation o1, PluginInformation o2) { 578 580 if (o1.stage < o2.stage) return -1; 579 581 if (o1.stage == o2.stage) return 0; … … 972 974 return; 973 975 974 976 final File[] files = pluginDir.listFiles(new FilenameFilter() { 977 @Override 975 978 public boolean accept(File dir, String name) { 976 979 return name.endsWith(".jar.new"); 977 980 }}); … … 1198 1201 pluginTab.add(new JLabel(name), GBC.std()); 1199 1202 pluginTab.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL)); 1200 1203 pluginTab.add(new JButton(new AbstractAction(tr("Information")) { 1204 @Override 1201 1205 public void actionPerformed(ActionEvent event) { 1202 1206 StringBuilder b = new StringBuilder(); 1203 1207 for (Entry<String, String> e : info.attr.entrySet()) { -
src/org/openstreetmap/josm/plugins/PluginPreferenceFactory.java
12 12 this.plugin = plugin; 13 13 } 14 14 15 @Override 15 16 public PreferenceSetting createPreferenceSetting() { 16 17 return plugin.getPreferenceSetting(); 17 18 } -
src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java
73 73 protected void scanSiteCacheFiles(ProgressMonitor monitor, File pluginsDirectory) { 74 74 File[] siteCacheFiles = pluginsDirectory.listFiles( 75 75 new FilenameFilter() { 76 @Override 76 77 public boolean accept(File dir, String name) { 77 78 return name.matches("^([0-9]+-)?site.*\\.txt$"); 78 79 } … … 98 99 protected void scanIconCacheFiles(ProgressMonitor monitor, File pluginsDirectory) { 99 100 File[] siteCacheFiles = pluginsDirectory.listFiles( 100 101 new FilenameFilter() { 102 @Override 101 103 public boolean accept(File dir, String name) { 102 104 return name.matches("^([0-9]+-)?site.*plugin-icons\\.zip$"); 103 105 } … … 126 128 protected void scanPluginFiles(ProgressMonitor monitor, File pluginsDirectory) { 127 129 File[] pluginFiles = pluginsDirectory.listFiles( 128 130 new FilenameFilter() { 131 @Override 129 132 public boolean accept(File dir, String name) { 130 133 return name.endsWith(".jar") || name.endsWith(".jar.new"); 131 134 } -
src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
330 330 for (String location : PluginInformation.getPluginLocations()) { 331 331 File [] f = new File(location).listFiles( 332 332 new FilenameFilter() { 333 @Override 333 334 public boolean accept(File dir, String name) { 334 335 return name.matches("^([0-9]+-)?site.*\\.txt$") || 335 336 name.matches("^([0-9]+-)?site.*-icons\\.zip$"); -
src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
38 38 private static int exceptionCounter = 0; 39 39 private static boolean suppressExceptionDialogs = false; 40 40 41 @Override 41 42 public void uncaughtException(Thread t, Throwable e) { 42 43 handleException(e); 43 44 } -
src/org/openstreetmap/josm/tools/CopyList.java
177 177 */ 178 178 int expectedModCount = modCount; 179 179 180 @Override 180 181 public boolean hasNext() { 181 182 return cursor != size; 182 183 } 183 184 185 @Override 184 186 public E next() { 185 187 checkForComodification(); 186 188 try { … … 193 195 } 194 196 } 195 197 198 @Override 196 199 public void remove() { 197 200 if (lastRet == -1) 198 201 throw new IllegalStateException(); -
src/org/openstreetmap/josm/tools/Diff.java
406 406 producing an edit script in reverse order. */ 407 407 408 408 static class ReverseScript implements ScriptBuilder { 409 @Override 409 410 public change build_script( 410 411 final boolean[] changed0,int len0, 411 412 final boolean[] changed1,int len1) … … 439 440 static class ForwardScript implements ScriptBuilder { 440 441 /** Scan the tables of which lines are inserted and deleted, 441 442 producing an edit script in forward order. */ 443 @Override 442 444 public change build_script( 443 445 final boolean[] changed0,int len0, 444 446 final boolean[] changed1,int len1) -
src/org/openstreetmap/josm/tools/I18n.java
329 329 Locale[] l = new Locale[v.size()]; 330 330 l = v.toArray(l); 331 331 Arrays.sort(l, new Comparator<Locale>() { 332 @Override 332 333 public int compare(Locale o1, Locale o2) { 333 334 return o1.toString().compareTo(o2.toString()); 334 335 } -
src/org/openstreetmap/josm/tools/ImageProvider.java
692 692 }); 693 693 694 694 parser.setEntityResolver(new EntityResolver() { 695 @Override 695 696 public InputSource resolveEntity (String publicId, String systemId) { 696 697 return new InputSource(new ByteArrayInputStream(new byte[0])); 697 698 } -
src/org/openstreetmap/josm/tools/PlatformHookOsx.java
45 45 System.out.println("Failed to register with OSX: " + ex); 46 46 } 47 47 } 48 @Override 48 49 public Object invoke (Object proxy, Method method, Object[] args) throws Throwable { 49 50 Boolean handled = Boolean.TRUE; 50 51 //System.out.println("Going to handle method "+method+" (short: "+method.getName()+") with event "+args[0]); -
src/org/openstreetmap/josm/tools/PresetTextComparator.java
9 9 import org.openstreetmap.josm.Main; 10 10 11 11 public class PresetTextComparator implements Comparator<JMenuItem>, Serializable { 12 @Override 12 13 public int compare(JMenuItem arg0, JMenuItem arg1) { 13 14 if (Main.main.menu.presetSearchAction.equals(arg0.getAction())) 14 15 return -1; -
src/org/openstreetmap/josm/tools/SubclassFilteredCollection.java
40 40 } 41 41 } 42 42 43 @Override 43 44 public boolean hasNext() { 44 45 findNext(); 45 46 return current != null; 46 47 } 47 48 49 @Override 48 50 public T next() { 49 51 findNext(); 50 52 S old = current; … … 54 56 return res; 55 57 } 56 58 59 @Override 57 60 public void remove() { 58 61 throw new UnsupportedOperationException(); 59 62 }
