Changeset 6296 in josm


Ignore:
Timestamp:
2013-10-04T03:27:01+02:00 (11 years ago)
Author:
Don-vip
Message:

Sonar/Findbugs - Avoid commented-out lines of code, javadoc

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

Legend:

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

    r6265 r6296  
    672672        //
    673673        try {
    674             //CoordinateFormat format = CoordinateFormat.valueOf(Main.pref.get("coordinates"));
    675674            CoordinateFormat.setCoordinateFormat(CoordinateFormat.valueOf(Main.pref.get("coordinates")));
    676675        } catch (IllegalArgumentException iae) {
  • trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java

    r6130 r6296  
    4242public final class CreateCircleAction extends JosmAction {
    4343
     44    /**
     45     * Constructs a new {@code CreateCircleAction}.
     46     */
    4447    public CreateCircleAction() {
    4548        super(tr("Create Circle"), "createcircle", tr("Create a circle from three selected nodes."),
     
    179182                    cmds.add(new DeleteCommand(n1));
    180183                }
    181 
    182                 // or insert it
    183                 // wayToAdd.nodes.add((numberOfNodesInCircle - 1) / 2, n1);
    184184            }
    185185
  • trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java

    r6245 r6296  
    3636    public static final ArrayList<FileExporter> exporters;
    3737
    38     // add some file types only if the relevant classes are there;
     38    // add some file types only if the relevant classes are there.
    3939    // this gives us the option to painlessly drop them from the .jar
    4040    // and build JOSM versions without support for these formats
  • trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java

    r6093 r6296  
    9494
    9595    private static void pruneSuccsAndReverse(List<Integer> is) {
    96         //if (is.size() < 2) return;
    97 
    9896        HashSet<Integer> is2 = new HashSet<Integer>();
    9997        for (int i : is) {
  • trunk/src/org/openstreetmap/josm/actions/MoveAction.java

    r6084 r6296  
    4040        } else if (dir == Direction.LEFT)  {
    4141            directiontext = tr("left");
    42         } else { //dir == Direction.RIGHT) {
     42        } else {
    4343            directiontext = tr("right");
    4444        }
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r6130 r6296  
    383383        // rotate back and log the change
    384384        final Collection<Command> commands = new LinkedList<Command>();
    385         //        OrthogonalizeAction.rememberMovements.clear();
    386385        for (Node n: allNodes) {
    387386            EastNorth tmp = new EastNorth(nX.get(n), nY.get(n));
     
    448447            // sum up segments
    449448            EastNorth h = new EastNorth(0.,0.);
    450             //double lh = EN.abs(h);
    451449            EastNorth v = new EastNorth(0.,0.);
    452             //double lv = EN.abs(v);
    453450            for (int i = 0; i < nSeg; ++i) {
    454451                EastNorth segment = EN.diff(en[i+1], en[i]);
  • trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    r6248 r6296  
    228228            // Segment cannot be simplified - try shorter segments
    229229            buildSimplifiedNodeList(wnew, from, imax,threshold,simplifiedNodes);
    230             //simplifiedNodes.add(wnew.get(imax));
    231230            buildSimplifiedNodeList(wnew, imax, to, threshold,simplifiedNodes);
    232231        } else {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r6289 r6296  
    16131613                hdg-=360;
    16141614            }
    1615             //fixed=true;
    1616             //absoluteFix=true;
    16171615            customBaseHeading=hdg;
    16181616        }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java

    r6069 r6296  
    207207    protected void updateEnabledState() {
    208208        setEnabled(getEditLayer() != null);
    209         // setEnabled(Main.main.getActiveLayer() instanceof OsmDataLayer);
    210209    }
    211210
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r6246 r6296  
    944944                osm = nearest;
    945945
    946                 // Point p = e.getPoint();
    947 //              updateKeyModifiers(e); // cycleSetup called only after updateModifiers !
    948 
    949946                if (!(alt || multipleMatchesParameter)) {
    950947                    // no real cycling, just one element in cycle list
  • trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java

    r5077 r6296  
    3030    // The old role
    3131    private String oldRole;
    32     // Old value of modified;
     32    // Old value of modified
    3333    private Boolean oldModified;
    3434
  • trunk/src/org/openstreetmap/josm/command/ScaleCommand.java

    r4918 r6296  
    6969    @Override
    7070    protected void transformNodes() {
    71         // scalingFactor = 2.0;
    7271        for (Node n : nodes) {
    7372            EastNorth oldEastNorth = oldStates.get(n).eastNorth;
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r6258 r6296  
    484484                if (item.getNodeType() != Node.ELEMENT_NODE) continue;
    485485                String elementName = item.getNodeName();
    486                 //if (monitor!=null) monitor.indeterminateSubTask(elementName);
    487486                Element elem = (Element) item;
    488487
     
    684683
    685684        /**
    686          * subsititute ${expression} = expression evaluated by JavaScript
     685         * substitute ${expression} = expression evaluated by JavaScript
    687686         */
    688687        private String evalVars(String s) {
     
    691690            StringBuffer sb = new StringBuffer();
    692691            while (mr.find()) {
    693             try {
    694                 String result = engine.eval(mr.group(1)).toString();
    695                 mr.appendReplacement(sb, result);
    696             } catch (ScriptException ex) {
    697                 log("Error: Can not evaluate expression %s : %s",  mr.group(1), ex.getMessage());
    698                 //mr.appendReplacement(sb, mr.group(0));
    699             }
     692                try {
     693                    String result = engine.eval(mr.group(1)).toString();
     694                    mr.appendReplacement(sb, result);
     695                } catch (ScriptException ex) {
     696                    log("Error: Can not evaluate expression %s : %s",  mr.group(1), ex.getMessage());
     697                }
    700698            }
    701699            mr.appendTail(sb);
  • trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java

    r6171 r6296  
    6363   
    6464    static long lon2x(double lon) {
    65         //return Math.round((lon + 180.0) * QuadBuckets.WORLD_PARTS / 360.0)-1;
    6665        long ret = (long)((lon + 180.0) * WORLD_PARTS / 360.0);
    6766        if (ret == WORLD_PARTS) {
     
    7271   
    7372    static long lat2y(double lat) {
    74         //return Math.round((lat + 90.0) * QuadBuckets.WORLD_PARTS / 180.0)-1;
    7573        long ret = (long)((lat + 90.0) * WORLD_PARTS / 180.0);
    7674        if (ret == WORLD_PARTS) {
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r6206 r6296  
    148148         * PN^2 = (Axp + Byp + C)^2 / RS^2 that is the distance from P to the line
    149149         *
    150          * so if PN^2 is less than PNmin^2 (initialized to tolerance) we can reject the line;
     150         * so if PN^2 is less than PNmin^2 (initialized to tolerance) we can reject the line
    151151         * otherwise... determine if the projected poijnt lies within the bounds of the line: PR^2 -
    152152         * PN^2 <= RS^2 and PS^2 - PN^2 <= RS^2
  • trunk/src/org/openstreetmap/josm/data/imagery/GeorefImage.java

    r6248 r6296  
    148148            }
    149149            long freeMem = Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory();
    150             //Main.debug("Free Memory:           "+ (freeMem/1024/1024) +" MB");
    151150            // Notice that this value can get negative due to integer overflows
    152             //Main.debug("Img Size:              "+ (width*height*3/1024/1024) +" MB");
    153151
    154152            int multipl = alphaChannel ? 4 : 3;
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r6069 r6296  
    8080    protected void mergePrimitive(OsmPrimitive source, Collection<? extends OsmPrimitive> candidates) {
    8181        if (!source.isNew() ) {
    82             // try to merge onto a matching primitive with the same
    83             // defined id
     82            // try to merge onto a matching primitive with the same defined id
    8483            //
    8584            if (mergeById(source))
    8685                return;
    87             //if (!source.isVisible())
    88             // ignore it
    89             //    return;
    9086        } else {
    9187            // ignore deleted primitives from source
     
    10197                if (target.hasEqualSemanticAttributes(source)) {
    10298                    mergedMap.put(source.getPrimitiveId(), target.getPrimitiveId());
    103                     // copy the technical attributes from other
    104                     // version
     99                    // copy the technical attributes from other version
    105100                    target.setVisible(source.isVisible());
    106101                    target.setUser(source.getUser());
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r6248 r6296  
    11271127        if (!isNew() &&  id != other.id)
    11281128            return false;
    1129         //        if (isIncomplete() && ! other.isIncomplete() || !isIncomplete()  && other.isIncomplete())
    11301129        if (isIncomplete() ^ other.isIncomplete()) // exclusive or operator for performance (see #7159)
    11311130            return false;
  • trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java

    r6235 r6296  
    506506            QBLevel<T> next;
    507507            next = q.nextContentNode();
    508             //if (consistency_testing && (orig == next))
    509508            if (orig == next) {
    510509                abort("got same leaf back leaf: " + q.isLeaf());
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java

    r6084 r6296  
    249249        // equal semantics is valid for subclasses like {@link HistoryOsmNode} etc. too.
    250250        // So, don't enforce equality of class.
    251         //
    252         //        if (getClass() != obj.getClass())
    253         //            return false;
    254251        HistoryOsmPrimitive other = (HistoryOsmPrimitive) obj;
    255252        if (id != other.id)
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r6248 r6296  
    498498            } else {
    499499                TexturePaint texture = new TexturePaint(fillImage.getImage(),
    500                         //                        new Rectangle(polygon.xpoints[0], polygon.ypoints[0], fillImage.getWidth(), fillImage.getHeight()));
    501500                        new Rectangle(0, 0, fillImage.getWidth(), fillImage.getHeight()));
    502501                g.setPaint(texture);
     
    511510
    512511        if (text != null && isShowNames()) {
    513             /*
    514              * abort if we can't compose the label to be rendered
    515              */
     512            // abort if we can't compose the label to be rendered
    516513            if (text.labelCompositionStrategy == null) return;
    517514            String name = text.labelCompositionStrategy.compose(osm);
     
    522519            Rectangle2D nb = fontMetrics.getStringBounds(name, g); // if slow, approximate by strlen()*maxcharbounds(font)
    523520
    524             // Point2D c = getCentroid(polygon);
    525521            // Using the Centroid is Nicer for buildings like: +--------+
    526522            // but this needs to be fast.  As most houses are  |   42   |
     
    528524            // will have to do.                                    ++
    529525            // Centroids are not optimal either, just imagine a U-shaped house.
    530             // Point2D c = new Point2D.Double(pb.x + pb.width / 2.0, pb.y + pb.height / 2.0);
    531             // Rectangle2D.Double centeredNBounds =
    532             //     new Rectangle2D.Double(c.getX() - nb.getWidth()/2,
    533             //                            c.getY() - nb.getHeight()/2,
    534             //                            nb.getWidth(),
    535             //                            nb.getHeight());
    536526
    537527            Rectangle centeredNBounds = new Rectangle(pb.x + (int)((pb.width - nb.getWidth())/2.0),
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r6248 r6296  
    488488                        }
    489489                    }
    490                 } /* for(i = ... */
    491             } /* while(joined) */
     490                }
     491            }
    492492
    493493            if (nodes == null) {
     
    497497
    498498            result.add(new JoinedWay(nodes, wayIds, selected));
    499         } /* while(left != 0) */
     499        }
    500500
    501501        return result;
     
    575575        return innerWays;
    576576    }
    577 /*
    578     public List<PolyData> getInnerPolygons() {
    579         return innerPolygons;
    580     }
    581 
    582     public List<PolyData> getOuterPolygons() {
    583         return outerPolygons;
    584     }
    585 */
     577
    586578    public List<PolyData> getCombinedPolygons() {
    587579        return combinedPolygons;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java

    r6240 r6296  
    186186            return test(key, value).remove(key);
    187187        }
    188 /*
    189         DeprecationCheck testAndRemove(String key) {
    190             return test(key).remove(key);
    191         }
    192 */
     188
    193189        DeprecationCheck alternative(String key, String value) {
    194190            alternatives.add(new Tag(key, value));
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r6248 r6296  
    140140                    public void run() {
    141141                        lg.setText(fixImageLinks(content));
    142                         // lg.moveCaretPosition(0);
    143142                    }
    144143                });
  • trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java

    r6087 r6296  
    199199                setPartiallyIdentified(userName);
    200200            } else {
    201                 // same name in the preferences as JOSM already knows about;
     201                // same name in the preferences as JOSM already knows about.
    202202                // keep the state, be it partially or fully identified
    203203            }
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r6267 r6296  
    598598    }
    599599
    600     /*
    601      * Remove panel from top of MapView by class     */
     600    /**
     601     * Remove panel from top of MapView by class     
     602     */
    602603    public void removeTopPanel(Class<?> type) {
    603604        int n = leftPanel.getComponentCount();
     
    607608                leftPanel.remove(i);
    608609                leftPanel.doLayout();
    609                 //                repaint();
    610610                return;
    611611            }
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r6267 r6296  
    322322                                    oldMousePos = ms.mousePos;
    323323                                } catch (ConcurrentModificationException x) {
    324                                     //x.printStackTrace();
     324                                    Main.warn(x);
    325325                                } catch (NullPointerException x) {
    326                                     //x.printStackTrace();
     326                                    Main.warn(x);
    327327                                } finally {
    328328                                    if (ds != null) {
  • trunk/src/org/openstreetmap/josm/gui/MenuScroller.java

    r6246 r6296  
    3838public class MenuScroller {
    3939
    40     //private JMenu menu;
    4140    private JPopupMenu menu;
    4241    private Component[] menuItems;
  • trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java

    r6248 r6296  
    1919 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2020 */
    21 
    22 //package org.jdesktop.swingx;
    2321package org.openstreetmap.josm.gui;
    2422
     
    7068 * is changed, all PropertyChangeListeners are fired.
    7169 *
    72  * @author Hans Muller
     70 * @author Hans Muller - SwingX
    7371 * @see MultiSplitPane
    7472 */
    75 
    7673public class MultiSplitLayout implements LayoutManager {
    7774    private final Map<String, Component> childMap = new HashMap<String, Component>();
  • trunk/src/org/openstreetmap/josm/gui/MultiSplitPane.java

    r6084 r6296  
    1919 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2020 */
    21 
    22 //package org.jdesktop.swingx;
    2321package org.openstreetmap.josm.gui;
    2422
     
    4543 * is changed, all PropertyChangeListeners are fired.
    4644 *
    47  * @author Hans Muller
     45 * @author Hans Muller - SwingX
    4846 */
    4947public class MultiSplitPane extends JPanel {
  • trunk/src/org/openstreetmap/josm/gui/actionsupport/AlignImageryPanel.java

    r6070 r6296  
    6565            add(closeButton, GBC.std(3,1).anchor(GBC.EAST));
    6666        }
    67 //        setBorder(new EmptyBorder(12, 12, 12, 12));
    6867        setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.LOWERED), new EmptyBorder(12, 12, 12, 12)));
    6968        setBackground(new Color(224, 236, 249));
     
    7978        }
    8079    }
    81 
    8280}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r6105 r6296  
    170170        }));
    171171
    172         // activate DEL in the list of relations
    173         //displaylist.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0), "deleteRelation");
    174         //displaylist.getActionMap().put("deleteRelation", deleteAction);
    175 
    176172        InputMapUtils.unassignCtrlShiftUpDown(displaylist, JComponent.WHEN_FOCUSED);
    177173
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryTask.java

    r5903 r6296  
    110110        }
    111111
    112         // update the global changeset cache with the downloaded changesets;
     112        // update the global changeset cache with the downloaded changesets.
    113113        // this will trigger change events which views are listening to. They
    114114        // will update their views accordingly.
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r6104 r6296  
    793793                    tr("Add all objects selected in the current dataset before the first member"));
    794794            putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copystartright"));
    795             // putValue(NAME, tr("Add Selected"));
    796795            refreshEnabled();
    797796        }
     
    821820            putValue(SHORT_DESCRIPTION, tr("Add all objects selected in the current dataset after the last member"));
    822821            putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copyendright"));
    823             // putValue(NAME, tr("Add Selected"));
    824822            refreshEnabled();
    825823        }
     
    850848                    tr("Add all objects selected in the current dataset before the first selected member"));
    851849            putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copybeforecurrentright"));
    852             // putValue(NAME, tr("Add Selected"));
    853850            refreshEnabled();
    854851        }
     
    887884                    tr("Add all objects selected in the current dataset after the last selected member"));
    888885            putValue(SMALL_ICON, ImageProvider.get("dialogs/conflict", "copyaftercurrentright"));
    889             // putValue(NAME, tr("Add Selected"));
    890886            refreshEnabled();
    891887        }
     
    922918            putValue(SHORT_DESCRIPTION, tr("Remove all members referring to one of the selected objects"));
    923919            putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "deletemembers"));
    924             // putValue(NAME, tr("Remove Selected"));
    925920            updateEnabledState();
    926921        }
     
    10681063            String tooltip = tr("Move the currently selected members up");
    10691064            putValue(SMALL_ICON, ImageProvider.get("dialogs", "moveup"));
    1070             // putValue(NAME, tr("Move Up"));
    10711065            Shortcut sc = Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"),
    10721066                KeyEvent.VK_UP, Shortcut.ALT);
     
    10911085            String tooltip = tr("Move the currently selected members down");
    10921086            putValue(SMALL_ICON, ImageProvider.get("dialogs", "movedown"));
    1093             // putValue(NAME, tr("Move Down"));
    10941087            Shortcut sc = Shortcut.registerShortcut("relationeditor:movedown", tr("Relation Editor: Move Down"),
    10951088                KeyEvent.VK_DOWN, Shortcut.ALT);
     
    14471440            putValue(SHORT_DESCRIPTION, tr("Add an empty tag"));
    14481441            putValue(SMALL_ICON, ImageProvider.get("dialogs", "add"));
    1449             // putValue(NAME, tr("Cancel"));
    14501442            setEnabled(true);
    14511443        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableColumnModel.java

    r3210 r6296  
    2828        col.setResizable(true);
    2929        col.setPreferredWidth(300);
    30         // col.setCellRenderer(new OsmPrimitivRenderer());
    3130        col.setCellRenderer(new MemberTableMemberCellRenderer());
    3231        addColumn(col);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java

    r6085 r6296  
    3434        this.value = (WayConnectionType) value;
    3535        renderForeground(isSelected);
    36         //setText(value.toString());
    3736        setToolTipText(((WayConnectionType)value).getToolTip());
    3837        renderBackground(getModel(table), null, isSelected);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java

    r6093 r6296  
    660660
    661661    /**
    662      * get a node we can link against when sorting members
    663      * @param element the element we want to link against
    664      * @param linked_element already linked against element
    665      * @return the unlinked node if element is a way, the node itself if element is a node, null otherwise
    666      */
    667     /*private static Node getUnusedNode(RelationMember element, RelationMember linked_element)
    668     {
    669         Node result = null;
    670 
    671         if (element.isWay()) {
    672             Way w = element.getWay();
    673             if (linked_element.isWay()) {
    674                 Way x = linked_element.getWay();
    675                 if ((w.firstNode() == x.firstNode()) || (w.firstNode() == x.lastNode())) {
    676                     result = w.lastNode();
    677                 } else {
    678                     result = w.firstNode();
    679                 }
    680             } else if (linked_element.isNode()) {
    681                 Node m = linked_element.getNode();
    682                 if (w.firstNode() == m) {
    683                     result = w.lastNode();
    684                 } else {
    685                     result = w.firstNode();
    686                 }
    687             }
    688         } else if (element.isNode()) {
    689             Node n = element.getNode();
    690             result = n;
    691         }
    692 
    693         return result;
    694     }*/
    695 
    696 
    697     /**
    698662     * Sort the selected relation members by the way they are linked.
    699663     */
     
    770734        }
    771735    }
    772 
    773     //    private static void unconnectPreviousLink(List<WayConnectionType> con, int beg, boolean backward){
    774     //        int i = beg;
    775     //        while(true){
    776     //            WayConnectionType t = con.get(i--);
    777     //            t.isOnewayOppositeConnected = false;
    778     //            if(backward && t.isOnewayLoopBackwardPart) break;
    779     //            if(!backward && t.isOnewayLoopForwardPart) break;
    780     //        }
    781     //    }
    782 
    783736}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java

    r5630 r6296  
    100100
    101101        remaining.addAll(map.ways.keySet());
    102 
    103         /*
    104          * Clean up the maps, i.e. remove nodes from roundabouts and dead ends that
    105          * cannot be used in future. (only for performance)
    106          */
    107         //        Iterator<Map.Entry<Node,TreeSet<Integer>>> it = map.nodes.entrySet().iterator();
    108         //        while (it.hasNext()) {
    109         //            Map.Entry<Node,TreeSet<Integer>> nodeLinks = it.next();
    110         //
    111         //            if (nodeLinks.getValue().size() < 2) {
    112         //                if (nodeLinks.getValue().size() != 1) throw new AssertionError();
    113         //
    114         //                Integer d_way = nodeLinks.getValue().iterator().next();
    115         //                TreeSet<Node> d_way_nodes = map.ways.get(d_way);
    116         //                d_way_nodes.remove(nodeLinks.getKey());
    117         //
    118         //                it.remove();
    119         //                continue;
    120         //            }
    121         //        }
    122102    }
    123103
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java

    r6289 r6296  
    167167                wct.isOnewayLoopForwardPart = true;
    168168            }
    169             if (dirFW == NONE && dirBW == NONE) { //Not connected to previous
    170                 //                        unconnectPreviousLink(con, i, true);
    171                 //                        unconnectPreviousLink(con, i, false);
     169            // Not connected to previous
     170            if (dirFW == NONE && dirBW == NONE) {
    172171                wct.linkPrev = false;
    173                 if (RelationSortUtils.isOneway(m)){
     172                if (RelationSortUtils.isOneway(m)) {
    174173                    wct.isOnewayHead = true;
    175174                    lastForwardWay = i-1;
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java

    r6203 r6296  
    210210    class RemoveAction extends AbstractAction implements ListSelectionListener{
    211211        public RemoveAction() {
    212             //putValue(NAME, tr("Remove"));
    213212            putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
    214213            putValue(SHORT_DESCRIPTION, tr("Remove the currently selected bookmarks"));
     
    237236    class RenameAction extends AbstractAction implements ListSelectionListener{
    238237        public RenameAction() {
    239             //putValue(NAME, tr("Remove"));
    240238            putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit"));
    241239            putValue(SHORT_DESCRIPTION, tr("Rename the currently selected bookmark"));
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java

    r6084 r6296  
    339339
    340340    public static boolean isAutorunEnabled() {
    341         //String autorun=Main.pref.get("download.autorun",null);
    342         //boolean expert=ExpertToggleAction.isExpert();
    343         //return (autorun==null && !expert) || "true".equals(autorun) ;
    344341        return Main.pref.getBoolean("download.autorun",false);
    345342    }
     
    352349
    353350    /**
    354      * Replies the currently selected download area. May be null, if no download area is selected
    355      * yet.
     351     * Replies the currently selected download area. May be null, if no download area is selected yet.
    356352     */
    357353    public Bounds getSelectedDownloadArea() {
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r6248 r6296  
    471471    class ReloadAction extends AbstractAction {
    472472        public ReloadAction() {
    473             //putValue(NAME, tr("Reload"));
    474473            putValue(SHORT_DESCRIPTION, tr("Reload the current help page"));
    475474            putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh"));
     
    487486            this.history = history;
    488487            history.addObserver(this);
    489             //putValue(NAME, tr("Back"));
    490488            putValue(SHORT_DESCRIPTION, tr("Go to the previous page"));
    491489            putValue(SMALL_ICON, ImageProvider.get("help", "previous"));
     
    508506            this.history = history;
    509507            history.addObserver(this);
    510             //putValue(NAME, tr("Forward"));
    511508            putValue(SHORT_DESCRIPTION, tr("Go to the next page"));
    512509            putValue(SMALL_ICON, ImageProvider.get("help", "next"));
     
    526523    class HomeAction extends AbstractAction  {
    527524        public HomeAction() {
    528             //putValue(NAME, tr("Home"));
    529525            putValue(SHORT_DESCRIPTION, tr("Go to the JOSM help home page"));
    530526            putValue(SMALL_ICON, ImageProvider.get("help", "home"));
  • trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java

    r6143 r6296  
    119119        if(ret == null)
    120120            return ret;
    121         ret = "/" + ret + Main.pref.get("help.pathhelp", "/Help").replaceAll("^\\/+", ""); // remove leading /;
     121        ret = "/" + ret + Main.pref.get("help.pathhelp", "/Help").replaceAll("^\\/+", ""); // remove leading /
    122122        return ret.replaceAll("\\/+", "\\/"); // collapse sequences of //
    123123    }
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java

    r6267 r6296  
    302302    class RefreshAction extends AbstractAction {
    303303        public RefreshAction() {
    304             //putValue(NAME, tr("Reload"));
    305304            putValue(SHORT_DESCRIPTION, tr("Load the list of your open changesets from the server"));
    306305            putValue(SMALL_ICON, ImageProvider.get("dialogs", "refresh"));
     
    320319    class CloseChangesetAction extends AbstractAction implements ItemListener{
    321320        public CloseChangesetAction() {
    322             //putValue(NAME, tr("Close"));
    323321            putValue(SMALL_ICON, ImageProvider.get("closechangeset"));
    324322            putValue(SHORT_DESCRIPTION, tr("Close the currently selected open changeset"));
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r6258 r6296  
    497497
    498498        @Override
    499         public void windowOpened(WindowEvent e) {
    500             //startUserInput();
    501         }
    502 
    503         @Override
    504499        public void windowActivated(WindowEvent arg0) {
    505500            if (tpConfigPanels.getSelectedIndex() == 0) {
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r6248 r6296  
    383383        Area a = data.getDataSourceArea();
    384384
    385         // copy the merged layer's data source info;
    386         // only add source rectangles if they are not contained in the
    387         // layer already.
     385        // copy the merged layer's data source info.
     386        // only add source rectangles if they are not contained in the layer already.
    388387        for (DataSource src : from.dataSources) {
    389388            if (a == null || !a.contains(src.bounds.asRect())) {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r6248 r6296  
    11// License: GPL. See LICENSE file for details.
    2 // Copyright 2007 by Christian Gallioz (aka khris78)
    3 // Parts of code from Geotagged plugin (by Rob Neild)
    4 
    52package org.openstreetmap.josm.gui.layer.geoimage;
    63
     
    8178import org.xml.sax.SAXException;
    8279
    83 /** This class displays the window to select the GPX file and the offset (timezone + delta).
     80/**
     81 * This class displays the window to select the GPX file and the offset (timezone + delta).
    8482 * Then it correlates the images of the layer with that GPX file.
    8583 */
     
    541539        cbShowThumbs = new JCheckBox(tr("Show Thumbnail images on the map"), ticked);
    542540        cbShowThumbs.setEnabled(!yLayer.thumbsLoaded);
    543         /*cbShowThumbs.addItemListener(new ItemListener() {
    544             public void itemStateChanged(ItemEvent e) {
    545                 if (e.getStateChange() == ItemEvent.SELECTED) {
    546                     yLayer.loadThumbs();
    547                 } else {
    548                 }
    549             }
    550         });*/
    551541
    552542        int y=0;
     
    10511041            timezone = (double)Math.round(tz * 2)/2; // hours, rounded to one decimal place
    10521042            delta = Math.round(diff - timezone*60*60); // seconds
    1053 
    1054             /*Main.debug("phto " + firstExifDate);
    1055             Main.debug("gpx  " + firstGPXDate);
    1056             Main.debug("diff " + diff);
    1057             Main.debug("difh " + diffInH);
    1058             Main.debug("days " + dayOffset);
    1059             Main.debug("time " + tz);
    1060             Main.debug("fix  " + timezone);
    1061             Main.debug("offt " + delta);*/
    10621043
    10631044            tfTimezone.getDocument().removeDocumentListener(statusBarUpdater);
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r6292 r6296  
    11// License: GPL. See LICENSE file for details.
    2 // Copyright 2007 by Christian Gallioz (aka khris78)
    3 // Parts of code from Geotagged plugin (by Rob Neild)
    4 // and the core JOSM source code (by Immanuel Scholz and others)
    52package org.openstreetmap.josm.gui.layer.geoimage;
    63
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java

    r6090 r6296  
    11// License: GPL. See LICENSE file for details.
    2 // Copyright 2007 by Christian Gallioz (aka khris78)
    3 
    42package org.openstreetmap.josm.gui.layer.geoimage;
    53
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java

    r6084 r6296  
    11// License: GPL. See LICENSE file for details.
    2 // Copyright 2007 by Christian Gallioz (aka khris78)
    3 // Parts of code from Geotagged plugin (by Rob Neild)
    4 // and the core JOSM source code (by Immanuel Scholz and others)
    5 
    62package org.openstreetmap.josm.gui.layer.geoimage;
    73
     
    139import org.openstreetmap.josm.data.coor.LatLon;
    1410
    15 /*
     11/**
    1612 * Stores info about each image
    1713 */
    18 
    1914final public class ImageEntry implements Comparable<ImageEntry>, Cloneable {
    2015    private File file;
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r6084 r6296  
    11// License: GPL. See LICENSE file for details.
    2 // Copyright 2007 by Christian Gallioz (aka khris78)
    3 // Parts of code from Geotagged plugin (by Rob Neild)
    4 // and the core JOSM source code (by Immanuel Scholz and others)
    5 
    62package org.openstreetmap.josm.gui.layer.geoimage;
    73
     
    5652    public static ImageViewerDialog getInstance() {
    5753        if (dialog == null)
    58             throw new AssertionError(); // a new instance needs to be created first
     54            throw new AssertionError("a new instance needs to be created first");
    5955        return dialog;
    6056    }
     
    6864        tr("Tool: {0}", tr("Display geotagged images")), KeyEvent.VK_Y, Shortcut.DIRECT), 200);
    6965
    70         /* Don't show a detached dialog right from the start. */
     66        // Don't show a detached dialog right from the start.
    7167        if (isShowing && !isDocked) {
    7268            setIsShowing(false);
     
    219215    public void displayImage(GeoImageLayer layer, ImageEntry entry) {
    220216        synchronized(this) {
    221             //            if (currentLayer == layer && currentEntry == entry) {
    222             //                repaint();
    223             //                return;
    224             //            }                     TODO: pop up image dialog but don't load image again
     217            // TODO: pop up image dialog but don't load image again
    225218
    226219            if (centerView && Main.isDisplayingMapView() && entry != null && entry.getPos() != null) {
     
    245238                osd.append(tr("\nDirection {0}\u00b0", Math.round(entry.getExifImgDir())));
    246239            }
    247             //if (entry.getPos()  != null) {
    248             //    osd.append(tr("\nlat: {0}, lon: {1}", Double.toString(entry.getPos().lat()), Double.toString(entry.getPos().lon())));
    249             //}
    250             //osd.append(tr("\nfile mtime: {0}", Long.toString(entry.getFile().lastModified())));
    251240            DateFormat dtf = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
    252241            if (entry.getExifTime() != null) {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/JpegFileFilter.java

    r2711 r6296  
    11// License: GPL. See LICENSE file for details.
    2 // Copyright 2007 by Christian Gallioz (aka khris78)
    3 // Parts of code from Geotagged plugin (by Rob Neild)
    4 // and the core JOSM source code (by Immanuel Scholz and others)
    5 
    62package org.openstreetmap.josm.gui.layer.geoimage;
    73
    84import static org.openstreetmap.josm.tools.I18n.tr;
    95
    10 //import javax.swing.JFileChooser;
    116import java.io.File;
    127
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java

    r6084 r6296  
    3838    private Timer timer = null;
    3939    private double animationInterval = 0.0; // seconds
    40     // private Rectangle audioTracer = null;
    41     // private Icon audioTracerIcon = null;
    4240    static private PlayHeadMarker playHead = null;
    4341    private MapMode oldMode = null;
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java

    r6084 r6296  
    387387        public TestAccessTokenAction() {
    388388            putValue(NAME, tr("Test Access Token"));
    389             /* putValue(SHORT_DESCRIPTION, ""); */
    390389            putValue(SMALL_ICON, ImageProvider.get("about"));
    391390        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r6248 r6296  
    824824                @Override
    825825                public Dimension preferredLayoutSize(Container parent) {
    826                     Dimension l = new Dimension(200, 200); //left.getPreferredSize();
    827                     Dimension r = new Dimension(200, 200); //right.getPreferredSize();
     826                    Dimension l = new Dimension(200, 200);
     827                    Dimension r = new Dimension(200, 200);
    828828                    return new Dimension(l.width+r.width+10+buttons.getPreferredSize().width,Math.max(l.height, r.height));
    829829                }
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

    r6248 r6296  
    246246            log.append(CustomConfigurator.getLog());
    247247        }
    248         //try { Main.pref.save();  } catch (IOException ex) { }
    249248        log.append("</html>");
    250249        String msg = log.toString().replace("\n", "<br/>");
     
    253252                + "You can reject preferences changes by pressing \"Cancel\" in preferences dialog <br/>"
    254253                + "To activate some changes JOSM restart may be needed.</html>"), msg).showDialog();
    255 
    256         //JOptionPane.showMessageDialog(Main.parent,
    257         //   tr("Installed plugins and some changes in preferences will start to work after JOSM restart"), tr("Warning"), JOptionPane.WARNING_MESSAGE);
    258254
    259255        readPreferences(tmpPrefs);
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java

    r6084 r6296  
    5151    @Override
    5252    public void addGui(PreferenceTabbedPane gui) {
    53         //gui.display.setPreferredSize(new Dimension(400,600));
    5453        gpxPanel = new GPXSettingsPanel();
    5554        gui.addValidationListener(gpxPanel);
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r6087 r6296  
    109109    }
    110110
     111    /**
     112     * Constructs a new {@code OsmApiUrlInputPanel}.
     113     */
    111114    public OsmApiUrlInputPanel() {
    112115        build();
     
    152155                OsmApi.getOsmApi().initialize(null);
    153156            } catch (Exception x) {
    154                 // ignore;
     157                Main.warn(x);
    155158            }
    156159        }
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java

    r6248 r6296  
    368368    protected void init() {
    369369        setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    370         //setCellSelectionEnabled(true);
    371370        setRowSelectionAllowed(true);
    372371        setColumnSelectionAllowed(true);
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

    r6248 r6296  
    957957                    try {
    958958                        Method method = Class.forName(class_method[0]).getMethod(class_method[1]);
    959                         // Check method is public static String[] methodName();
     959                        // Check method is public static String[] methodName()
    960960                        int mod = method.getModifiers();
    961961                        if (Modifier.isPublic(mod) && Modifier.isStatic(mod)
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java

    r6288 r6296  
    119119                for (Object value : possibleValues) {
    120120                    if (value != null) {
    121                         // These two lines work with a "classic" renderer,
     121                        // With a "classic" renderer, we could call setPrototypeDisplayValue(value) + getPreferredSize()
    122122                        // but not with TaggingPreset custom renderer that return a dummy height if index is equal to -1
    123                         //setPrototypeDisplayValue(value);
    124                         //Dimension dim = getPreferredSize();
    125                        
    126123                        // So we explicitely call the renderer by simulating a correct index for the current value
    127124                        Component c = getRenderer().getListCellRendererComponent(list, value, i, true, true);
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r6287 r6296  
    239239
    240240            // checksum check:
    241             // the bytes between the $ and the * are xored;
     241            // the bytes between the $ and the * are xored
    242242            // if there is no * or other meanities it will throw
    243243            // and result in a malformed packet.
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r6142 r6296  
    168168
    169169            private static final long serialVersionUID = 1L;
    170             ///private final DefaultCellEditor textEditor = new DefaultCellEditor( new JTextField() );
    171170
    172171            @Override
     
    288287    }
    289288
    290      /*
     289    /**
    291290     * parse addtags parameters Example URL (part):
    292291     * addtags=wikipedia:de%3DResidenzschloss Dresden|name:en%3DDresden Castle
  • trunk/src/org/openstreetmap/josm/plugins/PluginListParser.java

    r6085 r6296  
    6565            String url = null;
    6666            StringBuilder manifest = new StringBuilder();
    67             /*
    68             code structure:
    69                 for () {
    70                     A;
    71                     B;
    72                     C;
    73                 }
    74                 B;
    75              */
    7667            for (String line = r.readLine(); line != null; line = r.readLine()) {
    7768                if (line.startsWith("\t")) {
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r6295 r6296  
    272272                                && yoff + SNAKE_LIMIT <= y && y < ylim)
    273273                        {
    274                             /* We have a good enough best diagonal;
    275                now insist that it end with a significant snake.  */
     274                            /* We have a good enough best diagonal.
     275                               now insist that it end with a significant snake.  */
    276276                            int k;
    277277
     
    305305                                && yoff < y && y <= ylim - SNAKE_LIMIT)
    306306                        {
    307                             /* We have a good enough best diagonal;
    308                now insist that it end with a significant snake.  */
     307                            /* We have a good enough best diagonal.
     308                               now insist that it end with a significant snake.  */
    309309                            int k;
    310310
     
    363363            int d = diag (xoff, xlim, yoff, ylim);
    364364            int c = cost;
    365             //int f = fdiag[fdiagoff + d];
    366365            int b = bdiag[bdiagoff + d];
    367366
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r6246 r6296  
    498498            }
    499499
    500             //order points so p1.lat <= p2.lat;
     500            //order points so p1.lat <= p2.lat
    501501            if (newPoint.getEastNorth().getY() > oldPoint.getEastNorth().getY()) {
    502502                p1 = oldPoint;
Note: See TracChangeset for help on using the changeset viewer.