Changeset 5863 in josm for trunk/src/org
- Timestamp:
- 2013-04-14T22:20:20+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/DiffTableModel.java
r5627 r5863 10 10 11 11 /** 12 * Simple model storing "diff cells" in a list. Could probably have used a DefaultTableModel instead.. 13 * 14 * {@link NodeListDiffTableCellRenderer} 12 * Simple model storing "diff cells" in a list. Could probably have 13 * used a {@link javax.swing.table.DefaultTableModel} instead. 15 14 */ 16 15 class DiffTableModel extends AbstractTableModel { -
trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java
r5859 r5863 61 61 * Creates a new task 62 62 * 63 * @param parent the component to be used as reference to find the parent for {@link PleaseWaitDialog}. 64 * Must not be null. 65 * @throws IllegalArgumentException thrown if parent is null 63 * @param parent the component to be used as reference to find the 64 * parent for {@link org.openstreetmap.josm.gui.PleaseWaitDialog}. 65 * Must not be <code>null</code>. 66 * @throws IllegalArgumentException thrown if parent is <code>null</code> 66 67 */ 67 68 public HistoryLoadTask(Component parent) { … … 142 143 * Adds a collection of objects to loaded, specified by a collection of OSM primitives. 143 144 * 144 * @param primitive the OSM primitive. Must not be null. primitive.getId() > 0 required. 145 * @return this task 146 * @throws IllegalArgumentException thrown if primitives is null 147 * @throws IllegalArgumentException thrown if one of the ids in the collection <= 0 145 * @param primitives the OSM primitives. Must not be <code>null</code>. 146 * <code>primitive.getId() > 0</code> required. 147 * @return this task 148 * @throws IllegalArgumentException thrown if primitives is <code>null</code> 149 * @throws IllegalArgumentException thrown if one of the ids in the collection <= 0 148 150 */ 149 151 public HistoryLoadTask add(Collection<? extends OsmPrimitive> primitives) { … … 160 162 @Override 161 163 protected void cancel() { 162 System.out.println("Cancel!"); 163 if (reader!=null) reader.cancel(); 164 if (reader != null) { 165 reader.cancel(); 166 } 164 167 canceled = true; 165 168 } -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r5859 r5863 53 53 54 54 /** 55 * Imports OSM data from file @param file 56 * This method supports progress monitoring and canceling by using @param progressMonitor 55 * Imports OSM data from file 56 * @param file file to read data from 57 * @param progressMonitor handler for progress monitoring and canceling 57 58 */ 58 59 @Override … … 73 74 74 75 /** 75 * Imports OSM data from stream @param in , sitle will be generated from name of file @param associatedFile 76 * Imports OSM data from stream 77 * @param in input stream 78 * @param associatedFile filename of data 76 79 */ 77 80 protected void importData(InputStream in, final File associatedFile) throws IllegalDataException { … … 80 83 81 84 /** 82 * Imports OSM data from stream @param in , layer name will be generated from name of file @param associatedFile 83 * This method supports progress monitoring and canceling by using @param progressMonitor 85 * Imports OSM data from stream 86 * @param in input stream 87 * @param associatedFile filename of data (layer name will be generated from name of file) 88 * @param pm handler for progress monitoring and canceling 84 89 */ 85 90 protected void importData(InputStream in, final File associatedFile, ProgressMonitor pm) throws IllegalDataException { … … 100 105 /** 101 106 * Load osm data layer from InputStream. 102 * associatedFile can be null if the stream does not come from a file. 107 * @param in input stream 108 * @param associatedFile filename of data (can be <code>null</code> if the stream does not come from a file) 109 * @param layerName name of generated layer 110 * @param progressMonitor handler for progress monitoring and canceling 103 111 */ 104 112 public OsmImporterData loadLayer(InputStream in, final File associatedFile, final String layerName, ProgressMonitor progressMonitor) throws IllegalDataException { -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r5587 r5863 38 38 * Open a connection to the given url and return a reader on the input stream 39 39 * from that connection. In case of user cancel, return <code>null</code>. 40 * @param urlStr The exact url to connect to. 41 * @param pleaseWaitDlg 40 * Relative URL's are directed to API base URL. 41 * @param urlStr The url to connect to. 42 * @param progressMonitor progress monitoring and abort handler 42 43 * @return An reader reading the input stream (servers answer) or <code>null</code>. 44 * @throws OsmTransferException thrown if data transfer errors occur 43 45 */ 44 46 protected InputStream getInputStream(String urlStr, ProgressMonitor progressMonitor) throws OsmTransferException { … … 52 54 } 53 55 56 /** 57 * Retrun the base URL for relative URL requests 58 * @return base url of API 59 */ 54 60 protected String getBaseUrl() { 55 61 return api.getBaseUrl(); 56 62 } 57 63 64 /** 65 * Open a connection to the given url and return a reader on the input stream 66 * from that connection. In case of user cancel, return <code>null</code>. 67 * @param urlStr The exact url to connect to. 68 * @param progressMonitor progress monitoring and abort handler 69 * @return An reader reading the input stream (servers answer) or <code>null</code>. 70 * @throws OsmTransferException thrown if data transfer errors occur 71 */ 58 72 protected InputStream getInputStreamRaw(String urlStr, ProgressMonitor progressMonitor) throws OsmTransferException { 59 73 try { -
trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java
r5692 r5863 15 15 16 16 /** 17 * @see CredentialsAgent#getCredentials (RequestorType, String, boolean)17 * @see CredentialsAgent#getCredentials 18 18 */ 19 19 @Override -
trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java
r5111 r5863 25 25 26 26 /** 27 * @see CredentialsAgent#lookup (RequestorType)27 * @see CredentialsAgent#lookup 28 28 */ 29 29 @Override … … 59 59 60 60 /** 61 * @see CredentialsAgent#store (RequestorType, PasswordAuthentication)61 * @see CredentialsAgent#store 62 62 */ 63 63 @Override -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r4534 r5863 626 626 } 627 627 628 /** Mark to be discarded each line that matches no line of another file. 629 If a line matches many lines, mark it as provisionally discardable. 630 @see equivCount() 631 @param counts The count of each equivalence number for the other file. 632 @return 0=nondiscardable, 1=discardable or 2=provisionally discardable 633 for each line 628 /** 629 * Mark to be discarded each line that matches no line of another file. 630 * If a line matches many lines, mark it as provisionally discardable. 631 * @see #equivCount() 632 * @param counts The count of each equivalence number for the other file. 633 * @return 0=nondiscardable, 1=discardable or 2=provisionally discardable 634 * for each line 634 635 */ 635 636 636 private byte[] discardable(final int[] counts) { 637 637 final int end = buffered_lines; … … 642 642 643 643 /* Multiply MANY by approximate square root of number of lines. 644 That is the threshold for provisionally discardable lines. */644 That is the threshold for provisionally discardable lines. */ 645 645 while ((tem = tem >> 2) > 0) { 646 646 many *= 2; … … 663 663 } 664 664 665 /** Don't really discard the provisional lines except when they occur 666 in a run of discardables, with nonprovisionals at the beginning 667 and end. */ 668 665 /** 666 * Don't really discard the provisional lines except when they occur 667 * in a run of discardables, with nonprovisionals at the beginning 668 * and end. 669 */ 669 670 private void filterDiscards(final byte[] discards) { 670 671 final int end = buffered_lines; -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r5830 r5863 341 341 /** 342 342 * {@code data:[<mediatype>][;base64],<data>} 343 * @see RFC2397343 * @see <a href="http://tools.ietf.org/html/rfc2397">RFC2397</a> 344 344 */ 345 345 private static final Pattern dataUrlPattern = Pattern.compile( -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r5460 r5863 89 89 90 90 /** 91 * p91 * Parse OSM short link 92 92 * 93 93 * @param url string for parsing 94 *95 94 * @return Bounds if shortlink, null otherwise 96 * 97 * @see http://trac.openstreetmap.org/browser/sites/rails_port/lib/short_link.rb 95 * @see <a href="http://trac.openstreetmap.org/browser/sites/rails_port/lib/short_link.rb">short_link.rb</a> 98 96 */ 99 97 private static Bounds parseShortLink(final String url) { … … 146 144 } 147 145 146 /** radius of the earth */ 148 147 public static final double R = 6378137.0; 149 148 … … 185 184 } 186 185 186 /** 187 * Return OSM Zoom level for a given area 188 * 189 * @param b bounds of the area 190 * @return matching zoom level for area 191 */ 187 192 static public int getZoom(Bounds b) { 188 193 // convert to mercator (for calculation of zoom only) … … 201 206 } 202 207 208 /** 209 * Return OSM URL for given area 210 * 211 * @param b bounds of the area 212 * @return link to display that area in OSM map 213 */ 203 214 static public String getURL(Bounds b) { 204 215 return getURL(b.getCenter(), getZoom(b)); 205 216 } 206 217 218 /** 219 * Return OSM URL for given position and zoom 220 * 221 * @param pos center position of area 222 * @param zoom zoom depth of display 223 * @return link to display that area in OSM map 224 */ 207 225 static public String getURL(LatLon pos, int zoom) { 208 226 // Truncate lat and lon to something more sensible
Note:
See TracChangeset
for help on using the changeset viewer.