Ignore:
Timestamp:
2014-10-18T23:07:52+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix Java 7 / unused code warnings

Location:
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java

    r30641 r30737  
    3232import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
    3333import org.openstreetmap.josm.gui.NavigatableComponent;
     34import org.openstreetmap.josm.gui.NavigatableComponent.SoMChangeListener;
    3435import org.openstreetmap.josm.gui.SideButton;
    35 import org.openstreetmap.josm.gui.NavigatableComponent.SoMChangeListener;
    3636import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
    3737import org.openstreetmap.josm.gui.help.HelpUtil;
     
    7373     */
    7474    protected JLabel segAngleLabel;
    75    
     75
    7676    private DataSet ds;
    7777
    7878    private Collection<Way> ways;
    7979    private Collection<Node> nodes;
    80    
     80
    8181    /**
    8282     * Constructor
     
    131131            resetButton
    132132        }));
    133        
     133
    134134        DataSet.addSelectionListener(this);
    135135        NavigatableComponent.addSoMChangeListener(this);
     
    162162        Node lastNode = null;
    163163        // Don't mix up way and nodes computation (fix #6872). Priority given to ways
    164         ways = new SubclassFilteredCollection<OsmPrimitive, Way>(newSelection, OsmPrimitive.wayPredicate);
     164        ways = new SubclassFilteredCollection<>(newSelection, OsmPrimitive.wayPredicate);
    165165        if (ways.isEmpty()) {
    166             nodes = new SubclassFilteredCollection<OsmPrimitive, Node>(newSelection, OsmPrimitive.nodePredicate);
     166            nodes = new SubclassFilteredCollection<>(newSelection, OsmPrimitive.nodePredicate);
    167167            for (Node n : nodes) {
    168168                if (n.getCoor() != null) {
     
    198198            }
    199199        }
    200        
     200
    201201        final String lengthLabel = getDistText(length);
    202202        final String angleLabel = getAngleText(segAngle);
    203203        final String areaLabel = getAreaText(area);
    204        
     204
    205205        GuiHelper.runInEDT(new Runnable() {
    206206            @Override
     
    211211            }
    212212        });
    213        
     213
    214214        DataSet currentDs = Main.main.getCurrentDataSet();
    215    
     215
    216216        if (ds != currentDs) {
    217217            if (ds != null) {
     
    246246        return false;
    247247    }
    248    
     248
    249249    @Override public void nodeMoved(NodeMovedEvent event) {
    250250        Node n = event.getNode();
  • applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java

    r30641 r30737  
    5252
    5353    private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(MeasurementPlugin.class.getResource("/images/measurement.png")));
    54     private Collection<WayPoint> points = new ArrayList<WayPoint>(32);
     54    private Collection<WayPoint> points = new ArrayList<>(32);
    5555
    5656    @Override
     
    146146            last = p;
    147147        }
    148         if (MeasurementPlugin.measurementDialog != null) { 
     148        if (MeasurementPlugin.measurementDialog != null) {
    149149            MeasurementPlugin.measurementDialog.pathLengthLabel.setText(NavigatableComponent.getDistText(pathLength));
    150150        }
     
    153153        }
    154154    }
    155    
     155
    156156    /*
    157157     * Use an equal area sinusoidal projection to improve accuracy and so we can still use normal polygon area calculation
     
    222222         */
    223223        private DefaultListModel<GpxLayer> model = new DefaultListModel<>();
    224    
     224
    225225        /**
    226226         * @param layer the targeting measurement layer
     
    229229            super(tr("Import path from GPX layer"), ImageProvider.get("dialogs", "edit")); // TODO: find better image
    230230        }
    231    
     231
    232232        @Override
    233233        public void actionPerformed(ActionEvent e) {
     
    237237            Layer lastLayer = null;
    238238            int layerCnt = 0;
    239    
     239
    240240            for (Layer l : data) {
    241241                if (l instanceof GpxLayer) {
     
    261261                    }
    262262                });
    263    
     263
    264264                JCheckBox dropFirst = new JCheckBox(tr("Drop existing path"));
    265    
     265
    266266                panel.add(layerList);
    267267                panel.add(dropFirst);
    268    
     268
    269269                final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
    270270                        @Override
     
    275275                final JDialog dlg = optionPane.createDialog(Main.parent, tr("Import path from GPX layer"));
    276276                dlg.setVisible(true);
    277    
     277
    278278                Object answer = optionPane.getValue();
    279279                if (answer == null || answer == JOptionPane.UNINITIALIZED_VALUE ||
     
    281281                    return;
    282282                }
    283    
    284                 GpxLayer gpx = (GpxLayer)layerList.getSelectedValue();
     283
     284                GpxLayer gpx = layerList.getSelectedValue();
    285285                if (dropFirst.isSelected()) {
    286                     points = new ArrayList<WayPoint>(32);
     286                    points = new ArrayList<>(32);
    287287                }
    288288
Note: See TracChangeset for help on using the changeset viewer.