Ignore:
Timestamp:
2016-07-04T09:29:30+02:00 (8 years ago)
Author:
donvip
Message:

checkstyle

Location:
applications/editors/josm/plugins/waypoint_search
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/waypoint_search/.project

    r32286 r32551  
    1616                        </arguments>
    1717                </buildCommand>
     18                <buildCommand>
     19                        <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
     20                        <arguments>
     21                        </arguments>
     22                </buildCommand>
    1823        </buildSpec>
    1924        <natures>
    2025                <nature>org.eclipse.jdt.core.javanature</nature>
     26                <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
    2127        </natures>
    2228</projectDescription>
  • applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/Engine.java

    r32329 r32551  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.waypointSearch;
    23
    3 import org.openstreetmap.josm.Main;
    4 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    5 import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
    6 
    7 import java.util.*;
     4import java.util.ArrayList;
     5import java.util.Iterator;
     6import java.util.List;
    87import java.util.regex.Pattern;
    98
    10 class Engine {
    11    
     9import org.openstreetmap.josm.Main;
     10import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
     11import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
     12
     13final class Engine {
     14
    1215    private Engine() {
    1316        // Utility class
     
    2528                        returnList.add(marker);
    2629                    }
    27                 }               
     30                }
    2831            }
    29         } 
     32        }
    3033        return returnList;
    31     }   
    32    
     34    }
     35
    3336    static boolean gpxLayersExist() {
    3437        return !Main.getLayerManager().getLayersOfType(MarkerLayer.class).isEmpty();
  • applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java

    r30777 r32551  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.waypointSearch;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    25
    36import java.awt.BorderLayout;
     
    912import java.util.Iterator;
    1013import java.util.List;
    11 import javax.swing.*;
     14
     15import javax.swing.DefaultListModel;
     16import javax.swing.JLabel;
     17import javax.swing.JList;
     18import javax.swing.JPanel;
     19import javax.swing.JScrollPane;
     20import javax.swing.JTextField;
     21import javax.swing.ListSelectionModel;
    1222
    1323import org.openstreetmap.josm.Main;
     
    1525import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
    1626import org.openstreetmap.josm.tools.Shortcut;
    17 import static org.openstreetmap.josm.tools.I18n.tr;
    1827
    1928class SelectWaypointDialog extends ToggleDialog implements KeyListener, MouseListener {
     
    2433    private List<Marker> searchResultObjectCache = new ArrayList<>();
    2534    private boolean firstTimeSearch = true;
    26    
     35
    2736    SelectWaypointDialog(String name, String iconName, String tooltip,
    2837            Shortcut shortcut, int preferredHeight) {
     
    3443        //add panel - all the gui of the plugin goes in here
    3544        JPanel panel = new JPanel(new BorderLayout());
    36        
     45
    3746        //search field
    3847        searchPattern.setText(tr("Enter search expression here.."));
    3948        searchPattern.addKeyListener(this);
    4049        searchPattern.addMouseListener(this);
    41         panel.add(searchPattern,BorderLayout.NORTH);
    42        
     50        panel.add(searchPattern, BorderLayout.NORTH);
     51
    4352        //add result table
    4453        searchResult.setLayoutOrientation(JList.VERTICAL);
     
    4756        JScrollPane scrollPane = new JScrollPane(searchResult);
    4857        scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    49         panel.add(scrollPane,BorderLayout.CENTER);
    50        
     58        panel.add(scrollPane, BorderLayout.CENTER);
     59
    5160        //add label
    5261        JLabel label = new JLabel(tr("Select waypoint to move map"));
    53         panel.add(label,BorderLayout.SOUTH);
    54        
     62        panel.add(label, BorderLayout.SOUTH);
     63
    5564        //add panel to JOSM gui
    5665        createLayout(panel, false, null);
    5766    }
    58    
     67
    5968    void updateSearchResults() {
    6069        String searchfor = "";
     
    8897    @Override
    8998    public void mouseClicked(MouseEvent e) {
    90         if (e.getSource()==searchResult) {
     99        if (e.getSource() == searchResult) {
    91100            //click on the search result box
    92101            Marker marker = searchResultObjectCache.get(searchResult.getSelectedIndex());
    93102            Main.map.mapView.zoomTo(marker.getCoor());
    94         } else {
    95             //click on the text field (input search expression)
    96103        }
    97104    }
     
    109116    @Override
    110117    public void mousePressed(MouseEvent arg0) {
    111         if (searchPattern.getSelectedText()==null) {
     118        if (searchPattern.getSelectedText() == null) {
    112119            searchPattern.selectAll();
    113120        }
  • applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java

    r32514 r32551  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.waypointSearch;
    23
     
    1819 * Click on one of the search results/waypoints to move the map.
    1920 */
    20 public class WaypointSearchPlugin extends Plugin implements LayerChangeListener  {
     21public class WaypointSearchPlugin extends Plugin implements LayerChangeListener {
    2122    private SelectWaypointDialog waypointDialog;
    2223   
Note: See TracChangeset for help on using the changeset viewer.