Changeset 8926 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-10-22T02:01:00+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r8509 r8926 10 10 import java.util.Collection; 11 11 import java.util.List; 12 import java.util.concurrent.CancellationException; 13 import java.util.concurrent.ExecutionException; 12 14 import java.util.concurrent.Future; 13 15 … … 91 93 * This functions calculates the rectangles, asks the user to continue and downloads 92 94 * the areas if applicable. 95 * 96 * @param a download area hull 97 * @param maxArea maximum area size for a single download 98 * @param osmDownload Set to true if OSM data should be downloaded 99 * @param gpxDownload Set to true if GPX data should be downloaded 100 * @param title the title string for the confirmation dialog 101 * @param progressMonitor the progress monitor 93 102 */ 94 103 protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title, -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r8919 r8926 930 930 931 931 /** 932 * This is a method splits way into smaller parts, using the prepared nodes list as split points. 932 * This is a method that splits way into smaller parts, using the prepared nodes list as split points. 933 933 * Uses {@link SplitWayAction#splitWay} for the heavy lifting. 934 * @param way way to split 935 * @param nodes split points 934 936 * @return list of split ways (or original ways if no splitting is done). 935 937 */ … … 1142 1144 * This method checks if polygons have several touching parts and splits them in several polygons. 1143 1145 * @param polygons the polygons to process. 1146 * @return the resulting list of polygons 1144 1147 */ 1145 1148 public static List<AssembledPolygon> fixTouchingPolygons(List<AssembledPolygon> polygons) { -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r8855 r8926 245 245 * - The same for vertical segments. 246 246 * 5. Rotate back. 247 * 247 * @throws InvalidUserInputException if selected ways have an angle different from 90 or 180 degrees 248 248 **/ 249 249 private static Collection<Command> orthogonalize(List<WayData> wayDataList, List<Node> headingNodes) throws InvalidUserInputException { … … 536 536 * Recognize angle to be approximately 0, 90, 180 or 270 degrees. 537 537 * returns an integral value, corresponding to a counter clockwise turn: 538 * @throws RejectedAngleException in case of invalid angle 538 539 */ 539 540 private static int angleToDirectionChange(double a, double deltaMax) throws RejectedAngleException { -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r8924 r8926 837 837 /** 838 838 * Called after every put. In case of a problem, do nothing but output the error in log. 839 * @throws IOException if any I/O error occurs 839 840 */ 840 841 public void save() throws IOException { -
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r8836 r8926 113 113 * 114 114 * @return the option selected by user. {@link JOptionPane#CLOSED_OPTION} if the dialog was closed. 115 * @throws HeadlessException if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code> 115 116 */ 116 117 public static int showOptionDialog(String preferenceKey, Component parent, Object message, String title, int optionType, … … 153 154 * 154 155 * @return true, if the selected option is equal to <code>trueOption</code>, otherwise false. 156 * @throws HeadlessException if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code> 155 157 * 156 158 * @see JOptionPane#INFORMATION_MESSAGE -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r8863 r8926 198 198 /** 199 199 * Called from the XML parser to set the types this preset affects. 200 * @throws SAXException if any SAX error occurs 200 201 */ 201 202 public void setType(String types) throws SAXException { -
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r8846 r8926 128 128 /** 129 129 * Parse the given input source and return the dataset. 130 * @throws IllegalDataException if an error was found while parsing the OSM data 130 131 * 131 132 * @see OsmReader#parseDataSet(InputStream, ProgressMonitor) -
trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
r8840 r8926 60 60 * executed in the current thread. 61 61 * @return the data to cache 62 * @throws T a {@link Throwable} 62 63 */ 63 64 protected abstract byte[] updateData() throws T; … … 175 176 /** 176 177 * Tries to load the data using the given ident from disk. If this fails, data will be updated, unless run in offline mode 178 * @throws T a {@link Throwable} 177 179 */ 178 180 private void loadFromDisk() throws T { -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r8846 r8926 877 877 } 878 878 879 /** Method for parsing API responses for operations on individual notes */ 879 /** 880 * Method for parsing API responses for operations on individual notes 881 * @param xml the API response as XML data 882 * @return the resulting Note 883 * @throws OsmTransferException if the API response cannot be parsed 884 */ 880 885 private Note parseSingleNote(String xml) throws OsmTransferException { 881 886 try { -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r8855 r8926 84 84 * @param associatedFile filename of data (layer name will be generated from name of file) 85 85 * @param pm handler for progress monitoring and canceling 86 * @throws IllegalDataException if an error was found while parsing the OSM data 86 87 */ 87 88 protected void importData(InputStream in, final File associatedFile, ProgressMonitor pm) throws IllegalDataException { … … 112 113 * @param layerName name of generated layer 113 114 * @param progressMonitor handler for progress monitoring and canceling 115 * @throws IllegalDataException if an error was found while parsing the OSM data 114 116 */ 115 117 public OsmImporterData loadLayer(InputStream in, final File associatedFile, final String layerName, ProgressMonitor progressMonitor) -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r8846 r8926 398 398 * This is basically the same code as parseUnknown(), except for the warnings, which 399 399 * are displayed for inner elements and not at top level. 400 * @throws XMLStreamException if there is an error processing the underlying XML source 400 401 */ 401 402 private void jumpToEnd(boolean printWarning) throws XMLStreamException { … … 430 431 /** 431 432 * Read out the common attributes and put them into current OsmPrimitive. 433 * @throws XMLStreamException if there is an error processing the underlying XML source 432 434 */ 433 435 private void readCommon(PrimitiveData current) throws XMLStreamException { -
trunk/src/org/openstreetmap/josm/io/UTFInputStreamReader.java
r8510 r8926 16 16 * Creates a new {@link InputStreamReader} from the {@link InputStream} with UTF-8 as default encoding. 17 17 * @return A reader with the correct encoding. Starts to read after the BOM. 18 * @throws IOException if any I/O error occurs 18 19 * @see #create(java.io.InputStream, String) 19 20 */ … … 26 27 * @param defaultEncoding Used, when no BOM was recognized. Can be null. 27 28 * @return A reader with the correct encoding. Starts to read after the BOM. 29 * @throws IOException if any I/O error occurs 28 30 */ 29 31 public static UTFInputStreamReader create(InputStream input, String defaultEncoding) throws IOException { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r8840 r8926 134 134 * @param algorithm the signing algorithm, eg "SHA256withRSA" 135 135 * @param san SubjectAlternativeName extension (optional) 136 * @return the self-signed X.509 Certificate 137 * @throws GeneralSecurityException if any security error occurs 138 * @throws IOException if any I/O error occurs 136 139 */ 137 140 private static X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm, String san) 138 141 throws GeneralSecurityException, IOException { 139 PrivateKey privkey = pair.getPrivate();140 142 X509CertInfo info = new X509CertInfo(); 141 143 Date from = new Date(); … … 193 195 194 196 // Sign the cert to identify the algorithm that's used. 197 PrivateKey privkey = pair.getPrivate(); 195 198 X509CertImpl cert = new X509CertImpl(info); 196 199 cert.sign(privkey, algorithm); -
trunk/src/org/openstreetmap/josm/io/session/SessionLayerExporter.java
r5391 r8926 6 6 import java.util.Collection; 7 7 8 import org.w3c.dom.Element;9 10 8 import org.openstreetmap.josm.gui.layer.Layer; 11 9 import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport; 10 import org.w3c.dom.Element; 12 11 13 12 public interface SessionLayerExporter { … … 15 14 /** 16 15 * Return the Layers, this Layer depends on. 16 * @return the layer dependencies 17 17 */ 18 18 Collection<Layer> getDependencies(); … … 20 20 /** 21 21 * The GUI for exporting this layer. 22 * @return the export panel 22 23 */ 23 24 Component getExportPanel(); 24 25 25 26 /** 26 * Return true, if the layer should be included in the 27 * list of exported layers. 27 * Return true, if the layer should be included in the list of exported layers. 28 28 * 29 29 * The user can veto this in the export panel. 30 * @return {@code true} if the layer should be included in the list of exported layers, {@code false} otherwise. 30 31 */ 31 32 boolean shallExport(); 32 33 33 34 /** 34 * Return true, if some data needs to be included in 35 * the zip archive. This decision depends on the user 35 * Return true, if some data needs to be included in the zip archive. This decision depends on the user 36 36 * selection in the export panel. 37 37 * 38 * If any layer requires zip, the user can only save as 39 * .joz. Otherwise both .jos and .joz are possible.38 * If any layer requires zip, the user can only save as .joz. Otherwise both .jos and .joz are possible. 39 * @return {@code true} if some data needs to be included in the zip archive, {@code false} otherwise. 40 40 */ 41 41 boolean requiresZip(); … … 44 44 * Save meta data to the .jos file. Return a layer XML element. 45 45 * Use <code>support</code> to save files in the zip archive as needed. 46 * @param support support class providing export utilities 47 * @return the resulting XML element 48 * @throws IOException if any I/O error occurs 46 49 */ 47 50 Element export(ExportSupport support) throws IOException; 48 49 51 } 50 -
trunk/src/org/openstreetmap/josm/io/session/SessionLayerImporter.java
r4668 r8926 4 4 import java.io.IOException; 5 5 6 import org.w3c.dom.Element;7 8 6 import org.openstreetmap.josm.gui.layer.Layer; 9 7 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 10 8 import org.openstreetmap.josm.io.IllegalDataException; 11 9 import org.openstreetmap.josm.io.session.SessionReader.ImportSupport; 10 import org.w3c.dom.Element; 12 11 13 12 public interface SessionLayerImporter { 13 14 14 /** 15 15 * Load the layer from xml meta-data. 16 * @param elem XML element 17 * @param support support class providing import utilities 18 * @param progressMonitor progress monitor 19 * @return the resulting layer 20 * @throws IOException if any I/O error occurs 21 * @throws IllegalDataException if invalid data is read 16 22 */ 17 23 Layer load(Element elem, ImportSupport support, ProgressMonitor progressMonitor) throws IOException, IllegalDataException; -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r8850 r8926 196 196 * Returns null if the URI points to a file inside the zip archive. 197 197 * In this case, inZipPath will be set to the corresponding path. 198 * @param uriStr the URI as string 199 * @return the resulting File 200 * @throws IOException if any I/O error occurs 198 201 */ 199 202 public File getFile(String uriStr) throws IOException { -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r8836 r8926 142 142 * @return the OutputStream you can write to. Never close the returned 143 143 * output stream, but make sure to flush buffers. 144 * @throws IOException if any I/O error occurs 144 145 */ 145 146 public OutputStream getOutputStreamZip(String zipPath) throws IOException { -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r8840 r8926 83 83 along with this program; if not, write to the Free Software 84 84 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 85 86 85 */ 87 88 86 public class Diff { 89 87 … … 94 92 be needed again later to print the results of the comparison as 95 93 an edit script, if desired. 94 * @param a first array 95 * @param b second array 96 96 */ 97 97 public Diff(Object[] a, Object[] b) { -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r8924 r8926 222 222 223 223 /** 224 * return the modulus in the range [0, n) 224 * Return the modulus in the range [0, n) 225 * @param a dividend 226 * @param n divisor 227 * @return modulo (remainder of the Euclidian division of a by n) 225 228 */ 226 229 public static int mod(int a, int n) { -
trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java
r8811 r8926 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.tools.template_engine; 3 4 3 5 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 15 14 import org.openstreetmap.josm.tools.template_engine.Tokenizer.TokenType; 16 15 17 16 /** 17 * Template parser. 18 */ 18 19 public class TemplateParser { 19 20 private final Tokenizer tokenizer; … … 22 23 private static final Collection<TokenType> CONDITION_WITH_APOSTROPHES_END_TOKENS = Arrays.asList(TokenType.APOSTROPHE); 23 24 25 /** 26 * Constructs a new {@code TemplateParser}. 27 * @param template template to parse 28 */ 24 29 public TemplateParser(String template) { 25 30 this.tokenizer = new Tokenizer(template); … … 34 39 } 35 40 41 /** 42 * Parse the template. 43 * @return the resulting template entry 44 * @throws ParseError if the template cannot be parsed 45 */ 36 46 public TemplateEntry parse() throws ParseError { 37 47 return parseExpression(EXPRESSION_END_TOKENS); … … 91 101 result.getEntries().add(new SearchExpressionCondition( 92 102 SearchCompiler.compile(searchExpression.getText()), condition)); 93 } catch ( org.openstreetmap.josm.actions.search.SearchCompiler.ParseError e) {103 } catch (SearchCompiler.ParseError e) { 94 104 throw new ParseError(searchExpression.getPosition(), e); 95 105 } … … 121 131 Match match = SearchCompiler.compile(searchExpression.getText()); 122 132 result = new ContextSwitchTemplate(match, template, searchExpression.getPosition()); 123 } catch ( org.openstreetmap.josm.actions.search.SearchCompiler.ParseError e) {133 } catch (SearchCompiler.ParseError e) { 124 134 throw new ParseError(searchExpression.getPosition(), e); 125 135 } … … 129 139 return result; 130 140 } 131 132 141 }
Note:
See TracChangeset
for help on using the changeset viewer.