Changeset 6069 in josm


Ignore:
Timestamp:
2013-07-17T00:01:07+02:00 (11 years ago)
Author:
stoecker
Message:

see #8853 remove tabs, trailing spaces, windows line ends, strange characters

Location:
trunk/src/org/openstreetmap/josm
Files:
117 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r5886 r6069  
    100100        panel.setPreferredSize(new Dimension(600, 300));
    101101        panel.add(about, GBC.std().fill());
    102        
     102
    103103        GuiHelper.prepareResizeableOptionPane(panel, panel.getPreferredSize());
    104104        JOptionPane.showMessageDialog(Main.parent, panel, tr("About JOSM..."),
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r6000 r6069  
    113113        return null;
    114114    }
    115    
     115
    116116    protected boolean isLayerAlreadyPresent() {
    117117        if (Main.isDisplayingMapView()) {
  • trunk/src/org/openstreetmap/josm/actions/AddNodeAction.java

    r5926 r6069  
    4444
    4545        dialog.showDialog();
    46        
     46
    4747        if (dialog.getValue() != 1)
    4848            return;
  • trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java

    r5719 r6069  
    240240        setEnabled(selection != null && !selection.isEmpty());
    241241    }
    242    
     242
    243243    /**
    244244     * 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  
    4747        marktr("previous"),
    4848        marktr("next")};
    49    
     49
    5050    private final String mode;
    5151
     
    123123    public AutoScaleAction(final String mode) {
    124124        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),
    126126                true, null, false);
    127127        String modeHelp = Character.toUpperCase(mode.charAt(0)) + mode.substring(1);
  • trunk/src/org/openstreetmap/josm/actions/CopyAction.java

    r5953 r6069  
    1919
    2020/**
    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.
    2222 * @since 404
    2323 */
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r5818 r6069  
    130130    }
    131131
    132     /** 
     132    /**
    133133      * Enable this action only if something is selected
    134134      *
     
    185185    /**
    186186     * 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
    188188     * @param relation the multipolygon style relation to process
    189189     * @return a list of commands to execute
     
    212212                Way way = m.getWay();
    213213                outerWays.add(way);
    214                
     214
    215215                for( String key : way.keySet() ) {
    216216                    if( !values.containsKey(key) ) { //relation values take precedence
  • trunk/src/org/openstreetmap/josm/actions/DialogsToggleAction.java

    r6019 r6069  
    1717
    1818/*
    19 * Action that hides or shows toggle dialogs panel and other panels 
     19* Action that hides or shows toggle dialogs panel and other panels
    2020* to free more space for drawing (GIMP-like)
    2121* @author cmuelle8
  • trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java

    r5438 r6069  
    1818    /**
    1919     * Constructs a new {@code DiskAccessAction}.
    20      * 
     20     *
    2121     * @param name The action's text as displayed on the menu (if it is added to a menu)
    2222     * @param iconName The filename of the icon to use
     
    4747    /**
    4848     * 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
    5050     * @param multiple If true, makes the dialog allow multiple file selections
    5151     * @param title The string that goes in the dialog window's title bar
     
    5959    /**
    6060     * 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
    6262     * @param multiple If true, makes the dialog allow multiple file selections
    6363     * @param title The string that goes in the dialog window's title bar
     
    7272    /**
    7373     * 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
    7575     * @param multiple If true, makes the dialog allow multiple file selections
    7676     * @param title The string that goes in the dialog window's title bar
    7777     * @param extension The file extension that will be selected as the default file filter
    7878     * @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>
    8181     *                      <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.
    8383     *                 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.
    8585     *        This property will then be updated to the new "last directory" chosen by the user. If null, the default property "lastDirectory" will be used.
    8686     * @return The {@code JFileChooser}.
     
    9393    /**
    9494     * 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
    9696     * @param multiple If true, makes the dialog allow multiple file selections
    9797     * @param title The string that goes in the dialog window's title bar
    9898     * @param filter The only file filter that will be proposed by the dialog
    9999     * @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>
    102102     *                      <li>select both files and directories ({@code JFileChooser.FILES_AND_DIRECTORIES})</li>
    103103     * @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
     
    111111    /**
    112112     * 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
    114114     * @param multiple If true, makes the dialog allow multiple file selections
    115115     * @param title The string that goes in the dialog window's title bar
     
    117117     * @param defaultFilter The file filter that will be selected by default
    118118     * @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>
    121121     *                      <li>select both files and directories ({@code JFileChooser.FILES_AND_DIRECTORIES})</li>
    122122     * @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
     
    124124     * @since 5438
    125125     */
    126     public static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title, 
     126    public static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title,
    127127            Collection<? extends FileFilter> filters, FileFilter defaultFilter, int selectionMode, String lastDirProperty) {
    128128        return new JFileChooserManager(open, lastDirProperty).createFileChooser(multiple, title, filters, defaultFilter, selectionMode).openFileChooser();
  • trunk/src/org/openstreetmap/josm/actions/DistributeAction.java

    r6006 r6069  
    4040        putValue("help", ht("/Action/DistributeNodes"));
    4141    }
    42    
     42
    4343    /**
    4444     * The general algorithm here is to find the two selected nodes
     
    6666                }
    6767        }
    68        
     68
    6969        Set<Node> ignoredNodes = removeNodesWithoutCoordinates(nodes);
    7070        ignoredNodes.addAll(removeNodesWithoutCoordinates(itnodes));
     
    149149        Main.map.repaint();
    150150    }
    151    
     151
    152152    private Set<Node> removeNodesWithoutCoordinates(Collection<Node> col) {
    153153        Set<Node> result = new HashSet<Node>();
  • trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java

    r5566 r6069  
    109109     * support new file extensions. The old AllFormatsImporter doesn’t include the new
    110110     * extensions and thus will not display these files.
    111      * 
     111     *
    112112     * @since 5131
    113113     */
     
    196196     * @param fileChooser the file chooser
    197197     * @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.
    199199     *                 If false, only the file filters that include {@code extension} will be proposed
    200200     * @since 5438
     
    215215     * @param fileChooser the file chooser
    216216     * @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.
    218218     *                 If false, only the file filters that include {@code extension} will be proposed
    219219     * @since 5438
     
    268268
    269269    /**
    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.
    271271     * @return the comma-separated list of file extensions of this file filter, as a String
    272272     * @since 5131
  • trunk/src/org/openstreetmap/josm/actions/FollowLineAction.java

    r4982 r6069  
    6363            return;
    6464        if (!(Main.map.mapMode instanceof DrawAction)) return; // We are not on draw mode
    65        
     65
    6666        Collection<Node> selectedPoints = osmLayer.data.getSelectedNodes();
    6767        Collection<Way> selectedLines = osmLayer.data.getSelectedWays();
    6868        if ((selectedPoints.size() > 1) || (selectedLines.size() != 1)) // Unsuitable selection
    6969            return;
    70        
     70
    7171        Node last = ((DrawAction) Main.map.mapMode).getCurrentBaseNode();
    7272        if (last == null)
     
    8383        List<OsmPrimitive> referrers = last.getReferrers();
    8484        if (referrers.size() < 2) return; // There's nothing to follow
    85        
    86         Node newPoint = null;       
     85
     86        Node newPoint = null;
    8787        Iterator<OsmPrimitive> i = referrers.iterator();
    8888        while (i.hasNext()) {
     
    119119            osmLayer.data.addSelected(newFollower);
    120120            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.
    123123            if (Main.map.mapView.viewportFollowing) {
    124124                Main.map.mapView.smoothScrollTo(newPoint.getEastNorth());
  • trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java

    r5886 r6069  
    3939        private final Pattern idValidator;
    4040        public JRadioButton btn;
    41        
     41
    4242        /**
    4343         * @param name Name of the rectifing service
  • trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java

    r5897 r6069  
    5757        });
    5858    }
    59    
     59
    6060    public void merge(List<Layer> sourceLayers) {
    6161        doMerge(sourceLayers, sourceLayers);
     
    9393        });
    9494    }
    95    
     95
    9696    /**
    9797     * returns true if the user wants to cancel, false if they want to continue
  • trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java

    r5360 r6069  
    3939        if (targetLayer == null)
    4040            return;
    41         if (getEditLayer().isUploadDiscouraged() && targetLayer instanceof OsmDataLayer && !((OsmDataLayer)targetLayer).isUploadDiscouraged() 
     41        if (getEditLayer().isUploadDiscouraged() && targetLayer instanceof OsmDataLayer && !((OsmDataLayer)targetLayer).isUploadDiscouraged()
    4242                && getEditLayer().data.getAllSelected().size() > 1) {
    4343            if (warnMergingUploadDiscouragedObjects(targetLayer)) {
     
    6868        setEnabled(selection != null && !selection.isEmpty());
    6969    }
    70    
     70
    7171    /**
    7272     * returns true if the user wants to cancel, false if they want to continue
  • trunk/src/org/openstreetmap/josm/actions/MoveAction.java

    r5377 r6069  
    115115        ? Main.main.undoRedo.commands.getLast() : null;
    116116
    117         getCurrentDataSet().beginUpdate(); 
     117        getCurrentDataSet().beginUpdate();
    118118        if (c instanceof MoveCommand && affectedNodes.equals(((MoveCommand)c).getParticipatingPrimitives())) {
    119119            ((MoveCommand)c).moveAgain(distx, disty);
     
    122122                    c = new MoveCommand(selection, distx, disty));
    123123        }
    124         getCurrentDataSet().endUpdate(); 
    125        
     124        getCurrentDataSet().endUpdate();
     125
    126126        for (Node n : affectedNodes) {
    127127            if (n.getCoor().isOutSideWorld()) {
  • trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java

    r5874 r6069  
    287287                    }
    288288                }
    289                
     289
    290290                for (File urlFile: urlFiles) {
    291291                    try {
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r6040 r6069  
    4646
    4747    protected final List<Class<? extends DownloadTask>> downloadTasks;
    48    
     48
    4949    /**
    5050     * Create an open action. The name is "Open a file".
     
    123123        openUrl(layer.isSelected(), Utils.strip(uploadAddresses.getText()));
    124124    }
    125    
     125
    126126    /**
    127127     * Replies the list of download tasks accepting the given url.
     
    192192        }
    193193    }
    194    
     194
    195195    /**
    196196     * Adds a new download task to the supported ones.
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r5736 r6069  
    198198        }
    199199    }
    200    
     200
    201201    /**
    202202     * Collect groups of ways with common nodes in order to orthogonalize each group separately.
     
    216216        return groups;
    217217    }
    218    
     218
    219219    private static void extendGroupRec(List<WayData> group, WayData newGroupMember, List<WayData> remaining) {
    220220        group.add(newGroupMember);
     
    427427         * Then sum up all horizontal / vertical segments to have a good guess for the
    428428         * heading of the entire way.
    429          * @throws InvalidUserInputException 
     429         * @throws InvalidUserInputException
    430430         */
    431431        public void calcDirections(Direction pInitialDirection) throws InvalidUserInputException {
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r5915 r6069  
    3939
    4040    private static final String help = ht("/Action/PasteTags");
    41    
     41
    4242    public PasteTagsAction() {
    4343        super(tr("Paste Tags"), "pastetags",
     
    170170
    171171        /**
    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>
    173173         * is in the target collection
    174174         *
     
    248248        if (selection.isEmpty())
    249249            return;
    250        
     250
    251251        String buf = Utils.getClipboardContent();
    252252        if (buf == null || buf.isEmpty() || buf.matches("(\\d+,)*\\d+")) {
    253253            pasteTagsFromJOSMBuffer(selection);
    254         } else { 
     254        } else {
    255255            // Paste tags from arbitrary text
    256256            pasteTagsFromText(selection, buf);
     
    277277        return !commands.isEmpty();
    278278    }
    279        
     279
    280280    /** Paste tags from JOSM buffer
    281281     * @param selection objects that will have the tags
    282      * @return false if JOSM buffer was empty 
     282     * @return false if JOSM buffer was empty
    283283     */
    284284    public static boolean pasteTagsFromJOSMBuffer(Collection<OsmPrimitive> selection) {
     
    297297    /**
    298298     * Create and execute SequenceCommand with descriptive title
    299      * @param commands 
     299     * @param commands
    300300     */
    301301    private static void commitCommands(Collection<OsmPrimitive> selection, List<Command> commands) {
     
    309309                    ));
    310310        }
    311     } 
    312    
     311    }
     312
    313313    @Override
    314314    protected void updateEnabledState() {
  • trunk/src/org/openstreetmap/josm/actions/RestartAction.java

    r5967 r6069  
    4848        }
    4949    }
    50    
     50
    5151    /**
    5252     * Determines if restarting the application should be possible on this platform.
     
    5757        return System.getProperty("sun.java.command") != null;
    5858    }
    59    
     59
    6060    /**
    6161     * Restarts the current Java application
     
    6666        try {
    6767            // 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 +
    6969                    (Main.platform instanceof PlatformHookWindows ? "java.exe" : "java");
    7070            if (!new File(java).isFile()) {
     
    8080                }
    8181            }
    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)
    8383            String[] mainCommand = System.getProperty("sun.java.command").split(" ");
    8484            // program main is a jar
     
    115115        }
    116116    }
    117    
     117
    118118    /**
    119119     * Returns a new {@code ButtonSpec} instance that performs this action.
     
    142142        );
    143143    }
    144    
     144
    145145    /**
    146146     * Returns default {@code ButtonSpec} instances for this action (Restart/Cancel).
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r6011 r6069  
    118118     * Creates a new "Save" dialog for a single {@link ExtensionFileFilter} and makes it visible.<br/>
    119119     * When the user has chosen a file, checks the file extension, and confirms overwrite if needed.
    120      * 
     120     *
    121121     * @param title The dialog title
    122122     * @param filter The dialog file filter
     
    133133     * Creates a new "Save" dialog for a given file extension and makes it visible.<br/>
    134134     * When the user has chosen a file, checks the file extension, and confirms overwrite if needed.
    135      * 
     135     *
    136136     * @param title The dialog title
    137137     * @param extension The file extension
     
    143143        return checkFileAndConfirmOverWrite(fc, extension);
    144144    }
    145    
     145
    146146    private static File checkFileAndConfirmOverWrite(JFileChooser fc, String extension) {
    147147        if (fc == null) return null;
    148148        File file = fc.getSelectedFile();
    149        
     149
    150150        FileFilter ff = fc.getFileFilter();
    151151        if (!ff.accept(file)) {
  • trunk/src/org/openstreetmap/josm/actions/SaveAsAction.java

    r5459 r6069  
    1818public class SaveAsAction extends SaveActionBase {
    1919    private static SaveAsAction instance = new SaveAsAction();
    20    
     20
    2121    /**
    2222     * Construct the action with "Save" as label.
     
    2828        putValue("help", ht("/Action/SaveAs"));
    2929    }
    30    
     30
    3131    public static SaveAsAction getInstance() {
    3232        return instance;
  • trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java

    r5926 r6069  
    2626
    2727public class SessionLoadAction extends DiskAccessAction {
    28    
     28
    2929    public SessionLoadAction() {
    3030        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  
    7373            }
    7474        }
    75        
     75
    7676        FileFilter joz = new ExtensionFileFilter("joz", "joz", tr("Session file (archive) (*.joz)"));
    7777        FileFilter jos = new ExtensionFileFilter("jos", "jos", tr("Session file (*.jos)"));
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r5992 r6069  
    4141 */
    4242public final class ShowStatusReportAction extends JosmAction {
    43    
     43
    4444    /**
    4545     * Constructs a new {@code ShowStatusReportAction}
     
    6363        }
    6464    }
    65    
     65
    6666    /**
    6767     * Replies the report header (software and system info)
  • trunk/src/org/openstreetmap/josm/actions/UploadAction.java

    r5621 r6069  
    155155        );
    156156    }
    157    
     157
    158158    /**
    159159     * returns true if the user wants to cancel, false if they
  • trunk/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java

    r5460 r6069  
    2828        );
    2929        putValue("help", ht("/Action/ViewportFollowing"));
    30         selected = false; 
     30        selected = false;
    3131        notifySelectedState();
    3232    }
  • trunk/src/org/openstreetmap/josm/actions/WireframeToggleAction.java

    r5925 r6069  
    3030                false /* register toolbar */
    3131        );
    32         putValue("toolbar", "wireframe"); 
     32        putValue("toolbar", "wireframe");
    3333        Main.toolbar.register(this);
    3434        selected = MapRendererFactory.getInstance().isWireframeMapRendererActive();
     
    6060        selected = !selected;
    6161        //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
    6868        notifySelectedState();
    6969        if (Main.isDisplayingMapView()) {
     
    7171        }
    7272    }
    73    
     73
    7474    public void actionPerformed(ActionEvent e) {
    7575        toggleSelectedState();
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioBackAction.java

    r5871 r6069  
    1616
    1717/**
    18  * Jump the audio backward 10 seconds and start playing if paused. 
     18 * Jump the audio backward 10 seconds and start playing if paused.
    1919 * @since 547
    2020 */
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java

    r5871 r6069  
    1919    /**
    2020     * Constructs a new {@code AudioFastSlowAction}.
    21      * 
     21     *
    2222     * @param name the action's text as displayed on the menu (if it is added to a menu)
    2323     * @param iconName the filename of the icon to use
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioFasterAction.java

    r5871 r6069  
    1212/**
    1313 * 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.
    1515 * @since 563
    1616 */
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioFwdAction.java

    r5871 r6069  
    1919 */
    2020public class AudioFwdAction extends JosmAction {
    21    
     21
    2222    /**
    2323     * Constructs a new {@code AudioFwdAction}.
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioNextAction.java

    r5871 r6069  
    1414/**
    1515 * 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.
    1717 * @since 547
    1818 */
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java

    r5945 r6069  
    1717 * If not playing, play the sound track from the first Audio Marker, or from the point at which it was paused.<br/>
    1818 * 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.
    2020 * @since 547
    2121 */
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioPrevAction.java

    r5871 r6069  
    1414/**
    1515 * 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.
    1717 * @since 547
    1818 */
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioSlowerAction.java

    r5871 r6069  
    1212/**
    1313 * 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.
    1515 * @since 563
    1616 */
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java

    r6040 r6069  
    4747        return errorMessages;
    4848    }
    49    
     49
    5050    @Override
    5151    public String acceptsDocumentationSummary() {
     
    6060                buf.append(XmlWriter.encode(pattern));
    6161                buf.append("</li>");
    62             } 
     62            }
    6363            buf.append("</ul>");
    6464        }
     
    9090        return new String[]{};
    9191    }
    92    
     92
    9393}
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java

    r6031 r6069  
    126126                return;
    127127            String name = newLayerName != null ? newLayerName : tr("Downloaded GPX Data");
    128            
     128
    129129            GpxImporterData layers = GpxImporter.loadLayers(rawData, reader.isGpxParsedProperly(), name, tr("Markers from {0}", name));
    130            
     130
    131131            GpxLayer gpxLayer = addOrMergeLayer(layers.getGpxLayer(), findGpxMergeLayer());
    132132            addOrMergeLayer(layers.getMarkerLayer(), findMarkerMergeLayer(gpxLayer));
    133            
     133
    134134            layers.getPostLayerTask().run();
    135135        }
    136        
     136
    137137        private <L extends Layer> L addOrMergeLayer(L layer, L mergeLayer) {
    138138            if (layer == null) return null;
     
    160160            return null;
    161161        }
    162        
     162
    163163        private MarkerLayer findMarkerMergeLayer(GpxLayer fromLayer) {
    164164            if (!Main.isDisplayingMapView())
     
    189189        return null;
    190190    }
    191    
     191
    192192    /**
    193193     * Determines if the given URL denotes an OSM gpx-related API call.
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r6031 r6069  
    3636 */
    3737public class DownloadOsmTask extends AbstractDownloadTask {
    38    
     38
    3939    private static final String PATTERN_OSM_API_URL           = "http://.*/api/0.6/(map|nodes?|ways?|relations?|\\*).*";
    4040    private static final String PATTERN_OVERPASS_API_URL      = "http://.*/interpreter\\?data=.*";
    4141    private static final String PATTERN_OVERPASS_API_XAPI_URL = "http://.*/xapi\\?.*\\[@meta\\].*";
    4242    private static final String PATTERN_EXTERNAL_OSM_FILE     = "https?://.*/.*\\.osm";
    43    
     43
    4444    protected Bounds currentBounds;
    4545    protected DataSet downloadedData;
    4646    protected DownloadTask downloadTask;
    47    
     47
    4848    protected OsmDataLayer targetLayer;
    49    
     49
    5050    protected String newLayerName = null;
    51    
     51
    5252    @Override
    5353    public String[] getPatterns() {
    5454        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,
    5656                PATTERN_OVERPASS_API_XAPI_URL, PATTERN_EXTERNAL_OSM_FILE};
    5757        } else {
     
    149149        return url;
    150150    }
    151    
     151
    152152    /**
    153153     * Loads a given URL from the OSM Server
     
    159159        if (url.matches(PATTERN_OVERPASS_API_URL)) {
    160160            url = encodePartialUrl(url, "/interpreter?data="); // encode only the part after the = sign
    161            
     161
    162162        } else if (url.matches(PATTERN_OVERPASS_API_XAPI_URL)) {
    163163            url = encodePartialUrl(url, "/xapi?"); // encode only the part after the ? sign
     
    171171        return Main.worker.submit(downloadTask);
    172172    }
    173    
     173
    174174    protected final void extractOsmFilename(String pattern, String url) {
    175175        Matcher matcher = Pattern.compile(pattern).matcher(url);
     
    194194            this.newLayer = newLayer;
    195195        }
    196        
     196
    197197        protected DataSet parseDataSet() throws OsmTransferException {
    198198            return reader.parseOsm(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
     
    247247            return null;
    248248        }
    249        
     249
    250250        protected OsmDataLayer createNewLayer(String layerName) {
    251251            if (layerName == null || layerName.isEmpty()) {
     
    254254            return new OsmDataLayer(dataSet, layerName, null);
    255255        }
    256        
     256
    257257        protected OsmDataLayer createNewLayer() {
    258258            return createNewLayer(null);
     
    297297            }
    298298        }
    299        
     299
    300300        protected void computeBboxAndCenterScale() {
    301301            BoundingXYVisitor v = new BoundingXYVisitor();
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java

    r6032 r6069  
    1414 */
    1515public interface DownloadTask {
    16    
     16
    1717    /**
    1818     * Asynchronously launches the download task for a given bounding box.
     
    7171     */
    7272    Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor);
    73    
     73
    7474    /**
    7575     * Returns true if the task is able to open the given URL, false otherwise.
     
    8585     */
    8686    String acceptsDocumentationSummary();
    87    
     87
    8888    /**
    8989     * Returns human-readable description of the task
     
    9292     */
    9393    String getTitle();
    94    
     94
    9595    /**
    9696     * Returns regular expressions that match the URLs
     
    114114     */
    115115    public void cancel();
    116    
     116
    117117    /**
    118118     * Replies the HTML-formatted confirmation message to be shown to user when the given URL needs to be confirmed before loading.
    119119     * @param url The URL to be confirmed
    120120     * @return The HTML-formatted confirmation message to be shown to user
    121      * @since 
     121     * @since
    122122     */
    123123    public String getConfirmationMessage(URL url);
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java

    r6053 r6069  
    4646    private List<Future<?>> taskFutures = new LinkedList<Future<?>>();
    4747    private ProgressMonitor progressMonitor;
    48    
     48
    4949    private void addDownloadTask(DownloadTask dt, Rectangle2D td, int i, int n) {
    5050        ProgressMonitor childProgress = progressMonitor.createSubTaskMonitor(1, false);
     
    5454        tasks.add(dt);
    5555    }
    56    
     56
    5757    /**
    5858     * Downloads a list of areas from the OSM Server
     
    6161     * @param osmData Set to true if OSM data should be downloaded
    6262     * @param gpxData Set to true if GPX data should be downloaded
    63      * @param progressMonitor The progress monitor 
     63     * @param progressMonitor The progress monitor
    6464     * @return The Future representing the asynchronous download task
    6565     */
     
    7171            Main.map.mapView.setActiveLayer(l);
    7272        }
    73        
     73
    7474        int n = (osmData && gpxData ? 2 : 1)*rects.size();
    7575        progressMonitor.beginTask(null, n);
     
    230230
    231231        private final boolean osmData;
    232        
     232
    233233        public PostDownloadProcessor(boolean osmData) {
    234234            this.osmData = osmData;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r6026 r6069  
    257257     * calls the cursor and target highlighting routines. Allows for modifiers
    258258     * not taken from the given mouse event.
    259      * 
     259     *
    260260     * Normally the mouse event also contains the modifiers. However, when the
    261261     * mouse is not moved and only modifier keys are pressed, no mouse event
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r6027 r6069  
    121121    private Stroke rubberLineStroke;
    122122    private static final BasicStroke BASIC_STROKE = new BasicStroke(1);
    123    
     123
    124124    public DrawAction(MapFrame mapFrame) {
    125125        super(tr("Draw"), "node/autonode", tr("Draw nodes"),
     
    204204            return;
    205205        super.enterMode();
    206        
     206
    207207        rubberLineColor = Main.pref.getColor(marktr("helper line"), null);
    208208        if (rubberLineColor == null) rubberLineColor = PaintColors.SELECTED.get();
    209        
     209
    210210        rubberLineStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.stroke.helper-line","3"));
    211211        drawHelperLine = Main.pref.getBoolean("draw.helper-line", true);
     
    773773        updateKeyModifiers(e);
    774774        mousePos = e.getPoint();
    775         if (snapHelper.isSnapOn() && ctrl) 
     775        if (snapHelper.isSnapOn() && ctrl)
    776776            tryToSetBaseSegmentForAngleSnap();
    777          
     777
    778778        computeHelperLine();
    779779        addHighlighting();
    780780    }
    781    
     781
    782782    /**
    783783     * This method is used to detect segment under mouse and use it as reference for angle snapping
     
    888888        currentBaseNode = null;
    889889        previousNode = null;
    890        
     890
    891891        // Try to find an open way to measure angle from it. The way is not to be continued!
    892892        // warning: may result in changes of currentBaseNode and previousNode
     
    895895            for (OsmPrimitive p: selectedNode.getReferrers()) {
    896896                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
    898898                        selectedWay=null;
    899899                        break;
     
    904904                }
    905905            }
    906         } 
    907        
     906        }
     907
    908908        if (selectedNode == null) {
    909909            if (selectedWay == null)
     
    916916        }
    917917    }
    918    
     918
    919919    /**
    920920     * if one of the ends of @param way is given @param node ,
     
    13491349        JCheckBoxMenuItem checkBox;
    13501350        public final Color ORANGE_TRANSPARENT = new Color(Color.ORANGE.getRed(),Color.ORANGE.getGreen(),Color.ORANGE.getBlue(),128);
    1351    
     1351
    13521352        public void init() {
    13531353            snapOn=false;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r6050 r6069  
    7373    private Color mainColor;
    7474    private Stroke mainStroke;
    75    
     75
    7676    /**
    7777     * drawing settings for helper lines
     
    8888    private List<ReferenceSegment> possibleMoveDirections;
    8989
    90    
     90
    9191    /**
    9292     * Collection of nodes that is moved
     
    238238        if (e.getButton() != MouseEvent.BUTTON1)
    239239            return;
    240        
     240
    241241        requestFocusInMapView();
    242242        updateKeyModifiers(e);
    243        
     243
    244244        selectedNode = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive.isSelectablePredicate);
    245245        selectedSegment = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive.isSelectablePredicate);
    246        
     246
    247247        // If nothing gets caught, stay in select mode
    248248        if (selectedSegment == null && selectedNode == null) return;
    249        
     249
    250250        if (selectedNode != null) {
    251251            if (ctrl || nodeDragWithoutCtrl) {
     
    253253                movingNodeList.add(selectedNode);
    254254                calculatePossibleDirectionsByNode();
    255                 if (possibleMoveDirections.isEmpty()) { 
     255                if (possibleMoveDirections.isEmpty()) {
    256256                    // if no directions fould, do not enter dragging mode
    257257                    return;
     
    278278            calculatePossibleDirectionsBySegment();
    279279        }
    280        
     280
    281281        // Signifies that nothing has happened yet
    282282        newN1en = null;
     
    386386        }
    387387    }
    388    
     388
    389389    /**
    390390     * Insert node into nearby segment
    391      * @param e - current mouse point 
     391     * @param e - current mouse point
    392392     */
    393393    private void addNewNode(MouseEvent e) {
     
    488488        Main.main.undoRedo.add(c);
    489489    }
    490    
     490
    491491    /**
    492492     * This method tests if a node has other ways apart from the given one.
     
    502502        return false;
    503503    }
    504    
     504
    505505    /**
    506506     * Determine best movenemnt from initialMousePos  to current position @param mouseEn,
    507507     * choosing one of the directions @field possibleMoveDirections
    508      * @return movement vector 
     508     * @return movement vector
    509509     */
    510510    private EastNorth calculateBestMovement(EastNorth mouseEn) {
    511        
     511
    512512        EastNorth initialMouseEn = Main.map.mapView.getEastNorth(initialMousePos.x, initialMousePos.y);
    513513        EastNorth mouseMovement = initialMouseEn.sub(mouseEn);
    514        
     514
    515515        double bestDistance = Double.POSITIVE_INFINITY;
    516516        EastNorth bestMovement = null;
     
    565565        initialN1en = selectedSegment.getFirstNode().getEastNorth();
    566566        initialN2en = selectedSegment.getSecondNode().getEastNorth();
    567            
     567
    568568        //add direction perpendicular to the selected segment
    569569        possibleMoveDirections = new ArrayList<ReferenceSegment>();
     
    573573                ), initialN1en, initialN2en, true));
    574574
    575        
     575
    576576        //add directions parallel to neighbor segments
    577577        Node prevNode = getPreviousNode(selectedSegment.lowerIndex);
     
    593593        }
    594594    }
    595    
     595
    596596    /**
    597597     * Gather possible move directions - along all adjacent segments
     
    609609                        initialN1en.getX() - en.getX(),
    610610                        initialN1en.getY() - en.getY()
    611                     ), initialN1en, en, false));                                   
     611                    ), initialN1en, en, false));
    612612                }
    613613            }
    614614        }
    615615    }
    616    
     616
    617617    /**
    618618     * Gets a node from selected way before given index.
     
    685685
    686686                EastNorth normalUnitVector = getNormalUniVector();
    687                
     687
    688688                if (mode == Mode.extrude || mode == Mode.create_new) {
    689689                    g2.setColor(mainColor);
     
    722722                    if (p1.distance(p2) < 3) {
    723723                        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),
    725725                                (int)(symbolSize), (int)(symbolSize));
    726726                    } else {
     
    752752        }
    753753    }
    754    
     754
    755755    private EastNorth getNormalUniVector() {
    756756        double fac = 1.0 / activeMoveDirection.en.distance(0,0);
     
    770770        return normalUnitVector;
    771771    }
    772    
     772
    773773    private void drawAngleSymbol(Graphics2D g2, Point2D center, EastNorth normal, boolean mirror) {
    774774        // EastNorth units per pixel
     
    776776        double raoffsetx = symbolSize*factor*normal.getX();
    777777        double raoffsety = symbolSize*factor*normal.getY();
    778        
    779         double cx = center.getX(), cy = center.getY(); 
     778
     779        double cx = center.getX(), cy = center.getY();
    780780        double k = (mirror ? -1 : 1);
    781781        Point2D ra1 = new Point2D.Double(cx + raoffsetx, cy + raoffsety);
    782782        Point2D ra3 = new Point2D.Double(cx - raoffsety*k, cy + raoffsetx*k);
    783783        Point2D ra2 = new Point2D.Double(ra1.getX() - raoffsety*k, ra1.getY() + raoffsetx*k);
    784        
     784
    785785        GeneralPath ra = new GeneralPath();
    786786        ra.moveTo((float)ra1.getX(), (float)ra1.getY());
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java

    r6029 r6069  
    8989    private Stroke deleteNodeStroke;
    9090    private int dotSize;
    91    
     91
    9292    private boolean selectionChangedBlocked = false;
    9393
     
    130130        deleteNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.delete-node", "1"));
    131131        dotSize = Main.pref.getInteger("improvewayaccuracy.dot-size",6);
    132                
     132
    133133        mv = Main.map.mapView;
    134134        mousePos = null;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java

    r5960 r6069  
    5757        updateStatusLine();
    5858    }
    59    
     59
    6060    /**
    6161     * Makes this map mode inactive.
     
    102102        shift = (modifiers & ActionEvent.SHIFT_MASK) != 0;
    103103    }
    104    
     104
    105105    protected void requestFocusInMapView() {
    106106        if (isEnabled()) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r6028 r6069  
    9898    private boolean snapDefault;
    9999
    100     private double snapThreshold; 
     100    private double snapThreshold;
    101101    private double snapDistanceMetric;
    102102    private double snapDistanceImperial;
     
    125125    private EastNorth helperLineStart;
    126126    private EastNorth helperLineEnd;
    127    
     127
    128128    Stroke helpLineStroke;
    129129    Stroke refLineStroke;
     
    157157        refLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.ref-line", "1 2 2"));
    158158        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
    161161        //// Needed to update the mouse cursor if modifiers are changed when the mouse is motionless
    162162        try {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java

    r5981 r6069  
    2222/**
    2323 * Helper for ParallelWayAction
    24  * 
     24 *
    2525 * @author Ole Jørgen Brønner (olejorgenb)
    2626 */
     
    6969        if (sortedNodesPath == null)
    7070            throw new IllegalArgumentException("Ways must have spanning path"); // Create a dedicated exception?
    71        
     71
    7272        // Fix #8631 - Remove duplicated nodes from graph to be robust with self-intersecting ways
    7373        Set<Node> removedNodes = new HashSet<Node>();
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r6013 r6069  
    207207
    208208    int previousModifiers;
    209    
     209
    210210     /**
    211211     * This is called whenever the keyboard modifier status changes
     
    282282        return repaintIfRequired(newHighlights);
    283283    }
    284    
     284
    285285    /**
    286286     * works out which cursor should be displayed for most of SelectAction's
     
    381381        return needsRepaint;
    382382    }
    383    
     383
    384384     /**
    385385     * Look, whether any object is selected. If not, select the nearest node.
     
    397397        if (!mv.isActiveLayerVisible() || !(Boolean) this.getValue("active") || mouseDownButton != MouseEvent.BUTTON1)
    398398            return;
    399        
     399
    400400        // left-button mouse click only is processed here
    401        
     401
    402402        // request focus in order to enable the expected keyboard shortcuts
    403403        mv.requestFocus();
     
    416416
    417417        // primitives under cursor are stored in c collection
    418        
     418
    419419        OsmPrimitive nearestPrimitive = mv.getNearestNodeOrWay(e.getPoint(), OsmPrimitive.isSelectablePredicate, true);
    420420
    421421        determineMapMode(nearestPrimitive!=null);
    422        
     422
    423423        switch(mode) {
    424424        case rotate:
     
    462462        updateStatusLine();
    463463    }
    464    
     464
    465465    @Override
    466466    public void mouseMoved(MouseEvent e) {
     
    475475        }
    476476    }
    477    
     477
    478478    /**
    479479     * If the left mouse button is pressed, move all currently selected
     
    485485        if (!mv.isActiveLayerVisible())
    486486            return;
    487        
     487
    488488        // Swing sends random mouseDragged events when closing dialogs by double-clicking their top-left icon on Windows
    489489        // Ignore such false events to prevent issues like #7078
    490490        if (mouseDownButton == MouseEvent.BUTTON1 && mouseReleaseTime > mouseDownTime)
    491491            return;
    492        
     492
    493493        cancelDrawMode = true;
    494494        if (mode == Mode.select)
     
    542542        if (e.getPoint().equals(lastMousePos))
    543543            return;
    544        
     544
    545545        EastNorth currentEN = mv.getEastNorth(e.getX(), e.getY());
    546546
     
    559559    }
    560560
    561    
     561
    562562
    563563    @Override
     
    568568    }
    569569
    570    
     570
    571571    @Override
    572572    public void mouseReleased(MouseEvent e) {
     
    653653        }
    654654    }
    655    
     655
    656656    /** returns true whenever elements have been grabbed and moved (i.e. the initial
    657657     * thresholds have been exceeded) and is still in progress (i.e. mouse button
     
    662662    }
    663663
    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
    667667     * continuous moving, scaling and rotation
    668668     * @param currentEN - mouse position
     
    677677            getCurrentDataSet().setSelected(nearestPrimitive);
    678678        }
    679        
     679
    680680        Collection<Node> affectedNodes = AllNodesVisitor.getAllNodes(selection);
    681681        // for these transformations, having only one node makes no sense - quit silently
     
    710710        } else {
    711711            startEN = currentEN; // drag can continue after scaling/rotation
    712    
     712
    713713            if (mode != Mode.rotate && mode != Mode.scale) {
    714714                return false;
    715715            }
    716            
     716
    717717            getCurrentDataSet().beginUpdate();
    718            
     718
    719719            if (mode == Mode.rotate) {
    720720                if (c instanceof RotateCommand && affectedNodes.equals(((RotateCommand) c).getTransformedNodes())) {
     
    730730                }
    731731            }
    732            
     732
    733733            Collection<Way> ways = getCurrentDataSet().getSelectedWays();
    734734            if (doesImpactStatusLine(affectedNodes, ways)) {
     
    739739        return true;
    740740    }
    741    
     741
    742742    private boolean doesImpactStatusLine(Collection<Node> affectedNodes, Collection<Way> selectedWays) {
    743743        for (Way w : selectedWays) {
     
    750750        return false;
    751751    }
    752    
     752
    753753    /**
    754754     * Adapt last move command (if it is suitable) to work with next drag, started at point startEN
     
    762762        }
    763763    }
    764        
     764
    765765    /**
    766766     * Obtain command in undoRedo stack to "continue" when dragging
     
    774774        return c;
    775775    }
    776    
     776
    777777    /**
    778778     * Present warning in case of large and possibly unwanted movements and undo
     
    812812        getCurrentDataSet().fireSelectionChanged();
    813813    }
    814    
     814
    815815    /**
    816816     * Merges the selected nodes to the one closest to the given mouse position iff the control
     
    908908        this.lassoMode = lassoMode;
    909909    }
    910    
     910
    911911    CycleManager cycleManager = new CycleManager();
    912912    VirtualManager virtualManager = new VirtualManager();
    913    
     913
    914914    private class CycleManager {
    915915
     
    926926            multipleMatchesParameter = Main.pref.getBoolean("selectaction.cycles.multiple.matches", false);
    927927        }
    928        
     928
    929929        /**
    930930         * Determine prmitive to be selected and build cycleList
     
    941941                // Point p = e.getPoint();
    942942//              updateKeyModifiers(e); // cycleSetup called only after updateModifiers !
    943                
     943
    944944                if (!(alt || multipleMatchesParameter)) {
    945                     // no real cycling, just one element in cycle list                   
     945                    // no real cycling, just one element in cycle list
    946946                    cycleList = MapView.asColl(osm);
    947947
     
    10211021                        // first selected primitive in cycleList is found
    10221022                        if (cyclePrims || ctrl) {
    1023                             ds.clearSelection(foundInDS); // deselect it 
     1023                            ds.clearSelection(foundInDS); // deselect it
    10241024                            nxt = i.hasNext() ? i.next() : first;
    10251025                            // return next one in cycle list (last->first)
     
    10291029                }
    10301030            }
    1031            
     1031
    10321032            // if "no-alt-cycling" is enabled, Ctrl-Click arrives here.
    10331033            if (ctrl) {
     
    10541054        }
    10551055    }
    1056    
     1056
    10571057    private class VirtualManager {
    10581058
     
    10621062        private int virtualSnapDistSq2;
    10631063        private int virtualSpace;
    1064        
     1064
    10651065        private void init() {
    10661066            nodeVirtualSize = Main.pref.getInteger("mappaint.node.virtual-size", 8);
     
    10691069            virtualSpace = Main.pref.getInteger("mappaint.node.virtual-space", 70);
    10701070        }
    1071        
     1071
    10721072        /**
    10731073         * Calculate a virtual node if there is enough visual space to draw a
  • trunk/src/org/openstreetmap/josm/actions/relation/SelectRelationAction.java

    r5799 r6069  
    1111
    1212/**
    13  * Sets the current selection to specified list of relations 
     13 * Sets the current selection to specified list of relations
    1414 * @since 5793
    1515 */
    1616public class SelectRelationAction extends AbstractRelationAction {
    17    
     17
    1818    private final boolean add;
    1919
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r5948 r6069  
    9090        }
    9191    }
    92    
     92
    9393    public static Collection<SearchSetting> getSearchHistory() {
    9494        return searchHistory;
  • trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java

    r5767 r6069  
    9999        }
    100100    }
    101    
     101
    102102    /**
    103103     * Data fix to cleanup wrong spelled keys
     
    130130        }
    131131    }
    132    
     132
    133133    /**
    134134     * Data fix to cleanup wrong spelled tags
     
    170170        }
    171171    }
    172    
     172
    173173    /**
    174174     * Checks the upload for deprecated or wrong tags.
  • trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java

    r5926 r6069  
    6060            test.visit(selection);
    6161            test.endTest();
    62             if (Main.pref.getBoolean(ValidatorPreference.PREF_OTHER, false) && 
     62            if (Main.pref.getBoolean(ValidatorPreference.PREF_OTHER, false) &&
    6363                Main.pref.getBoolean(ValidatorPreference.PREF_OTHER_UPLOAD, false))
    6464            {
  • trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java

    r5953 r6069  
    5959        init(data, toSelect);
    6060    }
    61    
     61
    6262    private final void init(List<PrimitiveData> data, List<PrimitiveData> toSelect) {
    6363        CheckParameterUtil.ensureParameterNotNull(data, "data");
     
    113113    @Override public void undoCommand() {
    114114        DataSet ds = getLayer().data;
    115        
     115
    116116        if (createdPrimitives == null) {
    117117            createdPrimitives = new ArrayList<OsmPrimitive>(data.size());
    118118            createdPrimitivesToSelect = new ArrayList<OsmPrimitive>(toSelect.size());
    119            
     119
    120120            for (PrimitiveData pd : data) {
    121121                OsmPrimitive p = ds.getPrimitiveById(pd);
     
    126126            }
    127127            createdPrimitives = PurgeCommand.topoSort(createdPrimitives);
    128            
     128
    129129            for (PrimitiveData p : data) {
    130130                ds.removePrimitive(p);
     
    132132            data = null;
    133133            toSelect = null;
    134            
     134
    135135        } else {
    136136            for (OsmPrimitive osm : createdPrimitives) {
     
    161161        if (createdPrimitives != null)
    162162            return createdPrimitives;
    163        
     163
    164164        Collection<OsmPrimitive> prims = new HashSet<OsmPrimitive>();
    165165        for (PrimitiveData d : data) {
  • trunk/src/org/openstreetmap/josm/command/MoveCommand.java

    r5694 r6069  
    3131    private Collection<Node> nodes = new LinkedList<Node>();
    3232    /**
    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) =
    3434     */
    3535    private EastNorth startEN;
     
    7373        this(objects, offset.getX(), offset.getY());
    7474    }
    75    
     75
    7676    /**
    7777     * Create a MoveCommand and assign the initial object set and movement vector.
     
    102102         startEN =  start;
    103103     }
    104      
     104
    105105    /**
    106106     * Move the same set of objects again by the specified vector. The vectors
     
    122122        moveAgain(x - this.x, y - this.y);
    123123    }
    124    
    125     /**
    126      * Change the displacement vector to have endpoint @param currentEN 
     124
     125    /**
     126     * Change the displacement vector to have endpoint @param currentEN
    127127     * starting point is  startEN
    128128     */
    129129    public void applyVectorTo(EastNorth currentEN) {
    130         if (startEN == null) 
     130        if (startEN == null)
    131131            return;
    132132        x = currentEN.getX() - startEN.getX();
  • trunk/src/org/openstreetmap/josm/command/PurgeCommand.java

    r5993 r6069  
    3939
    4040    protected Map<PrimitiveId, PrimitiveData> makeIncompleteData_byPrimId;
    41    
     41
    4242    protected final ConflictCollection purgedConflicts = new ConflictCollection();
    4343
     
    132132            }
    133133        }
    134        
     134
    135135        for (Conflict<?> conflict : purgedConflicts) {
    136136            getLayer().getConflicts().add(conflict);
  • trunk/src/org/openstreetmap/josm/command/RotateCommand.java

    r4918 r6069  
    6161        handleEvent(currentEN);
    6262    }
    63    
     63
    6464    /**
    6565     * 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  
    4545        }
    4646    }
    47    
     47
    4848    private static final Collection<Pattern> ignoredKeys = new ArrayList<Pattern>();
    4949    static {
     
    5858        }
    5959    }
    60    
     60
    6161    private static class StringSwitcher {
    6262
     
    9393     */
    9494    public static class TagSwitcher {
    95        
     95
    9696        /**
    9797         * Reverses a given tag.
     
    102102            return apply(tag.getKey(), tag.getValue());
    103103        }
    104        
     104
    105105        /**
    106106         * Reverses a given tag (key=value).
     
    128128                // Change key but not left/right value (fix #8518)
    129129                newKey = FORWARD_BACKWARD.apply(key);
    130                
     130
    131131            } else if (!ignoreKeyForCorrection(key)) {
    132132                for (StringSwitcher prefixSuffixSwitcher : stringSwitchers) {
     
    144144        }
    145145    }
    146    
     146
    147147    private static final StringSwitcher FORWARD_BACKWARD = new StringSwitcher("forward", "backward");
    148148    private static final StringSwitcher UP_DOWN = new StringSwitcher("up", "down");
  • trunk/src/org/openstreetmap/josm/data/AutosaveTask.java

    r5889 r6069  
    275275        return new File(autosaveDir, osmFile.getName().replaceFirst("[.][^.]+$", ".pid"));
    276276    }
    277    
     277
    278278    /**
    279279     * Replies the list of .osm files still present in autosave dir, that are not currently managed by another instance of JOSM.
     
    315315        return result;
    316316    }
    317    
     317
    318318    private boolean jvmPerfDataFileExists(final String jvmId) {
    319319        File jvmDir = new File(System.getProperty("java.io.tmpdir") + File.separator + "hsperfdata_" + System.getProperty("user.name"));
     
    354354        File backupFile = new File(deletedLayersDir, f.getName());
    355355        File pidFile = getPidFile(f);
    356        
     356
    357357        if (backupFile.exists()) {
    358358            deletedLayers.remove(backupFile);
  • trunk/src/org/openstreetmap/josm/data/Bounds.java

    r5235 r6069  
    3030        return new LatLon(maxLat, maxLon);
    3131    }
    32    
     32
    3333    public enum ParseMethod {
    3434        MINLAT_MINLON_MAXLAT_MAXLON,
    3535        LEFT_BOTTOM_RIGHT_TOP
    3636    }
    37    
     37
    3838    /**
    3939     * Construct bounds out of two points
     
    5050        this(b, true);
    5151    }
    52    
     52
    5353    public Bounds(LatLon b, boolean roundToOsmPrecision) {
    5454        // Do not call this(b, b) to avoid GPX performance issue (see #7028) until roundToOsmPrecision() is improved
     
    124124            }
    125125        }
    126        
     126
    127127        switch (parseMethod) {
    128128            case LEFT_BOTTOM_RIGHT_TOP:
     
    140140        }
    141141    }
    142    
     142
    143143    protected static double initLat(double value, boolean roundToOsmPrecision) {
    144144        if (!LatLon.isValidLat(value))
     
    246246        extend(b.getMax());
    247247    }
    248    
     248
    249249    /**
    250250     * Is the given point within this bounds?
     
    266266        return notCrossing.minLon <= crossing.maxLon || notCrossing.maxLon >= crossing.minLon;
    267267    }
    268    
     268
    269269    /**
    270270     * The two bounds intersect? Compared to java Shape.intersects, if does not use
     
    274274        if (b.maxLat < minLat || b.minLat > maxLat)
    275275            return false;
    276        
     276
    277277        if (crosses180thMeridian() && !b.crosses180thMeridian()) {
    278278            return intersectsLonCrossing(this, b);
     
    294294        return this.minLon > this.maxLon;
    295295    }
    296    
     296
    297297    /**
    298298     * Converts the lat/lon bounding box to an object of type Rectangle2D.Double
     
    320320     * <p>Replies true, if this bounds are <em>collapsed</em>, i.e. if the min
    321321     * and the max corner are equal.</p>
    322      * 
     322     *
    323323     * @return true, if this bounds are <em>collapsed</em>
    324324     */
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r5927 r6069  
    5858public class CustomConfigurator {
    5959    private static StringBuilder summary = new StringBuilder();
    60        
     60
    6161    public static void log(String fmt, Object... vars) {
    6262        summary.append(String.format(fmt, vars));
    6363    }
    64    
     64
    6565    public static void log(String s) {
    6666        summary.append(s);
    6767        summary.append("\n");
    6868    }
    69    
     69
    7070    public static String getLog() {
    7171        return summary.toString();
    7272    }
    73    
     73
    7474    public static void readXML(String dir, String fileName) {
    7575        readXML(new File(dir, fileName));
     
    8787        new XMLCommandProcessor(prefs).openAndReadXML(file);
    8888        synchronized(CustomConfigurator.class) {
    89             CustomConfigurator.class.notifyAll(); 
     89            CustomConfigurator.class.notifyAll();
    9090            busy=false;
    9191        }
    9292    }
    93    
     93
    9494    /**
    9595     * Read configuration script from XML file, modifying main preferences
     
    9999        readXML(file, Main.pref);
    100100    }
    101    
     101
    102102    /**
    103103     * Downloads file to one of JOSM standard folders
    104104     * @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
    106106     * @param base - only "prefs", "cache" and "plugins" allowed for standard folders
    107107     */
     
    113113     * Downloads file to one of JOSM standard folders nad unpack it as ZIP/JAR file
    114114     * @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
    116116     * @param base - only "prefs", "cache" and "plugins" allowed for standard folders
    117117     */
     
    123123     * Downloads file to arbitrary folder
    124124     * @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
    126126     * @param parentDir - folder where to put file
    127127     * @param mkdir - if true, non-existing directories will be created
     
    139139        log("Info: downloading file from %s to %s in background ", parentDir, fOut.getAbsolutePath());
    140140        if (unzip) log("and unpacking it"); else log("");
    141        
     141
    142142    }
    143143
    144144    /**
    145145     * 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
    147147     * @param text - message to display, HTML allowed
    148148     */
     
    158158        }
    159159    }
    160    
     160
    161161    /**
    162162     * Simple function for choose window, may be used from JS API and from other code
     
    214214        exportPreferencesKeysToFile(fileName, append, keySet);
    215215    }
    216    
     216
    217217    /**
    218218     * Export specified preferences keys to configuration file
     
    241241        if (root==null) return;
    242242        try {
    243            
     243
    244244            Element newRoot = exportDocument.createElement("config");
    245245            exportDocument.appendChild(newRoot);
    246            
     246
    247247            Element prefElem = exportDocument.createElement("preferences");
    248248            prefElem.setAttribute("operation", append?"append":"replace");
     
    270270        }
    271271    }
    272    
    273    
     272
     273
    274274        public static void deleteFile(String path, String base) {
    275275        String dir = getDirectoryByAbbr(base);
     
    292292        deleteFileOrDirectory(new File(path));
    293293    }
    294    
     294
    295295    public static void deleteFileOrDirectory(File f) {
    296296        if (f.isDirectory()) {
    297297            for (File f1: f.listFiles()) {
    298298                deleteFileOrDirectory(f1);
    299             } 
     299            }
    300300        }
    301301        try {
     
    308308    private static boolean busy=false;
    309309
    310    
     310
    311311    public static void pluginOperation(String install, String uninstall, String delete)  {
    312312        final List<String> installList = new ArrayList<String>();
     
    317317        Collections.addAll(deleteList, delete.toLowerCase().split(";"));
    318318        installList.remove("");removeList.remove("");deleteList.remove("");
    319        
     319
    320320        if (!installList.isEmpty()) {
    321321            log("Plugins install: "+installList);
     
    332332            public void run() {
    333333                if (task.isCanceled()) return;
    334                 synchronized (CustomConfigurator.class) { 
     334                synchronized (CustomConfigurator.class) {
    335335                try { // proceed only after all other tasks were finished
    336336                    while (busy) CustomConfigurator.class.wait();
    337337                } catch (InterruptedException ex) { }
    338                        
     338
    339339                SwingUtilities.invokeLater(new Runnable() {
    340340                    public void run() {
     
    376376        Main.worker.submit(r);
    377377    }
    378    
     378
    379379    private static String getDirectoryByAbbr(String base) {
    380380            String dir;
     
    402402        tmp.listOfStructsProperties.putAll( pref.listOfStructsProperties );
    403403        tmp.colornames.putAll( pref.colornames );
    404        
     404
    405405        return tmp;
    406406    }
     
    408408
    409409    public static class XMLCommandProcessor {
    410        
     410
    411411        Preferences mainPrefs;
    412412        Map<String,Element> tasksMap = new HashMap<String,Element>();
    413        
     413
    414414        private boolean lastV; // last If condition result
    415        
    416        
     415
     416
    417417        ScriptEngine engine ;
    418418
     
    452452                engine = new ScriptEngineManager().getEngineByName("rhino");
    453453                engine.eval("API={}; API.pref={}; API.fragments={};");
    454                
     454
    455455                engine.eval("homeDir='"+normalizeDirName(Main.pref.getPreferencesDir()) +"';");
    456456                engine.eval("josmVersion="+Version.getInstance().getVersion()+";");
     
    493493                    if (processRunTaskElement(elem)) return;
    494494                } else if ("ask".equals(elementName)) {
    495                     processAskElement(elem); 
     495                    processAskElement(elem);
    496496                } else if ("if".equals(elementName)) {
    497                     processIfElement(elem); 
     497                    processIfElement(elem);
    498498                } else if ("else".equals(elementName)) {
    499                     processElseElement(elem); 
     499                    processElseElement(elem);
    500500                } else if ("break".equals(elementName)) {
    501501                    return;
     
    515515                    log("Error: Unknown element " + elementName);
    516516                }
    517                
     517
    518518            }
    519519        }
     
    524524            String oper = evalVars(item.getAttribute("operation"));
    525525            String id = evalVars(item.getAttribute("id"));
    526            
    527            
     526
     527
    528528            if ("delete-keys".equals(oper)) {
    529529                String pattern = evalVars(item.getAttribute("pattern"));
     
    537537                return;
    538538            }
    539            
     539
    540540            Preferences tmpPref = readPreferencesFromDOMElement(item);
    541541            PreferencesUtils.showPrefs(tmpPref);
    542            
     542
    543543            if (id.length()>0) {
    544544                try {
     
    551551                }
    552552            }
    553            
     553
    554554            if ("replace".equals(oper)) {
    555555                log("Preferences replace: %d keys: %s\n",
     
    564564            }
    565565        }
    566        
     566
    567567         private void processDeleteElement(Element item) {
    568568            String path = evalVars(item.getAttribute("path"));
     
    583583                return;
    584584            }
    585            
     585
    586586            if (path.contains("..") || path.startsWith("/") || path.contains(":")) {
    587587                return; // some basic protection
     
    593593            processDownloadOperation(address, path, dir, "true".equals(mkdir), "true".equals(unzip));
    594594        }
    595        
     595
    596596        private void processPluginInstallElement(Element elem) {
    597597            String install = elem.getAttribute("install");
     
    600600            pluginOperation(install, uninstall, delete);
    601601        }
    602        
     602
    603603        private void processMsgBoxElement(Element elem) {
    604604            String text = evalVars(elem.getAttribute("text"));
     
    609609            messageBox(type, text);
    610610        }
    611        
     611
    612612
    613613        private void processAskElement(Element elem) {
     
    617617            String var = elem.getAttribute("var");
    618618            if (var.length()==0) var="result";
    619            
     619
    620620            String input = evalVars(elem.getAttribute("input"));
    621621            if ("true".equals(input)) {
     
    636636            }
    637637        }
    638        
     638
    639639        private void processIfElement(Element elem) {
    640640            String realValue = evalVars(elem.getAttribute("test"));
     
    645645                log("Error: Illegal test expression in if: %s=%s\n", elem.getAttribute("test"), realValue);
    646646            }
    647                
    648             if (v) processXmlFragment(elem); 
     647
     648            if (v) processXmlFragment(elem);
    649649            lastV = v;
    650650        }
     
    652652        private void processElseElement(Element elem) {
    653653            if (!lastV) {
    654                 processXmlFragment(elem); 
     654                processXmlFragment(elem);
    655655            }
    656656        }
     
    668668            return false;
    669669        }
    670        
    671                
     670
     671
    672672        private void processScriptElement(Element elem) {
    673673            String js = elem.getChildNodes().item(0).getTextContent();
     
    681681            log("Script finished");
    682682        }
    683        
     683
    684684        /**
    685685         * subsititute ${expression} = expression evaluated by JavaScript
     
    710710
    711711                xformer.transform(new DOMSource(item), out);
    712                
     712
    713713                String fragmentWithReplacedVars= evalVars(outputWriter.toString());
    714714
     
    717717            } catch (Exception ex) {
    718718                log("Error: can not read XML fragment :" + ex.getMessage());
    719             } 
     719            }
    720720
    721721            return tmpPref;
     
    737737     */
    738738    public static class PreferencesUtils {
    739    
     739
    740740        private static void replacePreferences(Preferences fragment, Preferences mainpref) {
    741741            // normal prefs
     
    798798            }
    799799
    800             /// "maps" 
     800            /// "maps"
    801801            for (Entry<String, List<Map<String, String>>> entry : fragment.listOfStructsProperties.entrySet()) {
    802802                String key = entry.getKey();
     
    805805                if (newMaps == null) continue;
    806806
    807                 // get existing properties as list of maps 
     807                // get existing properties as list of maps
    808808
    809809                for (Map<String, String> map : entry.getValue()) {
     
    816816            }
    817817        }
    818        
     818
    819819        /**
    820820     * Delete items from @param mainpref collections that match items from @param fragment collections
     
    850850            String key = entry.getKey();
    851851
    852            
     852
    853853            Collection<Collection<String>> newLists = getArray(mainpref, key, true);
    854854            if (newLists == null) continue;
    855            
     855
    856856            // if items are found in one of lists, remove that list!
    857857            Iterator<Collection<String>> listIterator = newLists.iterator();
     
    870870        }
    871871
    872         /// "maps" 
     872        /// "maps"
    873873        for (Entry<String, List<Map<String, String>>> entry : fragment.listOfStructsProperties.entrySet()) {
    874874            String key = entry.getKey();
     
    876876            List<Map<String, String>> newMaps = getListOfStructs(mainpref, key, true);
    877877            if (newMaps == null) continue;
    878                
     878
    879879            Iterator<Map<String, String>> mapIterator = newMaps.iterator();
    880880            while (mapIterator.hasNext()) {
     
    891891        }
    892892    }
    893        
     893
    894894    private static void deletePreferenceKeyByPattern(String pattern, Preferences pref) {
    895895        Map<String, Setting> allSettings = pref.getAllSettings();
     
    909909        }
    910910    }
    911    
     911
    912912    private static Collection<String> getCollection(Preferences mainpref, String key, boolean warnUnknownDefault)  {
    913913        Collection<String> existing = mainpref.collectionProperties.get(key);
     
    921921                ? new ArrayList<String>(existing) : new ArrayList<String>(defaults);
    922922    }
    923    
     923
    924924    private static Collection<Collection<String>> getArray(Preferences mainpref, String key, boolean warnUnknownDefault)  {
    925925        Collection<List<String>> existing = mainpref.arrayProperties.get(key);
     
    947947                ? new ArrayList<Map<String, String>>(existing) : new ArrayList<Map<String, String>>(defaults);
    948948    }
    949    
    950    
     949
     950
    951951
    952952    private static void defaultUnknownWarning(String key) {
     
    965965        System.out.println("maps: " + tmpPref.listOfStructsProperties);
    966966    }
    967    
     967
    968968    private static void modifyPreferencesByScript(ScriptEngine engine, Preferences tmpPref, String js) throws ScriptException {
    969969        loadPrefsToJS(engine, tmpPref, "API.pref", true);
     
    972972    }
    973973
    974    
     974
    975975     /**
    976976     * Convert JavaScript preferences object to preferences data structures
     
    978978     * @param tmpPref - preferences to fill from JS
    979979     * @param varInJS - JS variable name, where preferences are stored
    980      * @throws ScriptException 
     980     * @throws ScriptException
    981981     */
    982982    public static void readPrefsFromJS(ScriptEngine engine, Preferences tmpPref, String varInJS) throws ScriptException {
     
    10581058            tmpPref.listOfStructsProperties.put(e.getKey(), e.getValue());
    10591059        }
    1060            
    1061     }
    1062    
    1063    
     1060
     1061    }
     1062
     1063
    10641064    /**
    10651065     * Convert preferences data structures to JavaScript object
     
    10681068     * @param whereToPutInJS - variable name to store preferences in JS
    10691069     * @param includeDefaults - include known default values to JS objects
    1070      * @throws ScriptException 
     1070     * @throws ScriptException
    10711071     */
    10721072    public static void loadPrefsToJS(ScriptEngine engine, Preferences tmpPref, String whereToPutInJS, boolean includeDefaults) throws ScriptException {
     
    11511151            whereToPutInJS+"[String(e.getKey())] = jslistmap;"+
    11521152            "}\n";
    1153                
     1153
    11541154        //System.out.println("map1: "+stringMap );
    11551155        //System.out.println("lists1: "+listMap );
     
    11591159        // Execute conversion script
    11601160        engine.eval(init);
    1161            
     1161
    11621162    }
    11631163    }
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r6054 r6069  
    13461346        // Workaround to fix another Java bug
    13471347        // 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
    13491349        // and http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6923200
    13501350        if (Main.pref.getBoolean("jdk.Arrays.useLegacyMergeSort", !Version.getInstance().isLocalBuild())) {
     
    13521352        }
    13531353    }
    1354    
     1354
    13551355    private void updateSystemProperty(String key, String value) {
    13561356        if (value != null) {
     
    16551655        if (b==null) return false;
    16561656        if (a==b) return true;
    1657        
    1658         if (a instanceof StringSetting) 
     1657
     1658        if (a instanceof StringSetting)
    16591659            return (a.getValue().equals(b.getValue()));
    16601660        if (a instanceof ListSetting) {
  • trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java

    r5298 r6069  
    2424    private final T their;
    2525    private final boolean isMyDeleted;
    26    
     26
    2727    // mergedMap is only set if the conflict results from merging two layers
    2828    private Map<PrimitiveId, PrimitiveId> mergedMap;
  • trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java

    r4126 r6069  
    77/**
    88 * LatLon class that maintains a cache of projected EastNorth coordinates.
    9  * 
     9 *
    1010 * 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
    1212 * changes.
    13  * 
     13 *
    1414 * Node and WayPoint have another, optimized, cache for projected coordinates.
    1515 */
     
    4747    /**
    4848     * Replies the projected east/north coordinates.
    49      * 
     49     *
    5050     * @return the internally cached east/north coordinates. null, if the globally defined projection is null
    5151     */
  • trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java

    r4640 r6069  
    6060        return hd;
    6161    }
    62    
     62
    6363    /**
    6464     * Replies true if east and north are different from Double.NaN
    65      * 
     65     *
    6666     * @return true if east and north are different from Double.NaN
    6767     */
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r5909 r6069  
    4646        cDdFormatter.applyPattern("###0.0######");
    4747    }
    48    
     48
    4949    private static final String cDms60 = cDmsSecondFormatter.format(60.0);
    5050    private static final String cDms00 = cDmsSecondFormatter.format( 0.0);
     
    115115        int tMinutes = (int) tTmpMinutes;
    116116        double tSeconds = (tTmpMinutes - tMinutes) * 60;
    117        
     117
    118118        String sDegrees = Integer.toString(tDegree);
    119119        String sMinutes = cDmsMinuteFormatter.format(tMinutes);
    120120        String sSeconds = cDmsSecondFormatter.format(tSeconds);
    121        
     121
    122122        if (sSeconds.equals(cDms60)) {
    123123            sSeconds = cDms00;
     
    142142        int tDegree = (int) tAbsCoord;
    143143        double tMinutes = (tAbsCoord - tDegree) * 60;
    144        
     144
    145145        String sDegrees = Integer.toString(tDegree);
    146146        String sMinutes = cDmMinuteFormatter.format(tMinutes);
    147        
     147
    148148        if (sMinutes.equals(cDm60)) {
    149149            sMinutes = cDm00;
    150150            sDegrees = Integer.toString(tDegree+1);
    151151        }
    152        
     152
    153153        return sDegrees + "\u00B0" + sMinutes + "\'";
    154154    }
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r5715 r6069  
    7878     * The bounds are not stored internally, but recalculated every time
    7979     * this function is called.
    80      * 
     80     *
    8181     * FIXME might perhaps use visitor pattern?
    8282     */
     
    124124        return result;
    125125    }
    126    
     126
    127127     /**
    128128     * 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  
    1919
    2020    /**
    21      * Returns the String value to which the specified key is mapped, 
     21     * Returns the String value to which the specified key is mapped,
    2222     * or {@code null} if this map contains no String mapping for the key.
    23      * 
     23     *
    2424     * @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,
    2626     *         or {@code null} if this map contains no String mapping for the key
    2727     */
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r5617 r6069  
    4848            return urlString;
    4949        }
    50        
     50
    5151        public static ImageryType fromUrlString(String s) {
    5252            for (ImageryType type : ImageryType.values()) {
  • trunk/src/org/openstreetmap/josm/data/imagery/Shape.java

    r5381 r6069  
    2121
    2222    private List<Coordinate> coords = new ArrayList<Coordinate>();
    23    
     23
    2424    public Shape(String asString, String separator) throws IllegalArgumentException {
    2525        CheckParameterUtil.ensureParameterNotNull(asString, "asString");
     
    4949        return coords;
    5050    }
    51    
     51
    5252    public boolean contains(LatLon latlon) {
    5353        if (latlon == null)
     
    6565
    6666        double lat, lon;
    67        
     67
    6868        try {
    6969            lat = Double.parseDouble(sLat);
     
    8181            throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", sLon));
    8282        }
    83        
     83
    8484        coords.add(new Coordinate(LatLon.roundToOsmPrecision(lat), LatLon.roundToOsmPrecision(lon)));
    8585    }
  • trunk/src/org/openstreetmap/josm/data/imagery/types/EntryType.java

    r5170 r6069  
    2121/**
    2222 * <p>Java class for entry complex type.
    23  * 
     23 *
    2424 * <p>The following schema fragment specifies the expected content contained within this class.
    25  * 
     25 *
    2626 * <pre>
    2727 * &lt;complexType name="entry">
     
    4040 * &lt;/complexType>
    4141 * </pre>
    42  * 
    43  * 
     42 *
     43 *
    4444 */
    4545@XmlAccessorType(XmlAccessType.FIELD)
     
    7070    /**
    7171     * Gets the value of the pixelPerDegree property.
    72      * 
     72     *
    7373     */
    7474    public double getPixelPerDegree() {
     
    7878    /**
    7979     * Sets the value of the pixelPerDegree property.
    80      * 
     80     *
    8181     */
    8282    public void setPixelPerDegree(double value) {
     
    8686    /**
    8787     * Gets the value of the east property.
    88      * 
     88     *
    8989     */
    9090    public double getEast() {
     
    9494    /**
    9595     * Sets the value of the east property.
    96      * 
     96     *
    9797     */
    9898    public void setEast(double value) {
     
    102102    /**
    103103     * Gets the value of the north property.
    104      * 
     104     *
    105105     */
    106106    public double getNorth() {
     
    110110    /**
    111111     * Sets the value of the north property.
    112      * 
     112     *
    113113     */
    114114    public void setNorth(double value) {
     
    118118    /**
    119119     * Gets the value of the lastUsed property.
    120      * 
     120     *
    121121     * @return
    122122     *     possible object is
    123123     *     {@link String }
    124      * 
     124     *
    125125     */
    126126    public Calendar getLastUsed() {
     
    130130    /**
    131131     * Sets the value of the lastUsed property.
    132      * 
     132     *
    133133     * @param value
    134134     *     allowed object is
    135135     *     {@link String }
    136      * 
     136     *
    137137     */
    138138    public void setLastUsed(Calendar value) {
     
    142142    /**
    143143     * Gets the value of the lastModified property.
    144      * 
     144     *
    145145     * @return
    146146     *     possible object is
    147147     *     {@link String }
    148      * 
     148     *
    149149     */
    150150    public Calendar getLastModified() {
     
    154154    /**
    155155     * Sets the value of the lastModified property.
    156      * 
     156     *
    157157     * @param value
    158158     *     allowed object is
    159159     *     {@link String }
    160      * 
     160     *
    161161     */
    162162    public void setLastModified(Calendar value) {
     
    166166    /**
    167167     * Gets the value of the filename property.
    168      * 
     168     *
    169169     * @return
    170170     *     possible object is
    171171     *     {@link String }
    172      * 
     172     *
    173173     */
    174174    public String getFilename() {
     
    178178    /**
    179179     * Sets the value of the filename property.
    180      * 
     180     *
    181181     * @param value
    182182     *     allowed object is
    183183     *     {@link String }
    184      * 
     184     *
    185185     */
    186186    public void setFilename(String value) {
  • trunk/src/org/openstreetmap/josm/data/imagery/types/ObjectFactory.java

    r5170 r6069  
    11//
    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
    66//
    77
     
    1313
    1414/**
    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
    2525 * provided in this class.
    26  * 
     26 *
    2727 */
    2828@XmlRegistry
     
    3232    /**
    3333     * 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     *
    3535     */
    3636    public ObjectFactory() {
     
    3939    /**
    4040     * Create an instance of {@link WmsCacheType }
    41      * 
     41     *
    4242     */
    4343    public WmsCacheType createWmsCacheType() {
     
    4747    /**
    4848     * Create an instance of {@link ProjectionType }
    49      * 
     49     *
    5050     */
    5151    public ProjectionType createProjectionType() {
     
    5555    /**
    5656     * Create an instance of {@link EntryType }
    57      * 
     57     *
    5858     */
    5959    public EntryType createEntryType() {
  • trunk/src/org/openstreetmap/josm/data/imagery/types/ProjectionType.java

    r5170 r6069  
    11//
    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
    66//
    77
     
    1919/**
    2020 * <p>Java class for projection complex type.
    21  * 
     21 *
    2222 * <p>The following schema fragment specifies the expected content contained within this class.
    23  * 
     23 *
    2424 * <pre>
    2525 * &lt;complexType name="projection">
     
    3535 * &lt;/complexType>
    3636 * </pre>
    37  * 
    38  * 
     37 *
     38 *
    3939 */
    4040@XmlAccessorType(XmlAccessType.FIELD)
     
    5252    /**
    5353     * Gets the value of the entry property.
    54      * 
     54     *
    5555     * <p>
    5656     * This accessor method returns a reference to the live list,
     
    5858     * returned list will be present inside the JAXB object.
    5959     * This is why there is not a <CODE>set</CODE> method for the entry property.
    60      * 
     60     *
    6161     * <p>
    6262     * For example, to add a new item, do as follows:
     
    6464     *    getEntry().add(newItem);
    6565     * </pre>
    66      * 
    67      * 
     66     *
     67     *
    6868     * <p>
    6969     * Objects of the following type(s) are allowed in the list
    7070     * {@link EntryType }
    71      * 
    72      * 
     71     *
     72     *
    7373     */
    7474    public List<EntryType> getEntry() {
     
    8181    /**
    8282     * Gets the value of the name property.
    83      * 
     83     *
    8484     * @return
    8585     *     possible object is
    8686     *     {@link String }
    87      *     
     87     *
    8888     */
    8989    public String getName() {
     
    9393    /**
    9494     * Sets the value of the name property.
    95      * 
     95     *
    9696     * @param value
    9797     *     allowed object is
    9898     *     {@link String }
    99      *     
     99     *
    100100     */
    101101    public void setName(String value) {
     
    105105    /**
    106106     * Gets the value of the cacheDirectory property.
    107      * 
     107     *
    108108     * @return
    109109     *     possible object is
    110110     *     {@link String }
    111      *     
     111     *
    112112     */
    113113    public String getCacheDirectory() {
     
    117117    /**
    118118     * Sets the value of the cacheDirectory property.
    119      * 
     119     *
    120120     * @param value
    121121     *     allowed object is
    122122     *     {@link String }
    123      *     
     123     *
    124124     */
    125125    public void setCacheDirectory(String value) {
  • trunk/src/org/openstreetmap/josm/data/imagery/types/WmsCacheType.java

    r5170 r6069  
    11//
    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
    66//
    77
     
    2020/**
    2121 * <p>Java class for anonymous complex type.
    22  * 
     22 *
    2323 * <p>The following schema fragment specifies the expected content contained within this class.
    24  * 
     24 *
    2525 * <pre>
    2626 * &lt;complexType>
     
    3636 * &lt;/complexType>
    3737 * </pre>
    38  * 
    39  * 
     38 *
     39 *
    4040 */
    4141@XmlAccessorType(XmlAccessType.FIELD)
     
    5454    /**
    5555     * Gets the value of the projection property.
    56      * 
     56     *
    5757     * <p>
    5858     * This accessor method returns a reference to the live list,
     
    6060     * returned list will be present inside the JAXB object.
    6161     * This is why there is not a <CODE>set</CODE> method for the projection property.
    62      * 
     62     *
    6363     * <p>
    6464     * For example, to add a new item, do as follows:
     
    6666     *    getProjection().add(newItem);
    6767     * </pre>
    68      * 
    69      * 
     68     *
     69     *
    7070     * <p>
    7171     * Objects of the following type(s) are allowed in the list
    7272     * {@link ProjectionType }
    73      * 
    74      * 
     73     *
     74     *
    7575     */
    7676    public List<ProjectionType> getProjection() {
     
    8383    /**
    8484     * Gets the value of the tileSize property.
    85      * 
     85     *
    8686     */
    8787    public int getTileSize() {
     
    9191    /**
    9292     * Sets the value of the tileSize property.
    93      * 
     93     *
    9494     */
    9595    public void setTileSize(int value) {
     
    9999    /**
    100100     * Gets the value of the totalFileSize property.
    101      * 
     101     *
    102102     */
    103103    public int getTotalFileSize() {
     
    107107    /**
    108108     * Sets the value of the totalFileSize property.
    109      * 
     109     *
    110110     */
    111111    public void setTotalFileSize(int value) {
  • trunk/src/org/openstreetmap/josm/data/imagery/types/package-info.java

    r5170 r6069  
    11//
    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
    66//
    77
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java

    r6067 r6069  
    6464     * at the given API url. URL parameters are only set if the URL equals {@link OsmApi#DEFAULT_API_URL}
    6565     * or references the domain "dev.openstreetmap.org", otherwise they may be <code>null</code>.
    66      * 
     66     *
    6767     * @param apiUrl The API URL for which the OAuth default parameters are created. If null or empty, the default OSM API url is used.
    6868     * @return a set of default parameters for the given {@code apiUrl}
     
    133133    /**
    134134     * Constructs a new, unitialized, {@code OAuthParameters}.
    135      * 
     135     *
    136136     * @see #createDefault
    137137     * @see #createFromPreferences
     
    162162        return consumerKey;
    163163    }
    164    
     164
    165165    /**
    166166     * Sets the consumer key.
     
    170170        this.consumerKey = consumerKey;
    171171    }
    172    
    173     /**
    174      * Gets the consumer secret. 
     172
     173    /**
     174     * Gets the consumer secret.
    175175     * @return The consumer secret
    176176     */
     
    178178        return consumerSecret;
    179179    }
    180    
     180
    181181    /**
    182182     * Sets the consumer secret.
     
    186186        this.consumerSecret = consumerSecret;
    187187    }
    188    
     188
    189189    /**
    190190     * Gets the request token URL.
     
    194194        return requestTokenUrl;
    195195    }
    196    
     196
    197197    /**
    198198     * Sets the request token URL.
     
    202202        this.requestTokenUrl = requestTokenUrl;
    203203    }
    204    
     204
    205205    /**
    206206     * Gets the access token URL.
     
    210210        return accessTokenUrl;
    211211    }
    212    
     212
    213213    /**
    214214     * Sets the access token URL.
     
    218218        this.accessTokenUrl = accessTokenUrl;
    219219    }
    220    
     220
    221221    /**
    222222     * Gets the authorise URL.
     
    226226        return authoriseUrl;
    227227    }
    228    
     228
    229229    /**
    230230     * Sets the authorise URL.
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r5927 r6069  
    658658    public boolean hasSameTags(OsmPrimitive other) {
    659659        // 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
    661661        // and comparing the key maps (costly operation, see #7159)
    662         return (keys == null && other.keys == null) 
     662        return (keys == null && other.keys == null)
    663663            || (keys != null && other.keys != null && keys.length == other.keys.length && (keys.length == 0 || getKeys().equals(other.getKeys())));
    664664    }
  • trunk/src/org/openstreetmap/josm/data/osm/BBox.java

    r5170 r6069  
    175175        return new LatLon(ymin, xmax);
    176176    }
    177    
     177
    178178    public LatLon getCenter() {
    179179        return new LatLon(ymin + (ymax-ymin)/2.0, xmin + (xmax-xmin)/2.0);
  • trunk/src/org/openstreetmap/josm/data/osm/Changeset.java

    r5996 r6069  
    1717 */
    1818public final class Changeset implements Tagged {
    19    
     19
    2020    /** The maximum changeset comment text length allowed by API 0.6 **/
    2121    public static final int MAX_COMMENT_LENGTH = 255;
    22    
     22
    2323    /** the changeset id */
    2424    private int id;
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r5925 r6069  
    135135        return targetDataSet.getPrimitiveById(targetId);
    136136    }
    137    
     137
    138138    protected void addConflict(Conflict<?> c) {
    139139        c.setMergedMap(mergedMap);
     
    221221        }
    222222    }
    223    
     223
    224224    private final void resetPrimitive(OsmPrimitive osm) {
    225225        if (osm instanceof Way) {
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r6009 r6069  
    6363    /**
    6464     * <p>Replies the projected east/north coordinates.</p>
    65      * 
     65     *
    6666     * <p>Uses the {@link Main#getProjection() global projection} to project the lan/lon-coordinates.
    6767     * Internally caches the projected coordinates.</p>
     
    6969     * <p><strong>Caveat:</strong> doesn't listen to projection changes. Clients must
    7070     * {@link #invalidateEastNorthCache() invalidate the internal cache}.</p>
    71      * 
     71     *
    7272     * <p>Replies {@code null} if this node doesn't know lat/lon-coordinates, i.e. because it is an incomplete node.
    73      * 
     73     *
    7474     * @return the east north coordinates or {@code null}
    7575     * @see #invalidateEastNorthCache()
    76      * 
     76     *
    7777     */
    7878    @Override
     
    305305    public void updatePosition() {
    306306    }
    307    
     307
    308308    @Override
    309309    public boolean isDrawable() {
     
    314314    /**
    315315     * Check whether this node connects 2 ways.
    316      * 
     316     *
    317317     * @return true if isReferredByWays(2) returns true
    318      * @see #isReferredByWays(int) 
     318     * @see #isReferredByWays(int)
    319319     */
    320320    public boolean isConnectionNode() {
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r6059 r6069  
    3030/**
    3131 * The base class for OSM objects ({@link Node}, {@link Way}, {@link Relation}).
    32  * 
     32 *
    3333 * It can be created, deleted and uploaded to the OSM-Server.
    3434 *
     
    620620    private static volatile Collection<String> uninteresting = null;
    621621    private static volatile Collection<String> discardable = null;
    622    
     622
    623623    /**
    624624     * Returns a list of "uninteresting" keys that do not make an object
     
    658658        return discardable;
    659659    }
    660    
     660
    661661    /**
    662662     * Returns a list of "work in progress" keys that do not make an object
     
    762762        return (flags & FLAG_TAGGED) != 0;
    763763    }
    764    
     764
    765765    /**
    766766     * Determines if this object is considered "annotated". To be "annotated", an object
  • trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java

    r5292 r6069  
    2121        return memberId;
    2222    }
    23    
     23
    2424    public String getRole() {
    2525        return role;
    2626    }
    27    
     27
    2828    public OsmPrimitiveType getMemberType() {
    2929        return memberType;
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r6009 r6069  
    105105        return nodes.length;
    106106    }
    107    
     107
    108108    /**
    109109     * Replies the real number of nodes in this way (full number of nodes minus one if this way is closed)
     
    111111     * @return the real number of nodes in this way.
    112112     * @since 5847
    113      * 
     113     *
    114114     * @see #getNodesCount()
    115115     * @see #isClosed()
     
    183183
    184184    /**
    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.)
    188188     * @return The ordered list of chunks of this way.
    189189     * @since 3348
     
    494494        return nodes.length >= 3 && nodes[nodes.length-1] == nodes[0];
    495495    }
    496    
     496
    497497    /**
    498498     * Determines if this way denotes an area (closed way with at least three distinct nodes).
     
    682682    /**
    683683     * 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,
    685685     *         {@code -1} if the way is a reversed oneway,
    686686     *         {@code 0} otherwise.
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java

    r5440 r6069  
    1515 */
    1616public class HistoryNode extends HistoryOsmPrimitive {
    17    
     17
    1818    /** the coordinates. May be null for deleted nodes */
    1919    private LatLon coords;
     
    2121    /**
    2222     * Constructs a new {@code HistoryNode}.
    23      * 
     23     *
    2424     * @param id the id (> 0 required)
    2525     * @param version the version (> 0 required)
     
    3838     * Constructs a new {@code HistoryNode} with a configurable checking of historic parameters.
    3939     * This is needed to build virtual HistoryNodes for modified nodes, which do not have a timestamp and a changeset id.
    40      * 
     40     *
    4141     * @param id the id (> 0 required)
    4242     * @param version the version (> 0 required)
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java

    r5440 r6069  
    8888        tags = new HashMap<String, String>();
    8989    }
    90    
     90
    9191    /**
    9292     * Constructs a new {@code HistoryOsmPrimitive} from an existing {@link OsmPrimitive}.
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java

    r5440 r6069  
    2525    /**
    2626     * Constructs a new {@code HistoryWay}.
    27      * 
     27     *
    2828     * @param id the id (> 0 required)
    2929     * @param version the version (> 0 required)
     
    4141     * Constructs a new {@code HistoryWay} with a configurable checking of historic parameters.
    4242     * This is needed to build virtual HistoryWays for modified ways, which do not have a timestamp and a changeset id.
    43      * 
     43     *
    4444     * @param id the id (> 0 required)
    4545     * @param version the version (> 0 required)
     
    5858    /**
    5959     * Constructs a new {@code HistoryWay} with a given list of node ids.
    60      * 
     60     *
    6161     * @param id the id (> 0 required)
    6262     * @param version the version (> 0 required)
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/AllNodesVisitor.java

    r6010 r6069  
    4848            if (m.isNode()) visit(m.getNode());
    4949    }
    50    
     50
    5151    /**
    5252     * Replies all nodes contained by the given primitives
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/PrimitiveVisitor.java

    r6010 r6069  
    1111 */
    1212public interface PrimitiveVisitor {
    13    
     13
    1414    /**
    1515     * Visiting call for points.
     
    1717     */
    1818    void visit(INode n);
    19    
     19
    2020    /**
    2121     * Visiting call for lines.
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java

    r5571 r6069  
    2828    /** the map viewport - provides projection and hit detection functionality */
    2929    protected NavigatableComponent nc;
    30    
     30
    3131    /** if true, the paint visitor shall render OSM objects such that they
    3232     * look inactive. Example: rendering of data in an inactive layer using light gray as color only. */
     
    5050    /** Preference: minimum space (displayed way length) to display segment numbers */
    5151    protected int segmentNumberSpace;
    52    
     52
    5353    /**
    5454     * <p>Creates an abstract paint visitor</p>
    55      * 
     55     *
    5656     * @param g the graphics context. Must not be null.
    5757     * @param nc the map viewport. Must not be null.
     
    6868        this.isInactiveMode = isInactiveMode;
    6969    }
    70    
     70
    7171    /**
    7272     * Draw the node as small rectangle with the given color.
     
    8080     * Draw an number of the order of the two consecutive nodes within the
    8181     * parents way
    82      * 
     82     *
    8383     * @param p1 First point of the way segment.
    8484     * @param p2 Second point of the way segment.
     
    102102        }
    103103    }
    104    
     104
    105105    /**
    106106     * Draws virtual nodes.
     
    134134            g.draw(path);
    135135        } catch (ArrayIndexOutOfBoundsException e) {
    136             // Silently ignore any ArrayIndexOutOfBoundsException that may be raised 
     136            // Silently ignore any ArrayIndexOutOfBoundsException that may be raised
    137137            // if the way has changed while being rendered (fix #7979)
    138138            // TODO: proper solution ?
     
    142142        }
    143143    }
    144    
     144
    145145    /**
    146146     * Reads the color definitions from preferences. This function is <code>public</code>, so that
     
    154154        this.highlightColor = PaintColors.HIGHLIGHT.get();
    155155    }
    156    
     156
    157157    /**
    158158     * Reads all the settings from preferences. Calls the @{link #getColors}
     
    167167        getColors();
    168168    }
    169    
     169
    170170    /**
    171171     * Checks if a way segemnt is large enough for additional information display.
     
    181181        return (xd+yd > space);
    182182    }
    183    
     183
    184184    /**
    185185     * Checks if segment is visible in display.
     
    196196        return true;
    197197    }
    198    
     198
    199199    /**
    200200     * Creates path for drawing virtual nodes for one way.
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java

    r5909 r6069  
    2121 * <p>MapRendererFactory manages a list of map renderer classes and associated
    2222 * meta data (display name, description).</p>
    23  * 
     23 *
    2424 * <p>Plugins can implement and supply their own map renderers.</p>
    2525 * <strong>Sample code in a plugin</strong>
     
    2828 *    // ....
    2929 * }
    30  * 
     30 *
    3131 * // to be called when the plugin is created
    3232 * MapRendererFactory factory = MapRendererFactory.getInstance();
    3333 * factory.register(MyMapRenderer.class, "My map renderer", "This is is a fast map renderer");
    3434 * factory.activate(MyMapRenderer.class);
    35  * 
     35 *
    3636 * </pre>
    3737 *
     
    4040
    4141    /** preference key for the renderer class name. Default: class name for {@link StyledMapRenderer}
    42      * 
     42     *
    4343     */
    4444    static public final String PREF_KEY_RENDERER_CLASS_NAME = "mappaint.renderer-class-name";
     
    161161     * <p>Replies true, if {@code Renderer} is already a registered map renderer
    162162     * class.</p>
    163      * 
     163     *
    164164     * @param renderer the map renderer class. Must not be null.
    165165     * @return true, if {@code Renderer} is already a registered map renderer
     
    177177    /**
    178178     * <p>Registers a map renderer class.</p>
    179      * 
     179     *
    180180     * @param renderer the map renderer class. Must not be null.
    181181     * @param displayName the display name to be displayed in UIs (i.e. in the preference dialog)
     
    201201     * <p>If the respective class is also the active renderer, the renderer is reset
    202202     * to the default renderer.</p>
    203      * 
     203     *
    204204     * @param renderer the map renderer class. Must not be null.
    205      * 
     205     *
    206206     */
    207207    public void unregister(Class<? extends AbstractMapRenderer> renderer) {
     
    225225     *
    226226     * <p>The renderer class must already be registered.</p>
    227      * 
     227     *
    228228     * @param renderer the map renderer class. Must not be null.
    229229     * @throws IllegalArgumentException thrown if {@code renderer} is null
    230230     * @throws IllegalStateException thrown if {@code renderer} isn't registered yet
    231      * 
     231     *
    232232     */
    233233    public void activate(Class<? extends AbstractMapRenderer> renderer) throws IllegalArgumentException, IllegalStateException{
     
    247247     *
    248248     * @throws IllegalStateException thrown if the default renderer {@link StyledMapRenderer} isn't registered
    249      * 
     249     *
    250250     */
    251251    public void activateDefault() throws IllegalStateException{
     
    283283    /**
    284284     * <p>Replies the (unmodifiable) list of map renderer descriptors.</p>
    285      * 
     285     *
    286286     * @return the descriptors
    287287     */
     
    293293     * <p>Replies true, if currently the wireframe map renderer is active. Otherwise,
    294294     * false.</p>
    295      * 
     295     *
    296296     * <p>There is a specific method for {@link WireframeMapRenderer} for legacy support.
    297297     * Until 03/2011 there were only two possible map renderers in JOSM: the wireframe
    298298     * renderer and the styled renderer. For the time being there are still UI elements
    299299     * (menu entries, etc.) which toggle between these two renderers only.</p>
    300      * 
     300     *
    301301     * @return true, if currently the wireframe map renderer is active. Otherwise,
    302302     * false
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/Rendering.java

    r4087 r6069  
    1111    /**
    1212     * <p>Renders the OSM data in {@code data}</p>
    13      * 
     13     *
    1414     * @param data the data set to be rendered
    1515     * @param renderVirtualNodes if true, renders virtual nodes. Otherwise, ignores them.
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r6035 r6069  
    222222        }
    223223    }
    224    
     224
    225225    private static class StyleRecord implements Comparable<StyleRecord> {
    226226        final ElemStyle style;
     
    310310    private Color relationSelectedColor;
    311311    private Color highlightColorTransparent;
    312    
     312
    313313    private static final int FLAG_NORMAL = 0;
    314314    private static final int FLAG_DISABLED = 1;
     
    321321
    322322    private Collection<WaySegment> highlightWaySegments;
    323    
     323
    324324    // highlight customization fields
    325325    private int highlightLineWidth;
     
    327327    private int widerHighlight;
    328328    private int highlightStep;
    329    
     329
    330330    //flag that activate wider highlight mode
    331331    private boolean useWiderHighlight;
     
    441441        }
    442442    }
    443    
     443
    444444    protected void drawArea(OsmPrimitive osm, Path2D.Double path, Color color, MapImage fillImage, TextElement text) {
    445445
     
    514514        }
    515515    }
    516    
     516
    517517    public void drawArea(Relation r, Color color, MapImage fillImage, TextElement text) {
    518518        Multipolygon multipolygon = MultipolygonCache.getInstance().get(nc, r);
     
    529529        }
    530530    }
    531    
     531
    532532    public void drawArea(Way w, Color color, MapImage fillImage, TextElement text) {
    533533        drawArea(w, getPath(w), color, fillImage, text);
     
    732732        }
    733733    }
    734    
     734
    735735    public void drawNodeIcon(Node n, Image img, float alpha, boolean selected, boolean member) {
    736736        Point p = nc.getPoint(n);
     
    760760        }
    761761    }
    762    
     762
    763763    public void drawNodeSymbol(Node n, Symbol s, Color fillColor, Color strokeColor) {
    764764        Point p = nc.getPoint(n);
     
    850850        StyledMapRenderer.this.drawOrderNumber(p1, p2, orderNumber, clr);
    851851    }
    852    
     852
    853853    /**
    854854     * highlights a given GeneralPath using the settings from BasicStroke to match the line's
     
    883883        }
    884884    }
    885    
     885
    886886    public void drawRestriction(Image img, Point pVia, double vx, double vx2, double vy, double vy2, double angle, boolean selected) {
    887887        /* rotate image with direction last node in from to */
     
    898898        }
    899899    }
    900    
     900
    901901    public void drawRestriction(Relation r, MapImage icon) {
    902902        Way fromWay = null;
     
    10731073                pVia, vx, vx2, vy, vy2, iconAngle, r.isSelected());
    10741074    }
    1075    
     1075
    10761076    public void drawTextOnPath(Way way, TextElement text) {
    10771077        if (way == null || text == null)
     
    11101110        double[] p1 = pointAt(t1, poly, pathLength);
    11111111        double[] p2 = pointAt(t2, poly, pathLength);
    1112        
     1112
    11131113        if (p1 == null || p2 == null)
    11141114            return;
     
    11641164        }
    11651165    }
    1166    
     1166
    11671167    /**
    11681168     * draw way
     
    13041304        this.backgroundColor = PaintColors.getBackgroundColor();
    13051305    }
    1306    
     1306
    13071307    @Override
    13081308    protected void getSettings(boolean virtual) {
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java

    r6010 r6069  
    9696    /**
    9797     * Creates an wireframe render
    98      * 
     98     *
    9999     * @param g the graphics context. Must not be null.
    100100     * @param nc the map viewport. Must not be null.
     
    158158        this.ds = data;
    159159        getSettings(virtual);
    160        
     160
    161161        for (final Relation rel : data.searchRelations(bbox)) {
    162162            if (rel.isDrawable() && !ds.isSelected(rel) && !rel.isDisabledAndHidden()) {
     
    181181        }
    182182        displaySegments();
    183        
     183
    184184        // Display highlighted ways after the other ones (fix #8276)
    185185        for (List<Way> specialWays : Arrays.asList(new List[]{untaggedWays, highlightedWays})) {
     
    190190            displaySegments();
    191191        }
    192        
     192
    193193        for (final OsmPrimitive osm : data.getSelected()) {
    194194            if (osm.isDrawable()) {
     
    274274        }
    275275    }
    276    
     276
    277277    private boolean isNodeTagged(Node n) {
    278278        return n.isTagged() || n.isAnnotated();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r5410 r6069  
    5050     * member role indicates that the member belongs to an <em>outer</em> or an
    5151     * <em>inner</em> polygon.</p>
    52      * 
     52     *
    5353     * <p>The decision is taken based on preference settings, see the four preference keys
    5454     * above.</p>
    55      * 
     55     *
    5656     */
    5757    private static class MultipolygonRoleMatcher implements PreferenceChangedListener{
     
    209209            buildPoly();
    210210        }
    211        
     211
    212212        private void buildPoly() {
    213213            boolean initial = true;
     
    238238            this.inners = new ArrayList<Multipolygon.PolyData>(copy.inners);
    239239        }
    240        
     240
    241241        public Intersection contains(Path2D.Double p) {
    242242            int contains = 0;
     
    262262            appendInner(inner.poly);
    263263        }
    264        
     264
    265265        private void appendInner(Path2D.Double inner) {
    266266            poly.append(inner.getPathIterator(null), false);
     
    277277            return bounds;
    278278        }
    279        
     279
    280280        public Collection<Long> getWayIds() {
    281281            return wayIds;
    282282        }
    283        
     283
    284284        private void resetNodes(DataSet dataSet) {
    285285            if (!nodes.isEmpty()) {
     
    309309            }
    310310        }
    311        
     311
    312312        private void resetPoly() {
    313313            poly.reset();
     
    315315            bounds = null;
    316316        }
    317        
     317
    318318        public void nodeMoved(NodeMovedEvent event) {
    319319            final Node n = event.getNode();
     
    329329            }
    330330        }
    331        
     331
    332332        public void wayNodesChanged(WayNodesChangedEvent event) {
    333333            final Long wayId = event.getChangedWay().getUniqueId();
     
    350350    private final List<PolyData> outerPolygons = new ArrayList<PolyData>();
    351351    private final List<PolyData> combinedPolygons = new ArrayList<PolyData>();
    352    
     352
    353353    private boolean incomplete;
    354354
     
    389389        }
    390390    }
    391    
     391
    392392    public final boolean isIncomplete() {
    393393        return incomplete;
     
    518518            }
    519519        }
    520        
     520
    521521        if (insideCount == 1)
    522522            return insidePolygon;
     
    560560            }
    561561        }
    562        
     562
    563563        // Clear inner and outer polygons to reduce memory footprint
    564564        innerPolygons.clear();
  • trunk/src/org/openstreetmap/josm/data/preferences/AbstractProperty.java

    r5464 r6069  
    5353        Main.pref.put(getKey(), String.valueOf(getDefaultValue()));
    5454    }
    55    
     55
    5656    /**
    5757     * Replies the value of this property.
     
    6060     */
    6161    public abstract T get();
    62    
     62
    6363    /**
    6464     * Sets this property to the specified value.
  • trunk/src/org/openstreetmap/josm/data/preferences/CachedProperty.java

    r5478 r6069  
    5050        return updateCount;
    5151    }
    52    
    53     @Override 
    54     public T getDefaultValue() { 
    55         return fromString(getDefaultValueAsString()); 
     52
     53    @Override
     54    public T getDefaultValue() {
     55        return fromString(getDefaultValueAsString());
    5656    }
    5757
  • trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java

    r5239 r6069  
    100100        return degree + (minute/60.0) + (second/3600.0);
    101101    }
    102    
     102
    103103    public void dump() {
    104104        System.err.println("x_0="+x_0);
  • trunk/src/org/openstreetmap/josm/data/projection/Projection.java

    r5903 r6069  
    5050     * If projection supports parameters, return a different code
    5151     * for each set of parameters.
    52      * 
     52     *
    5353     * The EPSG code can be used (if defined for the projection).
    5454     *
  • trunk/src/org/openstreetmap/josm/data/projection/datum/AbstractDatum.java

    r4285 r6069  
    55
    66abstract public class AbstractDatum implements Datum {
    7    
     7
    88    protected String name;
    99    protected String proj4Id;
  • trunk/src/org/openstreetmap/josm/data/projection/datum/Datum.java

    r4285 r6069  
    77/**
    88 * Represents a geodetic datum.
    9  * 
     9 *
    1010 * Basically it provides conversion functions from and to the WGS84 datum.
    1111 */
     
    2323     */
    2424    String getProj4Id();
    25    
     25
    2626    /**
    2727     * @return the ellipsoid associated with this datum
     
    3333     */
    3434    LatLon toWGS84(LatLon ll);
    35    
     35
    3636    /**
    3737     * Convert lat/lon from WGS84 to this datum.
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java

    r5926 r6069  
    1717    public final static NTV2GridShiftFileWrapper BETA2007 = new NTV2GridShiftFileWrapper("resource://data/BETA2007.gsb");
    1818    public final static NTV2GridShiftFileWrapper ntf_rgf93 = new NTV2GridShiftFileWrapper("resource://data/ntf_r93_b.gsb");
    19    
     19
    2020
    2121    private NTV2GridShiftFile instance = null;
  • trunk/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java

    r5551 r6069  
    77/**
    88 * Datum provides general conversion from one ellipsoid to another.
    9  * 
     9 *
    1010 * Seven parameters can be specified:
    1111 * - 3D offset
    1212 * - general rotation
    1313 * - scale
    14  * 
     14 *
    1515 * This method is described by EPSG as EPSG::9606.
    1616 * Also known as Bursa-Wolf.
    1717 */
    1818public class SevenParameterDatum extends AbstractDatum {
    19    
     19
    2020    protected double dx, dy, dz, rx, ry, rz, s;
    2121
    2222    /**
    23      * 
     23     *
    2424     * @param name name of the datum
    2525     * @param proj4Id Proj.4 identifier for this datum (or null)
     
    6161        return this.ellps.cart2LatLon(new double[] { x, y, z });
    6262    }
    63    
     63
    6464}
  • trunk/src/org/openstreetmap/josm/data/projection/datum/ThreeParameterDatum.java

    r4285 r6069  
    99 */
    1010public class ThreeParameterDatum extends AbstractDatum {
    11    
     11
    1212    protected double dx, dy, dz;
    1313
     
    3636        return this.ellps.cart2LatLon(xyz);
    3737    }
    38    
     38
    3939}
  • trunk/src/org/openstreetmap/josm/data/validation/Test.java

    r6009 r6069  
    225225        return progressMonitor.isCanceled();
    226226    }
    227    
     227
    228228    /**
    229229     * 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  
    290290    public int compareTo(TestError o) {
    291291        if (equals(o)) return 0;
    292        
     292
    293293        MultipleNameVisitor v1 = new MultipleNameVisitor();
    294294        MultipleNameVisitor v2 = new MultipleNameVisitor();
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java

    r5908 r6069  
    3939    protected static final int MULTIPLE_STREET_RELATIONS = 2604;
    4040    protected static final int HOUSE_NUMBER_TOO_FAR = 2605;
    41    
     41
    4242    protected static final String ADDR_HOUSE_NUMBER  = "addr:housenumber";
    4343    protected static final String ADDR_INTERPOLATION = "addr:interpolation";
     
    4545    protected static final String ADDR_STREET        = "addr:street";
    4646    protected static final String ASSOCIATED_STREET  = "associatedStreet";
    47    
     47
    4848    protected class AddressError extends TestError {
    4949
     
    5858        }
    5959    }
    60    
     60
    6161    /**
    6262     * Constructor
     
    6565        super(tr("Addresses"), tr("Checks for errors in addresses and associatedStreet relations."));
    6666    }
    67    
     67
    6868    protected List<Relation> getAndCheckAssociatedStreets(OsmPrimitive p) {
    6969        List<Relation> list = OsmPrimitive.getFilteredList(p.getReferrers(), Relation.class);
     
    150150                List<OsmPrimitive> list = map.get(key);
    151151                if (list.size() > 1) {
    152                     errors.add(new AddressError(DUPLICATE_HOUSE_NUMBER, list, 
     152                    errors.add(new AddressError(DUPLICATE_HOUSE_NUMBER, list,
    153153                            tr("Duplicate house numbers"), tr(description_en, key), description_en));
    154154                }
     
    156156            // Report wrong street names
    157157            if (!wrongStreetNames.isEmpty()) {
    158                 errors.add(new AddressError(MULTIPLE_STREET_NAMES, wrongStreetNames, 
     158                errors.add(new AddressError(MULTIPLE_STREET_NAMES, wrongStreetNames,
    159159                        tr("Multiple street names in relation")));
    160160            }
     
    169169        }
    170170    }
    171    
     171
    172172    protected void checkDistance(OsmPrimitive house, Collection<Way> street) {
    173173        EastNorth centroid;
     
    207207        List<OsmPrimitive> errorList = new ArrayList<OsmPrimitive>(street);
    208208        errorList.add(0, house);
    209         errors.add(new AddressError(HOUSE_NUMBER_TOO_FAR, errorList, 
     209        errors.add(new AddressError(HOUSE_NUMBER_TOO_FAR, errorList,
    210210                tr("House number too far from street")));
    211211    }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/BuildingInBuilding.java

    r5522 r6069  
    8181        }
    8282    }
    83    
     83
    8484    protected boolean sameLayers(Way w1, Way w2) {
    8585        String l1 = w1.get("layer") != null ? w1.get("layer") : "0";
     
    8787        return l1.equals(l2);
    8888    }
    89    
     89
    9090    protected boolean isWayInsideMultiPolygon(Way object, Relation multiPolygon) {
    9191        // Extract outer/inner members from multipolygon
     
    115115        return false;
    116116    }
    117    
     117
    118118    @Override
    119119    public void endTest() {
    120120        for (final OsmPrimitive p : primitivesToCheck) {
    121121            Collection<Way> outers = new FilteredCollection<Way>(index.search(p.getBBox()), new Predicate<Way>() {
    122                
     122
    123123                protected boolean evaluateNode(Node n, Way object) {
    124124                    return isInPolygon(n, object.getNodes()) || object.getNodes().contains(n);
    125125                }
    126                
     126
    127127                protected boolean evaluateWay(Way w, Way object) {
    128128                    if (w.equals(object)) return false;
    129                    
     129
    130130                    // Get all multipolygons referencing object
    131131                    Collection<OsmPrimitive> buildingMultiPolygons = new FilteredCollection<OsmPrimitive>(object.getReferrers(), new Predicate<OsmPrimitive>() {
     
    135135                        }
    136136                    }) ;
    137                    
     137
    138138                    // if there's none, test if w is inside object
    139139                    if (buildingMultiPolygons.isEmpty()) {
     
    153153                    }
    154154                }
    155                
     155
    156156                protected boolean evaluateRelation(Relation r, Way object) {
    157157                    MultiPolygonMembers mpm = new MultiPolygonMembers((Relation) p);
     
    163163                    return false;
    164164                }
    165                
     165
    166166                @Override
    167167                public boolean evaluate(Way object) {
     
    177177                }
    178178            });
    179            
     179
    180180            if (!outers.isEmpty()) {
    181181                errors.add(new TestError(this, Severity.WARNING,
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r5995 r6069  
    145145                continue;
    146146            }
    147            
     147
    148148            // report errors
    149149            errors.addAll(buildTestErrors(this, nodes));
     
    401401                target = nodes.iterator().next();
    402402            }
    403    
     403
    404404            if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, Collections.singleton(target)))
    405405                return MergeNodesAction.mergeNodes(Main.main.getEditLayer(), nodes, target);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java

    r5700 r6069  
    9292    /** Bag of all ways, regardless of tags */
    9393    private MultiMap<WayPairNoTags, OsmPrimitive> waysNoTags;
    94    
     94
    9595    /** Set of known hashcodes for list of coordinates **/
    9696    private Set<Integer> knownHashCodes;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    r5688 r6069  
    252252        }
    253253    }
    254    
     254
    255255    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
    258258        Collection<? extends OsmPrimitive> primitives = error.getPrimitives();
    259259        if (!primitives.contains(r)) {
     
    268268        }
    269269    }
    270    
     270
    271271    private void addError(Relation r, TestError error) {
    272272        addRelationIfNeeded(error, r);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/NodesDuplicatingWayTags.java

    r5272 r6069  
    2020 * <p>
    2121 * See JOSM ticket #7639 for the original request.
    22  * 
     22 *
    2323 * @author Mrwojo
    2424 */
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r6068 r6069  
    419419            if (checkValues && value != null && value.length() > 0 && presetsValueData != null) {
    420420                final Set<String> values = presetsValueData.get(key);
    421                 final boolean keyInPresets = values != null; 
     421                final boolean keyInPresets = values != null;
    422422                final boolean tagInPresets = values != null && (values.isEmpty() || values.contains(prop.getValue()));
    423                
     423
    424424                boolean ignore = false;
    425425                for (String a : ignoreDataStartsWith) {
     
    438438                    }
    439439                }
    440                
     440
    441441                if (!tagInPresets) {
    442442                    for (IgnoreKeyPair a : ignoreDataKeyPair) {
     
    446446                    }
    447447                }
    448                
     448
    449449                if (!ignore) {
    450450                    if (!keyInPresets) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java

    r5199 r6069  
    157157                    Way previous = (Way) via.get(i - 1);
    158158                    Way current = (Way) via.get(i);
    159                     checkIfConnected(previous, current, 
     159                    checkIfConnected(previous, current,
    160160                            tr("The \"via\" ways are not connected."), UNCONNECTED_VIA);
    161161                }
     
    165165                return;
    166166            }
    167             checkIfConnected((Way) via.get(via.size() - 1), toWay, 
     167            checkIfConnected((Way) via.get(via.size() - 1), toWay,
    168168                    tr("The last \"via\" and the \"to\" way are not connected."), TO_VIA_WAY);
    169169
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java

    r5352 r6069  
    5252        NAMED_WAYS.add( "pedestrian" ); ;
    5353    }
    54    
     54
    5555    /** Whitelist of roles allowed to reference an untagged way */
    5656    public static final Set<String> WHITELIST = new HashSet<String>();
  • trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java

    r6010 r6069  
    2020{
    2121    public static final int MULTIPLE_NAME_MAX_LENGTH = 80;
    22    
     22
    2323    /** The class name of the combined primitives */
    2424    private String multipleClassname;
Note: See TracChangeset for help on using the changeset viewer.