Changeset 6070 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2013-07-17T00:01:49+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:
200 edited

Legend:

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

    r5957 r6070  
    112112        return true;
    113113    }
    114    
     114
    115115    /**
    116116     * Global parent component for all dialogs and message boxes
    117117     */
    118118    public static Component parent;
    119    
     119
    120120    /**
    121121     * Global application.
    122122     */
    123123    public static Main main;
    124    
     124
    125125    /**
    126126     * Command-line arguments used to run the application.
    127127     */
    128128    public static String[] commandLineArgs;
    129    
     129
    130130    /**
    131131     * The worker thread slave. This is for executing all long and intensive
     
    134134     */
    135135    public final static ExecutorService worker = new ProgressMonitorExecutor();
    136    
     136
    137137    /**
    138138     * Global application preferences
     
    144144     */
    145145    public static final PrimitiveDeepCopy pasteBuffer = new PrimitiveDeepCopy();
    146    
     146
    147147    /**
    148148     * The layer source from which {@link Main#pasteBuffer} data comes from.
     
    154154     */
    155155    public static MapFrame map;
    156    
     156
    157157    /**
    158158     * Set to <code>true</code>, when in applet mode
     
    543543        contentPanePrivate.getActionMap().remove(action);
    544544    }
    545    
     545
    546546    /**
    547547     * Replies the registered action for the given shortcut
     
    565565
    566566    /**
    567      * Global panel. 
     567     * Global panel.
    568568     */
    569569    public static final JPanel panel = new JPanel(new BorderLayout());
     
    704704    /**
    705705     * Asks user to perform "save layer" operations (save .osm on disk and/or upload osm data to server) before osm layers deletion.
    706      * 
     706     *
    707707     * @param selectedLayers The layers to check. Only instances of {@link OsmDataLayer} are considered.
    708708     * @param exit {@code true} if JOSM is exiting, {@code false} otherwise.
     
    897897        }
    898898    }
    899    
     899
    900900    protected static void addListener() {
    901901        parent.addComponentListener(new WindowPositionSizeListener());
     
    10461046    /**
    10471047     * Listener for window switch events.
    1048      * 
     1048     *
    10491049     * These are events, when the user activates a window of another application
    10501050     * or comes back to JOSM. Window switches from one JOSM window to another
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r5847 r6070  
    392392                return comp;
    393393
    394             if (r1.getUniqueId() > r2.getUniqueId()) 
     394            if (r1.getUniqueId() > r2.getUniqueId())
    395395                return 1;
    396396            else if (r1.getUniqueId() < r2.getUniqueId())
  • trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java

    r5584 r6070  
    247247        return Main.pref.get("osm-server.auth-method", "basic").equals("oauth");
    248248    }
    249    
     249
    250250    /**
    251251     * Explains a {@link OsmApiException} which was thrown because the authentication at
     
    278278     */
    279279    public static void explainAuthorizationFailed(OsmApiException e) {
    280        
     280
    281281        Matcher m;
    282282        String msg;
    283283        String url = e.getAccessedUrl();
    284284        Pattern p = Pattern.compile("http://.*/api/0.6/(node|way|relation)/(\\d+)/(\\d+)");
    285        
     285
    286286        // Special case for individual access to redacted versions
    287287        // See http://wiki.openstreetmap.org/wiki/Open_Database_License/Changes_in_the_API
     
    298298            msg = ExceptionUtil.explainFailedAuthorisation(e);
    299299        }
    300        
     300
    301301        HelpAwareOptionPane.showOptionDialog(
    302302                Main.parent,
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r5909 r6070  
    5151 *
    5252 * Note: The button indices are counted from 1 and upwards.
    53  * So for {@link #getValue()}, {@link #setDefaultButton(int)} and 
     53 * So for {@link #getValue()}, {@link #setDefaultButton(int)} and
    5454 * {@link #setCancelButton} the first button has index 1.
    55  * 
     55 *
    5656 * Simple example:
    5757 * <pre>
     
    274274    /**
    275275     * Retrieve the user choice after the dialog has been closed.
    276      * 
     276     *
    277277     * @return <ul> <li>The selected button. The count starts with 1.</li>
    278278     *              <li>A return value of {@link #DialogClosedOtherwise} means the dialog has been closed otherwise.</li>
     
    452452        }
    453453    }
    454    
     454
    455455    protected final WindowGeometry initWindowGeometry() {
    456456        return new WindowGeometry(rememberSizePref, defaultWindowGeometry);
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r5889 r6070  
    4040
    4141    public static class LinkGeneral extends JosmEditorPane implements HyperlinkListener {
    42        
     42
    4343        /**
    4444         * Constructs a new {@code LinkGeneral} with the given HTML text
  • trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java

    r6051 r6070  
    4242        public final String helpTopic;
    4343        private boolean enabled;
    44        
     44
    4545        private final Collection<ChangeListener> listeners = new HashSet<ChangeListener>();
    46        
     46
    4747        /**
    4848         * Constructs a new {@code ButtonSpec}.
     
    7272            setEnabled(enabled);
    7373        }
    74        
     74
    7575        /**
    7676         * Determines if this button spec is enabled
     
    8181            return enabled;
    8282        }
    83        
     83
    8484        /**
    8585         * Enables or disables this button spec, depending on the value of the parameter {@code b}.
     
    9696            }
    9797        }
    98        
     98
    9999        private final boolean addChangeListener(ChangeListener listener) {
    100100            return listener != null ? listeners.add(listener) : false;
  • trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java

    r5909 r6070  
    183183        return userInfo;
    184184    }
    185    
     185
    186186    /**
    187187     * Initializes the user identity manager from Basic Authentication values in the {@link org.openstreetmap.josm.data.Preferences}
     
    251251            }
    252252            return;
    253            
     253
    254254        } else if (evt.getKey().equals("osm-server.url")) {
    255255            if (!(evt.getNewValue() instanceof StringSetting)) return;
     
    260260                setPartiallyIdentified(getUserName());
    261261            }
    262            
     262
    263263        } else if (evt.getKey().equals("oauth.access-token.key")) {
    264264            accessTokenKeyChanged = true;
    265            
     265
    266266        } else if (evt.getKey().equals("oauth.access-token.secret")) {
    267267            accessTokenSecretChanged = true;
    268268        }
    269        
     269
    270270        if (accessTokenKeyChanged && accessTokenSecretChanged) {
    271271            accessTokenKeyChanged = false;
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r5868 r6070  
    265265            System.exit(1);
    266266        }
    267        
     267
    268268        Main.commandLineArgs = argArray;
    269269
  • trunk/src/org/openstreetmap/josm/gui/MainMenu.java

    r5965 r6070  
    578578            showAudioMenu(true);
    579579        }
    580        
     580
    581581        Main.pref.addPreferenceChangeListener(new PreferenceChangedListener() {
    582582            @Override
     
    600600        new PresetsMenuEnabler(presetsMenu).refreshEnabled();
    601601    }
    602    
     602
    603603    protected void showAudioMenu(boolean showMenu) {
    604604        if (showMenu && audioMenu == null) {
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r6056 r6070  
    145145
    146146    private final boolean unregisterTab;
    147    
     147
    148148    /**
    149149     * Default width of the toggle dialog area.
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r6056 r6070  
    8383    final MapView mv;
    8484    final Collector collector;
    85    
     85
    8686    public class BackgroundProgressMonitor implements ProgressMonitorDialog {
    8787
     
    145145    final JProgressBar progressBar = new JProgressBar();
    146146    public final BackgroundProgressMonitor progressMonitor = new BackgroundProgressMonitor();
    147    
     147
    148148    private final MouseListener jumpToOnLeftClick;
    149149    private final SoMChangeListener somListener;
    150    
     150
    151151    private double distValue; // Distance value displayed in distText, stored if refresh needed after a change of system of measurement
    152152
     
    456456            EventQueue.invokeLater(new Runnable(){
    457457               public void run() {
    458                     staticPopup.hide(); 
     458                    staticPopup.hide();
    459459                }});
    460460        }
     
    531531            }
    532532            text.append(name);
    533            
     533
    534534            boolean idShown = Main.pref.getBoolean("osm-primitives.showid");
    535535            // fix #7557 - do not show ID twice
    536            
     536
    537537            if (!osm.isNew() && !idShown) {
    538538                text.append(" [id="+osm.getId()+"]");
     
    611611
    612612    private AWTEventListener awtListener = new AWTEventListener() {
    613          @Override 
     613         @Override
    614614         public void eventDispatched(AWTEvent event) {
    615615            if (event instanceof InputEvent &&
     
    700700                    @Override
    701701                    public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
    702                         Component invoker = ((JPopupMenu)e.getSource()).getInvoker(); 
     702                        Component invoker = ((JPopupMenu)e.getSource()).getInvoker();
    703703                        jumpButton.setVisible(invoker == latText || invoker == lonText);
    704704                        doNotHide.setSelected(Main.pref.getBoolean("statusbar.always-visible", true));
     
    710710            }
    711711        });
    712        
     712
    713713        // also show Jump To dialog on mouse click (except context menu)
    714714        jumpToOnLeftClick = new MouseAdapter() {
     
    758758        add(angleText, GBC.std().insets(3,0,0,0));
    759759        add(distText, GBC.std().insets(3,0,0,0));
    760        
     760
    761761        distText.addMouseListener(new MouseAdapter() {
    762762            private final List<String> soms = new ArrayList<String>(new TreeSet<String>(NavigatableComponent.SYSTEMS_OF_MEASUREMENT.keySet()));
    763            
     763
    764764            @Override
    765765            public void mouseClicked(MouseEvent e) {
     
    769769            }
    770770        });
    771        
     771
    772772        NavigatableComponent.addSoMChangeListener(somListener = new SoMChangeListener() {
    773773            @Override public void systemOfMeasurementChanged(String oldSoM, String newSoM) {
     
    775775            }
    776776        });
    777        
     777
    778778        latText.addMouseListener(jumpToOnLeftClick);
    779779        lonText.addMouseListener(jumpToOnLeftClick);
    780        
     780
    781781        helpText.setEditable(false);
    782782        add(nameText, GBC.std().insets(3,0,0,0));
     
    803803        thread.start();
    804804    }
    805    
     805
    806806    public JPanel getAnglePanel() {
    807807        return angleText;
     
    892892    public void destroy() {
    893893        NavigatableComponent.removeSoMChangeListener(somListener);
    894        
     894
    895895        // MapFrame gets destroyed when the last layer is removed, but the status line background
    896896        // thread that collects the information doesn't get destroyed automatically.
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r6052 r6070  
    8080     */
    8181    public interface LayerChangeListener {
    82        
     82
    8383        /**
    8484         * Notifies this listener that the active layer has changed.
     
    8787         */
    8888        void activeLayerChange(Layer oldLayer, Layer newLayer);
    89        
     89
    9090        /**
    9191         * Notifies this listener that a layer has been added.
     
    9393         */
    9494        void layerAdded(Layer newLayer);
    95        
     95
    9696        /**
    9797         * Notifies this listener that a layer has been removed.
     
    272272            @Override public void mouseMoved(MouseEvent e) {
    273273                lastMEvent = e;
    274             }           
     274            }
    275275            @Override
    276276            public void mousePressed(MouseEvent me) {
     
    288288    private Dimension oldSize = null;
    289289    private Point oldLoc = null;
    290    
     290
    291291    /*
    292292     * Call this method to keep map position on screen during next repaint
     
    296296        oldLoc  = getLocationOnScreen();
    297297    }
    298    
     298
    299299    /**
    300300     * Adds a GPX layer. A GPX layer is added below the lowest data layer.
     
    432432            setActiveLayer(determineNextActiveLayer(layersList), false);
    433433        }
    434        
     434
    435435        if (layer instanceof OsmDataLayer) {
    436436            ((OsmDataLayer)layer).removeLayerPropertyChangeListener(this);
     
    552552            zoomTo(newCenter);
    553553        }
    554        
     554
    555555        List<Layer> visibleLayers = getVisibleLayersInZOrder();
    556556
     
    565565
    566566        boolean canUseBuffer;
    567        
     567
    568568        synchronized (this) {
    569569            canUseBuffer = !paintPreferencesChanged;
  • trunk/src/org/openstreetmap/josm/gui/MenuScroller.java

    r5927 r6070  
    482482        }
    483483    }
    484    
     484
    485485    private class MenuScrollListener implements PopupMenuListener {
    486486
     
    597597        }
    598598    }
    599    
     599
    600600    private class MouseScrollListener implements MouseWheelListener {
    601601        public void mouseWheelMoved(MouseWheelEvent mwe) {
  • trunk/src/org/openstreetmap/josm/gui/NameFormatterHook.java

    r5903 r6070  
    1515     */
    1616    public String checkRelationTypeName(IRelation relation, String defaultName);
    17    
     17
    1818    /**
    1919     * Check the node format. Return the corrected format if needed, null otherwise.
     
    2323     */
    2424    public String checkFormat(INode node, String defaultName);
    25    
     25
    2626    /**
    2727     * Check the way format. Return the corrected format if needed, null otherwise.
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r6065 r6070  
    6464        void zoomChanged();
    6565    }
    66    
     66
    6767    /**
    6868     * Interface to notify listeners of the change of the system of measurement.
     
    7777        void systemOfMeasurementChanged(String oldSoM, String newSoM);
    7878    }
    79    
     79
    8080    /**
    8181     * Simple data class that keeps map center and scale in one object.
     
    150150    /**
    151151     * Removes a SoM change listener
    152      * 
     152     *
    153153     * @param listener the listener. Ignored if null or already absent
    154154     * @since 6056
     
    160160    /**
    161161     * Adds a SoM change listener
    162      * 
     162     *
    163163     * @param listener the listener. Ignored if null or already registered.
    164164     * @since 6056
     
    169169        }
    170170    }
    171    
     171
    172172    protected static void fireSoMChanged(String oldSoM, String newSoM) {
    173173        for (SoMChangeListener l : somChangeListeners) {
     
    190190    private Rectangle paintRect = null;
    191191    private Polygon paintPoly = null;
    192    
     192
    193193    public NavigatableComponent() {
    194194        setLayout(null);
     
    728728        return getNearestNode(p, predicate, use_selected, null);
    729729    }
    730    
     730
    731731    /**
    732732     * The *result* depends on the current map selection state IF use_selected is true
     
    734734     * If more than one node within node.snap-distance pixels is found,
    735735     * the nearest node selected is returned IF use_selected is true.
    736      * 
     736     *
    737737     * If there are no selected nodes near that point, the node that is related to some of the preferredRefs
    738738     *
     
    755755    public final Node getNearestNode(Point p, Predicate<OsmPrimitive> predicate,
    756756            boolean use_selected, Collection<OsmPrimitive> preferredRefs) {
    757        
     757
    758758        Map<Double, List<Node>> nlists = getNearestNodesImpl(p, predicate);
    759759        if (nlists.isEmpty()) return null;
    760        
     760
    761761        if (preferredRefs != null && preferredRefs.isEmpty()) preferredRefs = null;
    762762        Node ntsel = null, ntnew = null, ntref = null;
     
    793793
    794794        // take nearest selected, nearest new or true nearest node to p, in that order
    795         if (ntsel != null && useNtsel) 
     795        if (ntsel != null && useNtsel)
    796796            return ntsel;
    797         if (ntref != null) 
     797        if (ntref != null)
    798798            return ntref;
    799         if (ntnew != null) 
     799        if (ntnew != null)
    800800            return ntnew;
    801801        return nlists.values().iterator().next().get(0);
     
    956956        return (ntsel != null && use_selected) ? ntsel : wayseg;
    957957    }
    958    
     958
    959959     /**
    960960     * The *result* depends on the current map selection state IF use_selected is true.
     
    974974        WaySegment wayseg = null, ntsel = null, ntref = null;
    975975        if (preferredRefs != null && preferredRefs.isEmpty()) preferredRefs = null;
    976        
     976
    977977        searchLoop: for (List<WaySegment> wslist : getNearestWaySegmentsImpl(p, predicate).values()) {
    978978            for (WaySegment ws : wslist) {
     
    10031003            }
    10041004        }
    1005         if (ntsel != null && use_selected) 
     1005        if (ntsel != null && use_selected)
    10061006            return ntsel;
    10071007        if (ntref != null)
     
    11801180     */
    11811181    public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean use_selected) {
    1182         Collection<OsmPrimitive> sel = 
     1182        Collection<OsmPrimitive> sel =
    11831183                use_selected ? getCurrentDataSet().getSelected() : null;
    11841184        OsmPrimitive osm = getNearestNode(p, predicate, use_selected, sel);
     
    12951295            }
    12961296        }
    1297        
     1297
    12981298        // add nearby nodes
    12991299        for (List<Node> nlist : getNearestNodesImpl(p, predicate).values()) {
    13001300            nearestList.addAll(nlist);
    13011301        }
    1302        
     1302
    13031303        // add parent relations of nearby nodes and ways
    13041304        Set<OsmPrimitive> parentRelations = new HashSet<OsmPrimitive>();
     
    13111311        }
    13121312        nearestList.addAll(parentRelations);
    1313        
     1313
    13141314        if (ignore != null) {
    13151315            nearestList.removeAll(ignore);
     
    13921392     */
    13931393    public static class SystemOfMeasurement {
    1394        
     1394
    13951395        /** First value, in meters, used to translate unit according to above formula. */
    13961396        public final double aValue;
     
    14041404         *  @since 5870 */
    14051405        public final double areaCustomValue;
    1406         /** Specific optional area unit. Set to {@code null} if not used. 
     1406        /** Specific optional area unit. Set to {@code null} if not used.
    14071407         *  @since 5870 */
    14081408        public final String areaCustomName;
     
    14131413         * If a quantity x is given in m (x_m) and in unit a (x_a) then it translates as
    14141414         * x_a == x_m / aValue
    1415          * 
     1415         *
    14161416         * @param aValue First value, in meters, used to translate unit according to above formula.
    14171417         * @param aName First unit used to format text.
     
    14221422            this(aValue, aName, bValue, bName, -1, null);
    14231423        }
    1424        
     1424
    14251425        /**
    14261426         * System of measurement. Currently covers only length (and area) units.
     
    14281428         * If a quantity x is given in m (x_m) and in unit a (x_a) then it translates as
    14291429         * x_a == x_m / aValue
    1430          * 
     1430         *
    14311431         * @param aValue First value, in meters, used to translate unit according to above formula.
    14321432         * @param aName First unit used to format text.
    14331433         * @param bValue Second value, in meters, used to translate unit according to above formula.
    14341434         * @param bName Second unit used to format text.
    1435          * @param areaCustomValue Specific optional area value, in squared meters, between {@code aValue*aValue} and {@code bValue*bValue}. 
     1435         * @param areaCustomValue Specific optional area value, in squared meters, between {@code aValue*aValue} and {@code bValue*bValue}.
    14361436         *                        Set to {@code -1} if not used.
    14371437         * @param areaCustomName Specific optional area unit. Set to {@code null} if not used.
    1438          * 
     1438         *
    14391439         * @since 5870
    14401440         */
     
    14821482                return formatText(a, aName+"\u00b2");
    14831483        }
    1484        
     1484
    14851485        private static String formatText(double v, String unit) {
    14861486            return String.format(Locale.US, "%." + (v<9.999999 ? 2 : 1) + "f %s", v, unit);
     
    14931493     */
    14941494    public static final SystemOfMeasurement METRIC_SOM = new SystemOfMeasurement(1, "m", 1000, "km", 10000, "ha");
    1495    
     1495
    14961496    /**
    14971497     * Chinese system.
     
    14991499     */
    15001500    public static final SystemOfMeasurement CHINESE_SOM = new SystemOfMeasurement(1.0/3.0, "\u5e02\u5c3a" /* chi */, 500, "\u5e02\u91cc" /* li */);
    1501    
     1501
    15021502    /**
    15031503     * Imperial system (British Commonwealth and former British Empire).
     
    15051505     */
    15061506    public static final SystemOfMeasurement IMPERIAL_SOM = new SystemOfMeasurement(0.3048, "ft", 1609.344, "mi", 4046.86, "ac");
    1507    
     1507
    15081508    /**
    15091509     * Nautical mile system (navigation, polar exploration).
     
    15791579        Cursors = c;
    15801580    }
    1581    
     1581
    15821582    @Override
    15831583    public void paint(Graphics g) {
     
    16131613        }
    16141614    }
    1615    
     1615
    16161616    /**
    16171617     * Requests to paint the given {@code Polygon} as a polyline (unclosed polygon).
     
    16281628        }
    16291629    }
    1630    
     1630
    16311631    /**
    16321632     * Requests to clear the rectangled previously drawn.
  • trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java

    r5895 r6070  
    8181    /**
    8282     * Constructs a new {@code PleaseWaitDialog}.
    83      * @param parent the {@code Component} from which the dialog is displayed. Can be {@code null}. 
     83     * @param parent the {@code Component} from which the dialog is displayed. Can be {@code null}.
    8484     */
    8585    public PleaseWaitDialog(Component parent) {
  • trunk/src/org/openstreetmap/josm/gui/SelectionManager.java

    r5764 r6070  
    221221        nc.requestPaintRect(getSelectionRectangle());
    222222    }
    223    
     223
    224224    private void paintLasso() {
    225225        if (mousePos == null || mousePosStart == null || mousePos == mousePosStart) {
  • trunk/src/org/openstreetmap/josm/gui/ShowHideButtonListener.java

    r4609 r6070  
    44/**
    55 * When some component (ToggleDialog, for example) is linked to button
    6  * and needs information about button showing/hiding events, this interface 
     6 * and needs information about button showing/hiding events, this interface
    77 * is used, setting the listener should be implemented by @class HideableButton
    88 */
  • trunk/src/org/openstreetmap/josm/gui/SideButton.java

    r5926 r6070  
    2626public class SideButton extends JButton implements Destroyable {
    2727    private final static int iconHeight = 20;
    28    
     28
    2929    private PropertyChangeListener propertyChangeListener;
    3030
  • trunk/src/org/openstreetmap/josm/gui/actionsupport/AlignImageryPanel.java

    r5927 r6070  
    2525/**
    2626 * The panel to nag a user ONCE that he/she has to align imagery.
    27  * 
     27 *
    2828 * @author zverik
    2929 */
     
    3333    public AlignImageryPanel(boolean oneLine) {
    3434        super();
    35        
     35
    3636        Font font = getFont().deriveFont(Font.PLAIN, 14.0f);
    3737        JLabel nagLabel = new JLabel(tr("Aerial imagery might be misaligned. Please check its offset using GPS tracks!"));
     
    3939        nagLabel.setFont(font);
    4040        detailsList.setFont(font);
    41        
     41
    4242        JButton closeButton = new JButton(ImageProvider.get("misc", "black_x"));
    4343        closeButton.setContentAreaFilled(false);
     
    5454            }
    5555        });
    56        
     56
    5757        setLayout(new GridBagLayout());
    5858        if (!oneLine) { // tune for small screens
     
    7979        }
    8080    }
    81    
     81
    8282}
  • trunk/src/org/openstreetmap/josm/gui/bbox/BBoxChooser.java

    r5816 r6070  
    77 * A BBoxChooser is a component which provides a UI for choosing a
    88 * bounding box.
    9  * 
     9 *
    1010 */
    1111public interface BBoxChooser {
     
    2020     * Sets the current bounding box in this BboxChooser. If {@code bbox}
    2121     * is null the current bbox in this BBoxChooser is removed.
    22      * 
     22     *
    2323     * @param bbox the bounding box
    2424     */
     
    2929     * Replies null, if currently there isn't a bbox choosen in this
    3030     * BBoxChooser.
    31      * 
     31     *
    3232     * @return the currently selected bounding box
    3333     */
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java

    r5925 r6070  
    5656    private SizeButton iSizeButton = null;
    5757    private SourceButton iSourceButton = null;
    58    
     58
    5959    private boolean isSelecting;
    6060
     
    7979        iSizeButton = sizeButton;
    8080        iSourceButton = sourceButton;
    81        
     81
    8282        isSelecting = false;
    8383
     
    158158                iStartSelectionPoint = null;
    159159                isSelecting = false;
    160                
     160
    161161            } else {
    162162                int sourceButton = iSourceButton.hit(e.getPoint());
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java

    r5903 r6070  
    258258        selectFirstTabWithConflicts();
    259259    }
    260    
     260
    261261    public void selectFirstTabWithConflicts() {
    262262        for (int i = 0; i < tabbedPane.getTabCount(); i++) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java

    r5903 r6070  
    8787    private boolean isFrozen = false;
    8888    private final ComparePairListModel comparePairListModel;
    89    
     89
    9090    private DataSet myDataset;
    9191    private Map<PrimitiveId, PrimitiveId> mergedMap;
     
    130130        return getMyPrimitiveById(entry);
    131131    }
    132    
     132
    133133    public final OsmPrimitive getMyPrimitiveById(PrimitiveId entry) {
    134134        OsmPrimitive result = myDataset.getPrimitiveById(entry);
     
    336336        fireModelDataChanged();
    337337    }
    338    
     338
    339339    protected final void initPopulate(OsmPrimitive my, OsmPrimitive their, Map<PrimitiveId, PrimitiveId> mergedMap) {
    340340        CheckParameterUtil.ensureParameterNotNull(my, "my");
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java

    r5429 r6070  
    888888        );
    889889    }
    890    
     890
    891891    public void unlinkAsListener() {
    892892        myEntriesTable.unlinkAsListener();
     
    10311031        }
    10321032    }
    1033    
     1033
    10341034    protected final <P extends OsmPrimitive> OsmDataLayer findLayerFor(P primitive) {
    10351035        if (primitive != null) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMerger.java

    r5335 r6070  
    6060        theirEntriesTable.setLayer(findLayerFor(theirWay));
    6161    }
    62    
     62
    6363    public void deletePrimitive(boolean deleted) {
    6464        if (deleted) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r5998 r6070  
    463463
    464464    /**
    465      * Replies the list of {@link Command commands} needed to resolve specified conflicts, 
     465     * Replies the list of {@link Command commands} needed to resolve specified conflicts,
    466466     * by displaying if necessary a {@link CombinePrimitiveResolverDialog} to the user.
    467467     * This dialog will allow the user to choose conflict resolution actions.
    468      * 
     468     *
    469469     * Non-expert users are informed first of the meaning of these operations, allowing them to cancel.
    470      * 
     470     *
    471471     * @param tagsOfPrimitives The tag collection of the primitives to be combined.
    472472     *                         Should generally be equal to {@code TagCollection.unionOfAllPrimitives(primitives)}
     
    480480            final Collection<? extends OsmPrimitive> primitives,
    481481            final Collection<? extends OsmPrimitive> targetPrimitives) throws UserCancelException {
    482        
     482
    483483        CheckParameterUtil.ensureParameterNotNull(tagsOfPrimitives, "tagsOfPrimitives");
    484484        CheckParameterUtil.ensureParameterNotNull(primitives, "primitives");
     
    511511        dialog.getRelationMemberConflictResolverModel().populate(parentRelations, primitives);
    512512        dialog.prepareDefaultDecisions();
    513        
     513
    514514        // Ensure a proper title is displayed instead of a previous target (fix #7925)
    515515        if (targetPrimitives.size() == 1) {
     
    555555                parentRelations.size(), parentRelations.size(), primitives.size(),
    556556                DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(parentRelations));
    557        
     557
    558558        if (!ConditionalOptionPaneUtil.showConfirmationDialog(
    559559                "combine_tags",
     
    596596                + "Do you want to continue?",
    597597                primitives.size(), conflicts);
    598        
     598
    599599        if (!ConditionalOptionPaneUtil.showConfirmationDialog(
    600600                "combine_tags",
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r5958 r6070  
    8585    private CloseOpenChangesetsAction closeChangesetAction;
    8686    private LaunchChangesetManagerAction launchChangesetManagerAction;
    87    
     87
    8888    private ChangesetDialogPopup popupMenu;
    8989
     
    204204        launchChangesetManagerAction = new LaunchChangesetManagerAction();
    205205        cbInSelectionOnly.addItemListener(launchChangesetManagerAction);
    206        
     206
    207207        popupMenu = new ChangesetDialogPopup(lstInActiveDataLayer, lstInSelection);
    208208
     
    210210        lstInSelection.addMouseListener(popupMenuLauncher);
    211211        lstInActiveDataLayer.addMouseListener(popupMenuLauncher);
    212        
     212
    213213        createLayout(pnl, false, Arrays.asList(new SideButton[] {
    214214            new SideButton(selectObjectsAction, false),
  • trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java

    r5958 r6070  
    7575    private SelectAction selectAction = new SelectAction();
    7676    private SelectAndZoomAction selectAndZoomAction = new SelectAndZoomAction();
    77    
     77
    7878    public CommandStackDialog(final MapFrame mapFrame) {
    7979        super(tr("Command Stack"), "commandstack", tr("Open a list of all commands (undo buffer)."),
     
    8989        undoTree.getSelectionModel().addTreeSelectionListener(undoSelectionListener);
    9090        InputMapUtils.unassignCtrlShiftUpDown(undoTree, JComponent.WHEN_FOCUSED);
    91        
     91
    9292        redoTree.addMouseListener(new MouseEventHandler());
    9393        redoTree.setRootVisible(false);
     
    124124            new SideButton(redoAction)
    125125        }));
    126        
     126
    127127        InputMapUtils.addEnterAction(undoTree, selectAndZoomAction);
    128128        InputMapUtils.addEnterAction(redoTree, selectAndZoomAction);
     
    303303        return node;
    304304    }
    305    
     305
    306306    /**
    307307     * Return primitives that are affected by some command
    308      * @param path GUI elements 
    309      * @return collection of affected primitives, onluy usable ones 
     308     * @param path GUI elements
     309     * @return collection of affected primitives, onluy usable ones
    310310     */
    311311    protected static FilteredCollection<OsmPrimitive> getAffectedPrimitives(TreePath path) {
     
    354354            Main.map.mapView.getEditLayer().data.setSelected( getAffectedPrimitives(path));
    355355        }
    356        
     356
    357357        @Override
    358358        public void updateEnabledState() {
     
    377377        }
    378378    }
    379    
     379
    380380    /**
    381381     * undo / redo switch to reduce duplicate code
     
    448448            super(new CommandStackPopup());
    449449        }
    450        
     450
    451451        @Override
    452452        public void mouseClicked(MouseEvent evt) {
     
    456456        }
    457457    }
    458    
     458
    459459    private class CommandStackPopup extends JPopupMenu {
    460460        public CommandStackPopup(){
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r6009 r6070  
    6767    /**
    6868     * Replies the color used to paint conflicts.
    69      * 
     69     *
    7070     * @return the color used to paint conflicts
    7171     * @since 1221
     
    8383    /** the list widget for the list of conflicts */
    8484    private JList lstConflicts;
    85    
     85
    8686    private final JPopupMenu popupMenu = new JPopupMenu();
    8787    private final PopupMenuHandler popupMenuHandler = new PopupMenuHandler(popupMenu);
     
    115115            btnResolve, btnSelect
    116116        }));
    117        
     117
    118118        popupMenuHandler.addAction(Main.main.menu.autoScaleActions.get("conflict"));
    119119    }
     
    143143        DataSet.removeSelectionListener(this);
    144144    }
    145    
     145
    146146    /**
    147147     * Add a list selection listener to the conflicts list.
     
    152152        lstConflicts.getSelectionModel().addListSelectionListener(listener);
    153153    }
    154    
     154
    155155    /**
    156156     * Remove the given list selection listener from the conflicts list.
     
    161161        lstConflicts.getSelectionModel().removeListSelectionListener(listener);
    162162    }
    163    
     163
    164164    /**
    165165     * Replies the popup menu handler.
     
    218218    /**
    219219     * Paints all conflicts that can be expressed on the main window.
    220      * 
     220     *
    221221     * @param g The {@code Graphics} used to paint
    222222     * @param nc The {@code NavigatableComponent} used to get screen coordinates of nodes
     
    294294    /**
    295295     * returns the first selected item of the conflicts list
    296      * 
     296     *
    297297     * @return Conflict
    298298     */
     
    331331        return ht("/Dialog/ConflictList");
    332332    }
    333    
     333
    334334    class MouseEventHandler extends PopupMenuLauncher {
    335335        public MouseEventHandler() {
     
    438438            }
    439439            DataSet ds = Main.main.getCurrentDataSet();
    440             if (ds != null) { // Can't see how it is possible but it happened in #7942 
     440            if (ds != null) { // Can't see how it is possible but it happened in #7942
    441441                ds.setSelected(sel);
    442442            }
     
    450450        }
    451451    }
    452    
     452
    453453    /**
    454454     * Warns the user about the number of detected conflicts
  • trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java

    r5360 r6070  
    108108        historyTable.getSelectionModel().addListSelectionListener(showHistoryAction);
    109109        historyTable.getSelectionModel().addListSelectionListener(reloadAction);
    110        
     110
    111111        // Show history dialog on Enter/Spacebar
    112112        InputMapUtils.addEnterAction(historyTable, showHistoryAction);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r6058 r6070  
    9292
    9393    private final NewAction newAction;
    94    
     94
    9595    /** the popup menu and its handler */
    9696    private final JPopupMenu popupMenu = new JPopupMenu();
     
    9898
    9999    private final JosmTextField filter;
    100    
     100
    101101    // Actions
    102102    /** the edit action */
     
    114114    /** add all selected primitives to the given relations */
    115115    private final AddSelectionToRelations addSelectionToRelations = new AddSelectionToRelations();
    116    
     116
    117117    HighlightHelper highlightHelper = new HighlightHelper();
    118118    private boolean highlightEnabled = Main.pref.getBoolean("draw.target-highlight", true);
     
    158158        // Setup popup menu handler
    159159        setupPopupMenuHandler();
    160        
     160
    161161        JPanel pane = new JPanel(new BorderLayout());
    162162        pane.add(filter, BorderLayout.NORTH);
     
    175175
    176176        InputMapUtils.unassignCtrlShiftUpDown(displaylist, JComponent.WHEN_FOCUSED);
    177        
     177
    178178        // Select relation on Ctrl-Enter
    179179        InputMapUtils.addEnterAction(displaylist, selectRelationAction);
     
    182182        displaylist.getActionMap().put("edit", editAction);
    183183        displaylist.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.CTRL_MASK), "edit");
    184        
     184
    185185        updateActionsRelationLists();
    186186    }
    187    
     187
    188188    // inform all actions about list of relations they need
    189189    private void updateActionsRelationLists() {
    190190        List<Relation> sel = model.getSelectedRelations();
    191191        popupMenuHandler.setPrimitives(sel);
    192        
     192
    193193        Component focused = FocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    194        
     194
    195195        //update highlights
    196196        if (highlightEnabled && focused==displaylist && Main.isDisplayingMapView()) {
     
    200200        }
    201201    }
    202    
     202
    203203    @Override public void showNotify() {
    204204        MapView.addLayerChangeListener(newAction);
     
    214214        DataSet.removeSelectionListener(addSelectionToRelations);
    215215    }
    216    
     216
    217217    private void resetFilter() {
    218218        filter.setText(null);
     
    309309
    310310    class MouseEventHandler extends PopupMenuLauncher {
    311        
     311
    312312        public MouseEventHandler() {
    313313            super(popupMenu);
     
    318318            if (highlightEnabled) highlightHelper.clear();
    319319        }
    320        
     320
    321321        protected void setCurrentRelationAsSelection() {
    322322            Main.main.getCurrentDataSet().setSelected((Relation)displaylist.getSelectedValue());
     
    326326            EditRelationAction.launchEditor(getSelected());
    327327        }
    328        
     328
    329329        @Override public void mouseClicked(MouseEvent e) {
    330330            if (Main.main.getEditLayer() == null) return;
     
    338338        }
    339339    }
    340    
     340
    341341    /**
    342342     * The action for creating a new relation
     
    493493            }
    494494        }
    495        
     495
    496496        private void updateFilteredRelations() {
    497497            if (filter != null) {
     
    519519            return filteredRelations == null ? relations : filteredRelations;
    520520        }
    521        
     521
    522522        private Relation getVisibleRelation(int index) {
    523523            if (index < 0 || index >= getVisibleRelations().size()) return null;
     
    584584            return i;
    585585        }
    586        
     586
    587587        private Integer getVisibleRelationIndex(Relation rel) {
    588588            int i = getVisibleRelations().indexOf(rel);
     
    604604
    605605    private final void setupPopupMenuHandler() {
    606        
     606
    607607        // -- select action
    608608        popupMenuHandler.addAction(selectRelationAction);
     
    624624        popupMenuHandler.addAction(duplicateAction).setVisible(false);
    625625        popupMenuHandler.addAction(deleteRelationsAction).setVisible(false);
    626        
     626
    627627        popupMenuHandler.addAction(addSelectionToRelations);
    628628    }
    629    
     629
    630630    /* ---------------------------------------------------------------------------------- */
    631631    /* Methods that can be called from plugins                                            */
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r6058 r6070  
    155155            }
    156156        });
    157                
     157
    158158        lstPrimitives.addMouseListener(new MouseEventHandler());
    159159
     
    192192            super(popupMenu);
    193193        }
    194        
     194
    195195        @Override
    196196        public void mouseClicked(MouseEvent e) {
     
    727727                text.append(tr("Unselectable now"));
    728728                this.sel=new ArrayList<OsmPrimitive>(); // empty selection
    729             }           
     729            }
    730730            if(ways + nodes + relations == 1)
    731731            {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r6061 r6070  
    144144     */
    145145    protected JCheckBoxMenuItem windowMenuItem;
    146    
     146
    147147    /**
    148148     * The linked preferences class (optional). If set, accessible from the title bar with a dedicated button
     
    152152    /**
    153153     * Constructor
    154      * 
     154     *
    155155     * @param name  the name of the dialog
    156156     * @param iconName the name of the icon to be displayed
     
    493493                add(buttonsHide);
    494494            }
    495            
     495
    496496            // show the pref button if applicable
    497497            if (preferenceClass != null) {
     
    558558            return lblTitle.getText();
    559559        }
    560        
     560
    561561        public class DialogPopupMenu extends JPopupMenu {
    562562            public final JMenu buttonHidingMenu = new JMenu(tr("Side buttons"));
     
    589589            }
    590590        }
    591        
     591
    592592        public void registerMouseListener() {
    593593            addMouseListener(new MouseEventHandler());
    594594        }
    595        
     595
    596596        class MouseEventHandler extends PopupMenuLauncher {
    597597            public MouseEventHandler() {
     
    864864            buttonsHide.setVisible(false);
    865865        }
    866        
     866
    867867        // Register title bar mouse listener only after buttonActions has been initialized to have a complete popup menu
    868868        titleBar.registerMouseListener();
    869        
     869
    870870        return data;
    871871    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r6009 r6070  
    7777    private final JPopupMenu popupMenu = new JPopupMenu();
    7878    private final PopupMenuHandler popupMenuHandler = new PopupMenuHandler(popupMenu);
    79    
     79
    8080    /** Last selected element */
    8181    private DefaultMutableTreeNode lastSelectedNode = null;
     
    417417        tree.addTreeSelectionListener(listener);
    418418    }
    419    
     419
    420420    /**
    421421     * Remove the given tree selection listener from the validator tree.
     
    426426        tree.removeTreeSelectionListener(listener);
    427427    }
    428    
     428
    429429    /**
    430430     * Replies the popup menu handler.
     
    435435        return popupMenuHandler;
    436436    }
    437    
     437
    438438    /**
    439439     * Replies the currently selected error, or {@code null}.
     
    451451        return null;
    452452    }
    453    
     453
    454454    /**
    455455     * Watches for double clicks and launches the popup menu.
    456456     */
    457457    class MouseEventHandler extends PopupMenuLauncher {
    458        
     458
    459459        public MouseEventHandler() {
    460460            super(popupMenu);
    461461        }
    462        
     462
    463463        @Override
    464464        public void mouseClicked(MouseEvent e) {
     
    483483            }
    484484        }
    485        
     485
    486486        @Override public void launch(MouseEvent e) {
    487487            TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
     
    585585            // do nothing
    586586        }
    587        
     587
    588588        protected void fixError(TestError error) throws InterruptedException, InvocationTargetException {
    589589            if (error.isFixable()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java

    r5998 r6070  
    557557
    558558    class MouseEventHandler extends PopupMenuLauncher {
    559        
     559
    560560        public MouseEventHandler() {
    561561            super(new ChangesetTablePopupMenu());
    562562        }
    563        
     563
    564564        @Override
    565565        public void mouseClicked(MouseEvent evt) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/SingleChangesetDownloadPanel.java

    r5765 r6070  
    5151        tfChangesetId.getDocument().addDocumentListener(actDownload);
    5252        add(btn);
    53        
    54         if (Main.pref.getBoolean("downloadchangeset.autopaste", true)) { 
     53
     54        if (Main.pref.getBoolean("downloadchangeset.autopaste", true)) {
    5555            tfChangesetId.tryToPasteFromClipboard();
    5656        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryDialog.java

    r5998 r6070  
    191191                    }
    192192                    break;
    193    
     193
    194194                case 2:
    195195                    if (getChangesetQuery() == null) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r6068 r6070  
    152152     */
    153153    private final TagEditHelper editHelper = new TagEditHelper(propertyData, valueCount);
    154    
     154
    155155    private final DataSetListenerAdapter dataChangedAdapter = new DataSetListenerAdapter(this);
    156156    private final HelpAction helpAction = new HelpAction();
     
    170170    private final SelectRelationAction selectRelationAction = new SelectRelationAction(false);
    171171    private final SelectRelationAction addRelationToSelectionAction = new SelectRelationAction(true);
    172    
     172
    173173    private final DownloadMembersAction downloadMembersAction = new DownloadMembersAction();
    174174    private final DownloadSelectedIncompleteMembersAction downloadSelectedIncompleteMembersAction = new DownloadSelectedIncompleteMembersAction();
    175    
     175
    176176    private final SelectMembersAction selectMembersAction = new SelectMembersAction(false);
    177177    private final SelectMembersAction addMembersToSelectionAction = new SelectMembersAction(true);
    178    
     178
    179179    private final HighlightHelper highlightHelper= new HighlightHelper();
    180    
     180
    181181    /**
    182182     * The Add button (needed to be able to disable it)
     
    195195     */
    196196    private final PresetListPanel presets = new PresetListPanel();
    197    
     197
    198198    /**
    199199     * Text to display when nothing selected.
     
    214214        }
    215215    };
    216    
     216
    217217    // <editor-fold defaultstate="collapsed" desc="Dialog construction and helper methods">
    218    
     218
    219219    /**
    220220     * Create a new PropertiesDialog
     
    231231        setupMembershipMenu();
    232232        buildMembershipTable();
    233        
     233
    234234        // combine both tables and wrap them in a scrollPane
    235235        JPanel bothTables = new JPanel();
     
    249249            bothTables.add(presets, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 2, 5, 2));
    250250        }
    251        
     251
    252252        setupKeyboardShortcuts();
    253253
     
    257257        propertyTable.getSelectionModel().addListSelectionListener(deleteAction);
    258258        membershipTable.getSelectionModel().addListSelectionListener(deleteAction);
    259        
    260        
     259
     260
    261261        JScrollPane scrollPane = (JScrollPane) createLayout(bothTables, true, Arrays.asList(new SideButton[] {
    262262                this.btnAdd, this.btnEdit, this.btnDel
     
    273273        editHelper.loadTagsIfNeeded();
    274274    }
    275        
     275
    276276    private void buildPropertiesTable() {
    277277        // setting up the properties table
     
    280280        propertyTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    281281        propertyTable.getTableHeader().setReorderingAllowed(false);
    282        
     282
    283283        propertyTable.getColumnModel().getColumn(1).setCellRenderer(new DefaultTableCellRenderer(){
    284284            @Override public Component getTableCellRendererComponent(JTable table, Object value,
     
    383383        mod.getColumn(0).setPreferredWidth(200);
    384384    }
    385    
     385
    386386    /**
    387387     * creates the popup menu @field membershipMenu and its launcher on membership table
     
    432432        });
    433433    }
    434    
    435     /**
    436      * creates the popup menu @field propertyMenu and its launcher on property table 
     434
     435    /**
     436     * creates the popup menu @field propertyMenu and its launcher on property table
    437437     */
    438438    private void setupPropertiesMenu() {
     
    448448        propertyTable.addMouseListener(new PopupMenuLauncher(propertyMenu));
    449449    }
    450    
     450
    451451    /**
    452452     * Assignas all needed keys like Enter and Spacebar to most important actions
    453453     */
    454454    private void setupKeyboardShortcuts() {
    455        
     455
    456456        // ENTER = editAction, open "edit" dialog
    457457        propertyTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
     
    461461                .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),"onTableEnter");
    462462        membershipTable.getActionMap().put("onTableEnter",editAction);
    463        
    464         // INSERT button = addAction, open "add property" dialog 
     463
     464        // INSERT button = addAction, open "add property" dialog
    465465        propertyTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
    466466                .put(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0),"onTableInsert");
    467467        propertyTable.getActionMap().put("onTableInsert",addAction);
    468        
     468
    469469        // unassign some standard shortcuts for JTable to allow upload / download
    470470        InputMapUtils.unassignCtrlShiftUpDown(propertyTable, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    471        
     471
    472472        // unassign some standard shortcuts for correct copy-pasting, fix #8508
    473473        propertyTable.setTransferHandler(null);
    474  
     474
    475475        propertyTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
    476476                .put(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),"onCopy");
     
    479479        // allow using enter to add tags for all look&feel configurations
    480480        InputMapUtils.enableEnter(this.btnAdd);
    481        
     481
    482482        // DEL button = deleteAction
    483483        getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
     
    485485                );
    486486        getActionMap().put("delete", deleteAction);
    487        
     487
    488488        // F1 button = custom help action
    489489        getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
     
    491491        getActionMap().put("onHelp", helpAction);
    492492    }
    493    
     493
    494494         /**
    495495     * This simply fires up an {@link RelationEditor} for the relation shown; everything else
     
    506506                ((MemberInfo) membershipData.getValueAt(row, 1)).role).setVisible(true);
    507507    }
    508    
     508
    509509    private int findRow(TableModel model, Object value) {
    510510        for (int i=0; i<model.getRowCount(); i++) {
     
    514514        return -1;
    515515    }
    516    
     516
    517517    /**
    518518     * Update selection status, call @{link #selectionChanged} function.
     
    525525        }
    526526    }
    527    
     527
    528528   // </editor-fold>
    529529
    530530    // <editor-fold defaultstate="collapsed" desc="Event listeners methods">
    531    
     531
    532532    @Override
    533533    public void showNotify() {
     
    558558        }
    559559    }
    560    
     560
    561561    @Override
    562562    public void destroy() {
     
    625625                    ? e.getValue().keySet().iterator().next() : tr("<different>"));
    626626        }
    627        
     627
    628628        membershipData.setRowCount(0);
    629629
     
    698698        }
    699699    }
    700    
     700
    701701    /* ---------------------------------------------------------------------------------- */
    702702    /* EditLayerChangeListener                                                            */
     
    721721
    722722    // <editor-fold defaultstate="collapsed" desc="Methods that are called by plugins to extend fuctionality ">
    723    
     723
    724724    /**
    725725     * Replies the property popup menu handler.
     
    752752        return row > -1 ? (IRelation) membershipData.getValueAt(row, 0) : null;
    753753    }
    754        
     754
    755755    // </editor-fold>
    756    
     756
    757757     /**
    758758     * Class that watches for mouse clicks
     
    852852        }
    853853    };
    854    
     854
    855855    /**
    856856     * Action handling delete button press in properties dialog.
     
    940940            } else if (membershipTable.getSelectedRowCount() > 0) {
    941941                int[] rows = membershipTable.getSelectedRows();
    942                 // delete from last relation to convserve row numbers in the table 
     942                // delete from last relation to convserve row numbers in the table
    943943                for (int i=rows.length-1; i>=0; i--) {
    944944                    deleteFromRelation(rows[i]);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java

    r5925 r6070  
    415415                    refreshView(r);
    416416                }
    417                 SwingUtilities.invokeLater(new Runnable() { 
    418                     public void run() { 
    419                         Main.map.repaint(); 
    420                     } 
    421                 }); 
     417                SwingUtilities.invokeLater(new Runnable() {
     418                    public void run() {
     419                        Main.map.repaint();
     420                    }
     421                });
    422422            } catch (Exception e) {
    423423                if (canceled) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r6068 r6070  
    216216                }
    217217        );
    218        
     218
    219219        tagEditorPanel.setNextFocusComponent(memberTable);
    220220        selectionTable.setFocusable(false);
     
    492492        tb.add(moveDownAction);
    493493        memberTable.getActionMap().put("moveDown", moveDownAction);
    494        
     494
    495495        tb.addSeparator();
    496496
     
    499499        memberTableModel.getSelectionModel().addListSelectionListener(editAction);
    500500        tb.add(editAction);
    501        
     501
    502502        // -- delete action
    503503        RemoveAction removeSelectedAction = new RemoveAction();
     
    505505        tb.add(removeSelectedAction);
    506506        memberTable.getActionMap().put("removeSelected", removeSelectedAction);
    507        
     507
    508508        tb.addSeparator();
    509509        // -- sort action
     
    536536        inputMap.put((KeyStroke) moveDownAction.getValue(AbstractAction.ACCELERATOR_KEY),"moveDown");
    537537        inputMap.put((KeyStroke) downloadIncompleteMembersAction.getValue(AbstractAction.ACCELERATOR_KEY),"downloadIncomplete");
    538        
     538
    539539        return tb;
    540540    }
     
    677677    }
    678678
    679    
     679
    680680    private void registerCopyPasteAction(AbstractAction action, Object actionName, KeyStroke shortcut) {
    681681        int mods = shortcut.getModifiers();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberRoleCellEditor.java

    r4238 r6070  
    2626        this.ds = ds;
    2727        editor = new AutoCompletingTextField();
    28         editor.setBorder(BorderFactory.createEmptyBorder(1,1,1,1)); 
     28        editor.setBorder(BorderFactory.createEmptyBorder(1,1,1,1));
    2929        autoCompletionList = new AutoCompletionList();
    3030        editor.setAutoCompletionList(autoCompletionList);
     
    5757        return super.stopCellEditing();
    5858    }
    59    
     59
    6060    /** Returns the edit field for this cell editor. */
    6161    public AutoCompletingTextField getEditor() {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java

    r6064 r6070  
    6363     */
    6464    protected void init() {
    65         MemberRoleCellEditor ce = (MemberRoleCellEditor)getColumnModel().getColumn(0).getCellEditor(); 
     65        MemberRoleCellEditor ce = (MemberRoleCellEditor)getColumnModel().getColumn(0).getCellEditor();
    6666        setRowHeight(ce.getEditor().getPreferredSize().height);
    6767        setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
     
    7575
    7676        initHighlighting();
    77        
     77
    7878        // install custom navigation actions
    7979        //
     
    8181        getActionMap().put("selectPreviousColumnCell", new SelectPreviousColumnCellAction());
    8282    }
    83    
     83
    8484    @Override
    8585    protected ZoomToAction buildZoomToAction() {
    8686        return new ZoomToAction(this);
    8787    }
    88    
     88
    8989    @Override
    9090    protected JPopupMenu buildPopupMenu() {
     
    9999        return menu;
    100100    }
    101    
     101
    102102    @Override
    103103    public Dimension getPreferredSize(){
     
    140140                }
    141141            }};
    142    
     142
    143143    private void initHighlighting() {
    144144        highlightEnabled = Main.pref.getBoolean("draw.target-highlight", true);
     
    217217        MapView.removeLayerChangeListener(zoomToGap);
    218218    }
    219    
     219
    220220    public void stopHighlighting() {
    221221        if (highlighterListener == null) return;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r5911 r6070  
    380380        return updateCount;
    381381    }
    382    
     382
    383383    private void clearErrors() {
    384384        if (errors != null) {
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java

    r5998 r6070  
    144144
    145145        pnl.add(sizeCheck,  GBC.eol().anchor(GBC.EAST).insets(5,5,5,2));
    146        
     146
    147147        if (!ExpertToggleAction.isExpert()) {
    148148            JLabel infoLabel  = new JLabel(tr("Use left click&drag to select area, arrows or right mouse button to scroll map, wheel or +/- to zoom."));
     
    165165        pnl.add(btnDownload = new SideButton(actDownload = new DownloadAction()));
    166166        InputMapUtils.enableEnter(btnDownload);
    167        
     167
    168168        makeCheckBoxRespondToEnter(cbDownloadGpxData);
    169169        makeCheckBoxRespondToEnter(cbDownloadOsmData);
     
    308308        cbDownloadGpxData.setSelected(Main.pref.getBoolean("download.gps", false));
    309309        cbNewLayer.setSelected(Main.pref.getBoolean("download.newlayer", false));
    310         cbStartup.setSelected( isAutorunEnabled() ); 
     310        cbStartup.setSelected( isAutorunEnabled() );
    311311        int idx = Main.pref.getInteger("download.tab", 0);
    312312        if (idx < 0 || idx > tpDownloadAreaSelectors.getTabCount()) {
  • trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java

    r5898 r6070  
    6363                w = iScreenSize.width * 90 / 100;
    6464                h = iScreenSize.height * 90 / 100;
    65                 iDownloadDialogDimension = iGui.getSize(); 
     65                iDownloadDialogDimension = iGui.getSize();
    6666            }
    6767            // shrink
     
    7373            }
    7474
    75             // resize and center the DownloadDialog 
    76             iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h); 
     75            // resize and center the DownloadDialog
     76            iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);
    7777            repaint();
    7878        }
  • trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java

    r5356 r6070  
    259259            LatLon coord = node.getCoords();
    260260            LatLon oppositeCoord = oppositeNode.getCoords();
    261            
     261
    262262            // display the coordinates
    263263            //
     
    267267            // update background color to reflect differences in the coordinates
    268268            //
    269             if (coord == oppositeCoord || 
     269            if (coord == oppositeCoord ||
    270270                    (coord != null && oppositeCoord != null && coord.lat() == oppositeCoord.lat())) {
    271271                lblLat.setBackground(Color.WHITE);
     
    273273                lblLat.setBackground(BGCOLOR_DIFFERENCE);
    274274            }
    275             if (coord == oppositeCoord || 
     275            if (coord == oppositeCoord ||
    276276                    (coord != null && oppositeCoord != null && coord.lon() == oppositeCoord.lon())) {
    277277                lblLon.setBackground(Color.WHITE);
     
    285285        }
    286286    }
    287    
     287
    288288    private static class DistanceViewer extends LatLonViewer {
    289289
    290290        private JLabel lblDistance;
    291        
     291
    292292        public DistanceViewer(HistoryBrowserModel model) {
    293293            super(model, PointInTimeType.REFERENCE_POINT_IN_TIME);
     
    329329            LatLon coord = node.getCoords();
    330330            LatLon oppositeCoord = oppositeNode.getCoords();
    331            
     331
    332332            // update distance
    333333            //
  • trunk/src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java

    r5302 r6070  
    2828 * handles everything on its own, in other words it renders itself and also functions
    2929 * as editor so the checkboxes may be set by the user.
    30  * 
     30 *
    3131 * Intended usage is like this:
    3232 * ActionFlagsTableCell aftc = new ActionFlagsTableCell();
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java

    r5266 r6070  
    1515     * Sets the current changeset comment and notifies observers if the comment
    1616     * has changed.
    17      * 
     17     *
    1818     * @param comment the new upload comment. Empty string assumed if null.
    1919     */
     
    2929    /**
    3030     * Replies the current changeset comment in this model.
    31      * 
     31     *
    3232     * @return the current changeset comment in this model.
    3333     */
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java

    r5874 r6070  
    4949        this.mkdir = mkdir;
    5050        this.unpack = unpack;
    51     }   
    52    
     51    }
     52
    5353    private static class DownloadException extends Exception {
    5454        public DownloadException(String msg) {
     
    6868
    6969
    70     @Override 
     70    @Override
    7171    protected void cancel() {
    7272        this.canceled = true;
     
    7474    }
    7575
    76     @Override 
     76    @Override
    7777    protected void finish() {}
    7878
     
    9191                }
    9292            }
    93            
     93
    9494            URL url = new URL(address);
    9595            int size;
     
    100100                size = downloadConnection.getContentLength();
    101101            }
    102            
     102
    103103            progressMonitor.setTicksCount(100);
    104104            progressMonitor.subTask(tr("Downloading File {0}: {1} bytes...", file.getName(),size));
    105            
     105
    106106            in = downloadConnection.getInputStream();
    107107            out = new FileOutputStream(file);
     
    112112                out.write(buffer, 0, read);
    113113                count+=read;
    114                 if (canceled) break;                           
     114                if (canceled) break;
    115115                p2 = 100 * count / size;
    116116                if (p2!=p1) {
     
    142142    }
    143143
    144     @Override 
     144    @Override
    145145    protected void realRun() throws SAXException, IOException {
    146146        if (canceled) return;
     
    160160        return canceled;
    161161    }
    162    
     162
    163163    /**
    164164     * Recursive unzipping function
     
    166166     * @param file
    167167     * @param dir
    168      * @throws IOException 
     168     * @throws IOException
    169169     */
    170170    public static void unzipFileRecursively(File file, String dir) throws IOException {
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesTask.java

    r5791 r6070  
    9595            if (osm == null) {
    9696                switch (id.getType()) {
    97                     case NODE: 
     97                    case NODE:
    9898                        osm = new Node(id.getUniqueId());
    9999                        break;
     
    128128            DataSetMerger merger = new DataSetMerger(ds, theirDataSet);
    129129            merger.merge();
    130            
     130
    131131            // if incomplete relation members exist, download them too
    132132            for (Relation r : ds.getRelations()) {
     
    165165                }
    166166            }
    167            
     167
    168168        } catch(Exception e) {
    169169            if (canceled) return;
     
    171171        }
    172172    }
    173    
     173
    174174    /**
    175175     * replies the set of ids of all primitives for which a fetch request to the
  • trunk/src/org/openstreetmap/josm/gui/io/RecentlyOpenedFilesMenu.java

    r5729 r6070  
    4949        });
    5050    }
    51    
     51
    5252    private void rebuild() {
    5353        removeAll();
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r5998 r6070  
    5656 * This is a dialog for entering upload options like the parameters for
    5757 * the upload changeset and the strategy for opening/closing a changeset.
    58  * 
     58 *
    5959 */
    6060public class UploadDialog extends JDialog implements PropertyChangeListener, PreferenceChangedListener{
     
    111111        //
    112112        pnl.add(pnlUploadedObjects = new UploadedObjectsSummaryPanel(), GBC.eol().fill(GBC.BOTH));
    113        
     113
    114114        // Custom components
    115115        for (Component c : customComponents) {
     
    309309    public void setDefaultChangesetTags(Map<String, String> tags) {
    310310        pnlTagSettings.setDefaultTags(tags);
    311          for (String key: tags.keySet()) { 
    312             if (key.equals("comment")) { 
     311         for (String key: tags.keySet()) {
     312            if (key.equals("comment")) {
    313313                changesetCommentModel.setComment(tags.get(key));
    314             } 
    315         } 
     314            }
     315        }
    316316    }
    317317
     
    370370        super.setVisible(visible);
    371371    }
    372    
    373     /**
    374      * Adds a custom component to this dialog. 
     372
     373    /**
     374     * Adds a custom component to this dialog.
    375375     * Custom components added at JOSM startup are displayed between the objects list and the properties tab pane.
    376376     * @param c The custom component to add. If {@code null}, this method does nothing.
  • trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java

    r5998 r6070  
    264264            putValue(Action.NAME, tr("Cancel"));
    265265            putValue(Action.SMALL_ICON, ImageProvider.get("", "cancel"));
    266             getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) 
    267             .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); 
     266            getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
     267            .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE");
    268268            getRootPane().getActionMap().put("ESCAPE", this);
    269269            setEnabled(true);
  • trunk/src/org/openstreetmap/josm/gui/layer/CustomizeColor.java

    r4270 r6070  
    3434        this();
    3535        layers = new LinkedList<Layer>();
    36         layers.add(l); 
     36        layers.add(l);
    3737    }
    3838
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r5959 r6070  
    113113        return new Date[]{earliest.getTime(), latest.getTime()};
    114114    }
    115    
     115
    116116    /**
    117117    * Returns minimum and maximum timestamps for all tracks
     
    138138        return new Date[]{new Date((long) (min * 1000)), new Date((long) (max * 1000)), };
    139139    }
    140    
    141    
     140
     141
    142142    /**
    143143     * returns a human readable string that shows the timespan of the given track
     
    288288                new LayerListPopup.InfoAction(this) };
    289289    }
    290    
     290
    291291    public boolean isLocalFile() {
    292292        return isLocalFile;
     
    335335            return true;
    336336    }
    337    
     337
    338338    public void filterTracksByDate(Date fromDate, Date toDate, boolean showWithoutDate) {
    339339        int i = 0;
     
    342342        for (GpxTrack trk : data.tracks) {
    343343            Date[] t = GpxLayer.getMinMaxTimeForTrack(trk);
    344            
     344
    345345            if (t==null) continue;
    346346            long tm = t[1].getTime();
     
    543543                }
    544544            }
    545            
     545
    546546            for (GpxTrack trk : data.tracks) {
    547547                for (GpxTrackSegment segment : trk.getSegments()) {
     
    880880        return SaveActionBase.createAndOpenSaveFileChooser(tr("Save GPX file"), GpxImporter.FILE_FILTER);
    881881    }
    882    
     882
    883883}
  • trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java

    r5963 r6070  
    130130            String url = info.getUrl();
    131131            if (url != null) {
    132                 panel.add(new JLabel(tr("URL: ")), GBC.std().insets(0, 5, 2, 0)); 
     132                panel.add(new JLabel(tr("URL: ")), GBC.std().insets(0, 5, 2, 0));
    133133                panel.add(new UrlLabel(url), GBC.eol().insets(2, 5, 10, 0));
    134134            }
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r5459 r6070  
    436436        // To be overriden if needed
    437437    }
    438    
     438
    439439    /**
    440440     * Replies the savable state of this layer (i.e if it can be saved through a "File->Save" dialog).
     
    445445        return false;
    446446    }
    447    
     447
    448448    /**
    449449     * Checks whether it is ok to launch a save (whether we have data, there is no conflict etc.)
     
    454454        return true;
    455455    }
    456    
     456
    457457    /**
    458458     * Creates a new "Save" dialog for this layer and makes it visible.<br/>
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r6039 r6070  
    163163        void commandChanged(int queueSize, int redoSize);
    164164    }
    165    
     165
    166166    /**
    167167     * Listener called when a state of this layer has changed.
     
    175175        void uploadDiscouragedChanged(OsmDataLayer layer, boolean newValue);
    176176    }
    177    
     177
    178178    private final CopyOnWriteArrayList<LayerStateChangeListener> layerStateChangeListeners = new CopyOnWriteArrayList<LayerStateChangeListener>();
    179    
     179
    180180    /**
    181181     * Adds a layer state change listener
     
    189189        }
    190190    }
    191    
     191
    192192    /**
    193193     * Removes a layer property change listener
     
    259259        return ImageProvider.get("layer", "osmdata_small");
    260260    }
    261    
     261
    262262    /**
    263263     * TODO: @return Return a dynamic drawn icon of the map data. The icon is
     
    355355        mergeFrom(from, null);
    356356    }
    357    
     357
    358358    /**
    359359     * merges the primitives in dataset <code>from</code> into the dataset of
     
    415415
    416416    @Override public boolean isMergable(final Layer other) {
    417         // isUploadDiscouraged commented to allow merging between normal layers and discouraged layers with a warning (see #7684) 
     417        // isUploadDiscouraged commented to allow merging between normal layers and discouraged layers with a warning (see #7684)
    418418        return other instanceof OsmDataLayer;// && (isUploadDiscouraged() == ((OsmDataLayer)other).isUploadDiscouraged());
    419419    }
     
    781781        return true;
    782782    }
    783    
     783
    784784    /**
    785785     * Check the data set if it would be empty on save. It is empty, if it contains
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r6042 r6070  
    128128    protected TileSource tileSource;
    129129    protected OsmTileLoader tileLoader;
    130    
     130
    131131    public static TileLoaderFactory loaderFactory = new TileLoaderFactory() {
    132132        @Override
     
    144144        }
    145145    };
    146    
     146
    147147    /**
    148148    * Plugins that wish to set custom tile loader should call this method
     
    151151        TMSLayer.loaderFactory = loaderFactory;
    152152    }
    153    
     153
    154154    HashSet<Tile> tileRequestsOutstanding = new HashSet<Tile>();
    155155    @Override
     
    170170        }*/
    171171    }
    172    
     172
    173173    @Override
    174174    public TileCache getTileCache() {
    175175        return tileCache;
    176176    }
    177    
     177
    178178    private class TmsTileClearController implements TileClearController, CancelListener {
    179179
    180180        private final ProgressMonitor monitor;
    181181        private boolean cancel = false;
    182        
     182
    183183        public TmsTileClearController(ProgressMonitor monitor) {
    184184            this.monitor = monitor;
     
    219219    /**
    220220     * Clears the tile cache.
    221      * 
    222      * If the current tileLoader is an instance of OsmTileLoader, a new 
    223      * TmsTileClearController is created and passed to the according clearCache 
     221     *
     222     * If the current tileLoader is an instance of OsmTileLoader, a new
     223     * TmsTileClearController is created and passed to the according clearCache
    224224     * method.
    225      * 
    226      * @param monitor 
     225     *
     226     * @param monitor
    227227     * @see MemoryTileCache#clear()
    228      * @see OsmFileCacheTileLoader#clearCache(org.openstreetmap.gui.jmapviewer.interfaces.TileSource, org.openstreetmap.gui.jmapviewer.OsmFileCacheTileLoader.TileClearController) 
     228     * @see OsmFileCacheTileLoader#clearCache(org.openstreetmap.gui.jmapviewer.interfaces.TileSource, org.openstreetmap.gui.jmapviewer.OsmFileCacheTileLoader.TileClearController)
    229229     */
    230230    void clearTileCache(ProgressMonitor monitor) {
     
    257257    /**
    258258     * Initiates a repaint of Main.map
    259      * 
     259     *
    260260     * @see Main#map
    261      * @see MapFrame#repaint() 
     261     * @see MapFrame#repaint()
    262262     */
    263263    void redraw() {
     
    360360     * Creates and returns a new TileSource instance depending on the {@link ImageryType}
    361361     * of the passed ImageryInfo object.
    362      * 
     362     *
    363363     * If no appropriate TileSource is found, null is returned.
    364      * Currently supported ImageryType are {@link ImageryType#TMS}, 
     364     * Currently supported ImageryType are {@link ImageryType#TMS},
    365365     * {@link ImageryType#BING}, {@link ImageryType#SCANEX}.
    366      * 
     366     *
    367367     * @param info
    368368     * @return a new TileSource instance or null if no TileSource for the ImageryInfo/ImageryType could be found.
    369      * @throws IllegalArgumentException 
     369     * @throws IllegalArgumentException
    370370     */
    371371    public static TileSource getTileSource(ImageryInfo info) throws IllegalArgumentException {
     
    706706        return zia;
    707707    }
    708    
     708
    709709    public boolean increaseZoomLevel() {
    710710        if (zoomIncreaseAllowed()) {
     
    739739        return currentZoomLevel > this.getMinZoomLvl();
    740740    }
    741    
     741
    742742    /**
    743743     * Zoom out from map.
    744      * 
     744     *
    745745     * @return    true, if zoom increasing was successfull, false othervise
    746746     */
     
    774774        return new Tile(tileSource, x, y, zoom);
    775775    }
    776    
     776
    777777    synchronized Tile getOrCreateTile(int x, int y, int zoom) {
    778778        Tile tile = getTile(x, y, zoom);
     
    852852        return !done;
    853853    }
    854    
     854
    855855    boolean imageLoaded(Image i) {
    856856        if (i == null)
     
    861861        return false;
    862862    }
    863    
     863
    864864    /**
    865      * Returns the image for the given tile if both tile and image are loaded. 
     865     * Returns the image for the given tile if both tile and image are loaded.
    866866     * Otherwise returns  null.
    867      * 
     867     *
    868868     * @param tile the Tile for which the image should be returned
    869869     * @return  the image of the tile or null.
     
    953953        }
    954954    }
    955    
     955
    956956    // This function is called for several zoom levels, not just
    957957    // the current one.  It should not trigger any tiles to be
     
    10731073        return Main.map.mapView.getPoint(Main.getProjection().latlon2eastNorth(ll).add(getDx(), getDy()));
    10741074    }
    1075    
     1075
    10761076    private Point pixelPos(Tile t) {
    10771077        double lon = tileSource.tileXToLon(t.getXtile(), t.getZoom());
     
    10791079        return pixelPos(tmpLL);
    10801080    }
    1081    
     1081
    10821082    private LatLon getShiftedLatLon(EastNorth en) {
    10831083        return Main.getProjection().eastNorth2latlon(en.add(-getDx(), -getDy()));
    10841084    }
    1085    
     1085
    10861086    private Coordinate getShiftedCoord(EastNorth en) {
    10871087        LatLon ll = getShiftedLatLon(en);
     
    11381138            }
    11391139        }
    1140        
     1140
    11411141        boolean tooSmall() {
    11421142            return this.tilesSpanned() < 2.1;
    11431143        }
    1144        
     1144
    11451145        boolean tooLarge() {
    11461146            return this.tilesSpanned() > 10;
    11471147        }
    1148        
     1148
    11491149        boolean insane() {
    11501150            return this.tilesSpanned() > 100;
    11511151        }
    1152        
     1152
    11531153        double tilesSpanned() {
    11541154            return Math.sqrt(1.0 * this.size());
     
    11681168            return this.__allTiles(false);
    11691169        }
    1170        
     1170
    11711171        List<Tile> allTilesCreate() {
    11721172            return this.__allTiles(true);
    11731173        }
    1174        
     1174
    11751175        private List<Tile> __allTiles(boolean create) {
    11761176            // Tileset is either empty or too large
     
    11931193            return ret;
    11941194        }
    1195        
     1195
    11961196        private List<Tile> allLoadedTiles() {
    11971197            List<Tile> ret = new ArrayList<Tile>();
  • trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java

    r5907 r6070  
    6464        if (root == null || root.getChildCount() == 0)
    6565            return;
    66        
     66
    6767        PaintVisitor paintVisitor = new PaintVisitor(g, mv);
    6868
     
    8080            severity = severity.getPreviousSibling();
    8181        }
    82        
     82
    8383        paintVisitor.clearPaintedObjects();
    8484    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java

    r4698 r6070  
    3737    /** The image currently displayed */
    3838    private Image image = null;
    39    
     39
    4040    /** The image currently displayed */
    4141    private boolean errorLoading = false;
     
    9999                    ImageDisplay.this.image = img;
    100100                    visibleRect = new Rectangle(0, 0, img.getWidth(null), img.getHeight(null));
    101    
     101
    102102                    final int w = (int) visibleRect.getWidth();
    103103                    final int h = (int) visibleRect.getHeight();
    104    
     104
    105105                    outer: {
    106106                        final int hh, ww, q;
     
    131131                            break outer;
    132132                        }
    133    
     133
    134134                        final BufferedImage rot = new BufferedImage(ww, hh, BufferedImage.TYPE_INT_RGB);
    135135                        final AffineTransform xform = AffineTransform.getQuadrantRotateInstance(q, ax, ay);
     
    137137                        g.drawImage(image, xform, null);
    138138                        g.dispose();
    139    
     139
    140140                        visibleRect.setSize(ww, hh);
    141141                        image.flush();
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java

    r5927 r6070  
    4343public class ChooseTrackVisibilityAction extends AbstractAction {
    4444    private final GpxLayer layer;
    45  
     45
    4646    DateFilterPanel dateFilter;
    4747    JTable table;
    48    
     48
    4949    public ChooseTrackVisibilityAction(final GpxLayer layer) {
    5050        super(tr("Choose visible tracks"), ImageProvider.get("dialogs/filter"));
     
    124124        return t;
    125125    }
    126    
     126
    127127    boolean noUpdates=false;
    128    
     128
    129129    /** selects all rows (=tracks) in the table that are currently visible on the layer*/
    130130    private void selectVisibleTracksInTable() {
     
    154154        });
    155155    }
    156    
     156
    157157    private void updateVisibilityFromTable() {
    158158        ListSelectionModel s = (ListSelectionModel) table.getSelectionModel();
     
    163163        Main.map.repaint(100);
    164164    }
    165    
     165
    166166    @Override
    167167    public void actionPerformed(ActionEvent arg0) {
    168168        final JPanel msg = new JPanel(new GridBagLayout());
    169        
     169
    170170        dateFilter = new DateFilterPanel(layer, "gpx.traces", false);
    171171        dateFilter.setFilterAppliedListener(new ActionListener(){
     
    179179        });
    180180        dateFilter.loadFromPrefs();
    181        
     181
    182182        final JToggleButton b = new JToggleButton(new AbstractAction(tr("Select by date")) {
    183183            @Override public void actionPerformed(ActionEvent e) {
     
    193193        msg.add(b, GBC.std().insets(0,0,5,0));
    194194        msg.add(dateFilter, GBC.eol().insets(0,0,10,0).fill(GBC.HORIZONTAL));
    195        
     195
    196196        msg.add(new JLabel(tr("<html>Select all tracks that you want to be displayed. You can drag select a " + "range of tracks or use CTRL+Click to select specific ones. The map is updated live in the " + "background. Open the URLs by double clicking them.</html>")), GBC.eop().fill(GBC.HORIZONTAL));
    197197        // build table
     
    236236        Main.map.repaint();
    237237    }
    238    
     238
    239239}
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

    r5927 r6070  
    6868        Main.main.removeLayer(layer);
    6969    }
    70    
     70
    7171}
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/CustomizeDrawingAction.java

    r5927 r6070  
    101101        Main.map.repaint();
    102102    }
    103    
     103
    104104}
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java

    r6054 r6070  
    2525 */
    2626public class DownloadAlongPanel extends JPanel {
    27        
    28         // Preferences keys
    29         private final String prefOsm;
    30         private final String prefGps;
    31         private final String prefDist;
    32         private final String prefArea;
    33         private final String prefNear;
    34 
    35         // Data types to download
     27   
     28    // Preferences keys
     29    private final String prefOsm;
     30    private final String prefGps;
     31    private final String prefDist;
     32    private final String prefArea;
     33    private final String prefNear;
     34
     35    // Data types to download
    3636    private final JCheckBox cbDownloadOsmData;
    3737    private final JCheckBox cbDownloadGpxData;
    3838
    3939    // Legacy list of values
    40         private static final Integer dist[] = { 5000, 500, 50 };
    41         private static final Integer area[] = { 20, 10, 5, 1 };
    42        
    43         private final JList buffer;
    44         private final JList maxRect;
    45         private final JList downloadNear;
    46        
    47         /**
    48         * Constructs a new {@code DownloadPanel}.
    49         * @param prefOsm Preference key determining if OSM data should be downloaded
    50         * @param prefGps Preference key determining if GPS data should be downloaded
    51         * @param prefDist Preference key determining maximum distance
    52         * @param prefArea Preference key determining maximum area
    53         * @param prefNear Preference key determining "near" parameter. Can be {@code null}
    54         */
    55         public DownloadAlongPanel(String prefOsm, String prefGps, String prefDist, String prefArea, String prefNear) {
    56                 super(new GridBagLayout());
    57                
    58                 this.prefOsm = prefOsm;
    59                 this.prefGps = prefGps;
    60                 this.prefDist = prefDist;
    61                 this.prefArea = prefArea;
    62                 this.prefNear = prefNear;
    63 
    64                 cbDownloadOsmData = new JCheckBox(tr("OpenStreetMap data"), Main.pref.getBoolean(prefOsm, true));
     40    private static final Integer dist[] = { 5000, 500, 50 };
     41    private static final Integer area[] = { 20, 10, 5, 1 };
     42   
     43    private final JList buffer;
     44    private final JList maxRect;
     45    private final JList downloadNear;
     46   
     47    /**
     48    * Constructs a new {@code DownloadPanel}.
     49    * @param prefOsm Preference key determining if OSM data should be downloaded
     50    * @param prefGps Preference key determining if GPS data should be downloaded
     51    * @param prefDist Preference key determining maximum distance
     52    * @param prefArea Preference key determining maximum area
     53    * @param prefNear Preference key determining "near" parameter. Can be {@code null}
     54    */
     55    public DownloadAlongPanel(String prefOsm, String prefGps, String prefDist, String prefArea, String prefNear) {
     56        super(new GridBagLayout());
     57       
     58        this.prefOsm = prefOsm;
     59        this.prefGps = prefGps;
     60        this.prefDist = prefDist;
     61        this.prefArea = prefArea;
     62        this.prefNear = prefNear;
     63
     64        cbDownloadOsmData = new JCheckBox(tr("OpenStreetMap data"), Main.pref.getBoolean(prefOsm, true));
    6565        cbDownloadOsmData.setToolTipText(tr("Select to download OSM data."));
    6666        add(cbDownloadOsmData,  GBC.std().insets(1,5,1,5));
     
    6969        add(cbDownloadGpxData,  GBC.eol().insets(5,5,1,5));
    7070       
    71                 add(new JLabel(tr("Download everything within:")), GBC.eol());
    72                 String s[] = new String[dist.length];
    73                 for (int i = 0; i < dist.length; ++i) {
    74                         s[i] = tr("{0} meters", dist[i]);
    75                 }
    76                 buffer = new JList(s);
    77                
    78                 double distanceValue = Main.pref.getDouble(prefDist, dist[0]);
    79                 int distanceLegacyIndex = 0;
    80                 for (int i = 0; i < dist.length; i++) {
    81                         if (dist[i] == (int)distanceValue) {
    82                                 distanceLegacyIndex = i;
    83                                 break;
    84                         }
    85                 }
    86                
    87                 buffer.setSelectedIndex(distanceLegacyIndex);
    88                 add(buffer, GBC.eol());
    89 
    90                 add(new JLabel(tr("Maximum area per request:")), GBC.eol());
    91                 s = new String[area.length];
    92                 for (int i = 0; i < area.length; ++i) {
    93                         s[i] = tr("{0} sq km", area[i]);
    94                 }
    95                 maxRect = new JList(s);
    96 
    97                 double areaValue = Main.pref.getDouble(prefArea, area[0]);
    98                 int areaLegacyIndex = 0;
    99                 for (int i = 0; i < area.length; i++) {
    100                         if (area[i] == (int)areaValue) {
    101                                 areaLegacyIndex = i;
    102                                 break;
    103                         }
    104                 }
    105                
    106                 maxRect.setSelectedIndex(areaLegacyIndex);
    107                 add(maxRect, GBC.eol());
    108                
    109                 if (prefNear != null) {
     71        add(new JLabel(tr("Download everything within:")), GBC.eol());
     72        String s[] = new String[dist.length];
     73        for (int i = 0; i < dist.length; ++i) {
     74            s[i] = tr("{0} meters", dist[i]);
     75        }
     76        buffer = new JList(s);
     77       
     78        double distanceValue = Main.pref.getDouble(prefDist, dist[0]);
     79        int distanceLegacyIndex = 0;
     80        for (int i = 0; i < dist.length; i++) {
     81            if (dist[i] == (int)distanceValue) {
     82                distanceLegacyIndex = i;
     83                break;
     84            }
     85        }
     86       
     87        buffer.setSelectedIndex(distanceLegacyIndex);
     88        add(buffer, GBC.eol());
     89
     90        add(new JLabel(tr("Maximum area per request:")), GBC.eol());
     91        s = new String[area.length];
     92        for (int i = 0; i < area.length; ++i) {
     93            s[i] = tr("{0} sq km", area[i]);
     94        }
     95        maxRect = new JList(s);
     96
     97        double areaValue = Main.pref.getDouble(prefArea, area[0]);
     98        int areaLegacyIndex = 0;
     99        for (int i = 0; i < area.length; i++) {
     100            if (area[i] == (int)areaValue) {
     101                areaLegacyIndex = i;
     102                break;
     103            }
     104        }
     105       
     106        maxRect.setSelectedIndex(areaLegacyIndex);
     107        add(maxRect, GBC.eol());
     108       
     109        if (prefNear != null) {
    110110            add(new JLabel(tr("Download near:")), GBC.eol());
    111111            downloadNear = new JList(new String[]{tr("track only"), tr("waypoints only"), tr("track and waypoints")});
    112112            downloadNear.setSelectedIndex(Main.pref.getInteger(prefNear, 0));
    113113            add(downloadNear, GBC.eol());
    114                 } else {
    115                     downloadNear = null;
    116                 }
    117         }
    118        
    119         /**
    120         * Gets the maximum distance in meters
    121         * @return The maximum distance, in meters
    122         */
    123         public final double getDistance() {
    124                 return dist[buffer.getSelectedIndex()];
    125         }
    126 
    127         /**
    128         * Gets the maximum area in squared kilometers
    129         * @return The maximum distance, in squared kilometers
    130         */
    131         public final double getArea() {
    132                 return area[maxRect.getSelectedIndex()];
    133         }
    134        
    135         /**
    136         * Gets the "download near" choosen value
    137         * @return the "download near" choosen value (0: track only, 1: waypoints only, 2: both)
    138         */
    139         public final int getNear() {
    140             return downloadNear.getSelectedIndex();
    141         }
    142        
     114        } else {
     115            downloadNear = null;
     116        }
     117    }
     118   
     119    /**
     120    * Gets the maximum distance in meters
     121    * @return The maximum distance, in meters
     122    */
     123    public final double getDistance() {
     124        return dist[buffer.getSelectedIndex()];
     125    }
     126
     127    /**
     128    * Gets the maximum area in squared kilometers
     129    * @return The maximum distance, in squared kilometers
     130    */
     131    public final double getArea() {
     132        return area[maxRect.getSelectedIndex()];
     133    }
     134   
     135    /**
     136    * Gets the "download near" choosen value
     137    * @return the "download near" choosen value (0: track only, 1: waypoints only, 2: both)
     138    */
     139    public final int getNear() {
     140        return downloadNear.getSelectedIndex();
     141    }
     142   
    143143    /**
    144144     * Replies true if the user selected to download OSM data
     
    158158        return cbDownloadGpxData.isSelected();
    159159    }
    160        
     160   
    161161    /**
    162162     * Remembers the current settings in the download panel
    163163     */
    164164    protected final void rememberSettings() {
    165                 Main.pref.put(prefOsm, isDownloadOsmData());
    166                 Main.pref.put(prefGps, isDownloadGpxData());
    167                 Main.pref.putDouble(prefDist, getDistance());
    168                 Main.pref.putDouble(prefArea, getArea());
    169                 if (prefNear != null) {
    170                     Main.pref.putInteger(prefNear, getNear());
    171                 }
     165        Main.pref.put(prefOsm, isDownloadOsmData());
     166        Main.pref.put(prefGps, isDownloadGpxData());
     167        Main.pref.putDouble(prefDist, getDistance());
     168        Main.pref.putDouble(prefArea, getArea());
     169        if (prefNear != null) {
     170            Main.pref.putInteger(prefNear, getNear());
     171        }
    172172    }
    173173   
     
    177177     */
    178178    protected final void addChangeListener(ChangeListener listener) {
    179         cbDownloadGpxData.addChangeListener(listener);
    180         cbDownloadOsmData.addChangeListener(listener);
     179        cbDownloadGpxData.addChangeListener(listener);
     180        cbDownloadOsmData.addChangeListener(listener);
    181181    }
    182182
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java

    r6054 r6070  
    2525 */
    2626public class DownloadAlongTrackAction extends DownloadAlongAction {
    27    
     27
    2828    static final int NEAR_TRACK = 0;
    2929    static final int NEAR_WAYPOINTS = 1;
     
    3636    private static final String PREF_DOWNLOAD_ALONG_TRACK_AREA = "downloadAlongTrack.area";
    3737    private static final String PREF_DOWNLOAD_ALONG_TRACK_NEAR = "downloadAlongTrack.near";
    38    
     38
    3939    private final GpxData data;
    4040
     
    5050    @Override
    5151    public void actionPerformed(ActionEvent e) {
    52        
     52
    5353        final DownloadAlongPanel panel = new DownloadAlongPanel(
    5454                PREF_DOWNLOAD_ALONG_TRACK_OSM, PREF_DOWNLOAD_ALONG_TRACK_GPS,
     
    5858            return;
    5959        }
    60        
     60
    6161        final int near = panel.getNear();
    6262
     
    124124                    return;
    125125                }
    126                 confirmAndDownloadAreas(a, max_area, panel.isDownloadOsmData(), panel.isDownloadGpxData(), 
     126                confirmAndDownloadAreas(a, max_area, panel.isDownloadOsmData(), panel.isDownloadGpxData(),
    127127                        tr("Download from OSM along this track"), progressMonitor);
    128128            }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java

    r5927 r6070  
    3737
    3838    private final GpxData data;
    39    
     39
    4040    public DownloadWmsAlongTrackAction(final GpxData data) {
    4141        super(tr("Precache imagery tiles along this track"), ImageProvider.get("downloadalongtrack"));
     
    118118        JOptionPane.showMessageDialog(Main.parent, tr("There are no imagery layers."), tr("No imagery layers"), JOptionPane.WARNING_MESSAGE);
    119119    }
    120    
     120
    121121}
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java

    r5927 r6070  
    3939public class ImportAudioAction extends AbstractAction {
    4040    private final GpxLayer layer;
    41    
     41
    4242    private static class Markers {
    4343        public boolean timedMarkersOmitted = false;
     
    114114        }
    115115    }
    116    
     116
    117117    /**
    118118     * Makes a new marker layer derived from this GpxLayer containing at least one audio marker
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportImagesAction.java

    r5927 r6070  
    6262        }
    6363    }
    64    
     64
    6565}
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/MarkersFromNamedPointsAction.java

    r5927 r6070  
    4444        }
    4545    }
    46    
     46
    4747}
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java

    r5684 r6070  
    321321     *
    322322     * Override in subclasses to add all necessary attributes.
    323      * 
     323     *
    324324     * @return the corresponding WayPoint with all relevant attributes
    325325     */
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java

    r5926 r6070  
    1818 */
    1919public class Cascade implements Cloneable {
    20    
     20
    2121    public static final Cascade EMPTY_CASCADE = new Cascade();
    2222
     
    2828        return get(key, def, klass, false);
    2929    }
    30    
     30
    3131    /**
    3232     * Get value for the given key
     
    182182    @Override
    183183    public Cascade clone() {
    184         @SuppressWarnings("unchecked") 
     184        @SuppressWarnings("unchecked")
    185185        HashMap<String, Object> clonedProp = (HashMap) ((HashMap) this.prop).clone();
    186186        Cascade c = new Cascade();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Environment.java

    r5705 r6070  
    5151    /**
    5252     * Creates a clone of the environment {@code other}
    53      * 
     53     *
    5454     * @param other the other environment. Must not be null.
    5555     */
     
    112112    /**
    113113     * Replies the current context.
    114      * 
     114     *
    115115     * @return the current context
    116116     */
  • trunk/src/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategy.java

    r4007 r6070  
    1515 * strategies on how to compose the text label which can be rendered close to a node
    1616 * or within an area in an OSM map.</p>
    17  * 
     17 *
    1818 * <p>The three strategies below support three rules for composing a label:
    1919 * <ul>
    2020 *   <li>{@link StaticLabelCompositionStrategy} - the label is given by a static text
    2121 *   specified in the MapCSS style file</li>
    22  * 
     22 *
    2323 *   <li>{@link TagLookupCompositionStrategy} - the label is given by the content of a
    2424 *   tag whose name specified in the MapCSS style file</li>
    25  * 
     25 *
    2626 *   <li>{@link DeriveLabelFromNameTagsCompositionStrategy} - the label is given by the value
    2727 *   of one
     
    167167        /**
    168168         * <p>Creates the strategy and initializes its name tags from the preferences.</p>
    169          * 
     169         *
    170170         * <p><strong>Note:</strong> If the list of name tags in the preferences changes, strategy instances
    171171         * are not notified. It's up to the client to listen to preference changes and
    172172         * invoke {@link #initNameTagsFromPreferences()} accordingly.</p>
    173          * 
     173         *
    174174         */
    175175        public DeriveLabelFromNameTagsCompositionStrategy() {
     
    179179        /**
    180180         * Sets the name tags to be looked up in order to build up the label
    181          * 
     181         *
    182182         * @param nameTags the name tags. null values are ignore.
    183183         */
     
    201201        /**
    202202         * Replies an unmodifiable list of the name tags used to compose the label.
    203          * 
     203         *
    204204         * @return the list of name tags
    205205         */
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r5891 r6070  
    124124                .setOptional(true).get();
    125125    }
    126    
     126
    127127    public static ImageIcon getNodeIcon(Tag tag) {
    128128        return getNodeIcon(tag, true);
    129129    }
    130    
     130
    131131    public static ImageIcon getNodeIcon(Tag tag, boolean includeDeprecatedIcon) {
    132132        if (tag != null) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java

    r3865 r6070  
    2828
    2929    public final static StyleCache EMPTY_STYLECACHE = (new StyleCache()).intern();
    30    
     30
    3131    private StyleCache() {
    3232        bd = new ArrayList<Double>();
     
    189189            bd.add(i, lower);
    190190            data.add(i, sl);
    191            
     191
    192192            //  --|--|----|--------|--
    193193            //   i-1 i   i+1      i+2
     
    200200        }
    201201    }
    202    
     202
    203203    public void consistencyTest() {
    204204        if (bd.size() < 2) throw new AssertionError();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java

    r5342 r6070  
    3636    /**
    3737     * Creates a new text element
    38      * 
     38     *
    3939     * @param strategy the strategy indicating how the text is composed for a specific {@link OsmPrimitive} to be rendered.
    4040     * If null, no label is rendered.
     
    6060    /**
    6161     * Copy constructor
    62      * 
     62     *
    6363     * @param other the other element.
    6464     */
     
    7676     * Derives a suitable label composition strategy from the style properties in
    7777     * {@code c}.
    78      * 
     78     *
    7979     * @param c the style properties
    8080     * @return the label composition strategy
     
    109109     * Builds a text element from style properties in {@code c} and the
    110110     * default text color {@code defaultTextColor}
    111      * 
     111     *
    112112     * @param c the style properties
    113113     * @param defaultTextColor the default text color. Must not be null.
     
    161161    /**
    162162     * Replies the label to be rendered for the primitive {@code osm}.
    163      * 
     163     *
    164164     * @param osm the OSM object
    165165     * @return the label, or null, if {@code osm} is null or if no label can be
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r4069 r6070  
    136136    /**
    137137     * <p>Represents a key/value condition which is either applied to a primitive.</p>
    138      * 
     138     *
    139139     */
    140140    public static class KeyValueCondition extends Condition {
     
    146146        /**
    147147         * <p>Creates a key/value-condition.</p>
    148          * 
     148         *
    149149         * @param k the key
    150150         * @param v the value
     
    208208     *                  LINK:        the parent is a relation and it has at least one member with the role
    209209     *                               "a label" referring to the child
    210      * 
     210     *
    211211     *     [!"a label"]  PRIMITIVE:  the primitive doesn't have a tag "a label"
    212212     *                   LINK:       the parent is a relation but doesn't have a member with the role
     
    224224
    225225        /**
    226          * 
     226         *
    227227         * @param label
    228228         * @param exclamationMarkPresent
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java

    r5801 r6070  
    3838                if (key.equals(TEXT)) {
    3939                    /* Special case for declaration 'text: ...'
    40                      * 
     40                     *
    4141                     * - Treat the value 'auto' as keyword.
    4242                     * - Treat any other literal value 'litval' as as reference to tag with key 'litval'
    43                      * 
     43                     *
    4444                     * - Accept function expressions as is. This allows for
    4545                     *     tag(a_tag_name)                 value of a tag
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSException.java

    r4069 r6070  
    77    protected Integer line;
    88    protected Integer column;
    9    
     9
    1010    public MapCSSException(String specialmessage) {
    1111        this.specialmessage = specialmessage;
     
    1919        this.line = line;
    2020    }
    21    
     21
    2222    @Override
    2323    public String getMessage() {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java

    r4074 r6070  
    88
    99public class MapCSSRule {
    10    
     10
    1111    public List<Selector> selectors;
    1212    public List<Instruction> declaration;
     
    1919    /**
    2020     * <p>Executes the instructions against the environment {@code env}</p>
    21      * 
     21     *
    2222     * @param env the environment
    2323     */
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r4252 r6070  
    4747     * <p>Creates a new style source from the MapCSS styles supplied in
    4848     * {@code css}</p>
    49      * 
     49     *
    5050     * @param css the MapCSS style declaration. Must not be null.
    5151     * @throws IllegalArgumentException thrown if {@code css} is null
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r5841 r6070  
    3434    /**
    3535     * <p>Represents a child selector or a parent selector.</p>
    36      * 
     36     *
    3737     * <p>In addition to the standard CSS notation for child selectors, JOSM also supports
    3838     * an "inverse" notation:</p>
     
    4040     *    selector_a > selector_b { ... }       // the standard notation (child selector)
    4141     *    relation[type=route] > way { ... }    // example (all ways of a route)
    42      * 
     42     *
    4343     *    selector_a < selector_b { ... }       // the inverse notation (parent selector)
    4444     *    node[traffic_calming] < way { ... }   // example (way that has a traffic calming node)
     
    5555
    5656        /**
    57          * 
     57         *
    5858         * @param a the first selector
    5959         * @param b the second selector
     
    6969        /**
    7070         * <p>Finds the first referrer matching {@link #left}</p>
    71          * 
     71         *
    7272         * <p>The visitor works on an environment and it saves the matching
    7373         * referrer in {@code e.parent} and its relative position in the
    7474         * list referrers "child list" in {@code e.index}.</p>
    75          * 
     75         *
    7676         * <p>If after execution {@code e.parent} is null, no matching
    7777         * referrer was found.</p>
     
    196196        }
    197197    }
    198    
     198
    199199    /**
    200200     * Super class of {@link GeneralSelector} and {@link LinkSelector}
     
    204204
    205205        protected final List<Condition> conds;
    206        
     206
    207207        protected AbstractSelector(List<Condition> conditions) {
    208208            if (conditions == null || conditions.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/IconPrototype.java

    r3836 r6070  
    66
    77public class IconPrototype extends Prototype {
    8    
     8
    99    public IconReference icon;
    1010    public Boolean annotate;
  • trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java

    r5886 r6070  
    3434 * <li>Access token URL</li>
    3535 * <li>Authorize URL</li>
    36  * 
     36 *
    3737 * @see OAuthParameters
    3838 * @since 2746
  • trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java

    r5886 r6070  
    143143    public void setApiUrl(String apiUrl) {
    144144        super.setApiUrl(apiUrl);
    145         if (pnlMessage != null) { 
     145        if (pnlMessage != null) {
    146146            pnlMessage.setText(tr("<html><body>"
    147147                    + "Please enter an OAuth Access Token which is authorized to access the OSM server "
  • trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java

    r6066 r6070  
    4040
    4141/**
    42  * An OAuth 1.0 authorization client. 
     42 * An OAuth 1.0 authorization client.
    4343 * @since 2746
    4444 */
  • trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java

    r5886 r6070  
    3737 * In contrast to the fully-automatic procedure the user is dispatched to an
    3838 * external browser for login and authorisation.
    39  * 
     39 *
    4040 * @since 2746
    4141 */
  • trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java

    r5886 r6070  
    3434        }
    3535    }
    36    
     36
    3737    private AudioPreference() {
    3838        super("audio", tr("Audio Settings"), tr("Settings for the audio player and audio markers."));
     
    5757    public void addGui(PreferenceTabbedPane gui) {
    5858        JPanel audio = new JPanel(new GridBagLayout());
    59        
     59
    6060        // audioMenuVisible
    6161        audioMenuVisible.setSelected(! Main.pref.getBoolean("audio.menuinvisible"));
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java

    r5998 r6070  
    8686        this.setMaximumSize( Toolkit.getDefaultToolkit().getScreenSize());
    8787    }
    88    
     88
    8989    /**
    9090     * Replies the preferences tabbed pane.
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java

    r4989 r6070  
    33
    44/**
    5  * Base interface of Preferences settings, should not be directly implemented, 
     5 * Base interface of Preferences settings, should not be directly implemented,
    66 * see {@link TabPreferenceSetting} and {@link SubPreferenceSetting}.
    77 */
     
    1818     */
    1919    boolean ok();
    20    
     20
    2121    /**
    2222     * Called to know if the preferences tab has only to be displayed in expert mode.
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r5973 r6070  
    212212            }}, clazz);
    213213    }
    214    
     214
    215215    public boolean selectSubTabByPref(Class<? extends SubPreferenceSetting> clazz) {
    216216        for (PreferenceSetting setting : settings) {
     
    244244        return getSetting(ImageryPreference.class);
    245245    }
    246    
     246
    247247    public final ShortcutPreference getShortcutPreference() {
    248248        return getSetting(ShortcutPreference.class);
  • trunk/src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java

    r5899 r6070  
    2525        }
    2626    }
    27    
     27
    2828    private ServerAccessPreference() {
    2929        super("connection", tr("Connection Settings"), tr("Connection Settings for the OSM server."), false, new JTabbedPane());
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java

    r5220 r6070  
    99
    1010/**
    11  * A source entry primarily used to save the user's selection of mappaint styles, 
     11 * A source entry primarily used to save the user's selection of mappaint styles,
    1212 * but also for preset sources.
    1313 */
     
    6161            return false;
    6262        final SourceEntry other = (SourceEntry) obj;
    63         return equal(other.url, url) && 
     63        return equal(other.url, url) &&
    6464                equal(other.name, name) &&
    6565                equal(other.title, title) &&
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r6020 r6070  
    147147            return new ActionDefinition(null);
    148148        }
    149        
     149
    150150        public boolean hasParameters() {
    151151            if (!(getAction() instanceof ParameterizedAction)) return false;
    152152            for (Object o: parameters.values()) {
    153153                if (o!=null) return true;
    154             } 
     154            }
    155155            return false;
    156156        }
     
    412412                            }
    413413                });
    414            
     414
    415415        JMenuItem configure = new JMenuItem(new AbstractAction(tr("Configure toolbar")) {
    416416            @Override
     
    430430                    p.setVisible(true);
    431431                // refresh toolbar to try using changed shortcuts without restart
    432                     Main.toolbar.refreshToolbarControl(); 
     432                    Main.toolbar.refreshToolbarControl();
    433433                }
    434434            });
     
    485485
    486486        private final class Move implements ActionListener {
    487             @Override 
     487            @Override
    488488            public void actionPerformed(ActionEvent e) {
    489489                if (e.getActionCommand().equals("<") && actionsTree.getSelectionCount() > 0) {
     
    10321032                final JButton b = addButtonAndShortcut(action);
    10331033                buttonActions.put(b, action);
    1034                
     1034
    10351035                Icon i = action.getDisplayIcon();
    10361036                if (i != null) {
     
    10551055        control.setVisible(control.getComponentCount() != 0);
    10561056    }
    1057    
     1057
    10581058    private JButton addButtonAndShortcut(ActionDefinition action) {
    10591059        Action act = action.getParametrizedAction();
    10601060        JButton b = control.add(act);
    1061        
     1061
    10621062        Shortcut sc = null;
    10631063        if (action.getAction() instanceof JosmAction) {
     
    10721072            paramCode =  action.parameters.hashCode();
    10731073        }
    1074        
     1074
    10751075        String tt = action.getDisplayTooltip();
    10761076        if (tt==null) {
     
    10911091            Main.unregisterShortcut(sc);
    10921092            Main.registerActionShortcut(act, sc);
    1093            
     1093
    10941094            // add shortcut info to the tooltip if needed
    10951095            if (sc.getAssignedUser()) {
     
    11001100            }
    11011101        }
    1102        
     1102
    11031103        if (!tt.isEmpty()) {
    11041104            b.setToolTipText(tt);
  • trunk/src/org/openstreetmap/josm/gui/preferences/ValidatorPreference.java

    r4976 r6070  
    3232        }
    3333    }
    34    
     34
    3535    private ValidatorPreference() {
    36         super("validator", tr("Data validator"), 
     36        super("validator", tr("Data validator"),
    3737                tr("An OSM data validator that checks for common errors made by users and editor programs."));
    3838    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

    r6022 r6070  
    9595        });
    9696        readPreferences(Main.pref);
    97        
     97
    9898        applyFilter();
    9999        table = new PreferencesTable(displayData);
     
    140140            }
    141141        });
    142        
     142
    143143        JButton export = new JButton(tr("Export selected items"));
    144144        p.add(export, GBC.std().insets(5,5,0,0));
     
    148148            }
    149149        });
    150        
     150
    151151        final JButton more = new JButton(tr("More..."));
    152152        p.add(more, GBC.std().insets(5,5,0,0));
     
    178178        allData = prepareData(loaded, orig, defaults);
    179179    }
    180    
     180
    181181    private File[] askUserForCustomSettingsFiles(boolean saveFileFlag, String title) {
    182182        FileFilter filter = new FileFilter() {
     
    195195            if (sel.length==1 && !sel[0].getName().contains(".")) sel[0]=new File(sel[0].getAbsolutePath()+".xml");
    196196            return sel;
    197         } 
     197        }
    198198        return new File[0];
    199199    }
    200  
     200
    201201    private void exportSelectedToXML() {
    202202        ArrayList<String> keys = new ArrayList<String>();
    203203        boolean hasLists = false;
    204        
     204
    205205        for (PrefEntry p: table.getSelectedItems()) {
    206206            // preferences with default values are not saved
     
    212212            }
    213213        }
    214        
     214
    215215        if (keys.isEmpty()) {
    216216            JOptionPane.showMessageDialog(Main.parent,
     
    233233        CustomConfigurator.exportPreferencesKeysToFile(files[0].getAbsolutePath(), answer == 0, keys);
    234234    }
    235    
     235
    236236    private void readPreferencesFromXML() {
    237237        File[] files = askUserForCustomSettingsFiles(false, tr("Open JOSM customization file"));
     
    262262        applyFilter();
    263263    }
    264    
     264
    265265    private Comparator<PrefEntry> customComparator = new Comparator<PrefEntry>() {
    266266        @Override
     
    273273        }
    274274    };
    275                
     275
    276276    private List<PrefEntry> prepareData(Map<String, Setting> loaded, Map<String, Setting> orig, Map<String, Setting> defaults) {
    277277        List<PrefEntry> data = new ArrayList<PrefEntry>();
     
    306306        return data;
    307307    }
    308    
     308
    309309    Map<String,String> profileTypes = new LinkedHashMap<String, String>();
    310    
     310
    311311    private JPopupMenu buildPopupMenu() {
    312312        JPopupMenu menu = new JPopupMenu();
     
    315315        profileTypes.put(marktr("toolbar"), "toolbar.*");
    316316        profileTypes.put(marktr("imagery"), "imagery.*");
    317        
     317
    318318        for (Entry<String,String> e: profileTypes.entrySet()) {
    319319            menu.add(new ExportProfileAction(Main.pref, e.getKey(), e.getValue()));
    320320        }
    321        
     321
    322322        menu.addSeparator();
    323323        menu.add(getProfileMenu());
     
    340340        return menu;
    341341    }
    342    
     342
    343343    private JMenu getProfileMenu() {
    344344        final JMenu p =new JMenu(tr("Load profile"));
     
    372372        return p;
    373373    }
    374    
     374
    375375    private class ImportProfileAction extends AbstractAction {
    376376        private final File file;
    377377        private final String type;
    378        
     378
    379379        public ImportProfileAction(String name, File file, String type) {
    380380            super(name);
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java

    r5703 r6070  
    126126        panel.add(onewayArrow, GBC.eop().insets(20,0,0,0));
    127127        panel.add(segmentOrderNumber, GBC.eop().insets(20,0,0,0));
    128        
     128
    129129        panel.add(new JLabel(tr("Select and draw mode options")),
    130130                GBC.eop().insets(5,10,0,0));
    131131        panel.add(virtualNodes, GBC.eop().insets(20,0,0,0));
    132132        panel.add(drawHelperLine, GBC.eop().insets(20, 0, 0, 0));
    133        
     133
    134134        panel.add(performanceLabel, GBC.eop().insets(5,10,0,0));
    135135        panel.add(useAntialiasing, GBC.eop().insets(20,0,0,0));
     
    137137        panel.add(useHighlighting, GBC.eop().insets(20,0,0,0));
    138138        panel.add(outlineOnly, GBC.eol().insets(20,0,0,0));
    139        
     139
    140140        panel.add(new JLabel(tr("Other options")),
    141141                GBC.eop().insets(5,10,0,0));
    142142        panel.add(sourceBounds, GBC.eop().insets(20,0,0,0));
    143143        panel.add(inactive, GBC.eop().insets(20,0,0,0));
    144        
     144
    145145        ExpertToggleAction.addVisibilitySwitcher(performanceLabel);
    146146        ExpertToggleAction.addVisibilitySwitcher(useAntialiasing);
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java

    r5631 r6070  
    4343        model = new LanguageComboBoxModel();
    4444        // Selecting the language BEFORE the JComboBox listens to model changes speed up initialization by ~35ms (see #7386)
    45         // See http://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui 
     45        // See http://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui
    4646        model.selectLanguage(Main.pref.get("language"));
    4747        langCombo = new JosmComboBox(model);
     
    5454        panel.add(langCombo, GBC.eol().fill(GBC.HORIZONTAL));
    5555        panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
    56        
     56
    5757        TabPreferenceSetting tabPref = lafPreference.getTabPreferenceSetting(gui);
    5858        tabPref.registerSubTab(this, tabPref.getSubTab(lafPreference));
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java

    r5886 r6070  
    2929    protected final JosmTextArea rawUrl = new JosmTextArea(3, 40);
    3030    protected final JosmTextField name = new JosmTextField();
    31    
     31
    3232    protected final Collection<ContentValidationListener> listeners = new ArrayList<ContentValidationListener>();
    33    
     33
    3434    /**
    3535     * A listener notified when the validation status of this panel change.
     
    3838        /**
    3939         * Called when the validation status of this panel changed
    40          * @param isValid true if the conditions required to close this panel are met   
     40         * @param isValid true if the conditions required to close this panel are met
    4141         */
    4242        public void contentChanged(boolean isValid);
     
    7171        return s.replaceAll("[\r\n]+", "").trim();
    7272    }
    73    
     73
    7474    protected final String getImageryName() {
    7575        return sanitize(name.getText());
     
    7979        return sanitize(rawUrl.getText());
    8080    }
    81    
     81
    8282    protected abstract boolean isImageryValid();
    8383
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanel.java

    r5886 r6070  
    8989                (int) Math.ceil(view.getPreferredSpan(View.Y_AXIS)));
    9090    }
    91    
     91
    9292    protected final String getTmsUrl() {
    9393        return sanitize(tmsUrl.getText());
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r6016 r6070  
    110110        tree.getLayerTree().addPropertyChangeListener("selectedLayers", new PropertyChangeListener() {
    111111            @Override
    112             public void propertyChange(PropertyChangeEvent evt) { 
     112            public void propertyChange(PropertyChangeEvent evt) {
    113113                onLayerSelectionChanged();
    114114            }
     
    135135            }
    136136        });
    137        
     137
    138138        registerValidableComponent(endpoint);
    139139        registerValidableComponent(rawUrl);
    140140        registerValidableComponent(wmsUrl);
    141141    }
    142    
     142
    143143    protected final void onLayerSelectionChanged() {
    144144        if (wms.getServiceUrl() != null) {
     
    161161        return info;
    162162    }
    163    
     163
    164164    protected final String getWmsUrl() {
    165165        return sanitize(wmsUrl.getText());
    166166    }
    167    
     167
    168168    protected boolean isImageryValid() {
    169169        if (getImageryName().isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r5886 r6070  
    8888        addSettingsSection(p, name, section, GBC.eol());
    8989    }
    90    
     90
    9191    private void addSettingsSection(final JPanel p, String name, JPanel section, GBC gbc) {
    9292        final JLabel lbl = new JLabel(name);
     
    436436                    throw new IllegalStateException("Type " + type + " not supported");
    437437                }
    438                
     438
    439439                final AddImageryDialog addDialog = new AddImageryDialog(gui, p);
    440440                addDialog.showDialog();
    441                
     441
    442442                if (addDialog.getValue() == 1) {
    443443                    try {
     
    455455            }
    456456        }
    457        
     457
    458458        private class RemoveEntryAction extends AbstractAction implements ListSelectionListener {
    459459
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java

    r5609 r6070  
    8888        add(hint, gbc);
    8989    }
    90    
     90
    9191    /**
    9292     * A plugin checkbox.
     
    102102        }
    103103    }
    104    
     104
    105105    /**
    106106     * Listener called when the user selects/unselects a plugin checkbox.
     
    139139                        for (String s : pi.getRequiredPlugins()) {
    140140                            if (s.equals(cb.pi.getName())) {
    141                                 otherPlugins.add(pi.getName()); 
     141                                otherPlugins.add(pi.getName());
    142142                                break;
    143143                            }
     
    151151        }
    152152    };
    153    
     153
    154154
    155155    /**
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java

    r5601 r6070  
    295295        return ret;
    296296    }
    297    
     297
    298298    /**
    299299     * Replies the set of all available plugins.
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/AbstractProjectionChoice.java

    r5548 r6070  
    77
    88abstract public class AbstractProjectionChoice implements ProjectionChoice {
    9    
     9
    1010    protected String name;
    1111    protected String id;
     
    5252
    5353    abstract public String getCurrentCode();
    54    
     54
    5555    abstract public String getProjectionName();
    5656
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java

    r5886 r6070  
    209209    public String getCurrentCode() {
    210210        // not needed - getProjection() is overridden
    211         throw new UnsupportedOperationException(); 
     211        throw new UnsupportedOperationException();
    212212    }
    213213
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java

    r5548 r6070  
    5353        return null;
    5454    }
    55    
     55
    5656    @Override
    5757    public String getProjectionName() {
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java

    r5548 r6070  
    7777        return null;
    7878    }
    79    
     79
    8080    @Override
    8181    protected String indexToZone(int index) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionChoice.java

    r5548 r6070  
    2020     *
    2121     * Will be used to save the user selection to the preference file.
    22      * 
     22     *
    2323     * @return the string identifier
    2424     */
     
    6767    /**
    6868     * Get Preferences from projection code.
    69      * 
     69     *
    7070     * @return null when code is not part of this projection choice.
    7171     * An empty Collection as return value indicates, that the code is supported,
     
    7676    /**
    7777     * Short name of the projection choice as shown in the GUI (combo box).
    78      * 
     78     *
    7979     * @return the name
    8080     */
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r6056 r6070  
    9090         * see http://www.epsg-registry.org/
    9191         */
    92         mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 
     92        mercator = registerProjectionChoice(tr("Mercator"), "core:mercator",
    9393                3857);
    94        
     94
    9595        /**
    9696         * UTM.
     
    155155        /**
    156156         * Lambert 93 projection.
    157          * 
     157         *
    158158         * As specified by the IGN in this document
    159159         * http://professionnels.ign.fr/DISPLAY/000/526/702/5267026/NTG_87.pdf
     
    471471        return gui.getMapPreference();
    472472    }
    473    
     473
    474474    /**
    475475     * Selects the given projection.
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java

    r5548 r6070  
    2525
    2626    private Hemisphere hemisphere;
    27    
     27
    2828    private final static List<String> cbEntries = new ArrayList<String>();
    2929    static {
  • trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java

    r5954 r6070  
    161161            this.name = name;
    162162        }
    163        
     163
    164164        @Override
    165165        public Component getTableCellRendererComponent(JTable table, Object value, boolean
     
    186186        }
    187187    }
    188    
     188
    189189    private void initComponents() {
    190190        JPanel listPane = new JPanel();
  • trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreference.java

    r5954 r6070  
    1919
    2020    private String defaultFilter;
    21            
     21
    2222    public static class Factory implements PreferenceSettingFactory {
    2323        public PreferenceSetting createPreferenceSetting() {
     
    2525        }
    2626    }
    27    
     27
    2828    private ShortcutPreference() {
    2929        // icon source: http://www.iconfinder.net/index.php?q=key&page=icondetails&iconid=8553&size=128&q=key&s12=on&s16=on&s22=on&s32=on&s48=on&s64=on&s128=on
     
    3535        super("shortcuts", tr("Keyboard Shortcuts"), tr("Changing keyboard shortcuts manually."));
    3636    }
    37    
     37
    3838    @Override
    3939    public void addGui(PreferenceTabbedPane gui) {
     
    4949        return Shortcut.savePrefs();
    5050    }
    51    
     51
    5252    public void setDefaultFilter(String substring) {
    5353        defaultFilter = substring;
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java

    r6068 r6070  
    6464        tagTable.setNextFocusComponent(nextFocusComponent);
    6565    }
    66    
     66
    6767    /**
    6868     * builds the panel with the button row
     
    123123            });
    124124        }
    125        
     125
    126126        addFocusListener(new FocusAdapter() {
    127127            @Override public void focusGained(FocusEvent e) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java

    r6064 r6070  
    4747    private final TagEditorModel model;
    4848    private Component nextFocusComponent;
    49        
     49
    5050    /** a list of components to which focus can be transferred without stopping
    5151     * cell editing this table.
     
    104104                getCellEditor().stopCellEditing();
    105105            }
    106            
     106
    107107            if (row==-1 && col==-1) {
    108108                requestFocusInCell(0, 0);
    109109                return;
    110110            }
    111        
     111
    112112            if (col == 0) {
    113113                col++;
     
    290290            if (!key.trim().isEmpty()) {
    291291                model.appendNewTag();
    292             } 
     292            }
    293293            requestFocusInCell(model.getRowCount()-1, 0);
    294294        }
    295            
     295
    296296        protected void updateEnabledState() {
    297297            setEnabled(TagTable.this.isEnabled());
     
    435435        this.nextFocusComponent = nextFocusComponent;
    436436    }
    437    
     437
    438438    public TagCellEditor getTableCellEditor() {
    439439        return editor;
     
    472472        }
    473473        // there was a bug here - on older 1.6 Java versions Tab was not working
    474         // after such activation. In 1.7 it works OK, 
     474        // after such activation. In 1.7 it works OK,
    475475        // previous solution of usint awt.Robot was resetting mouse speed on Windows
    476476    }
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r6068 r6070  
    7575    public String locale_name;
    7676   public final static String OPTIONAL_TOOLTIP_TEXT = "Optional tooltip text";
    77    
     77
    7878    /**
    7979     * The types as preparsed collection.
     
    8484    public TemplateEntry nameTemplate;
    8585    public Match nameTemplateFilter;
    86    
     86
    8787    /**
    8888     * Create an empty tagging preset. This will not have any items and
     
    239239        if (roles != null && osm != null) {
    240240            for (Role i : roles.roles) {
    241                 if (i.memberExpression != null && i.memberExpression.match(osm) 
     241                if (i.memberExpression != null && i.memberExpression.match(osm)
    242242                        && (i.types == null || i.types.isEmpty() || i.types.contains(TaggingPresetType.forPrimitive(osm)) )) {
    243243                    return i.key;
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItem.java

    r6068 r6070  
    4646        return null;
    4747    }
    48    
     48
    4949}
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java

    r6068 r6070  
    465465    }
    466466   
    467     public void setClickListener(ActionListener сlickListener) {
    468         this.clickListener = сlickListener;
     467    public void setClickListener(ActionListener clickListener) {
     468        this.clickListener = clickListener;
    469469    }
    470470   
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetType.java

    r6068 r6070  
    4747        return null;
    4848    }
    49    
     49
    5050}
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r5704 r6070  
    286286
    287287    private static InputContext privateInputContext = InputContext.getInstance();
    288    
     288
    289289    @Override
    290290    public InputContext getInputContext() {
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java

    r5886 r6070  
    3636
    3737    private Integer maxChars;
    38    
     38
    3939    /**
    4040     * The document model for the editor
     
    4848        @Override
    4949        public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
    50            
     50
    5151            // If a maximum number of characters is specified, avoid to exceed it
    5252            if (maxChars != null && str != null && getLength() + str.length() > maxChars) {
     
    5858                }
    5959            }
    60            
     60
    6161            if (autoCompletionList == null) {
    6262                super.insertString(offs, str, a);
  • trunk/src/org/openstreetmap/josm/gui/util/FileFilterAllFiles.java

    r5572 r6070  
    1212 */
    1313public class FileFilterAllFiles extends FileFilter {
    14    
     14
    1515    private static FileFilterAllFiles INSTANCE;
    1616
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r5881 r6070  
    5252        }
    5353    }
    54    
     54
    5555    public static void executeByMainWorkerInEDT(final Runnable task) {
    5656        Main.worker.submit(new Runnable() {
    5757            public void run() {
    58                 runInEDTAndWait(task); 
     58                runInEDTAndWait(task);
    5959            }
    6060        });
     
    8282        }
    8383    }
    84    
     84
    8585    /**
    8686     * returns true if the user wants to cancel, false if they
     
    104104        return dlg.showDialog().getValue() != 2;
    105105    }
    106    
     106
    107107    /**
    108108     * Replies the disabled (grayed) version of the specified image.
     
    125125        return new ImageIcon(getDisabledImage(icon.getImage()));
    126126    }
    127    
     127
    128128    /**
    129129     * Attaches a {@code HierarchyListener} to the specified {@code Component} that
     
    154154        return pane;
    155155    }
    156    
     156
    157157    /**
    158158     * Schedules a new Timer to be run in the future (once or several times).
     
    169169        return timer;
    170170    }
    171    
     171
    172172    /**
    173173     * Return s new BasicStroke object with given thickness and style
     
    177177    public static Stroke getCustomizedStroke(String code) {
    178178        String[] s = code.trim().split("[^\\.0-9]+");
    179        
    180         if (s.length==0) return new BasicStroke(); 
     179
     180        if (s.length==0) return new BasicStroke();
    181181        float w;
    182182        try {
     
    215215        }
    216216    }
    217    
     217
    218218    /**
    219219     * Gets the font used to display JOSM title in about dialog and splash screen.
     
    227227    public static Font getTitleFont() {
    228228        List<String> fonts = Arrays.asList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
    229         // Helvetica is the preferred choice but is not available by default on Windows 
     229        // Helvetica is the preferred choice but is not available by default on Windows
    230230        // (http://www.microsoft.com/typography/fonts/product.aspx?pid=161)
    231231        if (fonts.contains("Helvetica")) {
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java

    r5887 r6070  
    2121     *      <code>createDefaultModel</code> method
    2222     * @param text  the initial string to display, or <code>null</code>
    23      * @param columns  the number of columns to use to calculate 
     23     * @param columns  the number of columns to use to calculate
    2424     *   the preferred width >= 0; if <code>columns</code>
    2525     *   is set to zero, the preferred width will be whatever
     
    3737     *
    3838     * @param text the text to be displayed, or <code>null</code>
    39      * @param columns  the number of columns to use to calculate 
     39     * @param columns  the number of columns to use to calculate
    4040     *   the preferred width; if columns is set to zero, the
    4141     *   preferred width will be whatever naturally results from
     
    6363     * <code>null</code>.
    6464     *
    65      * @param columns  the number of columns to use to calculate 
     65     * @param columns  the number of columns to use to calculate
    6666     *   the preferred width; if columns is set to zero, the
    6767     *   preferred width will be whatever naturally results from
    6868     *   the component implementation
    69      */ 
     69     */
    7070    public JosmTextField(int columns) {
    7171        this(null, null, columns);
  • trunk/src/org/openstreetmap/josm/gui/widgets/ListPopupMenu.java

    r4459 r6070  
    1313 */
    1414public class ListPopupMenu extends JPopupMenu {
    15    
     15
    1616    private JList[] lists;
    1717
  • trunk/src/org/openstreetmap/josm/gui/widgets/OsmIdTextField.java

    r5778 r6070  
    3030     * Sets the type of primitive object
    3131     * @param type The type of primitive object (
    32      *      {@link OsmPrimitiveType#NODE NODE}, 
    33      *      {@link OsmPrimitiveType#WAY WAY}, 
     32     *      {@link OsmPrimitiveType#NODE NODE},
     33     *      {@link OsmPrimitiveType#WAY WAY},
    3434     *      {@link OsmPrimitiveType#RELATION RELATION})
    3535     */
  • trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuLauncher.java

    r5958 r6070  
    2525
    2626    /**
    27      * Creates a new {@link PopupMenuLauncher} with no defined menu. 
     27     * Creates a new {@link PopupMenuLauncher} with no defined menu.
    2828     * It is then needed to override the {@link #launch} method.
    2929     * @see #launch(MouseEvent)
     
    5555    @Override public void mouseClicked(MouseEvent e) {}
    5656    @Override public void mouseReleased(MouseEvent e) { processEvent(e); }
    57    
     57
    5858    private void processEvent(MouseEvent e) {
    5959        if (e.isPopupTrigger() && (!checkEnabled || e.getComponent().isEnabled())) {
     
    7575        }
    7676    }
    77    
     77
    7878    protected boolean checkSelection(Component component, Point p) {
    7979        if (component instanceof JList) {
     
    8686        return true;
    8787    }
    88    
     88
    8989    protected void checkFocusAndShowMenu(final Component component, final MouseEvent evt) {
    9090        if (component != null && component.isFocusable() && !component.hasFocus() && component.requestFocusInWindow()) {
     
    100100        }
    101101    }
    102    
     102
    103103    protected void showMenu(MouseEvent evt) {
    104104        if (menu != null && evt != null) {
     
    106106        }
    107107    }
    108    
     108
    109109    protected int checkListSelection(JList list, Point p) {
    110110        int idx = list.locationToIndex(p);
     
    122122        return row;
    123123    }
    124    
     124
    125125    protected TreePath checkTreeSelection(JTree tree, Point p) {
    126126        TreePath path = tree.getPathForLocation(p.x, p.y);
     
    130130        return path;
    131131    }
    132    
     132
    133133    protected static boolean isDoubleClick(MouseEvent e) {
    134134        return e != null && SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2;
    135135    }
    136    
     136
    137137    /**
    138138     * @return the popup menu if defined, {@code null} otherwise.
  • trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java

    r5874 r6070  
    5959        return result;
    6060    }
    61    
     61
    6262    /**
    6363     * Retrieve raw gps waypoints from the server API.
     
    131131                    return null;
    132132                ds.mergeFrom(ds2);
    133                
     133
    134134            } else {
    135135                // Simple request
  • trunk/src/org/openstreetmap/josm/io/CacheFiles.java

    r5881 r6070  
    6565     */
    6666    public CacheFiles(String ident, boolean isPlugin) {
    67         String pref = isPlugin ? 
     67        String pref = isPlugin ?
    6868                Main.pref.getPluginsDirectory().getPath() + File.separator + "cache" :
    6969                Main.pref.getCacheDirectory().getPath();
  • trunk/src/org/openstreetmap/josm/io/Capabilities.java

    r4063 r6070  
    1313 *
    1414 * Example capabilites document:
    15  * 
     15 *
    1616 * <osm version="0.6" generator="OpenStreetMap server">
    1717 *   <api>
     
    3232 *   </policy>
    3333 * </osm>
    34  * 
     34 *
    3535 * This class is used in conjunction with a very primitive parser
    3636 * and simply stuffs the each tag and its attributes into a hash
  • trunk/src/org/openstreetmap/josm/io/FileExporter.java

    r5459 r6070  
    1212
    1313public abstract class FileExporter implements LayerChangeListener {
    14    
     14
    1515    public final ExtensionFileFilter filter;
    1616
     
    3131
    3232    /**
    33      * Returns the enabled state of this {@code FileExporter}. When enabled, it is listed and usable in "File->Save" dialogs. 
     33     * Returns the enabled state of this {@code FileExporter}. When enabled, it is listed and usable in "File->Save" dialogs.
    3434     * @return true if this {@code FileExporter} is enabled
    3535     * @since 5459
  • trunk/src/org/openstreetmap/josm/io/FileImporter.java

    r5459 r6070  
    2424
    2525    public final ExtensionFileFilter filter;
    26    
     26
    2727    private boolean enabled;
    2828
     
    106106        return (new Double(this.getPriority())).compareTo(other.getPriority());
    107107    }
    108    
     108
    109109    public static CBZip2InputStream getBZip2InputStream(InputStream in) throws IOException {
    110110        if (in == null) {
     
    129129
    130130    /**
    131      * Returns the enabled state of this {@code FileImporter}. When enabled, it is listed and usable in "File->Open" dialog. 
     131     * Returns the enabled state of this {@code FileImporter}. When enabled, it is listed and usable in "File->Open" dialog.
    132132     * @return true if this {@code FileImporter} is enabled
    133133     * @since 5459
  • trunk/src/org/openstreetmap/josm/io/GeoJSONExporter.java

    r5874 r6070  
    2020    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    2121            "json,geojson", "json", tr("GeoJSON Files") + " (*.json *.geojson)");
    22    
     22
    2323    public GeoJSONExporter() {
    2424        super(FILE_FILTER);
  • trunk/src/org/openstreetmap/josm/io/GpxImporter.java

    r5679 r6070  
    3232    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    3333            "gpx,gpx.gz", "gpx", tr("GPX Files") + " (*.gpx *.gpx.gz)");
    34    
     34
    3535    /**
    36      * Utility class containing imported GPX and marker layers, and a task to run after they are added to MapView. 
     36     * Utility class containing imported GPX and marker layers, and a task to run after they are added to MapView.
    3737     */
    3838    public static class GpxImporterData {
     
    8585        }
    8686        String fileName = file.getName();
    87        
     87
    8888        try {
    8989            GpxReader r = new GpxReader(is);
     
    9696        }
    9797    }
    98    
     98
    9999    /**
    100100     * Adds the specified GPX and marker layers to Map.main
     
    126126     * @see #addLayers
    127127     */
    128     public static GpxImporterData loadLayers(final GpxData data, final boolean parsedProperly, 
     128    public static GpxImporterData loadLayers(final GpxData data, final boolean parsedProperly,
    129129            final String gpxLayerName, String markerLayerName) {
    130130        GpxLayer gpxLayer = null;
  • trunk/src/org/openstreetmap/josm/io/GpxReader.java

    r5854 r6070  
    3434/**
    3535 * Read a gpx file.
    36  * 
     36 *
    3737 * Bounds are not read, as we caluclate them. @see GpxData.recalculateBounds()
    3838 * Both GPX version 1.0 and 1.1 are supported.
  • trunk/src/org/openstreetmap/josm/io/GpxWriter.java

    r5874 r6070  
    6363            }
    6464        }
    65        
     65
    6666        out.println("<?xml version='1.0' encoding='UTF-8'?>");
    6767        out.println("<gpx version=\"1.1\" creator=\"JOSM GPX export\" xmlns=\"http://www.topografix.com/GPX/1/1\"\n" +
  • trunk/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java

    r5889 r6070  
    2424
    2525    public static final boolean[] INVALID_CHARS;
    26    
     26
    2727    static {
    2828        INVALID_CHARS = new boolean[0x20];
  • trunk/src/org/openstreetmap/josm/io/JpgImporter.java

    r5438 r6070  
    2323public class JpgImporter extends FileImporter {
    2424    private GpxLayer gpx;
    25    
     25
    2626    /**
    2727     * The default file filter (only *.jpg files).
     
    2929    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    3030            "jpg", "jpg", tr("Image Files") + " (*.jpg)");
    31    
     31
    3232    /**
    3333     * An alternate file filter that also includes folders.
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r5387 r6070  
    124124    /**
    125125     * appends a {@link OsmPrimitive} id to the list of ids which will be fetched from the server.
    126      * 
     126     *
    127127     * @param ds the {@link DataSet} to which the primitive belongs
    128128     * @param id the primitive id
     
    416416        return missingPrimitives;
    417417    }
    418    
    419     /**
    420      * The class holding the results given by {@link Fetcher}. 
     418
     419    /**
     420     * The class holding the results given by {@link Fetcher}.
    421421     * It is only a wrapper of the resulting {@link DataSet} and the collection of {@link PrimitiveId} that could not have been loaded.
    422422     */
    423423    protected static class FetchResult {
    424        
     424
    425425        /**
    426426         * The resulting data set
    427427         */
    428428        public final DataSet dataSet;
    429        
     429
    430430        /**
    431431         * The collection of primitive ids that could not have been loaded
    432432         */
    433433        public final Set<PrimitiveId> missingPrimitives;
    434        
     434
    435435        /**
    436436         * Constructs a {@code FetchResult}
     
    443443        }
    444444    }
    445    
     445
    446446    /**
    447447     * The class that actually download data from OSM API. Several instances of this class are used by {@link MultiFetchServerObjectReader} (one per set of primitives to fetch).
     
    472472            return fetch(progressMonitor).dataSet;
    473473        }
    474        
     474
    475475        @Override
    476476        public FetchResult call() throws Exception {
    477477            return fetch(progressMonitor);
    478478        }
    479        
     479
    480480        /**
    481481         * fetches the requested primitives and updates the specified progress monitor.
     
    496496            }
    497497        }
    498        
     498
    499499        /**
    500500         * invokes a Multi Get for a set of ids and a given {@link OsmPrimitiveType}.
  • trunk/src/org/openstreetmap/josm/io/NMEAImporter.java

    r5452 r6070  
    2222    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    2323            "nmea,nme,nma,log,txt", "nmea", tr("NMEA-0183 Files") + " (*.nmea *.nme *.nma *.log *.txt)");
    24    
     24
    2525    public NMEAImporter() {
    2626        super(FILE_FILTER);
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r6009 r6070  
    5454 */
    5555public class OsmApi extends OsmConnection {
    56    
    57     /** 
    58      * Maximum number of retries to send a request in case of HTTP 500 errors or timeouts 
     56
     57    /**
     58     * Maximum number of retries to send a request in case of HTTP 500 errors or timeouts
    5959     */
    6060    static public final int DEFAULT_MAX_NUM_RETRIES = 5;
    6161
    6262    /**
    63      * Maximum number of concurrent download threads, imposed by 
     63     * Maximum number of concurrent download threads, imposed by
    6464     * <a href="http://wiki.openstreetmap.org/wiki/API_usage_policy#Technical_Usage_Requirements">
    6565     * OSM API usage policy.</a>
     
    6767     */
    6868    static public final int MAX_DOWNLOAD_THREADS = 2;
    69    
    70     /**
    71      * Default URL of the standard OSM API. 
     69
     70    /**
     71     * Default URL of the standard OSM API.
    7272     * @since 5422
    7373     */
     
    9393        return api;
    9494    }
    95    
     95
    9696    /**
    9797     * Replies the {@link OsmApi} for the URL given by the preference <code>osm-server.url</code>
     
    187187            this.fastFail = fastFail;
    188188        }
    189        
     189
    190190        @Override
    191191        protected byte[] updateData() throws OsmTransferException {
     
    196196    /**
    197197     * Initializes this component by negotiating a protocol version with the server.
    198      * 
     198     *
    199199     * @param monitor the progress monitor
    200200     * @throws OsmTransferCanceledException If the initialisation has been cancelled by user.
     
    204204        initialize(monitor, false);
    205205    }
    206    
    207     /**
    208      * Initializes this component by negotiating a protocol version with the server, with the ability to control the timeout. 
     206
     207    /**
     208     * Initializes this component by negotiating a protocol version with the server, with the ability to control the timeout.
    209209     *
    210210     * @param monitor the progress monitor
     
    269269        }
    270270    }
    271    
     271
    272272    private void initializeCapabilities(String xml) throws SAXException, IOException, ParserConfigurationException {
    273273        InputSource inputSource = new InputSource(new StringReader(xml));
     
    734734            throw new OsmTransferException(tr("ID of current changeset > 0 required. Current ID is {0}.", changeset.getId()));
    735735    }
    736    
     736
    737737    /**
    738738     * Replies the changeset data uploads are currently directed to
  • trunk/src/org/openstreetmap/josm/io/OsmApiException.java

    r5584 r6070  
    2828        this.accessedUrl = accessedUrl;
    2929    }
    30    
     30
    3131    /**
    3232     * Constructs an {@code OsmApiException} with the specified response code, error header and error body
     
    5252
    5353    /**
    54      * Constructs an {@code OsmApiException} with the specified cause and a detail message of 
    55      * <tt>(cause==null ? null : cause.toString())</tt> 
     54     * Constructs an {@code OsmApiException} with the specified cause and a detail message of
     55     * <tt>(cause==null ? null : cause.toString())</tt>
    5656     * (which typically contains the class and detail message of <tt>cause</tt>).
    5757     *
    58      * @param cause the cause (which is saved for later retrieval by the {@link #getCause} method). 
     58     * @param cause the cause (which is saved for later retrieval by the {@link #getCause} method).
    5959     *              A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.
    6060     */
     
    6666     * Constructs an {@code OsmApiException} with the specified detail message and cause.
    6767     *
    68      * <p> Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated 
     68     * <p> Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated
    6969     * into this exception's detail message.
    7070     *
  • trunk/src/org/openstreetmap/josm/io/OsmApiInitializationException.java

    r5386 r6070  
    1919
    2020    /**
    21      * Constructs an {@code OsmApiInitializationException} with the specified cause and a detail message of 
    22      * <tt>(cause==null ? null : cause.toString())</tt> 
     21     * Constructs an {@code OsmApiInitializationException} with the specified cause and a detail message of
     22     * <tt>(cause==null ? null : cause.toString())</tt>
    2323     * (which typically contains the class and detail message of <tt>cause</tt>).
    2424     *
    25      * @param cause the cause (which is saved for later retrieval by the {@link #getCause} method). 
     25     * @param cause the cause (which is saved for later retrieval by the {@link #getCause} method).
    2626     *              A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.
    2727     */
     
    3333     * Constructs an {@code OsmApiInitializationException} with the specified detail message and cause.
    3434     *
    35      * <p> Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated 
     35     * <p> Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated
    3636     * into this exception's detail message.
    3737     *
  • trunk/src/org/openstreetmap/josm/io/OsmBzip2Importer.java

    r5859 r6070  
    1515    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    1616            "osm.bz2,osm.bz", "osm.bz2", tr("OSM Server Files bzip2 compressed") + " (*.osm.bz2 *.osm.bz)");
    17    
     17
    1818    public OsmBzip2Importer() {
    1919        super(FILE_FILTER);
  • trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java

    r5859 r6070  
    2424    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    2525            "osc,osc.bz2,osc.bz,osc.gz", "osc", tr("OsmChange File") + " (*.osc *.osc.bz2 *.osc.bz *.osc.gz)");
    26    
     26
    2727    public OsmChangeImporter() {
    2828        super(FILE_FILTER);
     
    3636        try {
    3737            FileInputStream in = new FileInputStream(file);
    38            
     38
    3939            if (file.getName().endsWith(".osc")) {
    4040                importData(in, file, progressMonitor);
     
    4444                importData(getBZip2InputStream(in), file, progressMonitor);
    4545            }
    46            
     46
    4747        } catch (FileNotFoundException e) {
    4848            e.printStackTrace();
     
    5454        importData(in, associatedFile, NullProgressMonitor.INSTANCE);
    5555    }
    56    
     56
    5757    protected void importData(InputStream in, final File associatedFile, ProgressMonitor  progressMonitor) throws IllegalDataException {
    5858        final DataSet dataSet = OsmChangeReader.parseDataSet(in, progressMonitor);
    5959        final OsmDataLayer layer = new OsmDataLayer(dataSet, associatedFile.getName(), associatedFile);
    60         addDataLayer(dataSet, layer, associatedFile.getPath()); 
     60        addDataLayer(dataSet, layer, associatedFile.getPath());
    6161    }
    62        
    63     protected void addDataLayer(final DataSet dataSet, final OsmDataLayer layer, final String filePath) { 
     62
     63    protected void addDataLayer(final DataSet dataSet, final OsmDataLayer layer, final String filePath) {
    6464        // FIXME: remove UI stuff from IO subsystem
    6565        //
  • trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java

    r5346 r6070  
    4444    private ChangesetDataSet data;
    4545
    46     // FIXME: this class has many similarities with OsmHistoryReader.Parser and should be merged 
     46    // FIXME: this class has many similarities with OsmHistoryReader.Parser and should be merged
    4747    private class Parser extends DefaultHandler {
    4848
     
    143143            long changesetId = getMandatoryAttributeLong(atts,"changeset");
    144144            boolean visible= getMandatoryAttributeBoolean(atts, "visible");
    145            
     145
    146146            Long uid = getAttributeLong(atts, "uid");
    147147            String userStr = atts.getValue("user");
  • trunk/src/org/openstreetmap/josm/io/OsmGzipImporter.java

    r5859 r6070  
    1515    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    1616            "osm.gz", "osm.gz", tr("OSM Server Files gzip compressed") + " (*.osm.gz)");
    17    
     17
    1818    public OsmGzipImporter() {
    1919        super(FILE_FILTER);
  • trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java

    r5881 r6070  
    4242    private final HistoryDataSet data;
    4343
    44     // FIXME: this class has many similarities with OsmChangesetContentParser.Parser and should be merged 
     44    // FIXME: this class has many similarities with OsmChangesetContentParser.Parser and should be merged
    4545    private class Parser extends DefaultHandler {
    4646
  • trunk/src/org/openstreetmap/josm/io/OsmImporter.java

    r5874 r6070  
    2525    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    2626            "osm,xml", "osm", tr("OSM Server Files") + " (*.osm *.xml)");
    27    
     27
    2828    public static class OsmImporterData {
    2929
     
    8080        importData(in, associatedFile, NullProgressMonitor.INSTANCE);
    8181    }
    82    
     82
    8383    /**
    8484     * Imports OSM data from stream
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r5996 r6070  
    130130        while (true) {
    131131            int event = parser.next();
    132            
     132
    133133            if (cancel) {
    134134                cancel = false;
    135135                throwException(tr("Reading was canceled"));
    136136            }
    137            
     137
    138138            if (event == XMLStreamConstants.START_ELEMENT) {
    139139                if (parser.getLocalName().equals("bounds")) {
  • trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java

    r5874 r6070  
    8181        }, progressMonitor);
    8282    }
    83    
     83
    8484    /**
    8585     * Method to download GZip-compressed OSM files from somewhere
     
    117117        }, progressMonitor);
    118118    }
    119    
     119
    120120    /**
    121121     * Method to download BZip2-compressed OSM Change files from somewhere
     
    135135        }, progressMonitor);
    136136    }
    137    
     137
    138138    /**
    139139     * Method to download GZip-compressed OSM Change files from somewhere
  • trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java

    r5874 r6070  
    2323 * It can either download the object including or not including its immediate children.
    2424 * The former case is called a "full download".
    25  * 
     25 *
    2626 * It can also download a specific version of the object (however, "full" download is not possible
    2727 * in that case).
  • trunk/src/org/openstreetmap/josm/io/OsmServerReader.java

    r5863 r6070  
    209209        this.doAuthenticate = doAuthenticate;
    210210    }
    211    
     211
    212212    /**
    213213     * Determines if the GPX data has been parsed properly.
  • trunk/src/org/openstreetmap/josm/io/OsmTransferException.java

    r5386 r6070  
    2727
    2828    /**
    29      * Constructs an {@code OsmTransferException} with the specified cause and a detail message of 
    30      * <tt>(cause==null ? null : cause.toString())</tt> 
     29     * Constructs an {@code OsmTransferException} with the specified cause and a detail message of
     30     * <tt>(cause==null ? null : cause.toString())</tt>
    3131     * (which typically contains the class and detail message of <tt>cause</tt>).
    3232     *
    33      * @param cause the cause (which is saved for later retrieval by the {@link #getCause} method). 
     33     * @param cause the cause (which is saved for later retrieval by the {@link #getCause} method).
    3434     *              A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.
    3535     */
     
    4141     * Constructs an {@code OsmTransferException} with the specified detail message and cause.
    4242     *
    43      * <p> Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated 
     43     * <p> Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated
    4444     * into this exception's detail message.
    4545     *
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r5874 r6070  
    7171        header(null);
    7272    }
    73    
     73
    7474    public void header(Boolean upload) {
    7575        out.println("<?xml version='1.0' encoding='UTF-8'?>");
     
    8282        out.println("' generator='JOSM'>");
    8383    }
    84    
     84
    8585    public void footer() {
    8686        out.println("</osm>");
     
    9999        return result;
    100100    }
    101    
     101
    102102    public void writeLayer(OsmDataLayer layer) {
    103103        header(!layer.isUploadDiscouraged());
     
    116116        writeRelations(ds.getRelations());
    117117    }
    118    
     118
    119119    /**
    120120     * Writes the given nodes sorted by id
     
    129129        }
    130130    }
    131    
     131
    132132    /**
    133133     * Writes the given ways sorted by id
     
    142142        }
    143143    }
    144    
     144
    145145    /**
    146146     * Writes the given relations sorted by id
  • trunk/src/org/openstreetmap/josm/io/OsmWriterFactory.java

    r4645 r6070  
    77 * This factory is called by everyone who needs an OsmWriter object,
    88 * instead of directly calling the OsmWriter constructor.
    9  * 
     9 *
    1010 * This enables plugins to substitute the original OsmWriter with
    1111 * their own version, altering the way JOSM writes objects to the
    1212 * server, and to disk.
    13  * 
     13 *
    1414 * @author Frederik Ramm
    1515 *
  • trunk/src/org/openstreetmap/josm/io/WMSLayerExporter.java

    r5874 r6070  
    1313
    1414/**
    15  * Export a WMS layer to a serialized binary file that can be imported later via {@link WMSLayerImporter}. 
    16  * 
     15 * Export a WMS layer to a serialized binary file that can be imported later via {@link WMSLayerImporter}.
     16 *
    1717 * @since 5457
    1818 */
  • trunk/src/org/openstreetmap/josm/io/WMSLayerImporter.java

    r5874 r6070  
    2828    public static final ExtensionFileFilter FILE_FILTER = new ExtensionFileFilter(
    2929            "wms", "wms", tr("WMS Files (*.wms)"));
    30    
     30
    3131    private final WMSLayer wmsLayer;
    3232
     
    5858            Utils.close(ois);
    5959        }
    60        
     60
    6161        // FIXME: remove UI stuff from IO subsystem
    6262        GuiHelper.runInEDT(new Runnable() {
  • trunk/src/org/openstreetmap/josm/io/XmlWriter.java

    r5874 r6070  
    7676        encoding.put('\t', "&#x9;");
    7777    }
    78    
     78
    7979    @Override
    8080    public void close() throws IOException {
  • trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java

    r5889 r6070  
    5252                    if (requestorType.equals(RequestorType.PROXY))
    5353                        dialog = CredentialDialog.getHttpProxyCredentialDialog(username, password, host, getSaveUsernameAndPasswordCheckboxText());
    54                     else 
     54                    else
    5555                        dialog = CredentialDialog.getOsmApiCredentialDialog(username, password, host, getSaveUsernameAndPasswordCheckboxText());
    5656                    dialog.setVisible(true);
  • trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java

    r5266 r6070  
    1818 */
    1919public class CredentialsManager implements CredentialsAgent {
    20    
     20
    2121    private static CredentialsManager instance;
    2222
     
    3838        return instance;
    3939    }
    40    
     40
    4141    private static CredentialsAgentFactory agentFactory;
    4242
     
    4444        CredentialsAgent getCredentialsAgent();
    4545    }
    46    
     46
    4747    /**
    4848     * Plugins can register a CredentialsAgentFactory, thereby overriding
     
    5959     * non-static fields and methods
    6060     */
    61    
     61
    6262    private CredentialsAgent delegate;
    6363
  • trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java

    r5863 r6070  
    145145        return pnlMessage;
    146146    }
    147    
     147
    148148    @Override
    149149    public String getSaveUsernameAndPasswordCheckboxText() {
    150150        return tr("Save user and password (unencrypted)");
    151151    }
    152    
     152
    153153}
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java

    r6000 r6070  
    6767    String buildRootUrl() {
    6868        if (serviceUrl == null) {
    69             return null; 
     69            return null;
    7070        }
    7171        StringBuilder a = new StringBuilder(serviceUrl.getProtocol());
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r5880 r6070  
    4040
    4141/**
    42  * 
     42 *
    4343 * @author master
    44  * 
     44 *
    4545 * Dialog to add tags as part of the remotecontrol
    4646 * Existing Keys get grey color and unchecked selectboxes so they will not overwrite the old Key-Value-Pairs by default.
     
    5252
    5353    /** initially given tags  **/
    54     String[][] tags; 
    55    
     54    String[][] tags;
     55
    5656    private final JTable propertyTable;
    5757    private Collection<? extends OsmPrimitive> sel;
     
    6060    String sender;
    6161    static Set<String> trustedSenders = new HashSet<String>();
    62    
     62
    6363    /**
    6464     * Class for displaying "delete from ... objects" in the table
     
    7373        }
    7474    }
    75    
     75
    7676    /**
    7777     * Class for displaying list of existing tag values in the table
     
    8383            this.tag=tag; valueCount=new HashMap<String, Integer>();
    8484        }
    85        
     85
    8686        int addValue(String val) {
    8787            Integer c = valueCount.get(val);
     
    117117            sb.append("</html>");
    118118            return sb.toString();
    119            
    120         }
    121     }
    122            
     119
     120        }
     121    }
     122
    123123    public AddTagsDialog(String[][] tags, String senderName) {
    124124        super(Main.parent, tr("Add tags to selected objects"), new String[] { tr("Add selected tags"), tr("Add all tags"),  tr("Cancel")},
     
    128128
    129129        this.sender = senderName;
    130        
     130
    131131        DataSet.addSelectionListener(this);
    132132
     
    142142        sel = Main.main.getCurrentDataSet().getSelected();
    143143        count = new int[tags.length];
    144        
     144
    145145        for (int i = 0; i<tags.length; i++) {
    146146            count[i] = 0;
     
    164164            tm.setValueAt(old , i, 3);
    165165        }
    166        
     166
    167167        propertyTable = new JTable(tm) {
    168168
     
    200200                return tr("Enable the checkbox to accept the value");
    201201            }
    202            
     202
    203203        };
    204        
     204
    205205        propertyTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
    206206        // a checkbox has a size of 15 px
     
    213213        propertyTable.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_MASK), "shiftenter");
    214214        propertyTable.getActionMap().put("shiftenter", new AbstractAction() {
    215             @Override  public void actionPerformed(ActionEvent e) { 
     215            @Override  public void actionPerformed(ActionEvent e) {
    216216                buttonAction(1, e); // add all tags on Shift-Enter
    217217            }
    218218        });
    219        
     219
    220220        // set the content of this AddTagsDialog consisting of the tableHeader and the table itself.
    221221        JPanel tablePanel = new JPanel();
     
    229229                    if (c.isSelected())
    230230                        trustedSenders.add(sender);
    231                     else 
     231                    else
    232232                        trustedSenders.remove(sender);
    233233                }
     
    275275                }
    276276            }
    277         } 
     277        }
    278278        if (buttonIndex == 2) {
    279279            trustedSenders.remove(sender);
     
    287287        findExistingTags();
    288288    }
    289    
     289
    290290     /*
    291291     * parse addtags parameters Example URL (part):
     
    314314                        for (String tag : tagSet) {
    315315                            // support a  =   b===c as "a"="b===c"
    316                             String [] pair = tag.split("\\s*=\\s*",2); 
     316                            String [] pair = tag.split("\\s*=\\s*",2);
    317317                            keyValue[i][0] = pair[0];
    318318                            keyValue[i][1] = pair.length<2 ? "": pair[1];
     
    323323                }
    324324
    325                
     325
    326326            });
    327327        }
    328328    }
    329    
     329
    330330    /**
    331331     * Ask user and add the tags he confirm
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java

    r5861 r6070  
    4545     * Adds external request handler.
    4646     * Can be used by plugins that want to use remote control.
    47      * 
     47     *
    4848     * @param command The command name.
    4949     * @param handlerClass The additional request handler.
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r5889 r6070  
    9292     * Add external request handler. Message can be suppressed.
    9393     * (for internal use)
    94      * 
     94     *
    9595     * @param command The command to handle.
    9696     * @param handler The additional request handler.
     
    138138            out = new OutputStreamWriter(raw);
    139139            BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream(), "ASCII"));
    140            
     140
    141141            String get = in.readLine();
    142142            if (get == null) {
     
    162162                return;
    163163            }
    164            
     164
    165165            int questionPos = url.indexOf('?');
    166            
     166
    167167            String command = questionPos < 0 ? url : url.substring(0, questionPos);
    168            
     168
    169169            Map <String,String> headers = new HashMap<String, String>();
    170170            int k=0, MAX_HEADERS=20;
     
    178178                } else break;
    179179            }
    180            
     180
    181181            // Who sent the request: trying our best to detect
    182182            // not from localhost => sender = IP
    183183            // from localhost: sender = referer header, if exists
    184184            String sender = null;
    185            
     185
    186186            if (!request.getInetAddress().isLoopbackAddress()) {
    187187                sender = request.getInetAddress().getHostAddress();
     
    197197                if (sender == null) {
    198198                    sender = "localhost";
    199                 } 
    200             }
    201            
     199                }
     200            }
     201
    202202            // find a handler for this command
    203203            Class<? extends RequestHandler> handlerClass = handlers.get(command);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java

    r5876 r6070  
    2626     */
    2727    public static final String command = "add_node";
    28    
     28
    2929    private double lat;
    3030    private double lon;
     
    6969
    7070        Node nd = null;
    71        
     71
    7272        if (Main.map != null &&  Main.map.mapView != null) {
    7373            Point p = Main.map.mapView.getPoint(ll);
     
    8383            Main.main.undoRedo.add(new AddCommand(nd));
    8484        }
    85        
     85
    8686        Main.main.getCurrentDataSet().setSelected(nd);
    8787        if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) {
     
    9191        }
    9292        // parse parameter addtags=tag1=value1|tag2=vlaue2
    93         AddTagsDialog.addTags(args, sender);       
     93        AddTagsDialog.addTags(args, sender);
    9494    }
    9595
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java

    r5927 r6070  
    3434     */
    3535    public static final String command = "add_way";
    36    
     36
    3737    private final List<LatLon> allCoordinates = new ArrayList<LatLon>();
    3838
     
    5555        });
    5656        // parse parameter addtags=tag1=value1|tag2=value2
    57         AddTagsDialog.addTags(args, sender);       
     57        AddTagsDialog.addTags(args, sender);
    5858    }
    5959
     
    9494        }
    9595    }
    96    
     96
    9797    /**
    98      * Find the node with almost the same ccords in dataset or in already added nodes 
     98     * Find the node with almost the same ccords in dataset or in already added nodes
    9999     * @since 5845
    100100     **/
    101101    Node findOrCreateNode(LatLon ll,  List<Command> commands) {
    102         Node nd = null;     
    103          
     102        Node nd = null;
     103
    104104        if (Main.map != null && Main.map.mapView != null) {
    105105            Point p = Main.map.mapView.getPoint(ll);
     
    109109            }
    110110        }
    111        
     111
    112112        Node prev = null;
    113113        for (LatLon lOld: addedNodes.keySet()) {
     
    128128        return nd;
    129129    }
    130    
     130
    131131    /*
    132132     * This function creates the way with given coordinates of nodes
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java

    r5889 r6070  
    2323     */
    2424    public static final String command = "import";
    25    
     25
    2626    private URL url;
    2727    private Collection<DownloadTask> suitableDownloadTasks;
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r5876 r6070  
    3838     */
    3939    public static final String command = "load_and_zoom";
    40    
     40
    4141    /**
    4242     * The remote control command name used to zoom.
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java

    r5927 r6070  
    2626     */
    2727    public static final String command = "load_object";
    28    
     28
    2929    private final List<PrimitiveId> ps = new LinkedList<PrimitiveId>();
    3030
     
    5151                public void run() {
    5252                    Main.main.getCurrentDataSet().setSelected(ps);
    53                     AddTagsDialog.addTags(args, sender);       
     53                    AddTagsDialog.addTags(args, sender);
    5454                    ps.clear();
    5555                }
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java

    r5876 r6070  
    4343    /** will be filled with the command assigned to the subclass */
    4444    protected String myCommand;
    45    
     45
    4646    /**
    4747     * who send th request?
     
    251251        this.sender = sender;
    252252    }
    253  
     253
    254254    public static class RequestHandlerException extends Exception {
    255255
  • trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java

    r5505 r6070  
    6868
    6969        for (ImageEntry entry : layer.getImages()) {
    70            
     70
    7171            Element imgElem = support.createElement("geoimage");
    7272
  • trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java

    r5684 r6070  
    8686            }
    8787        }
    88        
     88
    8989        return new GeoImageLayer(entries, gpxLayer);
    9090    }
  • trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java

    r5684 r6070  
    3131    private ImageryLayer layer;
    3232    private JCheckBox export;
    33    
     33
    3434    public ImagerySessionExporter(ImageryLayer layer) {
    3535        this.layer = layer;
  • trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java

    r5684 r6070  
    4848        return layer;
    4949    }
    50    
     50
    5151}
  • trunk/src/org/openstreetmap/josm/io/session/MarkerSessionImporter.java

    r5684 r6070  
    5757            MarkerLayer markerLayer = importData.getMarkerLayer();
    5858            markerLayer.fromLayer = gpxLayer;
    59            
     59
    6060            return markerLayer;
    6161
  • trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java

    r5886 r6070  
    6868        public LayerSaveAction() {
    6969            putValue(SMALL_ICON, new ImageProvider("save").setWidth(16).get());
    70             putValue(SHORT_DESCRIPTION, layer.requiresSaveToFile() ? 
     70            putValue(SHORT_DESCRIPTION, layer.requiresSaveToFile() ?
    7171                    tr("Layer contains unsaved data - save to file.") :
    7272                    tr("Layer does not contain unsaved data."));
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r6041 r6070  
    151151
    152152    final public static String [] UNMAINTAINED_PLUGINS = new String[] {"gpsbabelgui", "Intersect_way"};
    153    
     153
    154154    /**
    155155     * Default time-based update interval, in days (pluginmanager.time-based-update.interval)
     
    425425            return false;
    426426        }
    427        
     427
    428428        // Add all plugins already loaded (to include early plugins when checking late ones)
    429429        Collection<PluginInformation> allPlugins = new HashSet<PluginInformation>(plugins);
     
    449449
    450450        String requires = local ? plugin.localrequires : plugin.requires;
    451        
     451
    452452        // make sure the dependencies to other plugins are not broken
    453453        //
     
    483483        List<URL> allPluginLibraries = new LinkedList<URL>();
    484484        File pluginDir = Main.pref.getPluginsDirectory();
    485        
     485
    486486        // Add all plugins already loaded (to include early plugins in the classloader, allowing late plugins to rely on early ones)
    487487        Collection<PluginInformation> allPlugins = new HashSet<PluginInformation>(plugins);
     
    489489            allPlugins.add(proxy.getPluginInformation());
    490490        }
    491        
     491
    492492        for (PluginInformation info : allPlugins) {
    493493            if (info.libraries == null) {
     
    760760        );
    761761    }
    762    
     762
    763763    private static Set<PluginInformation> findRequiredPluginsToDownload(
    764764            Collection<PluginInformation> pluginsToUpdate, List<PluginInformation> allPlugins, Set<PluginInformation> pluginsToDownload) {
     
    818818            Future<?> future = service.submit(task1);
    819819            List<PluginInformation> allPlugins = null;
    820            
     820
    821821            try {
    822822                future.get();
     
    841841                }
    842842            }
    843            
     843
    844844            if (!pluginsToUpdate.isEmpty()) {
    845                
     845
    846846                Set<PluginInformation> pluginsToDownload = new HashSet<PluginInformation>(pluginsToUpdate);
    847                
     847
    848848                if (allPlugins != null) {
    849849                    // Updated plugins may need additional plugin dependencies currently not installed
     
    851851                    Set<PluginInformation> additionalPlugins = findRequiredPluginsToDownload(pluginsToUpdate, allPlugins, pluginsToDownload);
    852852                    pluginsToDownload.addAll(additionalPlugins);
    853                    
     853
    854854                    // Iterate on required plugins, if they need themselves another plugins (i.e A needs B, but B needs C)
    855855                    while (!additionalPlugins.isEmpty()) {
     
    881881                    return plugins;
    882882                }
    883                
     883
    884884                // Update Plugin info for downloaded plugins
    885885                //
    886886                refreshLocalUpdatedPluginInfo(task2.getDownloadedPlugins());
    887                
     887
    888888                // notify user if downloading a locally installed plugin failed
    889889                //
     
    10051005        return;
    10061006    }
    1007    
     1007
    10081008    /**
    10091009     * Determines if the specified file is a valid and accessible JAR file.
     
    10231023        return false;
    10241024    }
    1025    
     1025
    10261026    /**
    10271027     * Replies the updated jar file for the given plugin name.
     
    10431043        return downloadedPluginFile;
    10441044    }
    1045    
     1045
    10461046    /**
    10471047     * Refreshes the given PluginInformation objects with new contents read from their corresponding jar file.
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r5874 r6070  
    5858    public List<URL> libraries = new LinkedList<URL>();
    5959    public final Map<String, String> attr = new TreeMap<String, String>();
    60    
     60
    6161    private static final ImageIcon emptyIcon = new ImageIcon(new BufferedImage(24, 24, BufferedImage.TYPE_INT_ARGB));
    6262
     
    154154        this.attr.putAll(other.attr);
    155155    }
    156    
     156
    157157    /**
    158158     * Updates the plugin information of this plugin information object with the
     
    173173        this.stage = other.stage;
    174174    }
    175    
     175
    176176    private void scanManifest(Manifest manifest, boolean oldcheck){
    177177        String lang = LanguageInfo.getLanguageCodeManifest();
     
    495495        return requiredPlugins;
    496496    }
    497    
    498     /**
    499      * Replies the list of plugins required by the up-to-date version of this plugin. 
     497
     498    /**
     499     * Replies the list of plugins required by the up-to-date version of this plugin.
    500500     * @return List of plugins required. Empty if no plugin is required.
    501501     * @since 5601
     
    504504        return getRequiredPlugins(requires);
    505505    }
    506    
    507     /**
    508      * Replies the list of plugins required by the local instance of this plugin. 
     506
     507    /**
     508     * Replies the list of plugins required by the local instance of this plugin.
    509509     * @return List of plugins required. Empty if no plugin is required.
    510510     * @since 5601
     
    513513        return getRequiredPlugins(localrequires);
    514514    }
    515    
    516     /**
    517      * Updates the local fields ({@link #localversion}, {@link #localmainversion}, {@link #localrequires}) 
    518      * to values contained in the up-to-date fields ({@link #version}, {@link #mainversion}, {@link #requires}) 
     515
     516    /**
     517     * Updates the local fields ({@link #localversion}, {@link #localmainversion}, {@link #localrequires})
     518     * to values contained in the up-to-date fields ({@link #version}, {@link #mainversion}, {@link #requires})
    519519     * of the given PluginInformation.
    520520     * @param info The plugin information to get the data from.
  • trunk/src/org/openstreetmap/josm/tools/AlphanumComparator.java

    r5087 r6070  
    3131 *
    3232 * The Alphanum Algorithm is discussed at http://www.DaveKoelle.com
    33  * 
     33 *
    3434 * This is an updated version with enhancements made by Daniel Migowski, Andre
    3535 * Bogus, and David Koelle.
  • trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java

    r5874 r6070  
    342342
    343343    /**
    344      * Shows a popup audio error message for the given exception. 
     344     * Shows a popup audio error message for the given exception.
    345345     * @param ex The exception used as error reason. Cannot be {@code null}.
    346346     */
  • trunk/src/org/openstreetmap/josm/tools/AudioUtil.java

    r5874 r6070  
    1818 */
    1919public class AudioUtil {
    20    
     20
    2121    /**
    2222     * Returns calibrated length of recording in seconds.
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r5886 r6070  
    129129                                urltext += "...<snip>...\n";
    130130                            }
    131                            
     131
    132132                            JPanel p = new JPanel(new GridBagLayout());
    133133                            p.add(new JMultilineLabel(
     
    173173        }
    174174    }
    175    
     175
    176176    /**
    177177     * Determines if an exception is currently being handled
     
    181181        return handlingInProgress;
    182182    }
    183    
     183
    184184    /**
    185185     * Replies the URL to create a JOSM bug report with the given debug text
     
    194194            gzip.write(debugText.getBytes("UTF-8"));
    195195            Utils.close(gzip);
    196    
     196
    197197            return new URL("http://josm.openstreetmap.de/josmticket?" +
    198198                    "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true));
     
    202202        }
    203203    }
    204    
     204
    205205    /**
    206206     * Replies the URL label to create a JOSM bug report with the given debug text
  • trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java

    r5584 r6070  
    279279            msg = body;
    280280        }
    281        
     281
    282282        if (msg != null && !msg.isEmpty()) {
    283283            return tr("<html>"
     
    546546        return message;
    547547    }
    548    
     548
    549549    /**
    550550     * Explains a {@link OsmApiException} which was thrown because of
    551      * bandwidth limit exceeded (HTTP error 509) 
     551     * bandwidth limit exceeded (HTTP error 509)
    552552     *
    553553     * @param e the exception
     
    559559        return message;
    560560    }
    561    
     561
    562562
    563563    /**
     
    694694        return msg;
    695695    }
    696    
     696
    697697    /**
    698698     * Replaces some HTML reserved characters (<, > and &) by their equivalent entity (&lt;, &gt; and &amp;);
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r6049 r6070  
    3939     *
    4040     * Prerequisite: no two nodes have the same coordinates.
    41      * 
     41     *
    4242     * @param ways  a list of ways to test
    4343     * @param test  if false, do not build list of Commands, just return nodes
     
    247247     */
    248248    public static EastNorth getSegmentSegmentIntersection(EastNorth p1, EastNorth p2, EastNorth p3, EastNorth p4) {
    249        
     249
    250250        CheckParameterUtil.ensureValidCoordinates(p1, "p1");
    251251        CheckParameterUtil.ensureValidCoordinates(p2, "p2");
    252252        CheckParameterUtil.ensureValidCoordinates(p3, "p3");
    253253        CheckParameterUtil.ensureValidCoordinates(p4, "p4");
    254        
     254
    255255        double x1 = p1.getX();
    256256        double y1 = p1.getY();
     
    270270        // (x2-x1,y2-y1)*u - (x4-x3,y4-y3)*v = (x3-x1,y3-y1)
    271271        // if 0<= u,v <=1, intersection exists at ( x1+ (x2-x1)*u, y1 + (y2-y1)*u )
    272        
     272
    273273        double a1 = x2 - x1;
    274274        double b1 = x3 - x4;
     
    281281        // Solve the equations
    282282        double det = a1*b2 - a2*b1;
    283        
     283
    284284        double uu = b2*c1 - b1*c2 ;
    285285        double vv = a1*c2 - a2*c1;
    286286        double mag = Math.abs(uu)+Math.abs(vv);
    287                
     287
    288288        if (Math.abs(det) > 1e-12 * mag) {
    289289            double u = uu/det, v = vv/det;
     
    298298            // parallel lines
    299299            return null;
    300         } 
     300        }
    301301    }
    302302
     
    312312        CheckParameterUtil.ensureValidCoordinates(p3, "p3");
    313313        CheckParameterUtil.ensureValidCoordinates(p4, "p4");
    314        
     314
    315315        if (!p1.isValid()) throw new IllegalArgumentException();
    316        
     316
    317317        // Convert line from (point, point) form to ax+by=c
    318318        double a1 = p2.getY() - p1.getY();
     
    376376            return new EastNorth(p1.getX() + ldx * offset, p1.getY() + ldy * offset);
    377377    }
    378    
     378
    379379    /**
    380380     * Calculates closest point to a line segment.
     
    418418     */
    419419    public static boolean angleIsClockwise(EastNorth commonNode, EastNorth firstNode, EastNorth secondNode) {
    420        
     420
    421421        CheckParameterUtil.ensureValidCoordinates(commonNode, "commonNode");
    422422        CheckParameterUtil.ensureValidCoordinates(firstNode, "firstNode");
    423423        CheckParameterUtil.ensureValidCoordinates(secondNode, "secondNode");
    424        
     424
    425425        double dy1 = (firstNode.getY() - commonNode.getY());
    426426        double dy2 = (secondNode.getY() - commonNode.getY());
     
    446446            path.closePath();
    447447        }
    448        
     448
    449449        return new Area(path);
    450450    }
    451    
     451
    452452    /**
    453453     * Tests if two polygons intersect.
     
    457457     */
    458458    public static PolygonIntersection polygonIntersection(List<Node> first, List<Node> second) {
    459        
     459
    460460        Area a1 = getArea(first);
    461461        Area a2 = getArea(second);
    462        
     462
    463463        Area inter = new Area(a1);
    464464        inter.intersect(a2);
    465        
     465
    466466        Rectangle bounds = inter.getBounds();
    467        
     467
    468468        if (inter.isEmpty() || bounds.getHeight()*bounds.getWidth() <= 1.0) {
    469469            return PolygonIntersection.OUTSIDE;
     
    622622     */
    623623    public static double getSegmentAngle(EastNorth p1, EastNorth p2) {
    624        
     624
    625625        CheckParameterUtil.ensureValidCoordinates(p1, "p1");
    626626        CheckParameterUtil.ensureValidCoordinates(p2, "p2");
    627        
     627
    628628        return Math.atan2(p2.north() - p1.north(), p2.east() - p1.east());
    629629    }
     
    638638     */
    639639    public static double getCornerAngle(EastNorth p1, EastNorth p2, EastNorth p3) {
    640        
     640
    641641        CheckParameterUtil.ensureValidCoordinates(p1, "p1");
    642642        CheckParameterUtil.ensureValidCoordinates(p2, "p2");
    643643        CheckParameterUtil.ensureValidCoordinates(p3, "p3");
    644        
     644
    645645        Double result = getSegmentAngle(p2, p1) - getSegmentAngle(p2, p3);
    646646        if (result <= -Math.PI) {
     
    654654        return result;
    655655    }
    656    
     656
    657657    public static EastNorth getCentroid(List<Node> nodes) {
    658658        // Compute the centroid of nodes
     
    672672                BigDecimal x1 = new BigDecimal(n1.east());
    673673                BigDecimal y1 = new BigDecimal(n1.north());
    674    
     674
    675675                BigDecimal k = x0.multiply(y1, MathContext.DECIMAL128).subtract(y0.multiply(x1, MathContext.DECIMAL128));
    676    
     676
    677677                area = area.add(k, MathContext.DECIMAL128);
    678678                east = east.add(k.multiply(x0.add(x1, MathContext.DECIMAL128), MathContext.DECIMAL128));
     
    702702     */
    703703    public static EastNorth getSegmentAltituteIntersection(EastNorth sp1, EastNorth sp2, EastNorth ap) {
    704        
     704
    705705        CheckParameterUtil.ensureValidCoordinates(sp1, "sp1");
    706706        CheckParameterUtil.ensureValidCoordinates(sp2, "sp2");
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r5946 r6070  
    198198        return this;
    199199    }
    200    
     200
    201201    /**
    202202     * Convenience method, see {@link #setMaxSize(Dimension)}.
  • trunk/src/org/openstreetmap/josm/tools/ImageResource.java

    r5830 r6070  
    1313 * Holds data for one particular image.
    1414 * It can be backed by a svg or raster image.
    15  * 
    16  * In the first case, 'svg' is not null and in the latter case, 'imgCache' has 
     15 *
     16 * In the first case, 'svg' is not null and in the latter case, 'imgCache' has
    1717 * at least one entry for the key DEFAULT_DIMENSION.
    1818 */
    1919class ImageResource {
    20    
     20
    2121    /**
    2222     * Caches the image data for resized versions of the same image.
     
    2525    private SVGDiagram svg;
    2626    public static final Dimension DEFAULT_DIMENSION = new Dimension(-1, -1);
    27  
     27
    2828    public ImageResource(BufferedImage img) {
    2929        CheckParameterUtil.ensureParameterNotNull(img);
     
    6363            BufferedImage base = imgCache.get(DEFAULT_DIMENSION);
    6464            if (base == null) throw new AssertionError();
    65            
     65
    6666            int width = dim.width;
    6767            int height = dim.height;
  • trunk/src/org/openstreetmap/josm/tools/InputMapUtils.java

    r5927 r6070  
    1313
    1414/**
    15  * Tools to work with Swing InputMap 
     15 * Tools to work with Swing InputMap
    1616 *
    1717 */
     
    2525        SwingUtilities.replaceUIInputMap(cmp,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,inputMap);
    2626      }
    27      
    28      
     27
     28
    2929      /**
    3030       * Enable activating button on Enter (which is replaced with spacebar for certain Look-And-Feels)
     
    3535         b.getActionMap().put("enter",b.getAction());
    3636      }
    37      
     37
    3838      public static void addEnterAction(JComponent c, Action a) {
    3939         c.getActionMap().put("enter", a);
    4040         c.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");
    4141      }
    42      
     42
    4343      public static void addSpacebarAction(JComponent c, Action a) {
    4444         c.getActionMap().put("spacebar", a);
    4545         c.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "spacebar");
    4646      }
    47            
     47
    4848}
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r5926 r6070  
    2525     * case (or Xy_AB: for sub languages).
    2626     *
    27      * @param type the type 
     27     * @param type the type
    2828     * @return the wiki language prefix or {@code null} for {@link LocaleType#BASELANGUAGE}, when
    2929     * base language is identical to default or english
  • trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java

    r5266 r6070  
    2727        Main.platform.openUrl(uri.toString());
    2828    }
    29    
     29
    3030    /**
    3131     * @return <code>null</code> for success or a string in case of an error.
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r5850 r6070  
    9292
    9393    public boolean rename(File from, File to);
    94    
     94
    9595    /**
    9696     * Returns a detailed OS description (at least family + version).
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r5879 r6070  
    250250        return false;
    251251    }
    252    
     252
    253253    /* (non-Javadoc)
    254254     * @see org.openstreetmap.josm.tools.PlatformHookUnixoid#getOSDescription()
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r5994 r6070  
    2121 */
    2222public class PlatformHookUnixoid implements PlatformHook {
    23    
     23
    2424    private String osDescription;
    25    
     25
    2626    @Override
    2727    public void preStartupHook(){
     
    127127        return osName;
    128128    }
    129    
     129
    130130    @Override
    131131    public String getOSDescription() {
     
    135135        return osDescription;
    136136    }
    137    
     137
    138138    protected static class LinuxReleaseInfo {
    139139        private final String path;
     
    143143        private final boolean plainText;
    144144        private final String prefix;
    145        
     145
    146146        public LinuxReleaseInfo(String path, String descriptionField, String idField, String releaseField) {
    147147            this(path, descriptionField, idField, releaseField, false, null);
     
    155155            this(path, null, null, null, true, prefix);
    156156        }
    157        
     157
    158158        private LinuxReleaseInfo(String path, String descriptionField, String idField, String releaseField, boolean plainText, String prefix) {
    159159            this.path = path;
     
    166166
    167167        @Override public String toString() {
    168             return "ReleaseInfo [path=" + path + ", descriptionField=" + descriptionField + 
     168            return "ReleaseInfo [path=" + path + ", descriptionField=" + descriptionField +
    169169                    ", idField=" + idField + ", releaseField=" + releaseField + "]";
    170170        }
    171        
     171
    172172        /**
    173173         * Extracts OS detailed information from a Linux release file (/etc/xxx-release)
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r5850 r6070  
    4444        //Shortcut.registerSystemCut("system:menuexit", tr("reserved"), VK_Q, CTRL_DOWN_MASK);
    4545        Shortcut.registerSystemShortcut("system:duplicate", tr("reserved"), VK_D, CTRL_DOWN_MASK); // not really system, but to avoid odd results
    46        
     46
    4747        // Windows 7 shortcuts: http://windows.microsoft.com/en-US/windows7/Keyboard-shortcuts
    4848
     
    5656        Shortcut.registerSystemShortcut("microsoft-reserved-02", tr("reserved"), VK_NUM_LOCK, ALT_DOWN_MASK | SHIFT_DOWN_MASK).setAutomatic(); // Turn Mouse Keys on or off
    5757        //Shortcut.registerSystemCut("microsoft-reserved-03", tr("reserved"), VK_U, );// Open the Ease of Access Center (TODO: Windows-U, how to handle it in Java ?)
    58        
     58
    5959        // General keyboard shortcuts
    6060        //Shortcut.registerSystemShortcut("system:help", tr("reserved"), VK_F1, 0);                            // Display Help
     
    129129    @Override
    130130    public String getOSDescription() {
    131         return Utils.strip(System.getProperty("os.name")) + " " + 
     131        return Utils.strip(System.getProperty("os.name")) + " " +
    132132                ((System.getenv("ProgramFiles(x86)") == null) ? "32" : "64") + "-Bit";
    133133    }
  • trunk/src/org/openstreetmap/josm/tools/UrlLabel.java

    r5440 r6070  
    2828        this (url, url, 0);
    2929    }
    30    
     30
    3131    public UrlLabel(String url, int fontPlus) {
    3232        this (url, url, fontPlus);
     
    3636        this (url, url, 0);
    3737    }
    38    
     38
    3939    public UrlLabel(String url, String description, int fontPlus) {
    4040        this();
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r5887 r6070  
    249249     */
    250250    public static void copyFile(File in, File out) throws IOException  {
    251         // TODO: remove this function when we move to Java 7 (use Files.copy instead) 
     251        // TODO: remove this function when we move to Java 7 (use Files.copy instead)
    252252        FileInputStream inStream = null;
    253253        FileOutputStream outStream = null;
     
    266266        }
    267267    }
    268    
     268
    269269    public static int copyStream(InputStream source, OutputStream destination) throws IOException {
    270270        int count = 0;
     
    306306        }
    307307    }
    308    
     308
    309309    /**
    310310     * <p>Utility method for closing a {@link ZipFile}.</p>
     
    357357            try {
    358358                t = clipboard.getContents(null);
    359             } catch (IllegalStateException e) { 
     359            } catch (IllegalStateException e) {
    360360                // Clipboard currently unavailable. On some platforms, the system clipboard is unavailable while it is accessed by another application.
    361361                try {
     
    561561        return new Color(Integer.parseInt(clr, 16));
    562562    }
    563    
     563
    564564    /**
    565565     * Opens a HTTP connection to the given URL and sets the User-Agent property to JOSM's one.
     
    577577        return connection;
    578578    }
    579    
     579
    580580    /**
    581581     * Opens a connection to the given URL and sets the User-Agent property to JOSM's one.
     
    618618     * Opens a HTTP connection to the given URL, sets the User-Agent property to JOSM's one and optionnaly disables Keep-Alive.
    619619     * @param httpURL The HTTP url to open (must use http:// or https://)
    620      * @param keepAlive 
     620     * @param keepAlive
    621621     * @return An open HTTP connection to the given URL
    622622     * @throws IOException if an I/O exception occurs.
     
    630630        return connection;
    631631    }
    632    
     632
    633633    /**
    634634     * An alternative to {@link String#trim()} to effectively remove all leading and trailing white characters, including Unicode ones.
    635635     * @see <a href="http://closingbraces.net/2008/11/11/javastringtrim/">Java’s String.trim has a strange idea of whitespace</a>
    636      * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4080617">JDK bug 4080617</a> 
     636     * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4080617">JDK bug 4080617</a>
    637637     * @param str The string to strip
    638      * @return <code>str</code>, without leading and trailing characters, according to 
     638     * @return <code>str</code>, without leading and trailing characters, according to
    639639     *         {@link Character#isWhitespace(char)} and {@link Character#isSpaceChar(char)}.
    640640     * @since 5772
  • trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java

    r5926 r6070  
    110110    /**
    111111     * Creates a window geometry from a rectangle
    112      * 
     112     *
    113113     * @param rect the position
    114114     */
     
    286286     * Applies this geometry to a window. Makes sure that the window is not
    287287     * placed outside of the coordinate range of all available screens.
    288      * 
     288     *
    289289     * @param window the window
    290290     */
     
    322322     * Find the size and position of the screen for given coordinates. Use first screen,
    323323     * when no coordinates are stored or null is passed.
    324      * 
     324     *
    325325     * @param preferenceKey the key to get size and position from
    326326     * @return bounds of the screen
     
    336336     * Find the size and position of the screen for given coordinates. Use first screen,
    337337     * when no coordinates are stored or null is passed.
    338      * 
     338     *
    339339     * @param g coordinates to check
    340340     * @return bounds of the screen
Note: See TracChangeset for help on using the changeset viewer.