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


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

cosmetics

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

Legend:

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

    r3444 r3479  
    654654            if (map  != null) {
    655655                newToggleDlgWidth = Integer.toString(map.getToggleDlgWidth());
    656                 if (newToggleDlgWidth.equals(Integer.toString(map.DEF_TOGGLE_DLG_WIDTH))) {
     656                if (newToggleDlgWidth.equals(Integer.toString(MapFrame.DEF_TOGGLE_DLG_WIDTH))) {
    657657                    newToggleDlgWidth = "";
    658658                }
  • 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
  • trunk/src/org/openstreetmap/josm/command/PseudoCommand.java

    r3262 r3479  
    33
    44import java.util.Collection;
    5 import java.util.HashMap;
    6 import java.util.Map;
    7 
    8 import javax.swing.tree.DefaultMutableTreeNode;
    9 import javax.swing.tree.MutableTreeNode;
    105
    116import org.openstreetmap.josm.data.osm.OsmPrimitive;
    12 import org.openstreetmap.josm.data.osm.PrimitiveData;
    137
    148/**
  • trunk/src/org/openstreetmap/josm/command/PurgeCommand.java

    r3431 r3479  
    104104                    PrimitiveData empty;
    105105                    switch(osm.getType()) {
    106                         case NODE: empty = new NodeData(); break;
    107                         case WAY: empty = new WayData(); break;
    108                         case RELATION: empty = new RelationData(); break;
    109                         default: throw new AssertionError();
     106                    case NODE: empty = new NodeData(); break;
     107                    case WAY: empty = new WayData(); break;
     108                    case RELATION: empty = new RelationData(); break;
     109                    default: throw new AssertionError();
    110110                    }
    111111                    empty.setId(osm.getUniqueId());
     
    154154         */
    155155        outer:
    156         for (Iterator<OsmPrimitive> it = in.iterator(); it.hasNext();) {
    157             OsmPrimitive u = it.next();
    158             if (u instanceof Node) {
    159                 Node n = (Node) u;
    160                 for (OsmPrimitive ref : n.getReferrers()) {
    161                     if (ref instanceof Way && in.contains(ref))
    162                         continue outer;
    163                 }
    164                 it.remove();
    165                 out.add(n);
    166             }
    167         }
     156            for (Iterator<OsmPrimitive> it = in.iterator(); it.hasNext();) {
     157                OsmPrimitive u = it.next();
     158                if (u instanceof Node) {
     159                    Node n = (Node) u;
     160                    for (OsmPrimitive ref : n.getReferrers()) {
     161                        if (ref instanceof Way && in.contains(ref)) {
     162                            continue outer;
     163                        }
     164                    }
     165                    it.remove();
     166                    out.add(n);
     167                }
     168            }
    168169
    169170        /**
     
    171172         */
    172173        top:
    173         while (!in.isEmpty()) {
    174             for (Iterator<OsmPrimitive> it = in.iterator(); it.hasNext();) {
    175                 OsmPrimitive u = it.next();
    176                 if (u instanceof Way) {
    177                     Way w = (Way) u;
    178                     it.remove();
    179                     for (Node n : w.getNodes()) {
    180                         if (in.contains(n)) {
    181                             in.remove(n);
    182                             out.add(n);
     174            while (!in.isEmpty()) {
     175                for (Iterator<OsmPrimitive> it = in.iterator(); it.hasNext();) {
     176                    OsmPrimitive u = it.next();
     177                    if (u instanceof Way) {
     178                        Way w = (Way) u;
     179                        it.remove();
     180                        for (Node n : w.getNodes()) {
     181                            if (in.contains(n)) {
     182                                in.remove(n);
     183                                out.add(n);
     184                            }
    183185                        }
    184                     }
    185                     out.add(w);
    186                     continue top;
    187                 }
    188             }
    189             break; // no more ways left
    190         }
    191 
    192         /**
    193          * Rest are relations. Do topological sorting on a DAG where each
    194          * arrow points from child to parent. (Because it is faster to
    195          * loop over getReferrers() than getMembers().)
    196          */
    197         Set<Relation> inR = (Set) in;
    198         Set<Relation> childlessR = new HashSet<Relation>();
    199         List<Relation> outR = new ArrayList<Relation>(inR.size());
    200 
    201         HashMap<Relation, Integer> numChilds = new HashMap<Relation, Integer>();
    202 
    203         // calculate initial number of childs
    204         for (Relation r : inR) {
    205             numChilds.put(r, 0);
    206         }
    207         for (Relation r : inR) {
    208             for (OsmPrimitive parent : r.getReferrers()) {
    209                 if (!(parent instanceof Relation))
    210                     throw new AssertionError();
    211                 Integer i = numChilds.get((Relation)parent);
    212                 if (i != null) {
    213                     numChilds.put((Relation)parent, i+1);
    214                 }
    215             }
    216         }
    217         for (Relation r : inR) {
    218             if (numChilds.get(r).equals(0)) {
    219                 childlessR.add(r);
    220             }
    221         }
    222 
    223         while (!childlessR.isEmpty()) {
    224             // Identify one childless Relation and
    225             // let it virtually die. This makes other
    226             // relations childless.
    227             Iterator<Relation> it  = childlessR.iterator();
    228             Relation next = it.next();
    229             it.remove();
    230             outR.add(next);
    231 
    232             for (OsmPrimitive parentPrim : next.getReferrers()) {
    233                 Relation parent = (Relation) parentPrim;
    234                 Integer i = numChilds.get(parent);
    235                 if (i != null) {
    236                     numChilds.put(parent, i-1);
    237                     if (i-1 == 0) {
    238                         childlessR.add(parent);
    239                     }
    240                 }
    241             }
    242         }
    243 
    244         if (outR.size() != inR.size())
    245             throw new AssertionError("topo sort algorithm failed");
    246 
    247         out.addAll(outR);
    248 
    249         return out;
    250     }
    251    
     186                        out.add(w);
     187                        continue top;
     188                    }
     189                }
     190                break; // no more ways left
     191            }
     192
     193            /**
     194             * Rest are relations. Do topological sorting on a DAG where each
     195             * arrow points from child to parent. (Because it is faster to
     196             * loop over getReferrers() than getMembers().)
     197             */
     198            Set<Relation> inR = (Set) in;
     199            Set<Relation> childlessR = new HashSet<Relation>();
     200            List<Relation> outR = new ArrayList<Relation>(inR.size());
     201
     202            HashMap<Relation, Integer> numChilds = new HashMap<Relation, Integer>();
     203
     204            // calculate initial number of childs
     205            for (Relation r : inR) {
     206                numChilds.put(r, 0);
     207            }
     208            for (Relation r : inR) {
     209                for (OsmPrimitive parent : r.getReferrers()) {
     210                    if (!(parent instanceof Relation))
     211                        throw new AssertionError();
     212                    Integer i = numChilds.get(parent);
     213                    if (i != null) {
     214                        numChilds.put((Relation)parent, i+1);
     215                    }
     216                }
     217            }
     218            for (Relation r : inR) {
     219                if (numChilds.get(r).equals(0)) {
     220                    childlessR.add(r);
     221                }
     222            }
     223
     224            while (!childlessR.isEmpty()) {
     225                // Identify one childless Relation and
     226                // let it virtually die. This makes other
     227                // relations childless.
     228                Iterator<Relation> it  = childlessR.iterator();
     229                Relation next = it.next();
     230                it.remove();
     231                outR.add(next);
     232
     233                for (OsmPrimitive parentPrim : next.getReferrers()) {
     234                    Relation parent = (Relation) parentPrim;
     235                    Integer i = numChilds.get(parent);
     236                    if (i != null) {
     237                        numChilds.put(parent, i-1);
     238                        if (i-1 == 0) {
     239                            childlessR.add(parent);
     240                        }
     241                    }
     242                }
     243            }
     244
     245            if (outR.size() != inR.size())
     246                throw new AssertionError("topo sort algorithm failed");
     247
     248            out.addAll(outR);
     249
     250            return out;
     251    }
     252
    252253    @Override
    253254    public Object getDescription() {
  • trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java

    r3385 r3479  
    153153                    } else if (primitive instanceof Relation) {
    154154                        clone = new Relation((Relation)primitive);
    155                     }
     155                    } else
     156                        throw new AssertionError();
    156157
    157158                    // use this structure to remember keys that have been set already so that
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r3275 r3479  
    55import java.util.Iterator;
    66import java.util.LinkedList;
    7 import java.util.Stack;
    87
    98import org.openstreetmap.josm.Main;
     
    7978            c.undoCommand();
    8079            redoCommands.addFirst(c);
    81             if (commands.isEmpty())
     80            if (commands.isEmpty()) {
    8281                break;
     82            }
    8383        }
    8484        fireCommandsChanged();
     
    107107            c.executeCommand();
    108108            commands.add(c);
    109             if (redoCommands.isEmpty())
     109            if (redoCommands.isEmpty()) {
    110110                break;
     111            }
    111112        }
    112113        fireCommandsChanged();
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java

    r3425 r3479  
    66import oauth.signpost.basic.DefaultOAuthConsumer;
    77import oauth.signpost.basic.DefaultOAuthProvider;
    8 import oauth.signpost.signature.HmacSha1MessageSigner;
    98
    109import org.openstreetmap.josm.data.Preferences;
     
    1312/**
    1413 * This class manages a set of OAuth parameters.
    15  * 
     14 *
    1615 */
    1716public class OAuthParameters {
     
    2726     * Replies a set of default parameters for a consumer accessing the standard OSM server
    2827     * at http://api.openstreetmap.org/api
    29      * 
     28     *
    3029     * @return a set of default parameters
    3130     */
     
    4241    /**
    4342     * Replies a set of parameters as defined in the preferences.
    44      * 
     43     *
    4544     * @param pref the preferences
    4645     * @return the parameters
     
    6160    /**
    6261     * Clears the preferences for OAuth parameters
    63      * 
     62     *
    6463     * @param pref the preferences in which keys related to OAuth parameters are
    6564     * removed
     
    8483    /**
    8584     * Creates a clone of the parameters in <code>other</code>.
    86      * 
     85     *
    8786     * @param other the other parameters. Must not be null.
    8887     * @throws IllegalArgumentException thrown if other is null
     
    130129    /**
    131130     * Builds an {@see OAuthConsumer} based on these parameters
    132      * 
     131     *
    133132     * @return the consumer
    134133     */
     
    140139    /**
    141140     * Builds an {@see OAuthProvider} based on these parameters and a OAuth consumer <code>consumer</code>.
    142      * 
     141     *
    143142     * @param consumer the consumer. Must not be null.
    144143     * @return the provider
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r3471 r3479  
    326326     */
    327327    public void fireSelectionChanged(){
    328         synchronized (selListeners) {
    329             Collection<? extends OsmPrimitive> currentSelection = getSelected();
    330             for (SelectionChangedListener l : selListeners) {
    331                 l.selectionChanged(currentSelection);
    332             }
     328        Collection<? extends OsmPrimitive> currentSelection = getSelected();
     329        for (SelectionChangedListener l : selListeners) {
     330            l.selectionChanged(currentSelection);
    333331        }
    334332    }
  • trunk/src/org/openstreetmap/josm/data/osm/Tag.java

    r3083 r3479  
    6868    }
    6969
    70     @Override
    71     public Tag clone() {
    72         return new Tag(this);
    73     }
    74 
    7570    /**
    7671     * Replies true if the key of this tag is equal to <code>key</code>.
  • trunk/src/org/openstreetmap/josm/gui/SplashScreen.java

    r3181 r3479  
    55
    66import java.awt.Color;
    7 import java.awt.Dimension;
    87import java.awt.Font;
    98import java.awt.GridBagConstraints;
    109import java.awt.GridBagLayout;
    1110import java.awt.Insets;
    12 import java.awt.Toolkit;
    1311import java.awt.event.MouseAdapter;
    1412import java.awt.event.MouseEvent;
  • trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java

    r3105 r3479  
    2424import java.util.Set;
    2525import java.util.Vector;
    26 import java.util.logging.Logger;
    2726import java.util.regex.Matcher;
    2827import java.util.regex.Pattern;
     
    5554 * TileSelectionBBoxChooser allows to select a bounding box (i.e. for downloading) based
    5655 * on OSM tile numbers.
    57  * 
     56 *
    5857 * TileSelectionBBoxChooser can be embedded as component in a Swing container. Example:
    5958 * <pre>
     
    7069 *        }
    7170 *    });
    72  * 
     71 *
    7372 *    // init the chooser with a bounding box
    7473 *    chooser.setBoundingBox(....);
    75  * 
     74 *
    7675 *    f.setVisible(true);
    7776 * </pre>
    7877 */
    7978public class TileSelectionBBoxChooser extends JPanel implements BBoxChooser{
    80 
    81     static private final Logger logger = Logger.getLogger(TileSelectionBBoxChooser.class.getName());
    8279
    8380    /** the current bounding box */
     
    129126    /**
    130127     * Replies the current bounding box. null, if no valid bounding box is currently selected.
    131      * 
     128     *
    132129     */
    133130    public Bounds getBoundingBox() {
     
    137134    /**
    138135     * Sets the current bounding box.
    139      * 
     136     *
    140137     * @param bbox the bounding box. null, if this widget isn't initialized with a bounding box
    141138     */
     
    162159    /**
    163160     * Computes the bounding box given a tile grid.
    164      * 
     161     *
    165162     * @param tb the description of the tile grid
    166163     * @return the bounding box
     
    177174    /**
    178175     * Replies lat/lon of the north/west-corner of a tile at a specific zoom level
    179      * 
     176     *
    180177     * @param tile  the tile address (x,y)
    181178     * @param zoom the zoom level
     
    205202    /**
    206203     * A panel for describing a rectangular area of OSM tiles at a given zoom level.
    207      * 
     204     *
    208205     * The panel emits PropertyChangeEvents for the property {@see TileGridInputPanel#TILE_BOUNDS_PROP}
    209206     * when the user successfully enters a valid tile grid specification.
     
    572569    /**
    573570     * Validates the x- or y-coordinate of a tile at a given zoom level.
    574      * 
     571     *
    575572     */
    576573    static private class TileCoordinateValidator extends AbstractTextComponentValidator {
     
    653650     */
    654651    static private class TileBoundsMapView extends JMapViewer {
    655         private Bounds bbox;
    656652        private Point min;
    657653        private Point max;
     
    662658
    663659        public void setBoundingBox(Bounds bbox){
    664             this.bbox = bbox;
    665660            if (bbox == null) {
    666661                min = null;
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java

    r3210 r3479  
    3535import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
    3636import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
    37 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
    3837import org.openstreetmap.josm.tools.ImageProvider;
    3938
  • trunk/src/org/openstreetmap/josm/gui/dialogs/CommandListMutableTreeNode.java

    r3262 r3479  
    44import javax.swing.tree.DefaultMutableTreeNode;
    55
    6 import org.openstreetmap.josm.command.Command;
    76import org.openstreetmap.josm.command.PseudoCommand;
    87
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java

    r3363 r3479  
    22package org.openstreetmap.josm.gui.dialogs;
    33
    4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    54import static org.openstreetmap.josm.tools.I18n.tr;
    65
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java

    r3083 r3479  
    439439        private JMultilineLabel lblMessage;
    440440        private Changeset current;
    441         private DownloadAction actDownload;
    442441
    443442        protected void build() {
     
    447446            );
    448447            add(lblMessage);
    449             add(new JButton(actDownload = new DownloadAction()));
     448            add(new JButton(new DownloadAction()));
    450449
    451450        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberRoleCellEditor.java

    r3214 r3479  
    99import javax.swing.table.TableCellEditor;
    1010
    11 import org.openstreetmap.josm.Main;
    1211import org.openstreetmap.josm.data.osm.DataSet;
    1312import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
    14 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
    1513import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
    1614
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java

    r3083 r3479  
    4242    private JCheckBox cbReadFull;
    4343    private EditAction editAction;
    44     private final GenericRelationEditor relationEditor;
    4544
    4645    /**
     
    7069
    7170    public ReferringRelationsBrowser(OsmDataLayer layer, ReferringRelationsBrowserModel model, GenericRelationEditor relationEditor) {
    72         this.relationEditor = relationEditor;
    7371        this.model = model;
    7472        this.layer = layer;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java

    r3200 r3479  
    22package org.openstreetmap.josm.gui.dialogs.relation;
    33
    4 import java.awt.Dimension;
    54import java.awt.Point;
    6 import java.awt.Toolkit;
    75import java.awt.event.WindowAdapter;
    86import java.awt.event.WindowEvent;
     
    235233    protected boolean hasEditorWithCloseUpperLeftCorner(Point p, RelationEditor thisEditor) {
    236234        for (RelationEditor editor: openDialogs.values()) {
    237             if (editor == thisEditor)
     235            if (editor == thisEditor) {
    238236                continue;
     237            }
    239238            Point corner = editor.getLocation();
    240239            if (p.x >= corner.x -5 && corner.x + 5 >= p.x
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java

    r2990 r3479  
    3434    /** The image currently displayed */
    3535    private Image image = null;
    36     private Image image_c = null;
    3736
    3837    /** The image currently displayed */
    3938    private boolean errorLoading = false;
    40     private boolean errorLoading_c = false;
    4139
    4240    /** The rectangle (in image coordinates) of the image that is visible. This rectangle is calculated
    4341     * each time the zoom is modified */
    4442    private Rectangle visibleRect = null;
    45     private Rectangle visibleRect_c = null;
    4643
    4744    /** When a selection is done, the rectangle of the selection (in image coordinates) */
  • trunk/src/org/openstreetmap/josm/gui/preferences/StyleSourceEditor.java

    r3474 r3479  
    773773                    r = new InputStreamReader(stream);
    774774                }
    775                 BufferedReader reader = new BufferedReader(r);
     775                reader = new BufferedReader(r);
    776776
    777777                String line;
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r3385 r3479  
    118118            AutoCompletionListItem bestItem = null;
    119119            for (int i = 0, n = model.getSize(); i < n; i++) {
    120                 AutoCompletionListItem currentItem = (AutoCompletionListItem) model.getElementAt(i);;
     120                AutoCompletionListItem currentItem = (AutoCompletionListItem) model.getElementAt(i);
    121121                if (currentItem.getValue().startsWith(pattern)) {
    122122                    if (bestItem == null || currentItem.getPriority().compareTo(bestItem.getPriority()) > 0) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java

    r3289 r3479  
    44import java.util.ArrayList;
    55import java.util.Collection;
    6 import java.util.Comparator;
    76import java.util.Collections;
    87import java.util.HashSet;
    98import java.util.List;
    109import java.util.Map;
     10import java.util.Set;
    1111import java.util.Map.Entry;
    12 import java.util.Set;
    13 import java.util.TreeSet;
    14 import java.util.logging.Logger;
    15 
     12
     13import org.openstreetmap.josm.data.osm.DataSet;
    1614import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1715import org.openstreetmap.josm.data.osm.OsmUtils;
    1816import org.openstreetmap.josm.data.osm.Relation;
    1917import org.openstreetmap.josm.data.osm.RelationMember;
    20 import org.openstreetmap.josm.data.osm.DataSet;
    2118import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent;
    2219import org.openstreetmap.josm.data.osm.event.DataChangedEvent;
     
    2825import org.openstreetmap.josm.data.osm.event.TagsChangedEvent;
    2926import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
    30 import org.openstreetmap.josm.gui.MapView;
    31 import org.openstreetmap.josm.gui.layer.Layer;
    32 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3327import org.openstreetmap.josm.gui.tagging.TaggingPreset;
    3428import org.openstreetmap.josm.tools.MultiMap;
     
    7064     */
    7165    protected static MultiMap<String, String> presetTagCache = new MultiMap<String, String>();
    72     /** 
    73      * the cached list of member roles 
     66    /**
     67     * the cached list of member roles
    7468     * only accessed by getRoleCache(), rebuild() and cacheRelationMemberRoles()
    7569     * use getRoleCache() accessor
     
    187181                    TaggingPreset.Roles r = (TaggingPreset.Roles) item;
    188182                    for (TaggingPreset.Role i : r.roles) {
    189                         if (i.key != null)
     183                        if (i.key != null) {
    190184                            presetRoleCache.add(i.key);
     185                        }
    191186                    }
    192187                }
  • trunk/src/org/openstreetmap/josm/gui/tagging/tagging-preset.xsd

    r3321 r3479  
    161161                <attribute name="requisite" type="string"/>
    162162                <attribute name="type" type="string"/>
     163                <attribute name="count" type="integer"/>
    163164        </complexType>
    164165
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r3456 r3479  
    3232import org.openstreetmap.josm.data.osm.RelationMember;
    3333import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
    34 import org.openstreetmap.josm.data.osm.Storage;
    3534import org.openstreetmap.josm.data.osm.User;
    3635import org.openstreetmap.josm.data.osm.Way;
  • trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java

    r3380 r3479  
    77import java.io.ByteArrayInputStream;
    88import java.io.File;
     9import java.io.FileOutputStream;
    910import java.io.FilenameFilter;
    10 import java.io.FileOutputStream;
    1111import java.io.IOException;
    1212import java.io.InputStream;
     
    4848    private List<PluginInformation> availablePlugins;
    4949
    50     protected enum CacheType {PLUGIN_LIST, ICON_LIST};
     50    protected enum CacheType {PLUGIN_LIST, ICON_LIST}
    5151
    5252    protected void init(Collection<String> sites){
     
    6060    /**
    6161     * Creates the task
    62      * 
     62     *
    6363     * @param sites the collection of download sites. Defaults to the empty collection if null.
    6464     */
     
    7070    /**
    7171     * Creates the task
    72      * 
     72     *
    7373     * @param monitor the progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null
    7474     * @param sites the collection of download sites. Defaults to the empty collection if null.
     
    9696     * Creates the file name for the cached plugin list and the icon cache
    9797     * file.
    98      * 
     98     *
    9999     * @param site the name of the site
    100100     * @param type icon cache or plugin list cache
     
    122122            }
    123123            switch (type) {
    124                 case PLUGIN_LIST:
    125                     sb.append(".txt");
    126                     break;
    127                 case ICON_LIST:
    128                     sb.append("-icons.zip");
    129                     break;
     124            case PLUGIN_LIST:
     125                sb.append(".txt");
     126                break;
     127            case ICON_LIST:
     128                sb.append("-icons.zip");
     129                break;
    130130            }
    131131            name = sb.toString();
     
    138138    /**
    139139     * Downloads the list from a remote location
    140      * 
     140     *
    141141     * @param site the site URL
    142142     * @param monitor a progress monitor
     
    150150            String pl = Main.pref.getCollectionAsString("plugins");
    151151            String printsite = site.replaceAll("%<(.*)>", "");
    152             if(pl != null && pl.length() != 0)
     152            if(pl != null && pl.length() != 0) {
    153153                site = site.replaceAll("%<(.*)>", "$1"+pl);
    154             else
     154            } else {
    155155                site = printsite;
     156            }
    156157
    157158            monitor.beginTask("");
     
    257258    /**
    258259     * Writes the list of plugins to a cache file
    259      * 
     260     *
    260261     * @param site the site from where the list was downloaded
    261262     * @param list the downloaded list
     
    288289     * Filter information about deprecated plugins from the list of downloaded
    289290     * plugins
    290      * 
     291     *
    291292     * @param plugins the plugin informations
    292293     * @return the plugin informations, without deprecated plugins
     
    306307    /**
    307308     * Parses the plugin list
    308      * 
     309     *
    309310     * @param site the site from where the list was downloaded
    310311     * @param doc the document with the plugin list
     
    335336        for (String location : PluginInformation.getPluginLocations()) {
    336337            File [] f = new File(location).listFiles(
    337                 new FilenameFilter() {
    338                     public boolean accept(File dir, String name) {
    339                         return name.matches("^([0-9]+-)?site.*\\.txt$") ||
    340                                name.matches("^([0-9]+-)?site.*-icons\\.zip$");
     338                    new FilenameFilter() {
     339                        public boolean accept(File dir, String name) {
     340                            return name.matches("^([0-9]+-)?site.*\\.txt$") ||
     341                            name.matches("^([0-9]+-)?site.*-icons\\.zip$");
     342                        }
    341343                    }
    342                 }
    343344            );
    344             if(f != null && f.length > 0)
     345            if(f != null && f.length > 0) {
    345346                siteCacheFiles.addAll(Arrays.asList(f));
     347            }
    346348        }
    347349
     
    382384    /**
    383385     * Replies the list of plugins described in the downloaded plugin lists
    384      * 
     386     *
    385387     * @return  the list of plugins
    386388     */
Note: See TracChangeset for help on using the changeset viewer.