Changeset 6069 in josm for trunk/src/org
- Timestamp:
- 2013-07-17T00:01:07+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 117 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r5886 r6069 100 100 panel.setPreferredSize(new Dimension(600, 300)); 101 101 panel.add(about, GBC.std().fill()); 102 102 103 103 GuiHelper.prepareResizeableOptionPane(panel, panel.getPreferredSize()); 104 104 JOptionPane.showMessageDialog(Main.parent, panel, tr("About JOSM..."), -
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r6000 r6069 113 113 return null; 114 114 } 115 115 116 116 protected boolean isLayerAlreadyPresent() { 117 117 if (Main.isDisplayingMapView()) { -
trunk/src/org/openstreetmap/josm/actions/AddNodeAction.java
r5926 r6069 44 44 45 45 dialog.showDialog(); 46 46 47 47 if (dialog.getValue() != 1) 48 48 return; -
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r5719 r6069 240 240 setEnabled(selection != null && !selection.isEmpty()); 241 241 } 242 242 243 243 /** 244 244 * Determines if a regular polygon is allowed to be created with the given nodes collection. -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r6009 r6069 47 47 marktr("previous"), 48 48 marktr("next")}; 49 49 50 50 private final String mode; 51 51 … … 123 123 public AutoScaleAction(final String mode) { 124 124 super(tr("Zoom to {0}", tr(mode)), "dialogs/autoscale/" + mode, tr("Zoom the view to {0}.", tr(mode)), 125 Shortcut.registerShortcut("view:zoom"+mode, tr("View: {0}", tr("Zoom to {0}", tr(mode))), getModeShortcut(mode), Shortcut.DIRECT), 125 Shortcut.registerShortcut("view:zoom"+mode, tr("View: {0}", tr("Zoom to {0}", tr(mode))), getModeShortcut(mode), Shortcut.DIRECT), 126 126 true, null, false); 127 127 String modeHelp = Character.toUpperCase(mode.charAt(0)) + mode.substring(1); -
trunk/src/org/openstreetmap/josm/actions/CopyAction.java
r5953 r6069 19 19 20 20 /** 21 * Copy OSM primitives to clipboard in order to paste them, or their tags, somewhere else. 21 * Copy OSM primitives to clipboard in order to paste them, or their tags, somewhere else. 22 22 * @since 404 23 23 */ -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r5818 r6069 130 130 } 131 131 132 /** 132 /** 133 133 * Enable this action only if something is selected 134 134 * … … 185 185 /** 186 186 * This method removes tags/value pairs from inner and outer ways and put them on relation if necessary 187 * Function was extended in reltoolbox plugin by Zverikk and copied back to the core 187 * Function was extended in reltoolbox plugin by Zverikk and copied back to the core 188 188 * @param relation the multipolygon style relation to process 189 189 * @return a list of commands to execute … … 212 212 Way way = m.getWay(); 213 213 outerWays.add(way); 214 214 215 215 for( String key : way.keySet() ) { 216 216 if( !values.containsKey(key) ) { //relation values take precedence -
trunk/src/org/openstreetmap/josm/actions/DialogsToggleAction.java
r6019 r6069 17 17 18 18 /* 19 * Action that hides or shows toggle dialogs panel and other panels 19 * Action that hides or shows toggle dialogs panel and other panels 20 20 * to free more space for drawing (GIMP-like) 21 21 * @author cmuelle8 -
trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
r5438 r6069 18 18 /** 19 19 * Constructs a new {@code DiskAccessAction}. 20 * 20 * 21 21 * @param name The action's text as displayed on the menu (if it is added to a menu) 22 22 * @param iconName The filename of the icon to use … … 47 47 /** 48 48 * Creates a new {@link JFileChooser} and makes it visible. 49 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 49 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 50 50 * @param multiple If true, makes the dialog allow multiple file selections 51 51 * @param title The string that goes in the dialog window's title bar … … 59 59 /** 60 60 * Creates a new {@link JFileChooser} and makes it visible. 61 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 61 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 62 62 * @param multiple If true, makes the dialog allow multiple file selections 63 63 * @param title The string that goes in the dialog window's title bar … … 72 72 /** 73 73 * Creates a new {@link JFileChooser} and makes it visible. 74 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 74 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 75 75 * @param multiple If true, makes the dialog allow multiple file selections 76 76 * @param title The string that goes in the dialog window's title bar 77 77 * @param extension The file extension that will be selected as the default file filter 78 78 * @param selectionMode The selection mode that allows the user to:<br/> 79 * <li>just select files ({@code JFileChooser.FILES_ONLY})</li> 80 * <li>just select directories ({@code JFileChooser.DIRECTORIES_ONLY})</li> 79 * <li>just select files ({@code JFileChooser.FILES_ONLY})</li> 80 * <li>just select directories ({@code JFileChooser.DIRECTORIES_ONLY})</li> 81 81 * <li>select both files and directories ({@code JFileChooser.FILES_AND_DIRECTORIES})</li> 82 * @param allTypes If true, all the files types known by JOSM will be proposed in the "file type" combobox. 82 * @param allTypes If true, all the files types known by JOSM will be proposed in the "file type" combobox. 83 83 * If false, only the file filters that include {@code extension} will be proposed 84 * @param lastDirProperty The name of the property used to setup the JFileChooser initial directory. 84 * @param lastDirProperty The name of the property used to setup the JFileChooser initial directory. 85 85 * This property will then be updated to the new "last directory" chosen by the user. If null, the default property "lastDirectory" will be used. 86 86 * @return The {@code JFileChooser}. … … 93 93 /** 94 94 * Creates a new {@link JFileChooser} for a single {@link FileFilter} and makes it visible. 95 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 95 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 96 96 * @param multiple If true, makes the dialog allow multiple file selections 97 97 * @param title The string that goes in the dialog window's title bar 98 98 * @param filter The only file filter that will be proposed by the dialog 99 99 * @param selectionMode The selection mode that allows the user to:<br/> 100 * <li>just select files ({@code JFileChooser.FILES_ONLY})</li> 101 * <li>just select directories ({@code JFileChooser.DIRECTORIES_ONLY})</li> 100 * <li>just select files ({@code JFileChooser.FILES_ONLY})</li> 101 * <li>just select directories ({@code JFileChooser.DIRECTORIES_ONLY})</li> 102 102 * <li>select both files and directories ({@code JFileChooser.FILES_AND_DIRECTORIES})</li> 103 103 * @param lastDirProperty The name of the property used to setup the JFileChooser initial directory. This property will then be updated to the new "last directory" chosen by the user … … 111 111 /** 112 112 * Creates a new {@link JFileChooser} for several {@link FileFilter}s and makes it visible. 113 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 113 * @param open If true, pops up an "Open File" dialog. If false, pops up a "Save File" dialog 114 114 * @param multiple If true, makes the dialog allow multiple file selections 115 115 * @param title The string that goes in the dialog window's title bar … … 117 117 * @param defaultFilter The file filter that will be selected by default 118 118 * @param selectionMode The selection mode that allows the user to:<br/> 119 * <li>just select files ({@code JFileChooser.FILES_ONLY})</li> 120 * <li>just select directories ({@code JFileChooser.DIRECTORIES_ONLY})</li> 119 * <li>just select files ({@code JFileChooser.FILES_ONLY})</li> 120 * <li>just select directories ({@code JFileChooser.DIRECTORIES_ONLY})</li> 121 121 * <li>select both files and directories ({@code JFileChooser.FILES_AND_DIRECTORIES})</li> 122 122 * @param lastDirProperty The name of the property used to setup the JFileChooser initial directory. This property will then be updated to the new "last directory" chosen by the user … … 124 124 * @since 5438 125 125 */ 126 public static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title, 126 public static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title, 127 127 Collection<? extends FileFilter> filters, FileFilter defaultFilter, int selectionMode, String lastDirProperty) { 128 128 return new JFileChooserManager(open, lastDirProperty).createFileChooser(multiple, title, filters, defaultFilter, selectionMode).openFileChooser(); -
trunk/src/org/openstreetmap/josm/actions/DistributeAction.java
r6006 r6069 40 40 putValue("help", ht("/Action/DistributeNodes")); 41 41 } 42 42 43 43 /** 44 44 * The general algorithm here is to find the two selected nodes … … 66 66 } 67 67 } 68 68 69 69 Set<Node> ignoredNodes = removeNodesWithoutCoordinates(nodes); 70 70 ignoredNodes.addAll(removeNodesWithoutCoordinates(itnodes)); … … 149 149 Main.map.repaint(); 150 150 } 151 151 152 152 private Set<Node> removeNodesWithoutCoordinates(Collection<Node> col) { 153 153 Set<Node> result = new HashSet<Node>(); -
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r5566 r6069 109 109 * support new file extensions. The old AllFormatsImporter doesn’t include the new 110 110 * extensions and thus will not display these files. 111 * 111 * 112 112 * @since 5131 113 113 */ … … 196 196 * @param fileChooser the file chooser 197 197 * @param extension the default extension 198 * @param allTypes If true, all the files types known by JOSM will be proposed in the "file type" combobox. 198 * @param allTypes If true, all the files types known by JOSM will be proposed in the "file type" combobox. 199 199 * If false, only the file filters that include {@code extension} will be proposed 200 200 * @since 5438 … … 215 215 * @param fileChooser the file chooser 216 216 * @param extension the default extension 217 * @param allTypes If true, all the files types known by JOSM will be proposed in the "file type" combobox. 217 * @param allTypes If true, all the files types known by JOSM will be proposed in the "file type" combobox. 218 218 * If false, only the file filters that include {@code extension} will be proposed 219 219 * @since 5438 … … 268 268 269 269 /** 270 * Replies the comma-separated list of file extensions of this file filter. 270 * Replies the comma-separated list of file extensions of this file filter. 271 271 * @return the comma-separated list of file extensions of this file filter, as a String 272 272 * @since 5131 -
trunk/src/org/openstreetmap/josm/actions/FollowLineAction.java
r4982 r6069 63 63 return; 64 64 if (!(Main.map.mapMode instanceof DrawAction)) return; // We are not on draw mode 65 65 66 66 Collection<Node> selectedPoints = osmLayer.data.getSelectedNodes(); 67 67 Collection<Way> selectedLines = osmLayer.data.getSelectedWays(); 68 68 if ((selectedPoints.size() > 1) || (selectedLines.size() != 1)) // Unsuitable selection 69 69 return; 70 70 71 71 Node last = ((DrawAction) Main.map.mapMode).getCurrentBaseNode(); 72 72 if (last == null) … … 83 83 List<OsmPrimitive> referrers = last.getReferrers(); 84 84 if (referrers.size() < 2) return; // There's nothing to follow 85 86 Node newPoint = null; 85 86 Node newPoint = null; 87 87 Iterator<OsmPrimitive> i = referrers.iterator(); 88 88 while (i.hasNext()) { … … 119 119 osmLayer.data.addSelected(newFollower); 120 120 osmLayer.data.addSelected(newPoint); 121 // "viewport following" mode for tracing long features 122 // from aerial imagery or GPS tracks. 121 // "viewport following" mode for tracing long features 122 // from aerial imagery or GPS tracks. 123 123 if (Main.map.mapView.viewportFollowing) { 124 124 Main.map.mapView.smoothScrollTo(newPoint.getEastNorth()); -
trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java
r5886 r6069 39 39 private final Pattern idValidator; 40 40 public JRadioButton btn; 41 41 42 42 /** 43 43 * @param name Name of the rectifing service -
trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
r5897 r6069 57 57 }); 58 58 } 59 59 60 60 public void merge(List<Layer> sourceLayers) { 61 61 doMerge(sourceLayers, sourceLayers); … … 93 93 }); 94 94 } 95 95 96 96 /** 97 97 * returns true if the user wants to cancel, false if they want to continue -
trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java
r5360 r6069 39 39 if (targetLayer == null) 40 40 return; 41 if (getEditLayer().isUploadDiscouraged() && targetLayer instanceof OsmDataLayer && !((OsmDataLayer)targetLayer).isUploadDiscouraged() 41 if (getEditLayer().isUploadDiscouraged() && targetLayer instanceof OsmDataLayer && !((OsmDataLayer)targetLayer).isUploadDiscouraged() 42 42 && getEditLayer().data.getAllSelected().size() > 1) { 43 43 if (warnMergingUploadDiscouragedObjects(targetLayer)) { … … 68 68 setEnabled(selection != null && !selection.isEmpty()); 69 69 } 70 70 71 71 /** 72 72 * returns true if the user wants to cancel, false if they want to continue -
trunk/src/org/openstreetmap/josm/actions/MoveAction.java
r5377 r6069 115 115 ? Main.main.undoRedo.commands.getLast() : null; 116 116 117 getCurrentDataSet().beginUpdate(); 117 getCurrentDataSet().beginUpdate(); 118 118 if (c instanceof MoveCommand && affectedNodes.equals(((MoveCommand)c).getParticipatingPrimitives())) { 119 119 ((MoveCommand)c).moveAgain(distx, disty); … … 122 122 c = new MoveCommand(selection, distx, disty)); 123 123 } 124 getCurrentDataSet().endUpdate(); 125 124 getCurrentDataSet().endUpdate(); 125 126 126 for (Node n : affectedNodes) { 127 127 if (n.getCoor().isOutSideWorld()) { -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r5874 r6069 287 287 } 288 288 } 289 289 290 290 for (File urlFile: urlFiles) { 291 291 try { -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r6040 r6069 46 46 47 47 protected final List<Class<? extends DownloadTask>> downloadTasks; 48 48 49 49 /** 50 50 * Create an open action. The name is "Open a file". … … 123 123 openUrl(layer.isSelected(), Utils.strip(uploadAddresses.getText())); 124 124 } 125 125 126 126 /** 127 127 * Replies the list of download tasks accepting the given url. … … 192 192 } 193 193 } 194 194 195 195 /** 196 196 * Adds a new download task to the supported ones. -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r5736 r6069 198 198 } 199 199 } 200 200 201 201 /** 202 202 * Collect groups of ways with common nodes in order to orthogonalize each group separately. … … 216 216 return groups; 217 217 } 218 218 219 219 private static void extendGroupRec(List<WayData> group, WayData newGroupMember, List<WayData> remaining) { 220 220 group.add(newGroupMember); … … 427 427 * Then sum up all horizontal / vertical segments to have a good guess for the 428 428 * heading of the entire way. 429 * @throws InvalidUserInputException 429 * @throws InvalidUserInputException 430 430 */ 431 431 public void calcDirections(Direction pInitialDirection) throws InvalidUserInputException { -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r5915 r6069 39 39 40 40 private static final String help = ht("/Action/PasteTags"); 41 41 42 42 public PasteTagsAction() { 43 43 super(tr("Paste Tags"), "pastetags", … … 170 170 171 171 /** 172 * Replies true if there is at least one primitive of type <code>type</code> 172 * Replies true if there is at least one primitive of type <code>type</code> 173 173 * is in the target collection 174 174 * … … 248 248 if (selection.isEmpty()) 249 249 return; 250 250 251 251 String buf = Utils.getClipboardContent(); 252 252 if (buf == null || buf.isEmpty() || buf.matches("(\\d+,)*\\d+")) { 253 253 pasteTagsFromJOSMBuffer(selection); 254 } else { 254 } else { 255 255 // Paste tags from arbitrary text 256 256 pasteTagsFromText(selection, buf); … … 277 277 return !commands.isEmpty(); 278 278 } 279 279 280 280 /** Paste tags from JOSM buffer 281 281 * @param selection objects that will have the tags 282 * @return false if JOSM buffer was empty 282 * @return false if JOSM buffer was empty 283 283 */ 284 284 public static boolean pasteTagsFromJOSMBuffer(Collection<OsmPrimitive> selection) { … … 297 297 /** 298 298 * Create and execute SequenceCommand with descriptive title 299 * @param commands 299 * @param commands 300 300 */ 301 301 private static void commitCommands(Collection<OsmPrimitive> selection, List<Command> commands) { … … 309 309 )); 310 310 } 311 } 312 311 } 312 313 313 @Override 314 314 protected void updateEnabledState() { -
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r5967 r6069 48 48 } 49 49 } 50 50 51 51 /** 52 52 * Determines if restarting the application should be possible on this platform. … … 57 57 return System.getProperty("sun.java.command") != null; 58 58 } 59 59 60 60 /** 61 61 * Restarts the current Java application … … 66 66 try { 67 67 // java binary 68 final String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + 68 final String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + 69 69 (Main.platform instanceof PlatformHookWindows ? "java.exe" : "java"); 70 70 if (!new File(java).isFile()) { … … 80 80 } 81 81 } 82 // program main and program arguments (be careful a sun property. might not be supported by all JVM) 82 // program main and program arguments (be careful a sun property. might not be supported by all JVM) 83 83 String[] mainCommand = System.getProperty("sun.java.command").split(" "); 84 84 // program main is a jar … … 115 115 } 116 116 } 117 117 118 118 /** 119 119 * Returns a new {@code ButtonSpec} instance that performs this action. … … 142 142 ); 143 143 } 144 144 145 145 /** 146 146 * Returns default {@code ButtonSpec} instances for this action (Restart/Cancel). -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r6011 r6069 118 118 * Creates a new "Save" dialog for a single {@link ExtensionFileFilter} and makes it visible.<br/> 119 119 * When the user has chosen a file, checks the file extension, and confirms overwrite if needed. 120 * 120 * 121 121 * @param title The dialog title 122 122 * @param filter The dialog file filter … … 133 133 * Creates a new "Save" dialog for a given file extension and makes it visible.<br/> 134 134 * When the user has chosen a file, checks the file extension, and confirms overwrite if needed. 135 * 135 * 136 136 * @param title The dialog title 137 137 * @param extension The file extension … … 143 143 return checkFileAndConfirmOverWrite(fc, extension); 144 144 } 145 145 146 146 private static File checkFileAndConfirmOverWrite(JFileChooser fc, String extension) { 147 147 if (fc == null) return null; 148 148 File file = fc.getSelectedFile(); 149 149 150 150 FileFilter ff = fc.getFileFilter(); 151 151 if (!ff.accept(file)) { -
trunk/src/org/openstreetmap/josm/actions/SaveAsAction.java
r5459 r6069 18 18 public class SaveAsAction extends SaveActionBase { 19 19 private static SaveAsAction instance = new SaveAsAction(); 20 20 21 21 /** 22 22 * Construct the action with "Save" as label. … … 28 28 putValue("help", ht("/Action/SaveAs")); 29 29 } 30 30 31 31 public static SaveAsAction getInstance() { 32 32 return instance; -
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r5926 r6069 26 26 27 27 public class SessionLoadAction extends DiskAccessAction { 28 28 29 29 public SessionLoadAction() { 30 30 super(tr("Load Session"), "open", tr("Load a session from file."), null, true, "load-session", true); -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r5684 r6069 73 73 } 74 74 } 75 75 76 76 FileFilter joz = new ExtensionFileFilter("joz", "joz", tr("Session file (archive) (*.joz)")); 77 77 FileFilter jos = new ExtensionFileFilter("jos", "jos", tr("Session file (*.jos)")); -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r5992 r6069 41 41 */ 42 42 public final class ShowStatusReportAction extends JosmAction { 43 43 44 44 /** 45 45 * Constructs a new {@code ShowStatusReportAction} … … 63 63 } 64 64 } 65 65 66 66 /** 67 67 * Replies the report header (software and system info) -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r5621 r6069 155 155 ); 156 156 } 157 157 158 158 /** 159 159 * returns true if the user wants to cancel, false if they -
trunk/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java
r5460 r6069 28 28 ); 29 29 putValue("help", ht("/Action/ViewportFollowing")); 30 selected = false; 30 selected = false; 31 31 notifySelectedState(); 32 32 } -
trunk/src/org/openstreetmap/josm/actions/WireframeToggleAction.java
r5925 r6069 30 30 false /* register toolbar */ 31 31 ); 32 putValue("toolbar", "wireframe"); 32 putValue("toolbar", "wireframe"); 33 33 Main.toolbar.register(this); 34 34 selected = MapRendererFactory.getInstance().isWireframeMapRendererActive(); … … 60 60 selected = !selected; 61 61 //Main.pref.put("draw.wireframe", selected); 62 if (selected){ 63 MapRendererFactory.getInstance().activate(WireframeMapRenderer.class); 64 } else { 65 MapRendererFactory.getInstance().activate(StyledMapRenderer.class); 66 } 67 62 if (selected){ 63 MapRendererFactory.getInstance().activate(WireframeMapRenderer.class); 64 } else { 65 MapRendererFactory.getInstance().activate(StyledMapRenderer.class); 66 } 67 68 68 notifySelectedState(); 69 69 if (Main.isDisplayingMapView()) { … … 71 71 } 72 72 } 73 73 74 74 public void actionPerformed(ActionEvent e) { 75 75 toggleSelectedState(); -
trunk/src/org/openstreetmap/josm/actions/audio/AudioBackAction.java
r5871 r6069 16 16 17 17 /** 18 * Jump the audio backward 10 seconds and start playing if paused. 18 * Jump the audio backward 10 seconds and start playing if paused. 19 19 * @since 547 20 20 */ -
trunk/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java
r5871 r6069 19 19 /** 20 20 * Constructs a new {@code AudioFastSlowAction}. 21 * 21 * 22 22 * @param name the action's text as displayed on the menu (if it is added to a menu) 23 23 * @param iconName the filename of the icon to use -
trunk/src/org/openstreetmap/josm/actions/audio/AudioFasterAction.java
r5871 r6069 12 12 /** 13 13 * Increase the speed of audio playback. 14 * Each use increases the speed further until one of the other controls is used. 14 * Each use increases the speed further until one of the other controls is used. 15 15 * @since 563 16 16 */ -
trunk/src/org/openstreetmap/josm/actions/audio/AudioFwdAction.java
r5871 r6069 19 19 */ 20 20 public class AudioFwdAction extends JosmAction { 21 21 22 22 /** 23 23 * Constructs a new {@code AudioFwdAction}. -
trunk/src/org/openstreetmap/josm/actions/audio/AudioNextAction.java
r5871 r6069 14 14 /** 15 15 * Play the sound track from the Audio Marker after the one most recently played.<br/> 16 * Play from the first such Marker if none has been played, or repeat the last marker if at the end. 16 * Play from the first such Marker if none has been played, or repeat the last marker if at the end. 17 17 * @since 547 18 18 */ -
trunk/src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java
r5945 r6069 17 17 * If not playing, play the sound track from the first Audio Marker, or from the point at which it was paused.<br/> 18 18 * If playing, pause the sound.<br/> 19 * If fast forwarding or slow forwarding, resume normal speed. 19 * If fast forwarding or slow forwarding, resume normal speed. 20 20 * @since 547 21 21 */ -
trunk/src/org/openstreetmap/josm/actions/audio/AudioPrevAction.java
r5871 r6069 14 14 /** 15 15 * Play the sound track from the Audio Marker before the one most recently played.<br/> 16 * Play from the first such Marker if none has been played or already at the first marker. 16 * Play from the first such Marker if none has been played or already at the first marker. 17 17 * @since 547 18 18 */ -
trunk/src/org/openstreetmap/josm/actions/audio/AudioSlowerAction.java
r5871 r6069 12 12 /** 13 13 * Decrease the speed of audio playback. 14 * Each use decreases the speed further until one of the other controls is used. 14 * Each use decreases the speed further until one of the other controls is used. 15 15 * @since 563 16 16 */ -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java
r6040 r6069 47 47 return errorMessages; 48 48 } 49 49 50 50 @Override 51 51 public String acceptsDocumentationSummary() { … … 60 60 buf.append(XmlWriter.encode(pattern)); 61 61 buf.append("</li>"); 62 } 62 } 63 63 buf.append("</ul>"); 64 64 } … … 90 90 return new String[]{}; 91 91 } 92 92 93 93 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r6031 r6069 126 126 return; 127 127 String name = newLayerName != null ? newLayerName : tr("Downloaded GPX Data"); 128 128 129 129 GpxImporterData layers = GpxImporter.loadLayers(rawData, reader.isGpxParsedProperly(), name, tr("Markers from {0}", name)); 130 130 131 131 GpxLayer gpxLayer = addOrMergeLayer(layers.getGpxLayer(), findGpxMergeLayer()); 132 132 addOrMergeLayer(layers.getMarkerLayer(), findMarkerMergeLayer(gpxLayer)); 133 133 134 134 layers.getPostLayerTask().run(); 135 135 } 136 136 137 137 private <L extends Layer> L addOrMergeLayer(L layer, L mergeLayer) { 138 138 if (layer == null) return null; … … 160 160 return null; 161 161 } 162 162 163 163 private MarkerLayer findMarkerMergeLayer(GpxLayer fromLayer) { 164 164 if (!Main.isDisplayingMapView()) … … 189 189 return null; 190 190 } 191 191 192 192 /** 193 193 * Determines if the given URL denotes an OSM gpx-related API call. -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r6031 r6069 36 36 */ 37 37 public class DownloadOsmTask extends AbstractDownloadTask { 38 38 39 39 private static final String PATTERN_OSM_API_URL = "http://.*/api/0.6/(map|nodes?|ways?|relations?|\\*).*"; 40 40 private static final String PATTERN_OVERPASS_API_URL = "http://.*/interpreter\\?data=.*"; 41 41 private static final String PATTERN_OVERPASS_API_XAPI_URL = "http://.*/xapi\\?.*\\[@meta\\].*"; 42 42 private static final String PATTERN_EXTERNAL_OSM_FILE = "https?://.*/.*\\.osm"; 43 43 44 44 protected Bounds currentBounds; 45 45 protected DataSet downloadedData; 46 46 protected DownloadTask downloadTask; 47 47 48 48 protected OsmDataLayer targetLayer; 49 49 50 50 protected String newLayerName = null; 51 51 52 52 @Override 53 53 public String[] getPatterns() { 54 54 if (this.getClass() == DownloadOsmTask.class) { 55 return new String[]{PATTERN_OSM_API_URL, PATTERN_OVERPASS_API_URL, 55 return new String[]{PATTERN_OSM_API_URL, PATTERN_OVERPASS_API_URL, 56 56 PATTERN_OVERPASS_API_XAPI_URL, PATTERN_EXTERNAL_OSM_FILE}; 57 57 } else { … … 149 149 return url; 150 150 } 151 151 152 152 /** 153 153 * Loads a given URL from the OSM Server … … 159 159 if (url.matches(PATTERN_OVERPASS_API_URL)) { 160 160 url = encodePartialUrl(url, "/interpreter?data="); // encode only the part after the = sign 161 161 162 162 } else if (url.matches(PATTERN_OVERPASS_API_XAPI_URL)) { 163 163 url = encodePartialUrl(url, "/xapi?"); // encode only the part after the ? sign … … 171 171 return Main.worker.submit(downloadTask); 172 172 } 173 173 174 174 protected final void extractOsmFilename(String pattern, String url) { 175 175 Matcher matcher = Pattern.compile(pattern).matcher(url); … … 194 194 this.newLayer = newLayer; 195 195 } 196 196 197 197 protected DataSet parseDataSet() throws OsmTransferException { 198 198 return reader.parseOsm(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false)); … … 247 247 return null; 248 248 } 249 249 250 250 protected OsmDataLayer createNewLayer(String layerName) { 251 251 if (layerName == null || layerName.isEmpty()) { … … 254 254 return new OsmDataLayer(dataSet, layerName, null); 255 255 } 256 256 257 257 protected OsmDataLayer createNewLayer() { 258 258 return createNewLayer(null); … … 297 297 } 298 298 } 299 299 300 300 protected void computeBboxAndCenterScale() { 301 301 BoundingXYVisitor v = new BoundingXYVisitor(); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java
r6032 r6069 14 14 */ 15 15 public interface DownloadTask { 16 16 17 17 /** 18 18 * Asynchronously launches the download task for a given bounding box. … … 71 71 */ 72 72 Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor); 73 73 74 74 /** 75 75 * Returns true if the task is able to open the given URL, false otherwise. … … 85 85 */ 86 86 String acceptsDocumentationSummary(); 87 87 88 88 /** 89 89 * Returns human-readable description of the task … … 92 92 */ 93 93 String getTitle(); 94 94 95 95 /** 96 96 * Returns regular expressions that match the URLs … … 114 114 */ 115 115 public void cancel(); 116 116 117 117 /** 118 118 * Replies the HTML-formatted confirmation message to be shown to user when the given URL needs to be confirmed before loading. 119 119 * @param url The URL to be confirmed 120 120 * @return The HTML-formatted confirmation message to be shown to user 121 * @since 121 * @since 122 122 */ 123 123 public String getConfirmationMessage(URL url); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r6053 r6069 46 46 private List<Future<?>> taskFutures = new LinkedList<Future<?>>(); 47 47 private ProgressMonitor progressMonitor; 48 48 49 49 private void addDownloadTask(DownloadTask dt, Rectangle2D td, int i, int n) { 50 50 ProgressMonitor childProgress = progressMonitor.createSubTaskMonitor(1, false); … … 54 54 tasks.add(dt); 55 55 } 56 56 57 57 /** 58 58 * Downloads a list of areas from the OSM Server … … 61 61 * @param osmData Set to true if OSM data should be downloaded 62 62 * @param gpxData Set to true if GPX data should be downloaded 63 * @param progressMonitor The progress monitor 63 * @param progressMonitor The progress monitor 64 64 * @return The Future representing the asynchronous download task 65 65 */ … … 71 71 Main.map.mapView.setActiveLayer(l); 72 72 } 73 73 74 74 int n = (osmData && gpxData ? 2 : 1)*rects.size(); 75 75 progressMonitor.beginTask(null, n); … … 230 230 231 231 private final boolean osmData; 232 232 233 233 public PostDownloadProcessor(boolean osmData) { 234 234 this.osmData = osmData; -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r6026 r6069 257 257 * calls the cursor and target highlighting routines. Allows for modifiers 258 258 * not taken from the given mouse event. 259 * 259 * 260 260 * Normally the mouse event also contains the modifiers. However, when the 261 261 * mouse is not moved and only modifier keys are pressed, no mouse event -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r6027 r6069 121 121 private Stroke rubberLineStroke; 122 122 private static final BasicStroke BASIC_STROKE = new BasicStroke(1); 123 123 124 124 public DrawAction(MapFrame mapFrame) { 125 125 super(tr("Draw"), "node/autonode", tr("Draw nodes"), … … 204 204 return; 205 205 super.enterMode(); 206 206 207 207 rubberLineColor = Main.pref.getColor(marktr("helper line"), null); 208 208 if (rubberLineColor == null) rubberLineColor = PaintColors.SELECTED.get(); 209 209 210 210 rubberLineStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.stroke.helper-line","3")); 211 211 drawHelperLine = Main.pref.getBoolean("draw.helper-line", true); … … 773 773 updateKeyModifiers(e); 774 774 mousePos = e.getPoint(); 775 if (snapHelper.isSnapOn() && ctrl) 775 if (snapHelper.isSnapOn() && ctrl) 776 776 tryToSetBaseSegmentForAngleSnap(); 777 777 778 778 computeHelperLine(); 779 779 addHighlighting(); 780 780 } 781 781 782 782 /** 783 783 * This method is used to detect segment under mouse and use it as reference for angle snapping … … 888 888 currentBaseNode = null; 889 889 previousNode = null; 890 890 891 891 // Try to find an open way to measure angle from it. The way is not to be continued! 892 892 // warning: may result in changes of currentBaseNode and previousNode … … 895 895 for (OsmPrimitive p: selectedNode.getReferrers()) { 896 896 if (p.isUsable() && p instanceof Way && ((Way) p).isFirstLastNode(selectedNode)) { 897 if (selectedWay!=null) { // two uncontinued ways, nothing to take as reference 897 if (selectedWay!=null) { // two uncontinued ways, nothing to take as reference 898 898 selectedWay=null; 899 899 break; … … 904 904 } 905 905 } 906 } 907 906 } 907 908 908 if (selectedNode == null) { 909 909 if (selectedWay == null) … … 916 916 } 917 917 } 918 918 919 919 /** 920 920 * if one of the ends of @param way is given @param node , … … 1349 1349 JCheckBoxMenuItem checkBox; 1350 1350 public final Color ORANGE_TRANSPARENT = new Color(Color.ORANGE.getRed(),Color.ORANGE.getGreen(),Color.ORANGE.getBlue(),128); 1351 1351 1352 1352 public void init() { 1353 1353 snapOn=false; -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r6050 r6069 73 73 private Color mainColor; 74 74 private Stroke mainStroke; 75 75 76 76 /** 77 77 * drawing settings for helper lines … … 88 88 private List<ReferenceSegment> possibleMoveDirections; 89 89 90 90 91 91 /** 92 92 * Collection of nodes that is moved … … 238 238 if (e.getButton() != MouseEvent.BUTTON1) 239 239 return; 240 240 241 241 requestFocusInMapView(); 242 242 updateKeyModifiers(e); 243 243 244 244 selectedNode = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive.isSelectablePredicate); 245 245 selectedSegment = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive.isSelectablePredicate); 246 246 247 247 // If nothing gets caught, stay in select mode 248 248 if (selectedSegment == null && selectedNode == null) return; 249 249 250 250 if (selectedNode != null) { 251 251 if (ctrl || nodeDragWithoutCtrl) { … … 253 253 movingNodeList.add(selectedNode); 254 254 calculatePossibleDirectionsByNode(); 255 if (possibleMoveDirections.isEmpty()) { 255 if (possibleMoveDirections.isEmpty()) { 256 256 // if no directions fould, do not enter dragging mode 257 257 return; … … 278 278 calculatePossibleDirectionsBySegment(); 279 279 } 280 280 281 281 // Signifies that nothing has happened yet 282 282 newN1en = null; … … 386 386 } 387 387 } 388 388 389 389 /** 390 390 * Insert node into nearby segment 391 * @param e - current mouse point 391 * @param e - current mouse point 392 392 */ 393 393 private void addNewNode(MouseEvent e) { … … 488 488 Main.main.undoRedo.add(c); 489 489 } 490 490 491 491 /** 492 492 * This method tests if a node has other ways apart from the given one. … … 502 502 return false; 503 503 } 504 504 505 505 /** 506 506 * Determine best movenemnt from initialMousePos to current position @param mouseEn, 507 507 * choosing one of the directions @field possibleMoveDirections 508 * @return movement vector 508 * @return movement vector 509 509 */ 510 510 private EastNorth calculateBestMovement(EastNorth mouseEn) { 511 511 512 512 EastNorth initialMouseEn = Main.map.mapView.getEastNorth(initialMousePos.x, initialMousePos.y); 513 513 EastNorth mouseMovement = initialMouseEn.sub(mouseEn); 514 514 515 515 double bestDistance = Double.POSITIVE_INFINITY; 516 516 EastNorth bestMovement = null; … … 565 565 initialN1en = selectedSegment.getFirstNode().getEastNorth(); 566 566 initialN2en = selectedSegment.getSecondNode().getEastNorth(); 567 567 568 568 //add direction perpendicular to the selected segment 569 569 possibleMoveDirections = new ArrayList<ReferenceSegment>(); … … 573 573 ), initialN1en, initialN2en, true)); 574 574 575 575 576 576 //add directions parallel to neighbor segments 577 577 Node prevNode = getPreviousNode(selectedSegment.lowerIndex); … … 593 593 } 594 594 } 595 595 596 596 /** 597 597 * Gather possible move directions - along all adjacent segments … … 609 609 initialN1en.getX() - en.getX(), 610 610 initialN1en.getY() - en.getY() 611 ), initialN1en, en, false)); 611 ), initialN1en, en, false)); 612 612 } 613 613 } 614 614 } 615 615 } 616 616 617 617 /** 618 618 * Gets a node from selected way before given index. … … 685 685 686 686 EastNorth normalUnitVector = getNormalUniVector(); 687 687 688 688 if (mode == Mode.extrude || mode == Mode.create_new) { 689 689 g2.setColor(mainColor); … … 722 722 if (p1.distance(p2) < 3) { 723 723 g2.setStroke(mainStroke); 724 g2.drawOval((int)(p1.x-symbolSize/2), (int)(p1.y-symbolSize/2), 724 g2.drawOval((int)(p1.x-symbolSize/2), (int)(p1.y-symbolSize/2), 725 725 (int)(symbolSize), (int)(symbolSize)); 726 726 } else { … … 752 752 } 753 753 } 754 754 755 755 private EastNorth getNormalUniVector() { 756 756 double fac = 1.0 / activeMoveDirection.en.distance(0,0); … … 770 770 return normalUnitVector; 771 771 } 772 772 773 773 private void drawAngleSymbol(Graphics2D g2, Point2D center, EastNorth normal, boolean mirror) { 774 774 // EastNorth units per pixel … … 776 776 double raoffsetx = symbolSize*factor*normal.getX(); 777 777 double raoffsety = symbolSize*factor*normal.getY(); 778 779 double cx = center.getX(), cy = center.getY(); 778 779 double cx = center.getX(), cy = center.getY(); 780 780 double k = (mirror ? -1 : 1); 781 781 Point2D ra1 = new Point2D.Double(cx + raoffsetx, cy + raoffsety); 782 782 Point2D ra3 = new Point2D.Double(cx - raoffsety*k, cy + raoffsetx*k); 783 783 Point2D ra2 = new Point2D.Double(ra1.getX() - raoffsety*k, ra1.getY() + raoffsetx*k); 784 784 785 785 GeneralPath ra = new GeneralPath(); 786 786 ra.moveTo((float)ra1.getX(), (float)ra1.getY()); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r6029 r6069 89 89 private Stroke deleteNodeStroke; 90 90 private int dotSize; 91 91 92 92 private boolean selectionChangedBlocked = false; 93 93 … … 130 130 deleteNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.delete-node", "1")); 131 131 dotSize = Main.pref.getInteger("improvewayaccuracy.dot-size",6); 132 132 133 133 mv = Main.map.mapView; 134 134 mousePos = null; -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r5960 r6069 57 57 updateStatusLine(); 58 58 } 59 59 60 60 /** 61 61 * Makes this map mode inactive. … … 102 102 shift = (modifiers & ActionEvent.SHIFT_MASK) != 0; 103 103 } 104 104 105 105 protected void requestFocusInMapView() { 106 106 if (isEnabled()) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r6028 r6069 98 98 private boolean snapDefault; 99 99 100 private double snapThreshold; 100 private double snapThreshold; 101 101 private double snapDistanceMetric; 102 102 private double snapDistanceImperial; … … 125 125 private EastNorth helperLineStart; 126 126 private EastNorth helperLineEnd; 127 127 128 128 Stroke helpLineStroke; 129 129 Stroke refLineStroke; … … 157 157 refLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.ref-line", "1 2 2")); 158 158 mainColor = Main.pref.getColor(marktr("make parallel helper line"), null); 159 if (mainColor == null) mainColor = PaintColors.SELECTED.get(); 160 159 if (mainColor == null) mainColor = PaintColors.SELECTED.get(); 160 161 161 //// Needed to update the mouse cursor if modifiers are changed when the mouse is motionless 162 162 try { -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java
r5981 r6069 22 22 /** 23 23 * Helper for ParallelWayAction 24 * 24 * 25 25 * @author Ole Jørgen Brønner (olejorgenb) 26 26 */ … … 69 69 if (sortedNodesPath == null) 70 70 throw new IllegalArgumentException("Ways must have spanning path"); // Create a dedicated exception? 71 71 72 72 // Fix #8631 - Remove duplicated nodes from graph to be robust with self-intersecting ways 73 73 Set<Node> removedNodes = new HashSet<Node>(); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r6013 r6069 207 207 208 208 int previousModifiers; 209 209 210 210 /** 211 211 * This is called whenever the keyboard modifier status changes … … 282 282 return repaintIfRequired(newHighlights); 283 283 } 284 284 285 285 /** 286 286 * works out which cursor should be displayed for most of SelectAction's … … 381 381 return needsRepaint; 382 382 } 383 383 384 384 /** 385 385 * Look, whether any object is selected. If not, select the nearest node. … … 397 397 if (!mv.isActiveLayerVisible() || !(Boolean) this.getValue("active") || mouseDownButton != MouseEvent.BUTTON1) 398 398 return; 399 399 400 400 // left-button mouse click only is processed here 401 401 402 402 // request focus in order to enable the expected keyboard shortcuts 403 403 mv.requestFocus(); … … 416 416 417 417 // primitives under cursor are stored in c collection 418 418 419 419 OsmPrimitive nearestPrimitive = mv.getNearestNodeOrWay(e.getPoint(), OsmPrimitive.isSelectablePredicate, true); 420 420 421 421 determineMapMode(nearestPrimitive!=null); 422 422 423 423 switch(mode) { 424 424 case rotate: … … 462 462 updateStatusLine(); 463 463 } 464 464 465 465 @Override 466 466 public void mouseMoved(MouseEvent e) { … … 475 475 } 476 476 } 477 477 478 478 /** 479 479 * If the left mouse button is pressed, move all currently selected … … 485 485 if (!mv.isActiveLayerVisible()) 486 486 return; 487 487 488 488 // Swing sends random mouseDragged events when closing dialogs by double-clicking their top-left icon on Windows 489 489 // Ignore such false events to prevent issues like #7078 490 490 if (mouseDownButton == MouseEvent.BUTTON1 && mouseReleaseTime > mouseDownTime) 491 491 return; 492 492 493 493 cancelDrawMode = true; 494 494 if (mode == Mode.select) … … 542 542 if (e.getPoint().equals(lastMousePos)) 543 543 return; 544 544 545 545 EastNorth currentEN = mv.getEastNorth(e.getX(), e.getY()); 546 546 … … 559 559 } 560 560 561 561 562 562 563 563 @Override … … 568 568 } 569 569 570 570 571 571 @Override 572 572 public void mouseReleased(MouseEvent e) { … … 653 653 } 654 654 } 655 655 656 656 /** returns true whenever elements have been grabbed and moved (i.e. the initial 657 657 * thresholds have been exceeded) and is still in progress (i.e. mouse button … … 662 662 } 663 663 664 665 /** 666 * Create or update data modification command while dragging mouse - implementation of 664 665 /** 666 * Create or update data modification command while dragging mouse - implementation of 667 667 * continuous moving, scaling and rotation 668 668 * @param currentEN - mouse position … … 677 677 getCurrentDataSet().setSelected(nearestPrimitive); 678 678 } 679 679 680 680 Collection<Node> affectedNodes = AllNodesVisitor.getAllNodes(selection); 681 681 // for these transformations, having only one node makes no sense - quit silently … … 710 710 } else { 711 711 startEN = currentEN; // drag can continue after scaling/rotation 712 712 713 713 if (mode != Mode.rotate && mode != Mode.scale) { 714 714 return false; 715 715 } 716 716 717 717 getCurrentDataSet().beginUpdate(); 718 718 719 719 if (mode == Mode.rotate) { 720 720 if (c instanceof RotateCommand && affectedNodes.equals(((RotateCommand) c).getTransformedNodes())) { … … 730 730 } 731 731 } 732 732 733 733 Collection<Way> ways = getCurrentDataSet().getSelectedWays(); 734 734 if (doesImpactStatusLine(affectedNodes, ways)) { … … 739 739 return true; 740 740 } 741 741 742 742 private boolean doesImpactStatusLine(Collection<Node> affectedNodes, Collection<Way> selectedWays) { 743 743 for (Way w : selectedWays) { … … 750 750 return false; 751 751 } 752 752 753 753 /** 754 754 * Adapt last move command (if it is suitable) to work with next drag, started at point startEN … … 762 762 } 763 763 } 764 764 765 765 /** 766 766 * Obtain command in undoRedo stack to "continue" when dragging … … 774 774 return c; 775 775 } 776 776 777 777 /** 778 778 * Present warning in case of large and possibly unwanted movements and undo … … 812 812 getCurrentDataSet().fireSelectionChanged(); 813 813 } 814 814 815 815 /** 816 816 * Merges the selected nodes to the one closest to the given mouse position iff the control … … 908 908 this.lassoMode = lassoMode; 909 909 } 910 910 911 911 CycleManager cycleManager = new CycleManager(); 912 912 VirtualManager virtualManager = new VirtualManager(); 913 913 914 914 private class CycleManager { 915 915 … … 926 926 multipleMatchesParameter = Main.pref.getBoolean("selectaction.cycles.multiple.matches", false); 927 927 } 928 928 929 929 /** 930 930 * Determine prmitive to be selected and build cycleList … … 941 941 // Point p = e.getPoint(); 942 942 // updateKeyModifiers(e); // cycleSetup called only after updateModifiers ! 943 943 944 944 if (!(alt || multipleMatchesParameter)) { 945 // no real cycling, just one element in cycle list 945 // no real cycling, just one element in cycle list 946 946 cycleList = MapView.asColl(osm); 947 947 … … 1021 1021 // first selected primitive in cycleList is found 1022 1022 if (cyclePrims || ctrl) { 1023 ds.clearSelection(foundInDS); // deselect it 1023 ds.clearSelection(foundInDS); // deselect it 1024 1024 nxt = i.hasNext() ? i.next() : first; 1025 1025 // return next one in cycle list (last->first) … … 1029 1029 } 1030 1030 } 1031 1031 1032 1032 // if "no-alt-cycling" is enabled, Ctrl-Click arrives here. 1033 1033 if (ctrl) { … … 1054 1054 } 1055 1055 } 1056 1056 1057 1057 private class VirtualManager { 1058 1058 … … 1062 1062 private int virtualSnapDistSq2; 1063 1063 private int virtualSpace; 1064 1064 1065 1065 private void init() { 1066 1066 nodeVirtualSize = Main.pref.getInteger("mappaint.node.virtual-size", 8); … … 1069 1069 virtualSpace = Main.pref.getInteger("mappaint.node.virtual-space", 70); 1070 1070 } 1071 1071 1072 1072 /** 1073 1073 * Calculate a virtual node if there is enough visual space to draw a -
trunk/src/org/openstreetmap/josm/actions/relation/SelectRelationAction.java
r5799 r6069 11 11 12 12 /** 13 * Sets the current selection to specified list of relations 13 * Sets the current selection to specified list of relations 14 14 * @since 5793 15 15 */ 16 16 public class SelectRelationAction extends AbstractRelationAction { 17 17 18 18 private final boolean add; 19 19 -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r5948 r6069 90 90 } 91 91 } 92 92 93 93 public static Collection<SearchSetting> getSearchHistory() { 94 94 return searchHistory; -
trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java
r5767 r6069 99 99 } 100 100 } 101 101 102 102 /** 103 103 * Data fix to cleanup wrong spelled keys … … 130 130 } 131 131 } 132 132 133 133 /** 134 134 * Data fix to cleanup wrong spelled tags … … 170 170 } 171 171 } 172 172 173 173 /** 174 174 * Checks the upload for deprecated or wrong tags. -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r5926 r6069 60 60 test.visit(selection); 61 61 test.endTest(); 62 if (Main.pref.getBoolean(ValidatorPreference.PREF_OTHER, false) && 62 if (Main.pref.getBoolean(ValidatorPreference.PREF_OTHER, false) && 63 63 Main.pref.getBoolean(ValidatorPreference.PREF_OTHER_UPLOAD, false)) 64 64 { -
trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
r5953 r6069 59 59 init(data, toSelect); 60 60 } 61 61 62 62 private final void init(List<PrimitiveData> data, List<PrimitiveData> toSelect) { 63 63 CheckParameterUtil.ensureParameterNotNull(data, "data"); … … 113 113 @Override public void undoCommand() { 114 114 DataSet ds = getLayer().data; 115 115 116 116 if (createdPrimitives == null) { 117 117 createdPrimitives = new ArrayList<OsmPrimitive>(data.size()); 118 118 createdPrimitivesToSelect = new ArrayList<OsmPrimitive>(toSelect.size()); 119 119 120 120 for (PrimitiveData pd : data) { 121 121 OsmPrimitive p = ds.getPrimitiveById(pd); … … 126 126 } 127 127 createdPrimitives = PurgeCommand.topoSort(createdPrimitives); 128 128 129 129 for (PrimitiveData p : data) { 130 130 ds.removePrimitive(p); … … 132 132 data = null; 133 133 toSelect = null; 134 134 135 135 } else { 136 136 for (OsmPrimitive osm : createdPrimitives) { … … 161 161 if (createdPrimitives != null) 162 162 return createdPrimitives; 163 163 164 164 Collection<OsmPrimitive> prims = new HashSet<OsmPrimitive>(); 165 165 for (PrimitiveData d : data) { -
trunk/src/org/openstreetmap/josm/command/MoveCommand.java
r5694 r6069 31 31 private Collection<Node> nodes = new LinkedList<Node>(); 32 32 /** 33 * Starting position, base command point, current (mouse-drag) position = startEN + (x,y) = 33 * Starting position, base command point, current (mouse-drag) position = startEN + (x,y) = 34 34 */ 35 35 private EastNorth startEN; … … 73 73 this(objects, offset.getX(), offset.getY()); 74 74 } 75 75 76 76 /** 77 77 * Create a MoveCommand and assign the initial object set and movement vector. … … 102 102 startEN = start; 103 103 } 104 104 105 105 /** 106 106 * Move the same set of objects again by the specified vector. The vectors … … 122 122 moveAgain(x - this.x, y - this.y); 123 123 } 124 125 /** 126 * Change the displacement vector to have endpoint @param currentEN 124 125 /** 126 * Change the displacement vector to have endpoint @param currentEN 127 127 * starting point is startEN 128 128 */ 129 129 public void applyVectorTo(EastNorth currentEN) { 130 if (startEN == null) 130 if (startEN == null) 131 131 return; 132 132 x = currentEN.getX() - startEN.getX(); -
trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
r5993 r6069 39 39 40 40 protected Map<PrimitiveId, PrimitiveData> makeIncompleteData_byPrimId; 41 41 42 42 protected final ConflictCollection purgedConflicts = new ConflictCollection(); 43 43 … … 132 132 } 133 133 } 134 134 135 135 for (Conflict<?> conflict : purgedConflicts) { 136 136 getLayer().getConflicts().add(conflict); -
trunk/src/org/openstreetmap/josm/command/RotateCommand.java
r4918 r6069 61 61 handleEvent(currentEN); 62 62 } 63 63 64 64 /** 65 65 * Get angle between the horizontal axis and the line formed by the pivot and give points. -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java
r5787 r6069 45 45 } 46 46 } 47 47 48 48 private static final Collection<Pattern> ignoredKeys = new ArrayList<Pattern>(); 49 49 static { … … 58 58 } 59 59 } 60 60 61 61 private static class StringSwitcher { 62 62 … … 93 93 */ 94 94 public static class TagSwitcher { 95 95 96 96 /** 97 97 * Reverses a given tag. … … 102 102 return apply(tag.getKey(), tag.getValue()); 103 103 } 104 104 105 105 /** 106 106 * Reverses a given tag (key=value). … … 128 128 // Change key but not left/right value (fix #8518) 129 129 newKey = FORWARD_BACKWARD.apply(key); 130 130 131 131 } else if (!ignoreKeyForCorrection(key)) { 132 132 for (StringSwitcher prefixSuffixSwitcher : stringSwitchers) { … … 144 144 } 145 145 } 146 146 147 147 private static final StringSwitcher FORWARD_BACKWARD = new StringSwitcher("forward", "backward"); 148 148 private static final StringSwitcher UP_DOWN = new StringSwitcher("up", "down"); -
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r5889 r6069 275 275 return new File(autosaveDir, osmFile.getName().replaceFirst("[.][^.]+$", ".pid")); 276 276 } 277 277 278 278 /** 279 279 * Replies the list of .osm files still present in autosave dir, that are not currently managed by another instance of JOSM. … … 315 315 return result; 316 316 } 317 317 318 318 private boolean jvmPerfDataFileExists(final String jvmId) { 319 319 File jvmDir = new File(System.getProperty("java.io.tmpdir") + File.separator + "hsperfdata_" + System.getProperty("user.name")); … … 354 354 File backupFile = new File(deletedLayersDir, f.getName()); 355 355 File pidFile = getPidFile(f); 356 356 357 357 if (backupFile.exists()) { 358 358 deletedLayers.remove(backupFile); -
trunk/src/org/openstreetmap/josm/data/Bounds.java
r5235 r6069 30 30 return new LatLon(maxLat, maxLon); 31 31 } 32 32 33 33 public enum ParseMethod { 34 34 MINLAT_MINLON_MAXLAT_MAXLON, 35 35 LEFT_BOTTOM_RIGHT_TOP 36 36 } 37 37 38 38 /** 39 39 * Construct bounds out of two points … … 50 50 this(b, true); 51 51 } 52 52 53 53 public Bounds(LatLon b, boolean roundToOsmPrecision) { 54 54 // Do not call this(b, b) to avoid GPX performance issue (see #7028) until roundToOsmPrecision() is improved … … 124 124 } 125 125 } 126 126 127 127 switch (parseMethod) { 128 128 case LEFT_BOTTOM_RIGHT_TOP: … … 140 140 } 141 141 } 142 142 143 143 protected static double initLat(double value, boolean roundToOsmPrecision) { 144 144 if (!LatLon.isValidLat(value)) … … 246 246 extend(b.getMax()); 247 247 } 248 248 249 249 /** 250 250 * Is the given point within this bounds? … … 266 266 return notCrossing.minLon <= crossing.maxLon || notCrossing.maxLon >= crossing.minLon; 267 267 } 268 268 269 269 /** 270 270 * The two bounds intersect? Compared to java Shape.intersects, if does not use … … 274 274 if (b.maxLat < minLat || b.minLat > maxLat) 275 275 return false; 276 276 277 277 if (crosses180thMeridian() && !b.crosses180thMeridian()) { 278 278 return intersectsLonCrossing(this, b); … … 294 294 return this.minLon > this.maxLon; 295 295 } 296 296 297 297 /** 298 298 * Converts the lat/lon bounding box to an object of type Rectangle2D.Double … … 320 320 * <p>Replies true, if this bounds are <em>collapsed</em>, i.e. if the min 321 321 * and the max corner are equal.</p> 322 * 322 * 323 323 * @return true, if this bounds are <em>collapsed</em> 324 324 */ -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r5927 r6069 58 58 public class CustomConfigurator { 59 59 private static StringBuilder summary = new StringBuilder(); 60 60 61 61 public static void log(String fmt, Object... vars) { 62 62 summary.append(String.format(fmt, vars)); 63 63 } 64 64 65 65 public static void log(String s) { 66 66 summary.append(s); 67 67 summary.append("\n"); 68 68 } 69 69 70 70 public static String getLog() { 71 71 return summary.toString(); 72 72 } 73 73 74 74 public static void readXML(String dir, String fileName) { 75 75 readXML(new File(dir, fileName)); … … 87 87 new XMLCommandProcessor(prefs).openAndReadXML(file); 88 88 synchronized(CustomConfigurator.class) { 89 CustomConfigurator.class.notifyAll(); 89 CustomConfigurator.class.notifyAll(); 90 90 busy=false; 91 91 } 92 92 } 93 93 94 94 /** 95 95 * Read configuration script from XML file, modifying main preferences … … 99 99 readXML(file, Main.pref); 100 100 } 101 101 102 102 /** 103 103 * Downloads file to one of JOSM standard folders 104 104 * @param address - URL to download 105 * @param path - file path relative to base where to put downloaded file 105 * @param path - file path relative to base where to put downloaded file 106 106 * @param base - only "prefs", "cache" and "plugins" allowed for standard folders 107 107 */ … … 113 113 * Downloads file to one of JOSM standard folders nad unpack it as ZIP/JAR file 114 114 * @param address - URL to download 115 * @param path - file path relative to base where to put downloaded file 115 * @param path - file path relative to base where to put downloaded file 116 116 * @param base - only "prefs", "cache" and "plugins" allowed for standard folders 117 117 */ … … 123 123 * Downloads file to arbitrary folder 124 124 * @param address - URL to download 125 * @param path - file path relative to parentDir where to put downloaded file 125 * @param path - file path relative to parentDir where to put downloaded file 126 126 * @param parentDir - folder where to put file 127 127 * @param mkdir - if true, non-existing directories will be created … … 139 139 log("Info: downloading file from %s to %s in background ", parentDir, fOut.getAbsolutePath()); 140 140 if (unzip) log("and unpacking it"); else log(""); 141 141 142 142 } 143 143 144 144 /** 145 145 * Simple function to show messageBox, may be used from JS API and from other code 146 * @param type - 'i','w','e','q','p' for Information, Warning, Error, Question, Message 146 * @param type - 'i','w','e','q','p' for Information, Warning, Error, Question, Message 147 147 * @param text - message to display, HTML allowed 148 148 */ … … 158 158 } 159 159 } 160 160 161 161 /** 162 162 * Simple function for choose window, may be used from JS API and from other code … … 214 214 exportPreferencesKeysToFile(fileName, append, keySet); 215 215 } 216 216 217 217 /** 218 218 * Export specified preferences keys to configuration file … … 241 241 if (root==null) return; 242 242 try { 243 243 244 244 Element newRoot = exportDocument.createElement("config"); 245 245 exportDocument.appendChild(newRoot); 246 246 247 247 Element prefElem = exportDocument.createElement("preferences"); 248 248 prefElem.setAttribute("operation", append?"append":"replace"); … … 270 270 } 271 271 } 272 273 272 273 274 274 public static void deleteFile(String path, String base) { 275 275 String dir = getDirectoryByAbbr(base); … … 292 292 deleteFileOrDirectory(new File(path)); 293 293 } 294 294 295 295 public static void deleteFileOrDirectory(File f) { 296 296 if (f.isDirectory()) { 297 297 for (File f1: f.listFiles()) { 298 298 deleteFileOrDirectory(f1); 299 } 299 } 300 300 } 301 301 try { … … 308 308 private static boolean busy=false; 309 309 310 310 311 311 public static void pluginOperation(String install, String uninstall, String delete) { 312 312 final List<String> installList = new ArrayList<String>(); … … 317 317 Collections.addAll(deleteList, delete.toLowerCase().split(";")); 318 318 installList.remove("");removeList.remove("");deleteList.remove(""); 319 319 320 320 if (!installList.isEmpty()) { 321 321 log("Plugins install: "+installList); … … 332 332 public void run() { 333 333 if (task.isCanceled()) return; 334 synchronized (CustomConfigurator.class) { 334 synchronized (CustomConfigurator.class) { 335 335 try { // proceed only after all other tasks were finished 336 336 while (busy) CustomConfigurator.class.wait(); 337 337 } catch (InterruptedException ex) { } 338 338 339 339 SwingUtilities.invokeLater(new Runnable() { 340 340 public void run() { … … 376 376 Main.worker.submit(r); 377 377 } 378 378 379 379 private static String getDirectoryByAbbr(String base) { 380 380 String dir; … … 402 402 tmp.listOfStructsProperties.putAll( pref.listOfStructsProperties ); 403 403 tmp.colornames.putAll( pref.colornames ); 404 404 405 405 return tmp; 406 406 } … … 408 408 409 409 public static class XMLCommandProcessor { 410 410 411 411 Preferences mainPrefs; 412 412 Map<String,Element> tasksMap = new HashMap<String,Element>(); 413 413 414 414 private boolean lastV; // last If condition result 415 416 415 416 417 417 ScriptEngine engine ; 418 418 … … 452 452 engine = new ScriptEngineManager().getEngineByName("rhino"); 453 453 engine.eval("API={}; API.pref={}; API.fragments={};"); 454 454 455 455 engine.eval("homeDir='"+normalizeDirName(Main.pref.getPreferencesDir()) +"';"); 456 456 engine.eval("josmVersion="+Version.getInstance().getVersion()+";"); … … 493 493 if (processRunTaskElement(elem)) return; 494 494 } else if ("ask".equals(elementName)) { 495 processAskElement(elem); 495 processAskElement(elem); 496 496 } else if ("if".equals(elementName)) { 497 processIfElement(elem); 497 processIfElement(elem); 498 498 } else if ("else".equals(elementName)) { 499 processElseElement(elem); 499 processElseElement(elem); 500 500 } else if ("break".equals(elementName)) { 501 501 return; … … 515 515 log("Error: Unknown element " + elementName); 516 516 } 517 517 518 518 } 519 519 } … … 524 524 String oper = evalVars(item.getAttribute("operation")); 525 525 String id = evalVars(item.getAttribute("id")); 526 527 526 527 528 528 if ("delete-keys".equals(oper)) { 529 529 String pattern = evalVars(item.getAttribute("pattern")); … … 537 537 return; 538 538 } 539 539 540 540 Preferences tmpPref = readPreferencesFromDOMElement(item); 541 541 PreferencesUtils.showPrefs(tmpPref); 542 542 543 543 if (id.length()>0) { 544 544 try { … … 551 551 } 552 552 } 553 553 554 554 if ("replace".equals(oper)) { 555 555 log("Preferences replace: %d keys: %s\n", … … 564 564 } 565 565 } 566 566 567 567 private void processDeleteElement(Element item) { 568 568 String path = evalVars(item.getAttribute("path")); … … 583 583 return; 584 584 } 585 585 586 586 if (path.contains("..") || path.startsWith("/") || path.contains(":")) { 587 587 return; // some basic protection … … 593 593 processDownloadOperation(address, path, dir, "true".equals(mkdir), "true".equals(unzip)); 594 594 } 595 595 596 596 private void processPluginInstallElement(Element elem) { 597 597 String install = elem.getAttribute("install"); … … 600 600 pluginOperation(install, uninstall, delete); 601 601 } 602 602 603 603 private void processMsgBoxElement(Element elem) { 604 604 String text = evalVars(elem.getAttribute("text")); … … 609 609 messageBox(type, text); 610 610 } 611 611 612 612 613 613 private void processAskElement(Element elem) { … … 617 617 String var = elem.getAttribute("var"); 618 618 if (var.length()==0) var="result"; 619 619 620 620 String input = evalVars(elem.getAttribute("input")); 621 621 if ("true".equals(input)) { … … 636 636 } 637 637 } 638 638 639 639 private void processIfElement(Element elem) { 640 640 String realValue = evalVars(elem.getAttribute("test")); … … 645 645 log("Error: Illegal test expression in if: %s=%s\n", elem.getAttribute("test"), realValue); 646 646 } 647 648 if (v) processXmlFragment(elem); 647 648 if (v) processXmlFragment(elem); 649 649 lastV = v; 650 650 } … … 652 652 private void processElseElement(Element elem) { 653 653 if (!lastV) { 654 processXmlFragment(elem); 654 processXmlFragment(elem); 655 655 } 656 656 } … … 668 668 return false; 669 669 } 670 671 670 671 672 672 private void processScriptElement(Element elem) { 673 673 String js = elem.getChildNodes().item(0).getTextContent(); … … 681 681 log("Script finished"); 682 682 } 683 683 684 684 /** 685 685 * subsititute ${expression} = expression evaluated by JavaScript … … 710 710 711 711 xformer.transform(new DOMSource(item), out); 712 712 713 713 String fragmentWithReplacedVars= evalVars(outputWriter.toString()); 714 714 … … 717 717 } catch (Exception ex) { 718 718 log("Error: can not read XML fragment :" + ex.getMessage()); 719 } 719 } 720 720 721 721 return tmpPref; … … 737 737 */ 738 738 public static class PreferencesUtils { 739 739 740 740 private static void replacePreferences(Preferences fragment, Preferences mainpref) { 741 741 // normal prefs … … 798 798 } 799 799 800 /// "maps" 800 /// "maps" 801 801 for (Entry<String, List<Map<String, String>>> entry : fragment.listOfStructsProperties.entrySet()) { 802 802 String key = entry.getKey(); … … 805 805 if (newMaps == null) continue; 806 806 807 // get existing properties as list of maps 807 // get existing properties as list of maps 808 808 809 809 for (Map<String, String> map : entry.getValue()) { … … 816 816 } 817 817 } 818 818 819 819 /** 820 820 * Delete items from @param mainpref collections that match items from @param fragment collections … … 850 850 String key = entry.getKey(); 851 851 852 852 853 853 Collection<Collection<String>> newLists = getArray(mainpref, key, true); 854 854 if (newLists == null) continue; 855 855 856 856 // if items are found in one of lists, remove that list! 857 857 Iterator<Collection<String>> listIterator = newLists.iterator(); … … 870 870 } 871 871 872 /// "maps" 872 /// "maps" 873 873 for (Entry<String, List<Map<String, String>>> entry : fragment.listOfStructsProperties.entrySet()) { 874 874 String key = entry.getKey(); … … 876 876 List<Map<String, String>> newMaps = getListOfStructs(mainpref, key, true); 877 877 if (newMaps == null) continue; 878 878 879 879 Iterator<Map<String, String>> mapIterator = newMaps.iterator(); 880 880 while (mapIterator.hasNext()) { … … 891 891 } 892 892 } 893 893 894 894 private static void deletePreferenceKeyByPattern(String pattern, Preferences pref) { 895 895 Map<String, Setting> allSettings = pref.getAllSettings(); … … 909 909 } 910 910 } 911 911 912 912 private static Collection<String> getCollection(Preferences mainpref, String key, boolean warnUnknownDefault) { 913 913 Collection<String> existing = mainpref.collectionProperties.get(key); … … 921 921 ? new ArrayList<String>(existing) : new ArrayList<String>(defaults); 922 922 } 923 923 924 924 private static Collection<Collection<String>> getArray(Preferences mainpref, String key, boolean warnUnknownDefault) { 925 925 Collection<List<String>> existing = mainpref.arrayProperties.get(key); … … 947 947 ? new ArrayList<Map<String, String>>(existing) : new ArrayList<Map<String, String>>(defaults); 948 948 } 949 950 949 950 951 951 952 952 private static void defaultUnknownWarning(String key) { … … 965 965 System.out.println("maps: " + tmpPref.listOfStructsProperties); 966 966 } 967 967 968 968 private static void modifyPreferencesByScript(ScriptEngine engine, Preferences tmpPref, String js) throws ScriptException { 969 969 loadPrefsToJS(engine, tmpPref, "API.pref", true); … … 972 972 } 973 973 974 974 975 975 /** 976 976 * Convert JavaScript preferences object to preferences data structures … … 978 978 * @param tmpPref - preferences to fill from JS 979 979 * @param varInJS - JS variable name, where preferences are stored 980 * @throws ScriptException 980 * @throws ScriptException 981 981 */ 982 982 public static void readPrefsFromJS(ScriptEngine engine, Preferences tmpPref, String varInJS) throws ScriptException { … … 1058 1058 tmpPref.listOfStructsProperties.put(e.getKey(), e.getValue()); 1059 1059 } 1060 1061 } 1062 1063 1060 1061 } 1062 1063 1064 1064 /** 1065 1065 * Convert preferences data structures to JavaScript object … … 1068 1068 * @param whereToPutInJS - variable name to store preferences in JS 1069 1069 * @param includeDefaults - include known default values to JS objects 1070 * @throws ScriptException 1070 * @throws ScriptException 1071 1071 */ 1072 1072 public static void loadPrefsToJS(ScriptEngine engine, Preferences tmpPref, String whereToPutInJS, boolean includeDefaults) throws ScriptException { … … 1151 1151 whereToPutInJS+"[String(e.getKey())] = jslistmap;"+ 1152 1152 "}\n"; 1153 1153 1154 1154 //System.out.println("map1: "+stringMap ); 1155 1155 //System.out.println("lists1: "+listMap ); … … 1159 1159 // Execute conversion script 1160 1160 engine.eval(init); 1161 1161 1162 1162 } 1163 1163 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r6054 r6069 1346 1346 // Workaround to fix another Java bug 1347 1347 // Force Java 7 to use old sorting algorithm of Arrays.sort (fix #8712). 1348 // See Oracle bug database: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7075600 1348 // See Oracle bug database: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7075600 1349 1349 // and http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6923200 1350 1350 if (Main.pref.getBoolean("jdk.Arrays.useLegacyMergeSort", !Version.getInstance().isLocalBuild())) { … … 1352 1352 } 1353 1353 } 1354 1354 1355 1355 private void updateSystemProperty(String key, String value) { 1356 1356 if (value != null) { … … 1655 1655 if (b==null) return false; 1656 1656 if (a==b) return true; 1657 1658 if (a instanceof StringSetting) 1657 1658 if (a instanceof StringSetting) 1659 1659 return (a.getValue().equals(b.getValue())); 1660 1660 if (a instanceof ListSetting) { -
trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
r5298 r6069 24 24 private final T their; 25 25 private final boolean isMyDeleted; 26 26 27 27 // mergedMap is only set if the conflict results from merging two layers 28 28 private Map<PrimitiveId, PrimitiveId> mergedMap; -
trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java
r4126 r6069 7 7 /** 8 8 * LatLon class that maintains a cache of projected EastNorth coordinates. 9 * 9 * 10 10 * This class is convenient to use, but has relatively high memory costs. 11 * It keeps a pointer to the last known projection in order to detect projection 11 * It keeps a pointer to the last known projection in order to detect projection 12 12 * changes. 13 * 13 * 14 14 * Node and WayPoint have another, optimized, cache for projected coordinates. 15 15 */ … … 47 47 /** 48 48 * Replies the projected east/north coordinates. 49 * 49 * 50 50 * @return the internally cached east/north coordinates. null, if the globally defined projection is null 51 51 */ -
trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java
r4640 r6069 60 60 return hd; 61 61 } 62 62 63 63 /** 64 64 * Replies true if east and north are different from Double.NaN 65 * 65 * 66 66 * @return true if east and north are different from Double.NaN 67 67 */ -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r5909 r6069 46 46 cDdFormatter.applyPattern("###0.0######"); 47 47 } 48 48 49 49 private static final String cDms60 = cDmsSecondFormatter.format(60.0); 50 50 private static final String cDms00 = cDmsSecondFormatter.format( 0.0); … … 115 115 int tMinutes = (int) tTmpMinutes; 116 116 double tSeconds = (tTmpMinutes - tMinutes) * 60; 117 117 118 118 String sDegrees = Integer.toString(tDegree); 119 119 String sMinutes = cDmsMinuteFormatter.format(tMinutes); 120 120 String sSeconds = cDmsSecondFormatter.format(tSeconds); 121 121 122 122 if (sSeconds.equals(cDms60)) { 123 123 sSeconds = cDms00; … … 142 142 int tDegree = (int) tAbsCoord; 143 143 double tMinutes = (tAbsCoord - tDegree) * 60; 144 144 145 145 String sDegrees = Integer.toString(tDegree); 146 146 String sMinutes = cDmMinuteFormatter.format(tMinutes); 147 147 148 148 if (sMinutes.equals(cDm60)) { 149 149 sMinutes = cDm00; 150 150 sDegrees = Integer.toString(tDegree+1); 151 151 } 152 152 153 153 return sDegrees + "\u00B0" + sMinutes + "\'"; 154 154 } -
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r5715 r6069 78 78 * The bounds are not stored internally, but recalculated every time 79 79 * this function is called. 80 * 80 * 81 81 * FIXME might perhaps use visitor pattern? 82 82 */ … … 124 124 return result; 125 125 } 126 126 127 127 /** 128 128 * Makes a WayPoint at the projection of point P onto the track providing P is less than -
trunk/src/org/openstreetmap/josm/data/gpx/IWithAttributes.java
r5684 r6069 19 19 20 20 /** 21 * Returns the String value to which the specified key is mapped, 21 * Returns the String value to which the specified key is mapped, 22 22 * or {@code null} if this map contains no String mapping for the key. 23 * 23 * 24 24 * @param key the key whose associated value is to be returned 25 * @return the String value to which the specified key is mapped, 25 * @return the String value to which the specified key is mapped, 26 26 * or {@code null} if this map contains no String mapping for the key 27 27 */ -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r5617 r6069 48 48 return urlString; 49 49 } 50 50 51 51 public static ImageryType fromUrlString(String s) { 52 52 for (ImageryType type : ImageryType.values()) { -
trunk/src/org/openstreetmap/josm/data/imagery/Shape.java
r5381 r6069 21 21 22 22 private List<Coordinate> coords = new ArrayList<Coordinate>(); 23 23 24 24 public Shape(String asString, String separator) throws IllegalArgumentException { 25 25 CheckParameterUtil.ensureParameterNotNull(asString, "asString"); … … 49 49 return coords; 50 50 } 51 51 52 52 public boolean contains(LatLon latlon) { 53 53 if (latlon == null) … … 65 65 66 66 double lat, lon; 67 67 68 68 try { 69 69 lat = Double.parseDouble(sLat); … … 81 81 throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", sLon)); 82 82 } 83 83 84 84 coords.add(new Coordinate(LatLon.roundToOsmPrecision(lat), LatLon.roundToOsmPrecision(lon))); 85 85 } -
trunk/src/org/openstreetmap/josm/data/imagery/types/EntryType.java
r5170 r6069 21 21 /** 22 22 * <p>Java class for entry complex type. 23 * 23 * 24 24 * <p>The following schema fragment specifies the expected content contained within this class. 25 * 25 * 26 26 * <pre> 27 27 * <complexType name="entry"> … … 40 40 * </complexType> 41 41 * </pre> 42 * 43 * 42 * 43 * 44 44 */ 45 45 @XmlAccessorType(XmlAccessType.FIELD) … … 70 70 /** 71 71 * Gets the value of the pixelPerDegree property. 72 * 72 * 73 73 */ 74 74 public double getPixelPerDegree() { … … 78 78 /** 79 79 * Sets the value of the pixelPerDegree property. 80 * 80 * 81 81 */ 82 82 public void setPixelPerDegree(double value) { … … 86 86 /** 87 87 * Gets the value of the east property. 88 * 88 * 89 89 */ 90 90 public double getEast() { … … 94 94 /** 95 95 * Sets the value of the east property. 96 * 96 * 97 97 */ 98 98 public void setEast(double value) { … … 102 102 /** 103 103 * Gets the value of the north property. 104 * 104 * 105 105 */ 106 106 public double getNorth() { … … 110 110 /** 111 111 * Sets the value of the north property. 112 * 112 * 113 113 */ 114 114 public void setNorth(double value) { … … 118 118 /** 119 119 * Gets the value of the lastUsed property. 120 * 120 * 121 121 * @return 122 122 * possible object is 123 123 * {@link String } 124 * 124 * 125 125 */ 126 126 public Calendar getLastUsed() { … … 130 130 /** 131 131 * Sets the value of the lastUsed property. 132 * 132 * 133 133 * @param value 134 134 * allowed object is 135 135 * {@link String } 136 * 136 * 137 137 */ 138 138 public void setLastUsed(Calendar value) { … … 142 142 /** 143 143 * Gets the value of the lastModified property. 144 * 144 * 145 145 * @return 146 146 * possible object is 147 147 * {@link String } 148 * 148 * 149 149 */ 150 150 public Calendar getLastModified() { … … 154 154 /** 155 155 * Sets the value of the lastModified property. 156 * 156 * 157 157 * @param value 158 158 * allowed object is 159 159 * {@link String } 160 * 160 * 161 161 */ 162 162 public void setLastModified(Calendar value) { … … 166 166 /** 167 167 * Gets the value of the filename property. 168 * 168 * 169 169 * @return 170 170 * possible object is 171 171 * {@link String } 172 * 172 * 173 173 */ 174 174 public String getFilename() { … … 178 178 /** 179 179 * Sets the value of the filename property. 180 * 180 * 181 181 * @param value 182 182 * allowed object is 183 183 * {@link String } 184 * 184 * 185 185 */ 186 186 public void setFilename(String value) { -
trunk/src/org/openstreetmap/josm/data/imagery/types/ObjectFactory.java
r5170 r6069 1 1 // 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 4 // Any modifications to this file will be lost upon recompilation of the source schema. 5 // Generated on: 2011.01.09 at 07:33:18 PM CET 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 4 // Any modifications to this file will be lost upon recompilation of the source schema. 5 // Generated on: 2011.01.09 at 07:33:18 PM CET 6 6 // 7 7 … … 13 13 14 14 /** 15 * This object contains factory methods for each 16 * Java content interface and Java element interface 17 * generated in the org.openstreetmap.josm.data.imagery.types package. 18 * <p>An ObjectFactory allows you to programatically 19 * construct new instances of the Java representation 20 * for XML content. The Java representation of XML 21 * content can consist of schema derived interfaces 22 * and classes representing the binding of schema 23 * type definitions, element declarations and model 24 * groups. Factory methods for each of these are 15 * This object contains factory methods for each 16 * Java content interface and Java element interface 17 * generated in the org.openstreetmap.josm.data.imagery.types package. 18 * <p>An ObjectFactory allows you to programatically 19 * construct new instances of the Java representation 20 * for XML content. The Java representation of XML 21 * content can consist of schema derived interfaces 22 * and classes representing the binding of schema 23 * type definitions, element declarations and model 24 * groups. Factory methods for each of these are 25 25 * provided in this class. 26 * 26 * 27 27 */ 28 28 @XmlRegistry … … 32 32 /** 33 33 * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.openstreetmap.josm.data.imagery.types 34 * 34 * 35 35 */ 36 36 public ObjectFactory() { … … 39 39 /** 40 40 * Create an instance of {@link WmsCacheType } 41 * 41 * 42 42 */ 43 43 public WmsCacheType createWmsCacheType() { … … 47 47 /** 48 48 * Create an instance of {@link ProjectionType } 49 * 49 * 50 50 */ 51 51 public ProjectionType createProjectionType() { … … 55 55 /** 56 56 * Create an instance of {@link EntryType } 57 * 57 * 58 58 */ 59 59 public EntryType createEntryType() { -
trunk/src/org/openstreetmap/josm/data/imagery/types/ProjectionType.java
r5170 r6069 1 1 // 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 4 // Any modifications to this file will be lost upon recompilation of the source schema. 5 // Generated on: 2011.01.09 at 07:33:18 PM CET 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 4 // Any modifications to this file will be lost upon recompilation of the source schema. 5 // Generated on: 2011.01.09 at 07:33:18 PM CET 6 6 // 7 7 … … 19 19 /** 20 20 * <p>Java class for projection complex type. 21 * 21 * 22 22 * <p>The following schema fragment specifies the expected content contained within this class. 23 * 23 * 24 24 * <pre> 25 25 * <complexType name="projection"> … … 35 35 * </complexType> 36 36 * </pre> 37 * 38 * 37 * 38 * 39 39 */ 40 40 @XmlAccessorType(XmlAccessType.FIELD) … … 52 52 /** 53 53 * Gets the value of the entry property. 54 * 54 * 55 55 * <p> 56 56 * This accessor method returns a reference to the live list, … … 58 58 * returned list will be present inside the JAXB object. 59 59 * This is why there is not a <CODE>set</CODE> method for the entry property. 60 * 60 * 61 61 * <p> 62 62 * For example, to add a new item, do as follows: … … 64 64 * getEntry().add(newItem); 65 65 * </pre> 66 * 67 * 66 * 67 * 68 68 * <p> 69 69 * Objects of the following type(s) are allowed in the list 70 70 * {@link EntryType } 71 * 72 * 71 * 72 * 73 73 */ 74 74 public List<EntryType> getEntry() { … … 81 81 /** 82 82 * Gets the value of the name property. 83 * 83 * 84 84 * @return 85 85 * possible object is 86 86 * {@link String } 87 * 87 * 88 88 */ 89 89 public String getName() { … … 93 93 /** 94 94 * Sets the value of the name property. 95 * 95 * 96 96 * @param value 97 97 * allowed object is 98 98 * {@link String } 99 * 99 * 100 100 */ 101 101 public void setName(String value) { … … 105 105 /** 106 106 * Gets the value of the cacheDirectory property. 107 * 107 * 108 108 * @return 109 109 * possible object is 110 110 * {@link String } 111 * 111 * 112 112 */ 113 113 public String getCacheDirectory() { … … 117 117 /** 118 118 * Sets the value of the cacheDirectory property. 119 * 119 * 120 120 * @param value 121 121 * allowed object is 122 122 * {@link String } 123 * 123 * 124 124 */ 125 125 public void setCacheDirectory(String value) { -
trunk/src/org/openstreetmap/josm/data/imagery/types/WmsCacheType.java
r5170 r6069 1 1 // 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 4 // Any modifications to this file will be lost upon recompilation of the source schema. 5 // Generated on: 2011.01.09 at 07:33:18 PM CET 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 4 // Any modifications to this file will be lost upon recompilation of the source schema. 5 // Generated on: 2011.01.09 at 07:33:18 PM CET 6 6 // 7 7 … … 20 20 /** 21 21 * <p>Java class for anonymous complex type. 22 * 22 * 23 23 * <p>The following schema fragment specifies the expected content contained within this class. 24 * 24 * 25 25 * <pre> 26 26 * <complexType> … … 36 36 * </complexType> 37 37 * </pre> 38 * 39 * 38 * 39 * 40 40 */ 41 41 @XmlAccessorType(XmlAccessType.FIELD) … … 54 54 /** 55 55 * Gets the value of the projection property. 56 * 56 * 57 57 * <p> 58 58 * This accessor method returns a reference to the live list, … … 60 60 * returned list will be present inside the JAXB object. 61 61 * This is why there is not a <CODE>set</CODE> method for the projection property. 62 * 62 * 63 63 * <p> 64 64 * For example, to add a new item, do as follows: … … 66 66 * getProjection().add(newItem); 67 67 * </pre> 68 * 69 * 68 * 69 * 70 70 * <p> 71 71 * Objects of the following type(s) are allowed in the list 72 72 * {@link ProjectionType } 73 * 74 * 73 * 74 * 75 75 */ 76 76 public List<ProjectionType> getProjection() { … … 83 83 /** 84 84 * Gets the value of the tileSize property. 85 * 85 * 86 86 */ 87 87 public int getTileSize() { … … 91 91 /** 92 92 * Sets the value of the tileSize property. 93 * 93 * 94 94 */ 95 95 public void setTileSize(int value) { … … 99 99 /** 100 100 * Gets the value of the totalFileSize property. 101 * 101 * 102 102 */ 103 103 public int getTotalFileSize() { … … 107 107 /** 108 108 * Sets the value of the totalFileSize property. 109 * 109 * 110 110 */ 111 111 public void setTotalFileSize(int value) { -
trunk/src/org/openstreetmap/josm/data/imagery/types/package-info.java
r5170 r6069 1 1 // 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 4 // Any modifications to this file will be lost upon recompilation of the source schema. 5 // Generated on: 2011.01.09 at 07:33:18 PM CET 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 4 // Any modifications to this file will be lost upon recompilation of the source schema. 5 // Generated on: 2011.01.09 at 07:33:18 PM CET 6 6 // 7 7 -
trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
r6067 r6069 64 64 * at the given API url. URL parameters are only set if the URL equals {@link OsmApi#DEFAULT_API_URL} 65 65 * or references the domain "dev.openstreetmap.org", otherwise they may be <code>null</code>. 66 * 66 * 67 67 * @param apiUrl The API URL for which the OAuth default parameters are created. If null or empty, the default OSM API url is used. 68 68 * @return a set of default parameters for the given {@code apiUrl} … … 133 133 /** 134 134 * Constructs a new, unitialized, {@code OAuthParameters}. 135 * 135 * 136 136 * @see #createDefault 137 137 * @see #createFromPreferences … … 162 162 return consumerKey; 163 163 } 164 164 165 165 /** 166 166 * Sets the consumer key. … … 170 170 this.consumerKey = consumerKey; 171 171 } 172 173 /** 174 * Gets the consumer secret. 172 173 /** 174 * Gets the consumer secret. 175 175 * @return The consumer secret 176 176 */ … … 178 178 return consumerSecret; 179 179 } 180 180 181 181 /** 182 182 * Sets the consumer secret. … … 186 186 this.consumerSecret = consumerSecret; 187 187 } 188 188 189 189 /** 190 190 * Gets the request token URL. … … 194 194 return requestTokenUrl; 195 195 } 196 196 197 197 /** 198 198 * Sets the request token URL. … … 202 202 this.requestTokenUrl = requestTokenUrl; 203 203 } 204 204 205 205 /** 206 206 * Gets the access token URL. … … 210 210 return accessTokenUrl; 211 211 } 212 212 213 213 /** 214 214 * Sets the access token URL. … … 218 218 this.accessTokenUrl = accessTokenUrl; 219 219 } 220 220 221 221 /** 222 222 * Gets the authorise URL. … … 226 226 return authoriseUrl; 227 227 } 228 228 229 229 /** 230 230 * Sets the authorise URL. -
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r5927 r6069 658 658 public boolean hasSameTags(OsmPrimitive other) { 659 659 // We cannot directly use Arrays.equals(keys, other.keys) as keys is not ordered by key 660 // but we can at least check if both arrays are null or of the same size before creating 660 // but we can at least check if both arrays are null or of the same size before creating 661 661 // and comparing the key maps (costly operation, see #7159) 662 return (keys == null && other.keys == null) 662 return (keys == null && other.keys == null) 663 663 || (keys != null && other.keys != null && keys.length == other.keys.length && (keys.length == 0 || getKeys().equals(other.getKeys()))); 664 664 } -
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r5170 r6069 175 175 return new LatLon(ymin, xmax); 176 176 } 177 177 178 178 public LatLon getCenter() { 179 179 return new LatLon(ymin + (ymax-ymin)/2.0, xmin + (xmax-xmin)/2.0); -
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r5996 r6069 17 17 */ 18 18 public final class Changeset implements Tagged { 19 19 20 20 /** The maximum changeset comment text length allowed by API 0.6 **/ 21 21 public static final int MAX_COMMENT_LENGTH = 255; 22 22 23 23 /** the changeset id */ 24 24 private int id; -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r5925 r6069 135 135 return targetDataSet.getPrimitiveById(targetId); 136 136 } 137 137 138 138 protected void addConflict(Conflict<?> c) { 139 139 c.setMergedMap(mergedMap); … … 221 221 } 222 222 } 223 223 224 224 private final void resetPrimitive(OsmPrimitive osm) { 225 225 if (osm instanceof Way) { -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r6009 r6069 63 63 /** 64 64 * <p>Replies the projected east/north coordinates.</p> 65 * 65 * 66 66 * <p>Uses the {@link Main#getProjection() global projection} to project the lan/lon-coordinates. 67 67 * Internally caches the projected coordinates.</p> … … 69 69 * <p><strong>Caveat:</strong> doesn't listen to projection changes. Clients must 70 70 * {@link #invalidateEastNorthCache() invalidate the internal cache}.</p> 71 * 71 * 72 72 * <p>Replies {@code null} if this node doesn't know lat/lon-coordinates, i.e. because it is an incomplete node. 73 * 73 * 74 74 * @return the east north coordinates or {@code null} 75 75 * @see #invalidateEastNorthCache() 76 * 76 * 77 77 */ 78 78 @Override … … 305 305 public void updatePosition() { 306 306 } 307 307 308 308 @Override 309 309 public boolean isDrawable() { … … 314 314 /** 315 315 * Check whether this node connects 2 ways. 316 * 316 * 317 317 * @return true if isReferredByWays(2) returns true 318 * @see #isReferredByWays(int) 318 * @see #isReferredByWays(int) 319 319 */ 320 320 public boolean isConnectionNode() { -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r6059 r6069 30 30 /** 31 31 * The base class for OSM objects ({@link Node}, {@link Way}, {@link Relation}). 32 * 32 * 33 33 * It can be created, deleted and uploaded to the OSM-Server. 34 34 * … … 620 620 private static volatile Collection<String> uninteresting = null; 621 621 private static volatile Collection<String> discardable = null; 622 622 623 623 /** 624 624 * Returns a list of "uninteresting" keys that do not make an object … … 658 658 return discardable; 659 659 } 660 660 661 661 /** 662 662 * Returns a list of "work in progress" keys that do not make an object … … 762 762 return (flags & FLAG_TAGGED) != 0; 763 763 } 764 764 765 765 /** 766 766 * Determines if this object is considered "annotated". To be "annotated", an object -
trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java
r5292 r6069 21 21 return memberId; 22 22 } 23 23 24 24 public String getRole() { 25 25 return role; 26 26 } 27 27 28 28 public OsmPrimitiveType getMemberType() { 29 29 return memberType; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r6009 r6069 105 105 return nodes.length; 106 106 } 107 107 108 108 /** 109 109 * Replies the real number of nodes in this way (full number of nodes minus one if this way is closed) … … 111 111 * @return the real number of nodes in this way. 112 112 * @since 5847 113 * 113 * 114 114 * @see #getNodesCount() 115 115 * @see #isClosed() … … 183 183 184 184 /** 185 * Replies the ordered {@link List} of chunks of this way. Each chunk is replied as a {@link Pair} of {@link Node nodes}. 186 * @param sort If true, the nodes of each pair are sorted as defined by {@link Pair#sort}. 187 * If false, Pair.a and Pair.b are in the way order (i.e for a given Pair(n), Pair(n-1).b == Pair(n).a, Pair(n).b == Pair(n+1).a, etc.) 185 * Replies the ordered {@link List} of chunks of this way. Each chunk is replied as a {@link Pair} of {@link Node nodes}. 186 * @param sort If true, the nodes of each pair are sorted as defined by {@link Pair#sort}. 187 * If false, Pair.a and Pair.b are in the way order (i.e for a given Pair(n), Pair(n-1).b == Pair(n).a, Pair(n).b == Pair(n+1).a, etc.) 188 188 * @return The ordered list of chunks of this way. 189 189 * @since 3348 … … 494 494 return nodes.length >= 3 && nodes[nodes.length-1] == nodes[0]; 495 495 } 496 496 497 497 /** 498 498 * Determines if this way denotes an area (closed way with at least three distinct nodes). … … 682 682 /** 683 683 * Tests if this way is a oneway. 684 * @return {@code 1} if the way is a oneway, 684 * @return {@code 1} if the way is a oneway, 685 685 * {@code -1} if the way is a reversed oneway, 686 686 * {@code 0} otherwise. -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java
r5440 r6069 15 15 */ 16 16 public class HistoryNode extends HistoryOsmPrimitive { 17 17 18 18 /** the coordinates. May be null for deleted nodes */ 19 19 private LatLon coords; … … 21 21 /** 22 22 * Constructs a new {@code HistoryNode}. 23 * 23 * 24 24 * @param id the id (> 0 required) 25 25 * @param version the version (> 0 required) … … 38 38 * Constructs a new {@code HistoryNode} with a configurable checking of historic parameters. 39 39 * This is needed to build virtual HistoryNodes for modified nodes, which do not have a timestamp and a changeset id. 40 * 40 * 41 41 * @param id the id (> 0 required) 42 42 * @param version the version (> 0 required) -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r5440 r6069 88 88 tags = new HashMap<String, String>(); 89 89 } 90 90 91 91 /** 92 92 * Constructs a new {@code HistoryOsmPrimitive} from an existing {@link OsmPrimitive}. -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java
r5440 r6069 25 25 /** 26 26 * Constructs a new {@code HistoryWay}. 27 * 27 * 28 28 * @param id the id (> 0 required) 29 29 * @param version the version (> 0 required) … … 41 41 * Constructs a new {@code HistoryWay} with a configurable checking of historic parameters. 42 42 * This is needed to build virtual HistoryWays for modified ways, which do not have a timestamp and a changeset id. 43 * 43 * 44 44 * @param id the id (> 0 required) 45 45 * @param version the version (> 0 required) … … 58 58 /** 59 59 * Constructs a new {@code HistoryWay} with a given list of node ids. 60 * 60 * 61 61 * @param id the id (> 0 required) 62 62 * @param version the version (> 0 required) -
trunk/src/org/openstreetmap/josm/data/osm/visitor/AllNodesVisitor.java
r6010 r6069 48 48 if (m.isNode()) visit(m.getNode()); 49 49 } 50 50 51 51 /** 52 52 * Replies all nodes contained by the given primitives -
trunk/src/org/openstreetmap/josm/data/osm/visitor/PrimitiveVisitor.java
r6010 r6069 11 11 */ 12 12 public interface PrimitiveVisitor { 13 13 14 14 /** 15 15 * Visiting call for points. … … 17 17 */ 18 18 void visit(INode n); 19 19 20 20 /** 21 21 * Visiting call for lines. -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
r5571 r6069 28 28 /** the map viewport - provides projection and hit detection functionality */ 29 29 protected NavigatableComponent nc; 30 30 31 31 /** if true, the paint visitor shall render OSM objects such that they 32 32 * look inactive. Example: rendering of data in an inactive layer using light gray as color only. */ … … 50 50 /** Preference: minimum space (displayed way length) to display segment numbers */ 51 51 protected int segmentNumberSpace; 52 52 53 53 /** 54 54 * <p>Creates an abstract paint visitor</p> 55 * 55 * 56 56 * @param g the graphics context. Must not be null. 57 57 * @param nc the map viewport. Must not be null. … … 68 68 this.isInactiveMode = isInactiveMode; 69 69 } 70 70 71 71 /** 72 72 * Draw the node as small rectangle with the given color. … … 80 80 * Draw an number of the order of the two consecutive nodes within the 81 81 * parents way 82 * 82 * 83 83 * @param p1 First point of the way segment. 84 84 * @param p2 Second point of the way segment. … … 102 102 } 103 103 } 104 104 105 105 /** 106 106 * Draws virtual nodes. … … 134 134 g.draw(path); 135 135 } catch (ArrayIndexOutOfBoundsException e) { 136 // Silently ignore any ArrayIndexOutOfBoundsException that may be raised 136 // Silently ignore any ArrayIndexOutOfBoundsException that may be raised 137 137 // if the way has changed while being rendered (fix #7979) 138 138 // TODO: proper solution ? … … 142 142 } 143 143 } 144 144 145 145 /** 146 146 * Reads the color definitions from preferences. This function is <code>public</code>, so that … … 154 154 this.highlightColor = PaintColors.HIGHLIGHT.get(); 155 155 } 156 156 157 157 /** 158 158 * Reads all the settings from preferences. Calls the @{link #getColors} … … 167 167 getColors(); 168 168 } 169 169 170 170 /** 171 171 * Checks if a way segemnt is large enough for additional information display. … … 181 181 return (xd+yd > space); 182 182 } 183 183 184 184 /** 185 185 * Checks if segment is visible in display. … … 196 196 return true; 197 197 } 198 198 199 199 /** 200 200 * Creates path for drawing virtual nodes for one way. -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r5909 r6069 21 21 * <p>MapRendererFactory manages a list of map renderer classes and associated 22 22 * meta data (display name, description).</p> 23 * 23 * 24 24 * <p>Plugins can implement and supply their own map renderers.</p> 25 25 * <strong>Sample code in a plugin</strong> … … 28 28 * // .... 29 29 * } 30 * 30 * 31 31 * // to be called when the plugin is created 32 32 * MapRendererFactory factory = MapRendererFactory.getInstance(); 33 33 * factory.register(MyMapRenderer.class, "My map renderer", "This is is a fast map renderer"); 34 34 * factory.activate(MyMapRenderer.class); 35 * 35 * 36 36 * </pre> 37 37 * … … 40 40 41 41 /** preference key for the renderer class name. Default: class name for {@link StyledMapRenderer} 42 * 42 * 43 43 */ 44 44 static public final String PREF_KEY_RENDERER_CLASS_NAME = "mappaint.renderer-class-name"; … … 161 161 * <p>Replies true, if {@code Renderer} is already a registered map renderer 162 162 * class.</p> 163 * 163 * 164 164 * @param renderer the map renderer class. Must not be null. 165 165 * @return true, if {@code Renderer} is already a registered map renderer … … 177 177 /** 178 178 * <p>Registers a map renderer class.</p> 179 * 179 * 180 180 * @param renderer the map renderer class. Must not be null. 181 181 * @param displayName the display name to be displayed in UIs (i.e. in the preference dialog) … … 201 201 * <p>If the respective class is also the active renderer, the renderer is reset 202 202 * to the default renderer.</p> 203 * 203 * 204 204 * @param renderer the map renderer class. Must not be null. 205 * 205 * 206 206 */ 207 207 public void unregister(Class<? extends AbstractMapRenderer> renderer) { … … 225 225 * 226 226 * <p>The renderer class must already be registered.</p> 227 * 227 * 228 228 * @param renderer the map renderer class. Must not be null. 229 229 * @throws IllegalArgumentException thrown if {@code renderer} is null 230 230 * @throws IllegalStateException thrown if {@code renderer} isn't registered yet 231 * 231 * 232 232 */ 233 233 public void activate(Class<? extends AbstractMapRenderer> renderer) throws IllegalArgumentException, IllegalStateException{ … … 247 247 * 248 248 * @throws IllegalStateException thrown if the default renderer {@link StyledMapRenderer} isn't registered 249 * 249 * 250 250 */ 251 251 public void activateDefault() throws IllegalStateException{ … … 283 283 /** 284 284 * <p>Replies the (unmodifiable) list of map renderer descriptors.</p> 285 * 285 * 286 286 * @return the descriptors 287 287 */ … … 293 293 * <p>Replies true, if currently the wireframe map renderer is active. Otherwise, 294 294 * false.</p> 295 * 295 * 296 296 * <p>There is a specific method for {@link WireframeMapRenderer} for legacy support. 297 297 * Until 03/2011 there were only two possible map renderers in JOSM: the wireframe 298 298 * renderer and the styled renderer. For the time being there are still UI elements 299 299 * (menu entries, etc.) which toggle between these two renderers only.</p> 300 * 300 * 301 301 * @return true, if currently the wireframe map renderer is active. Otherwise, 302 302 * false -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/Rendering.java
r4087 r6069 11 11 /** 12 12 * <p>Renders the OSM data in {@code data}</p> 13 * 13 * 14 14 * @param data the data set to be rendered 15 15 * @param renderVirtualNodes if true, renders virtual nodes. Otherwise, ignores them. -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r6035 r6069 222 222 } 223 223 } 224 224 225 225 private static class StyleRecord implements Comparable<StyleRecord> { 226 226 final ElemStyle style; … … 310 310 private Color relationSelectedColor; 311 311 private Color highlightColorTransparent; 312 312 313 313 private static final int FLAG_NORMAL = 0; 314 314 private static final int FLAG_DISABLED = 1; … … 321 321 322 322 private Collection<WaySegment> highlightWaySegments; 323 323 324 324 // highlight customization fields 325 325 private int highlightLineWidth; … … 327 327 private int widerHighlight; 328 328 private int highlightStep; 329 329 330 330 //flag that activate wider highlight mode 331 331 private boolean useWiderHighlight; … … 441 441 } 442 442 } 443 443 444 444 protected void drawArea(OsmPrimitive osm, Path2D.Double path, Color color, MapImage fillImage, TextElement text) { 445 445 … … 514 514 } 515 515 } 516 516 517 517 public void drawArea(Relation r, Color color, MapImage fillImage, TextElement text) { 518 518 Multipolygon multipolygon = MultipolygonCache.getInstance().get(nc, r); … … 529 529 } 530 530 } 531 531 532 532 public void drawArea(Way w, Color color, MapImage fillImage, TextElement text) { 533 533 drawArea(w, getPath(w), color, fillImage, text); … … 732 732 } 733 733 } 734 734 735 735 public void drawNodeIcon(Node n, Image img, float alpha, boolean selected, boolean member) { 736 736 Point p = nc.getPoint(n); … … 760 760 } 761 761 } 762 762 763 763 public void drawNodeSymbol(Node n, Symbol s, Color fillColor, Color strokeColor) { 764 764 Point p = nc.getPoint(n); … … 850 850 StyledMapRenderer.this.drawOrderNumber(p1, p2, orderNumber, clr); 851 851 } 852 852 853 853 /** 854 854 * highlights a given GeneralPath using the settings from BasicStroke to match the line's … … 883 883 } 884 884 } 885 885 886 886 public void drawRestriction(Image img, Point pVia, double vx, double vx2, double vy, double vy2, double angle, boolean selected) { 887 887 /* rotate image with direction last node in from to */ … … 898 898 } 899 899 } 900 900 901 901 public void drawRestriction(Relation r, MapImage icon) { 902 902 Way fromWay = null; … … 1073 1073 pVia, vx, vx2, vy, vy2, iconAngle, r.isSelected()); 1074 1074 } 1075 1075 1076 1076 public void drawTextOnPath(Way way, TextElement text) { 1077 1077 if (way == null || text == null) … … 1110 1110 double[] p1 = pointAt(t1, poly, pathLength); 1111 1111 double[] p2 = pointAt(t2, poly, pathLength); 1112 1112 1113 1113 if (p1 == null || p2 == null) 1114 1114 return; … … 1164 1164 } 1165 1165 } 1166 1166 1167 1167 /** 1168 1168 * draw way … … 1304 1304 this.backgroundColor = PaintColors.getBackgroundColor(); 1305 1305 } 1306 1306 1307 1307 @Override 1308 1308 protected void getSettings(boolean virtual) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r6010 r6069 96 96 /** 97 97 * Creates an wireframe render 98 * 98 * 99 99 * @param g the graphics context. Must not be null. 100 100 * @param nc the map viewport. Must not be null. … … 158 158 this.ds = data; 159 159 getSettings(virtual); 160 160 161 161 for (final Relation rel : data.searchRelations(bbox)) { 162 162 if (rel.isDrawable() && !ds.isSelected(rel) && !rel.isDisabledAndHidden()) { … … 181 181 } 182 182 displaySegments(); 183 183 184 184 // Display highlighted ways after the other ones (fix #8276) 185 185 for (List<Way> specialWays : Arrays.asList(new List[]{untaggedWays, highlightedWays})) { … … 190 190 displaySegments(); 191 191 } 192 192 193 193 for (final OsmPrimitive osm : data.getSelected()) { 194 194 if (osm.isDrawable()) { … … 274 274 } 275 275 } 276 276 277 277 private boolean isNodeTagged(Node n) { 278 278 return n.isTagged() || n.isAnnotated(); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r5410 r6069 50 50 * member role indicates that the member belongs to an <em>outer</em> or an 51 51 * <em>inner</em> polygon.</p> 52 * 52 * 53 53 * <p>The decision is taken based on preference settings, see the four preference keys 54 54 * above.</p> 55 * 55 * 56 56 */ 57 57 private static class MultipolygonRoleMatcher implements PreferenceChangedListener{ … … 209 209 buildPoly(); 210 210 } 211 211 212 212 private void buildPoly() { 213 213 boolean initial = true; … … 238 238 this.inners = new ArrayList<Multipolygon.PolyData>(copy.inners); 239 239 } 240 240 241 241 public Intersection contains(Path2D.Double p) { 242 242 int contains = 0; … … 262 262 appendInner(inner.poly); 263 263 } 264 264 265 265 private void appendInner(Path2D.Double inner) { 266 266 poly.append(inner.getPathIterator(null), false); … … 277 277 return bounds; 278 278 } 279 279 280 280 public Collection<Long> getWayIds() { 281 281 return wayIds; 282 282 } 283 283 284 284 private void resetNodes(DataSet dataSet) { 285 285 if (!nodes.isEmpty()) { … … 309 309 } 310 310 } 311 311 312 312 private void resetPoly() { 313 313 poly.reset(); … … 315 315 bounds = null; 316 316 } 317 317 318 318 public void nodeMoved(NodeMovedEvent event) { 319 319 final Node n = event.getNode(); … … 329 329 } 330 330 } 331 331 332 332 public void wayNodesChanged(WayNodesChangedEvent event) { 333 333 final Long wayId = event.getChangedWay().getUniqueId(); … … 350 350 private final List<PolyData> outerPolygons = new ArrayList<PolyData>(); 351 351 private final List<PolyData> combinedPolygons = new ArrayList<PolyData>(); 352 352 353 353 private boolean incomplete; 354 354 … … 389 389 } 390 390 } 391 391 392 392 public final boolean isIncomplete() { 393 393 return incomplete; … … 518 518 } 519 519 } 520 520 521 521 if (insideCount == 1) 522 522 return insidePolygon; … … 560 560 } 561 561 } 562 562 563 563 // Clear inner and outer polygons to reduce memory footprint 564 564 innerPolygons.clear(); -
trunk/src/org/openstreetmap/josm/data/preferences/AbstractProperty.java
r5464 r6069 53 53 Main.pref.put(getKey(), String.valueOf(getDefaultValue())); 54 54 } 55 55 56 56 /** 57 57 * Replies the value of this property. … … 60 60 */ 61 61 public abstract T get(); 62 62 63 63 /** 64 64 * Sets this property to the specified value. -
trunk/src/org/openstreetmap/josm/data/preferences/CachedProperty.java
r5478 r6069 50 50 return updateCount; 51 51 } 52 53 @Override 54 public T getDefaultValue() { 55 return fromString(getDefaultValueAsString()); 52 53 @Override 54 public T getDefaultValue() { 55 return fromString(getDefaultValueAsString()); 56 56 } 57 57 -
trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
r5239 r6069 100 100 return degree + (minute/60.0) + (second/3600.0); 101 101 } 102 102 103 103 public void dump() { 104 104 System.err.println("x_0="+x_0); -
trunk/src/org/openstreetmap/josm/data/projection/Projection.java
r5903 r6069 50 50 * If projection supports parameters, return a different code 51 51 * for each set of parameters. 52 * 52 * 53 53 * The EPSG code can be used (if defined for the projection). 54 54 * -
trunk/src/org/openstreetmap/josm/data/projection/datum/AbstractDatum.java
r4285 r6069 5 5 6 6 abstract public class AbstractDatum implements Datum { 7 7 8 8 protected String name; 9 9 protected String proj4Id; -
trunk/src/org/openstreetmap/josm/data/projection/datum/Datum.java
r4285 r6069 7 7 /** 8 8 * Represents a geodetic datum. 9 * 9 * 10 10 * Basically it provides conversion functions from and to the WGS84 datum. 11 11 */ … … 23 23 */ 24 24 String getProj4Id(); 25 25 26 26 /** 27 27 * @return the ellipsoid associated with this datum … … 33 33 */ 34 34 LatLon toWGS84(LatLon ll); 35 35 36 36 /** 37 37 * Convert lat/lon from WGS84 to this datum. -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java
r5926 r6069 17 17 public final static NTV2GridShiftFileWrapper BETA2007 = new NTV2GridShiftFileWrapper("resource://data/BETA2007.gsb"); 18 18 public final static NTV2GridShiftFileWrapper ntf_rgf93 = new NTV2GridShiftFileWrapper("resource://data/ntf_r93_b.gsb"); 19 19 20 20 21 21 private NTV2GridShiftFile instance = null; -
trunk/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java
r5551 r6069 7 7 /** 8 8 * Datum provides general conversion from one ellipsoid to another. 9 * 9 * 10 10 * Seven parameters can be specified: 11 11 * - 3D offset 12 12 * - general rotation 13 13 * - scale 14 * 14 * 15 15 * This method is described by EPSG as EPSG::9606. 16 16 * Also known as Bursa-Wolf. 17 17 */ 18 18 public class SevenParameterDatum extends AbstractDatum { 19 19 20 20 protected double dx, dy, dz, rx, ry, rz, s; 21 21 22 22 /** 23 * 23 * 24 24 * @param name name of the datum 25 25 * @param proj4Id Proj.4 identifier for this datum (or null) … … 61 61 return this.ellps.cart2LatLon(new double[] { x, y, z }); 62 62 } 63 63 64 64 } -
trunk/src/org/openstreetmap/josm/data/projection/datum/ThreeParameterDatum.java
r4285 r6069 9 9 */ 10 10 public class ThreeParameterDatum extends AbstractDatum { 11 11 12 12 protected double dx, dy, dz; 13 13 … … 36 36 return this.ellps.cart2LatLon(xyz); 37 37 } 38 38 39 39 } -
trunk/src/org/openstreetmap/josm/data/validation/Test.java
r6009 r6069 225 225 return progressMonitor.isCanceled(); 226 226 } 227 227 228 228 /** 229 229 * Build a Delete command on all primitives that have not yet been deleted manually by user, or by another error fix. -
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r6030 r6069 290 290 public int compareTo(TestError o) { 291 291 if (equals(o)) return 0; 292 292 293 293 MultipleNameVisitor v1 = new MultipleNameVisitor(); 294 294 MultipleNameVisitor v2 = new MultipleNameVisitor(); -
trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
r5908 r6069 39 39 protected static final int MULTIPLE_STREET_RELATIONS = 2604; 40 40 protected static final int HOUSE_NUMBER_TOO_FAR = 2605; 41 41 42 42 protected static final String ADDR_HOUSE_NUMBER = "addr:housenumber"; 43 43 protected static final String ADDR_INTERPOLATION = "addr:interpolation"; … … 45 45 protected static final String ADDR_STREET = "addr:street"; 46 46 protected static final String ASSOCIATED_STREET = "associatedStreet"; 47 47 48 48 protected class AddressError extends TestError { 49 49 … … 58 58 } 59 59 } 60 60 61 61 /** 62 62 * Constructor … … 65 65 super(tr("Addresses"), tr("Checks for errors in addresses and associatedStreet relations.")); 66 66 } 67 67 68 68 protected List<Relation> getAndCheckAssociatedStreets(OsmPrimitive p) { 69 69 List<Relation> list = OsmPrimitive.getFilteredList(p.getReferrers(), Relation.class); … … 150 150 List<OsmPrimitive> list = map.get(key); 151 151 if (list.size() > 1) { 152 errors.add(new AddressError(DUPLICATE_HOUSE_NUMBER, list, 152 errors.add(new AddressError(DUPLICATE_HOUSE_NUMBER, list, 153 153 tr("Duplicate house numbers"), tr(description_en, key), description_en)); 154 154 } … … 156 156 // Report wrong street names 157 157 if (!wrongStreetNames.isEmpty()) { 158 errors.add(new AddressError(MULTIPLE_STREET_NAMES, wrongStreetNames, 158 errors.add(new AddressError(MULTIPLE_STREET_NAMES, wrongStreetNames, 159 159 tr("Multiple street names in relation"))); 160 160 } … … 169 169 } 170 170 } 171 171 172 172 protected void checkDistance(OsmPrimitive house, Collection<Way> street) { 173 173 EastNorth centroid; … … 207 207 List<OsmPrimitive> errorList = new ArrayList<OsmPrimitive>(street); 208 208 errorList.add(0, house); 209 errors.add(new AddressError(HOUSE_NUMBER_TOO_FAR, errorList, 209 errors.add(new AddressError(HOUSE_NUMBER_TOO_FAR, errorList, 210 210 tr("House number too far from street"))); 211 211 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/BuildingInBuilding.java
r5522 r6069 81 81 } 82 82 } 83 83 84 84 protected boolean sameLayers(Way w1, Way w2) { 85 85 String l1 = w1.get("layer") != null ? w1.get("layer") : "0"; … … 87 87 return l1.equals(l2); 88 88 } 89 89 90 90 protected boolean isWayInsideMultiPolygon(Way object, Relation multiPolygon) { 91 91 // Extract outer/inner members from multipolygon … … 115 115 return false; 116 116 } 117 117 118 118 @Override 119 119 public void endTest() { 120 120 for (final OsmPrimitive p : primitivesToCheck) { 121 121 Collection<Way> outers = new FilteredCollection<Way>(index.search(p.getBBox()), new Predicate<Way>() { 122 122 123 123 protected boolean evaluateNode(Node n, Way object) { 124 124 return isInPolygon(n, object.getNodes()) || object.getNodes().contains(n); 125 125 } 126 126 127 127 protected boolean evaluateWay(Way w, Way object) { 128 128 if (w.equals(object)) return false; 129 129 130 130 // Get all multipolygons referencing object 131 131 Collection<OsmPrimitive> buildingMultiPolygons = new FilteredCollection<OsmPrimitive>(object.getReferrers(), new Predicate<OsmPrimitive>() { … … 135 135 } 136 136 }) ; 137 137 138 138 // if there's none, test if w is inside object 139 139 if (buildingMultiPolygons.isEmpty()) { … … 153 153 } 154 154 } 155 155 156 156 protected boolean evaluateRelation(Relation r, Way object) { 157 157 MultiPolygonMembers mpm = new MultiPolygonMembers((Relation) p); … … 163 163 return false; 164 164 } 165 165 166 166 @Override 167 167 public boolean evaluate(Way object) { … … 177 177 } 178 178 }); 179 179 180 180 if (!outers.isEmpty()) { 181 181 errors.add(new TestError(this, Severity.WARNING, -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r5995 r6069 145 145 continue; 146 146 } 147 147 148 148 // report errors 149 149 errors.addAll(buildTestErrors(this, nodes)); … … 401 401 target = nodes.iterator().next(); 402 402 } 403 403 404 404 if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, Collections.singleton(target))) 405 405 return MergeNodesAction.mergeNodes(Main.main.getEditLayer(), nodes, target); -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
r5700 r6069 92 92 /** Bag of all ways, regardless of tags */ 93 93 private MultiMap<WayPairNoTags, OsmPrimitive> waysNoTags; 94 94 95 95 /** Set of known hashcodes for list of coordinates **/ 96 96 private Set<Integer> knownHashCodes; -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r5688 r6069 252 252 } 253 253 } 254 254 255 255 private void addRelationIfNeeded(TestError error, Relation r) { 256 // Fix #8212 : if the error references only incomplete primitives, 257 // add multipolygon in order to let user select something and fix the error 256 // Fix #8212 : if the error references only incomplete primitives, 257 // add multipolygon in order to let user select something and fix the error 258 258 Collection<? extends OsmPrimitive> primitives = error.getPrimitives(); 259 259 if (!primitives.contains(r)) { … … 268 268 } 269 269 } 270 270 271 271 private void addError(Relation r, TestError error) { 272 272 addRelationIfNeeded(error, r); -
trunk/src/org/openstreetmap/josm/data/validation/tests/NodesDuplicatingWayTags.java
r5272 r6069 20 20 * <p> 21 21 * See JOSM ticket #7639 for the original request. 22 * 22 * 23 23 * @author Mrwojo 24 24 */ -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r6068 r6069 419 419 if (checkValues && value != null && value.length() > 0 && presetsValueData != null) { 420 420 final Set<String> values = presetsValueData.get(key); 421 final boolean keyInPresets = values != null; 421 final boolean keyInPresets = values != null; 422 422 final boolean tagInPresets = values != null && (values.isEmpty() || values.contains(prop.getValue())); 423 423 424 424 boolean ignore = false; 425 425 for (String a : ignoreDataStartsWith) { … … 438 438 } 439 439 } 440 440 441 441 if (!tagInPresets) { 442 442 for (IgnoreKeyPair a : ignoreDataKeyPair) { … … 446 446 } 447 447 } 448 448 449 449 if (!ignore) { 450 450 if (!keyInPresets) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java
r5199 r6069 157 157 Way previous = (Way) via.get(i - 1); 158 158 Way current = (Way) via.get(i); 159 checkIfConnected(previous, current, 159 checkIfConnected(previous, current, 160 160 tr("The \"via\" ways are not connected."), UNCONNECTED_VIA); 161 161 } … … 165 165 return; 166 166 } 167 checkIfConnected((Way) via.get(via.size() - 1), toWay, 167 checkIfConnected((Way) via.get(via.size() - 1), toWay, 168 168 tr("The last \"via\" and the \"to\" way are not connected."), TO_VIA_WAY); 169 169 -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
r5352 r6069 52 52 NAMED_WAYS.add( "pedestrian" ); ; 53 53 } 54 54 55 55 /** Whitelist of roles allowed to reference an untagged way */ 56 56 public static final Set<String> WHITELIST = new HashSet<String>(); -
trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java
r6010 r6069 20 20 { 21 21 public static final int MULTIPLE_NAME_MAX_LENGTH = 80; 22 22 23 23 /** The class name of the combined primitives */ 24 24 private String multipleClassname;
Note:
See TracChangeset
for help on using the changeset viewer.