Ignore:
Timestamp:
2009-02-06T13:11:57+01:00 (15 years ago)
Author:
zere
Message:

Fixed bug when not checking the return value of a dialogue box.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java

    r13553 r13559  
    6767                                if ((way.nodes.size() == 5) &&
    6868                                                way.isClosed()) {
    69                                         terraceBuilding(way);
    70 
     69                                        // first ask the user how many buildings to terrace into
     70                                        String answer =
     71                                                JOptionPane.showInputDialog(
     72                                                                tr("How many buildings are in the terrace?"));
     73                                       
     74                                        // if the answer was null then the user clicked "Cancel"
     75                                        if (answer != null) {
     76                                                int nb = Integer.parseInt(answer);
     77                                                terraceBuilding(way, nb);
     78                                        }
    7179                                } else {
    7280                                        badSelect = true;
     
    94102         *
    95103         * @param w The closed, quadrilateral way to terrace.
     104         * @param nb The number of buildings to terrace into.
    96105         */
    97         private void terraceBuilding(Way w) {
    98                 // first ask the user how many buildings to terrace into
    99                 int nb = Integer.parseInt(
    100                                 JOptionPane.showInputDialog(
    101                                                 tr("How many buildings are in the terrace?")));
     106        private void terraceBuilding(Way w, int nb) {
    102107
    103108                // now find which is the longest side connecting the first node
Note: See TracChangeset for help on using the changeset viewer.