- Timestamp:
- 2009-11-24T10:45:04+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 278 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r2485 r2512 74 74 * Replies true if JOSM currently displays a map view. False, if it doesn't, i.e. if 75 75 * it only shows the MOTD panel. 76 * 76 * 77 77 * @return true if JOSM currently displays a map view 78 78 */ … … 128 128 */ 129 129 public static ToolbarPreferences toolbar; 130 131 130 132 131 public UndoRedoHandler undoRedo = new UndoRedoHandler(); … … 336 335 CoordinateFormat.setCoordinateFormat(CoordinateFormat.DECIMAL_DEGREES); 337 336 } 338 339 337 340 338 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); -
trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
r2343 r2512 25 25 public abstract class AbstractMergeAction extends JosmAction { 26 26 27 28 27 /** 29 28 * the list cell renderer used to render layer list entries 30 * 29 * 31 30 */ 32 31 static public class LayerListCellRenderer extends DefaultListCellRenderer { -
trunk/src/org/openstreetmap/josm/actions/AddNodeAction.java
r2323 r2512 81 81 82 82 } 83 -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r2477 r2512 98 98 * such layer exists, either because the layer list dialog is not yet created 99 99 * or because no layer is selected. 100 * 100 * 101 101 * @return the first selected layer in the layer list dialog 102 102 */ -
trunk/src/org/openstreetmap/josm/actions/CloseChangesetAction.java
r2323 r2512 49 49 } 50 50 51 52 51 protected void onPostDownloadOpenChangesets(DownloadOpenChangesetsTask task) { 53 52 if (task.isCancelled() || task.getLastException() != null) return; … … 75 74 } 76 75 77 78 76 private class DownloadOpenChangesetsTask extends PleaseWaitRunnable { 79 77 … … 85 83 86 84 /** 87 * 85 * 88 86 * @param model provides the user id of the current user and accepts the changesets 89 87 * after download … … 116 114 * Fetch the user info from the server. This is necessary if we don't know 117 115 * the users id yet 118 * 116 * 119 117 * @return the user info 120 118 * @throws OsmTransferException thrown in case of any communication exception -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r2381 r2512 90 90 } 91 91 92 93 92 public void combineWays(Collection<Way> ways) { 94 93 … … 219 218 * This is a collection of relations referring to at least one out of a set of 220 219 * ways. 221 * 220 * 222 221 * 223 222 */ … … 230 229 231 230 /** 232 * 231 * 233 232 * @param ways a collection of ways 234 233 */ … … 246 245 /** 247 246 * build the sets of referring relations from the relations in the dataset <code>ds</code> 248 * 247 * 249 248 * @param ds the data set 250 249 */ … … 273 272 /** 274 273 * Replies the set of referring relations 275 * 274 * 276 275 * @return the set of referring relations 277 276 */ … … 286 285 /** 287 286 * Replies the set of referring relations for a specific way 288 * 287 * 289 288 * @return the set of referring relations 290 289 */ … … 412 411 } 413 412 414 415 413 static public class NodeGraph { 416 414 static public List<NodePair> buildNodePairs(Way way, boolean directed) { … … 480 478 private HashMap<Node, List<NodePair>> successors; 481 479 private HashMap<Node, List<NodePair>> predecessors; 482 483 480 484 481 protected void rememberSuccessor(NodePair pair) { … … 612 609 /** 613 610 * Tries to find a spanning path starting from node <code>startNode</code>. 614 * 611 * 615 612 * Traverses the path in depth-first order. 616 * 613 * 617 614 * @param startNode the start node 618 615 * @return the spanning path; null, if no path is found … … 641 638 * Tries to find a path through the graph which visits each edge (i.e. 642 639 * the segment of a way) exactly one. 643 * 640 * 644 641 * @return the path; null, if no path was found 645 642 */ -
trunk/src/org/openstreetmap/josm/actions/DownloadAction.java
r2335 r2512 28 28 public class DownloadAction extends JosmAction { 29 29 private static final Logger logger = Logger.getLogger(DownloadAction.class.getName()); 30 30 31 31 public DownloadAction() { 32 32 super(tr("Download from OSM..."), "download", tr("Download map data from the OSM server."), … … 41 41 if (! dialog.isCanceled()) { 42 42 dialog.rememberSettings(); 43 Bounds area = dialog.getSelectedDownloadArea(); 43 Bounds area = dialog.getSelectedDownloadArea(); 44 44 if (dialog.isDownloadOsmData()) { 45 45 DownloadOsmTask task = new DownloadOsmTask(); … … 52 52 Main.worker.submit(new PostDownloadHandler(task, future)); 53 53 } 54 } 55 } 54 } 55 } 56 56 } -
trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
r2434 r2512 74 74 * Downloads the primitives referring to the primitive given by <code>id</code> and 75 75 * <code>type</code>. 76 * 76 * 77 77 * 78 78 * @param targetLayer the target layer. Must not be null. … … 118 118 /** 119 119 * constructor 120 * 120 * 121 121 * @param targetLayer the target layer for the downloaded primitives. Must not be null. 122 122 * @param children the collection of child primitives for which parents are to be downloaded 123 * 123 * 124 124 */ 125 125 public DownloadReferrersTask(OsmDataLayer targetLayer, Collection<OsmPrimitive> children) { … … 142 142 /** 143 143 * constructor 144 * 144 * 145 145 * @param targetLayer the target layer for the downloaded primitives. Must not be null. 146 146 * @param primitives the collection of children for which parents are to be downloaded. Children 147 147 * are specified by their id and their type. 148 * 148 * 149 149 */ 150 150 public DownloadReferrersTask(OsmDataLayer targetLayer, Map<Long, OsmPrimitiveType> children) { … … 167 167 /** 168 168 * constructor 169 * 169 * 170 170 * @param targetLayer the target layer. Must not be null. 171 171 * @param id the primitive id. id > 0 required. … … 174 174 * @exception IllegalArgumentException thrown if type == null 175 175 * @exception IllegalArgumentException thrown if targetLayer == null 176 * 176 * 177 177 */ 178 178 public DownloadReferrersTask(OsmDataLayer targetLayer, long id, OsmPrimitiveType type) throws IllegalArgumentException { -
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r2367 r2512 38 38 */ 39 39 public static ArrayList<FileImporter> importers; 40 40 41 41 public static ArrayList<FileExporter> exporters; 42 42 43 43 // add some file types only if the relevant classes are there; 44 44 // this gives us the option to painlessly drop them from the .jar … … 48 48 49 49 importers = new ArrayList<FileImporter>(); 50 50 51 51 String[] importerNames = { 52 52 "org.openstreetmap.josm.io.OsmImporter", … … 62 62 Class klass = Class.forName(classname); 63 63 importers.add((FileImporter)klass.newInstance()); 64 } catch (Exception e) {} 64 } catch (Exception e) {} 65 65 } 66 66 … … 78 78 Class klass = Class.forName(classname); 79 79 exporters.add((FileExporter)klass.newInstance()); 80 } catch (Exception e) {} 80 } catch (Exception e) {} 81 81 } 82 82 } … … 85 85 private final String description; 86 86 private final String defaultExtension; 87 88 87 89 88 static protected void sort(List<ExtensionFileFilter> filters) { … … 105 104 * The list is ordered according to their description, an {@see AllFormatsImporter} 106 105 * is append at the end. 107 * 106 * 108 107 * @return an ordered list of {@see ExtensionFileFilter}s for importing. 109 108 */ … … 124 123 * The list is ordered according to their description, an {@see AllFormatsImporter} 125 124 * is append at the end. 126 * 125 * 127 126 * @return an ordered list of {@see ExtensionFileFilter}s for exporting. 128 127 */ … … 141 140 /** 142 141 * Replies the default {@see ExtensionFileFilter} for a given extension 143 * 142 * 144 143 * @param extension the extension 145 144 * @return the default {@see ExtensionFileFilter} for a given extension … … 156 155 /** 157 156 * Replies the default {@see ExtensionFileFilter} for a given extension 158 * 157 * 159 158 * @param extension the extension 160 159 * @return the default {@see ExtensionFileFilter} for a given extension … … 172 171 * Applies the choosable {@see FileFilter} to a {@see JFileChooser} before using the 173 172 * file chooser for selecting a file for reading. 174 * 173 * 175 174 * @param fileChooser the file chooser 176 175 * @param extension the default extension … … 186 185 * Applies the choosable {@see FileFilter} to a {@see JFileChooser} before using the 187 186 * file chooser for selecting a file for writing. 188 * 187 * 189 188 * @param fileChooser the file chooser 190 189 * @param extension the default extension -
trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
r2343 r2512 24 24 */ 25 25 public class GpxExportAction extends DiskAccessAction { 26 27 26 28 27 public GpxExportAction() { … … 61 60 * <code>layer</code> must not be null. <code>layer</code> must be an instance of 62 61 * {@see OsmDataLayer} or {@see GpxLayer}. 63 * 62 * 64 63 * @param layer the layer 65 64 * @exception IllegalArgumentException thrown if layer is null … … 94 93 @Override 95 94 protected void updateEnabledState() { 96 boolean check = 97 Main.isDisplayingMapView() 95 boolean check = 96 Main.isDisplayingMapView() 98 97 && Main.map.mapView.getActiveLayer() != null; 99 98 if(!check) { -
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r2305 r2512 101 101 } 102 102 103 104 105 103 /** 106 104 * needs to be overridden to be useful -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r2414 r2512 40 40 /** 41 41 * Merges a collection of nodes into one node. 42 * 42 * 43 43 */ 44 44 public class MergeNodesAction extends JosmAction { … … 77 77 * The last selected node will become the target node the remaining 78 78 * nodes are merged to. 79 * 79 * 80 80 * @param candidates the collection of candidate nodes 81 81 * @return the selected target node … … 92 92 * Merges the nodes in <code>node</code> onto one of the nodes. Uses the dataset 93 93 * managed by <code>layer</code> as reference. 94 * 94 * 95 95 * @param layer the reference data layer. Must not be null. 96 96 * @param nodes the collection of nodes. Ignored if null. … … 98 98 * @throws IllegalArgumentException thrown if layer is null 99 99 * @throws IllegalArgumentException thrown if targetNode is null 100 * 100 * 101 101 */ 102 102 public static Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetNode) throws IllegalArgumentException{ … … 115 115 /** 116 116 * Fixes the parent ways referring to one of the nodes. 117 * 117 * 118 118 * Replies null, if the ways could not be fixed, i.e. because a way would have to be deleted 119 119 * which is referred to by a relation. 120 * 120 * 121 121 * @param backreferences the backreference data set 122 122 * @param nodesToDelete the collection of nodes to be deleted -
trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java
r2323 r2512 40 40 } 41 41 42 43 42 public void actionPerformed(ActionEvent e) { 44 43 if (getEditLayer() == null || getEditLayer().data.getSelected().isEmpty()) -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r2323 r2512 38 38 Shortcut.registerShortcut("system:open", tr("File: {0}", tr("Open...")), KeyEvent.VK_O, Shortcut.GROUP_MENU)); 39 39 putValue("help", ht("/Action/OpenFile")); 40 40 41 41 } 42 42 -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r2323 r2512 44 44 /** 45 45 * Restore the current history from the preferences 46 * 46 * 47 47 * @param cbHistory 48 48 */ -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r2323 r2512 171 171 else { 172 172 JOptionPane.showMessageDialog( 173 Main.parent, 173 Main.parent, 174 174 "<html><h3>"+tr(ex.getMessage())+"<br><hr><h3>"+tr("Usage")+tr(USAGE), 175 175 tr("Selected Elements cannot be orthogonalized"), … … 196 196 * the mean value of their y-Coordinates. 197 197 * - The same for vertical segments. 198 * 5. Rotate back. 198 * 5. Rotate back. 199 199 * 200 200 **/ 201 private static void orthogonalize(ArrayList<WayData> wayDataList, ArrayList<Node> headingNodes) 202 throws InvalidUserInputException 201 private static void orthogonalize(ArrayList<WayData> wayDataList, ArrayList<Node> headingNodes) 202 throws InvalidUserInputException 203 203 { 204 204 // find average heading … … 269 269 final HashSet<Node> s = new HashSet<Node>(allNodes); 270 270 int s_size = s.size(); 271 for (int dummy = 0; dummy < s_size; ++ dummy) { 272 if (s.isEmpty()) break; 271 for (int dummy = 0; dummy < s_size; ++ dummy) { 272 if (s.isEmpty()) break; 273 273 final Node dummy_n = s.iterator().next(); // pick arbitrary element of s 274 274 … … 333 333 if (headingNodes.contains(n)) { // The heading nodes should not have changed 334 334 final double EPSILON = 1E-6; 335 if (Math.abs(dx) > Math.abs(EPSILON * tmp.east()) || 335 if (Math.abs(dx) > Math.abs(EPSILON * tmp.east()) || 336 336 Math.abs(dy) > Math.abs(EPSILON * tmp.east())) { 337 337 throw new AssertionError(); 338 338 } 339 } 339 } 340 340 else { 341 341 OrthogonalizeAction.rememberMovements.put(n, new EastNorth(dx, dy)); … … 346 346 Main.map.repaint(); 347 347 } 348 349 348 350 349 /** … … 510 509 * Exception: unsuited user input 511 510 */ 512 private static class InvalidUserInputException extends Exception { 511 private static class InvalidUserInputException extends Exception { 513 512 InvalidUserInputException(String message) { 514 513 super(message); -
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r2349 r2512 70 70 double offsetNorth = mPosition.north() - (maxNorth + minNorth)/2.0; 71 71 72 73 74 72 // Make a copy of pasteBuffer and map from old id to copied data id 75 73 List<PrimitiveData> bufferCopy = new ArrayList<PrimitiveData>(); -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r2323 r2512 254 254 } 255 255 256 257 256 public void actionPerformed(ActionEvent e) { 258 257 if (getCurrentDataSet().getSelected().isEmpty()) -
trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java
r2323 r2512 38 38 this.file = file; 39 39 this.layer = layer; 40 this.putValue("help", ht("/Action/RenameLayer")); 40 this.putValue("help", ht("/Action/RenameLayer")); 41 41 } 42 42 -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r2343 r2512 130 130 } 131 131 132 133 132 /** 134 133 * Check the data set if it would be empty on save. It is empty, if it contains -
trunk/src/org/openstreetmap/josm/actions/SelectAllAction.java
r2323 r2512 26 26 /** 27 27 * Refreshes the enabled state 28 * 28 * 29 29 */ 30 30 @Override -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r2497 r2512 339 339 } 340 340 341 342 341 /** 343 342 * dupe a single node into as many nodes as there are ways using it, OR -
trunk/src/org/openstreetmap/josm/actions/UnselectAllAction.java
r2323 r2512 37 37 KeyEvent.VK_ESCAPE, Shortcut.GROUP_DIRECT).getKeyStroke(), 38 38 tr("Unselect All")); 39 39 40 40 putValue("help", ht("/Action/UnselectAll")); 41 41 } … … 48 48 /** 49 49 * Refreshes the enabled state 50 * 50 * 51 51 */ 52 52 @Override -
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r2471 r2512 148 148 149 149 /** 150 * 150 * 151 151 * @param toUpdate a collection of primitives to update from the server 152 152 */ … … 209 209 } 210 210 } 211 212 211 213 212 @Override -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r2480 r2512 50 50 import org.xml.sax.SAXException; 51 51 52 53 52 /** 54 53 * Action that opens a connection to the osm server and uploads all changes. … … 94 93 /** 95 94 * Registers an upload hook. Adds the hook at the first position of the upload hooks. 96 * 95 * 97 96 * @param hook the upload hook. Ignored if null. 98 97 */ … … 106 105 /** 107 106 * Unregisters an upload hook. Removes the hook from the list of upload hooks. 108 * 107 * 109 108 * @param hook the upload hook. Ignored if null. 110 109 */ … … 342 341 } 343 342 344 345 343 /** 346 344 * Handles the case where deleting a node failed because it is still in use in … … 466 464 } 467 465 468 469 466 /** 470 467 * error handler for any exception thrown during upload … … 574 571 575 572 /** 576 * 573 * 577 574 * @param layer the OSM data layer for which data is uploaded 578 575 * @param toUpload the collection of primitives to upload … … 600 597 * Retries to recover the upload operation from an exception which was thrown because 601 598 * an uploaded primitive was already deleted on the server. 602 * 599 * 603 600 * @param e the exception throw by the API 604 601 * @param monitor a progress monitor -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r2399 r2512 142 142 * Uploads the primitives in <code>toUpload</code> to the server. Only 143 143 * uploads primitives which are either new, modified or deleted. 144 * 144 * 145 145 * Also checks whether <code>toUpload</code> has to be extended with 146 146 * deleted parents in order to avoid precondition violations on the server. 147 * 147 * 148 148 * @param layer the data layer from which we upload a subset of primitives 149 149 * @param toUpload the primitives to upload. If null or empty returns immediatelly … … 178 178 * new primitive has to be uploaded as well, even if it isn't included in the 179 179 * list of candidate primitives. 180 * 180 * 181 181 */ 182 182 static class UploadHullBuilder implements Visitor { … … 228 228 * Builds the "hull" of primitives to be uploaded given a base collection 229 229 * of osm primitives. 230 * 230 * 231 231 * @param base the base collection. Must not be null. 232 232 * @return the "hull" … … 252 252 253 253 /** 254 * 254 * 255 255 * @param layer the data layer for which a collection of selected primitives is uploaded 256 256 * @param toUpload the collection of primitives to upload … … 291 291 * Replies the collection of deleted OSM primitives for which we have to check whether 292 292 * there are dangling references on the server. 293 * 293 * 294 294 * @return 295 295 */ -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java
r2322 r2512 30 30 } 31 31 32 33 32 protected void rememberErrorMessage(String message) { 34 33 errorMessages.add(message); … … 39 38 } 40 39 41 42 40 public List<Object> getErrorObjects() { 43 41 return errorMessages; -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r2343 r2512 29 29 return Main.worker.submit(downloadTask); 30 30 } 31 31 32 32 public Future<?> loadUrl(boolean a,java.lang.String b, ProgressMonitor progressMonitor) { 33 33 return null; … … 40 40 } 41 41 } 42 43 42 44 43 class DownloadTask extends PleaseWaitRunnable { … … 87 86 private Layer findMergeLayer() { 88 87 boolean merge = Main.pref.getBoolean("download.gps.mergeWithLocal", false); 89 if (!Main.isDisplayingMapView()) 88 if (!Main.isDisplayingMapView()) 90 89 return null; 91 90 Layer active = Main.map.mapView.getActiveLayer(); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskList.java
r2381 r2512 38 38 * a list in the end. 39 39 * @author xeen 40 * 40 * 41 41 */ 42 42 public class DownloadOsmTaskList { … … 101 101 * Replies the set of ids of all complete, non-new primitives (i.e. those with ! 102 102 * primitive.incomplete) 103 * 103 * 104 104 * @return the set of ids of all complete, non-new primitives 105 105 */ … … 127 127 * Updates the local state of a set of primitives (given by a set of primitive ids) with the 128 128 * state currently held on the server. 129 * 129 * 130 130 * @param potentiallyDeleted a set of ids to check update from the server 131 131 */ … … 149 149 * yes, retrieves the current state on the server and checks whether the primitives are indeed 150 150 * deleted on the server. 151 * 151 * 152 152 * @param potentiallyDeleted a set of primitives (given by their ids) 153 153 */ … … 196 196 /** 197 197 * Replies the set of primitive ids which have been downloaded by this task list 198 * 198 * 199 199 * @return the set of primitive ids which have been downloaded by this task list 200 200 */ -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java
r2330 r2512 8 8 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 9 9 10 11 10 public interface DownloadTask { 12 11 /** … … 16 15 * Set progressMonitor to {@see NullProgressMonitor#INSTANCE} if progress information is to 17 16 * be discarded. 18 * 17 * 19 18 * You can wait for the asynchronous download task to finish by synchronizing on the returned 20 19 * {@see Future}, but make sure not to freeze up JOSM. Example: 21 20 * <pre> 22 21 * Future<?> future = task.download(...); 23 * // DON'T run this on the Swing EDT or JOSM will freeze 24 * future.get(); // waits for the dowload task to complete 22 * // DON'T run this on the Swing EDT or JOSM will freeze 23 * future.get(); // waits for the dowload task to complete 25 24 * </pre> 26 * 25 * 27 26 * The following example uses a pattern which is better suited if a task is launched from 28 27 * the Swing EDT: … … 40 39 * Main.worker.submit(runAfterTask); 41 40 * </pre> 42 * 41 * 43 42 * @param newLayer true, if the data is to be downloaded into a new layer. If false, the task 44 43 * selects one of the existing layers as download layer, preferably the active layer. 45 * 44 * 46 45 * @param downloadArea the area to download 47 46 * @param progressMonitor the progressMonitor … … 56 55 * Set progressMonitor to {@see NullProgressMonitor#INSTANCE} if progress information is to 57 56 * be discarded. 58 57 59 58 * @param newLayer newLayer true, if the data is to be downloaded into a new layer. If false, the task 60 59 * selects one of the existing layers as download layer, preferably the active layer. … … 62 61 * @param progressMonitor the progressMonitor 63 62 * @return the future representing the asynchronous task 64 * 63 * 65 64 * @see #download(boolean, Bounds, ProgressMonitor) 66 65 */ … … 69 68 /** 70 69 * Replies the error objects of the task. Empty list, if no error messages are available. 71 * 70 * 72 71 * Error objects are either {@see String}s with error messages or {@see Exception}s. 73 72 * … … 78 77 /** 79 78 * Cancels the asynchronous download task. 80 * 79 * 81 80 */ 82 81 public void cancel(); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r2332 r2512 14 14 import org.openstreetmap.josm.gui.ExceptionDialogUtil; 15 15 import org.openstreetmap.josm.tools.ExceptionUtil; 16 17 16 18 17 public class PostDownloadHandler implements Runnable { … … 46 45 } 47 46 } 48 49 47 50 48 /** … … 59 57 this.futures.addAll(futures); 60 58 } 61 59 62 60 public void run() { 63 61 // wait for all downloads task to finish (by waiting for the futures -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r2343 r2512 124 124 } 125 125 126 127 126 @Override public void actionPerformed(ActionEvent e) { 128 127 super.actionPerformed(e); … … 165 164 * highlights. For now, only the cursor is enabled because highlighting 166 165 * requires WaySegment to be highlightable. 167 * 166 * 168 167 * Normally the mouse event also contains the modifiers. However, when the 169 168 * mouse is not moved and only modifier keys are pressed, no mouse event … … 171 170 * mouseevent. Instead we copy the previous event and only update the 172 171 * modifiers. 173 * 172 * 174 173 * @param MouseEvent 175 174 * @parm int modifiers … … 286 285 * Deletes the relation in the context of the given layer. Also notifies 287 286 * {@see RelationDialogManager} and {@see OsmDataLayer#fireDataChange()} events. 288 * 287 * 289 288 * @param layer the layer in whose context the relation is deleted. Must not be null. 290 289 * @param toDelete the relation to be deleted. Must not be null. -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r2402 r2512 274 274 } 275 275 276 277 276 @Override public void mouseMoved(MouseEvent e) { 278 277 // Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired. -
trunk/src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java
r1814 r2512 39 39 private final SelectionManager selectionManager; 40 40 41 42 41 /** 43 42 * Construct a ZoomAction without a label. -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r2467 r2512 35 35 36 36 public static final int DEFAULT_SEARCH_HISTORY_SIZE = 10; 37 38 37 39 38 public static enum SearchMode { … … 331 330 /** 332 331 * Refreshes the enabled state 333 * 332 * 334 333 */ 335 334 @Override -
trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java
r2198 r2512 28 28 * relations are uploaded before parent relations. It also checks for cyclic 29 29 * dependencies in the list of new relations. 30 * 30 * 31 31 * 32 32 */ … … 38 38 /** 39 39 * builds the panel which warns users about a cyclic dependency 40 * 40 * 41 41 * @param dep the list of relations with a cyclic dependency 42 42 * @return the panel … … 68 68 /** 69 69 * Warns the user if a cyclic dependency is detected 70 * 70 * 71 71 * @param e the cyclic dependency exception 72 72 */ -
trunk/src/org/openstreetmap/josm/command/Command.java
r2405 r2512 21 21 import org.openstreetmap.josm.gui.layer.Layer; 22 22 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 23 24 23 25 24 /** … … 151 150 abstract public MutableTreeNode description(); 152 151 153 154 155 152 } -
trunk/src/org/openstreetmap/josm/command/ConflictResolveCommand.java
r2198 r2512 14 14 * This is the common base class for {@see Command}s which manipulate {@see Conflict}s in 15 15 * addition to {@see OsmPrimitive}s. 16 * 16 * 17 17 * A ConflictResolverCommand can remember a collection of conflicts it resolves. Upon undoing 18 18 * it reconstitutes them. … … 37 37 /** 38 38 * remembers a conflict in the internal list of remembered conflicts 39 * 39 * 40 40 * @param c the remembered conflict 41 41 */ … … 49 49 * reconstitutes all remembered conflicts. Add the remembered conflicts to the 50 50 * set of conflicts of the {@see OsmDataLayer} this command was applied to. 51 * 51 * 52 52 */ 53 53 protected void reconstituteConflicts() { -
trunk/src/org/openstreetmap/josm/command/CoordinateConflictResolveCommand.java
r2181 r2512 30 30 /** 31 31 * constructor 32 * 32 * 33 33 * @param my my node 34 34 * @param their their node … … 39 39 this.decision = decision; 40 40 } 41 42 41 43 42 @Override -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r2468 r2512 50 50 /** 51 51 * Constructor. Deletes a collection of primitives in the current edit layer. 52 * 52 * 53 53 * @param data the primitives to delete. Must neither be null nor empty. 54 54 * @throws IllegalArgumentException thrown if data is null or empty … … 64 64 /** 65 65 * Constructor. Deletes a single primitive in the current edit layer. 66 * 66 * 67 67 * @param data the primitive to delete. Must not be null. 68 68 * @throws IllegalArgumentException thrown if data is null -
trunk/src/org/openstreetmap/josm/command/DeletedStateConflictResolveCommand.java
r2181 r2512 30 30 /** 31 31 * constructor 32 * 32 * 33 33 * @param my my node 34 34 * @param their their node … … 39 39 this.decision = decision; 40 40 } 41 42 41 43 42 @Override -
trunk/src/org/openstreetmap/josm/command/MoveCommand.java
r2495 r2512 54 54 */ 55 55 private List<OldState> oldState = new LinkedList<OldState>(); 56 57 56 58 57 public MoveCommand(OsmPrimitive osm, double x, double y) { -
trunk/src/org/openstreetmap/josm/command/PurgePrimitivesCommand.java
r2414 r2512 65 65 * constructor 66 66 * @param primitive the primitive to purge 67 * 67 * 68 68 */ 69 69 public PurgePrimitivesCommand(OsmPrimitive primitive) { … … 75 75 * @param layer the OSM data layer 76 76 * @param primitive the primitive to purge 77 * 77 * 78 78 */ 79 79 public PurgePrimitivesCommand(OsmDataLayer layer, OsmPrimitive primitive) { … … 86 86 * @param layer the OSM data layer 87 87 * @param primitives the primitives to purge 88 * 88 * 89 89 */ 90 90 public PurgePrimitivesCommand(OsmDataLayer layer, Collection<OsmPrimitive> primitives) { … … 95 95 /** 96 96 * Replies a collection with the purged primitives 97 * 97 * 98 98 * @return a collection with the purged primitives 99 99 */ … … 235 235 * Use to inject a backreference data set used when the command 236 236 * is executed. 237 * 237 * 238 238 * @param ds the backreference data set 239 239 */ -
trunk/src/org/openstreetmap/josm/command/RelationMemberConflictResolverCommand.java
r2163 r2512 50 50 this.mergedMembers = mergedMembers; 51 51 } 52 53 52 54 53 @Override -
trunk/src/org/openstreetmap/josm/command/TagConflictResolveCommand.java
r2070 r2512 27 27 private static final Logger logger = Logger.getLogger(TagConflictResolveCommand.class.getName()); 28 28 29 30 29 /** the conflict to resolve */ 31 30 private Conflict<OsmPrimitive> conflict; … … 34 33 private final List<TagMergeItem> mergeItems; 35 34 36 37 35 /** 38 36 * replies the number of decided conflicts 39 * 37 * 40 38 * @return the number of decided conflicts 41 39 */ … … 52 50 /** 53 51 * constructor 54 * 52 * 55 53 * @param my my primitive 56 54 * @param their their primitive … … 61 59 this.mergeItems = mergeItems; 62 60 } 63 64 61 65 62 @Override -
trunk/src/org/openstreetmap/josm/command/UndeletePrimitivesCommand.java
r2410 r2512 55 55 } 56 56 57 58 57 @Override 59 58 public MutableTreeNode description() { -
trunk/src/org/openstreetmap/josm/command/WayNodesConflictResolverCommand.java
r2381 r2512 35 35 private final List<Node> mergedNodeList; 36 36 37 38 37 /** 39 38 * … … 46 45 this.mergedNodeList = mergedNodeList; 47 46 } 48 49 47 50 48 @Override -
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r2320 r2512 27 27 * API. 28 28 * The collection is derived from the modified primitives of an {@see DataSet}. 29 * 29 * 30 30 */ 31 31 public class APIDataSet { … … 45 45 /** 46 46 * initializes the API data set with the modified primitives in <code>ds</code> 47 * 47 * 48 48 * @param ds the data set. Ignored, if null. 49 49 */ … … 73 73 * Ensures that primitives are deleted in the following order: Relations, then Ways, 74 74 * then Nodes. 75 * 75 * 76 76 */ 77 77 protected void sortDeleted() { … … 103 103 * Ensures that primitives are added in the following order: Nodes, then Ways, 104 104 * then Relations. 105 * 105 * 106 106 */ 107 107 protected void sortNew() { … … 131 131 /** 132 132 * initializes the API data set with the modified primitives in <code>ds</code> 133 * 133 * 134 134 * @param ds the data set. Ignored, if null. 135 135 */ … … 141 141 /** 142 142 * initializes the API data set with the primitives in <code>primitives</code> 143 * 143 * 144 144 * @param primitives the collection of primitives 145 145 */ … … 164 164 /** 165 165 * Replies true if there are no primitives to upload 166 * 166 * 167 167 * @return true if there are no primitives to upload 168 168 */ … … 173 173 /** 174 174 * Replies the primitives which should be added to the OSM database 175 * 175 * 176 176 * @return the primitives which should be added to the OSM database 177 177 */ … … 182 182 /** 183 183 * Replies the primitives which should be updated in the OSM database 184 * 184 * 185 185 * @return the primitives which should be updated in the OSM database 186 186 */ … … 191 191 /** 192 192 * Replies the primitives which should be deleted in the OSM database 193 * 193 * 194 194 * @return the primitives which should be deleted in the OSM database 195 195 */ … … 200 200 /** 201 201 * Replies all primitives 202 * 202 * 203 203 * @return all primitives 204 204 */ … … 214 214 * Adjusts the upload order for new relations. Child relations are uploaded first, 215 215 * parent relations second. 216 * 216 * 217 217 * This method detects cyclic dependencies in new relation. Relations with cyclic 218 218 * dependencies can't be uploaded. 219 * 219 * 220 220 * @throws CyclicUploadDependencyException thrown, if a cyclic dependency is detected 221 221 */ … … 238 238 * Replies the subset of relations in <code>relations</code> which are not referring to any 239 239 * new relation 240 * 240 * 241 241 * @param relations a list of relations 242 242 * @return the subset of relations in <code>relations</code> which are not referring to any … … 263 263 * Utility class to sort a collection of of new relations with their dependencies 264 264 * topologically. 265 * 265 * 266 266 */ 267 267 private class RelationUploadDependencyGraph { -
trunk/src/org/openstreetmap/josm/data/Bounds.java
r2456 r2512 87 87 * new bounds shall have an extension in latitude direction of <code>latExtent</code>, 88 88 * and in longitude direction of <code>lonExtent</code>. 89 * 89 * 90 90 * @param center the center coordinate pair. Must not be null. 91 91 * @param latExtent the latitude extent. > 0 required. -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r2372 r2512 376 376 } 377 377 378 379 378 public void load() throws IOException { 380 379 properties.clear(); -
trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
r2334 r2512 201 201 for (int i = 0; i < 4; ++i) { 202 202 String token = st.nextToken(); 203 try { 203 try { 204 204 values[i] = Double.parseDouble(token); 205 205 } catch(NumberFormatException e) { 206 206 System.err.println(tr("Error: Illegal double value ''{0}'' on line ''{1}'' in bookmark list from server",token,line)); 207 continue; 207 continue; 208 208 } 209 209 } -
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r2348 r2512 27 27 public final LinkedList<CommandQueueListener> listenerCommands = new LinkedList<CommandQueueListener>(); 28 28 29 30 29 public UndoRedoHandler() { 31 30 Layer.listeners.add(this); 32 31 } 33 34 32 35 33 /** -
trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
r2198 r2512 14 14 * {@see OsmPrimitive} from the dataset in another layer or the one retrieved from the server.</li> 15 15 * </ul> 16 * 16 * 17 17 * 18 18 */ -
trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
r2381 r2512 19 19 * <pre> 20 20 * ConflictCollection conflictCollection = .... 21 * 21 * 22 22 * for(Conflict c : conflictCollection) { 23 23 * // do something … … 68 68 /** 69 69 * Adds a conflict to the collection 70 * 70 * 71 71 * @param conflict the conflict 72 72 * @exception IllegalStateException thrown, if this collection already includes a … … 83 83 /** 84 84 * Adds a conflict to the collection of conflicts. 85 * 85 * 86 86 * @param conflict the conflict to to add. Must not be null. 87 87 * @throws IllegalArgumentException thrown, if conflict is null 88 88 * @throws IllegalStateException thrown if this collection already includes a conflict for conflict.getMy() 89 * 89 * 90 90 */ 91 91 public void add(Conflict<?> conflict) throws IllegalStateException, IllegalArgumentException { … … 98 98 /** 99 99 * Add the conflicts in <code>otherConflicts</code> to this collection of conflicts 100 * 100 * 101 101 * @param otherConflicts the collection of conflicts. Does nothing is conflicts is null. 102 102 */ … … 112 112 * Adds a conflict for the pair of {@see OsmPrimitive}s given by <code>my</code> and 113 113 * <code>their</code>. 114 * 114 * 115 115 * @param my my primitive 116 116 * @param their their primitive … … 123 123 /** 124 124 * removes a conflict from this collection 125 * 125 * 126 126 * @param conflict the conflict 127 127 */ … … 133 133 /** 134 134 * removes the conflict registered for {@see OsmPrimitive} <code>my</code> if any 135 * 135 * 136 136 * @param my the primitive 137 137 */ … … 149 149 * Replies the conflict for the {@see OsmPrimitive} <code>my</code>, null 150 150 * if no such conflict exists. 151 * 151 * 152 152 * @param my my primitive 153 153 * @return the conflict for the {@see OsmPrimitive} <code>my</code>, null … … 164 164 * Replies the conflict for the {@see OsmPrimitive} <code>their</code>, null 165 165 * if no such conflict exists. 166 * 166 * 167 167 * @param my my primitive 168 168 * @return the conflict for the {@see OsmPrimitive} <code>their</code>, null … … 179 179 /** 180 180 * Replies true, if this collection includes a conflict for <code>my</code>. 181 * 181 * 182 182 * @param my my primitive 183 183 * @return true, if this collection includes a conflict for <code>my</code>; false, otherwise … … 189 189 /** 190 190 * Replies true, if this collection includes a given conflict 191 * 191 * 192 192 * @param c the conflict 193 193 * @return true, if this collection includes the conflict; false, otherwise … … 199 199 /** 200 200 * Replies true, if this collection includes a conflict for <code>their</code>. 201 * 201 * 202 202 * @param their their primitive 203 203 * @return true, if this collection includes a conflict for <code>their</code>; false, otherwise … … 209 209 /** 210 210 * Removes any conflicts for the {@see OsmPrimitive} <code>my</code>. 211 * 211 * 212 212 * @param my the primitive 213 213 */ … … 223 223 /** 224 224 * Removes any conflicts for the {@see OsmPrimitive} <code>their</code>. 225 * 225 * 226 226 * @param their the primitive 227 227 */ … … 237 237 /** 238 238 * Replies the conflicts as list. 239 * 239 * 240 240 * @return the list of conflicts 241 241 */ … … 246 246 /** 247 247 * Replies the size of the collection 248 * 248 * 249 249 * @return the size of the collection 250 250 */ … … 255 255 /** 256 256 * Replies the conflict at position <code>idx</code> 257 * 257 * 258 258 * @param idx the index 259 259 * @return the conflict at position <code>idx</code> … … 265 265 /** 266 266 * Replies the iterator for this collection. 267 * 267 * 268 268 * @return the iterator 269 269 */ … … 281 281 * Replies the set of {@see OsmPrimitive} which participate in the role 282 282 * of "my" in the conflicts managed by this collection. 283 * 283 * 284 284 * @return the set of {@see OsmPrimitive} which participate in the role 285 285 * of "my" in the conflicts managed by this collection. … … 295 295 * Replies the set of {@see OsmPrimitive} which participate in the role 296 296 * of "their" in the conflicts managed by this collection. 297 * 297 * 298 298 * @return the set of {@see OsmPrimitive} which participate in the role 299 299 * of "their" in the conflicts managed by this collection. … … 309 309 /** 310 310 * Replies true if this collection is empty 311 * 311 * 312 312 * @return true, if this collection is empty; false, otherwise 313 313 */ -
trunk/src/org/openstreetmap/josm/data/coor/CoordinateFormat.java
r1990 r2512 6 6 /** 7 7 * An enumeration of coordinate formats 8 * 8 * 9 9 */ 10 10 public enum CoordinateFormat { … … 27 27 /** 28 28 * Replies the display name of the format 29 * 29 * 30 30 * @return the display name 31 31 */ … … 43 43 /** 44 44 * Replies the default coordinate format to be use 45 * 45 * 46 46 * @return the default coordinate format 47 47 */ … … 52 52 /** 53 53 * Sets the default coordinate format 54 * 54 * 55 55 * @param format the default coordinate format 56 56 */ -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r2457 r2512 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.data.coor; 3 4 3 5 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 27 26 /** 28 27 * Replies true if lat is in the range [-90,90] 29 * 28 * 30 29 * @param lat the latitude 31 30 * @return true if lat is in the range [-90,90] … … 37 36 /** 38 37 * Replies true if lon is in the range [-180,180] 39 * 38 * 40 39 * @param lon the longitude 41 40 * @return true if lon is in the range [-180,180] -
trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java
r2422 r2512 1 1 // License: GPL. Copyright 2009 by Dave Hansen, others 2 2 package org.openstreetmap.josm.data.coor; 3 4 3 5 4 public class QuadTiling -
trunk/src/org/openstreetmap/josm/data/osm/BackreferencedDataSet.java
r2414 r2512 87 87 * Replies the set of parent primitives for a given child primitive. Replies 88 88 * an empty set if no parents refer to the child. 89 * 89 * 90 90 * @param child the child primitive 91 91 * @return the set of parent primitives for a given child primitive. … … 109 109 * Replies true if there is at least one parent referring to child; 110 110 * false otherwise 111 * 111 * 112 112 * @param child the child primitive 113 113 * @return true if there is at least one parent referring to child; … … 119 119 /** 120 120 * Replies a set of all {@see RelationToChildReference}s for a given child primitive. 121 * 121 * 122 122 * @param child the child primitive 123 123 * @return a set of all {@see RelationToChildReference}s for a given child primitive … … 138 138 /** 139 139 * Replies a set of all {@see RelationToChildReference}s for a collection of child primitives 140 * 140 * 141 141 * @param children the collection of child primitives 142 142 * @return a set of all {@see RelationToChildReference}s to the children in the collection of child -
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r2305 r2512 39 39 private boolean incomplete; 40 40 41 42 41 /** 43 42 * Creates a new changeset with id 0. … … 197 196 } 198 197 199 200 198 public boolean hasEqualSemanticAttributes(Changeset other) { 201 199 if (other == null) -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r2497 r2512 57 57 /** 58 58 * Replies the API version this dataset was created from. May be null. 59 * 59 * 60 60 * @return the API version this dataset was created from. May be null. 61 61 */ … … 66 66 /** 67 67 * Sets the API version this dataset was created from. 68 * 68 * 69 69 * @param version the API version, i.e. "0.5" or "0.6" 70 70 */ … … 81 81 /** 82 82 * Replies an unmodifiable collection of nodes in this dataset 83 * 83 * 84 84 * @return an unmodifiable collection of nodes in this dataset 85 85 */ … … 101 101 /** 102 102 * Replies an unmodifiable collection of ways in this dataset 103 * 103 * 104 104 * @return an unmodifiable collection of ways in this dataset 105 105 */ … … 119 119 /** 120 120 * Replies an unmodifiable collection of relations in this dataset 121 * 121 * 122 122 * @return an unmodifiable collection of relations in this dataset 123 123 */ … … 239 239 } 240 240 241 242 241 /*--------------------------------------------------- 243 242 * SELECTION HANDLING … … 254 253 * notifies all registered selection change listeners about the current selection of 255 254 * primitives 256 * 255 * 257 256 * @param sel the current selection 258 257 */ … … 266 265 * Notifies all registered {@see SelectionChangedListener} about the current selection in 267 266 * this dataset. 268 * 267 * 269 268 */ 270 269 public void fireSelectionChanged(){ 271 270 notifySelectionChangeListeners(selectedPrimitives); 272 271 } 273 274 272 275 273 LinkedHashSet<OsmPrimitive> selectedPrimitives = new LinkedHashSet<OsmPrimitive>(); … … 285 283 return sel; 286 284 } 287 288 285 289 286 /** … … 339 336 } 340 337 341 342 338 public void toggleSelected(Collection<? extends PrimitiveId> osm) { 343 339 boolean changed = false; … … 457 453 } 458 454 459 460 455 /*------------------------------------------------------ 461 456 * FILTERED / DISABLED HANDLING … … 508 503 } 509 504 510 511 505 /** 512 506 * Remove the filtered parameter from every value in the collection. … … 531 525 } 532 526 } 533 534 527 535 528 @Override public DataSet clone() { … … 789 782 } 790 783 791 792 784 public void addDataSetListener(DataSetListener dsl) { 793 785 listeners.add(dsl); … … 913 905 * Removes all primitives from the dataset and resets the currently selected primitives 914 906 * to the empty collection. Also notifies selection change listeners if necessary. 915 * 907 * 916 908 */ 917 909 public void clear() { … … 926 918 } 927 919 928 929 920 // TODO Should be completely part of validator 930 921 private Map<OsmPrimitive, List<String>> errors = new HashMap<OsmPrimitive, List<String>>(); … … 941 932 /** 942 933 * Replies the list of errors registered for this primitive. 943 * 934 * 944 935 * @param primitive the primitive for which errors are queried 945 936 * @return the list of errors. Never null. -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r2497 r2512 17 17 * A dataset merger which takes a target and a source dataset and merges the source data set 18 18 * onto the target dataset. 19 * 19 * 20 20 */ 21 21 public class DataSetMerger { … … 179 179 /** 180 180 * Merges the node list of a source way onto its target way. 181 * 181 * 182 182 * @param source the source way 183 183 * @throws IllegalStateException thrown if no target way can be found for the source way 184 184 * @throws IllegalStateException thrown if there isn't a target node for one of the nodes in the source way 185 * 185 * 186 186 */ 187 187 private void mergeNodeList(Way source) throws IllegalStateException { … … 204 204 target.setNodes(newNodes); 205 205 } 206 207 206 208 207 /** -
trunk/src/org/openstreetmap/josm/data/osm/DateFormatter.java
r1169 r2512 5 5 import java.util.GregorianCalendar; 6 6 import java.util.TimeZone; 7 8 7 9 8 /** … … 16 15 private GregorianCalendar calendar; 17 16 18 19 17 /** 20 18 * Creates a new instance. … … 23 21 calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC")); 24 22 } 25 26 23 27 24 /** -
trunk/src/org/openstreetmap/josm/data/osm/Filter.java
r2145 r2512 39 39 applyForChildren = Boolean.parseBoolean(prfs[9]); 40 40 41 } 41 } 42 42 43 43 public String getPrefString(){ 44 return version + ";" + 44 return version + ";" + 45 45 text + ";" + mode + ";" + caseSensitive + ";" + regexSearch + ";" + 46 "legacy" + ";" + enable + ";" + hide + ";" + 46 "legacy" + ";" + enable + ";" + hide + ";" + 47 47 inverted + ";" + applyForChildren; 48 48 } -
trunk/src/org/openstreetmap/josm/data/osm/Hash.java
r2399 r2512 1 1 /* 2 2 * JOSMng - a Java Open Street Map editor, the next generation. 3 * 3 * 4 4 * Copyright (C) 2008 Petr Nejedly <P.Nejedly@sh.cvut.cz> 5 5 * … … 26 26 * It supports two type parameters to implement effective foreign key implementation 27 27 * inside (@link Storage}, but for basic use, both type parameters are the same. 28 * 28 * 29 29 * For use cases, see {@link Storage}. 30 30 * @author nenik 31 31 */ 32 32 public interface Hash<K,T> { 33 33 34 34 /** 35 35 * Get hashcode for given instance, based on some inner state of the 36 36 * instance. The returned hashcode should remain constant over the time, 37 37 * so it should be based on some instance invariant. 38 * 38 * 39 39 * @param k the object to compute hashcode for 40 40 * @return computed hashcode 41 41 */ 42 42 public int getHashCode(K k); 43 43 44 44 /** 45 45 * Compare two instances for semantic or lookup equality. For use cases 46 46 * where it compares different types, refer to {@link Storage}. 47 * 47 * 48 48 * @param k the object to compare 49 49 * @param t the object to compare -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r2450 r2512 51 51 } 52 52 53 54 53 protected Node(long id, boolean allowNegative) { 55 54 super(id, allowNegative); 56 55 } 57 58 56 59 57 /** … … 65 63 } 66 64 67 68 65 /** 69 66 * Create an incomplete Node object … … 74 71 75 72 /** 76 * 73 * 77 74 * @param clone 78 75 * @param clearId If true, set version to 0 and id to new unique value … … 114 111 /** 115 112 * Merges the technical and semantical attributes from <code>other</code> onto this. 116 * 113 * 117 114 * Both this and other must be new, or both must be assigned an OSM ID. If both this and <code>other</code> 118 115 * have an assigend OSM id, the IDs have to be the same. 119 * 116 * 120 117 * @param other the other primitive. Must not be null. 121 118 * @throws IllegalArgumentException thrown if other is null. -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2485 r2512 23 23 import org.openstreetmap.josm.data.osm.visitor.Visitor; 24 24 import org.openstreetmap.josm.gui.mappaint.ElemStyle; 25 26 25 27 26 /** … … 97 96 } 98 97 99 100 98 private static final int FLAG_MODIFIED = 1 << 0; 101 99 private static final int FLAG_VISIBLE = 1 << 1; … … 150 148 return ret; 151 149 } 152 153 150 154 151 /* mappaint data */ … … 496 493 return uninteresting; 497 494 } 498 499 495 500 496 private static Collection<String> directionKeys = null; … … 772 768 /** 773 769 * Replies true if this primitive has a tag with key <code>key</code> 774 * 770 * 775 771 * @param key the key 776 772 * @return true, if his primitive has a tag with key <code>key</code> … … 787 783 /** 788 784 * Replies true if other isn't null and has the same tags (key/value-pairs) as this. 789 * 785 * 790 786 * @param other the other object primitive 791 787 * @return true if other isn't null and has the same tags (key/value-pairs) as this. … … 800 796 801 797 private Object referrers; 802 803 798 804 799 /** … … 895 890 return result; 896 891 } 897 898 892 899 893 /** … … 1030 1024 } 1031 1025 1032 1033 1026 /** 1034 1027 * Replies the name of this primitive. The default implementation replies the value … … 1146 1139 } 1147 1140 } 1148 -
trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
r2405 r2512 148 148 } 149 149 150 151 150 @SuppressWarnings("unchecked") 152 151 static public <T extends PrimitiveData> List<T> getFilteredList(Collection<T> list, OsmPrimitiveType type) { … … 174 173 } 175 174 176 177 178 175 } -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r2454 r2512 12 12 import org.openstreetmap.josm.data.coor.LatLon; 13 13 import org.openstreetmap.josm.data.coor.QuadTiling; 14 15 14 16 15 public class QuadBuckets<T extends OsmPrimitive> implements Collection<T> -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r2450 r2512 283 283 } 284 284 285 286 285 /** 287 286 * removes all members with member.member == primitive -
trunk/src/org/openstreetmap/josm/data/osm/Storage.java
r2399 r2512 144 144 145 145 public @Override int hashCode() { 146 146 int h = 0; 147 147 for (T t : this) h += hash.getHashCode(t); 148 148 return h; 149 149 } 150 150 … … 259 259 } 260 260 261 262 263 261 private void ensureSpace() { 264 262 if (size > data.length*loadFactor) { // rehash … … 277 275 } 278 276 } 279 280 277 281 278 // -------------- factories -------------------- -
trunk/src/org/openstreetmap/josm/data/osm/Tag.java
r2305 r2512 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.osm; 3 4 3 5 4 /** -
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r2381 r2512 679 679 } 680 680 681 682 681 public TagCollection emptyTagsForKeysMissingIn(TagCollection other) { 683 682 TagCollection ret = new TagCollection(); -
trunk/src/org/openstreetmap/josm/data/osm/User.java
r2471 r2512 27 27 private static HashMap<Long,User> userMap = new HashMap<Long,User>(); 28 28 29 30 29 private static long getNextLocalUid() { 31 30 synchronized(User.class) { … … 36 35 /** 37 36 * Creates a local user with the given name 38 * 37 * 39 38 * @param name the name 40 39 */ … … 47 46 /** 48 47 * Creates a user known to the OSM server 49 * 48 * 50 49 * @param uid the user id 51 50 * @param name the name … … 64 63 /** 65 64 * clears the static map of user ids to user objects 66 * 65 * 67 66 */ 68 67 public static void clearUserMap() { … … 72 71 /** 73 72 * Returns the user with user id <code>uid</code> or null if this user doesn't exist 74 * 73 * 75 74 * @param uid the user id 76 75 * @return the user; null, if there is no user with this id … … 83 82 * Returns the list of users with name <code>name</code> or the empty list if 84 83 * no such users exist 85 * 84 * 86 85 * @param name the user name 87 86 * @return the list of users with name <code>name</code> or the empty list if … … 108 107 /** 109 108 * Replies the user name 110 * 109 * 111 110 * @return the user name. Never null, but may be the empty string 112 111 */ … … 118 117 * Replies the user id. If this user is known to the OSM server the positive user id 119 118 * from the server is replied. Otherwise, a negative local value is replied. 120 * 119 * 121 120 * A negative local is only unique during an editing session. It is lost when the 122 121 * application is closed and there is no guarantee that a negative local user id is 123 122 * always bound to a user with the same name. 124 * 123 * 125 124 */ 126 125 public long getId() { -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r2458 r2512 133 133 } 134 134 135 136 135 @Override public void visit(Visitor visitor) { 137 136 visitor.visit(this); … … 151 150 152 151 /** 153 * 152 * 154 153 * @param original 155 154 * @param clearId … … 327 326 } 328 327 329 330 328 public boolean isClosed() { 331 329 if (incomplete) return false; -
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r2448 r2512 17 17 * Represents the history of an OSM primitive. The history consists 18 18 * of a list of object snapshots with a specific version. 19 * 19 * 20 20 */ 21 21 public class History{ … … 42 42 /** 43 43 * Creates a new history for an OSM primitive 44 * 44 * 45 45 * @param id the id. >0 required. 46 46 * @param type the primitive type. Must not be null. … … 48 48 * @throws IllegalArgumentException thrown if id <= 0 49 49 * @throws IllegalArgumentException if type is null 50 * 50 * 51 51 */ 52 52 protected History(long id, OsmPrimitiveType type, List<HistoryOsmPrimitive> versions) { … … 169 169 /** 170 170 * Replies the primitive id for this history. 171 * 171 * 172 172 * @return the primitive id 173 173 */ … … 187 187 * Replies the history primitive with version <code>version</code>. null, 188 188 * if no such primitive exists. 189 * 189 * 190 190 * @param version the version 191 191 * @return the history primitive with version <code>version</code> -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java
r2448 r2512 15 15 /** 16 16 * A data set holding histories of OSM primitives. 17 * 17 * 18 18 * 19 19 */ … … 26 26 /** 27 27 * Replies the unique instance of the history data set 28 * 28 * 29 29 * @return the unique instance of the history data set 30 30 */ … … 70 70 * Replies the history primitive for the primitive with id <code>id</code> 71 71 * and version <code>version</code>. null, if no such primitive exists. 72 * 72 * 73 73 * @param id the id of the primitive. > 0 required. 74 74 * @param type the primitive type. Must not be null. … … 98 98 /** 99 99 * Adds a history primitive to the data set 100 * 100 * 101 101 * @param primitive the history primitive to add 102 102 */ … … 113 113 * Replies the history for a given primitive with id <code>id</code> 114 114 * and type <code>type</code>. 115 * 115 * 116 116 * @param id the id the if of the primitive. > 0 required 117 117 * @param type the type of the primitive. Must not be null. … … 133 133 * Replies the history for a primitive with id <code>id</code>. null, if no 134 134 * such history exists. 135 * 135 * 136 136 * @param pid the primitive id. Must not be null. 137 137 * @return the history for a primitive with id <code>id</code>. null, if no … … 150 150 /** 151 151 * merges the histories from the {@see HistoryDataSet} other in this history data set 152 * 152 * 153 153 * @param other the other history data set. Ignored if null. 154 154 */ -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java
r2243 r2512 6 6 import org.openstreetmap.josm.data.coor.LatLon; 7 7 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 8 9 8 10 9 /** -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r2448 r2512 135 135 * Sets the tags for this history primitive. Removes all 136 136 * tags if <code>tags</code> is null. 137 * 137 * 138 138 * @param tags the tags. May be null. 139 139 */ -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryRelation.java
r2181 r2512 22 22 /** 23 23 * constructor 24 * 24 * 25 25 * @param id the id (>0 required) 26 26 * @param version the version (> 0 required) … … 30 30 * @param changesetId the changeset id (> 0 required) 31 31 * @param timestamp the timestamp (! null required) 32 * 32 * 33 33 * @throws IllegalArgumentException thrown if preconditions are violated 34 34 */ … … 40 40 /** 41 41 * constructor 42 * 42 * 43 43 * @param id the id (>0 required) 44 44 * @param version the version (> 0 required) … … 49 49 * @param timestamp the timestamp (! null required) 50 50 * @param members list of members for this relation 51 * 51 * 52 52 * @throws IllegalArgumentException thrown if preconditions are violated 53 53 */ … … 62 62 /** 63 63 * replies an immutable list of members of this relation 64 * 64 * 65 65 * @return an immutable list of members of this relation 66 66 */ … … 71 71 /** 72 72 * replies the number of members 73 * 73 * 74 74 * @return the number of members 75 * 75 * 76 76 */ 77 77 public int getNumMembers() { … … 93 93 /** 94 94 * replies the type, i.e. {@see OsmPrimitiveType#RELATION} 95 * 95 * 96 96 */ 97 97 @Override … … 102 102 /** 103 103 * adds a member to the list of members 104 * 104 * 105 105 * @param member the member (must not be null) 106 106 * @exception IllegalArgumentException thrown, if member is null -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java
r2181 r2512 39 39 /** 40 40 * replies the idx-th node id in the list of node ids of this way 41 * 41 * 42 42 * @param idx the index 43 43 * @return the idx-th node id … … 52 52 /** 53 53 * replies an immutable list of the ways node ids 54 * 54 * 55 55 * @return the ways node ids 56 56 */ … … 61 61 /** 62 62 * replies the ways type, i.e. {@see OsmPrimitiveType#WAY} 63 * 63 * 64 64 * @return the ways type 65 65 */ … … 71 71 /** 72 72 * adds a node id to the list nodes of this way 73 * 73 * 74 74 * @param ref the node id to add 75 75 */ -
trunk/src/org/openstreetmap/josm/data/osm/history/RelationMember.java
r2181 r2512 18 18 19 19 /** 20 * 20 * 21 21 * @param role the role 22 22 * @param primitiveType the type (must not be null) 23 23 * @param primitiveId the id (>0 required) 24 * 24 * 25 25 * @exception IllegalArgumentException thrown, if primitiveType is null 26 26 * @exception IllegalArgumentException thrown, if primitiveId <= 0 … … 46 46 /** 47 47 * replies the type of the referenced OSM primitive 48 * 48 * 49 49 * @return the type of the referenced OSM primitive 50 50 */ … … 55 55 /** 56 56 * replies the id of the referenced OSM primitive 57 * 57 * 58 58 * @return the id of the referenced OSM primitive 59 59 */ -
trunk/src/org/openstreetmap/josm/data/osm/visitor/CollectBackReferencesVisitor.java
r2407 r2512 24 24 private Collection<OsmPrimitive> data = new HashSet<OsmPrimitive>(); 25 25 26 27 26 /** 28 27 * @param ds This parameter is ignored … … 43 42 this.indirectRefs = indirectRefs; 44 43 } 45 46 44 47 45 /** -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r2466 r2512 1171 1171 // g.setColor(new Color(255,255,0,128)); 1172 1172 // g.drawRect((int)centeredNBounds.getMinX(), 1173 // 1174 // 1175 // 1173 // (int)centeredNBounds.getMinY(), 1174 // (int)centeredNBounds.getWidth(), 1175 // (int)centeredNBounds.getHeight()); 1176 1176 1177 1177 if ((pb.width >= nb.getWidth() && pb.height >= nb.getHeight()) && // quick check … … 1619 1619 } 1620 1620 1621 1622 1621 //if(profiler) 1623 1622 //{ -
trunk/src/org/openstreetmap/josm/data/projection/NTV2Util.java
r2507 r2512 81 81 } 82 82 83 84 83 /** 85 84 * Get a double from the first 8 bytes of a byte array, -
trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
r2511 r2512 121 121 { 122 122 zone = DEFAULT_ZONE; 123 if( !args != null)123 if(args != null) 124 124 { 125 125 try { -
trunk/src/org/openstreetmap/josm/data/projection/SwissGrid.java
r2114 r2512 33 33 double phiprime_2 = Math.pow(phiprime,2); 34 34 35 36 35 double north = 37 36 200147.07d … … 41 40 - 194.56d * lambdaprime_2 * phiprime 42 41 + 119.79d * Math.pow(phiprime,3); 43 44 42 45 43 double east = -
trunk/src/org/openstreetmap/josm/gui/BookmarkList.java
r2344 r2512 82 82 } 83 83 } 84 84 85 85 class BookmarkCellRenderer extends JLabel implements ListCellRenderer { 86 86 87 87 private ImageIcon icon; 88 88 89 89 public BookmarkCellRenderer() { 90 90 setOpaque(true); … … 92 92 setIcon(icon); 93 93 } 94 94 95 95 protected void renderColor(boolean selected) { 96 96 if (selected) { … … 102 102 } 103 103 } 104 104 105 105 protected String buildToolTipText(Bookmark b) { 106 106 Bounds area = b.getArea(); … … 113 113 .append("</html>"); 114 114 return sb.toString(); 115 115 116 116 } 117 117 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 118 118 boolean cellHasFocus) { 119 119 120 120 Bookmark b = (Bookmark) value; 121 121 renderColor(isSelected); … … 123 123 setToolTipText(buildToolTipText(b)); 124 124 return this; 125 } 125 } 126 126 } 127 127 } -
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r2070 r2512 16 16 import org.openstreetmap.josm.tools.GBC; 17 17 18 19 18 /** 20 19 * ConditionalOptionPaneUtil provides static utility methods for displaying modal message dialogs 21 20 * which can be enabled/disabled by the user. 22 * 21 * 23 22 * They wrap the methods provided by {@see JOptionPane}. Within JOSM you should use these 24 23 * methods rather than the bare methods from {@see JOptionPane} because the methods provided 25 24 * by ConditionalOptionPaneUtil ensure that a dialog window is always on top and isn't hidden by one of the 26 25 * JOSM windows for detached dialogs, relation editors, history browser and the like. 27 * 26 * 28 27 */ 29 28 public class ConditionalOptionPaneUtil { … … 38 37 * Replies the preference value for the preference key "message." + <code>prefKey</code>. 39 38 * The default value if the preference key is missing is true. 40 * 39 * 41 40 * @param the preference key 42 41 * @return prefKey the preference value for the preference key "message." + <code>prefKey</code> … … 48 47 /** 49 48 * sets the value for the preference key "message." + <code>prefKey</code>. 50 * 49 * 51 50 * @param prefKey the key 52 51 * @param enabled the value … … 60 59 * It is always on top even if there are other open windows like detached dialogs, 61 60 * relation editors, history browsers and the like. 62 * 61 * 63 62 * Set <code>optionType</code> to {@see JOptionPane#YES_NO_OPTION} for a dialog with a YES and 64 63 * a NO button. … … 66 65 * Set <code>optionType</code> to {@see JOptionPane#YES_NO_CANCEL_OPTION} for a dialog with a YES, 67 66 * a NO and a CANCEL button 68 * 67 * 69 68 * Replies true, if the selected option is equal to <code>trueOption</code>, otherwise false. 70 69 * Replies true, if the dialog is not displayed because the respective preference option 71 70 * <code>preferenceKey</code> is set to false. 72 * 71 * 73 72 * @param preferenceKey the preference key 74 73 * @param parent the parent component … … 79 78 * @param options a list of options 80 79 * @param defaultOption the default option 81 * 82 * 80 * 81 * 83 82 * @return the index of the selected option. {@see JOptionPane#CLOSED_OPTION} if the dialog was closed. 84 83 * {@see ConditionalOptionPaneUtil#DIALOG_DISABLED_OPTION} if the dialog is disabled. 85 * 84 * 86 85 */ 87 86 static public int showOptionDialog(String preferenceKey, Component parent, Object message, String title, int optionType, int messageType, Object [] options, Object defaultOption) throws HeadlessException { … … 98 97 * It is always on top even if there are other open windows like detached dialogs, 99 98 * relation editors, history browsers and the like. 100 * 99 * 101 100 * Set <code>optionType</code> to {@see JOptionPane#YES_NO_OPTION} for a dialog with a YES and 102 101 * a NO button. … … 104 103 * Set <code>optionType</code> to {@see JOptionPane#YES_NO_CANCEL_OPTION} for a dialog with a YES, 105 104 * a NO and a CANCEL button 106 * 105 * 107 106 * Replies true, if the selected option is equal to <code>trueOption</code>, otherwise false. 108 107 * Replies true, if the dialog is not displayed because the respective preference option 109 108 * <code>preferenceKey</code> is set to false. 110 * 109 * 111 110 * @param preferenceKey the preference key 112 111 * @param parent the parent component … … 116 115 * @param messageType the message type 117 116 * @param trueOption if this option is selected the method replies true 118 * 119 * 117 * 118 * 120 119 * @return true, if the selected option is equal to <code>trueOption</code>, otherwise false. 121 * 120 * 122 121 * @see JOptionPane#INFORMATION_MESSAGE 123 122 * @see JOptionPane#WARNING_MESSAGE … … 137 136 * is always on top even if there are other open windows like detached dialogs, 138 137 * relation editors, history browsers and the like. 139 * 138 * 140 139 * If there is a preference with key <code>preferenceKey</code> and value <code>false</code> 141 140 * the dialog is not show. 142 * 141 * 143 142 * @param preferenceKey the preference key 144 143 * @param parent the parent component … … 146 145 * @param title the title 147 146 * @param messageType the message type 148 * 147 * 149 148 * @see JOptionPane#INFORMATION_MESSAGE 150 149 * @see JOptionPane#WARNING_MESSAGE -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r2476 r2512 30 30 /** 31 31 * Replies the unique instance of this formatter 32 * 32 * 33 33 * @return the unique instance of this formatter 34 34 */ … … 52 52 * <li>by the default tags in {@see #DEFAULT_NAMING_TAGS_FOR_RELATIONS} 53 53 * </ul> 54 * 54 * 55 55 * @return the list of naming tags used in relations 56 56 */ … … 64 64 } 65 65 66 67 66 /** 68 67 * Decorates the name of primitive with its id, if the preference 69 68 * <tt>osm-primitives.showid</tt> is set. 70 * 69 * 71 70 * @param name the name without the id 72 71 * @param primitive the primitive … … 82 81 /** 83 82 * Formats a name for a node 84 * 83 * 85 84 * @param node the node 86 85 * @return the name … … 107 106 /** 108 107 * Formats a name for a way 109 * 108 * 110 109 * @param way the way 111 110 * @return the name … … 145 144 /** 146 145 * Formats a name for a relation 147 * 146 * 148 147 * @param relation the relation 149 148 * @return the name … … 193 192 /** 194 193 * Formats a name for a changeset 195 * 194 * 196 195 * @param changeset the changeset 197 196 * @return the name -
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r2480 r2512 23 23 /** 24 24 * This utility class provides static methods which explain various exceptions to the user. 25 * 25 * 26 26 */ 27 27 public class ExceptionDialogUtil { … … 80 80 /** 81 81 * Explains an exception with a generic message dialog 82 * 82 * 83 83 * @param e the exception 84 84 */ … … 98 98 * This is most likely happening when user tries to access the OSM API from within an 99 99 * applet which wasn't loaded from the API server. 100 * 100 * 101 101 * @param e the exception 102 102 */ … … 116 116 * This is most likely because there's not connection to the Internet or because 117 117 * the remote server is not reachable. 118 * 118 * 119 119 * @param e the exception 120 120 */ … … 134 134 * This is most likely happening when the communication with the remote server is 135 135 * interrupted for any reason. 136 * 136 * 137 137 * @param e the exception 138 138 */ … … 150 150 /** 151 151 * Explains a {@see InvocationTargetException } 152 * 152 * 153 153 * @param e the exception 154 154 */ … … 167 167 * Explains a {@see OsmApiException} which was thrown because of an internal server 168 168 * error in the OSM API server. 169 * 169 * 170 170 * @param e the exception 171 171 */ … … 184 184 * Explains a {@see OsmApiException} which was thrown because of a bad 185 185 * request 186 * 186 * 187 187 * @param e the exception 188 188 */ … … 200 200 * Explains a {@see OsmApiException} which was thrown because a resource wasn't found 201 201 * on the server 202 * 202 * 203 203 * @param e the exception 204 204 */ … … 215 215 /** 216 216 * Explains a {@see OsmApiException} which was thrown because of a conflict 217 * 217 * 218 218 * @param e the exception 219 219 */ … … 232 232 * This is most likely happening when there is an error in the API URL or when 233 233 * local DNS services are not working. 234 * 234 * 235 235 * @param e the exception 236 236 */ … … 249 249 * Replies the first nested exception of type <code>nestedClass</code> (including 250 250 * the root exception <code>e</code>) or null, if no such exception is found. 251 * 251 * 252 252 * @param <T> 253 253 * @param e the root exception … … 270 270 /** 271 271 * Explains an {@see OsmTransferException} to the user. 272 * 272 * 273 273 * @param e the {@see OsmTransferException} 274 274 */ … … 350 350 /** 351 351 * Explains an {@see Exception} to the user. 352 * 352 * 353 353 * @param e the {@see Exception} 354 354 */ -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r2374 r2512 28 28 import org.openstreetmap.josm.tools.ImageProvider; 29 29 import org.openstreetmap.josm.tools.WindowGeometry; 30 31 30 32 31 public class ExtendedDialog extends JDialog { … … 73 72 * <li><code>setRememberWindowGeometry</code></li> 74 73 * </ul> 75 * 74 * 76 75 * When done, call <code>showDialog</code> to display it. You can receive 77 76 * the user's choice using <code>getValue</code>. Have a look at this function 78 77 * for possible return values. 79 * 78 * 80 79 * @param parent The parent element that will be used for position and maximum size 81 80 * @param title The text that will be shown in the window titlebar … … 110 109 * Allows decorating the buttons with tooltips. Expects an String[] with translated 111 110 * tooltip texts. 112 * 111 * 113 112 * @param toolTipTexts the tool tip texts. Ignored, if null. 114 113 */ … … 119 118 /** 120 119 * Sets the content that will be displayed in the message dialog. 121 * 120 * 122 121 * Note that depending on your other settings more UI elements may appear. 123 122 * The content is played on top of the other elements though. 124 * 123 * 125 124 * @param content Any element that can be displayed in the message dialog 126 125 */ … … 131 130 /** 132 131 * Sets the content that will be displayed in the message dialog. 133 * 132 * 134 133 * Note that depending on your other settings more UI elements may appear. 135 134 * The content is played on top of the other elements though. 136 * 135 * 137 136 * @param content Any element that can be displayed in the message dialog 138 137 * @param placeContentInScrollPane if true, places the content in a JScrollPane 139 * 138 * 140 139 */ 141 140 public void setContent(Component content, boolean placeContentInScrollPane) { … … 147 146 * Sets the message that will be displayed. The String will be automatically 148 147 * wrapped if it is too long. 149 * 148 * 150 149 * Note that depending on your other settings more UI elements may appear. 151 150 * The content is played on top of the other elements though. 152 * 151 * 153 152 * @param message The text that should be shown to the user 154 153 */ … … 333 332 * Set the pref to <code>null</code> or to an empty string to disable again. 334 333 * By default, it's disabled. 335 * 334 * 336 335 * Note: If you want to set the width of this dialog directly use the usual 337 336 * setSize, setPreferredSize, setMaxSize, setMinSize 338 * 337 * 339 338 * @param pref The preference to save the dimension to 340 339 * @param wg The default window geometry that should be used if no 341 340 * existing preference is found (only takes effect if 342 341 * <code>pref</code> is not null or empty 343 * 342 * 344 343 */ 345 344 public void setRememberWindowGeometry(String pref, WindowGeometry wg) { … … 426 425 * the button row)</li> 427 426 * </ul> 428 * 427 * 429 428 * @param helpTopic the help topic 430 429 * @param showHelpButton true, if the dialog displays a help button … … 434 433 this.showHelpButton = showHelpButton; 435 434 } 436 437 435 438 436 class HelpAction extends AbstractAction { -
trunk/src/org/openstreetmap/josm/gui/FileDrop.java
r2047 r2512 63 63 private transient java.awt.dnd.DropTargetListener dropListener; 64 64 65 66 65 /** Discover if the running JVM is modern enough to have drag and drop. */ 67 66 private static Boolean supportsDnD; … … 69 68 // Default border color 70 69 private static java.awt.Color defaultBorderColor = new java.awt.Color( 0f, 0f, 1f, 0.25f ); 71 72 70 73 71 /* Constructor for JOSM file drop */ … … 108 106 } // end constructor 109 107 110 111 112 113 108 /** 114 109 * Constructor with a default border and the option to recursively set drop targets. … … 132 127 } // end constructor 133 128 134 135 129 /** 136 130 * Constructor with a default border and debugging optionally turned on. … … 156 150 listener ); 157 151 } // end constructor 158 159 160 152 161 153 /** … … 188 180 } // end constructor 189 181 190 191 192 193 182 /** 194 183 * Constructor with a specified border … … 210 199 listener ); 211 200 } // end constructor 212 213 214 215 201 216 202 /** … … 238 224 } // end constructor 239 225 240 241 242 226 /** 243 227 * Constructor with a specified border and debugging optionally turned on. … … 265 249 listener ); 266 250 } // end constructor 267 268 269 270 271 251 272 252 /** … … 446 426 } // end constructor 447 427 448 449 428 private static boolean supportsDnD() 450 429 { // Static Boolean … … 464 443 } // end supportsDnD 465 444 466 467 445 // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added. 468 446 private static String ZERO_CHAR_STRING = "" + (char)0; … … 493 471 } 494 472 // END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added. 495 496 473 497 474 private void makeDropTarget( final java.io.PrintStream out, final java.awt.Component c, boolean recursive ) … … 541 518 } // end dropListener 542 519 543 544 545 520 /** Determine if the dragged data is a file list. */ 546 521 private boolean isDragOk( final java.io.PrintStream out, final java.awt.dnd.DropTargetDragEvent evt ) … … 578 553 } // end isDragOk 579 554 580 581 555 /** Outputs <tt>message</tt> to <tt>out</tt> if it's not null. */ 582 556 private static void log( java.io.PrintStream out, String message ) … … 587 561 } // end log 588 562 589 590 591 592 563 /** 593 564 * Removes the drag-and-drop hooks from the component and optionally … … 603 574 { return remove( null, c, true ); 604 575 } // end remove 605 606 607 576 608 577 /** … … 633 602 } // end remove 634 603 635 636 637 638 604 /* ******** I N N E R I N T E R F A C E L I S T E N E R ******** */ 639 640 605 641 606 /** … … 664 629 public abstract void filesDropped( java.io.File[] files ); 665 630 666 667 631 } // end inner-interface Listener 668 632 669 670 633 /* ******** I N N E R C L A S S ******** */ 671 672 634 673 635 /** … … 678 640 * 679 641 * <p>I'm releasing this code into the Public Domain. Enjoy.</p> 680 * 642 * 681 643 * @author Robert Harder 682 644 * @author rob@iharder.net … … 714 676 } // end inner class Event 715 677 716 717 718 678 /* ******** I N N E R C L A S S ******** */ 719 720 679 721 680 /** … … 756 715 * 757 716 * <p>I'm releasing this code into the Public Domain. Enjoy.</p> 758 * 717 * 759 718 * @author Robert Harder 760 719 * @author rob@iharder.net … … 770 729 */ 771 730 public final static String MIME_TYPE = "application/x-net.iharder.dnd.TransferableObject"; 772 773 731 774 732 /** … … 784 742 new java.awt.datatransfer.DataFlavor( FileDrop.TransferableObject.class, MIME_TYPE ); 785 743 786 787 744 private Fetcher fetcher; 788 745 private Object data; 789 746 790 747 private java.awt.datatransfer.DataFlavor customFlavor; 791 792 793 748 794 749 /** … … 807 762 } // end constructor 808 763 809 810 811 764 /** 812 765 * Creates a new {@link TransferableObject} that will return the … … 822 775 { this.fetcher = fetcher; 823 776 } // end constructor 824 825 826 777 827 778 /** … … 855 806 } // end getCustomDataFlavor 856 807 857 858 808 /* ******** T R A N S F E R A B L E M E T H O D S ******** */ 859 860 809 861 810 /** … … 884 833 } // end getTransferDataFlavors 885 834 886 887 888 835 /** 889 836 * Returns the data encapsulated in this {@link TransferableObject}. … … 912 859 } // end getTransferData 913 860 914 915 916 917 861 /** 918 862 * Returns <tt>true</tt> if <var>flavor</var> is one of the supported … … 936 880 return false; 937 881 } // end isDataFlavorSupported 938 939 882 940 883 /* ******** I N N E R I N T E R F A C E F E T C H E R ******** */ … … 965 908 } // end inner interface Fetcher 966 909 967 968 969 910 } // end class TransferableObject 970 911 971 972 973 974 975 912 } // end class FileDrop -
trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
r2387 r2512 36 36 37 37 /** 38 * 38 * 39 39 * @param text the button text 40 40 * @param icon the icon to display. Can be null … … 69 69 /** 70 70 * Creates the list buttons to be displayed in the option pane dialog. 71 * 71 * 72 72 * @param options the option. If null, just creates an OK button and a help button 73 73 * @param helpTopic the help topic. The context sensitive help of all buttons is equal … … 100 100 /** 101 101 * Creates the help button 102 * 102 * 103 103 * @param helpTopic the help topic 104 104 * @return the help button … … 125 125 * user clicks on the "Help" button the option dialog remains open and JOSM launches the help 126 126 * browser. 127 * 127 * 128 128 * <code>helpTopic</code> is the trailing part of a JOSM online help URL, i.e. the part after the leading 129 129 * <code>http://josm.openstreetmap.de/wiki/Help</code>. It should start with a leading '/' and it 130 130 * may include an anchor after a '#'. 131 * 131 * 132 132 * <strong>Examples</strong> 133 133 * <ul> … … 137 137 * 138 138 * In addition, the option buttons display JOSM icons, similar to ExtendedDialog. 139 * 139 * 140 140 * @param parentComponent the parent component 141 141 * @param msg the message … … 244 244 245 245 /** 246 * 246 * 247 247 * @param parentComponent 248 248 * @param msg -
trunk/src/org/openstreetmap/josm/gui/JMultilineLabel.java
r2154 r2512 14 14 * required to print it in one line. Additionally the maximum width of the text 15 15 * can be set using <code>setMaxWidth</code>. 16 * 16 * 17 17 * Note that this won't work if JMultilineLabel is put into a JScrollBox or 18 18 * similar as the bounds will never change. Instead scrollbars will be displayed. … … 28 28 * Supports both newline characters (<code>\n</code>) as well as the HTML 29 29 * <code><br></code> to insert new lines. 30 * 30 * 31 31 * Use setMaxWidth to limit the width of the label. 32 32 * @param text … … 45 45 * Set the maximum width. Use this method instead of setMaximumSize because 46 46 * this saves a little bit of overhead and is actually taken into account. 47 * 47 * 48 48 * @param width 49 49 */ -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r2402 r2512 183 183 boolean middleMouseDown = (ms.modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0; 184 184 185 186 185 // Popup Information 187 186 // display them if the middle mouse button is pressed and -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r2450 r2512 50 50 import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker; 51 51 import org.openstreetmap.josm.tools.AudioPlayer; 52 53 52 54 53 /** … … 151 150 /** 152 151 * Adds a GPX layer. A GPX layer is added below the lowest data layer. 153 * 152 * 154 153 * @param layer the GPX layer 155 154 */ … … 214 213 /** 215 214 * Replies true if the active layer is drawable. 216 * 215 * 217 216 * @return true if the active layer is drawable, false otherwise 218 217 */ … … 223 222 /** 224 223 * Replies true if the active layer is visible. 225 * 224 * 226 225 * @return true if the active layer is visible, false otherwise 227 226 */ … … 244 243 * <li>otherwise, the top most layer of any type becomes active</li> 245 244 * </ul> 246 * 245 * 247 246 * @return the next active data layer 248 247 */ … … 304 303 * Moves the layer to the given new position. No event is fired, but repaints 305 304 * according to the new Z-Order of the layers. 306 * 305 * 307 306 * @param layer The layer to move 308 307 * @param pos The new position of the layer … … 324 323 } 325 324 326 327 325 public int getLayerPos(Layer layer) { 328 326 int curLayerPos = layers.indexOf(layer); … … 335 333 * Creates a list of the visible layers in Z-Order, the layer with the lowest Z-Order 336 334 * first, layer with the highest Z-Order last. 337 * 335 * 338 336 * @return a list of the visible in Z-Order, the layer with the lowest Z-Order 339 337 * first, layer with the highest Z-Order last. … … 483 481 /** 484 482 * Replies an unmodifiable list of layers of a certain type. 485 * 483 * 486 484 * Example: 487 485 * <pre> 488 486 * List<WMSLayer> wmsLayers = getLayersOfType(WMSLayer.class); 489 487 * </pre> 490 * 488 * 491 489 * @return an unmodifiable list of layers of a certain type. 492 490 */ … … 503 501 /** 504 502 * Replies the number of layers managed by this mav view 505 * 503 * 506 504 * @return the number of layers managed by this mav view 507 505 */ … … 512 510 /** 513 511 * Replies true if there is at least one layer in this map view 514 * 512 * 515 513 * @return true if there is at least one layer in this map view 516 514 */ … … 522 520 * Sets the active layer to <code>layer</code>. If <code>layer</code> is an instance 523 521 * of {@see OsmDataLayer} also sets {@see #editLayer} to <code>layer</code>. 524 * 522 * 525 523 * @param layer the layer to be activate; must be one of the layers in the list of layers 526 524 * @exception IllegalArgumentException thrown if layer is not in the lis of layers … … 559 557 /** 560 558 * Replies the currently active layer 561 * 559 * 562 560 * @return the currently active layer (may be null) 563 561 */ … … 568 566 /** 569 567 * Replies the current edit layer, if any 570 * 568 * 571 569 * @return the current edit layer. May be null. 572 570 */ … … 586 584 /** 587 585 * replies true if the list of layers managed by this map view contain layer 588 * 586 * 589 587 * @param layer the layer 590 588 * @return true if the list of layers managed by this map view contain layer -
trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java
r2227 r2512 182 182 public boolean getFloatingDividers() { return floatingDividers; } 183 183 184 185 184 /** 186 185 * If true, Leaf node bounds match the corresponding component's … … 197 196 firePCS("floatingDividers", oldFloatingDividers, floatingDividers); 198 197 } 199 200 198 201 199 /** … … 241 239 return null; 242 240 } 243 244 241 245 242 private Dimension preferredComponentSize(Node node) { … … 335 332 } 336 333 337 338 334 private Rectangle boundsWithYandHeight(Rectangle bounds, double y, double height) { 339 335 Rectangle r = new Rectangle(); … … 347 343 return r; 348 344 } 349 350 345 351 346 private void minimizeSplitBounds(Split split, Rectangle bounds) { … … 364 359 split.setBounds(splitBounds); 365 360 } 366 367 361 368 362 private void layoutShrink(Split split, Rectangle bounds) { … … 483 477 } 484 478 485 486 479 private void layoutGrow(Split split, Rectangle bounds) { 487 480 Rectangle splitBounds = split.getBounds(); … … 574 567 } 575 568 576 577 569 /* Second pass of the layout algorithm: branch to layoutGrow/Shrink 578 570 * as needed. … … 604 596 } 605 597 } 606 607 598 608 599 /* First pass of the layout algorithm. … … 782 773 } 783 774 784 785 775 private Divider dividerAt(Node root, int x, int y) { 786 776 if (root instanceof Divider) { … … 853 843 } 854 844 855 856 845 /** 857 846 * Base class for the nodes that model a MultiSplitLayout. … … 1072 1061 } 1073 1062 } 1074 1075 1063 1076 1064 /** … … 1133 1121 } 1134 1122 1135 1136 1123 /** 1137 1124 * Models a single vertical/horiztonal divider. … … 1163 1150 } 1164 1151 } 1165 1166 1152 1167 1153 private static void throwParseException(StreamTokenizer st, String msg) throws Exception { … … 1329 1315 } 1330 1316 1331 1332 1317 private static void printModel(String indent, Node root) { 1333 1318 if (root instanceof Split) { -
trunk/src/org/openstreetmap/josm/gui/MultiSplitPane.java
r2224 r2512 351 351 } 352 352 353 354 353 private class InputHandler extends MouseInputAdapter implements KeyListener { 355 354 -
trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java
r2070 r2512 72 72 * build the tool tip text for an {@see OsmPrimitive}. It consist of the formatted 73 73 * key/value pairs for this primitive. 74 * 74 * 75 75 * @param primitive 76 76 * @return the tool tip text -
trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
r2319 r2512 108 108 * Appends a log message to the progress dialog. If the log area isn't visible yet 109 109 * it becomes visible. The height of the progress dialog is slightly increased too. 110 * 110 * 111 111 * @param message the message to append to the log. Ignore if null or white space only. 112 112 */ … … 126 126 /** 127 127 * Sets whether the cancel button is enabled or not 128 * 128 * 129 129 * @param enabled true, if the cancel button is enabled; false otherwise 130 130 */ … … 136 136 * Installs a callback for the cancel button. If callback is null, all action listeners 137 137 * are removed from the cancel button. 138 * 138 * 139 139 * @param callback the cancel callback 140 140 */ -
trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java
r2322 r2512 39 39 /** 40 40 * Create the runnable object with a given message for the user. 41 * 41 * 42 42 * @param title message for the user 43 43 * @param ignoreException If true, exception will be propagated to calling code. If false then -
trunk/src/org/openstreetmap/josm/gui/QuadStateCheckBox.java
r1169 r2512 186 186 } 187 187 } 188 -
trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java
r2391 r2512 67 67 private JViewport vp = new JViewport(); 68 68 private JComponent component = null; 69 69 70 70 private List<JButton> buttons = new ArrayList<JButton>(); 71 71 … … 85 85 public ScrollViewport(int direction) { 86 86 setLayout(new BorderLayout()); 87 87 88 88 JButton button; 89 89 … … 137 137 138 138 showOrHideButtons(); 139 139 140 140 timer.setRepeats(true); 141 141 timer.setInitialDelay(400); … … 203 203 */ 204 204 public void showOrHideButtons() { 205 boolean needButtons = vp.getViewSize().height > vp.getViewRect().height || 205 boolean needButtons = vp.getViewSize().height > vp.getViewRect().height || 206 206 vp.getViewSize().width > vp.getViewRect().width; 207 207 for (JButton b : buttons) { … … 209 209 } 210 210 } 211 211 212 212 public Rectangle getViewRect() { 213 213 return vp.getViewRect(); -
trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
r2381 r2512 156 156 int buttonPressed = e.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); 157 157 158 159 158 if (buttonPressed != 0) { 160 159 if (mousePosStart == null) { … … 197 196 } 198 197 } 199 200 198 201 199 /** -
trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java
r2308 r2512 51 51 * This dialog is used to get a user confirmation that a collection of primitives can be removed 52 52 * from their parent relations. 53 * 53 * 54 54 */ 55 55 public class DeleteFromRelationConfirmationDialog extends JDialog implements TableModelListener { … … 59 59 /** 60 60 * Replies the unique instance of this dialog 61 * 61 * 62 62 * @return 63 63 */ … … 151 151 /** 152 152 * Replies the data model used in this dialog 153 * 153 * 154 154 * @return the data model 155 155 */ … … 160 160 /** 161 161 * Replies true if the dialog was canceled 162 * 162 * 163 163 * @return true if the dialog was canceled 164 164 */ -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java
r2181 r2512 38 38 /** 39 39 * replies the display name 40 * 40 * 41 41 * @return the display name 42 42 */ … … 48 48 * replies true, if <code>role</code> is participating in this comparison 49 49 * pair 50 * 50 * 51 51 * @param role the list role 52 52 * @return true, if <code>role</code> is participating in this comparison … … 63 63 * replies the pair of {@see ListRole}s participating in this comparison 64 64 * pair 65 * 65 * 66 66 * @return the pair of list roles 67 67 */ … … 73 73 * replies the opposite role of <code>role</code> participating in this comparison 74 74 * pair 75 * 75 * 76 76 * @param role one of the two roles in this pair 77 77 * @return the opposite role -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java
r1954 r2512 34 34 /** 35 35 * An UI component for resolving conflicts between two {@see OsmPrimitive}s. 36 * 36 * 37 37 * This component emits {@see PropertyChangeEvent}s for three properties: 38 38 * <ul> … … 44 44 * their primitive</li> 45 45 * </ul> 46 * 46 * 47 47 */ 48 48 public class ConflictResolver extends JPanel implements PropertyChangeListener { … … 64 64 */ 65 65 static public final String THEIR_PRIMITIVE_PROP = ConflictResolver.class.getName() + ".theirPrimitive"; 66 67 66 68 67 private static final Logger logger = Logger.getLogger(ConflictResolver.class.getName()); … … 131 130 /** 132 131 * Sets the {@see OsmPrimitive} in the role "my" 133 * 132 * 134 133 * @param my the primitive in the role "my" 135 134 */ … … 144 143 /** 145 144 * Sets the {@see OsmPrimitive} in the role "their". 146 * 145 * 147 146 * @param their the primitive in the role "their" 148 147 */ … … 209 208 /** 210 209 * populates the conflict resolver with the conflicts between my and their 211 * 210 * 212 211 * @param my my primitive (i.e. the primitive in the local dataset) 213 212 * @param their their primitive (i.e. the primitive in the server dataset) 214 * 213 * 215 214 */ 216 215 public void populate(OsmPrimitive my, OsmPrimitive their) { … … 250 249 * Builds the resolution command(s) for the resolved conflicts in this 251 250 * ConflictResolver 252 * 251 * 253 252 * @return the resolution command 254 253 */ … … 282 281 /** 283 282 * Updates the state of the property {@see #RESOLVED_COMPLETELY_PROP} 284 * 283 * 285 284 */ 286 285 protected void updateResolvedCompletely() { … … 319 318 /** 320 319 * Replies true all differences in this conflicts are resolved 321 * 320 * 322 321 * @return true all differences in this conflicts are resolved 323 322 */ -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r2181 r2512 31 31 * <li>the list of <em>merged</em> entries</li> 32 32 * </ol> 33 * 33 * 34 34 * A ListMergeModel is a factory for three {@see TableModel}s and three {@see ListSelectionModel}s: 35 35 * <ol> … … 42 42 * decisions. {@see PropertyChangeListener}s can register for property value changes of 43 43 * {@see #PROP_FROZEN}. 44 * 44 * 45 45 * ListMergeModel is an abstract class. Three methods have to be implemented by subclasses: 46 46 * <ul> … … 74 74 private final ComparePairListModel comparePairListModel; 75 75 76 77 78 76 /** 79 77 * Creates a clone of an entry of type T suitable to be included in the 80 78 * list of merged entries 81 * 79 * 82 80 * @param entry the entry 83 81 * @return the cloned entry … … 88 86 * checks whether two entries are equal. This is not necessarily the same as 89 87 * e1.equals(e2). 90 * 88 * 91 89 * @param e1 the first entry 92 90 * @param e2 the second entry … … 97 95 /** 98 96 * Handles method dispatches from {@see TableModel#setValueAt(Object, int, int)}. 99 * 97 * 100 98 * @param model the table model 101 99 * @param value the value to be set 102 100 * @param row the row index 103 101 * @param col the column index 104 * 102 * 105 103 * @see TableModel#setValueAt(Object, int, int) 106 104 */ 107 105 protected abstract void setValueAt(DefaultTableModel model, Object value, int row, int col); 108 109 110 106 111 107 protected void buildMyEntriesTableModel() { … … 246 242 * list of merged nodes. Inserts the nodes at the top of the list of merged 247 243 * nodes. 248 * 244 * 249 245 * @param rows the indices 250 246 */ … … 257 253 * list of merged nodes. Inserts the nodes at the top of the list of merged 258 254 * nodes. 259 * 255 * 260 256 * @param rows the indices 261 257 */ … … 268 264 * list of merged nodes. Inserts the nodes at the end of the list of merged 269 265 * nodes. 270 * 266 * 271 267 * @param source the list of nodes to copy from 272 268 * @param rows the indices … … 290 286 * list of merged nodes. Inserts the nodes at the end of the list of merged 291 287 * nodes. 292 * 288 * 293 289 * @param rows the indices 294 290 */ … … 301 297 * list of merged nodes. Inserts the nodes at the end of the list of merged 302 298 * nodes. 303 * 299 * 304 300 * @param rows the indices 305 301 */ … … 311 307 * Copies the nodes given by indices in rows from the list of nodes <code>source</code> to the 312 308 * list of merged nodes. Inserts the nodes before row given by current. 313 * 309 * 314 310 * @param source the list of nodes to copy from 315 311 * @param rows the indices 316 312 * @param current the row index before which the nodes are inserted 317 313 * @exception IllegalArgumentException thrown, if current < 0 or >= #nodes in list of merged nodes 318 * 314 * 319 315 */ 320 316 protected void copyBeforeCurrent(ListRole source, int [] rows, int current) { … … 336 332 * Copies the nodes given by indices in rows from the list of my nodes to the 337 333 * list of merged nodes. Inserts the nodes before row given by current. 338 * 334 * 339 335 * @param rows the indices 340 336 * @param current the row index before which the nodes are inserted 341 337 * @exception IllegalArgumentException thrown, if current < 0 or >= #nodes in list of merged nodes 342 * 338 * 343 339 */ 344 340 public void copyMyBeforeCurrent(int [] rows, int current) { … … 349 345 * Copies the nodes given by indices in rows from the list of their nodes to the 350 346 * list of merged nodes. Inserts the nodes before row given by current. 351 * 347 * 352 348 * @param rows the indices 353 349 * @param current the row index before which the nodes are inserted 354 350 * @exception IllegalArgumentException thrown, if current < 0 or >= #nodes in list of merged nodes 355 * 351 * 356 352 */ 357 353 public void copyTheirBeforeCurrent(int [] rows, int current) { … … 362 358 * Copies the nodes given by indices in rows from the list of nodes <code>source</code> to the 363 359 * list of merged nodes. Inserts the nodes after the row given by current. 364 * 360 * 365 361 * @param source the list of nodes to copy from 366 362 * @param rows the indices 367 363 * @param current the row index after which the nodes are inserted 368 364 * @exception IllegalArgumentException thrown, if current < 0 or >= #nodes in list of merged nodes 369 * 365 * 370 366 */ 371 367 protected void copyAfterCurrent(ListRole source, int [] rows, int current) { … … 393 389 * Copies the nodes given by indices in rows from the list of my nodes to the 394 390 * list of merged nodes. Inserts the nodes after the row given by current. 395 * 391 * 396 392 * @param rows the indices 397 393 * @param current the row index after which the nodes are inserted 398 394 * @exception IllegalArgumentException thrown, if current < 0 or >= #nodes in list of merged nodes 399 * 395 * 400 396 */ 401 397 public void copyMyAfterCurrent(int [] rows, int current) { … … 406 402 * Copies the nodes given by indices in rows from the list of my nodes to the 407 403 * list of merged nodes. Inserts the nodes after the row given by current. 408 * 404 * 409 405 * @param rows the indices 410 406 * @param current the row index after which the nodes are inserted 411 407 * @exception IllegalArgumentException thrown, if current < 0 or >= #nodes in list of merged nodes 412 * 408 * 413 409 */ 414 410 public void copyTheirAfterCurrent(int [] rows, int current) { … … 419 415 * Moves the nodes given by indices in rows up by one position in the list 420 416 * of merged nodes. 421 * 422 * @param rows the indices 423 * 417 * 418 * @param rows the indices 419 * 424 420 */ 425 421 public void moveUpMerged(int [] rows) { … … 446 442 * Moves the nodes given by indices in rows down by one position in the list 447 443 * of merged nodes. 448 * 444 * 449 445 * @param rows the indices 450 446 */ … … 473 469 * Removes the nodes given by indices in rows from the list 474 470 * of merged nodes. 475 * 471 * 476 472 * @param rows the indices 477 473 */ … … 490 486 } 491 487 492 493 488 /** 494 489 * Replies true if the list of my entries and the list of their 495 490 * entries are equal 496 * 491 * 497 492 * @return true, if the lists are equal; false otherwise 498 493 */ … … 508 503 } 509 504 510 511 505 /** 512 506 * This an adapter between a {@see JTable} and one of the three entry lists 513 507 * in the role {@see ListRole} managed by the {@see ListMergeModel}. 514 * 508 * 515 509 * From the point of view of the {@see JTable} it is a {@see TableModel}. 516 510 * … … 524 518 525 519 /** 526 * 520 * 527 521 * @param role the role 528 522 */ … … 562 556 * replies true if the {@see ListRole} of this {@see EntriesTableModel} 563 557 * participates in the current {@see ComparePairType} 564 * 558 * 565 559 * @return true, if the if the {@see ListRole} of this {@see EntriesTableModel} 566 560 * participates in the current {@see ComparePairType} 567 * 561 * 568 562 * @see ComparePairListModel#getSelectedComparePair() 569 563 */ … … 577 571 * replies true if the entry at <code>row</code> is equal to the entry at the 578 572 * same position in the opposite list of the current {@see ComparePairType}. 579 * 573 * 580 574 * @param row the row number 581 575 * @return true if the entry at <code>row</code> is equal to the entry at the … … 601 595 * replies true if the entry at the current position is present in the opposite list 602 596 * of the current {@see ComparePairType}. 603 * 597 * 604 598 * @param row the current row 605 599 * @return true if the entry at the current position is present in the opposite list … … 629 623 /** 630 624 * replies the opposite list of entries with respect to the current {@see ComparePairType} 631 * 625 * 632 626 * @return the opposite list of entries 633 627 */ … … 645 639 * This is the selection model to be used in a {@see JTable} which displays 646 640 * an entry list managed by {@see ListMergeModel}. 647 * 641 * 648 642 * The model ensures that only rows displaying an entry in the entry list 649 643 * can be selected. "Empty" rows can't be selected. 650 * 644 * 651 645 * @see ListMergeModel#getMySelectionModel() 652 646 * @see ListMergeModel#getMergedSelectionModel() -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
r2181 r2512 78 78 private JLabel lblTheirVersion; 79 79 80 81 80 private JLabel lblFrozenState; 82 81 … … 105 104 106 105 myEntriesTable.getSelectionModel().addListSelectionListener(copyEndLeftAction); 107 108 106 109 107 theirEntriesTable.getSelectionModel().addListSelectionListener(copyStartRightAction); … … 385 383 add(buildFrozeStateControlPanel(), gc); 386 384 387 388 385 wireActionsToSelectionModels(); 389 386 } … … 518 515 } 519 516 520 521 517 class CopyStartRightAction extends AbstractAction implements ListSelectionListener { 522 518 … … 540 536 } 541 537 } 542 543 538 544 539 class CopyEndRightAction extends AbstractAction implements ListSelectionListener { … … 593 588 } 594 589 595 596 590 class CopyAfterCurrentRightAction extends AbstractAction implements ListSelectionListener { 597 591 … … 622 616 } 623 617 } 624 625 618 626 619 class MoveUpMergedAction extends AbstractAction implements ListSelectionListener { … … 807 800 } 808 801 809 810 802 public void update(Observable o, Object arg) { 811 803 lblMyVersion.setText( … … 839 831 observable = new Observable(); 840 832 } 841 842 833 843 834 /** … … 947 938 }); 948 939 949 950 940 observable.addObserver( 951 941 new Observer() { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModel.java
r2273 r2512 18 18 19 19 private static final Logger logger = Logger.getLogger(NodeListMergeModel.class.getName()); 20 21 20 22 21 /** … … 73 72 } 74 73 75 76 74 @Override 77 75 public boolean isEqualEntry(Node e1, Node e2) { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMerger.java
r1954 r2512 12 12 /** 13 13 * A UI component for resolving conflicts in the node lists of two {@see Way}s. 14 * 14 * 15 15 */ 16 16 public class NodeListMerger extends ListMerger<Node> { 17 17 private static final Logger logger = Logger.getLogger(NodeListMerger.class.getName()); 18 19 18 20 19 public NodeListMerger() { … … 64 63 } 65 64 66 67 65 public void populate(Way my, Way their) { 68 66 ((NodeListMergeModel)model).populate(my, their); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java
r2285 r2512 24 24 /** 25 25 * This is the {@see TableCellRenderer} used in the node tables of {@see NodeListMerger}. 26 * 26 * 27 27 */ 28 28 public class NodeListTableCellRenderer extends JLabel implements TableCellRenderer { … … 54 54 * build the tool tip text for an {@see OsmPrimitive}. It consist of the formatted 55 55 * key/value pairs for this primitive. 56 * 56 * 57 57 * @param primitive 58 58 * @return the tool tip text -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/OperationCancelledException.java
r1954 r2512 24 24 } 25 25 26 27 26 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java
r2273 r2512 180 180 } 181 181 182 183 182 /** 184 183 * replies the coordinates of my {@see OsmPrimitive}. null, if my primitive hasn't … … 253 252 return null; 254 253 } 255 256 254 257 255 /** -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java
r2070 r2512 28 28 * This class represents a UI component for resolving conflicts in some properties 29 29 * of {@see OsmPrimitive}. 30 * 30 * 31 31 */ 32 32 public class PropertiesMerger extends JPanel implements Observer { … … 127 127 add(btnKeepMyCoordinates, gc); 128 128 129 130 129 gc.gridx = 3; 131 130 gc.gridy = 1; … … 202 201 btnKeepMyDeletedState.setName("button.keepmydeletedstate"); 203 202 add(btnKeepMyDeletedState, gc); 204 205 203 206 204 gc.gridx = 3; -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java
r1954 r2512 18 18 */ 19 19 public class RelationMemberTableCellEditor extends AbstractCellEditor implements TableCellEditor{ 20 21 20 22 21 private final JTextField editor; … … 42 41 } 43 42 44 45 43 public Object getCellEditorValue() { 46 44 return editor.getText(); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRenderer.java
r2070 r2512 65 65 rowNumberBorder = BorderFactory.createEmptyBorder(0,4,0,0); 66 66 } 67 68 67 69 68 public String buildToolTipText(OsmPrimitive primitive) { … … 109 108 setToolTipText(null); 110 109 } 111 112 110 113 111 protected void renderBackground(ListMergeModel<Node>.EntriesTableModel model, RelationMember member, int row, int col, boolean isSelected) { … … 188 186 } 189 187 190 191 188 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 192 189 int row, int column) { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/MergedTableCellRenderer.java
r1954 r2512 15 15 public final static Color BGCOLOR_SELECTED = new Color(143,170,255); 16 16 17 18 17 protected void setBackgroundColor(TagMergeItem item, boolean isSelected) { 19 18 if (isSelected) { … … 24 23 setBackground(BGCOLOR_MINE); 25 24 } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) { 26 setBackground(BGCOLOR_THEIR); 25 setBackground(BGCOLOR_THEIR); 27 26 } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) { 28 27 setBackground(BGCOLOR_UNDECIDED); 29 } 28 } 30 29 } 31 32 30 33 31 @Override 34 32 protected void renderKey(TagMergeItem item, boolean isSelected) { … … 67 65 setToolTipText(item.getTheirTagValue()); 68 66 } else { 69 // should not happen 67 // should not happen 70 68 } 71 69 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/MineTableCellRenderer.java
r2017 r2512 14 14 public final static Color BGCOLOR_THEIR = Color.white; 15 15 public final static Color BGCOLOR_SELECTED = new Color(143,170,255); 16 16 17 17 protected void setBackgroundColor(TagMergeItem item, boolean isSelected) { 18 18 if (isSelected) { … … 20 20 return; 21 21 } 22 22 23 23 if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) { 24 24 setBackground(BGCOLOR_MINE); 25 25 } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) { 26 setBackground(BGCOLOR_THEIR); 26 setBackground(BGCOLOR_THEIR); 27 27 } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) { 28 28 setBackground(BGCOLOR_UNDECIDED); 29 } 29 } 30 30 } 31 31 32 32 protected void setTextColor(TagMergeItem item) { 33 33 if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) { 34 34 setForeground(Color.black); 35 35 } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) { 36 setForeground(Color.LIGHT_GRAY); 36 setForeground(Color.LIGHT_GRAY); 37 37 } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) { 38 38 setForeground(Color.black); 39 } 39 } 40 40 } 41 41 42 42 @Override 43 43 protected void renderKey(TagMergeItem item, boolean isSelected) { … … 48 48 setToolTipText(tr("My dataset does not include a tag with key {0}", item.getKey())); 49 49 } else { 50 setText(item.getKey()); 50 setText(item.getKey()); 51 51 setToolTipText(item.getKey()); 52 52 } … … 61 61 setToolTipText(tr("My dataset does not include a tag with key {0}", item.getKey())); 62 62 } else { 63 setText(item.getMyTagValue());