Ignore:
Timestamp:
2016-03-17T01:50:12+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - Local variable and method parameter names should comply with a naming convention

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
24 edited

Legend:

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

    r10000 r10001  
    418418            name = tr("relation");
    419419        }
    420         String admin_level = relation.get("admin_level");
    421         if (admin_level != null) {
    422             name += '['+admin_level+']';
     420        String adminLevel = relation.get("admin_level");
     421        if (adminLevel != null) {
     422            name += '['+adminLevel+']';
    423423        }
    424424
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r9983 r10001  
    320320
    321321        for (int i = 0; i < bTexts.length; i++) {
    322             final int final_i = i;
     322            final int finalI = i;
    323323            Action action = new AbstractAction(bTexts[i]) {
    324324                @Override
    325325                public void actionPerformed(ActionEvent evt) {
    326                     buttonAction(final_i, evt);
     326                    buttonAction(finalI, evt);
    327327                }
    328328            };
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r9976 r10001  
    553553        LatLon ll2 = getLatLon(width / 2 + 50, height / 2);
    554554        if (ll1.isValid() && ll2.isValid() && b.contains(ll1) && b.contains(ll2)) {
    555             double d_m = ll1.greatCircleDistance(ll2);
    556             double d_en = 100 * scale;
    557             double scaleMin = 0.01 * d_en / d_m / 100;
     555            double dm = ll1.greatCircleDistance(ll2);
     556            double den = 100 * scale;
     557            double scaleMin = 0.01 * den / dm / 100;
    558558            if (!Double.isInfinite(scaleMin) && newScale < scaleMin) {
    559559                newScale = scaleMin;
     
    10261026                    }
    10271027
    1028                     Point2D A = getPoint2D(lastN);
    1029                     Point2D B = getPoint2D(n);
    1030                     double c = A.distanceSq(B);
    1031                     double a = p.distanceSq(B);
    1032                     double b = p.distanceSq(A);
     1028                    Point2D pA = getPoint2D(lastN);
     1029                    Point2D pB = getPoint2D(n);
     1030                    double c = pA.distanceSq(pB);
     1031                    double a = p.distanceSq(pB);
     1032                    double b = p.distanceSq(pA);
    10331033
    10341034                    /* perpendicular distance squared
     
    11421142     * @param p the point for which to search the nearest segment.
    11431143     * @param predicate the returned object has to fulfill certain properties.
    1144      * @param use_selected whether selected way segments should be preferred.
     1144     * @param useSelected whether selected way segments should be preferred.
    11451145     * @param preferredRefs - prefer segments related to these primitives, may be null
    11461146     *
     
    11531153     */
    11541154    public final WaySegment getNearestWaySegment(Point p, Predicate<OsmPrimitive> predicate,
    1155             boolean use_selected,  Collection<OsmPrimitive> preferredRefs) {
     1155            boolean useSelected,  Collection<OsmPrimitive> preferredRefs) {
    11561156        WaySegment wayseg = null, ntsel = null, ntref = null;
    11571157        if (preferredRefs != null && preferredRefs.isEmpty()) preferredRefs = null;
     
    11851185            }
    11861186        }
    1187         if (ntsel != null && use_selected)
     1187        if (ntsel != null && useSelected)
    11881188            return ntsel;
    11891189        if (ntref != null)
     
    13521352     * @param p The point on screen.
    13531353     * @param predicate the returned object has to fulfill certain properties.
    1354      * @param use_selected whether to prefer primitives that are currently selected or referred by selected primitives
     1354     * @param useSelected whether to prefer primitives that are currently selected or referred by selected primitives
    13551355     *
    13561356     * @return A primitive within snap-distance to point p,
     
    13591359     * @see #getNearestWay(Point, Predicate)
    13601360     */
    1361     public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean use_selected) {
     1361    public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean useSelected) {
    13621362        Collection<OsmPrimitive> sel;
    13631363        DataSet ds = getCurrentDataSet();
    1364         if (use_selected && ds != null) {
     1364        if (useSelected && ds != null) {
    13651365            sel = ds.getSelected();
    13661366        } else {
    13671367            sel = null;
    13681368        }
    1369         OsmPrimitive osm = getNearestNode(p, predicate, use_selected, sel);
    1370 
    1371         if (isPrecedenceNode((Node) osm, p, use_selected)) return osm;
     1369        OsmPrimitive osm = getNearestNode(p, predicate, useSelected, sel);
     1370
     1371        if (isPrecedenceNode((Node) osm, p, useSelected)) return osm;
    13721372        WaySegment ws;
    1373         if (use_selected) {
    1374             ws = getNearestWaySegment(p, predicate, use_selected, sel);
     1373        if (useSelected) {
     1374            ws = getNearestWaySegment(p, predicate, useSelected, sel);
    13751375        } else {
    1376             ws = getNearestWaySegment(p, predicate, use_selected);
     1376            ws = getNearestWaySegment(p, predicate, useSelected);
    13771377        }
    13781378        if (ws == null) return osm;
    13791379
    1380         if ((ws.way.isSelected() && use_selected) || osm == null) {
     1380        if ((ws.way.isSelected() && useSelected) || osm == null) {
    13811381            // either (no _selected_ nearest node found, if desired) or no nearest node was found
    13821382            osm = ws.way;
  • trunk/src/org/openstreetmap/josm/gui/NotificationManager.java

    r9078 r10001  
    108108        currentNotificationPanel.validate();
    109109
    110         int MARGIN = 5;
     110        int margin = 5;
    111111        int x, y;
    112112        JFrame parentWindow = (JFrame) Main.parent;
     
    115115            MapView mv = Main.map.mapView;
    116116            Point mapViewPos = SwingUtilities.convertPoint(mv.getParent(), mv.getX(), mv.getY(), Main.parent);
    117             x = mapViewPos.x + MARGIN;
    118             y = mapViewPos.y + mv.getHeight() - Main.map.statusLine.getHeight() - size.height - MARGIN;
     117            x = mapViewPos.x + margin;
     118            y = mapViewPos.y + mv.getHeight() - Main.map.statusLine.getHeight() - size.height - margin;
    119119        } else {
    120             x = MARGIN;
    121             y = parentWindow.getHeight() - Main.toolbar.control.getSize().height - size.height - MARGIN;
     120            x = margin;
     121            y = parentWindow.getHeight() - Main.toolbar.control.getSize().height - size.height - margin;
    122122        }
    123123        parentWindow.getLayeredPane().add(currentNotificationPanel, JLayeredPane.POPUP_LAYER, 0);
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java

    r9983 r10001  
    240240            return;
    241241
    242         Point p_max = new Point(Math.max(aEnd.x, aStart.x), Math.max(aEnd.y, aStart.y));
    243         Point p_min = new Point(Math.min(aEnd.x, aStart.x), Math.min(aEnd.y, aStart.y));
    244 
    245         iSelectionRectStart = getPosition(p_min);
    246         iSelectionRectEnd =   getPosition(p_max);
     242        Point pMax = new Point(Math.max(aEnd.x, aStart.x), Math.max(aEnd.y, aStart.y));
     243        Point pMin = new Point(Math.min(aEnd.x, aStart.x), Math.min(aEnd.y, aStart.y));
     244
     245        iSelectionRectStart = getPosition(pMin);
     246        iSelectionRectEnd =   getPosition(pMax);
    247247
    248248        Bounds b = new Bounds(
  • trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java

    r9078 r10001  
    154154
    155155        // calc the screen coordinates for the new selection rectangle
    156         MapMarkerDot xmin_ymin = new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon());
    157         MapMarkerDot xmax_ymax = new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon());
    158 
    159156        List<MapMarker> marker = new ArrayList<>(2);
    160         marker.add(xmin_ymin);
    161         marker.add(xmax_ymax);
     157        marker.add(new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon()));
     158        marker.add(new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon()));
    162159        mapViewer.setBoundingBox(bbox);
    163160        mapViewer.setMapMarkerList(marker);
     
    704701                int zoomDiff = MAX_ZOOM - zoom;
    705702                Point tlc = getTopLeftCoordinates();
    706                 int x_min = (min.x >> zoomDiff) - tlc.x;
    707                 int y_min = (min.y >> zoomDiff) - tlc.y;
    708                 int x_max = (max.x >> zoomDiff) - tlc.x;
    709                 int y_max = (max.y >> zoomDiff) - tlc.y;
    710 
    711                 int w = x_max - x_min;
    712                 int h = y_max - y_min;
     703                int xMin = (min.x >> zoomDiff) - tlc.x;
     704                int yMin = (min.y >> zoomDiff) - tlc.y;
     705                int xMax = (max.x >> zoomDiff) - tlc.x;
     706                int yMax = (max.y >> zoomDiff) - tlc.y;
     707
     708                int w = xMax - xMin;
     709                int h = yMax - yMin;
    713710                g.setColor(new Color(0.9f, 0.7f, 0.7f, 0.6f));
    714                 g.fillRect(x_min, y_min, w, h);
     711                g.fillRect(xMin, yMin, w, h);
    715712
    716713                g.setColor(Color.BLACK);
    717                 g.drawRect(x_min, y_min, w, h);
     714                g.drawRect(xMin, yMin, w, h);
    718715            } catch (Exception e) {
    719716                Main.error(e);
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java

    r10000 r10001  
    418418    abstract static class CopyAction extends AbstractAction implements ListSelectionListener {
    419419
    420         protected CopyAction(String icon_name, String action_name, String short_description) {
    421             ImageIcon icon = ImageProvider.get("dialogs/conflict", icon_name);
     420        protected CopyAction(String iconName, String actionName, String shortDescription) {
     421            ImageIcon icon = ImageProvider.get("dialogs/conflict", iconName);
    422422            putValue(Action.SMALL_ICON, icon);
    423423            if (icon == null) {
    424                 putValue(Action.NAME, action_name);
     424                putValue(Action.NAME, actionName);
    425425            }
    426             putValue(Action.SHORT_DESCRIPTION, short_description);
     426            putValue(Action.SHORT_DESCRIPTION, shortDescription);
    427427            setEnabled(false);
    428428        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java

    r9078 r10001  
    107107    public void reconstruct(Action action, ToggleDialog triggeredBy) {
    108108
    109         final int N = allDialogs.size();
     109        final int n = allDialogs.size();
    110110
    111111        /**
     
    126126         * in the last panel anyway.
    127127         */
    128         JPanel p = panels.get(N-1); // current Panel (start with last one)
     128        JPanel p = panels.get(n-1); // current Panel (start with last one)
    129129        int k = -1;                 // indicates that current Panel index is N-1, but no default-view-Dialog has been added to this Panel yet.
    130         for (int i = N-1; i >= 0; --i) {
     130        for (int i = n-1; i >= 0; --i) {
    131131            final ToggleDialog dlg = allDialogs.get(i);
    132132            if (dlg.isDialogInDefaultView()) {
    133133                if (k == -1) {
    134                     k = N-1;
     134                    k = n-1;
    135135                } else {
    136136                    --k;
     
    146146
    147147        if (k == -1) {
    148             k = N-1;
    149         }
    150         final int numPanels = N - k;
     148            k = n-1;
     149        }
     150        final int numPanels = n - k;
    151151
    152152        /**
     
    154154         */
    155155        if (action == Action.ELEMENT_SHRINKS) {
    156             for (int i = 0; i < N; ++i) {
     156            for (int i = 0; i < n; ++i) {
    157157                final ToggleDialog dlg = allDialogs.get(i);
    158158                if (dlg.isDialogInDefaultView()) {
     
    191191
    192192            /** total Height */
    193             final int H = mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height;
     193            final int h = mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height;
    194194
    195195            /** space, that is available for dialogs in default view (after the reconfiguration) */
    196             final int s2 = H - (numPanels - 1) * DIVIDER_SIZE - sumC;
    197 
    198             final int hp_trig = triggeredBy.getPreferredHeight();
    199             if (hp_trig <= 0) throw new IllegalStateException(); // Must be positive
     196            final int s2 = h - (numPanels - 1) * DIVIDER_SIZE - sumC;
     197
     198            final int hpTrig = triggeredBy.getPreferredHeight();
     199            if (hpTrig <= 0) throw new IllegalStateException(); // Must be positive
    200200
    201201            /** The new dialog gets a fair share */
    202             final int hn_trig = hp_trig * s2 / (hp_trig + sumP);
    203             triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hn_trig));
     202            final int hnTrig = hpTrig * s2 / (hpTrig + sumP);
     203            triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hnTrig));
    204204
    205205            /** This is remainig for the other default view dialogs */
    206             final int R = s2 - hn_trig;
     206            final int r = s2 - hnTrig;
    207207
    208208            /**
    209209             * Take space only from dialogs that are relatively large
    210210             */
    211             int D_m = 0;        // additional space needed by the small dialogs
    212             int D_p = 0;        // available space from the large dialogs
    213             for (int i = 0; i < N; ++i) {
     211            int dm = 0;        // additional space needed by the small dialogs
     212            int dp = 0;        // available space from the large dialogs
     213            for (int i = 0; i < n; ++i) {
    214214                final ToggleDialog dlg = allDialogs.get(i);
    215215                if (dlg.isDialogInDefaultView() && dlg != triggeredBy) {
    216216                    final int ha = dlg.getSize().height;                              // current
    217                     final int h0 = ha * R / sumA;                                     // proportional shrinking
    218                     final int he = dlg.getPreferredHeight() * s2 / (sumP + hp_trig);  // fair share
     217                    final int h0 = ha * r / sumA;                                     // proportional shrinking
     218                    final int he = dlg.getPreferredHeight() * s2 / (sumP + hpTrig);  // fair share
    219219                    if (h0 < he) {                  // dialog is relatively small
    220220                        int hn = Math.min(ha, he);  // shrink less, but do not grow
    221                         D_m += hn - h0;
     221                        dm += hn - h0;
    222222                    } else {                        // dialog is relatively large
    223                         D_p += h0 - he;
     223                        dp += h0 - he;
    224224                    }
    225225                }
    226226            }
    227227            /** adjust, without changing the sum */
    228             for (int i = 0; i < N; ++i) {
     228            for (int i = 0; i < n; ++i) {
    229229                final ToggleDialog dlg = allDialogs.get(i);
    230230                if (dlg.isDialogInDefaultView() && dlg != triggeredBy) {
    231231                    final int ha = dlg.getHeight();
    232                     final int h0 = ha * R / sumA;
    233                     final int he = dlg.getPreferredHeight() * s2 / (sumP + hp_trig);
     232                    final int h0 = ha * r / sumA;
     233                    final int he = dlg.getPreferredHeight() * s2 / (sumP + hpTrig);
    234234                    if (h0 < he) {
    235235                        int hn = Math.min(ha, he);
     
    238238                        int d;
    239239                        try {
    240                             d = (h0-he) * D_m / D_p;
     240                            d = (h0-he) * dm / dp;
    241241                        } catch (ArithmeticException e) { /* D_p may be zero - nothing wrong with that. */
    242242                            d = 0;
     
    253253        final List<Node> ch = new ArrayList<>();
    254254
    255         for (int i = k; i <= N-1; ++i) {
     255        for (int i = k; i <= n-1; ++i) {
    256256            if (i != k) {
    257257                ch.add(new Divider());
     
    279279         * Hide the Panel, if there is nothing to show
    280280         */
    281         if (numPanels == 1 && panels.get(N-1).getComponents().length == 0) {
     281        if (numPanels == 1 && panels.get(n-1).getComponents().length == 0) {
    282282            parent.setDividerSize(0);
    283283            this.setVisible(false);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java

    r9970 r10001  
    212212    }
    213213
    214     private Direction determineDirection(int ref_i, Direction ref_direction, int k) {
    215         return determineDirection(ref_i, ref_direction, k, false);
     214    private Direction determineDirection(int refI, Direction refDirection, int k) {
     215        return determineDirection(refI, refDirection, k, false);
    216216    }
    217217
     
    225225     * Let the relation be a route of oneway streets, and someone travels them in the given order.
    226226     * Direction is FORWARD if it is legal and BACKWARD if it is illegal to do so for the given way.
    227      * @param ref_i way key
    228      * @param ref_direction direction of ref_i
     227     * @param refI way key
     228     * @param refDirection direction of ref_i
    229229     * @param k successor of ref_i
    230230     * @param reversed if {@code true} determine reverse direction
    231231     * @return direction of way {@code k}
    232232     */
    233     private Direction determineDirection(int ref_i, final Direction ref_direction, int k, boolean reversed) {
    234         if (ref_i < 0 || k < 0 || ref_i >= members.size() || k >= members.size())
     233    private Direction determineDirection(int refI, final Direction refDirection, int k, boolean reversed) {
     234        if (refI < 0 || k < 0 || refI >= members.size() || k >= members.size())
    235235            return NONE;
    236         if (ref_direction == NONE)
     236        if (refDirection == NONE)
    237237            return NONE;
    238238
    239         final RelationMember m_ref = members.get(ref_i);
     239        final RelationMember mRef = members.get(refI);
    240240        final RelationMember m = members.get(k);
    241         Way way_ref = null;
     241        Way wayRef = null;
    242242        Way way = null;
    243243
    244         if (m_ref.isWay()) {
    245             way_ref = m_ref.getWay();
     244        if (mRef.isWay()) {
     245            wayRef = mRef.getWay();
    246246        }
    247247        if (m.isWay()) {
     
    249249        }
    250250
    251         if (way_ref == null || way == null)
     251        if (wayRef == null || way == null)
    252252            return NONE;
    253253
     
    255255        List<Node> refNodes = new ArrayList<>();
    256256
    257         switch (ref_direction) {
     257        switch (refDirection) {
    258258        case FORWARD:
    259             refNodes.add(way_ref.lastNode());
     259            refNodes.add(wayRef.lastNode());
    260260            break;
    261261        case BACKWARD:
    262             refNodes.add(way_ref.firstNode());
     262            refNodes.add(wayRef.firstNode());
    263263            break;
    264264        case ROUNDABOUT_LEFT:
    265265        case ROUNDABOUT_RIGHT:
    266             refNodes = way_ref.getNodes();
     266            refNodes = wayRef.getNodes();
    267267            break;
    268268        }
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r9971 r10001  
    10131013
    10141014        // How many pixels into the 'source' rectangle are we drawing?
    1015         int screen_x_offset = target.x - source.x;
    1016         int screen_y_offset = target.y - source.y;
     1015        int screenXoffset = target.x - source.x;
     1016        int screenYoffset = target.y - source.y;
    10171017        // And how many pixels into the image itself does that correlate to?
    1018         int img_x_offset = (int) (screen_x_offset * imageXScaling + 0.5);
    1019         int img_y_offset = (int) (screen_y_offset * imageYScaling + 0.5);
     1018        int imgXoffset = (int) (screenXoffset * imageXScaling + 0.5);
     1019        int imgYoffset = (int) (screenYoffset * imageYScaling + 0.5);
    10201020        // Now calculate the other corner of the image that we need
    10211021        // by scaling the 'target' rectangle's dimensions.
    1022         int img_x_end = img_x_offset + (int) (target.getWidth() * imageXScaling + 0.5);
    1023         int img_y_end = img_y_offset + (int) (target.getHeight() * imageYScaling + 0.5);
     1022        int imgXend = imgXoffset + (int) (target.getWidth() * imageXScaling + 0.5);
     1023        int imgYend = imgYoffset + (int) (target.getHeight() * imageYScaling + 0.5);
    10241024
    10251025        if (Main.isDebugEnabled()) {
     
    10291029                target.x, target.y,
    10301030                target.x + target.width, target.y + target.height,
    1031                 img_x_offset, img_y_offset,
    1032                 img_x_end, img_y_end,
     1031                imgXoffset, imgYoffset,
     1032                imgXend, imgYend,
    10331033                this);
    10341034        if (PROP_FADE_AMOUNT.get() != 0) {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r9997 r10001  
    840840                return tr("No gpx selected");
    841841
    842             final long offset_ms = ((long) (timezone.getHours() * 3600 * 1000)) + delta.getMilliseconds(); // in milliseconds
    843             lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, offset_ms);
     842            final long offsetMs = ((long) (timezone.getHours() * 3600 * 1000)) + delta.getMilliseconds(); // in milliseconds
     843            lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, offsetMs);
    844844
    845845            return trn("<html>Matched <b>{0}</b> of <b>{1}</b> photo to GPX track.</html>",
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r9543 r10001  
    9191        Shortcut scPrev = Shortcut.registerShortcut(
    9292                "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.DIRECT);
    93         final String APREVIOUS = "Previous Image";
     93        final String previousImage = "Previous Image";
    9494        Main.registerActionShortcut(prevAction, scPrev);
    95         btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), APREVIOUS);
    96         btnPrevious.getActionMap().put(APREVIOUS, prevAction);
     95        btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), previousImage);
     96        btnPrevious.getActionMap().put(previousImage, prevAction);
    9797        btnPrevious.setEnabled(false);
    9898
    99         final String DELETE_TEXT = tr("Remove photo from layer");
    100         ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), DELETE_TEXT);
     99        final String removePhoto = tr("Remove photo from layer");
     100        ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), removePhoto);
    101101        JButton btnDelete = new JButton(delAction);
    102102        btnDelete.setPreferredSize(buttonDim);
     
    104104                "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo from layer")), KeyEvent.VK_DELETE, Shortcut.SHIFT);
    105105        Main.registerActionShortcut(delAction, scDelete);
    106         btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), DELETE_TEXT);
    107         btnDelete.getActionMap().put(DELETE_TEXT, delAction);
     106        btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), removePhoto);
     107        btnDelete.getActionMap().put(removePhoto, delAction);
    108108
    109109        ImageAction delFromDiskAction = new ImageAction(COMMAND_REMOVE_FROM_DISK,
     
    113113        Shortcut scDeleteFromDisk = Shortcut.registerShortcut(
    114114                "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete File from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT);
    115         final String ADELFROMDISK = "Delete image file from disk";
     115        final String deleteImage = "Delete image file from disk";
    116116        Main.registerActionShortcut(delFromDiskAction, scDeleteFromDisk);
    117         btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), ADELFROMDISK);
    118         btnDeleteFromDisk.getActionMap().put(ADELFROMDISK, delFromDiskAction);
     117        btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), deleteImage);
     118        btnDeleteFromDisk.getActionMap().put(deleteImage, delFromDiskAction);
    119119
    120120        ImageAction copyPathAction = new ImageAction(COMMAND_COPY_PATH, ImageProvider.get("copy"), tr("Copy image path"));
     
    123123        Shortcut scCopyPath = Shortcut.registerShortcut(
    124124                "geoimage:copypath", tr("Geoimage: {0}", tr("Copy image path")), KeyEvent.VK_C, Shortcut.ALT_CTRL_SHIFT);
    125         final String ACOPYPATH = "Copy image path";
     125        final String copyImage = "Copy image path";
    126126        Main.registerActionShortcut(copyPathAction, scCopyPath);
    127         btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), ACOPYPATH);
    128         btnCopyPath.getActionMap().put(ACOPYPATH, copyPathAction);
     127        btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), copyImage);
     128        btnCopyPath.getActionMap().put(copyImage, copyPathAction);
    129129
    130130        ImageAction nextAction = new ImageAction(COMMAND_NEXT, ImageProvider.get("dialogs", "next"), tr("Next"));
     
    133133        Shortcut scNext = Shortcut.registerShortcut(
    134134                "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.DIRECT);
    135         final String ANEXT = "Next Image";
     135        final String nextImage = "Next Image";
    136136        Main.registerActionShortcut(nextAction, scNext);
    137         btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), ANEXT);
    138         btnNext.getActionMap().put(ANEXT, nextAction);
     137        btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), nextImage);
     138        btnNext.getActionMap().put(nextImage, nextAction);
    139139        btnNext.setEnabled(false);
    140140
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java

    r9817 r10001  
    9393         * and then stop because it has more than 50k nodes.
    9494         */
    95         final double buffer_dist = panel.getDistance();
    96         final double max_area = panel.getArea() / 10000.0 / scale;
    97         final double buffer_y = buffer_dist / 100000.0;
    98         final double buffer_x = buffer_y / scale;
     95        final double bufferDist = panel.getDistance();
     96        final double maxArea = panel.getArea() / 10000.0 / scale;
     97        final double bufferY = bufferDist / 100000.0;
     98        final double bufferX = bufferY / scale;
    9999        final int totalTicks = latcnt;
    100100        // guess if a progress bar might be useful.
    101         final boolean displayProgress = totalTicks > 2000 && buffer_y < 0.01;
     101        final boolean displayProgress = totalTicks > 2000 && bufferY < 0.01;
    102102
    103103        class CalculateDownloadArea extends PleaseWaitRunnable {
     
    126126                    return;
    127127                }
    128                 confirmAndDownloadAreas(a, max_area, panel.isDownloadOsmData(), panel.isDownloadGpxData(),
     128                confirmAndDownloadAreas(a, maxArea, panel.isDownloadOsmData(), panel.isDownloadGpxData(),
    129129                        tr("Download from OSM along this track"), progressMonitor);
    130130            }
     
    147147                tick();
    148148                LatLon c = p.getCoor();
    149                 if (previous == null || c.greatCircleDistance(previous) > buffer_dist) {
     149                if (previous == null || c.greatCircleDistance(previous) > bufferDist) {
    150150                    // we add a buffer around the point.
    151                     r.setRect(c.lon() - buffer_x, c.lat() - buffer_y, 2 * buffer_x, 2 * buffer_y);
     151                    r.setRect(c.lon() - bufferX, c.lat() - bufferY, 2 * bufferX, 2 * bufferY);
    152152                    a.add(new Area(r));
    153153                    return c;
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r9248 r10001  
    9494            /* calculate time differences in waypoints */
    9595            double time = wpt.time;
    96             boolean wpt_has_link = wpt.attr.containsKey(GpxConstants.META_LINKS);
    97             if (firstTime < 0 && wpt_has_link) {
     96            boolean wptHasLink = wpt.attr.containsKey(GpxConstants.META_LINKS);
     97            if (firstTime < 0 && wptHasLink) {
    9898                firstTime = time;
    9999                for (GpxLink oneLink : wpt.<GpxLink>getCollection(GpxConstants.META_LINKS)) {
     
    102102                }
    103103            }
    104             if (wpt_has_link) {
     104            if (wptHasLink) {
    105105                for (GpxLink oneLink : wpt.<GpxLink>getCollection(GpxConstants.META_LINKS)) {
    106106                    String uri = oneLink.uri;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/CSSColors.java

    r7509 r10001  
    99    private static final Map<String, Color> CSS_COLORS = new HashMap<>();
    1010    static {
    11         Object[][] CSSCOLORS_INIT = new Object[][] {
     11        for (Object[] pair : new Object[][] {
    1212            {"aliceblue", 0xf0f8ff},
    1313            {"antiquewhite", 0xfaebd7},
     
    157157            {"yellow", 0xffff00},
    158158            {"yellowgreen", 0x9acd32}
    159         };
    160         for (Object[] pair : CSSCOLORS_INIT) {
     159        }) {
    161160            CSS_COLORS.put((String) pair[0], new Color((Integer) pair[1]));
    162161        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r9983 r10001  
    149149            }
    150150
    151             float test_float;
     151            float testFloat;
    152152            try {
    153                 test_float = Float.parseFloat(testString);
     153                testFloat = Float.parseFloat(testString);
    154154            } catch (NumberFormatException e) {
    155155                return false;
    156156            }
    157             float prototype_float = Float.parseFloat(prototypeString);
     157            float prototypeFloat = Float.parseFloat(prototypeString);
    158158
    159159            switch (this) {
    160160            case GREATER_OR_EQUAL:
    161                 return test_float >= prototype_float;
     161                return testFloat >= prototypeFloat;
    162162            case GREATER:
    163                 return test_float > prototype_float;
     163                return testFloat > prototypeFloat;
    164164            case LESS_OR_EQUAL:
    165                 return test_float <= prototype_float;
     165                return testFloat <= prototypeFloat;
    166166            case LESS:
    167                 return test_float < prototype_float;
     167                return testFloat < prototypeFloat;
    168168            default:
    169169                throw new AssertionError();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java

    r9371 r10001  
    5656        public final float defaultMajorZIndex;
    5757
    58         LineType(String prefix, float default_major_z_index) {
     58        LineType(String prefix, float defaultMajorZindex) {
    5959            this.prefix = prefix;
    60             this.defaultMajorZIndex = default_major_z_index;
    61         }
    62     }
    63 
    64     protected LineElement(Cascade c, float default_major_z_index, BasicStroke line, Color color, BasicStroke dashesLine,
     60            this.defaultMajorZIndex = defaultMajorZindex;
     61        }
     62    }
     63
     64    protected LineElement(Cascade c, float defaultMajorZindex, BasicStroke line, Color color, BasicStroke dashesLine,
    6565            Color dashesBackground, float offset, float realWidth, boolean wayDirectionArrows) {
    66         super(c, default_major_z_index);
     66        super(c, defaultMajorZindex);
    6767        this.line = line;
    6868        this.color = color;
     
    104104    private static LineElement createImpl(Environment env, LineType type) {
    105105        Cascade c = env.mc.getCascade(env.layer);
    106         Cascade c_def = env.mc.getCascade("default");
     106        Cascade cDef = env.mc.getCascade("default");
    107107        Float width;
    108108        switch (type) {
    109109            case NORMAL:
    110                 width = getWidth(c, WIDTH, getWidth(c_def, WIDTH, null));
     110                width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null));
    111111                break;
    112112            case CASING:
    113113                Float casingWidth = c.get(type.prefix + WIDTH, null, Float.class, true);
    114114                if (casingWidth == null) {
    115                     RelativeFloat rel_casingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);
    116                     if (rel_casingWidth != null) {
    117                         casingWidth = rel_casingWidth.val / 2;
     115                    RelativeFloat relCasingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);
     116                    if (relCasingWidth != null) {
     117                        casingWidth = relCasingWidth.val / 2;
    118118                    }
    119119                }
    120120                if (casingWidth == null)
    121121                    return null;
    122                 width = getWidth(c, WIDTH, getWidth(c_def, WIDTH, null));
     122                width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null));
    123123                if (width == null) {
    124124                    width = 0f;
     
    162162            case LEFT_CASING:
    163163            case RIGHT_CASING:
    164                 Float baseWidthOnDefault = getWidth(c_def, WIDTH, null);
     164                Float baseWidthOnDefault = getWidth(cDef, WIDTH, null);
    165165                Float baseWidth = getWidth(c, WIDTH, baseWidthOnDefault);
    166166                if (baseWidth == null || baseWidth < 2f) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java

    r9371 r10001  
    9393            BoxTextElement.SIMPLE_NODE_TEXT_ELEMSTYLE);
    9494
    95     protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float default_major_z_index, RotationAngle rotationAngle) {
    96         super(c, default_major_z_index);
     95    protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle) {
     96        super(c, defaultMajorZindex);
    9797        this.mapImage = mapImage;
    9898        this.symbol = symbol;
     
    104104    }
    105105
    106     private static NodeElement create(Environment env, float default_major_z_index, boolean allowDefault) {
     106    private static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) {
    107107        Cascade c = env.mc.getCascade(env.layer);
    108108
     
    138138        if (!allowDefault && symbol == null && mapImage == null) return null;
    139139
    140         return new NodeElement(c, mapImage, symbol, default_major_z_index, rotationAngle);
     140        return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle);
    141141    }
    142142
     
    148148            return null;
    149149
    150         Cascade c_def = env.mc.getCascade("default");
    151 
    152         Float widthOnDefault = c_def.get(keys[ICON_WIDTH_IDX], null, Float.class);
     150        Cascade cDef = env.mc.getCascade("default");
     151
     152        Float widthOnDefault = cDef.get(keys[ICON_WIDTH_IDX], null, Float.class);
    153153        if (widthOnDefault != null && widthOnDefault <= 0) {
    154154            widthOnDefault = null;
     
    156156        Float widthF = getWidth(c, keys[ICON_WIDTH_IDX], widthOnDefault);
    157157
    158         Float heightOnDefault = c_def.get(keys[ICON_HEIGHT_IDX], null, Float.class);
     158        Float heightOnDefault = cDef.get(keys[ICON_HEIGHT_IDX], null, Float.class);
    159159        if (heightOnDefault != null && heightOnDefault <= 0) {
    160160            heightOnDefault = null;
     
    189189    private static Symbol createSymbol(Environment env) {
    190190        Cascade c = env.mc.getCascade(env.layer);
    191         Cascade c_def = env.mc.getCascade("default");
     191        Cascade cDef = env.mc.getCascade("default");
    192192
    193193        SymbolShape shape;
     
    216216            return null;
    217217
    218         Float sizeOnDefault = c_def.get("symbol-size", null, Float.class);
     218        Float sizeOnDefault = cDef.get("symbol-size", null, Float.class);
    219219        if (sizeOnDefault != null && sizeOnDefault <= 0) {
    220220            sizeOnDefault = null;
     
    229229            return null;
    230230
    231         Float strokeWidthOnDefault = getWidth(c_def, "symbol-stroke-width", null);
     231        Float strokeWidthOnDefault = getWidth(cDef, "symbol-stroke-width", null);
    232232        Float strokeWidth = getWidth(c, "symbol-stroke-width", strokeWidthOnDefault);
    233233
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java

    r9371 r10001  
    3535    public boolean defaultSelectedHandling;
    3636
    37     public StyleElement(float major_z_index, float z_index, float object_z_index, boolean isModifier, boolean defaultSelectedHandling) {
    38         this.majorZIndex = major_z_index;
    39         this.zIndex = z_index;
    40         this.objectZIndex = object_z_index;
     37    public StyleElement(float majorZindex, float zIndex, float objectZindex, boolean isModifier, boolean defaultSelectedHandling) {
     38        this.majorZIndex = majorZindex;
     39        this.zIndex = zIndex;
     40        this.objectZIndex = objectZindex;
    4141        this.isModifier = isModifier;
    4242        this.defaultSelectedHandling = defaultSelectedHandling;
    4343    }
    4444
    45     protected StyleElement(Cascade c, float default_major_z_index) {
    46         majorZIndex = c.get(MAJOR_Z_INDEX, default_major_z_index, Float.class);
     45    protected StyleElement(Cascade c, float defaultMajorZindex) {
     46        majorZIndex = c.get(MAJOR_Z_INDEX, defaultMajorZindex, Float.class);
    4747        zIndex = c.get(Z_INDEX, 0f, Float.class);
    4848        objectZIndex = c.get(OBJECT_Z_INDEX, 0f, Float.class);
     
    8686                return (float) MapPaintSettings.INSTANCE.getDefaultSegmentWidth();
    8787            if (relativeTo != null) {
    88                 RelativeFloat width_rel = c.get(key, null, RelativeFloat.class, true);
    89                 if (width_rel != null)
    90                     return relativeTo + width_rel.val;
     88                RelativeFloat widthRel = c.get(key, null, RelativeFloat.class, true);
     89                if (widthRel != null)
     90                    return relativeTo + widthRel.val;
    9191            }
    9292        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r9686 r10001  
    9696        // fill model with colors:
    9797        Map<String, String> colorKeyList = new TreeMap<>();
    98         Map<String, String> colorKeyList_mappaint = new TreeMap<>();
    99         Map<String, String> colorKeyList_layer = new TreeMap<>();
     98        Map<String, String> colorKeyListMappaint = new TreeMap<>();
     99        Map<String, String> colorKeyListLayer = new TreeMap<>();
    100100        for (String key : colorMap.keySet()) {
    101101            if (key.startsWith("layer ")) {
    102                 colorKeyList_layer.put(getName(key), key);
     102                colorKeyListLayer.put(getName(key), key);
    103103            } else if (key.startsWith("mappaint.")) {
    104104                // use getName(key)+key, as getName() may be ambiguous
    105                 colorKeyList_mappaint.put(getName(key)+key, key);
     105                colorKeyListMappaint.put(getName(key)+key, key);
    106106            } else {
    107107                colorKeyList.put(getName(key), key);
     
    109109        }
    110110        addColorRows(colorMap, colorKeyList);
    111         addColorRows(colorMap, colorKeyList_mappaint);
    112         addColorRows(colorMap, colorKeyList_layer);
     111        addColorRows(colorMap, colorKeyListMappaint);
     112        addColorRows(colorMap, colorKeyListLayer);
    113113        if (this.colors != null) {
    114114            this.colors.repaint();
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r9840 r10001  
    7878        if (Main.isPlatformOsx()) {
    7979            try {
    80                 Class<?> Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");
    81                 Object Oquaqua = Cquaqua.getConstructor((Class[]) null).newInstance((Object[]) null);
     80                Class<?> cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");
     81                Object oquaqua = cquaqua.getConstructor((Class[]) null).newInstance((Object[]) null);
    8282                // no exception? Then Go!
    8383                lafCombo.addItem(
    84                         new UIManager.LookAndFeelInfo(((LookAndFeel) Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")
     84                        new UIManager.LookAndFeelInfo(((LookAndFeel) oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")
    8585                );
    8686            } catch (Exception ex) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java

    r9936 r10001  
    103103    }
    104104
    105     protected static String getLocaleText(String text, String text_context, String defaultText) {
     105    protected static String getLocaleText(String text, String textContext, String defaultText) {
    106106        if (text == null) {
    107107            return defaultText;
    108         } else if (text_context != null) {
    109             return trc(text_context, fixPresetString(text));
     108        } else if (textContext != null) {
     109            return trc(textContext, fixPresetString(text));
    110110        } else {
    111111            return tr(fixPresetString(text));
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java

    r9665 r10001  
    5252        }
    5353
    54         public void setMember_expression(String member_expression) throws SAXException {
     54        public void setMember_expression(String memberExpression) throws SAXException {
    5555            try {
    5656                final SearchAction.SearchSetting searchSetting = new SearchAction.SearchSetting();
    57                 searchSetting.text = member_expression;
     57                searchSetting.text = memberExpression;
    5858                searchSetting.caseSensitive = true;
    5959                searchSetting.regexSearch = true;
  • trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java

    r9590 r10001  
    9999    public void setFileFilter(final FileFilter cff) {
    100100        FilenameFilter filter = new FilenameFilter() {
    101             public boolean accept(File Directory, String fileName) {
    102                 return cff.accept(new File(Directory.getAbsolutePath() + fileName));
     101            @Override
     102            public boolean accept(File directory, String fileName) {
     103                return cff.accept(new File(directory.getAbsolutePath() + fileName));
    103104            }
    104105        };
Note: See TracChangeset for help on using the changeset viewer.