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

[josm_plugins] fix Java 7 / unused code warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogLayer.java

    r30701 r30737  
    11package nanolog;
    22
    3 import java.awt.*;
    4 import java.awt.event.*;
    5 import java.io.*;
     3import static org.openstreetmap.josm.tools.I18n.tr;
     4
     5import java.awt.Color;
     6import java.awt.Graphics2D;
     7import java.awt.Point;
     8import java.awt.event.ActionEvent;
     9import java.awt.event.MouseAdapter;
     10import java.awt.event.MouseEvent;
     11import java.io.BufferedReader;
     12import java.io.File;
     13import java.io.FileInputStream;
     14import java.io.IOException;
     15import java.io.InputStreamReader;
    616import java.text.ParseException;
    717import java.text.SimpleDateFormat;
    8 import java.util.*;
     18import java.util.ArrayList;
     19import java.util.Collections;
     20import java.util.Date;
     21import java.util.HashSet;
    922import java.util.List;
    10 import java.util.regex.*;
    11 import javax.swing.*;
     23import java.util.Set;
     24import java.util.regex.Matcher;
     25import java.util.regex.Pattern;
     26
     27import javax.swing.Action;
     28import javax.swing.Icon;
     29import javax.swing.JOptionPane;
     30
    1231import org.openstreetmap.josm.Main;
    13 import org.openstreetmap.josm.actions.*;
     32import org.openstreetmap.josm.actions.JosmAction;
     33import org.openstreetmap.josm.actions.RenameLayerAction;
    1434import org.openstreetmap.josm.data.Bounds;
    1535import org.openstreetmap.josm.data.coor.EastNorth;
     
    1838import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    1939import org.openstreetmap.josm.gui.MapView;
    20 import org.openstreetmap.josm.gui.dialogs.*;
    21 import org.openstreetmap.josm.gui.layer.*;
    22 import static org.openstreetmap.josm.tools.I18n.tr;
     40import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
     41import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
     42import org.openstreetmap.josm.gui.layer.GpxLayer;
     43import org.openstreetmap.josm.gui.layer.JumpToMarkerActions;
     44import org.openstreetmap.josm.gui.layer.Layer;
    2345import org.openstreetmap.josm.tools.ImageProvider;
    2446
     
    3254    private List<NanoLogEntry> log;
    3355    private int selectedEntry;
    34     private final Set<NanoLogLayerListener> listeners = new HashSet<NanoLogLayerListener>();
     56    private final Set<NanoLogLayerListener> listeners = new HashSet<>();
    3557    private NLLMouseAdapter mouseListener;
    36    
     58
    3759    public NanoLogLayer( List<NanoLogEntry> entries ) {
    3860        super(tr("NanoLog"));
    39         log = new ArrayList<NanoLogEntry>(entries);
     61        log = new ArrayList<>(entries);
    4062        selectedEntry = -1;
    4163        mouseListener = new NLLMouseAdapter();
     
    5072        super.destroy();
    5173    }
    52    
     74
    5375    public NanoLogLayer( File file ) throws IOException {
    5476        this(readNanoLog(file));
     
    7698        return Collections.unmodifiableList(log);
    7799    }
    78    
     100
    79101    public static List<NanoLogEntry> readNanoLog( File file ) throws IOException {
    80102        final Pattern NANOLOG_LINE = Pattern.compile("(.+?)\\t(.+?)(?:\\s*\\{\\{(-?\\d+\\.\\d+),\\s*(-?\\d+\\.\\d+)(?:,\\s*(\\d+))?\\}\\})?");
    81103        final SimpleDateFormat fmt = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss.SS");
    82         List<NanoLogEntry> result = new ArrayList<NanoLogEntry>();
     104        List<NanoLogEntry> result = new ArrayList<>();
    83105        BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF8"));
    84106        while( r.ready() ) {
     
    301323        Main.map.mapView.repaint();
    302324    }
    303    
     325
    304326    private class CorrelateEntries extends JosmAction {
    305327        private boolean toZero;
     
    328350        }
    329351    }
    330    
     352
    331353    private class SaveLayer extends JosmAction {
    332354
Note: See TracChangeset for help on using the changeset viewer.