Ignore:
Timestamp:
2013-06-21T00:29:01+02:00 (11 years ago)
Author:
pieren
Message:

Change some default preference values. Fix in grab plan image case where mouse clic is outside the image.

Location:
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java

    r27852 r29677  
    8686    private JTextField cacheSize = new JTextField(20);
    8787
    88     static final String DEFAULT_RASTER_DIVIDER = "5";
     88    static final String DEFAULT_RASTER_DIVIDER = "7";
    8989    private JTextField rasterDivider = new JTextField(10);
    9090
    9191    static final int DEFAULT_CROSSPIECES = 0;
     92   
     93    static final String DEFAULT_GRAB_MULTIPLIER = Scale.SQUARE_100M.value;
    9294
    9395    public CadastrePreferenceSetting() {
     
    220222        bgGrabMultiplier.add(grabMultiplier3);
    221223        bgGrabMultiplier.add(grabMultiplier4);
    222         String currentScale = Main.pref.get("cadastrewms.scale", "1");
     224        String currentScale = Main.pref.get("cadastrewms.scale", DEFAULT_GRAB_MULTIPLIER);
    223225        if (currentScale.equals(Scale.X1.value))
    224226            grabMultiplier1.setSelected(true);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java

    r29668 r29677  
    145145            handleNewCoordinates(ea.east(), ea.north());
    146146        } else {
    147             countMouseClicked++;
    148147            // ignore clicks outside the image
    149148            if (ea.east() < wmsLayer.getImage(0).min.east() || ea.east() > wmsLayer.getImage(0).max.east()
    150149                    || ea.north() < wmsLayer.getImage(0).min.north() || ea.north() > wmsLayer.getImage(0).max.north())
     150            {
     151                System.out.println("ignore clic outside the image");
    151152                return;
     153            }
     154            countMouseClicked++;
    152155            if (mode == cGetCorners) {
    153156                if (countMouseClicked == 1) {
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java

    r26835 r29677  
    162162                        CadastrePreferenceSetting.DEFAULT_RASTER_DIVIDER)));
    163163            } else
    164                 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.scale", Scale.X1.toString())));
     164                divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.scale", CadastrePreferenceSetting.DEFAULT_GRAB_MULTIPLIER)));
    165165        }
    166166        grabThread.addImages(dividedBbox);
     
    194194            // divide to fixed size squares
    195195            // grab all square in a spiral starting from the center (usually the most interesting place)
    196             int c = Integer.parseInt(Main.pref.get("cadastrewms.squareSize", "100"));
     196            int c = Integer.parseInt(Main.pref.get("cadastrewms.squareSize", String.valueOf(CadastrePreferenceSetting.DEFAULT_SQUARE_SIZE)));
    197197            lambertMin = lambertMin.add(- minEast%c, - minNorth%c);
    198198            lambertMax = lambertMax.add(c - lambertMax.east()%c, c - lambertMax.north()%c);
Note: See TracChangeset for help on using the changeset viewer.