Changeset 2512 in josm for trunk/src/org
- Timestamp:
- 2009-11-24T10:45:04+01:00 (15 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()); 63 setText(item.getMyTagValue()); 64 64 setToolTipText(item.getMyTagValue()); 65 } 65 } 66 66 } 67 67 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeColumnModel.java
r1954 r2512 11 11 12 12 protected void createColumns(TableCellRenderer renderer) { 13 13 14 14 TableColumn col = null; 15 16 // column 0 - Key 15 16 // column 0 - Key 17 17 col = new TableColumn(0); 18 18 col.setHeaderValue(tr("Key")); … … 20 20 col.setCellRenderer(renderer); 21 21 addColumn(col); 22 23 // column 1 - Value 22 23 // column 1 - Value 24 24 col = new TableColumn(1); 25 25 col.setHeaderValue(tr("Value")); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModel.java
r1954 r2512 17 17 /** 18 18 * This is the {@see TableModel} used in the tables of the {@see TagMerger}. 19 * 19 * 20 20 * The model can {@see #populate(OsmPrimitive, OsmPrimitive)} itself from the conflicts 21 21 * in the tag sets of two {@see OsmPrimitive}s. Internally, it keeps a list of {@see TagMergeItem}s. 22 * 22 * 23 23 * {@see #decide(int, MergeDecisionType)} and {@see #decide(int[], MergeDecisionType)} can be used 24 24 * to remember a merge decision for a specific row in the model. 25 * 25 * 26 26 * The model notifies {@see PropertyChangeListener}s about updates of the number of 27 27 * undecided tags (see {@see #PROP_NUM_UNDECIDED_TAGS}). 28 * 28 * 29 29 */ 30 30 public class TagMergeModel extends DefaultTableModel { … … 40 40 41 41 private int numUndecidedTags = 0; 42 43 42 44 43 public TagMergeModel() { … … 81 80 * refreshes the number of undecided tag conflicts after an update in the list of 82 81 * {@see TagMergeItem}s. Notifies {@see PropertyChangeListener} if necessary. 83 * 82 * 84 83 */ 85 84 protected void refreshNumUndecidedTags() { … … 99 98 * Populate the model with conflicts between the tag sets of the two 100 99 * {@see OsmPrimitive} <code>my</code> and <code>their</code>. 101 * 100 * 102 101 * @param my my primitive (i.e. the primitive from the local dataset) 103 102 * @param their their primitive (i.e. the primitive from the server dataset) 104 * 103 * 105 104 */ 106 105 public void populate(OsmPrimitive my, OsmPrimitive their) { … … 124 123 /** 125 124 * add a {@see TagMergeItem} to the model 126 * 125 * 127 126 * @param item the item 128 127 */ … … 143 142 * set the merge decision of the {@see TagMergeItem} in row <code>row</code> 144 143 * to <code>decision</code>. 145 * 144 * 146 145 * @param row the row 147 146 * @param decision the decision … … 156 155 * set the merge decision of all {@see TagMergeItem} given by indices in <code>rows</code> 157 156 * to <code>decision</code>. 158 * 157 * 159 158 * @param row the array of row indices 160 159 * @param decision the decision … … 175 174 return tagMergeItems == null ? 0 : tagMergeItems.size(); 176 175 } 177 178 176 179 177 @Override -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeTableCellRenderer.java
r2181 r2512 14 14 15 15 protected abstract void renderKey(TagMergeItem item, boolean isSelected ); 16 16 17 17 protected abstract void renderValue(TagMergeItem item, boolean isSelected); 18 18 19 19 protected void reset() { 20 20 setOpaque(true); … … 22 22 setForeground(Color.black); 23 23 } 24 24 25 25 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, 26 26 int col) { 27 28 reset(); 27 28 reset(); 29 29 TagMergeItem item = (TagMergeItem)value; 30 30 switch(col) { 31 case 0: 31 case 0: 32 32 renderKey(item, isSelected); 33 33 break; … … 36 36 break; 37 37 default: 38 // should not happen, but just in case 38 // should not happen, but just in case 39 39 throw new IllegalArgumentException(tr("Parameter 'col' must be 0 or 1. Got {0}.", col)); 40 40 } 41 41 return this; 42 42 } 43 43 44 44 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java
r1954 r2512 44 44 /** 45 45 * embeds table in a new {@see JScrollPane} and returns th scroll pane 46 * 46 * 47 47 * @param table the table 48 48 * @return the scroll pane embedding the table … … 59 59 /** 60 60 * builds the table for my tag set (table already embedded in a scroll pane) 61 * 61 * 62 62 * @return the table (embedded in a scroll pane) 63 63 */ … … 75 75 /** 76 76 * builds the table for their tag set (table already embedded in a scroll pane) 77 * 77 * 78 78 * @return the table (embedded in a scroll pane) 79 79 */ … … 91 91 /** 92 92 * builds the table for the merged tag set (table already embedded in a scroll pane) 93 * 93 * 94 94 * @return the table (embedded in a scroll pane) 95 95 */ … … 208 208 theirTable.getSelectionModel().addListSelectionListener(keepTheirAction); 209 209 210 211 210 DoubleClickAdapter dblClickAdapter = new DoubleClickAdapter(); 212 211 mineTable.addMouseListener(dblClickAdapter); 213 212 theirTable.addMouseListener(dblClickAdapter); 214 215 213 216 214 gc.gridx = 2; … … 237 235 /** 238 236 * replies the model used by this tag merger 239 * 237 * 240 238 * @return the model 241 239 */ … … 307 305 * the registerd Adjustables is updated the adjustment of 308 306 * the other registered Adjustables is adjusted too. 309 * 307 * 310 308 */ 311 309 class AdjustmentSynchronizer implements AdjustmentListener { … … 336 334 /** 337 335 * Handler for double clicks on entries in the three tag tables. 338 * 336 * 339 337 */ 340 338 class DoubleClickAdapter extends MouseAdapter { … … 368 366 * Sets the currently selected tags in the table of merged tags to state 369 367 * {@see MergeDecisionType#UNDECIDED} 370 * 368 * 371 369 */ 372 370 class UndecideAction extends AbstractAction implements ListSelectionListener { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TheirTableCellRenderer.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 30 32 31 protected void setTextColor(TagMergeItem item) { 33 32 if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) { 34 33 setForeground(Color.black); 35 34 } else if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) { 36 setForeground(Color.LIGHT_GRAY); 35 setForeground(Color.LIGHT_GRAY); 37 36 } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) { 38 37 setForeground(Color.black); 39 } 38 } 40 39 } 41 40 42 41 @Override 43 42 protected void renderKey(TagMergeItem item, boolean isSelected) { … … 48 47 setToolTipText(tr("Their dataset does not include a tag with key {0}", item.getKey())); 49 48 } else { 50 setText(item.getKey()); 49 setText(item.getKey()); 51 50 setToolTipText(item.getKey()); 52 51 } … … 61 60 setToolTipText(tr("Their dataset does not include a tag with key {0}", item.getKey())); 62 61 } else { 63 setText(item.getTheirTagValue()); 62 setText(item.getTheirTagValue()); 64 63 setToolTipText(item.getTheirTagValue()); 65 } 64 } 66 65 } 67 66 } -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
r2326 r2512 43 43 * This dialog helps to resolve conflicts occurring when ways are combined or 44 44 * nodes are merged. 45 * 45 * 46 46 * There is a singleton instance of this dialog which can be retrieved using 47 47 * {@see #getInstance()}. 48 * 48 * 49 49 * The dialog uses two models: one for resolving tag conflicts, the other 50 50 * for resolving conflicts in relation memberships. For both models there are accessors, 51 51 * i.e {@see #getTagConflictResolverModel()} and {@see #getRelationMemberConflictResolverModel()}. 52 * 52 * 53 53 * Models have to be <strong>populated</strong> before the dialog is launched. Example: 54 54 * <pre> … … 58 58 * dialog.prepareDefaultDecisions(); 59 59 * </pre> 60 * 60 * 61 61 * You should also set the target primitive which other primitives (ways or nodes) are 62 62 * merged to, see {@see #setTargetPrimitive(OsmPrimitive)}. 63 * 63 * 64 64 * After the dialog is closed use {@see #isCancelled()} to check whether the user canceled 65 65 * the dialog. If it wasn't canceled you may build a collection of {@see Command} objects 66 66 * which reflect the conflict resolution decisions the user made in the dialog: 67 67 * see {@see #buildResolutionCommands()} 68 * 68 * 69 69 * 70 70 */ … … 76 76 /** 77 77 * Replies the unique instance of the dialog 78 * 78 * 79 79 * @return the unique instance of the dialog 80 80 */ … … 92 92 private JPanel pnlButtons; 93 93 private OsmPrimitive targetPrimitive; 94 94 95 95 /** the private help action */ 96 96 private ContextSensitiveHelpAction helpAction; … … 101 101 * Replies the target primitive the collection of primitives is merged 102 102 * or combined to. 103 * 103 * 104 104 * @return the target primitive 105 105 */ … … 111 111 * Sets the primitive the collection of primitives is merged or combined 112 112 * to. 113 * 113 * 114 114 * @param primitive the target primitive 115 115 */ … … 118 118 updateTitle(); 119 119 if (primitive instanceof Way) { 120 pnlRelationMemberConflictResolver.initForWayCombining(); 120 pnlRelationMemberConflictResolver.initForWayCombining(); 121 121 } else if (primitive instanceof Node) { 122 122 pnlRelationMemberConflictResolver.initForNodeMerging(); … … 343 343 } 344 344 345 346 345 class CancelAction extends AbstractAction { 347 346 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
r2008 r2512 25 25 * proposed tag values. The editor also allows to select all proposed valued or 26 26 * to remove the tag. 27 * 27 * 28 28 * The editor responds intercepts some keys and interprets them as navigation keys. It 29 29 * forwards navigation events to {@see NavigationListener}s registred with this editor. 30 30 * You should register the parent table using this editor as {@see NavigationListener}. 31 * 31 * 32 32 * {@see KeyEvent#VK_ENTER} and {@see KeyEvent#VK_TAB} trigger a {@see NavigationListener#gotoNextDecision()}. 33 33 */ 34 34 public class MultiValueCellEditor extends AbstractCellEditor implements TableCellEditor{ 35 36 35 37 36 public static interface NavigationListener { … … 142 141 } 143 142 144 145 143 /** 146 144 * The cell renderer used in the combo box … … 191 189 } 192 190 } 193 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRenderer.java
r2220 r2512 20 20 /** 21 21 * This is a {@see TableCellRenderer} for {@see MultiValueResolutionDecision}s. 22 * 22 * 23 23 */ 24 24 public class MultiValueCellRenderer extends JLabel implements TableCellRenderer { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueResolutionDecision.java
r2181 r2512 17 17 /** 18 18 * Represents a decision for a conflict due to multiple possible value for a tag. 19 * 19 * 20 20 * 21 21 */ … … 41 41 * Creates a new decision for the tag collection <code>tags</code>. 42 42 * All tags must have the same key. 43 * 43 * 44 44 * @param tags the tags. Must not be null. 45 45 * @exception IllegalArgumentException thrown if tags is null … … 90 90 /** 91 91 * Apply the decision to keep exactly one value 92 * 92 * 93 93 * @param value the value to keep 94 94 * @throws IllegalArgumentException thrown if value is null … … 106 106 /** 107 107 * sets a new value for this 108 * 108 * 109 109 * @param value the new vlaue 110 110 */ … … 120 120 /** 121 121 * marks this as undecided 122 * 122 * 123 123 */ 124 124 public void undecide() { … … 128 128 /** 129 129 * Replies the chosen value 130 * 130 * 131 131 * @return the chosen value 132 132 * @throws IllegalStateException thrown if this resolution is not yet decided … … 145 145 /** 146 146 * Replies the list of possible, non empty values 147 * 147 * 148 148 * @return the list of possible, non empty values 149 149 */ … … 158 158 /** 159 159 * Replies the key of the tag to be resolved by this resolution 160 * 160 * 161 161 * @return the key of the tag to be resolved by this resolution 162 162 */ … … 167 167 /** 168 168 * Replies true if the empty value is a possible value in this resolution 169 * 169 * 170 170 * @return true if the empty value is a possible value in this resolution 171 171 */ … … 176 176 /** 177 177 * Replies true, if this resolution has more than 1 possible non-empty values 178 * 178 * 179 179 * @return true, if this resolution has more than 1 possible non-empty values 180 180 */ … … 185 185 /** 186 186 * Replies true if this resolution is decided 187 * 187 * 188 188 * @return true if this resolution is decided 189 189 */ … … 194 194 /** 195 195 * Replies the type of the resolution 196 * 196 * 197 197 * @return the type of the resolution 198 198 */ … … 203 203 /** 204 204 * Applies the resolution to an {@see OsmPrimitive} 205 * 205 * 206 206 * @param primitive the primitive 207 207 * @throws IllegalStateException thrown if this resolution is not resolved yet 208 * 208 * 209 209 */ 210 210 public void applyTo(OsmPrimitive primitive) throws IllegalStateException{ … … 223 223 /** 224 224 * Applies this resolution to a collection of primitives 225 * 225 * 226 226 * @param primtives the collection of primitives 227 227 * @throws IllegalStateException thrown if this resolution is not resolved yet … … 239 239 /** 240 240 * Builds a change command for applying this resolution to a primitive 241 * 241 * 242 242 * @param primitive the primitive 243 243 * @return the change command … … 258 258 /** 259 259 * Builds a change command for applying this resolution to a collection of primitives 260 * 260 * 261 261 * @param primitives the collection of primitives 262 262 * @return the change command … … 278 278 * Replies a tag representing the current resolution. Null, if this resolution is not resolved 279 279 * yet. 280 * 280 * 281 281 * @return a tag representing the current resolution. Null, if this resolution is not resolved 282 282 * yet -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java
r2220 r2512 136 136 /** 137 137 * Initializes the conflict resolver for a specific type of primitives 138 * 138 * 139 139 * @param type the type of primitives 140 140 * @param tc the tags belonging to this type of primitives … … 151 151 /** 152 152 * Populates the conflict resolver with one tag collection 153 * 153 * 154 154 * @param tagsForAllPrimitives the tag collection 155 155 * @param sourceStatistics histogram of tag source, number of primitives of each type in the source … … 195 195 /** 196 196 * Populate the tag conflict resolver with tags for each type of primitives 197 * 197 * 198 198 * @param tagsForNodes the tags belonging to nodes in the paste source 199 199 * @param tagsForWays the tags belonging to way in the paste source -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionEditor.java
r2326 r2512 37 37 private RelationMemberConflictDecisionType originalValue; 38 38 39 40 39 public void addCellEditorListener(CellEditorListener l) { 41 40 tableCellEditorSupport.addCellEditorListener(l); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionRenderer.java
r2326 r2512 16 16 public class RelationMemberConflictDecisionRenderer extends JLabel implements TableCellRenderer, ListCellRenderer{ 17 17 18 private JComboBox cbDecisionTypes; 19 18 private JComboBox cbDecisionTypes; 19 20 20 protected void resetTableRenderer() { 21 21 setOpaque(true); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionType.java
r2326 r2512 25 25 UNDECIDED; 26 26 27 28 27 static public void prepareLabel(RelationMemberConflictDecisionType decision, JLabel label) { 29 28 switch(decision) { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java
r2326 r2512 50 50 protected void build() { 51 51 setLayout(new GridBagLayout()); 52 JPanel pnl = new JPanel(); 52 JPanel pnl = new JPanel(); 53 53 pnl.setLayout(new BorderLayout()); 54 54 pnl.add(lblHeader = new JMultilineLabel("")); … … 60 60 add(pnl, gc); 61 61 model = new RelationMemberConflictResolverModel(); 62 62 63 63 gc.gridy = 1; 64 64 gc.weighty = 1.0; … … 89 89 public void focusGained(FocusEvent e) { 90 90 tfRole.selectAll(); 91 } 91 } 92 92 } 93 93 ); … … 104 104 + "to all modified relations.</html>")); 105 105 pnl.add(cbTagRelations); 106 pnl.add(new JLabel(trc("tag", "Key:"))); 106 pnl.add(new JLabel(trc("tag", "Key:"))); 107 107 pnl.add(tfKey = new AutoCompletingTextField(10)); 108 108 tfKey.setToolTipText(tr("<html>Enter a tag key, i.e. <strong><tt>fixme</tt></strong></html>")); … … 119 119 build(); 120 120 } 121 121 122 122 public void initForWayCombining() { 123 123 lblHeader.setText(tr("<html>The combined ways are members in one ore more relations. " 124 124 + "Please decide whether your want to <strong>keep</strong> these memberships " 125 + "for the combined way or whether you want to <strong>remove</strong> them.<br>" 125 + "for the combined way or whether you want to <strong>remove</strong> them.<br>" 126 126 + "The default is to <strong>keep</strong> them: the combined way will take the place of the original way in the membership." 127 127 + "</html>")); … … 132 132 lblHeader.setText(tr("<html>The merged nodes are members in one ore more relations. " 133 133 + "Please decide whether your want to <strong>keep</strong> these memberships " 134 + "for the target node or whether you want to <strong>remove</strong> them.<br>" 134 + "for the target node or whether you want to <strong>remove</strong> them.<br>" 135 135 + "The default is to <strong>keep</strong> them: the target node will take the place of the original node in the membership." 136 136 + "</html>")); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java
r2326 r2512 22 22 /** 23 23 * This model manages a list of conflicting relation members. 24 * 24 * 25 25 * It can be used as {@see TableModel}. 26 26 * … … 39 39 private PropertyChangeSupport support; 40 40 41 42 41 /** 43 42 * Replies the current number of conflicts 44 * 43 * 45 44 * @return the current number of conflicts 46 45 */ … … 52 51 * Updates the current number of conflicts from list of decisions and emits 53 52 * a property change event if necessary. 54 * 53 * 55 54 */ 56 55 protected void updateNumConflicts() { … … 120 119 * Populates the model with the members of the relation <code>relation</code> 121 120 * referring to <code>primitive</code>. 122 * 121 * 123 122 * @param relation the parent relation 124 123 * @param primitive the child primitive … … 135 134 * Populates the model with the relation members belonging to one of the relations in <code>relations</code> 136 135 * and referring to one of the primitives in <code>memberPrimitives</code>. 137 * 136 * 138 137 * @param relations the parent relations. Empty list assumed if null. 139 138 * @param memberPrimitives the child primitives. Empty list assumed if null. … … 155 154 * Populates the model with the relation members represented as a collection of 156 155 * {@see RelationToChildReference}s. 157 * 156 * 158 157 * @param references the references. Empty list assumed if null. 159 158 */ … … 175 174 /** 176 175 * Replies the decision at position <code>row</code> 177 * 176 * 178 177 * @param row 179 178 * @return the decision at position <code>row</code> … … 185 184 /** 186 185 * Replies the number of decisions managed by this model 187 * 186 * 188 187 * @return the number of decisions managed by this model 189 188 */ … … 195 194 * Refreshes the model state. Invoke this method to trigger necessary change 196 195 * events after an update of the model data. 197 * 196 * 198 197 */ 199 198 public void refresh() { … … 204 203 /** 205 204 * Apply a role to all member managed by this model. 206 * 205 * 207 206 * @param role the role. Empty string assumed if null. 208 207 */ … … 256 255 /** 257 256 * Builds a collection of commands executing the decisions made in this model. 258 * 257 * 259 258 * @param newPrimitive the primitive which members shall refer to if the 260 259 * decision is {@see RelationMemberConflictDecisionType#REPLACE} … … 295 294 * Replies the set of relations which have to be modified according 296 295 * to the decisions managed by this model. 297 * 296 * 298 297 * @param newPrimitive the primitive which members shall refer to if the 299 298 * decision is {@see RelationMemberConflictDecisionType#REPLACE} 300 * 299 * 301 300 * @return the set of relations which have to be modified according 302 301 * to the decisions managed by this model -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverTable.java
r2326 r2512 38 38 getActionMap().put("selectNextColumnCell", selectNextColumnCellAction); 39 39 getActionMap().put("selectPreviousColumnCell", selectPreviousColumnCellAction); 40 40 41 41 setRowHeight((int)new JComboBox().getPreferredSize().getHeight()); 42 42 } -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtil.java
r2220 r2512 11 11 /** 12 12 * Collection of utility methods for tag conflict resolution 13 * 13 * 14 14 */ 15 15 public class TagConflictResolutionUtil { … … 18 18 private TagConflictResolutionUtil() {} 19 19 20 21 20 /** 22 21 * Normalizes the tags in the tag collection <code>tc</code> before resolving tag conflicts. 23 * 22 * 24 23 * Removes irrelevant tags like "created_by". 25 * 24 * 26 25 * For tags which are not present on at least one of the merged nodes, the empty value "" 27 26 * is added to the list of values for this tag, but only if there are at least two 28 27 * primitives with tags. 29 * 28 * 30 29 * @param tc the tag collection 31 30 * @param merged the collection of merged primitives … … 59 58 /** 60 59 * Combines tags from TIGER data 61 * 60 * 62 61 * @param tc the tag collection 63 62 */ … … 75 74 * will offer an option for removing the tag and not only options for selecting 76 75 * one of the current values of the tag. 77 * 76 * 78 77 * @param tc the tag collection 79 78 */ -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java
r2220 r2512 21 21 * This is a UI widget for resolving tag conflicts, i.e. differences of the tag values 22 22 * of multiple {@see OsmPrimitive}s. 23 * 23 * 24 24 * 25 25 */ … … 61 61 /** 62 62 * Remembers the current settings in the global preferences 63 * 63 * 64 64 */ 65 65 public void rememberPreferences() { … … 80 80 /** 81 81 * Replies the model used by this dialog 82 * 82 * 83 83 * @return the model 84 84 */ -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
r2220 r2512 77 77 /** 78 78 * initializes the model from the current tags 79 * 79 * 80 80 */ 81 81 protected void rebuild() { … … 105 105 /** 106 106 * Populates the model with the tags for which conflicts are to be resolved. 107 * 107 * 108 108 * @param tags the tag collection with the tags. Must not be null. 109 109 * @param keysWithConflicts the set of tag keys with conflicts … … 158 158 /** 159 159 * Replies true if each {@see MultiValueResolutionDecision} is decided. 160 * 160 * 161 161 * @return true if each {@see MultiValueResolutionDecision} is decided; false 162 162 * otherwise … … 188 188 /** 189 189 * Sets whether all tags or only tags with conflicts are displayed 190 * 190 * 191 191 * @param showTagsWithConflictsOnly if true, only tags with conflicts are displayed 192 192 */ … … 198 198 /** 199 199 * Prepare the default decisions for the current model 200 * 200 * 201 201 */ 202 202 public void prepareDefaultTagDecisions() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r2301 r2512 77 77 private OsmDataLayer layer = null; 78 78 79 80 79 /** 81 80 * builds the GUI … … 153 152 } 154 153 155 156 154 /** 157 155 * refreshes the view of this dialog … … 204 202 } 205 203 206 207 204 /** 208 205 * replies the conflict collection currently held by this dialog; may be null -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r2308 r2512 98 98 } 99 99 100 101 100 @Override 102 101 public void setVisible(boolean isVisible) { … … 153 152 } 154 153 155 156 154 public ConflictResolutionDialog(Component parent) { 157 155 super(JOptionPane.getFrameForComponent(parent), true /* modal */); … … 174 172 } 175 173 176 177 174 public void actionPerformed(ActionEvent arg0) { 178 175 setVisible(false); … … 198 195 /** 199 196 * Action for applying resolved differences in a conflict 200 * 197 * 201 198 */ 202 199 class ApplyResolutionAction extends AbstractAction implements PropertyChangeListener { -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r2145 r2512 111 111 }); 112 112 pnl.add(upButton); 113 113 114 114 downButton = new SideButton(marktr("Down"), "down", "SelectionList", tr("Move filter down."), 115 115 new ActionListener(){ … … 149 149 }; 150 150 } 151 }; 151 }; 152 152 153 153 filters.addTableModelListener(this); -
trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r2448 r2512 52 52 * two actions for (1) (re)loading the history of the selected primitives and (2) 53 53 * for launching a history browser for each selected primitive. 54 * 54 * 55 55 */ 56 56 public class HistoryDialog extends ToggleDialog implements HistoryDataSetListener { -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r2434 r2512 256 256 } 257 257 258 259 258 private enum DeleteDecision { 260 259 deleteCurrent, -
trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r2493 r2512 572 572 Main.contentPane.getActionMap().put("properties:add", addAction); 573 573 574 575 574 // -- edit action 576 575 // … … 886 885 } 887 886 888 889 887 class AddAction extends AbstractAction { 890 888 public AddAction() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r2506 r2512 162 162 * Otherwise it is initialized with the list of non-deleted and visible relations 163 163 * in the layer's dataset. 164 * 164 * 165 165 * @param layer the layer. May be null. 166 166 */ … … 475 475 /** 476 476 * The action for downloading members of all selected relations 477 * 477 * 478 478 */ 479 479 class DownloadMembersAction extends AbstractAction implements ListSelectionListener{ … … 557 557 * Add all relations in <code>addedPrimitives</code> to the model for the 558 558 * relation list dialog 559 * 559 * 560 560 * @param addedPrimitives the collection of added primitives. May include nodes, 561 561 * ways, and relations. … … 584 584 /** 585 585 * Removes all relations in <code>removedPrimitives</code> from the model 586 * 586 * 587 587 * @param removedPrimitives the removed primitives. May include nodes, ways, 588 588 * and relations … … 622 622 * Replies the list of selected, non-new relations. Empty list, 623 623 * if there are no selected, non-new relations. 624 * 624 * 625 625 * @return the list of selected, non-new relations. 626 626 */ … … 642 642 * Replies the list of selected relations. Empty list, 643 643 * if there are no selected relations. 644 * 644 * 645 645 * @return the list of selected, non-new relations. 646 646 */ … … 658 658 /** 659 659 * Sets the selected relations. 660 * 660 * 661 661 * @return sel the list of selected relations 662 662 */ … … 712 712 public void layerRemoved(Layer a) {/* irrelevant in this context */} 713 713 public void layerAdded(Layer a) {/* irrelevant in this context */} 714 715 714 716 715 /* ---------------------------------------------------------------------------------- */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r2475 r2512 278 278 279 279 } 280 281 280 282 281 /** -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r2291 r2512 237 237 * Action for selecting the primitives contributed by the currently selected 238 238 * users. 239 * 239 * 240 240 */ 241 241 private static class UserInfo implements Comparable<UserInfo> { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r2433 r2512 435 435 } 436 436 437 438 437 /** 439 438 * The asynchronous task for downloading a set of relations -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r2494 r2512 118 118 super(layer, relation, selectedMembers); 119 119 120 121 120 // initialize the autocompletion infrastructure 122 121 // … … 324 323 }); 325 324 326 327 325 JPanel pnl3 = new JPanel(); 328 326 pnl3.setLayout(new BorderLayout()); … … 411 409 memberTable.getSelectionModel().addListSelectionListener(removeSelectedAction); 412 410 pnl.add(new JButton(removeSelectedAction), gc); 413 414 411 415 412 // ------ … … 756 753 } 757 754 758 759 755 } 760 756 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableCellRenderer.java
r2070 r2512 15 15 /** 16 16 * This is the {@see TableCellRenderer} used in the tables of {@see RelationMemberMerger}. 17 * 17 * 18 18 */ 19 19 public abstract class MemberTableCellRenderer extends JLabel implements TableCellRenderer { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java
r2394 r2512 13 13 import org.openstreetmap.josm.tools.ImageProvider; 14 14 import org.openstreetmap.josm.gui.dialogs.relation.WayConnectionType.Direction; 15 16 15 17 16 public class MemberTableLinkedCellRenderer extends MemberTableCellRenderer { … … 54 53 int y2 = 0; 55 54 56 57 55 if (value.linkPrev) { 58 56 g.setColor(Color.black); … … 66 64 g.drawImage(corners,xoff+xloop-2,y1-3,xoff+xloop+1,y1, 2,0,5,3, new Color(0,0,0,0), null); 67 65 g.drawLine(xoff+3,y1-3,xoff+xloop-3,y1-3); 68 } 66 } 69 67 else { 70 68 g.setColor(Color.red); … … 86 84 g.drawImage(corners,xoff+xloop-2,y2+1,xoff+xloop+1,y2+4, 2,2,5,5, new Color(0,0,0,0), null); 87 85 g.drawLine(xoff+3-1,y2+3,xoff+xloop-3,y2+3); 88 } 86 } 89 87 else { 90 88 g.setColor(Color.red); … … 118 116 } else if (value.direction == Direction.ROUNDABOUT_RIGHT) { 119 117 g.drawImage(roundabout_right, xoff-6, 1, null); 120 } 118 } 121 119 } 122 120 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableMemberCellRenderer.java
r1990 r2512 23 23 /** 24 24 * Load the image icon for an OSM primitive of type node 25 * 25 * 26 26 * @return the icon; null, if not found 27 27 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r2494 r2512 406 406 return ret; 407 407 } 408 409 408 410 409 /** -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
r2434 r2512 26 26 /** 27 27 * This is an asynchronous task for loading the parents of a given relation. 28 * 28 * 29 29 * Typical usage: 30 30 * <pre> … … 62 62 /** 63 63 * Creates a new task for asynchronously downloading the parents of a child relation. 64 * 64 * 65 65 * @param child the child relation. Must not be null. Must have an id > 0. 66 66 * @param layer the OSM data layer. Must not be null. 67 67 * @param full if true, parent relations are fully downloaded (i.e. with their members) 68 68 * @param monitor the progress monitor to be used 69 * 69 * 70 70 * @exception IllegalArgumentException thrown if child is null 71 71 * @exception IllegalArgumentException thrown if layer is null … … 88 88 /** 89 89 * Set a continuation which is called upon the job finished. 90 * 90 * 91 91 * @param continuation the continuation 92 92 */ … … 97 97 /** 98 98 * Replies true if this has been cancelled by the user. 99 * 99 * 100 100 * @return true if this has been cancelled by the user. 101 101 */ … … 106 106 /** 107 107 * Replies true if an exception has been caught during the execution of this task. 108 * 108 * 109 109 * @return true if an exception has been caught during the execution of this task. 110 110 */ … … 112 112 return lastException != null; 113 113 } 114 115 114 116 115 protected OsmDataLayer getLayer() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserModel.java
r2381 r2512 87 87 } 88 88 89 90 89 public boolean canReload() { 91 90 return relation != null && !relation.isNew(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java
r2070 r2512 16 16 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener; 17 17 18 19 18 /** 20 19 * RelationDialogManager keeps track of the open relation editors. … … 28 27 /** 29 28 * Replies the singleton {@see RelationDialogManager} 30 * 29 * 31 30 * @return the singleton {@see RelationDialogManager} 32 31 */ … … 106 105 * Register the relation editor for a relation managed by a 107 106 * {@see OsmDataLayer}. 108 * 107 * 109 108 * @param layer the layer 110 109 * @param relation the relation … … 137 136 /** 138 137 * Closes the editor open for a specific layer and a specific relation. 139 * 138 * 140 139 * @param layer the layer 141 140 * @param relation the relation … … 152 151 * Replies true if there is an open relation editor for the relation managed 153 152 * by the given layer. Replies false if relation is null. 154 * 153 * 155 154 * @param layer the layer 156 155 * @param relation the relation. May be null. … … 168 167 * Replies the editor for the relation managed by layer. Null, if no such editor 169 168 * is currently open. Returns null, if relation is null. 170 * 169 * 171 170 * @param layer the layer 172 171 * @param relation the relation 173 172 * @return the editor for the relation managed by layer. Null, if no such editor 174 173 * is currently open. 175 * 174 * 176 175 * @see #isOpenInEditor(OsmDataLayer, Relation) 177 176 */ … … 184 183 /** 185 184 * called when a layer is removed 186 * 185 * 187 186 */ 188 187 public void layerRemoved(Layer oldLayer) { … … 228 227 /** 229 228 * Positions an {@see RelationEditor} centered on the screen 230 * 229 * 231 230 * @param editor the editor 232 231 */ … … 244 243 * Replies true, if there is another open {@see RelationEditor} whose 245 244 * upper left corner is close to <code>p</code>. 246 * 245 * 247 246 * @param p the reference point to check 248 247 * @return true, if there is another open {@see RelationEditor} whose … … 262 261 * Positions a {@see RelationEditor} close to the center of the screen, in such 263 262 * a way, that it doesn't entirely cover another {@see RelationEditor} 264 * 263 * 265 264 * @param editor 266 265 */ … … 284 283 * method tries to reposition <code>editor</code> by moving it slightly down and 285 284 * slightly to the right. 286 * 285 * 287 286 * @param editor the editor 288 287 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java
r2273 r2512 24 24 * {@see #getEditor(OsmDataLayer, Relation, Collection)} will create an instance of 25 25 * this class. 26 * 26 * 27 27 * @param clazz the class 28 28 */ … … 55 55 * specific editor has been registered for the type of relation, then 56 56 * a generic editor will be returned. 57 * 57 * 58 58 * Editors can be registered by adding their class to the static list "editors" 59 59 * in the RelationEditor class. When it comes to editing a relation, all … … 91 91 /** 92 92 * Creates a new relation editor 93 * 93 * 94 94 * @param layer the {@see OsmDataLayer} in whose context a relation is edited. Must not be null. 95 95 * @param relation the relation. Can be null if a new relation is to be edited. … … 125 125 /** 126 126 * Replies the currently edited relation 127 * 127 * 128 128 * @return the currently edited relation 129 129 */ … … 135 135 * Sets the currently edited relation. Creates a snapshot of the current 136 136 * state of the relation. See {@see #getRelationSnapshot()} 137 * 137 * 138 138 * @param relation the relation 139 139 */ … … 147 147 * Replies the {@see OsmDataLayer} in whose context this relation editor is 148 148 * open 149 * 149 * 150 150 * @return the {@see OsmDataLayer} in whose context this relation editor is 151 151 * open … … 157 157 /** 158 158 * Replies the state of the edited relation when the editor has been launched 159 * 159 * 160 160 * @return the state of the edited relation when the editor has been launched 161 161 */ … … 166 166 /** 167 167 * Replies true if the currently edited relation has been changed elsewhere. 168 * 168 * 169 169 * In this case a relation editor can't apply updates to the relation directly. Rather, 170 170 * it has to create a conflict. 171 * 171 * 172 172 * @return true if the currently edited relation has been changed elsewhere. 173 173 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationNodeMap.java
r2421 r2512 27 27 * 28 28 * @author Christiaan Welvaart <cjw@time4t.net> 29 * 29 * 30 30 */ 31 31 public class RelationNodeMap { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
r2433 r2512 31 31 /** 32 32 * This is a {@se JTree} rendering the hierarchical structure of {@see Relation}s. 33 * 33 * 34 34 * @see RelationTreeModel 35 35 */ … … 65 65 /** 66 66 * replies the parent dialog this tree is embedded in. 67 * 67 * 68 68 * @return the parent dialog; null, if there is no parent dialog 69 69 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTreeCellRenderer.java
r1990 r2512 42 42 /** 43 43 * renders the textual value. Uses the relations names as value 44 * 44 * 45 45 * @param relation the relation 46 46 */ … … 51 51 /** 52 52 * renders the background 53 * 53 * 54 54 * @param selected true, if the current node is selected 55 55 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RunnableAction.java
r1762 r2512 7 7 public abstract class RunnableAction extends AbstractAction implements Runnable { 8 8 9 10 9 public RunnableAction() { 10 } 11 11 12 12 public abstract void run(); 13 13 14 15 16 14 public void actionPerformed(ActionEvent arg0) { 15 run(); 16 } 17 17 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableCellRenderer.java
r2070 r2512 20 20 /** 21 21 * This is the {@see TableCellRenderer} used in the tables of {@see RelationMemberMerger}. 22 * 22 * 23 23 */ 24 24 public class SelectionTableCellRenderer extends JLabel implements TableCellRenderer { 25 25 public final static Color BGCOLOR_SELECTED = new Color(143,170,255); 26 26 public final static Color BGCOLOR_DOUBLE_ENTRY = new Color(255,234,213); 27 28 27 29 28 private HashMap<OsmPrimitiveType, ImageIcon> icons; … … 37 36 /** 38 37 * Load the image icon for an OSM primitive of type node 39 * 38 * 40 39 * @return the icon; null, if not found 41 40 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
r2181 r2512 25 25 /** 26 26 * constructor 27 * 27 * 28 28 * @param layer the data layer. Must not be null. 29 29 * @exception IllegalArgumentException thrown if layer is null … … 38 38 populateSelectedPrimitives(layer); 39 39 } 40 41 40 42 41 public void unregister() { … … 98 97 * populates the model with the primitives currently selected in 99 98 * <code>layer</code> 100 * 99 * 101 100 * @param layer the data layer 102 101 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/WayConnectionType.java
r2394 r2512 15 15 public final boolean linkNext; 16 16 17 /** 18 * direction is FORWARD if the first node of this way is connected to the previous way 19 * and / or the last node of this way is connected to the next way. 17 /** 18 * direction is FORWARD if the first node of this way is connected to the previous way 19 * and / or the last node of this way is connected to the next way. 20 20 * direction is BACKWARD if it is the other way around. 21 21 * direction has a ROUNDABOUT value, if it is tagged as such and it is somehow … … 25 25 */ 26 26 public final Direction direction; 27 27 28 28 public enum Direction { 29 29 FORWARD, BACKWARD, ROUNDABOUT_LEFT, ROUNDABOUT_RIGHT, NONE; 30 30 31 31 public boolean isRoundabout() { 32 32 return this == ROUNDABOUT_RIGHT || this == ROUNDABOUT_LEFT; 33 } 33 } 34 34 }; 35 35 … … 38 38 39 39 public boolean isRoundabout = false; 40 40 41 41 public WayConnectionType(boolean linkPrev, boolean linkNext, Direction direction) { 42 42 this.linkPrev = linkPrev; … … 55 55 invalid = true; 56 56 } 57 57 58 58 public boolean isValid() { 59 return !invalid; 59 return !invalid; 60 60 } 61 61 -
trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
r2387 r2512 43 43 /** the list of bookmarks */ 44 44 private BookmarkList bookmarks; 45 45 46 46 /** the parent download GUI */ 47 47 private DownloadDialog parent; 48 48 49 49 /** displays information about the current download area */ 50 50 private JMultilineLabel lblCurrentDownloadArea; 51 51 /** the add action */ 52 52 private AddAction actAdd; 53 53 54 54 /** 55 * Creates the panel with the action buttons on the left 56 * 55 * Creates the panel with the action buttons on the left 56 * 57 57 * @return the panel with the action buttons on the left 58 58 */ … … 78 78 return pnl; 79 79 } 80 80 81 81 protected JPanel buildDownloadAreaAddPanel() { 82 82 JPanel pnl = new JPanel(); 83 83 pnl.setLayout(new GridBagLayout()); 84 84 85 85 GridBagConstraints gc = new GridBagConstraints(); 86 86 gc.anchor = GridBagConstraints.NORTHWEST; … … 89 89 gc.weighty = 1.0; 90 90 gc.insets = new Insets(5,5,5,5); 91 91 92 92 pnl.add(lblCurrentDownloadArea = new JMultilineLabel(""), gc); 93 93 94 94 gc.anchor = GridBagConstraints.NORTHEAST; 95 95 gc.fill = GridBagConstraints.HORIZONTAL; … … 100 100 return pnl; 101 101 } 102 102 103 103 public void addGui(final DownloadDialog gui) { 104 104 JPanel dlg = new JPanel(new GridBagLayout()); 105 105 gui.addDownloadAreaSelector(dlg, tr("Bookmarks")); 106 106 GridBagConstraints gc = new GridBagConstraints(); 107 108 107 109 108 bookmarks = new BookmarkList(); 110 109 bookmarks.getSelectionModel().addListSelectionListener(new ListSelectionListener() { … … 117 116 }); 118 117 bookmarks.addMouseListener(new DoubleClickAdapter()); 119 118 120 119 gc.fill = GridBagConstraints.HORIZONTAL; 121 120 gc.weightx = 1.0; 122 gc.weighty = 0.0; 121 gc.weighty = 0.0; 123 122 gc.gridwidth = 2; 124 123 dlg.add(buildDownloadAreaAddPanel(),gc); 125 124 126 125 gc.gridwidth = 1; 127 126 gc.gridx = 0; … … 129 128 gc.fill = GridBagConstraints.VERTICAL; 130 129 gc.weightx = 0.0; 131 gc.weighty = 1.0; 130 gc.weighty = 1.0; 132 131 dlg.add(buildButtonPanel(),gc); 133 132 … … 137 136 gc.fill = GridBagConstraints.BOTH; 138 137 gc.weightx = 1.0; 139 gc.weighty = 1.0; 138 gc.weighty = 1.0; 140 139 gc.gridx = 1; 141 dlg.add(new JScrollPane(bookmarks), gc); 142 140 dlg.add(new JScrollPane(bookmarks), gc); 141 143 142 this.parent = gui; 144 143 } 145 144 146 145 protected void updateDownloadAreaLabel() { 147 146 if (currentArea == null) { … … 154 153 currentArea.getMax().lonToString(CoordinateFormat.DECIMAL_DEGREES) 155 154 ) 156 ); 157 } 158 } 159 155 ); 156 } 157 } 158 160 159 /** 161 * Sets the current download area 162 * 163 * @param area the download area. 160 * Sets the current download area 161 * 162 * @param area the download area. 164 163 */ 165 164 public void setDownloadArea(Bounds area) { … … 170 169 actAdd.setEnabled(area != null); 171 170 } 172 171 173 172 /** 174 173 * The action to add a new bookmark for the current download area. … … 181 180 putValue(SHORT_DESCRIPTION, tr("Add a bookmark for the currently selected download area")); 182 181 } 183 182 184 183 public void actionPerformed(ActionEvent e) { 185 184 if (currentArea == null) { … … 203 202 ((DefaultListModel)bookmarks.getModel()).addElement(b); 204 203 bookmarks.save(); 205 } 206 } 207 } 208 204 } 205 } 206 } 207 209 208 class RemoveAction extends AbstractAction implements ListSelectionListener{ 210 209 public RemoveAction() { … … 214 213 updateEnabledState(); 215 214 } 216 215 217 216 public void actionPerformed(ActionEvent e) { 218 217 Object[] sels = bookmarks.getSelectedValues(); … … 230 229 public void valueChanged(ListSelectionEvent e) { 231 230 updateEnabledState(); 232 } 233 } 234 231 } 232 } 233 235 234 class RenameAction extends AbstractAction implements ListSelectionListener{ 236 235 public RenameAction() { … … 240 239 updateEnabledState(); 241 240 } 242 241 243 242 public void actionPerformed(ActionEvent e) { 244 243 Object[] sels = bookmarks.getSelectedValues(); … … 247 246 } 248 247 Bookmark b = (Bookmark)sels[0]; 249 Object value = 248 Object value = 250 249 JOptionPane.showInputDialog( 251 250 Main.parent,tr("Please enter a name for the bookmarked download area."), … … 257 256 ); 258 257 if (value != null) { 259 b.setName(value.toString()); 258 b.setName(value.toString()); 260 259 bookmarks.save(); 261 260 bookmarks.repaint(); … … 267 266 public void valueChanged(ListSelectionEvent e) { 268 267 updateEnabledState(); 269 } 270 } 271 268 } 269 } 270 272 271 class DoubleClickAdapter extends MouseAdapter { 273 272 @Override 274 273 public void mouseClicked(MouseEvent e) { 275 if (!(SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2)) 274 if (!(SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2)) 276 275 return; 277 276 int idx = bookmarks.locationToIndex(e.getPoint()); … … 279 278 return; 280 279 Bookmark b = (Bookmark)bookmarks.getModel().getElementAt(idx); 281 parent.startDownload(b.getArea()); 282 } 283 } 280 parent.startDownload(b.getArea()); 281 } 282 } 284 283 } -
trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
r2483 r2512 55 55 private DownloadDialog parent; 56 56 57 58 57 protected void registerBoundingBoxBuilder() { 59 58 BoundingBoxBuilder bboxbuilder = new BoundingBoxBuilder(); … … 148 147 } 149 148 150 151 149 public void setDownloadArea(Bounds area) { 152 150 updateBboxFields(area); … … 207 205 } 208 206 209 210 207 class LatValueChecker extends FocusAdapter implements ActionListener{ 211 208 private JTextField tfLatValue; -
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r2347 r2512 48 48 49 49 /** 50 * 50 * 51 51 */ 52 52 public class DownloadDialog extends JDialog { 53 53 static private final Logger logger = Logger.getLogger(DownloadDialog.class.getName()); 54 54 55 55 /** the unique instance of the download dialog */ 56 56 static private DownloadDialog instance; 57 57 58 58 /** 59 59 * Replies the unique instance of the download dialog 60 * 60 * 61 61 * @return the unique instance of the download dialog 62 62 */ … … 65 65 instance = new DownloadDialog(Main.parent); 66 66 return instance; 67 } 67 } 68 68 69 69 private final List<DownloadSelection> downloadSelections = new ArrayList<DownloadSelection>(); … … 80 80 private SideButton btnDownload; 81 81 82 83 82 public JPanel buildMainPanel() { 84 JPanel pnl = new JPanel(); 83 JPanel pnl = new JPanel(); 85 84 pnl.setLayout(new GridBagLayout()); 86 85 pnl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); … … 94 93 cbDownloadGpxData.setToolTipText(tr("Select to download GPS traces in the selected download area.")); 95 94 pnl.add(cbDownloadGpxData, GBC.eol().insets(20,0,0,0)); 96 95 97 96 // predefined download selections 98 97 downloadSelections.add(new SlippyMapChooser()); … … 111 110 s.addGui(this); 112 111 } 113 112 114 113 cbNewLayer = new JCheckBox(tr("Download as new layer")); 115 114 cbNewLayer.setToolTipText(tr("<html>Select to download data into a new data layer.<br>" … … 131 130 return pnl; 132 131 } 133 132 134 133 protected JPanel buildButtonPanel() { 135 134 JPanel pnl = new JPanel(); 136 135 pnl.setLayout(new FlowLayout()); 137 136 138 137 // -- download button 139 138 pnl.add(btnDownload = new SideButton(actDownload = new DownloadAction())); … … 142 141 btnDownload.getActionMap().put("download",actDownload); 143 142 144 // -- cancel button 143 // -- cancel button 145 144 SideButton btnCancel; 146 145 CancelAction actCancel = new CancelAction(); … … 150 149 btnCancel.getActionMap().put("enter",actCancel); 151 150 152 // -- cancel on ESC 151 // -- cancel on ESC 153 152 getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0), "cancel"); 154 153 getRootPane().getActionMap().put("cancel", actCancel); 155 154 156 // -- help button 155 // -- help button 157 156 SideButton btnHelp; 158 157 pnl.add(btnHelp = new SideButton(new ContextSensitiveHelpAction(ht("/Dialog/DownloadDialog")))); … … 160 159 btnHelp.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), "enter"); 161 160 btnHelp.getActionMap().put("enter",btnHelp.getAction()); 162 163 return pnl; 164 } 165 161 162 return pnl; 163 } 164 166 165 public DownloadDialog(Component parent) { 167 166 super(JOptionPane.getFrameForComponent(parent),tr("Download"), true /* modal */); … … 169 168 getContentPane().add(buildMainPanel(), BorderLayout.CENTER); 170 169 getContentPane().add(buildButtonPanel(), BorderLayout.SOUTH); 171 170 172 171 getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( 173 172 KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK), "checkClipboardContents"); … … 182 181 restoreSettings(); 183 182 } 184 185 183 186 184 private void checkClipboardContents() { … … 224 222 * @param eventSource - the DownloadSelection object that fired this notification. 225 223 */ 226 public void boundingBoxChanged(Bounds b, DownloadSelection eventSource) { 224 public void boundingBoxChanged(Bounds b, DownloadSelection eventSource) { 227 225 this.currentBounds = b; 228 226 for (DownloadSelection s : downloadSelections) { … … 233 231 updateSizeCheck(); 234 232 } 235 236 /** 237 * Invoked by 233 234 /** 235 * Invoked by 238 236 * @param b 239 237 */ … … 242 240 actDownload.run(); 243 241 } 244 242 245 243 /** 246 244 * Replies true if the user selected to download OSM data 247 * 245 * 248 246 * @return true if the user selected to download OSM data 249 247 */ … … 251 249 return cbDownloadOsmData.isSelected(); 252 250 } 253 251 254 252 /** 255 253 * Replies true if the user selected to download GPX data 256 * 254 * 257 255 * @return true if the user selected to download GPX data 258 256 */ … … 260 258 return cbDownloadGpxData.isSelected(); 261 259 } 262 263 /** 264 * Replies true if the user requires to download into a new layer 265 * 266 * @return true if the user requires to download into a new layer 260 261 /** 262 * Replies true if the user requires to download into a new layer 263 * 264 * @return true if the user requires to download into a new layer 267 265 */ 268 266 public boolean isNewLayerRequired() { 269 267 return cbNewLayer.isSelected(); 270 268 } 271 269 272 270 /** 273 271 * Adds a new download area selector to the download dialog 274 * 275 * @param selector the download are selector 272 * 273 * @param selector the download are selector 276 274 * @param displayName the display name of the selector 277 275 */ … … 279 277 tpDownloadAreaSelectors.add(displayName, selector); 280 278 } 281 282 /** 283 * Remembers the current settings in the download dialog 284 * 279 280 /** 281 * Remembers the current settings in the download dialog 282 * 285 283 */ 286 284 public void rememberSettings() { … … 293 291 } 294 292 } 295 293 296 294 public void restoreSettings() { 297 295 cbDownloadOsmData.setSelected(Main.pref.getBoolean("download.osm", true)); … … 303 301 } 304 302 tpDownloadAreaSelectors.setSelectedIndex(idx); 305 303 306 304 if (Main.map != null) { 307 305 MapView mv = Main.map.mapView; 308 306 currentBounds = new Bounds( 309 307 mv.getLatLon(0, mv.getHeight()), 310 mv.getLatLon(mv.getWidth(), 0) 308 mv.getLatLon(mv.getWidth(), 0) 311 309 ); 312 310 boundingBoxChanged(currentBounds,null); … … 323 321 } 324 322 } 325 323 326 324 /** 327 325 * Replies the currently selected download area. May be null, if no download area is selected … … 331 329 return currentBounds; 332 330 } 333 331 334 332 @Override 335 333 public void setVisible(boolean visible) { … … 350 348 /** 351 349 * Replies true if the dialog was canceled 352 * 350 * 353 351 * @return true if the dialog was canceled 354 352 */ … … 360 358 this.canceled = canceled; 361 359 } 362 360 363 361 class CancelAction extends AbstractAction { 364 362 public CancelAction() { 365 363 putValue(NAME, tr("Cancel")); 366 364 putValue(SMALL_ICON, ImageProvider.get("cancel")); 367 putValue(SHORT_DESCRIPTION, tr("Click to close the dialog and to abort downloading")); 368 } 369 365 putValue(SHORT_DESCRIPTION, tr("Click to close the dialog and to abort downloading")); 366 } 367 370 368 public void run() { 371 369 setCanceled(true); 372 setVisible(false); 373 } 374 370 setVisible(false); 371 } 372 375 373 public void actionPerformed(ActionEvent e) { 376 374 run(); 377 } 375 } 378 376 } 379 377 … … 382 380 putValue(NAME, tr("Download")); 383 381 putValue(SMALL_ICON, ImageProvider.get("download")); 384 putValue(SHORT_DESCRIPTION, tr("Click do download the currently selected area")); 385 } 386 382 putValue(SHORT_DESCRIPTION, tr("Click do download the currently selected area")); 383 } 384 387 385 public void run() { 388 386 if (currentBounds == null) { … … 398 396 JOptionPane.showMessageDialog( 399 397 DownloadDialog.this, 400 tr("<html>Neither <strong>{0}</strong> nor <strong>{1}</strong> is enabled.<br>" 398 tr("<html>Neither <strong>{0}</strong> nor <strong>{1}</strong> is enabled.<br>" 401 399 + "Please chose to either download OSM data, or GPX data, or both.</html>", 402 400 cbDownloadOsmData.getText(), … … 409 407 } 410 408 setCanceled(false); 411 setVisible(false); 412 } 413 409 setVisible(false); 410 } 411 414 412 public void actionPerformed(ActionEvent e) { 415 413 run(); 416 } 417 } 418 414 } 415 } 416 419 417 class WindowEventHandler extends WindowAdapter { 420 418 @Override … … 426 424 public void windowActivated(WindowEvent e) { 427 425 btnDownload.requestFocusInWindow(); 428 } 426 } 429 427 } 430 428 } -
trunk/src/org/openstreetmap/josm/gui/download/DownloadSelection.java
r2344 r2512 3 3 4 4 import org.openstreetmap.josm.data.Bounds; 5 6 5 7 6 public interface DownloadSelection { … … 12 11 void addGui(DownloadDialog gui); 13 12 14 15 13 /** 16 14 * Sets the current download area. The area may be null to clear 17 15 * the current download area. 18 * 16 * 19 17 * @param are the current download area 20 18 */ 21 19 public void setDownloadArea(Bounds area); 22 20 } 23 -
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r2362 r2512 66 66 private JTable tblSearchResults; 67 67 private DownloadDialog parent; 68 68 69 69 protected JPanel buildSearchPanel() { 70 70 JPanel panel = new JPanel(); 71 71 panel.setLayout(new GridBagLayout()); 72 72 GridBagConstraints gc = new GridBagConstraints(); 73 74 // the label for the search field 73 74 // the label for the search field 75 75 // 76 76 gc.gridwidth = 2; … … 79 79 gc.insets = new Insets(5, 5, 0, 5); 80 80 panel.add(new JLabel(tr("Enter a place name to search for:")), gc); 81 81 82 82 // the search expression field 83 83 // … … 104 104 gc.weightx = 0.0; 105 105 panel.add(btnSearch, gc); 106 107 return panel; 106 107 return panel; 108 108 } 109 109 … … 125 125 scrollPane.setPreferredSize(new Dimension(200,200)); 126 126 panel.add(scrollPane, BorderLayout.CENTER); 127 127 128 128 gui.addDownloadAreaSelector(panel, tr("Areas around places")); 129 129 130 scrollPane.setPreferredSize(scrollPane.getPreferredSize()); 130 scrollPane.setPreferredSize(scrollPane.getPreferredSize()); 131 131 tblSearchResults.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 132 132 tblSearchResults.getSelectionModel().addListSelectionListener(new ListSelectionHandler()); … … 139 139 } 140 140 } 141 }); 141 }); 142 142 parent = gui; 143 143 } … … 146 146 tblSearchResults.clearSelection(); 147 147 } 148 148 149 149 /** 150 150 * Data storage for search results. … … 160 160 public int osmId; 161 161 public OsmPrimitiveType type; 162 162 163 163 public Bounds getDownloadArea() { 164 164 double size = 180.0 / Math.pow(2, zoom); 165 165 Bounds b = new Bounds( 166 new LatLon(lat - size / 2, lon - size), 166 new LatLon(lat - size / 2, lon - size), 167 167 new LatLon(lat + size / 2, lon+ size) 168 168 ); … … 170 170 } 171 171 } 172 173 172 174 173 /** 175 174 * A very primitive parser for the name finder's output. … … 185 184 /** 186 185 * Detect starting elements. 187 * 186 * 188 187 */ 189 188 @Override … … 245 244 } 246 245 } 247 246 248 247 public List<SearchResult> getResult() { 249 248 return data; 250 249 } 251 250 } 252 251 253 252 class SearchAction extends AbstractAction implements DocumentListener { 254 253 … … 259 258 updateEnabledState(); 260 259 } 261 260 262 261 public void actionPerformed(ActionEvent e) { 263 262 if (!isEnabled() || cbSearchExpression.getText().trim().length() == 0) … … 268 267 Main.worker.submit(task); 269 268 } 270 269 271 270 protected void updateEnabledState() { 272 271 setEnabled(cbSearchExpression.getText().trim().length() > 0); … … 285 284 } 286 285 } 287 288 286 289 287 class NameQueryTask extends PleaseWaitRunnable { 290 288 291 289 private String searchExpression; 292 290 private HttpURLConnection connection; … … 294 292 private boolean canceled = false; 295 293 private Exception lastException; 296 294 297 295 public NameQueryTask(String searchExpression) { 298 296 super(tr("Querying name server"),false /* don't ignore exceptions */); 299 297 this.searchExpression = searchExpression; 300 298 } 301 302 299 303 300 @Override 304 301 protected void cancel() { … … 306 303 synchronized (this) { 307 304 if (connection != null) { 308 connection.disconnect(); 309 } 310 } 305 connection.disconnect(); 306 } 307 } 311 308 } 312 309 313 310 @Override 314 311 protected void finish() { 315 if (canceled) 312 if (canceled) 316 313 return; 317 314 if (lastException != null) { … … 319 316 return; 320 317 } 321 model.setData(this.data); 322 } 323 324 @Override 325 protected void realRun() throws SAXException, IOException, OsmTransferException { 318 model.setData(this.data); 319 } 320 321 @Override 322 protected void realRun() throws SAXException, IOException, OsmTransferException { 326 323 try { 327 324 getProgressMonitor().indeterminateSubTask(tr("Querying name server ...")); … … 339 336 } catch(Exception e) { 340 337 if (canceled) { 341 // ignore exception 338 // ignore exception 342 339 return; 343 340 } … … 346 343 } 347 344 } 348 345 349 346 class NamedResultTableModel extends DefaultTableModel { 350 347 private ArrayList<SearchResult> data; 351 348 private ListSelectionModel selectionModel; 352 349 353 350 public NamedResultTableModel(ListSelectionModel selectionModel) { 354 351 data = new ArrayList<SearchResult>(); … … 366 363 return data.get(row); 367 364 } 368 365 369 366 public void setData(List<SearchResult> data) { 370 367 if (data == null) { … … 377 374 @Override 378 375 public boolean isCellEditable(int row, int column) { 379 return false; 380 } 381 376 return false; 377 } 378 382 379 public SearchResult getSelectedSearchResult() { 383 380 if (selectionModel.getMinSelectionIndex() < 0) { … … 387 384 } 388 385 } 389 386 390 387 class NamedResultTableColumnModel extends DefaultTableColumnModel { 391 388 protected void createColumns() { … … 400 397 col.setCellRenderer(renderer); 401 398 addColumn(col); 402 399 403 400 // column 1 - Version 404 401 col = new TableColumn(1); … … 408 405 col.setCellRenderer(renderer); 409 406 addColumn(col); 410 407 411 408 // column 2 - Near 412 409 col = new TableColumn(2); … … 416 413 col.setCellRenderer(renderer); 417 414 addColumn(col); 418 419 415 420 416 // column 3 - Zoom … … 431 427 } 432 428 } 433 429 434 430 class ListSelectionHandler implements ListSelectionListener { 435 431 public void valueChanged(ListSelectionEvent lse) { … … 445 441 } 446 442 } 447 443 448 444 class NamedResultCellRenderer extends JLabel implements TableCellRenderer { 449 445 450 446 public NamedResultCellRenderer() { 451 447 setOpaque(true); 452 448 setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); 453 449 } 454 450 455 451 protected void reset() { 456 452 setText(""); 457 453 setIcon(null); 458 454 } 459 455 460 456 protected void renderColor(boolean selected) { 461 457 if (selected) { … … 464 460 } else { 465 461 setForeground(UIManager.getColor("Table.foreground")); 466 setBackground(UIManager.getColor("Table.background")); 467 } 468 } 469 462 setBackground(UIManager.getColor("Table.background")); 463 } 464 } 465 470 466 protected String lineWrapDescription(String description) { 471 467 StringBuffer ret = new StringBuffer(); … … 488 484 return ret.toString(); 489 485 } 490 486 491 487 public Component getTableCellRendererComponent(JTable table, Object value, 492 488 boolean isSelected, boolean hasFocus, int row, int column) { 493 489 494 490 reset(); 495 491 renderColor(isSelected); 496 492 497 493 if (value == null) return this; 498 494 SearchResult sr = (SearchResult) value; -
trunk/src/org/openstreetmap/josm/gui/download/SizeButton.java
r1390 r2512 1 1 // License: GPL. Copyright 2007 by Tim Haussmann 2 2 package org.openstreetmap.josm.gui.download; 3 4 3 5 4 import java.awt.Graphics; … … 9 8 10 9 import org.openstreetmap.josm.tools.ImageProvider; 11 12 10 13 11 /** … … 22 20 private ImageIcon shrinkImage; 23 21 private boolean isEnlarged = false; 24 25 22 26 23 public SizeButton(){ -
trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java
r2332 r2512 122 122 String labelText = tr("<b>Zoom:</b> Mousewheel, double click or Ctrl + Up/Down " 123 123 + "<b>Move map:</b> Hold right mousebutton and move mouse or use cursor keys. <b>Select:</b> Hold left mousebutton and draw a frame."); 124 slipyyMapTabPanel.add(new JLabel("<html>" + labelText + "</html>"), BorderLayout.SOUTH); 124 slipyyMapTabPanel.add(new JLabel("<html>" + labelText + "</html>"), BorderLayout.SOUTH); 125 125 iGui.addDownloadAreaSelector(slipyyMapTabPanel, tr("Slippy map")); 126 126 new OsmMapControl(this, slipyyMapTabPanel, iSizeButton, iSourceButton); … … 169 169 if (area == null) 170 170 return; 171 171 172 172 // test if a bounding box has been set set 173 173 if (area.getMin().lat() == 0.0 && area.getMin().lon() == 0.0 && area.getMax().lat() == 0.0 && area.getMax().lon() == 0.0) … … 224 224 Bounds b = new Bounds( 225 225 new LatLon( 226 Math.min(l2.getLat(), l1.getLat()), 226 Math.min(l2.getLat(), l1.getLat()), 227 227 Math.min(l1.getLon(), l2.getLon()) 228 228 ), 229 229 new LatLon( 230 Math.max(l2.getLat(), l1.getLat()), 230 Math.max(l2.getLat(), l1.getLat()), 231 231 Math.max(l1.getLon(), l2.getLon())) 232 232 ); -
trunk/src/org/openstreetmap/josm/gui/help/ContextSensitiveHelpAction.java
r2326 r2512 13 13 * This is the standard help action to be used with help buttons for 14 14 * context sensitive help 15 * 15 * 16 16 */ 17 17 public class ContextSensitiveHelpAction extends AbstractAction { … … 21 21 22 22 /** 23 * Sets the help topic 24 * 23 * Sets the help topic 24 * 25 25 * @param relativeHelpTopic the relative help topic 26 26 */ … … 30 30 this.helpTopic = relativeHelpTopic; 31 31 } 32 32 33 33 /** 34 34 * Creates a help topic for the root help topic 35 * 35 * 36 36 */ 37 37 public ContextSensitiveHelpAction() { 38 38 this(ht("/")); 39 39 } 40 40 41 41 /** 42 * 42 * 43 43 * @param helpTopic 44 44 */ -
trunk/src/org/openstreetmap/josm/gui/help/HelpApplication.java
r2358 r2512 31 31 * The JOSM help browser wrapped in its own application. It is listening to commands 32 32 * on standard in. 33 * 33 * 34 34 */ 35 35 public class HelpApplication { … … 57 57 new Thread(commandProcessor).start(); 58 58 } 59 60 59 61 60 static public void main(String argArray[]) { -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r2448 r2512 57 57 /** 58 58 * Replies the unique instance of the help browser 59 * 59 * 60 60 * @return the unique instance of the help browser 61 61 */ … … 70 70 * Launches the internal help browser and directs it to the help page for 71 71 * <code>helpTopic</code>. 72 * 72 * 73 73 * @param helpTopic the help topic 74 74 */ … … 94 94 /** 95 95 * Builds the style sheet used in the internal help browser 96 * 96 * 97 97 * @return the style sheet 98 98 */ … … 172 172 /** 173 173 * Replies the current URL 174 * 174 * 175 175 * @return the current URL 176 176 */ 177 178 177 179 178 public String getUrl() { … … 183 182 /** 184 183 * Displays a warning page when a help topic doesn't exist yet. 185 * 184 * 186 185 * @param relativeHelpTopic the help topic 187 186 */ … … 204 203 /** 205 204 * Displays a error page if a help topic couldn't be loaded because of network or IO error. 206 * 205 * 207 206 * @param relativeHelpTopic the help topic 208 207 * @param e the exception … … 227 226 /** 228 227 * Loads a help topic given by a relative help topic name (i.e. "/Action/New") 229 * 228 * 230 229 * First tries to load the language specific help topic. If it is missing, tries to 231 230 * load the topic in english. 232 * 231 * 233 232 * @param relativeHelpTopic the relative help topic 234 233 */ … … 265 264 * Loads a help topic given by an absolute help topic name, i.e. 266 265 * "/De:Help/Action/New" 267 * 266 * 268 267 * @param absoluteHelpTopic the absolute help topic name 269 268 */ … … 289 288 /** 290 289 * Opens an URL and displays the content. 291 * 290 * 292 291 * If the URL is the locator of an absolute help topic, help content is loaded from 293 292 * the JOSM wiki. Otherwise, the help browser loads the page from the given URL 294 * 293 * 295 294 * @param url the url 296 295 */ … … 333 332 * Loads and displays the help information for a help topic given 334 333 * by a relative help topic name, i.e. "/Action/New" 335 * 334 * 336 335 * @param relativeHelpTopic the relative help topic 337 336 */ … … 455 454 /** 456 455 * Scrolls the help browser to the element with id <code>id</code> 457 * 456 * 458 457 * @param id the id 459 458 * @return true, if an element with this id was found and scrolling was successful; false, otherwise … … 485 484 * <a href="#thisIsALocalFragment">. If so, replies the fragment, i.e. 486 485 * "thisIsALocalFragment". 487 * 486 * 488 487 * Otherwise, replies null 489 * 488 * 490 489 * @param e the hyperlink event 491 490 * @return the local fragment -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserCommandProcessor.java
r2317 r2512 13 13 /** 14 14 * Listens to commands on an input stream and delegates them to the help browser. 15 * 15 * 16 16 * 17 17 */ … … 23 23 24 24 /** 25 * 25 * 26 26 * @param browser the controlled help browser 27 27 */ … … 32 32 /** 33 33 * Show the help page for help topic <code>helpTopic</code>. 34 * 34 * 35 35 * @param helpTopic the help topic 36 36 */ … … 83 83 } 84 84 } 85 -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserProxy.java
r2308 r2512 15 15 /** 16 16 * This is the proxy class for the help browser running in its own process. 17 * 17 * 18 18 * 19 19 */ … … 25 25 /** 26 26 * replies the unique instance of the proxy 27 * 27 * 28 28 * @return the unique instance of the proxy 29 29 */ … … 42 42 /** 43 43 * launches the help browser in its own process 44 * 44 * 45 45 */ 46 46 protected void launch() { … … 78 78 * Direct the help browser to the help page for help topic 79 79 * <code>relativeHelpTopic</code> 80 * 80 * 81 81 * @param relativeHelpTopic the help topic 82 82 */ -
trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java
r2308 r2512 14 14 * Reads help content from the JOSM Wiki and prepares it for rendering in the internal 15 15 * help browser. 16 * 16 * 17 17 * The help content has to be <strong>filtered</strong> because only the main content <tt><div></tt> 18 18 * of a Wiki help page is displayed in the internal help browser. 19 * 19 * 20 20 * It also has to be <strong>transformed</strong> because the internal help browser required slightly 21 21 * different HTML than what is provided by the Wiki. 22 * 22 * 23 23 * @see WikiReader 24 24 */ … … 30 30 /** 31 31 * constructor 32 * 32 * 33 33 * @param baseUrl the base url of the JOSM help wiki, i.e. http://josm.openstreetmap.org 34 34 */ … … 39 39 /** 40 40 * Fetches the content of a help topic from the JOSM wiki. 41 * 41 * 42 42 * @param helpTopicUrl the absolute help topic URL 43 43 * @return the content, filtered and transformed for being displayed in the internal help browser … … 81 81 * Reads help content from the input stream and prepares it to be rendered later 82 82 * in the internal help browser. 83 * 83 * 84 84 * Throws a {@see MissingHelpContentException} if the content read from the stream 85 85 * most likely represents a stub help page. 86 * 86 * 87 87 * @param in the input stream 88 88 * @return the content -
trunk/src/org/openstreetmap/josm/gui/help/HelpContentReaderException.java
r2308 r2512 28 28 * Replies the HTTP response code related to the wiki access exception. 29 29 * If no HTTP response code is available, 0 is replied. 30 * 30 * 31 31 * @return the http response code 32 32 */ … … 37 37 /** 38 38 * Sets the HTTP response code 39 * 39 * 40 40 * @param responseCode the response code 41 41 */ … … 44 44 } 45 45 46 47 46 } -
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r2389 r2512 19 19 /** 20 20 * Replies the base wiki URL. 21 * 21 * 22 22 * @return the base wiki URL 23 23 */ … … 28 28 /** 29 29 * Replies the base wiki URL for help pages 30 * 30 * 31 31 * @return the base wiki URL for help pages 32 32 */ … … 37 37 /** 38 38 * Replies the URL on the wiki for an absolute help topic. The URL is encoded in UTF-8. 39 * 39 * 40 40 * @param absoluteHelpTopic the absolute help topic 41 41 * @return the url … … 53 53 /** 54 54 * Replies the URL to the edit page for the absolute help topic. 55 * 55 * 56 56 * @param absoluteHelpTopic the absolute help topic 57 57 * @return the URL to the edit page … … 66 66 * Extracts the relative help topic from an URL. Replies null, if 67 67 * no relative help topic is found. 68 * 68 * 69 69 * @param url the url 70 70 * @return the relative help topic in the URL, i.e. "/Action/New" … … 82 82 * Extracts the absolute help topic from an URL. Replies null, if 83 83 * no absolute help topic is found. 84 * 84 * 85 85 * @param url the url 86 86 * @return the absolute help topic in the URL, i.e. "/De:Help/Action/New" … … 106 106 * <li>/De:Help if the current locale is a locale with language "de"</li> 107 107 * </ul> 108 * 108 * 109 109 * @return the help topic prefix 110 110 * @see #getHelpTopicPrefix(Locale) … … 120 120 * <li>/De:Help if the locale is a locale with language "de"</li> 121 121 * </ul> 122 * 122 * 123 123 * @param locale the locale. {@see Locale#ENGLISH} assumed, if null. 124 124 * @return the help topic prefix … … 137 137 /** 138 138 * Replies the absolute, localized help topic for the given topic. 139 * 139 * 140 140 * Example: for a topic "/Dialog/RelationEditor" and the locale "de", this method 141 141 * replies "/De:Help/Dialog/RelationEditor" 142 * 142 * 143 143 * @param topic the relative help topic. Home help topic assumed, if null. 144 144 * @param locale the locale. {@see Locale#ENGLISH} assumed, if null. … … 164 164 * Replies the absolute, localized help topic for the given topic and the 165 165 * current locale. 166 * 166 * 167 167 * @param topic the relative help topic. Home help topic assumed, if null. 168 168 * @return the absolute, localized help topic … … 176 176 /** 177 177 * Replies the context specific help topic configured for <code>context</code>. 178 * 178 * 179 179 * @return the help topic. null, if no context specific help topic is found 180 180 */ … … 208 208 * Replies the global help action, if available. Otherwise, creates an instance 209 209 * of {@see HelpAction}. 210 * 210 * 211 211 * @return 212 212 */ … … 221 221 /** 222 222 * Makes a component aware of context sensitive help. 223 * 223 * 224 224 * A relative help topic doesn't start with /Help and doesn't include a locale 225 225 * code. Example: /Dialog/RelationEditor is a relative help topic, /De:Help/Dialog/RelationEditor 226 226 * is not. 227 * 227 * 228 228 * @param component the component the component 229 229 * @param topic the help topic. Set to the default help topic if null. … … 241 241 * This is a simple marker method for help topic literals. If you declare a help 242 242 * topic literal in the source you should enclose it in ht(...). 243 * 243 * 244 244 * <strong>Example</strong> 245 245 * <pre> … … 248 248 * putValue("help", ht("/Dialog/RelationEditor")); 249 249 * </pre> 250 * 251 * 250 * 251 * 252 252 * @param helpTopic 253 253 */ -
trunk/src/org/openstreetmap/josm/gui/history/AdjustmentSynchronizer.java
r2181 r2512 15 15 16 16 import javax.swing.JCheckBox; 17 18 17 19 18 /** … … 36 35 observable = new Observable(); 37 36 } 38 39 37 40 38 /** -
trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
r2245 r2512 87 87 88 88 /** 89 * 89 * 90 90 * @param model the model. Must not be null. 91 91 * @throws IllegalArgumentException thrown if model is null … … 131 131 /** 132 132 * Sets the model for this viewer 133 * 133 * 134 134 * @param model the model. 135 135 */ … … 147 147 * A UI widgets which displays the Lan/Lon-coordinates of a 148 148 * {@see HistoryNode}. 149 * 149 * 150 150 */ 151 151 private static class LatLonViewer extends JPanel implements Observer{ … … 210 210 lblLon.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); 211 211 212 213 212 // fill the remaining space 214 213 gc.gridx = 0; … … 222 221 223 222 /** 224 * 223 * 225 224 * @param model a model 226 225 * @param role the role for this viewer. -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
r2416 r2512 30 30 private CoordinateInfoViewer coordinateInfoViewer; 31 31 private JTabbedPane tpViewers; 32 33 32 34 33 /** -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialog.java
r2448 r2512 30 30 * This is non-modal dialog, always showing on top, which displays history information 31 31 * about a given {@see OsmPrimitive}. 32 * 32 * 33 33 */ 34 34 public class HistoryBrowserDialog extends JDialog implements HistoryDataSetListener{ … … 40 40 /** 41 41 * displays the title for this dialog 42 * 42 * 43 43 * @param h the current history 44 44 */ … … 58 58 /** 59 59 * builds the GUI 60 * 60 * 61 61 */ 62 62 protected void build() { … … 88 88 /** 89 89 * constructor 90 * 90 * 91 91 * @param history the history to be displayed 92 92 */ -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
r2448 r2512 88 88 /** 89 89 * Hides and destroys all currently visible history browser dialogs 90 * 90 * 91 91 */ 92 92 public void hideAll() { -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r2497 r2512 103 103 /** 104 104 * Creates a new history browser model for a given history. 105 * 105 * 106 106 * @param history the history. Must not be null. 107 107 * @throws IllegalArgumentException thrown if history is null … … 117 117 * Replies the current edit layer; null, if there isn't a current edit layer 118 118 * of type {@see OsmDataLayer}. 119 * 119 * 120 120 * @return the current edit layer 121 121 */ … … 258 258 * Sets the {@see HistoryOsmPrimitive} which plays the role of a reference point 259 259 * in time (see {@see PointInTimeType}). 260 * 260 * 261 261 * @param reference the reference history primitive. Must not be null. 262 262 * @throws IllegalArgumentException thrown if reference is null 263 263 * @throws IllegalStateException thrown if this model isn't a assigned a history yet 264 264 * @throws IllegalArgumentException if reference isn't an history primitive for the history managed by this mode 265 * 265 * 266 266 * @see #setHistory(History) 267 267 * @see PointInTimeType … … 289 289 * Sets the {@see HistoryOsmPrimitive} which plays the role of the current point 290 290 * in time (see {@see PointInTimeType}). 291 * 291 * 292 292 * @param reference the reference history primitive. Must not be null. 293 293 * @throws IllegalArgumentException thrown if reference is null 294 294 * @throws IllegalStateException thrown if this model isn't a assigned a history yet 295 295 * @throws IllegalArgumentException if reference isn't an history primitive for the history managed by this mode 296 * 296 * 297 297 * @see #setHistory(History) 298 298 * @see PointInTimeType … … 357 357 * representing the version currently edited in the current data 358 358 * layer. 359 * 359 * 360 360 * @param primitive the primitive to check 361 361 * @return true if <code>primitive</code> is the latest primitive … … 452 452 } 453 453 } 454 455 454 456 455 /** … … 767 766 * Removes this model as listener for data change and layer change 768 767 * events. 769 * 768 * 770 769 */ 771 770 public void unlinkAsListener() { … … 875 874 /** 876 875 * Creates a {@see HistoryOsmPrimitive} from a {@see OsmPrimitive} 877 * 876 * 878 877 */ 879 878 class HistoryPrimitiveBuilder extends AbstractVisitor { -
trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java
r2448 r2512 28 28 * 29 29 * It provides a fluent API for configuration. 30 * 30 * 31 31 * Sample usage: 32 * 32 * 33 33 * <pre> 34 34 * HistoryLoadTask task = new HistoryLoadTask() … … 37 37 * .add(37234, OsmPrimitveType.RELATION) 38 38 * .add(aHistoryItem); 39 * 39 * 40 40 * Main.worker.execute(task); 41 * 41 * 42 42 * </pre> 43 43 */ … … 56 56 /** 57 57 * Adds an object whose history is to be loaded. 58 * 58 * 59 59 * @param id the object id 60 60 * @param type the object type … … 73 73 /** 74 74 * Adds an object whose history is to be loaded. 75 * 75 * 76 76 * @param pid the primitive id. Must not be null. Id > 0 required. 77 77 * @return this task … … 88 88 /** 89 89 * Adds an object to be loaded, the object is specified by a history item. 90 * 90 * 91 91 * @param primitive the history item 92 92 * @return this task … … 102 102 /** 103 103 * Adds an object to be loaded, the object is specified by an already loaded object history. 104 * 104 * 105 105 * @param history the history. Must not be null. 106 106 * @return this task … … 116 116 /** 117 117 * Adds an object to be loaded, the object is specified by an OSM primitive. 118 * 118 * 119 119 * @param primitive the OSM primitive. Must not be null. primitive.getId() > 0 required. 120 120 * @return this task … … 133 133 /** 134 134 * Adds a collection of objects to loaded, specified by a collection of OSM primitives. 135 * 135 * 136 136 * @param primitive the OSM primitive. Must not be null. primitive.getId() > 0 required. 137 137 * @return this task -
trunk/src/org/openstreetmap/josm/gui/history/NodeListTableCellRenderer.java
r1709 r2512 16 16 /** 17 17 * The {@see TableCellRenderer} for a list of nodes in [@see HistoryBrower} 18 * 18 * 19 19 * 20 20 */ -
trunk/src/org/openstreetmap/josm/gui/history/NodeListTableColumnModel.java
r1709 r2512 9 9 /** 10 10 * The {@see TableColumnModel} for the table with the list of nodes. 11 * 11 * 12 12 * 13 13 */ -
trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java
r2448 r2512 32 32 * NodeListViewer is a UI component which displays the node list of two 33 33 * version of a {@see OsmPrimitive} in a {@see History}. 34 * 34 * 35 35 * <ul> 36 36 * <li>on the left, it displays the node list for the version at {@see PointInTimeType#REFERENCE_POINT_IN_TIME}</li> … … 168 168 } 169 169 } 170 171 170 172 171 class NodeListPopupMenu extends JPopupMenu { -
trunk/src/org/openstreetmap/josm/gui/history/PointInTimeType.java
r1750 r2512 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.history; 3 4 3 5 4 /** -
trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java
r2017 r2512 17 17 import org.openstreetmap.josm.tools.ImageProvider; 18 18 19 20 19 /** 21 20 * The {@see TableCellRenderer} for a list of relation members in {@see HistoryBrower} 22 * 21 * 23 22 * 24 23 */ … … 39 38 icons.put(OsmPrimitiveType.RELATION, ImageProvider.get("data", "relation")); 40 39 } 41 42 40 43 41 protected void renderIcon(RelationMember member) { … … 94 92 } 95 93 96 97 94 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 98 95 int row, int column) { -
trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListViewer.java
r2017 r2512 13 13 * RelationMemberListViewer is a UI component which displays the list of relation members of two 14 14 * version of a {@see Relation} in a {@see History}. 15 * 15 * 16 16 * <ul> 17 17 * <li>on the left, it displays the list of relation members for the version at {@see PointInTimeType#REFERENCE_POINT_IN_TIME}</li> -
trunk/src/org/openstreetmap/josm/gui/history/RelationMemberTableColumnModel.java
r2017 r2512 9 9 /** 10 10 * The {@see TableColumnModel} for the table with the list of relation members. 11 * 11 * 12 12 */ 13 13 public class RelationMemberTableColumnModel extends DefaultTableColumnModel { -
trunk/src/org/openstreetmap/josm/gui/history/TagTableCellRenderer.java
r2448 r2512 16 16 /** 17 17 * The {@see TableCellRenderer} for a list of tagsin {@see HistoryBrower} 18 * 18 * 19 19 */ 20 20 public class TagTableCellRenderer extends JLabel implements TableCellRenderer { -
trunk/src/org/openstreetmap/josm/gui/history/TagTableColumnModel.java
r2017 r2512 9 9 /** 10 10 * The {@see TableColumnModel} for the table with the list of tags 11 * 11 * 12 12 */ 13 13 public class TagTableColumnModel extends DefaultTableColumnModel{ -
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r2448 r2512 28 28 * VersionInfoPanel is an UI component which displays the basic properties of a version 29 29 * of a {@see OsmPrimitive}. 30 * 30 * 31 31 */ 32 32 public class VersionInfoPanel extends JPanel implements Observer{ … … 110 110 /** 111 111 * constructor 112 * 112 * 113 113 * @param model the model (must not be null) 114 114 * @param pointInTimeType the point in time this panel visualizes (must not be null) -
trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
r2044 r2512 24 24 /** 25 25 * VersionTable shows a list of version in a {@see History} of an {@see OsmPrimitive}. 26 * 26 * 27 27 * 28 28 */ -
trunk/src/org/openstreetmap/josm/gui/history/VersionTableCellRenderer.java
r2448 r2512 24 24 /** 25 25 * The {@see TableCellRenderer} for a list of versions in {@see HistoryBrower} 26 * 26 * 27 27 */ 28 28 public class VersionTableCellRenderer extends JLabel implements TableCellRenderer { -
trunk/src/org/openstreetmap/josm/gui/history/VersionTableColumnModel.java
r2017 r2512 9 9 /** 10 10 * The {@see TableColumnModel} for the table with the list of versions 11 * 11 * 12 12 */ 13 13 public class VersionTableColumnModel extends DefaultTableColumnModel { -
trunk/src/org/openstreetmap/josm/gui/io/AbstractIOTask.java
r2025 r2512 4 4 /** 5 5 * This is an abstract task for uploading or saving a data layer. 6 * 6 * 7 7 */ 8 8 public abstract class AbstractIOTask implements Runnable { … … 23 23 /** 24 24 * Replies true if the task has been cancelled 25 * 25 * 26 26 * @return true if the task has been cancelled 27 27 */ … … 32 32 /** 33 33 * Set whether this task has been cancelled 34 * 34 * 35 35 * @param cancelled true, if the task has been cancelled; false otherwise 36 36 */ … … 41 41 /** 42 42 * Replies true if the task has been failed 43 * 43 * 44 44 * @return true if the task has been failed 45 45 */ … … 50 50 /** 51 51 * Sets whether the task has been failed 52 * 52 * 53 53 * @param failed whether the task has been failed 54 54 */ … … 59 59 /** 60 60 * Replies the last exception caught 61 * 61 * 62 62 * @return the last exception caught; null, if no exception was caught 63 63 */ … … 68 68 /** 69 69 * Sets the last exception caught 70 * 70 * 71 71 * @param lastException the last exception 72 72 */ … … 78 78 * Replies true if this task was successful, i.e. if it wasn't 79 79 * cancelled and didn't fail 80 * 80 * 81 81 * @return true if this task was successful 82 82 */ -
trunk/src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java
r2115 r2512 18 18 /** 19 19 * A {@see ListCellRenderer} for the list of changesets in the upload dialog. 20 * 20 * 21 21 * 22 22 */ -
trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java
r2191 r2512 143 143 /** 144 144 * Sets whether this dialog is canceled 145 * 145 * 146 146 * @param canceled true, if this dialog is canceld 147 147 */ … … 152 152 /** 153 153 * Sets the collection of changesets to be displayed 154 * 154 * 155 155 * @param changesets the collection of changesets. Assumes an empty collection if null 156 156 */ … … 168 168 * Replies a collection with the changesets the user selected. 169 169 * Never null, but may be empty. 170 * 170 * 171 171 * @return a collection with the changesets the user selected. 172 172 */ -
trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetTask.java
r2115 r2512 19 19 /** 20 20 * A task for closing a collection of changesets. 21 * 21 * 22 22 */ 23 23 public class CloseChangesetTask extends PleaseWaitRunnable { … … 31 31 * are still open and if they have an id > 0. Other changesets in the collection 32 32 * are ignored. 33 * 33 * 34 34 * @param changesets the collection of changesets. Empty collection assumes, if null. 35 35 */ -
trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
r2289 r2512 36 36 37 37 /** 38 * 38 * 39 39 * @param model provides the user id of the current user and accepts the changesets 40 40 * after download … … 79 79 * Fetch the user info from the server. This is necessary if we don't know 80 80 * the users id yet 81 * 81 * 82 82 * @return the user info 83 83 * @throws OsmTransferException thrown in case of any communication exception -
trunk/src/org/openstreetmap/josm/gui/io/FilenameCellEditor.java
r2025 r2512 28 28 * This is a {@see TableCellEditor} for filenames. It provides a text input field and 29 29 * a button for launchinig a {@see JFileChooser}. 30 * 30 * 31 31 * 32 32 */ … … 48 48 gc.weighty = 1.0; 49 49 add(tfFileName = new JTextField(), gc); 50 51 50 52 51 gc.gridx = 1; … … 71 70 build(); 72 71 } 73 74 72 75 73 public void addCellEditorListener(CellEditorListener l) { -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayerInfo.java
r2181 r2512 10 10 * SaveLayerInfo represents the information, user preferences and save/upload states of 11 11 * a layer which might be uploaded/saved. 12 * 12 * 13 13 */ 14 14 class SaveLayerInfo implements Comparable<SaveLayerInfo> { … … 23 23 24 24 /** 25 * 25 * 26 26 * @param layer the layer. Must not be null. 27 27 * @throws IllegalArgumentException thrown if layer is null … … 38 38 /** 39 39 * Replies the layer this info objects holds information for 40 * 40 * 41 41 * @return the layer this info objects holds information for 42 42 */ … … 47 47 /** 48 48 * Replies true if this layer should be saved to a file; false, otherwise 49 * 49 * 50 50 * @return true if this layers should be saved to a file; false, otherwise 51 51 */ … … 56 56 /** 57 57 * Sets whether this layer should be saved to a file 58 * 58 * 59 59 * @param doSaveToFile true to save; false, to skip saving 60 60 */ … … 65 65 /** 66 66 * Replies true if this layer should be uploaded to the server; false, otherwise 67 * 67 * 68 68 * @return true if this layer should be uploaded to the server; false, otherwise 69 69 */ … … 74 74 /** 75 75 * Sets whether this layer should be uploaded to a file 76 * 76 * 77 77 * @param doSaveToFile true to upload; false, to skip uploading 78 78 */ … … 84 84 /** 85 85 * Replies true if this layer should be uploaded to the server and saved to file. 86 * 86 * 87 87 * @return true if this layer should be uploaded to the server and saved to file 88 88 */ … … 93 93 /** 94 94 * Replies the name of the layer 95 * 95 * 96 96 * @return the name of the layer 97 97 */ … … 102 102 /** 103 103 * Replies the file this layer should be saved to, if {@see #isDoSaveToFile()} is true 104 * 104 * 105 105 * @return the file this layer should be saved to, if {@see #isDoSaveToFile()} is true 106 106 */ … … 111 111 /** 112 112 * Sets the file this layer should be saved to, if {@see #isDoSaveToFile()} is true 113 * 113 * 114 114 * @param file the file 115 115 */ … … 147 147 * <li>{@see UploadOrSaveState#FAILED} if uploading {@see #getLayer() has failed</li> 148 148 * </ul> 149 * 149 * 150 150 * @return the upload state 151 151 */ … … 156 156 /** 157 157 * Sets the upload state for {@see #getLayer()} 158 * 158 * 159 159 * @param uploadState the upload state 160 160 */ … … 170 170 * <li>{@see UploadOrSaveState#FAILED} if saving {@see #getLayer() has failed</li> 171 171 * </ul> 172 * 172 * 173 173 * @return the save state 174 174 */ … … 179 179 /** 180 180 * Sets the save state for {@see #getLayer()} 181 * 181 * 182 182 * @param saveState save the upload state 183 183 */ … … 188 188 /** 189 189 * Resets the upload and save state 190 * 190 * 191 191 * @see #setUploadState(UploadOrSaveState) 192 192 * @see #setSaveState(UploadOrSaveState) -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayerInfoCellRenderer.java
r2196 r2512 20 20 * This is a {@see TableCellRenderer} for rendering the various fields of a 21 21 * {@see SaveLayerInfo} in the table {@see SaveLayersTable}. 22 * 22 * 23 23 * 24 24 */ -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java
r2181 r2512 11 11 * SaveLayerTask saves the data managed by an {@see OsmDataLayer} to the 12 12 * {@see OsmDataLayer#getAssociatedFile()}. 13 * 13 * 14 14 * <pre> 15 15 * ExecutorService executorService = ... … … 29 29 30 30 /** 31 * 31 * 32 32 * @param layerInfo information about the layer to be saved to save. Must not be null. 33 33 * @param monitor the monitor. Set to {@see NullProgressMonitor#INSTANCE} if null -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
r2196 r2512 84 84 /** 85 85 * builds the button row 86 * 86 * 87 87 * @return the panel with the button row 88 88 */ … … 377 377 * This is the asynchronous task which uploads modified layers to the server and 378 378 * saves them to files, if requested by the user. 379 * 379 * 380 380 */ 381 381 protected class SaveAndUploadTask implements Runnable { -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersModel.java
r2025 r2512 153 153 } 154 154 155 156 155 public void setUploadState(OsmDataLayer layer, UploadOrSaveState state) { 157 156 SaveLayerInfo info = getSaveLayerInfo(layer); -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java
r2051 r2512 8 8 import javax.swing.table.TableCellRenderer; 9 9 import javax.swing.table.TableColumn; 10 11 10 12 11 class SaveLayersTableColumnModel extends DefaultTableColumnModel { -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r2480 r2512 77 77 /** 78 78 * Replies the unique instance of the upload dialog 79 * 79 * 80 80 * @return the unique instance of the upload dialog 81 81 */ … … 113 113 /** 114 114 * builds the panel with the lists of primitives 115 * 115 * 116 116 * @return the panel with the lists of primitives 117 117 */ … … 126 126 /** 127 127 * builds the content panel for the upload dialog 128 * 128 * 129 129 * @return the content panel 130 130 */ … … 168 168 /** 169 169 * builds the panel with the OK and CANCEL buttons 170 * 170 * 171 171 * @return 172 172 */ … … 243 243 /** 244 244 * sets the collection of primitives which will be uploaded 245 * 245 * 246 246 * @param add the collection of primitives to add 247 247 * @param update the collection of primitives to update … … 312 312 /** 313 313 * Replies the current changeset 314 * 314 * 315 315 * @return the current changeset 316 316 */ … … 329 329 * changesets. If it is closed, removes it from the list of open 330 330 * changesets. 331 * 331 * 332 332 * @param cs the changeset 333 333 */ … … 339 339 * Removes <code>cs</code> from the list of open changesets in the upload 340 340 * dialog 341 * 341 * 342 342 * @param cs the changeset. Ignored if null. 343 343 */ … … 350 350 * Replies true if the changeset is to be closed after the 351 351 * next upload 352 * 352 * 353 353 * @return true if the changeset is to be closed after the 354 354 * next upload; false, otherwise … … 360 360 /** 361 361 * Replies the default value for "created_by" 362 * 362 * 363 363 * @return the default value for "created_by" 364 364 */ … … 370 370 /** 371 371 * Replies the current value for the upload comment 372 * 372 * 373 373 * @return the current value for the upload comment 374 374 */ … … 386 386 /** 387 387 * Replies true, if the dialog was canceled 388 * 388 * 389 389 * @return true, if the dialog was canceled 390 390 */ … … 395 395 /** 396 396 * Sets whether the dialog was canceld 397 * 397 * 398 398 * @param canceled true, if the dialog is canceled 399 399 */ … … 421 421 * This change listener is triggered when current tab in the tabbed pane in 422 422 * the lower half of the dialog is changed. 423 * 423 * 424 424 * It's main purpose is to keep the content in the text field for the changeset 425 425 * comment in sync with the changeset tag "comment". … … 518 518 putValue(SHORT_DESCRIPTION, tr("Cancel the upload and resume editing")); 519 519 } 520 521 520 522 521 public void actionPerformed(ActionEvent e) { … … 613 612 * build the panel with the widgets for controlling whether an atomic upload 614 613 * should be used or not 615 * 614 * 616 615 * @return the panel 617 616 */ … … 798 797 /** 799 798 * Replies the current upload comment 800 * 799 * 801 800 * @return 802 801 */ … … 807 806 /** 808 807 * Replies the current upload comment 809 * 808 * 810 809 * @return 811 810 */ … … 881 880 /** 882 881 * Remove a changeset from the list of open changeset 883 * 882 * 884 883 * @param cs the changeset to be removed. Ignored if null. 885 884 */ … … 908 907 /** 909 908 * Sets whether a new changeset is to be used 910 * 909 * 911 910 */ 912 911 public void setUseNewChangeset() { … … 927 926 * Replies true if the selected changeset should be closed after the 928 927 * next upload 929 * 928 * 930 929 * @return true if the selected changeset should be closed after the 931 930 * next upload … … 994 993 /** 995 994 * Refreshes the list of open changesets 996 * 995 * 997 996 */ 998 997 class RefreshAction extends AbstractAction { -
trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
r2402 r2512 23 23 /** 24 24 * UploadLayerTask uploads the data managed by an {@see OsmDataLayer} asynchronously. 25 * 25 * 26 26 * <pre> 27 27 * ExecutorService executorService = ... … … 46 46 47 47 /** 48 * 48 * 49 49 * @param layer the layer. Must not be null. 50 50 * @param monitor a progress monitor. If monitor is null, uses {@see NullProgressMonitor#INSTANCE} … … 77 77 * Retries to recover the upload operation from an exception which was thrown because 78 78 * an uploaded primitive was already deleted on the server. 79 * 79 * 80 80 * @param e the exception throw by the API 81 81 * @param monitor a progress monitor -
trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
r2250 r2512 47 47 /** 48 48 * This dialog can be used to select individual object for uploading. 49 * 49 * 50 50 * 51 51 */ -
trunk/src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
r2450 r2512 103 103 volatile Image scaledImage; 104 104 105 106 105 public Entry(File file, int width, int height, int maxSize, ImageLoadedListener listener) { 107 106 this.file = file; … … 222 221 } 223 222 } 224 225 223 226 224 public synchronized boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) { … … 322 320 gpxSubTask.finishTask(); 323 321 } 324 325 322 326 323 if (gps.isEmpty()) -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r2450 r2512 665 665 } // end for trk 666 666 } // end if lines 667 668 667 669 668 /**************************************************************** -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r2450 r2512 66 66 /** 67 67 * The visibility state of the layer. 68 * 68 * 69 69 */ 70 70 private boolean visible = true; … … 72 72 /** 73 73 * The layer should be handled as a background layer in automatic handling 74 * 74 * 75 75 */ 76 76 private boolean background = false; … … 78 78 /** 79 79 * The name of this layer. 80 * 80 * 81 81 */ 82 82 private String name; … … 145 145 public void setAssociatedFile(File file) { associatedFile = file; } 146 146 147 148 147 /** 149 148 * Replies the name of the layer 150 * 149 * 151 150 * @return the name of the layer 152 151 */ … … 174 173 /** 175 174 * Replies true if this layer is a background layer 176 * 175 * 177 176 * @return true if this layer is a background layer 178 177 */ … … 183 182 /** 184 183 * Sets whether this layer is a background layer 185 * 184 * 186 185 * @param background true, if this layer is a background layer 187 186 */ … … 193 192 * Sets the visibility of this layer. Emits property change event for 194 193 * property {@see #VISIBLE_PROP}. 195 * 194 * 196 195 * @param visible true, if the layer is visible; false, otherwise. 197 196 */ … … 221 220 /** 222 221 * Adds a {@see PropertyChangeListener} 223 * 222 * 224 223 * @param listener the listener 225 224 */ … … 230 229 /** 231 230 * Removes a {@see PropertyChangeListener} 232 * 231 * 233 232 * @param listener the listener 234 233 */ … … 239 238 /** 240 239 * fires a property change for the property {@see #VISIBLE_PROP} 241 * 240 * 242 241 * @param oldValue the old value 243 242 * @param newValue the new value … … 249 248 /** 250 249 * The action to save a layer 251 * 250 * 252 251 */ 253 252 public static class LayerSaveAction extends AbstractAction { -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r2500 r2512 324 324 /** 325 325 * Warns the user about the number of detected conflicts 326 * 326 * 327 327 * @param numNewConflicts the number of detected conflicts 328 328 * @param numPurgedPrimitives the number of automatically purged objects … … 389 389 * from the local dataset because they've been deleted on the 390 390 * server. 391 * 391 * 392 392 * @return the purge command. <code>null</code> if no primitives have to 393 393 * be purged … … 665 665 * Replies true if the data managed by this layer needs to be uploaded to 666 666 * the server because it contains at least one modified primitive. 667 * 667 * 668 668 * @return true if the data managed by this layer needs to be uploaded to 669 669 * the server because it contains at least one modified primitive; false, … … 679 679 * if the data managed by this layer has been modified since the last 680 680 * save operation to the file. 681 * 681 * 682 682 * @return true if the data managed by this layer needs to be saved to 683 683 * a file … … 689 689 /** 690 690 * Initializes the layer after a successful load of OSM data from a file 691 * 691 * 692 692 */ 693 693 public void onPostLoadFromFile() { … … 703 703 /** 704 704 * Initializes the layer after a successful save of OSM data to a file 705 * 705 * 706 706 */ 707 707 public void onPostSaveToFile() { … … 712 712 /** 713 713 * Initializes the layer after a successful upload to the server 714 * 714 * 715 715 */ 716 716 public void onPostUploadToServer() { -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r2450 r2512 446 446 } 447 447 448 449 448 public final class ShowHideMarkerText extends AbstractAction { 450 449 private final Layer layer; -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
r1924 r2512 45 45 } 46 46 } 47 48 49 -
trunk/src/org/openstreetmap/josm/gui/mappaint/IconElemStyle.java
r2392 r2512 25 25 annotate = true; 26 26 } 27 27 28 28 public ImageIcon getDisabledIcon() { 29 29 if (disabledIcon != null) -
trunk/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java
r2017 r2512 215 215 } 216 216 217 218 217 private void editPreference(final PreferenceDialog gui, final JTable list) { 219 218 if (list.getSelectedRowCount() != 1) { -
trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java
r2221 r2512 49 49 } 50 50 51 52 51 private DefaultTableModel tableModel; 53 52 private JTable colors; -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java
r1180 r2512 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.gui.preferences; 3 4 3 5 4 public interface PreferenceSetting { -
trunk/src/org/openstreetmap/josm/gui/preferences/StyleSourceEditor.java
r2400 r2512 79 79 private String availableStylesUrl; 80 80 81 82 81 /** 83 * 82 * 84 83 * @param stylesPreferencesKey the preferences key with the list of active style sources (filenames and URLs) 85 84 * @param iconsPreferenceKey the preference key with the list of icon sources (can be null) … … 145 144 tblActiveStyles.getActionMap().put("delete", removeActiveStylesAction); 146 145 JButton delete = new JButton(removeActiveStylesAction); 147 148 146 149 147 ActivateStylesAction activateStylesAction = new ActivateStylesAction(); … … 270 268 } 271 269 } 272 273 270 274 271 class ActiveStylesModel extends AbstractTableModel { … … 839 836 add(tfFileName = new JTextField(), gc); 840 837 841 842 838 gc.gridx = 1; 843 839 gc.gridy = 0; … … 862 858 } 863 859 864 865 860 public void addCellEditorListener(CellEditorListener l) { 866 861 if (!listeners.contains(l)) { … … 925 920 return this; 926 921 } 927 928 922 929 923 class LaunchFileChooserAction extends AbstractAction { -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r2316 r2512 424 424 } 425 425 426 427 426 private void loadAction(DefaultMutableTreeNode node, MenuElement menu) { 428 427 Object userObject = null; -
trunk/src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java
r2337 r2512 6 6 import java.util.LinkedList; 7 7 import java.util.Queue; 8 9 8 10 9 public abstract class AbstractProgressMonitor implements ProgressMonitor { -
trunk/src/org/openstreetmap/josm/gui/progress/NullProgressMonitor.java
r2319 r2512 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.progress; 3 4 3 5 4 public class NullProgressMonitor implements ProgressMonitor { -
trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java
r2338 r2512 17 17 import org.openstreetmap.josm.gui.PleaseWaitDialog; 18 18 import static org.openstreetmap.josm.tools.I18n.tr; 19 20 19 21 20 public class PleaseWaitProgressMonitor extends AbstractProgressMonitor { -
trunk/src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java
r2336 r2512 120 120 void removeCancelListener(CancelListener listener); 121 121 122 123 122 /** 124 123 * Appends a message to the log managed by the progress monitor. 125 * 124 * 126 125 * @param message the log message. Ignored if null or white space only. 127 126 */ -
trunk/src/org/openstreetmap/josm/gui/progress/ProgressRenderer.java
r2025 r2512 5 5 * Swing components can implement this interface and use a {@see SwingRenderingProgressMonitor} 6 6 * to render progress information. 7 * 7 * 8 8 */ 9 9 public interface ProgressRenderer { -
trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java
r2338 r2512 17 17 18 18 /** 19 * 19 * 20 20 * @param delegate the delegate which renders the progress information. Must not be null. 21 21 * @throws IllegalArgumentException thrown if delegate is null 22 * 22 * 23 23 */ 24 24 public SwingRenderingProgressMonitor(ProgressRenderer delegate) { -
trunk/src/org/openstreetmap/josm/gui/tagging/AutoCompletingTextField.java
r2088 r2512 26 26 * AutoCompletingTextField is an text field with autocompletion behaviour. It 27 27 * can be used as table cell editor in {@see JTable}s. 28 * 28 * 29 29 * Autocompletion is controlled by a list of {@see AutoCompletionListItem}s 30 30 * managed in a {@see AutoCompletionList}. 31 * 31 * 32 32 * 33 33 */ … … 43 43 /** 44 44 * inserts a string at a specific position 45 * 45 * 46 46 */ 47 47 @Override … … 110 110 /** 111 111 * creates the default document model for this editor 112 * 112 * 113 113 */ 114 114 @Override … … 160 160 161 161 /** 162 * 162 * 163 163 * @return the auto completion list; may be null, if no auto completion list is set 164 164 */ … … 228 228 } 229 229 230 231 230 public boolean shouldSelectCell(EventObject anEvent) { 232 231 return true; -
trunk/src/org/openstreetmap/josm/gui/tagging/TagCellEditor.java
r2048 r2512 16 16 /** 17 17 * This is the table cell editor for the tag editor dialog. 18 * 18 * 19 19 */ 20 20 @SuppressWarnings("serial") … … 49 49 * values from the the current JOSM data set. Keys already present in the 50 50 * current tag model are removed from the auto completion list. 51 * 51 * 52 52 * @param model the tag editor model 53 53 * @param currentTag the current tag … … 78 78 } 79 79 80 81 80 /** 82 81 * initializes the auto completion list when the cell editor starts to edit … … 84 83 * set of standard values for a given key and the set of values present in the 85 84 * current data set for the given key. 86 * 85 * 87 86 * @param forKey the key 88 87 */ … … 99 98 } 100 99 } 101 102 100 103 101 /** … … 163 161 /** 164 162 * replies the {@link AutoCompletionList} this table cell editor synchronizes with 165 * 163 * 166 164 * @return the auto completion list 167 165 */ … … 195 193 /** 196 194 * sets the tag editor model 197 * 195 * 198 196 * @param tagEditorModel the tag editor model 199 197 */ -
trunk/src/org/openstreetmap/josm/gui/tagging/TagCellRenderer.java
r2040 r2512 17 17 import javax.swing.table.TableCellRenderer; 18 18 19 20 19 /** 21 20 * This is the table cell renderer for cells for the table of tags 22 21 * in the tag editor dialog. 23 * 22 * 24 23 * 25 24 */ … … 49 48 * renders the name of a tag in the second column of 50 49 * the table 51 * 50 * 52 51 * @param tag the tag 53 52 */ … … 59 58 * renders the value of a a tag in the third column of 60 59 * the table 61 * 60 * 62 61 * @param tag the tag 63 62 */ … … 72 71 } 73 72 } 74 75 76 73 77 74 /** … … 93 90 * displays the tag which is suggested by the currently selected 94 91 * preset. 95 * 92 * 96 93 * @param tagModel the tag model 97 94 * @param model the tag editor model … … 101 98 } 102 99 103 104 100 /** 105 101 * replies the cell renderer component for a specific cell 106 * 102 * 107 103 * @param table the table 108 104 * @param value the value to be rendered … … 111 107 * @param rowIndex the row index 112 108 * @param vColIndex the column index 113 * 109 * 114 110 * @return the renderer component 115 111 */ … … 125 121 renderBackgroundColor(getModel(table).get(rowIndex), getModel(table)); 126 122 } 127 128 123 129 124 switch(vColIndex) { -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r2502 r2512 23 23 import org.openstreetmap.josm.data.osm.Tagged; 24 24 25 26 25 /** 27 26 * TagEditorModel is a table model. … … 118 117 } 119 118 120 121 119 public void prepend(TagModel tag) { 122 120 if (tag == null) … … 126 124 fireTableDataChanged(); 127 125 } 128 129 126 130 127 /** … … 154 151 } 155 152 156 157 153 /** 158 154 * replies the tag with name <code>name</code>; null, if no such tag exists … … 174 170 } 175 171 176 177 178 172 @Override public boolean isCellEditable(int row, int col) { 179 173 // all cells are editable 180 174 return true; 181 175 } 182 183 176 184 177 /** … … 220 213 /** 221 214 * Deletes all tags with name <code>name</code> 222 * 215 * 223 216 * @param name the name. Ignored if null. 224 217 */ … … 257 250 } 258 251 259 260 252 /** 261 253 * creates a new tag and appends it to the model … … 372 364 return false; 373 365 } 374 375 366 376 367 protected Command createUpdateTagCommand(Collection<OsmPrimitive> primitives, TagModel tag) { -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java
r2156 r2512 30 30 * a new tag and one for deleting the currently selected tags. 31 31 * 32 * 32 * 33 33 */ 34 34 public class TagEditorPanel extends JPanel { … … 41 41 private AutoCompletionList acList; 42 42 43 44 43 /** 45 44 * builds the panel with the table for editing tags 46 * 45 * 47 46 * @return the panel 48 47 */ … … 60 59 /** 61 60 * builds the panel with the button row 62 * 61 * 63 62 * @return the panel 64 63 */ … … 119 118 /** 120 119 * Replies the tag editor model used by this panel. 121 * 120 * 122 121 * @return the tag editor model used by this panel 123 122 */ … … 152 151 /** 153 152 * The action for deleting the currently selected tags 154 * 153 * 155 154 * 156 155 */ -
trunk/src/org/openstreetmap/josm/gui/tagging/TagModel.java
r2040 r2512 6 6 7 7 public class TagModel { 8 9 /** the name of the tag */ 10 private String name = null; 11 12 /** the list of values */ 13 private ArrayList<String> values = null; 14 15 /** 16 * constructor 17 */ 18 public TagModel() { 19 values = new ArrayList<String>(); 20 setName(""); 21 setValue(""); 22 } 23 24 /** 25 * constructor 26 * @param name the tag name 27 */ 28 public TagModel(String name) { 29 this(); 30 setName(name); 31 } 32 33 /** 34 * constructor 35 * 36 * @param name the tag name 37 * @param value the tag value 38 */ 39 public TagModel(String name, String value) { 40 this(); 41 setName(name); 42 setValue(value); 43 } 44 45 /** 46 * sets the name. Converts name to "" if null. 47 * @param name the tag name 48 */ 49 public void setName(String name) { 50 name = (name == null) ? "" : name; 51 this.name = name; 52 } 53 54 /** 55 * @return the tag name 56 */ 57 public String getName(){ 58 return name; 59 } 60 61 /** 62 * removes all values from the list of values 63 */ 64 public void clearValues() { 65 this.values.clear(); 66 } 67 68 /** 69 * sets a unique value for this tag. Converts value to "", if null. 70 * @param value the value. 71 */ 72 public void setValue(String value) { 73 value = (value == null) ? "" : value; 74 clearValues(); 75 this.values.add(value); 76 } 77 78 /** 79 * 80 * @param value the value to be checked; converted to "" if null 81 * @return true, if the values of this tag include <code>value</code>; false otherwise 82 */ 83 public boolean hasValue(String value) { 84 value = (value == null) ? "" : value; 85 return values.contains(value); 86 } 87 88 public void addValue(String value) { 89 value = (value == null) ? "" : value; 90 if (hasValue(value)) { 91 return; 92 } 93 values.add(value); 94 } 95 96 97 /** 98 * removes a value from the list of values. Converts value to "" if null 99 * @param value the value 100 */ 101 public void removeValue(String value){ 102 value = (value == null) ? "" : value; 103 values.remove(value); 104 } 105 106 public List<String> getValues() { 107 return values; 108 } 109 110 public String getValue() { 111 if (getValueCount() == 0) { 112 return ""; 113 } else if (getValueCount() == 1) { 114 return values.get(0); 115 } else { 116 StringBuilder sb = new StringBuilder(); 117 for (int i =0; i < values.size(); i++) { 118 sb.append(values.get(i)); 119 if (i + 1 < values.size()) { 120 sb.append(";"); 121 } 122 } 123 return sb.toString(); 124 } 125 } 126 127 public int getValueCount() { 128 return values.size(); 129 } 8 9 /** the name of the tag */ 10 private String name = null; 11 12 /** the list of values */ 13 private ArrayList<String> values = null; 14 15 /** 16 * constructor 17 */ 18 public TagModel() { 19 values = new ArrayList<String>(); 20 setName(""); 21 setValue(""); 22 } 23 24 /** 25 * constructor 26 * @param name the tag name 27 */ 28 public TagModel(String name) { 29 this(); 30 setName(name); 31 } 32 33 /** 34 * constructor 35 * 36 * @param name the tag name 37 * @param value the tag value 38 */ 39 public TagModel(String name, String value) { 40 this(); 41 setName(name); 42 setValue(value); 43 } 44 45 /** 46 * sets the name. Converts name to "" if null. 47 * @param name the tag name 48 */ 49 public void setName(String name) { 50 name = (name == null) ? "" : name; 51 this.name = name; 52 } 53 54 /** 55 * @return the tag name 56 */ 57 public String getName(){ 58 return name; 59 } 60 61 /** 62 * removes all values from the list of values 63 */ 64 public void clearValues() { 65 this.values.clear(); 66 } 67 68 /** 69 * sets a unique value for this tag. Converts value to "", if null. 70 * @param value the value. 71 */ 72 public void setValue(String value) { 73 value = (value == null) ? "" : value; 74 clearValues(); 75 this.values.add(value); 76 } 77 78 /** 79 * 80 * @param value the value to be checked; converted to "" if null 81 * @return true, if the values of this tag include <code>value</code>; false otherwise 82 */ 83 public boolean hasValue(String value) { 84 value = (value == null) ? "" : value; 85 return values.contains(value); 86 } 87 88 public void addValue(String value) { 89 value = (value == null) ? "" : value; 90 if (hasValue(value)) { 91 return; 92 } 93 values.add(value); 94 } 95 96 /** 97 * removes a value from the list of values. Converts value to "" if null 98 * @param value the value 99 */ 100 public void removeValue(String value){ 101 value = (value == null) ? "" : value; 102 values.remove(value); 103 } 104 105 public List<String> getValues() { 106 return values; 107 } 108 109 public String getValue() { 110 if (getValueCount() == 0) { 111 return ""; 112 } else if (getValueCount() == 1) { 113 return values.get(0); 114 } else { 115 StringBuilder sb = new StringBuilder(); 116 for (int i =0; i < values.size(); i++) { 117 sb.append(values.get(i)); 118 if (i + 1 < values.size()) { 119 sb.append(";"); 120 } 121 } 122 return sb.toString(); 123 } 124 } 125 126 public int getValueCount() { 127 return values.size(); 128 } 130 129 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java
r2048 r2512 60 60 TagCellRenderer renderer = new TagCellRenderer(); 61 61 62 63 62 // column 0 - tag key 64 63 col = new TableColumn(0); … … 120 119 } 121 120 122 123 121 /** 124 122 * Action to be run when the user navigates to the previous cell in the table, … … 134 132 getCellEditor().stopCellEditing(); 135 133 } 136 137 134 138 135 if (col <= 0 && row <= 0) { … … 206 203 getColumnModel().getSelectionModel().addListSelectionListener(this); 207 204 } 208 209 210 205 211 206 @Override … … 270 265 } 271 266 272 273 267 /** the delete action */ 274 268 private RunnableAction deleteAction = null; … … 364 358 } 365 359 366 367 360 /** 368 361 * @param autoCompletionList … … 414 407 // tblTagEditor.editCellAt(row, col); 415 408 // if (tblTagEditor.getEditorComponent() != null) { 416 // 409 // tblTagEditor.getEditorComponent().requestFocusInWindow(); 417 410 // } 418 411 -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r2302 r2512 151 151 152 152 private JComponent value; 153 154 153 155 154 @Override public boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel) { -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSeparator.java
r2017 r2512 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.gui.tagging; 3 4 3 5 4 public class TaggingPresetSeparator extends TaggingPreset { -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionCache.java
r2381 r2512 67 67 } 68 68 69 70 69 /** the cached tags give by a tag key and a list of values for this tag*/ 71 70 private HashMap<String, Set<String>> tagCache; … … 74 73 /** the layer this cache is built for */ 75 74 private OsmDataLayer layer; 76 77 75 78 76 /** -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPritority.java
r2048 r2512 12 12 IS_IN_STANDARD, 13 13 14 15 14 /** 16 15 * indicates that this is an arbitrary value from the data set, i.e. -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
r2156 r2512 13 13 /** 14 14 * AutoCompletionList manages a list of {@see AutoCompletionListItem}s. 15 * 15 * 16 16 * The list is sorted, items with higher priority first, then according to lexicographic order 17 17 * on the value of the {@see AutoCompletionListItem}. 18 * 18 * 19 19 * AutoCompletionList maintains two views on the list of {@see AutoCompletionListItem}s. 20 20 * <ol> … … 22 22 * <li>a filtered view, which includes only items which match a current filter expression</li> 23 23 * </ol> 24 * 24 * 25 25 * AutoCompletionList is an {@link AbstractTableModel} which serves the list of filtered 26 26 * items to a {@link JTable}. 27 * 27 * 28 28 */ 29 29 public class AutoCompletionList extends AbstractTableModel { … … 47 47 } 48 48 49 50 49 /** 51 50 * applies a filter expression to the list of {@see AutoCompletionListItem}s. 52 * 51 * 53 52 * The matching criterion is a case insensitive substring match. 54 * 53 * 55 54 * @param filter the filter expression; must not be null 56 * 55 * 57 56 * @exception IllegalArgumentException thrown, if filter is null 58 57 */ … … 66 65 /** 67 66 * clears the current filter 68 * 67 * 69 68 */ 70 69 public void clearFilter() { … … 80 79 } 81 80 82 83 81 /** 84 82 * adds an AutoCompletionListItem to the list. Only adds the item if it 85 83 * is not null and if not in the list yet. 86 * 84 * 87 85 * @param item the item 88 86 */ … … 95 93 } 96 94 97 98 95 /** 99 96 * adds another AutoCompletionList to this list. An item is only 100 97 * added it is not null and if it does not exist in the list yet. 101 * 98 * 102 99 * @param other another auto completion list; must not be null 103 100 * @exception IllegalArgumentException thrown, if other is null … … 113 110 } 114 111 115 116 112 /** 117 113 * adds a list of AutoCompletionListItem to this list. Only items which 118 114 * are not null and which do not exist yet in the list are added. 119 * 115 * 120 116 * @param other a list of AutoCompletionListItem; must not be null 121 117 * @exception IllegalArgumentException thrown, if other is null … … 134 130 * adds a list of strings to this list. Only strings which 135 131 * are not null and which do not exist yet in the list are added. 136 * 132 * 137 133 * @param value a list of strings to add 138 134 * @param priority the priority to use … … 171 167 * checks whether a specific item is already in the list. Matches for the 172 168 * the value <strong>and</strong> the priority of the item 173 * 169 * 174 170 * @param item the item to check 175 171 * @return true, if item is in the list; false, otherwise … … 184 180 * checks whether an item with the given value is already in the list. Ignores 185 181 * priority of the items. 186 * 182 * 187 183 * @param value the value of an auto completion item 188 184 * @return true, if value is in the list; false, otherwise … … 246 242 /** 247 243 * replies the number of filtered items 248 * 244 * 249 245 * @return the number of filtered items 250 246 */ … … 257 253 * @param idx the index; must be in the range 0<= idx < {@see #getFilteredSize()} 258 254 * @return the item 259 * 255 * 260 256 * @exception IndexOutOfBoundsException thrown, if idx is out of bounds 261 257 */ … … 266 262 } 267 263 268 269 264 /** 270 265 * removes all elements from the auto completion list 271 * 266 * 272 267 */ 273 268 public void clear() { … … 277 272 } 278 273 279 280 274 public int getColumnCount() { 281 275 return 1; -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionListItem.java
r2048 r2512 4 4 /** 5 5 * Represents an entry in the list of auto completion values. 6 * 6 * 7 7 * An AutoCompletionListItem has a <em>priority</em> and a <em>value</em>. 8 * 8 * 9 9 * The priority helps to sort the auto completion items according to their importance. For instance, 10 10 * in an auto completion list for tag names, standard tag names would be assigned a higher … … 13 13 * 14 14 * The value is a string which will be displayed in the auto completion list. 15 * 15 * 16 16 */ 17 17 public class AutoCompletionListItem implements Comparable<AutoCompletionListItem>{ … … 36 36 37 37 /** 38 * 38 * 39 39 * @return the priority 40 40 */ … … 52 52 53 53 /** 54 * 54 * 55 55 * @return the value 56 56 */ … … 112 112 } 113 113 114 115 114 public int compareTo(AutoCompletionListItem other) { 116 115 int ret = this.priority.compareTo(other.priority); -
trunk/src/org/openstreetmap/josm/gui/widgets/AutoCompleteComboBox.java
r2281 r2512 18 18 */ 19 19 public class AutoCompleteComboBox extends JComboBox { 20 21 20 22 21 private boolean autocompleteEnabled = true; -
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r2327 r2512 12 12 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 13 13 import org.xml.sax.SAXException; 14 15 14 16 15 public class BoundingBoxDownloader extends OsmServerReader { … … 41 40 try { 42 41 progressMonitor.indeterminateSubTask(tr("Contacting OSM Server...")); 43 String url = "trackpoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page="; 42 String url = "trackpoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page="; 44 43 45 44 boolean done = false; -
trunk/src/org/openstreetmap/josm/io/CacheFiles.java
r2016 r2512 175 175 } 176 176 177 178 177 /** 179 178 * Sets the amount of time data is stored before it gets expired -
trunk/src/org/openstreetmap/josm/io/Capabilities.java
r1691 r2512 32 32 * replies the value of configuration item in the capabilities as 33 33 * double value 34 * 34 * 35 35 * @param element the name of the element 36 36 * @param attribute the name of the attribute -
trunk/src/org/openstreetmap/josm/io/CredentialsManager.java
r2015 r2512 5 5 6 6 /** 7 * Manages how username and password are stored. In addition all 7 * Manages how username and password are stored. In addition all 8 8 * username/password-related user interaction is encapsulated here. 9 9 */ 10 10 public interface CredentialsManager { 11 11 enum Key { 12 OSM_SERVER_URL("url"), 13 USERNAME("username"), 12 OSM_SERVER_URL("url"), 13 USERNAME("username"), 14 14 PASSWORD("password"); 15 15 final private String pname; … … 21 21 } 22 22 }; 23 23 24 24 /** 25 25 * Should throw or return non-null, possibly empty String. -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r2359 r2512 182 182 183 183 @Override public void characters(char[] ch, int start, int length) { 184 /** 184 /** 185 185 * Remove illegal characters generated by the Nokia Sports Tracker device. 186 * Don't do this crude substitution for all files, since it would destroy 186 * Don't do this crude substitution for all files, since it would destroy 187 187 * certain unicode characters. 188 188 */ -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r2498 r2512 56 56 static private int MAX_IDS_PER_REQUEST = 200; 57 57 58 59 58 private HashSet<Long> nodes; 60 59 private HashSet<Long> ways; … … 254 253 return pkg; 255 254 } 256 257 255 258 256 /** -
trunk/src/org/openstreetmap/josm/io/MultiPartFormOutputStream.java
r1169 r2512 14 14 list of conditions and the following disclaimer in the documentation and/or other 15 15 materials provided with the distribution. 16 17 16 18 17 Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to … … 43 42 import java.net.URL; 44 43 import java.net.URLConnection; 45 46 44 47 45 /** -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r2480 r2512 296 296 } 297 297 298 299 298 /** 300 299 * Creates a new changeset based on the keys in <code>changeset</code>. If this 301 300 * method succeeds, changeset.getId() replies the id the server assigned to the new 302 301 * changeset 303 * 302 * 304 303 * The changeset must not be null, but its key/value-pairs may be empty. 305 * 304 * 306 305 * @param changeset the changeset toe be created. Must not be null. 307 306 * @param progressMonitor the progress monitor … … 335 334 * @param changeset the changeset to update. Must not be null. 336 335 * @param monitor the progress monitor. If null, uses the {@see NullProgressMonitor#INSTANCE}. 337 * 336 * 338 337 * @throws OsmTransferException if something goes wrong. 339 338 * @throws IllegalArgumentException if changeset is null 340 339 * @throws IllegalArgumentException if changeset.getId() <= 0 341 * 340 * 342 341 */ 343 342 public void updateChangeset(Changeset changeset, ProgressMonitor monitor) throws OsmTransferException { … … 368 367 } 369 368 370 371 369 /** 372 370 * Closes a changeset on the server. Sets changeset.setOpen(false) if this operation … … 375 373 * @param changeset the changeset to be closed. Must not be null. changeset.getId() > 0 required. 376 374 * @param monitor the progress monitor. If null, uses {@see NullProgressMonitor#INSTANCE} 377 * 375 * 378 376 * @throws OsmTransferException if something goes wrong. 379 377 * @throws IllegalArgumentException thrown if changeset is null … … 455 453 /** 456 454 * Replies the max. number of retries in case of 5XX errors on the server 457 * 455 * 458 456 * @return the max number of retries 459 457 */ … … 603 601 } 604 602 605 606 603 /** 607 604 * Ensures that the current changeset can be used for uploading data 608 * 605 * 609 606 * @throws OsmTransferException thrown if the current changeset can't be used for 610 607 * uploading data … … 618 615 /** 619 616 * Replies the changeset data uploads are currently directed to 620 * 617 * 621 618 * @return the changeset data uploads are currently directed to 622 619 */ … … 629 626 * can be null. If it isn't null it must have been created, i.e. id > 0 is required. Furthermore, 630 627 * it must be open. 631 * 628 * 632 629 * @param changeset the changeset 633 630 * @throws IllegalArgumentException thrown if changeset.getId() <= 0 -
trunk/src/org/openstreetmap/josm/io/OsmApiException.java
r2240 r2512 78 78 /** 79 79 * Replies a message suitable to be displayed in a message dialog 80 * 80 * 81 81 * @return a message which is suitable to be displayed in a message dialog 82 82 */ -
trunk/src/org/openstreetmap/josm/io/OsmApiPrimitiveGoneException.java
r2198 r2512 11 11 * Represents an exception thrown by the OSM API if JOSM tries to update or delete a primitive 12 12 * which is already deleted on the server. 13 * 13 * 14 14 */ 15 15 public class OsmApiPrimitiveGoneException extends OsmApiException{ … … 22 22 /** the id of the primitive */ 23 23 private long id; 24 25 24 26 25 public OsmApiPrimitiveGoneException(String errorHeader, String errorBody) { … … 37 36 /** 38 37 * Replies true if we know what primitive this exception was thrown for 39 * 38 * 40 39 * @return true if we know what primitive this exception was thrown for 41 40 */ … … 47 46 * Replies the type of the primitive this exception was thrown for. null, 48 47 * if the type is not known. 49 * 48 * 50 49 * @return the type of the primitive this exception was thrown for 51 50 */ … … 57 56 * Replies the id of the primitive this exception was thrown for. 0, if 58 57 * the id is not known. 59 * 58 * 60 59 * @return the id of the primitive this exception was thrown for 61 60 */ -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r2181 r2512 203 203 /** 204 204 * Parse the given input source and return the list of changesets 205 * 205 * 206 206 * @param source the source input stream 207 207 * @param progressMonitor the progress monitor 208 * 208 * 209 209 * @return the list of changesets 210 210 * @throws IllegalDataException thrown if the an error was found while parsing the data from the source -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r2322 r2512 132 132 /** 133 133 * Replies true if this connection is canceled 134 * 134 * 135 135 * @return true if this connection is canceled 136 136 * @return -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r2498 r2512 50 50 /** 51 51 * Replies the parsed data set 52 * 52 * 53 53 * @return the parsed data set 54 54 */ … … 60 60 * longs too, but in contrast to internal ids negative values are used 61 61 * to identify primitives unknown to the OSM server 62 * 62 * 63 63 * The keys are strings composed as follows 64 64 * <ul> … … 69 69 */ 70 70 private Map<String, OsmPrimitive> externalIdMap = new HashMap<String, OsmPrimitive>(); 71 72 71 73 72 /** … … 171 170 private OsmPrimitiveData current; 172 171 private String generator; 173 174 172 175 173 @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { … … 410 408 } 411 409 412 413 410 /** 414 411 * Processes the ways after parsing. Rebuilds the list of nodes of each way and 415 412 * adds the way to the dataset 416 * 413 * 417 414 * @throws IllegalDataException thrown if a data integrity problem is detected 418 415 */ … … 460 457 * Processes the parsed nodes after parsing. Just adds them to 461 458 * the dataset 462 * 459 * 463 460 */ 464 461 protected void processNodesAfterParsing() { … … 472 469 /** 473 470 * Completes the parsed relations with its members. 474 * 471 * 475 472 * @throws IllegalDataException thrown if a data integrity problem is detected, i.e. if a 476 473 * relation member refers to a local primitive which wasn't available in the data 477 * 474 * 478 475 */ 479 476 private void processRelationsAfterParsing() throws IllegalDataException { … … 545 542 /** 546 543 * Parse the given input source and return the dataset. 547 * 544 * 548 545 * @param source the source input stream 549 546 * @param progressMonitor the progress monitor 550 * 547 * 551 548 * @return the dataset with the parsed data 552 549 * @throws IllegalDataException thrown if the an error was found while parsing the data from the source -
trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java
r2181 r2512 69 69 /** 70 70 * Reads teh changeset with id <code>id</code> from the server 71 * 71 * 72 72 * @param id the changeset id. id > 0 required. 73 73 * @param monitor the progress monitor. Set to {@see NullProgressMonitor#INSTANCE} if null … … 105 105 /** 106 106 * not implemented yet 107 * 107 * 108 108 * @param id 109 109 * @param monitor -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r2181 r2512 135 135 * Returns true if this reader is adding authentication credentials to the read 136 136 * request sent to the server. 137 * 137 * 138 138 * @return true if this reader is adding authentication credentials to the read 139 139 * request sent to the server … … 146 146 * Sets whether this reader adds authentication credentials to the read 147 147 * request sent to the server. 148 * 148 * 149 149 * @param doAuthenticate true if this reader adds authentication credentials to the read 150 150 * request sent to the server -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r2273 r2512 64 64 /** 65 65 * Uploads the changes individually. Invokes one API call per uploaded primitmive. 66 * 66 * 67 67 * @param primitives the collection of primitives to upload 68 68 * @param progressMonitor the progress monitor … … 106 106 /** 107 107 * Upload all changes in one diff upload 108 * 108 * 109 109 * @param primitives the collection of primitives to upload 110 110 * @param progressMonitor the progress monitor … … 193 193 /** 194 194 * Replies the collection of successfully processed primitives 195 * 195 * 196 196 * @return the collection of successfully processed primitives 197 197 */ -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r2358 r2512 274 274 } 275 275 } 276 -
trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java
r2372 r2512 300 300 if (!name_lc.contains(lc_bit) && 301 301 !description_lc.contains(lc_bit) && 302 !remoteversion_lc.contains(lc_bit) && 302 !remoteversion_lc.contains(lc_bit) && 303 303 !localversion_lc.contains(lc_bit)) { 304 304 canHas = false; -
trunk/src/org/openstreetmap/josm/tools/CopyList.java
r1862 r2512 98 98 } 99 99 100 101 100 // speed optimizations: 102 101 public @Override boolean add(E element) { -
trunk/src/org/openstreetmap/josm/tools/DateParser.java
r1169 r2512 4 4 import java.text.ParseException; 5 5 import java.util.Date; 6 7 6 8 7 /** -
trunk/src/org/openstreetmap/josm/tools/DateUtils.java
r1724 r2512 29 29 import javax.xml.datatype.DatatypeFactory; 30 30 import javax.xml.datatype.XMLGregorianCalendar; 31 32 31 33 32 /** -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r2480 r2512 46 46 * Explains a precondition exception when a child relation could not be deleted because 47 47 * it is still referred to by an undeleted parent relation. 48 * 48 * 49 49 * @param e the exception 50 50 * @param childRelation the child relation … … 142 142 * Explains an exception thrown during upload because the changeset which data is 143 143 * uploaded to is already closed. 144 * 144 * 145 145 * @param e the exception 146 146 */ … … 160 160 /** 161 161 * Explains an exception with a generic message dialog 162 * 162 * 163 163 * @param e the exception 164 164 */ … … 176 176 * This is most likely happening when user tries to access the OSM API from within an 177 177 * applet which wasn't loaded from the API server. 178 * 178 * 179 179 * @param e the exception 180 180 */ … … 199 199 * This is most likely because there's not connection to the Internet or because 200 200 * the remote server is not reachable. 201 * 201 * 202 202 * @param e the exception 203 203 */ … … 215 215 * This is most likely happening when the communication with the remote server is 216 216 * interrupted for any reason. 217 * 217 * 218 218 * @param e the exception 219 219 */ … … 232 232 * Explains a {@see OsmApiException} which was thrown because of an internal server 233 233 * error in the OSM API server.. 234 * 234 * 235 235 * @param e the exception 236 236 */ … … 247 247 * Explains a {@see OsmApiException} which was thrown because of a bad 248 248 * request 249 * 249 * 250 250 * @param e the exception 251 251 */ … … 267 267 /** 268 268 * Explains a {@see OsmApiException} which was thrown because a resource wasn't found. 269 * 269 * 270 270 * @param e the exception 271 271 */ … … 286 286 * This is most likely happening when there is an error in the API URL or when 287 287 * local DNS services are not working. 288 * 288 * 289 289 * @param e the exception 290 290 */ … … 309 309 * Replies the first nested exception of type <code>nestedClass</code> (including 310 310 * the root exception <code>e</code>) or null, if no such exception is found. 311 * 311 * 312 312 * @param <T> 313 313 * @param e the root exception … … 330 330 /** 331 331 * Explains an {@see OsmTransferException} to the user. 332 * 332 * 333 333 * @param e the {@see OsmTransferException} 334 334 */ … … 383 383 /** 384 384 * Explains an {@see Exception} to the user. 385 * 385 * 386 386 * @param e the {@see Exception} 387 387 */ -
trunk/src/org/openstreetmap/josm/tools/FallbackDateParser.java
r1169 r2512 7 7 import java.util.Date; 8 8 import java.util.List; 9 10 9 11 10 /** … … 34 33 }; 35 34 36 37 35 private List<DateFormat> dateParsers; 38 36 private int activeDateParser; 39 40 37 41 38 /** … … 52 49 activeDateParser = -1; 53 50 } 54 55 51 56 52 /** -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r2358 r2512 135 135 * Sets the default locale (see {@see Locale#setDefault(Locale)} to the local 136 136 * given by <code>localName</code>. 137 * 137 * 138 138 * Ignored if localName is null. If the locale with name <code>localName</code> 139 139 * isn't found the default local is set to <tt>en</tt> (english). 140 * 140 * 141 141 * @param localeName the locale name. Ignored if null. 142 142 */ -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r2181 r2512 61 61 /** 62 62 * Return an image from the specified location. 63 * 63 * 64 64 * @param subdir The position of the directory, e.g. "layer" 65 65 * @param name The icons name (without the ending of ".png") … … 277 277 /** 278 278 * Creates a rotated version of the input image. 279 * 279 * 280 280 * @param c The component to get properties useful for painting, e.g. the foreground or 281 281 * background color. … … 283 283 * @param rotatedAngle the rotated angle, in degree, clockwise. It could be any double but we 284 284 * will mod it with 360 before using it. 285 * 285 * 286 286 * @return the image after rotating. 287 287 */ -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r2308 r2512 11 11 * prefix has the form 'Xy:' where 'Xy' is a ISO 639 language code in title 12 12 * case. 13 * 13 * 14 14 * @param locale the locale 15 15 * @return the wiki language prefix … … 30 30 /** 31 31 * Replies the wiki language prefix for the current locale. 32 * 32 * 33 33 * @return the wiki language prefix 34 34 * @see Locale#getDefault() … … 41 41 /** 42 42 * Replies the JOSM locale code for the default locale. 43 * 43 * 44 44 * @return the JOSM locale code for the default locale 45 45 * @see #getJOSMLocaleCode(Locale) … … 51 51 /** 52 52 * Replies the local code used by JOSM for a given locale. 53 * 53 * 54 54 * In most cases JOSM uses the 2-character ISO 639 language code ({@see Locale#getLanguage()} 55 55 * to identify the locale of a localized resource, but in some cases it may use the 56 56 * programmatic name for locales, as replied by {@see Locale#toString()}. 57 * 57 * 58 58 * @param locale the locale. Replies "en" if null. 59 59 * @return the JOSM code for the given locale … … 71 71 } 72 72 73 74 73 static public String getLanguageCodeXML() 75 74 { -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r2327 r2512 8 8 9 9 public class OsmUrlToBounds { 10 10 11 11 public static Bounds parse(String url) { 12 12 int i = url.indexOf('?'); -
trunk/src/org/openstreetmap/josm/tools/PresetTextComparator.java
r1677 r2512 11 11 } 12 12 13 14 13 } -
trunk/src/org/openstreetmap/josm/tools/PrimaryDateParser.java
r1169 r2512 9 9 import javax.xml.datatype.DatatypeConfigurationException; 10 10 import javax.xml.datatype.DatatypeFactory; 11 12 11 13 12 /** … … 23 22 private Calendar calendar; 24 23 25 26 24 /** 27 25 * Creates a new instance. … … 41 39 } 42 40 43 44 41 private boolean isDateInShortStandardFormat(String date) { 45 42 char[] dateChars; … … 109 106 } 110 107 111 112 108 private boolean isDateInLongStandardFormat(String date) { 113 109 char[] dateChars; … … 184 180 return true; 185 181 } 186 187 182 188 183 private Date parseShortStandardDate(String date) { … … 211 206 return calendar.getTime(); 212 207 } 213 214 208 215 209 private Date parseLongStandardDate(String date) { … … 241 235 return calendar.getTime(); 242 236 } 243 244 237 245 238 /** -
trunk/src/org/openstreetmap/josm/tools/UrlLabel.java
r2318 r2512 51 51 * Sets the URL to be visited if the user clicks on this URL label. If null, the 52 52 * label turns into a normal label without hyperlink. 53 * 53 * 54 54 * @param url the url. Can be null. 55 55 */ … … 61 61 /** 62 62 * Sets the text part of the URL label. Defaults to the empty string if description is null. 63 * 63 * 64 64 * @param description the description 65 65 */ -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r2308 r2512 14 14 /** 15 15 * Read a trac-wiki page. 16 * 16 * 17 17 * @author imi 18 18 */ … … 31 31 /** 32 32 * Read the page specified by the url and return the content. 33 * 33 * 34 34 * If the url is within the baseurl path, parse it as an trac wikipage and replace relative 35 35 * pathes etc.. 36 * 36 * 37 37 * @return 38 38 * @throws IOException Throws, if the page could not be loaded. -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r2384 r2512 20 20 * This is a helper class for persisting the geometry of a JOSM window to the preference store 21 21 * and for restoring it from the preference store. 22 * 22 * 23 23 */ 24 24 public class WindowGeometry { … … 27 27 * Replies a window geometry object for a window with a specific size which is 28 28 * centered on screen 29 * 29 * 30 30 * @param extent the size 31 31 * @return the geometry object … … 42 42 * Replies a window geometry object for a window which a specific size which is centered 43 43 * relative to a parent window 44 * 44 * 45 45 * @param parent the parent window 46 46 * @param extent the size … … 60 60 /** 61 61 * Exception thrown by the WindowGeometry class if something goes wrong 62 * 62 * 63 63 */ 64 64 static public class WindowGeometryException extends Exception { … … 78 78 79 79 /** 80 * 80 * 81 81 * @param topLeft the top left point 82 82 * @param extent the extent … … 89 89 /** 90 90 * Creates a window geometry from the position and the size of a window. 91 * 91 * 92 92 * @param window the window 93 93 */ … … 134 134 * Creates a window geometry from the values kept in the preference store under the 135 135 * key <code>preferenceKey</code> 136 * 136 * 137 137 * @param preferenceKey the preference key 138 138 * @throws WindowGeometryException thrown if no such key exist or if the preference value has … … 147 147 * key <code>preferenceKey</code>. Falls back to the <code>defaultGeometry</code> if 148 148 * something goes wrong. 149 * 149 * 150 150 * @param preferenceKey the preference key 151 151 * @param defaultGeometry the default geometry 152 * 152 * 153 153 */ 154 154 public WindowGeometry(String preferenceKey, WindowGeometry defaultGeometry) { … … 163 163 /** 164 164 * Remembers a window geometry under a specific preference key 165 * 165 * 166 166 * @param preferenceKey the preference key 167 167 */ … … 177 177 /** 178 178 * Replies the top left point for the geometry 179 * 179 * 180 180 * @return the top left point for the geometry 181 181 */ … … 186 186 /** 187 187 * Replies the size spezified by the geometry 188 * 188 * 189 189 * @return the size spezified by the geometry 190 190 */ … … 195 195 /** 196 196 * Applies this geometry to a window 197 * 197 * 198 198 * @param window the window 199 199 */ … … 206 206 * Applies this geometry to a window. Makes sure that the window is not placed outside 207 207 * of the coordinate range of the current screen. 208 * 208 * 209 209 * @param window the window 210 210 */
Note:
See TracChangeset
for help on using the changeset viewer.