Ignore:
Timestamp:
2010-08-29T14:55:25+02:00 (14 years ago)
Author:
jttt
Message:

cosmetics

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

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

    r3450 r3479  
    5959        /* translator note: other expressions for "purge" might be "forget", "clean", "obliterate", "prune" */
    6060        super(tr("Purge..."), "purge",  tr("Forget objects but do not delete them on server when uploading."),
    61         Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")), KeyEvent.VK_P, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT)
    62              , true);
     61                Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")), KeyEvent.VK_P, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT)
     62                , true);
    6363        putValue("help", HelpUtil.ht("/Action/Purge"));
    6464    }
     
    8181     */
    8282    protected List<OsmPrimitive> toPurgeAdditionally;
    83    
     83
    8484    @Override
    8585    public void actionPerformed(ActionEvent e) {
     
    9999            OsmPrimitive osm = toPurge.iterator().next();
    100100            for (OsmPrimitive parent: osm.getReferrers()) {
    101                 if (toPurge.contains(parent) || toPurgeChecked.contains(parent))
     101                if (toPurge.contains(parent) || toPurgeChecked.contains(parent)) {
    102102                    continue;
     103                }
    103104                if (parent instanceof Way || (parent instanceof Relation && osm.isNew())) {
    104105                    toPurgeAdditionally.add(parent);
     
    118119        // to-be-purged or of type relation.
    119120        TOP:
    120         for (OsmPrimitive child : toPurgeChecked) {
    121             if (child.isNew())
    122                 continue;
    123             for (OsmPrimitive parent : child.getReferrers()) {
    124                 if (parent instanceof Relation && !toPurgeChecked.contains(parent)) {
    125                     makeIncomplete.add(child);
    126                     continue TOP;
    127                 }
    128             }
    129         }
     121            for (OsmPrimitive child : toPurgeChecked) {
     122                if (child.isNew()) {
     123                    continue;
     124                }
     125                for (OsmPrimitive parent : child.getReferrers()) {
     126                    if (parent instanceof Relation && !toPurgeChecked.contains(parent)) {
     127                        makeIncomplete.add(child);
     128                        continue TOP;
     129                    }
     130                }
     131            }
    130132
    131133        // Add untagged way nodes. Do not add nodes that have other
     
    137139                    Way w = (Way) osm;
    138140                    NODE:
    139                     for (Node n : w.getNodes()) {
    140                         if (n.isTagged() || toPurgeChecked.contains(n))
    141                             continue;
    142                         for (OsmPrimitive ref : n.getReferrers()) {
    143                             if (ref != w && !toPurgeChecked.contains(ref))
    144                                 continue NODE;
     141                        for (Node n : w.getNodes()) {
     142                            if (n.isTagged() || toPurgeChecked.contains(n)) {
     143                                continue;
     144                            }
     145                            for (OsmPrimitive ref : n.getReferrers()) {
     146                                if (ref != w && !toPurgeChecked.contains(ref)) {
     147                                    continue NODE;
     148                                }
     149                            }
     150                            wayNodes.add(n);
    145151                        }
    146                         wayNodes.add(n);
    147                     }
    148152                }
    149153            }
     
    186190        pnl.add(new JLabel("<html>"+
    187191                tr("This operation makes JOSM forget the selected objects.<br> " +
    188                 "They will be removed from the layer, but <i>not</i> deleted<br> " +
     192                        "They will be removed from the layer, but <i>not</i> deleted<br> " +
    189193                "on the server when uploading.")+"</html>",
    190194                ImageProvider.get("purge"), JLabel.LEFT), GBC.eol().fill(GBC.HORIZONTAL));
     
    193197            pnl.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0,5,0,5));
    194198            pnl.add(new JLabel("<html>"+
    195                 tr("The following dependent objects will be purged<br> " +
    196                 "in addition to the selected objects:")+"</html>",
    197                 ImageProvider.get("warning-small"), JLabel.LEFT), GBC.eol().fill(GBC.HORIZONTAL));
     199                    tr("The following dependent objects will be purged<br> " +
     200                    "in addition to the selected objects:")+"</html>",
     201                    ImageProvider.get("warning-small"), JLabel.LEFT), GBC.eol().fill(GBC.HORIZONTAL));
    198202
    199203            Collections.sort(toPurgeAdditionally, new Comparator<OsmPrimitive>() {
     
    202206                    if (type != 0)
    203207                        return -type;
    204                     return (new Long(o1.getUniqueId())).compareTo(o2.getUniqueId());
     208                    return (Long.valueOf(o1.getUniqueId())).compareTo(o2.getUniqueId());
    205209                }
    206210            });
     
    210214                @Override
    211215                public Component getListCellRendererComponent(JList list,
    212                                               Object value,
    213                                               int index,
    214                                               boolean isSelected,
    215                                               boolean cellHasFocus) {
     216                        Object value,
     217                        int index,
     218                        boolean isSelected,
     219                        boolean cellHasFocus) {
    216220                    return super.getListCellRendererComponent(list, value, index, true, false);
    217221                }
     
    240244            pnl.add(new JLabel("<html>"+tr("Some of the objects are modified.<br> " +
    241245                    "Proceed, if these changes should be discarded."+"</html>"),
    242                         ImageProvider.get("warning-small"), JLabel.LEFT),
     246                    ImageProvider.get("warning-small"), JLabel.LEFT),
    243247                    GBC.eol().fill(GBC.HORIZONTAL));
    244248        }
  • trunk/src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java

    r3385 r3479  
    7070            throw new RuntimeException(e.getMessage(), e);
    7171        }
    72     }
    73 
    74     private long getNumber() {
    75         long result = 0;
    76         while (Character.isDigit(c)) {
    77             result = result * 10 + (c - '0');
    78             getChar();
    79         }
    80         return result;
    8172    }
    8273
Note: See TracChangeset for help on using the changeset viewer.