Ignore:
Timestamp:
2010-05-07T21:18:27+02:00 (14 years ago)
Author:
lambertus
Message:

Remember the interpolation between restarts

Location:
applications/editors/josm/plugins/terracer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/terracer/build.xml

    r21028 r21166  
    3232
    3333
    34     <property name="commit.message" value="Update to JOSM core" />
     34    <property name="commit.message" value="Remember the interpolation setting between restarts" />
    3535    <property name="plugin.main.version" value="3210" />
    3636
  • applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java

    r21094 r21166  
    5858    final static String HANDLE_RELATION = "plugins.terracer.handle_relation";
    5959    final static String DELETE_OUTLINE = "plugins.terracer.delete_outline";
     60    final static String INTERPOLATION = "plugins.terracer.interpolation";
    6061
    6162    final private Way street;
     
    163164            hiLabel.setText(tr("Highest Number"));
    164165            final String txt = relationExists ? tr("add to existing associatedStreet relation") : tr("create an associatedStreet relation");
     166
    165167            handleRelationCheckBox = new JCheckBox(txt, Main.pref.getBoolean(HANDLE_RELATION, true));
    166168            deleteOutlineCheckBox = new JCheckBox(tr("delete outline way"), Main.pref.getBoolean(DELETE_OUTLINE, true));
     
    265267            interpolation.add(tr("All"));
    266268            interpolation.add(tr("Even/Odd"));
     269            if (Main.pref.getInteger(INTERPOLATION, 2) == 1) {
     270                interpolation.select(tr("All"));
     271            } else {
     272                interpolation.select(tr("Even/Odd"));
     273            }
     274            //return (dialog.interpolation.getSelectedItem().equals(tr("All"))) ? 1 : 2;
    267275        }
    268276        return interpolation;
  • applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java

    r21094 r21166  
    305305     * @return the stepSize (1 for all, 2 for odd /even)
    306306     */
    307     public int stepSize() {
     307    public Integer stepSize() {
    308308        return (dialog.interpolation.getSelectedItem().equals(tr("All"))) ? 1
    309309                : 2;
     
    387387    }
    388388
     389   
    389390    /**
    390391     * Whether the user likes to delete the outline way.
     
    393394        return dialog.deleteOutlineCheckBox.isSelected();
    394395    }
    395 
     396   
    396397    /* (non-Javadoc)
    397398     * @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
     
    417418        Main.pref.put(HouseNumberInputDialog.HANDLE_RELATION, doHandleRelation());
    418419        Main.pref.put(HouseNumberInputDialog.DELETE_OUTLINE, doDeleteOutline());
     420        Main.pref.put(HouseNumberInputDialog.INTERPOLATION, stepSize().toString());
    419421    }
    420422}
Note: See TracChangeset for help on using the changeset viewer.