Ignore:
Timestamp:
2016-06-25T11:56:57+02:00 (10 years ago)
Author:
donvip
Message:

checkstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java

    r32395 r32398  
    6060        boolean wont = false;
    6161        for (RelationMember m : r.getMembers()) {
    62             if (m.isWay() ) {
     62            if (m.isWay()) {
    6363                ways.add(m.getWay());
    6464            } else {
     
    6767        }
    6868        if (wont) {
    69             JOptionPane.showMessageDialog(Main.parent, tr("Multipolygon must consist only of ways"), tr("Reconstruct polygon"), JOptionPane.ERROR_MESSAGE);
     69            JOptionPane.showMessageDialog(Main.parent,
     70                    tr("Multipolygon must consist only of ways"), tr("Reconstruct polygon"), JOptionPane.ERROR_MESSAGE);
    7071            return;
    7172        }
     
    7980
    8081        if (!mpc.innerWays.isEmpty()) {
    81             JOptionPane.showMessageDialog(Main.parent, tr("Reconstruction of polygons can be done only from outer ways"), tr("Reconstruct polygon"), JOptionPane.ERROR_MESSAGE);
     82            JOptionPane.showMessageDialog(Main.parent,
     83                    tr("Reconstruction of polygons can be done only from outer ways"), tr("Reconstruct polygon"), JOptionPane.ERROR_MESSAGE);
    8284            return;
    8385        }
     
    8688        List<Way> newSelection = new ArrayList<>();
    8789        List<Command> commands = new ArrayList<>();
    88         Command c = DeleteCommand.delete(Main.main.getEditLayer(), Collections.singleton(r), true, true);
    89         if (c == null )
     90        Command c = DeleteCommand.delete(Main.getLayerManager().getEditLayer(), Collections.singleton(r), true, true);
     91        if (c == null)
    9092            return;
    9193        commands.add(c);
     
    106108                }
    107109                List<OsmPrimitive> referrers = w.getReferrers();
    108                 for (Iterator<OsmPrimitive> ref1 = relations.iterator(); ref1.hasNext(); )
    109                     if (!referrers.contains(ref1.next()) ) {
     110                for (Iterator<OsmPrimitive> ref1 = relations.iterator(); ref1.hasNext();) {
     111                    if (!referrers.contains(ref1.next())) {
    110112                        ref1.remove();
    111113                    }
     114                }
    112115            }
    113116            tags.putAll(r.getKeys());
     
    123126                    keys.removeAll(IRRELEVANT_KEYS);
    124127                    if (keys.isEmpty()) {
    125                         if (candidateWay == null ) {
     128                        if (candidateWay == null) {
    126129                            candidateWay = w;
    127130                        } else {
     
    149152        Main.main.undoRedo.add(new SequenceCommand(tr("Reconstruct polygons from relation {0}",
    150153                r.getDisplayName(DefaultNameFormatter.getInstance())), commands));
    151         Main.main.getCurrentDataSet().setSelected(newSelection);
     154        Main.getLayerManager().getEditDataSet().setSelected(newSelection);
    152155    }
    153156
     
    158161
    159162    private boolean isSuitableRelation(Relation newRelation) {
    160         if (newRelation == null || !"multipolygon".equals(newRelation.get("type")) || newRelation.getMembersCount() == 0 )
     163        if (newRelation == null || !"multipolygon".equals(newRelation.get("type")) || newRelation.getMembersCount() == 0)
    161164            return false;
    162165        else {
    163             for (RelationMember m : newRelation.getMembers() )
    164                 if ("inner".equals(m.getRole()) )
     166            for (RelationMember m : newRelation.getMembers()) {
     167                if ("inner".equals(m.getRole()))
    165168                    return false;
     169            }
    166170            return true;
    167171        }
Note: See TracChangeset for help on using the changeset viewer.