Ignore:
Timestamp:
2018-08-19T22:35:16+02:00 (6 years ago)
Author:
donvip
Message:

rename packages, fix warnings

Location:
applications/editors/josm/plugins/surveyor/src
Files:
5 added
1 deleted
5 edited
26 copied

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/surveyor/src/org/dinopolis/util/io/Tokenizer.java

    r30737 r34591  
    2323
    2424import java.io.IOException;
    25 import java.io.InputStream;
    26 import java.io.InputStreamReader;
    2725import java.io.PushbackReader;
    2826import java.io.Reader;
     
    228226//----------------------------------------------------------------------
    229227/**
    230  * Creates a tokenizer that reads from the given string. It uses the
    231  * comma as delimiter, does not respect escape characters but respects
    232  * quoted words.
    233  *
    234  * @param inStream the stream to read from.
    235  */
    236   public Tokenizer(InputStream inStream)
    237   {
    238     this(new InputStreamReader(inStream));
    239   }
    240 
    241 //----------------------------------------------------------------------
    242 /**
    243228 * Creates a tokenizer that reads from the given reader. It uses the
    244229 * comma as delimiter, does not respect escape characters but respects
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/ActionConstants.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import javax.swing.Action;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/AutoSaveAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/AutoSaveEditLayerTimerTask.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.io.BufferedWriter;
    67import java.io.File;
    78import java.io.FileOutputStream;
    89import java.io.IOException;
     10import java.io.OutputStreamWriter;
    911import java.io.PrintWriter;
     12import java.nio.charset.StandardCharsets;
    1013import java.util.TimerTask;
    1114
     
    4144            // write to temporary file, on success, rename tmp file to target file:
    4245            File tmpFile = new File(file.getAbsoluteFile()+".tmp");
    43             System.out.println("AutoSaving osm data to file " + file.getAbsolutePath());
     46            Logging.info("AutoSaving osm data to file " + file.getAbsolutePath());
    4447            synchronized (SurveyorLock.class) {
    45                 OsmWriter w = OsmWriterFactory.createOsmWriter(new PrintWriter(new FileOutputStream(tmpFile)), false, dataset.getVersion());
     48                OsmWriter w = OsmWriterFactory.createOsmWriter(new PrintWriter(new OutputStreamWriter(
     49                        new FileOutputStream(tmpFile), StandardCharsets.UTF_8)), false, dataset.getVersion());
    4650                w.header();
    4751                w.writeDataSources(dataset);
     
    5054            }
    5155            tmpFile.renameTo(file);
    52             System.out.println("AutoSaving finished");
    5356        } catch (IOException ex) {
    5457            Logging.error(ex);
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/AutoSaveGpsLayerTimerTask.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    99import java.io.IOException;
    1010import java.io.PrintWriter;
     11import java.nio.charset.StandardCharsets;
     12import java.nio.file.Files;
    1113import java.util.TimerTask;
    1214
     
    1618import org.openstreetmap.josm.gui.layer.GpxLayer;
    1719import org.openstreetmap.josm.io.GpxWriter;
    18 
    19 import at.dallermassl.josm.plugin.surveyor.util.LayerUtil;
     20import org.openstreetmap.josm.plugins.surveyor.util.LayerUtil;
    2021
    2122/**
     
    6465            // quite a hack, but no other object to sync available :-(
    6566            // @see LiveGpsLayer
    66             PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(tmpFile)));
     67            PrintWriter out = new PrintWriter(Files.newBufferedWriter(tmpFile.toPath(), StandardCharsets.UTF_8));
    6768            try (GpxWriter gpxWriter = new GpxWriter(out)) {
    6869                gpxWriter.write(gpsLayer.data);
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/ButtonDescription.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/ButtonType.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44/**
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/GpsActionEvent.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import java.awt.event.ActionEvent;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/GpsDataSource.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import livegps.LiveGpsData;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/MetaAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import java.awt.event.ActionEvent;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import java.util.List;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorActionDescription.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import java.io.IOException;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorActionFactory.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import java.util.HashMap;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorComponent.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    99import java.beans.PropertyChangeEvent;
    1010import java.beans.PropertyChangeListener;
    11 import java.io.InputStreamReader;
    12 import java.io.Reader;
    13 import java.util.ArrayList;
    1411import java.util.HashSet;
    15 import java.util.List;
    1612import java.util.Set;
    1713
    1814import javax.swing.JComponent;
    19 import javax.swing.JFrame;
    2015import javax.swing.JLabel;
    2116import javax.swing.JOptionPane;
     
    2419import org.openstreetmap.josm.gui.MainApplication;
    2520import org.openstreetmap.josm.spi.preferences.Config;
    26 import org.openstreetmap.josm.tools.Logging;
    27 import org.openstreetmap.josm.tools.XmlObjectParser;
    28 import org.xml.sax.SAXException;
    2921
    3022import livegps.LiveGpsData;
     
    117109    }
    118110
    119     public static void main(String[] args) {
    120 
    121         // parse xml file and create component from it:
    122         Reader in = new InputStreamReader(SurveyorComponent.class.getClassLoader().getResourceAsStream("resources/surveyor.xml"));
    123         XmlObjectParser parser = new XmlObjectParser();
    124         parser.mapOnStart("surveyor", SurveyorComponent.class);
    125         parser.map("button", ButtonDescription.class);
    126         parser.map("action", SurveyorActionDescription.class);
    127 
    128         SurveyorComponent surveyorComponent = null;
    129         try {
    130             parser.start(in);
    131         } catch (SAXException e) {
    132             Logging.error(e);
    133         }
    134         List<SurveyorActionDescription> actions = new ArrayList<>();
    135         while (parser.hasNext()) {
    136             Object object = parser.next();
    137             if (object instanceof SurveyorComponent) {
    138                 System.out.println("SurveyorComponent " + object);
    139                 surveyorComponent = (SurveyorComponent) object;
    140             } else if (object instanceof ButtonDescription) {
    141                 System.out.println("ButtonDescription " + object);
    142                 ((ButtonDescription) object).setActions(actions);
    143                 surveyorComponent.addButton(((ButtonDescription) object));
    144                 actions.clear();
    145             } else if (object instanceof SurveyorActionDescription) {
    146                 System.out.println("SurveyorActionDescription " + object);
    147                 actions.add((SurveyorActionDescription) object);
    148             } else {
    149                 System.err.println("unknown " + object);
    150             }
    151         }
    152 
    153         JFrame frame = new JFrame();
    154         frame.add(surveyorComponent);
    155         frame.pack();
    156         frame.setVisible(true);
    157         frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    158     }
    159 
    160111    @Override
    161112    public void propertyChange(PropertyChangeEvent evt) {
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorLock.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44public class SurveyorLock {
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorPlugin.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/SurveyorShowAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor;
     2package org.openstreetmap.josm.plugins.surveyor;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    1010import java.io.InputStream;
    1111import java.io.InputStreamReader;
     12import java.nio.charset.StandardCharsets;
    1213import java.util.ArrayList;
    1314import java.util.List;
     
    2223import org.openstreetmap.josm.actions.JosmAction;
    2324import org.openstreetmap.josm.gui.MainApplication;
     25import org.openstreetmap.josm.plugins.surveyor.util.ResourceLoader;
    2426import org.openstreetmap.josm.spi.preferences.Config;
    2527import org.openstreetmap.josm.tools.Logging;
     
    2830import org.xml.sax.SAXException;
    2931
    30 import at.dallermassl.josm.plugin.surveyor.util.ResourceLoader;
    3132import livegps.LiveGpsPlugin;
    3233
     
    140141
    141142        SurveyorComponent surveyorComponent = null;
    142         parser.start(new BufferedReader(new InputStreamReader(in)));
     143        parser.start(new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8)));
    143144        List<SurveyorActionDescription> actions = new ArrayList<>();
    144145        while (parser.hasNext()) {
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/AbstractSurveyorAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action;
     2package org.openstreetmap.josm.plugins.surveyor.action;
    33
    44import java.util.List;
    55
    6 import at.dallermassl.josm.plugin.surveyor.SurveyorAction;
     6import org.openstreetmap.josm.plugins.surveyor.SurveyorAction;
    77
    88/**
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/BeepAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action;
     2package org.openstreetmap.josm.plugins.surveyor.action;
    33
    44import java.awt.Toolkit;
     
    66
    77import org.openstreetmap.josm.gui.MainApplication;
     8import org.openstreetmap.josm.plugins.surveyor.GpsActionEvent;
     9import org.openstreetmap.josm.plugins.surveyor.SurveyorAction;
    810import org.openstreetmap.josm.tools.Logging;
    9 
    10 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
    11 import at.dallermassl.josm.plugin.surveyor.SurveyorAction;
    1211
    1312/**
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/ConsolePrinterAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action;
     2package org.openstreetmap.josm.plugins.surveyor.action;
    33
    44import org.openstreetmap.josm.data.coor.LatLon;
    5 
    6 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
     5import org.openstreetmap.josm.plugins.surveyor.GpsActionEvent;
    76
    87/**
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/PlayAudioAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action;
     2package org.openstreetmap.josm.plugins.surveyor.action;
    33
    44import java.io.BufferedInputStream;
     
    1515
    1616import org.openstreetmap.josm.gui.MainApplication;
     17import org.openstreetmap.josm.plugins.surveyor.GpsActionEvent;
     18import org.openstreetmap.josm.plugins.surveyor.util.ResourceLoader;
    1719import org.openstreetmap.josm.tools.Logging;
    18 
    19 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
    20 import at.dallermassl.josm.plugin.surveyor.util.ResourceLoader;
    2120
    2221/**
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/SetNodeAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action;
     2package org.openstreetmap.josm.plugins.surveyor.action;
    33
    44import java.util.ArrayList;
     
    1010import org.openstreetmap.josm.data.osm.Node;
    1111import org.openstreetmap.josm.gui.MainApplication;
     12import org.openstreetmap.josm.plugins.surveyor.GpsActionEvent;
     13import org.openstreetmap.josm.plugins.surveyor.SurveyorAction;
     14import org.openstreetmap.josm.plugins.surveyor.SurveyorLock;
    1215import org.openstreetmap.josm.tools.Pair;
    13 
    14 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
    15 import at.dallermassl.josm.plugin.surveyor.SurveyorAction;
    16 import at.dallermassl.josm.plugin.surveyor.SurveyorLock;
    1716
    1817/**
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/SetWaypointAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action;
     2package org.openstreetmap.josm.plugins.surveyor.action;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    1515import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
    1616import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
     17import org.openstreetmap.josm.plugins.surveyor.GpsActionEvent;
     18import org.openstreetmap.josm.plugins.surveyor.SurveyorLock;
     19import org.openstreetmap.josm.plugins.surveyor.SurveyorPlugin;
     20import org.openstreetmap.josm.plugins.surveyor.action.gui.DialogClosingThread;
     21import org.openstreetmap.josm.plugins.surveyor.action.gui.WaypointDialog;
     22import org.openstreetmap.josm.plugins.surveyor.util.LayerUtil;
    1723import org.openstreetmap.josm.tools.Logging;
    1824
    19 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
    20 import at.dallermassl.josm.plugin.surveyor.SurveyorLock;
    21 import at.dallermassl.josm.plugin.surveyor.SurveyorPlugin;
    22 import at.dallermassl.josm.plugin.surveyor.action.gui.DialogClosingThread;
    23 import at.dallermassl.josm.plugin.surveyor.action.gui.WaypointDialog;
    24 import at.dallermassl.josm.plugin.surveyor.util.LayerUtil;
    2525import livegps.LiveGpsLayer;
    2626
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/SystemExecuteAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action;
     2package org.openstreetmap.josm.plugins.surveyor.action;
    33
    44import java.io.BufferedReader;
     
    66import java.io.InputStream;
    77import java.io.InputStreamReader;
     8import java.nio.charset.StandardCharsets;
    89
     10import org.openstreetmap.josm.plugins.surveyor.GpsActionEvent;
    911import org.openstreetmap.josm.tools.Logging;
    10 
    11 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
    1212
    1313/**
     
    3030                    final Process process = builder.start();
    3131                    InputStream is = process.getInputStream();
    32                     InputStreamReader isr = new InputStreamReader(is);
     32                    InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8);
    3333                    BufferedReader br = new BufferedReader(isr);
    3434                    String line;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/TaggingPresetAction.java

    r34576 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action;
     2package org.openstreetmap.josm.plugins.surveyor.action;
    33
    44import java.util.List;
     
    99import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
    1010import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
    11 
    12 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
    13 import at.dallermassl.josm.plugin.surveyor.SurveyorAction;
     11import org.openstreetmap.josm.plugins.surveyor.GpsActionEvent;
     12import org.openstreetmap.josm.plugins.surveyor.SurveyorAction;
    1413
    1514/**
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/gui/DialogClosingThread.java

    r33824 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action.gui;
     2package org.openstreetmap.josm.plugins.surveyor.action.gui;
    33
    44import java.awt.Component;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/action/gui/WaypointDialog.java

    r33011 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.action.gui;
    3 
    4 import java.beans.PropertyChangeEvent;
    5 import java.beans.PropertyChangeListener;
     2package org.openstreetmap.josm.plugins.surveyor.action.gui;
    63
    74import javax.swing.JDialog;
     
    3835        closer.observe(textField);
    3936        dialog.setContentPane(optionPane);
    40         optionPane.addPropertyChangeListener(new PropertyChangeListener() {
    41             public void propertyChange(PropertyChangeEvent e) {
    42                 String prop = e.getPropertyName();
     37        optionPane.addPropertyChangeListener(e -> {
     38            String prop = e.getPropertyName();
    4339
    44                 if (dialog.isVisible() && (e.getSource() == optionPane)
    45                                 && (prop.equals(JOptionPane.VALUE_PROPERTY))) {
    46                     // If you were going to check something
    47                     // before closing the window, you'd do it here.
    48                     dialog.setVisible(false);
    49                 }
     40            if (dialog.isVisible() && (e.getSource() == optionPane)
     41                            && (prop.equals(JOptionPane.VALUE_PROPERTY))) {
     42                // If you were going to check something
     43                // before closing the window, you'd do it here.
     44                dialog.setVisible(false);
    5045            }
    5146        });
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/util/LayerUtil.java

    r33824 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.util;
     2package org.openstreetmap.josm.plugins.surveyor.util;
    33
    44import org.openstreetmap.josm.gui.MainApplication;
  • applications/editors/josm/plugins/surveyor/src/org/openstreetmap/josm/plugins/surveyor/util/ResourceLoader.java

    r33011 r34591  
    11// License: GPL. For details, see LICENSE file.
    2 package at.dallermassl.josm.plugin.surveyor.util;
     2package org.openstreetmap.josm.plugins.surveyor.util;
    33
    44import java.io.FileInputStream;
Note: See TracChangeset for help on using the changeset viewer.