Changeset 33005 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-09-23T22:03:59+02:00 (8 years ago)
Author:
donvip
Message:

checkstyle

Location:
applications/editors/josm/plugins/addrinterpolation
Files:
1 added
5 edited

Legend:

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

    r32286 r33005  
    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/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationAction.java

    r29854 r33005  
    1 // License: GPL. Copyright 2009 by Mike Nice and others
    2 // Connects from JOSM menu action to Plugin
     1// License: GPL. For details, see LICENSE file.
    32package org.openstreetmap.josm.plugins.AddrInterpolation;
    43
     
    1615import org.openstreetmap.josm.tools.Shortcut;
    1716
    18 
    1917@SuppressWarnings("serial")
    20 public  class AddrInterpolationAction extends JosmAction implements
     18public class AddrInterpolationAction extends JosmAction implements
    2119SelectionChangedListener {
    2220
    23     public AddrInterpolationAction(){
     21    public AddrInterpolationAction() {
    2422        super(tr("Address Interpolation"), "AddrInterpolation", tr("Handy Address Interpolation Functions"),
    2523                Shortcut.registerShortcut("tools:AddressInterpolation", tr("Tool: {0}", tr("Address Interpolation")),
     
    4341        }
    4442        setEnabled(false);
    45 
    4643    }
    47 
    4844}
    49 
    50 
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java

    r32482 r33005  
    1 // License: GPL. Copyright 2009 by Mike Nice and others
    2 
    3 // Main plugin logic
     1// License: GPL. For details, see LICENSE file.
    42package org.openstreetmap.josm.plugins.AddrInterpolation;
    53
     
    5957import org.openstreetmap.josm.tools.ImageProvider;
    6058
    61 public class AddrInterpolationDialog extends JDialog implements ActionListener  {
     59public class AddrInterpolationDialog extends JDialog implements ActionListener {
    6260
    6361    private Way selectedStreet = null;
     
    7674
    7775    // Edit controls
    78     private EscapeDialog dialog=null;
     76    private EscapeDialog dialog = null;
    7977    private JRadioButton streetNameButton = null;
    80     private JRadioButton streetRelationButton  = null;
     78    private JRadioButton streetRelationButton = null;
    8179    private JTextField startTextField = null;
    8280    private JTextField endTextField = null;
     
    9593    // NOTE: The following 2 arrays must match in number of elements and position
    9694    // Tag values for map (Except that 'Numeric' is replaced by actual # on map)
    97     String[] addrInterpolationTags = { "odd", "even", "all", "alphabetic", "Numeric" };
    98     String[] addrInterpolationStrings = { tr("Odd"), tr("Even"), tr("All"), tr("Alphabetic"), tr("Numeric") }; // Translatable names for display
     95    String[] addrInterpolationTags = {"odd", "even", "all", "alphabetic", "Numeric"};
     96    String[] addrInterpolationStrings = {tr("Odd"), tr("Even"), tr("All"), tr("Alphabetic"), tr("Numeric") }; // Translatable names for display
    9997    private final int NumericIndex = 4;
    10098    private JComboBox<String> addrInterpolationList = null;
    10199
    102100    // NOTE: The following 2 arrays must match in number of elements and position
    103     String[] addrInclusionTags = { "actual", "estimate", "potential" }; // Tag values for map
    104     String[] addrInclusionStrings = { tr("Actual"), tr("Estimate"), tr("Potential") }; // Translatable names for display
     101    String[] addrInclusionTags = {"actual", "estimate", "potential" }; // Tag values for map
     102    String[] addrInclusionStrings = {tr("Actual"), tr("Estimate"), tr("Potential") }; // Translatable names for display
    105103    private JComboBox<String> addrInclusionList = null;
    106104
     
    124122
    125123        dialog.add(editControlsPane);
    126         dialog.setSize(new Dimension(300,500));
    127         dialog.setLocation(new Point(100,300));
     124        dialog.setSize(new Dimension(300, 500));
     125        dialog.setLocation(new Point(100, 300));
    128126
    129127        // Listen for windowOpened event to set focus
    130         dialog.addWindowListener( new WindowAdapter()
    131         {
     128        dialog.addWindowListener(new WindowAdapter() {
    132129            @Override
    133             public void windowOpened( WindowEvent e )
    134             {
     130            public void windowOpened(WindowEvent e) {
    135131                if (addrInterpolationWay != null) {
    136132                    startTextField.requestFocus();
    137                 }
    138                 else {
     133                } else {
    139134                    cityTextField.requestFocus();
    140135                }
     
    163158        editControlsPane.setLayout(gridbag);
    164159
    165         editControlsPane.setBorder(BorderFactory.createEmptyBorder(15,15,15,15));
     160        editControlsPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
    166161
    167162        String streetName = selectedStreet.get("name");
     
    174169        if (associatedStreetRelation == null) {
    175170            streetNameButton.setSelected(true);
    176         }else {
     171        } else {
    177172            streetRelationButton.setSelected(true);
    178173        }
     
    217212        JLabel[] textLabels = {startLabel, endLabel, numberingLabel, incrementLabel, inclusionLabel};
    218213        Component[] editFields = {startTextField, endTextField, addrInterpolationList, incrementTextField, addrInclusionList};
    219         AddEditControlRows(textLabels, editFields,  editControlsPane);
     214        AddEditControlRows(textLabels, editFields, editControlsPane);
    220215
    221216        cbConvertToHouseNumbers = new Checkbox(tr("Convert way to individual house numbers."), null, lastConvertToHousenumber);
     
    259254        addrInterpolationList.addFocusListener(new FocusAdapter() {
    260255            @Override
    261             public void focusGained(FocusEvent fe){
     256            public void focusGained(FocusEvent fe) {
    262257                if (!interpolationMethodSet) {
    263258                    if (AutoDetectInterpolationMethod()) {
     
    271266        // Numeric increment box can be enabled or disabled.
    272267        addrInterpolationList.addActionListener(new ActionListener() {
    273             public void actionPerformed(ActionEvent e){
     268            public void actionPerformed(ActionEvent e) {
    274269                int selectedIndex = addrInterpolationList.getSelectedIndex();
    275270                incrementTextField.setEnabled(selectedIndex == NumericIndex); // Enable or disable numeric field
     
    281276        if (houseNumberNodes.size() > 0) {
    282277            JLabel houseNumberNodeNote = new JLabel(tr("Will associate {0} additional house number nodes",
    283                     houseNumberNodes.size() ));
     278                    houseNumberNodes.size()));
    284279            editControlsPane.add(houseNumberNodeNote, c);
    285280        }
    286281
    287282        editControlsPane.add(new UrlLabel("http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation",
    288                 tr("More information about this feature"),2), c);
     283                tr("More information about this feature"), 2), c);
    289284
    290285        c.gridx = 0;
     
    320315        String startValueString = ReadTextField(startTextField);
    321316        String endValueString = ReadTextField(endTextField);
    322         if ( (startValueString == null) || (endValueString== null) ) {
     317        if ((startValueString == null) || (endValueString == null)) {
    323318            // Not all values entered yet
    324319            return false;
     
    329324        if (isLong(startValueString) && isLong(endValueString)) {
    330325            // Have 2 numeric values
    331             long startValue = Long.parseLong( startValueString );
    332             long endValue = Long.parseLong( endValueString );
     326            long startValue = Long.parseLong(startValueString);
     327            long endValue = Long.parseLong(endValueString);
    333328
    334329            if (isEven(startValue)) {
    335330                if (isEven(endValue)) {
    336331                    SelectInterpolationMethod("even");
    337                 }
    338                 else {
     332                } else {
    339333                    SelectInterpolationMethod("all");
    340334                }
     
    342336                if (!isEven(endValue)) {
    343337                    SelectInterpolationMethod("odd");
    344                 }
    345                 else {
     338                } else {
    346339                    SelectInterpolationMethod("all");
    347340                }
     
    352345            char endingChar = endValueString.charAt(endValueString.length()-1);
    353346
    354             if ( (!IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
     347            if ((!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) {
    355348                // Both end with alpha
    356349                SelectInterpolationMethod("alphabetic");
     
    358351            }
    359352
    360             if ( (IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
     353            if ((IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) {
    361354                endingChar = Character.toUpperCase(endingChar);
    362                 if ( (endingChar >= 'A') && (endingChar <= 'Z') ) {
     355                if ((endingChar >= 'A') && (endingChar <= 'Z')) {
    363356                    // First is a number, last is Latin alpha
    364357                    SelectInterpolationMethod("alphabetic");
     
    381374            incrementTextField.setText(currentMethod);
    382375            incrementTextField.setEnabled(true);
    383         }
    384         else {
     376        } else {
    385377            // Must scan OSM key values because combo box is already loaded with translated strings
    386             for (int i=0; i<addrInterpolationTags.length; i++) {
     378            for (int i = 0; i < addrInterpolationTags.length; i++) {
    387379                if (addrInterpolationTags[i].equals(currentMethod)) {
    388380                    currentIndex = i;
     
    399391        int currentIndex = 0;
    400392        // Must scan OSM key values because combo box is already loaded with translated strings
    401         for (int i=0; i<addrInclusionTags.length; i++) {
     393        for (int i = 0; i < addrInclusionTags.length; i++) {
    402394            if (addrInclusionTags[i].equals(currentMethod)) {
    403395                currentIndex = i;
     
    416408        editControlsPane.setLayout(gridbag);
    417409
    418         editControlsPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
     410        editControlsPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    419411
    420412        JLabel[] optionalTextLabels = {new JLabel(tr("City:")),
     
    433425            @Override
    434426            public void keyTyped(KeyEvent e) {
    435                 JTextField jtextfield = (JTextField)e.getSource();
     427                JTextField jtextfield = (JTextField) e.getSource();
    436428                String text = jtextfield.getText();
    437429                int length = text.length();
     
    444436                    // Accept key; convert to upper case
    445437                    if (!e.isActionKey()) {
    446                         e.setKeyChar(Character.toUpperCase(e.getKeyChar()) );
     438                        e.setKeyChar(Character.toUpperCase(e.getKeyChar()));
    447439                    }
    448440                }
     
    451443
    452444        Component[] optionalEditFields = {cityTextField, stateTextField, postCodeTextField, countryTextField, fullTextField};
    453         AddEditControlRows(optionalTextLabels, optionalEditFields,  editControlsPane);
     445        AddEditControlRows(optionalTextLabels, optionalEditFields, editControlsPane);
    454446
    455447        JPanel optionPanel = new JPanel(new BorderLayout());
     
    543535                    if (relationType.equals("associatedStreet")) {
    544536                        for (RelationMember relationMember : relation.getMembers()) {
    545                             if (relationMember.isWay()){
     537                            if (relationMember.isWay()) {
    546538                                Way way = (Way) relationMember.getMember();
    547539                                // System.out.println("Name: " + way.get("name") );
     
    552544                                    String streetName = "";
    553545                                    if (relation.getKeys().containsKey("name")) {
    554                                         streetName =  relation.get("name");
     546                                        streetName = relation.get("name");
    555547                                    } else {
    556548                                        // Relation is unnamed - use street name
    557                                         streetName =  selectedStreet.get("name");
     549                                        streetName = selectedStreet.get("name");
    558550                                    }
    559551                                    relationDescription += " (" + streetName + ")";
     
    561553                                }
    562554                            }
    563 
    564555                        }
    565556                    }
     
    590581                    namedWayCount++;
    591582                    this.selectedStreet = way;
    592                 }
    593                 else {
     583                } else {
    594584                    unNamedWayCount++;
    595585                    this.addrInterpolationWay = way;
     
    600590            //   Either selected or in the middle of the Address Interpolation way
    601591            //     Do not include end points of Address Interpolation way in this set yet.
    602             houseNumberNodes  = new ArrayList<>();
     592            houseNumberNodes = new ArrayList<>();
    603593            // Check selected nodes
    604594            for (OsmPrimitive osm : currentDataSet.getSelectedNodes()) {
     
    612602                // Check nodes in middle of address interpolation way
    613603                if (addrInterpolationWay.getNodesCount() > 2) {
    614                     for (int i=1; i<(addrInterpolationWay.getNodesCount()-2); i++) {
     604                    for (int i = 1; i < (addrInterpolationWay.getNodesCount()-2); i++) {
    615605                        Node testNode = addrInterpolationWay.getNode(i);
    616606                        if (testNode.getKeys().containsKey("addr:housenumber")) {
     
    682672                dialog.dispose();
    683673            }
    684         } else  if ("cancel".equals(e.getActionCommand())) {
     674        } else if ("cancel".equals(e.getActionCommand())) {
    685675            dialog.dispose();
    686676        }
     
    694684        if (strValue.length() > 0) {
    695685            return strValue.substring(0, strValue.length()-1);
    696         }
    697         else {
     686        } else {
    698687            return "";
    699688        }
     
    703692        if (strValue.length() > 0) {
    704693            return strValue.charAt(strValue.length()-1);
    705         }
    706         else {
     694        } else {
    707695            return 0;
    708696        }
     
    710698
    711699    // Test for valid positive long int
    712     private boolean isLong( String input ) {
    713         try
    714         {
    715             Long val = Long.parseLong( input );
     700    private boolean isLong(String input) {
     701        try {
     702            Long val = Long.parseLong(input);
    716703            return (val > 0);
    717         }
    718         catch( Exception e)
    719         {
     704        } catch (Exception e) {
    720705            return false;
    721706        }
    722707    }
    723708
    724     private boolean isEven( Long input )
    725     {
    726         return ((input %2) == 0);
     709    private boolean isEven(Long input) {
     710        return ((input % 2) == 0);
    727711    }
    728712
     
    737721
    738722        String baseAlpha = BaseAlpha(endValueString);
    739         int nSegments  =endNodeIndex - startNodeIndex;
     723        int nSegments = endNodeIndex - startNodeIndex;
    740724
    741725        double[] segmentLengths = new double[nSegments];
    742726        // Total length of address interpolation way section
    743         double totalLength= CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
     727        double totalLength = CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
    744728
    745729
     
    751735            Node lastHouseNode = addrInterpolationWay.getNode(startNodeIndex);
    752736            int currentSegment = 0; // Segment being used to place new house # node
    753             char currentChar= startingChar;
     737            char currentChar = startingChar;
    754738            while (nHouses > 0) {
    755739                double distanceNeeded = houseSpacing;
     
    769753                Node newHouseNumberNode = new Node(newHouseNumberPosition);
    770754                currentChar++;
    771                 if ( (currentChar >'Z') && (currentChar <'a')) {
     755                if ((currentChar > 'Z') && (currentChar < 'a')) {
    772756                    // Wraparound past uppercase Z: go directly to lower case a
    773757                    currentChar = 'a';
     
    784768
    785769                segmentLengths[currentSegment] -= distanceNeeded; // Track amount used
    786                 nHouses -- ;
     770                nHouses--;
    787771            }
    788772        }
     
    800784        // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor
    801785        int startIndex = 0; // Index into first interpolation zone of address interpolation way
    802         for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
     786        for (int i = 1; i < addrInterpolationWay.getNodesCount()-1; i++) {
    803787            Node testNode = addrInterpolationWay.getNode(i);
    804788            String endNodeNumber = testNode.get("addr:housenumber");
     
    807791                if (endNodeNumber != "") {
    808792                    char anchorChar = LastChar(endNodeNumber);
    809                     if ( (anchorChar >startingChar) && (anchorChar < endingChar) ) {
     793                    if ((anchorChar > startingChar) && (anchorChar < endingChar)) {
    810794                        // Lies within the expected range
    811795                        InterpolateAlphaSection(startIndex, i, endNodeNumber, startingChar, anchorChar);
     
    825809    }
    826810
    827     private double CalculateSegmentLengths(int startNodeIndex, int endNodeIndex, double segmentLengths[]) {
     811    private double CalculateSegmentLengths(int startNodeIndex, int endNodeIndex, double[] segmentLengths) {
    828812        Node fromNode = addrInterpolationWay.getNode(startNodeIndex);
    829813        double totalLength = 0.0;
     
    831815        for (int segment = 0; segment < nSegments; segment++) {
    832816            Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + segment);
    833             segmentLengths[segment]= fromNode.getCoor().greatCircleDistance(toNode.getCoor());
     817            segmentLengths[segment] = fromNode.getCoor().greatCircleDistance(toNode.getCoor());
    834818            totalLength += segmentLengths[segment];
    835819
     
    843827            long increment) {
    844828
    845         int nSegments  =endNodeIndex - startNodeIndex;
     829        int nSegments = endNodeIndex - startNodeIndex;
    846830
    847831        double[] segmentLengths = new double[nSegments];
    848832
    849833        // Total length of address interpolation way section
    850         double totalLength= CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
    851 
    852         int nHouses = (int)((endingAddr - startingAddr) / increment) -1;
     834        double totalLength = CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);
     835
     836        int nHouses = (int) ((endingAddr - startingAddr) / increment) -1;
    853837        if (nHouses > 0) {
    854838
     
    885869
    886870                segmentLengths[currentSegment] -= distanceNeeded; // Track amount used
    887                 nHouses -- ;
     871                nHouses--;
    888872            }
    889873        }
     
    892876    private void CreateNumericInterpolation(String startValueString, String endValueString, long increment) {
    893877
    894         long startingAddr = Long.parseLong( startValueString );
    895         long endingAddr = Long.parseLong( endValueString );
     878        long startingAddr = Long.parseLong(startValueString);
     879        long endingAddr = Long.parseLong(endValueString);
    896880
    897881        // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor
    898882        int startIndex = 0; // Index into first interpolation zone of address interpolation way
    899         for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
     883        for (int i = 1; i < addrInterpolationWay.getNodesCount()-1; i++) {
    900884            Node testNode = addrInterpolationWay.getNode(i);
    901885            String strEndNodeNumber = testNode.get("addr:housenumber");
     
    904888                if (isLong(strEndNodeNumber)) {
    905889
    906                     long anchorAddrNumber = Long.parseLong( strEndNodeNumber );
    907                     if ( (anchorAddrNumber >startingAddr) && (anchorAddrNumber < endingAddr) ) {
     890                    long anchorAddrNumber = Long.parseLong(strEndNodeNumber);
     891                    if ((anchorAddrNumber > startingAddr) && (anchorAddrNumber < endingAddr)) {
    908892                        // Lies within the expected range
    909893                        InterpolateNumericSection(startIndex, i, startingAddr, anchorAddrNumber, increment);
     
    954938
    955939        // Remove untagged nodes
    956         for (int i=1; i<addrInterpolationWay.getNodesCount()-1; i++) {
     940        for (int i = 1; i < addrInterpolationWay.getNodesCount()-1; i++) {
    957941            Node testNode = addrInterpolationWay.getNode(i);
    958942            if (!testNode.hasKeys()) {
     
    977961        String selectedMethod = GetInterpolationMethod();
    978962        if (addrInterpolationWay != null) {
    979             Long startAddr=0L, endAddr=0L;
     963            Long startAddr = 0L, endAddr = 0L;
    980964            if (!selectedMethod.equals("alphabetic")) {
    981965                Long[] addrArray = {startAddr, endAddr};
    982                 if (!ValidAddressNumbers(startValueString, endValueString, addrArray )) {
     966                if (!ValidAddressNumbers(startValueString, endValueString, addrArray)) {
    983967                    return false;
    984968                }
     
    1009993            }
    1010994            if (!errorMessage.equals("")) {
    1011                 JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"),   JOptionPane.ERROR_MESSAGE);
     995                JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"), JOptionPane.ERROR_MESSAGE);
    1012996                return false;
    1013997            }
     
    10171001            if (country.length() != 2) {
    10181002                JOptionPane.showMessageDialog(Main.parent,
    1019                         tr("Country code must be 2 letters"), tr("Error"),  JOptionPane.ERROR_MESSAGE);
     1003                        tr("Country code must be 2 letters"), tr("Error"), JOptionPane.ERROR_MESSAGE);
    10201004                return false;
    10211005            }
     
    10861070                AddToRelation(associatedStreetRelation, node, "house");
    10871071            }
    1088             if ((city != null) || (streetNameButton.isSelected()) ) {
     1072            if ((city != null) || (streetNameButton.isSelected())) {
    10891073                // Include street unconditionally if adding nodes only or city name specified
    10901074                commandGroup.add(new ChangePropertyCommand(node, "addr:street", streetName));
     
    11021086        }
    11031087
    1104 
    11051088        Main.main.undoRedo.add(new SequenceCommand(tr("Address Interpolation"), commandGroup));
    11061089        Main.map.repaint();
     
    11151098        }
    11161099        long testIncrement = Long.parseLong(incrementString);
    1117         if ( (testIncrement <=0) || (testIncrement > endingAddr ) ) {
     1100        if ((testIncrement <= 0) || (testIncrement > endingAddr)) {
    11181101            return false;
    11191102        }
    11201103
    1121         if ( ((endingAddr - startingAddr) % testIncrement) != 0) {
     1104        if (((endingAddr - startingAddr) % testIncrement) != 0) {
    11221105            return false;
    11231106        }
     
    11501133    // Test if relation contains specified member
    11511134    //   If not already present, it is added
    1152     private void AddToRelation(Relation relation,   OsmPrimitive testMember, String role) {
     1135    private void AddToRelation(Relation relation, OsmPrimitive testMember, String role) {
    11531136        boolean isFound = false;
    11541137        for (RelationMember relationMember : relation.getMembers()) {
     
    11741157    private String ValidateAlphaAddress(String startValueString,
    11751158            String endValueString) {
    1176         String errorMessage="";
     1159        String errorMessage = "";
    11771160
    11781161        if (startValueString.equals("") || endValueString.equals("")) {
     
    11841167
    11851168            boolean isOk = false;
    1186             if ( (IsNumeric("" + startingChar)) &&  (!IsNumeric("" + endingChar)) ) {
     1169            if ((IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) {
    11871170                endingChar = Character.toUpperCase(endingChar);
    1188                 if ( (endingChar >= 'A') && (endingChar <= 'Z') ) {
     1171                if ((endingChar >= 'A') && (endingChar <= 'Z')) {
    11891172                    // First is a number, last is Latin alpha
    11901173                    isOk = true;
    11911174                }
    1192             } else if ( (!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar)) ) {
     1175            } else if ((!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) {
    11931176                // Both are alpha
    11941177                isOk = true;
     
    11971180                errorMessage = tr("Alphabetic address must end with a letter");
    11981181            }
    1199 
    12001182
    12011183            // if a number is included, validate that it is the same number
     
    12351217        }
    12361218        if (errorMessage.equals("")) {
    1237             addrArray[0] = Long.parseLong( startValueString );
    1238             addrArray[1] = Long.parseLong( endValueString );
     1219            addrArray[0] = Long.parseLong(startValueString);
     1220            addrArray[1] = Long.parseLong(endValueString);
    12391221
    12401222            if (addrArray[1] <= addrArray[0]) {
     
    12471229
    12481230        } else {
    1249             JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"),   JOptionPane.ERROR_MESSAGE);
     1231            JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"), JOptionPane.ERROR_MESSAGE);
    12501232            return false;
    12511233        }
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationPlugin.java

    r29778 r33005  
    1 // License: GPL. Copyright 2009 by Mike Nice and others
     1// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.AddrInterpolation;
    3 
    43
    54import org.openstreetmap.josm.Main;
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/EscapeDialog.java

    r23191 r33005  
    1 // License: GPL. Copyright 2009 by Mike Nice and others
    2 // Handles ESC key to close a dialog
     1// License: GPL. For details, see LICENSE file.
    32package org.openstreetmap.josm.plugins.AddrInterpolation;
    43
     
    1615public class EscapeDialog extends JDialog {
    1716    public EscapeDialog() {
    18         this((Frame)null, false);
     17        this((Frame) null, false);
    1918    }
     19   
    2020    public EscapeDialog(Frame owner) {
    2121        this(owner, false);
    2222    }
     23   
    2324    public EscapeDialog(Frame owner, boolean modal) {
    2425        this(owner, null, modal);
    2526    }
     27   
    2628    public EscapeDialog(Frame owner, String title) {
    2729        this(owner, title, false);
    2830    }
     31   
    2932    public EscapeDialog(Frame owner, String title, boolean modal) {
    3033        super(owner, title, modal);
    3134    }
     35   
    3236    public EscapeDialog(Dialog owner) {
    3337        this(owner, false);
    3438    }
     39   
    3540    public EscapeDialog(Dialog owner, boolean modal) {
    3641        this(owner, null, modal);
    3742    }
     43   
    3844    public EscapeDialog(Dialog owner, String title) {
    3945        this(owner, title, false);
    4046    }
     47   
    4148    public EscapeDialog(Dialog owner, String title, boolean modal) {
    4249        super(owner, title, modal);
    4350    }
    44 
    4551
    4652    @Override
Note: See TracChangeset for help on using the changeset viewer.