Ignore:
Timestamp:
2013-08-01T15:45:24+02:00 (12 years ago)
Author:
pieren
Message:

Fix transparency issue on new raster images. Temporary disable georeferences parsing not working on new cadastre WMS. Workaround on address help tool when switching to full screen.

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/Address.java

    r28372 r29801  
    113113            Main.map.mapView.removeMouseListener(this);
    114114        }
    115         dialog.setVisible(false);
     115//        dialog.setVisible(false);
     116        // kill the window completely to fix an issue on some linux distro and
     117        // full screen mode.
     118        if(dialog != null)
     119        {
     120            dialog.dispose();
     121            dialog = null;
     122        }
    116123    }
    117124
     
    132139            setNewSelection(currentMouseNode);
    133140            String num = currentMouseNode.get(tagHouseNumber);
    134             if (num != null //
    135                     && currentMouseNode.get(tagHouseStreet) == null //
    136                     && findWayInRelationAddr(currentMouseNode) == null //
     141            if (num != null
     142                    && currentMouseNode.get(tagHouseStreet) == null
     143                    && findWayInRelationAddr(currentMouseNode) == null
    137144                    && !inputStreet.getText().equals("")) {
    138                 // address already present but not linked to a street
     145                // house number already present but not linked to a street
    139146                Collection<Command> cmds = new LinkedList<Command>();
    140147                addStreetNameOrRelation(currentMouseNode, cmds);
     
    154161                }
    155162                if (currentMouseNode.get(tagHouseStreet) != null) {
    156                     inputStreet.setText(currentMouseNode.get(tagHouseStreet));
    157                     if (ctrl) {
    158                         Collection<Command> cmds = new LinkedList<Command>();
    159                         addAddrToPrimitive(currentMouseNode, cmds);
    160                         if (num == null)
    161                             applyInputNumberChange();
     163                    if(Main.pref.getBoolean("cadastrewms.addr.dontUseRelation", false)) {
     164                        inputStreet.setText(currentMouseNode.get(tagHouseStreet));
     165                        if (ctrl) {
     166                            Collection<Command> cmds = new LinkedList<Command>();
     167                            addAddrToPrimitive(currentMouseNode, cmds);
     168                            if (num == null)
     169                                applyInputNumberChange();
     170                        }
     171                        setSelectedWay((Way)null);
    162172                    }
    163                     setSelectedWay((Way)null);
    164173                } else {
    165174                    // check if the node belongs to an associatedStreet relation
     
    528537        } else
    529538            link.setEnabled(true);
     539        link.repaint();
    530540    }
    531541   
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java

    r29525 r29801  
    508508
    509509    private void parseGeoreferences(WMSLayer wmsLayer, String input) {
    510         if (input.lastIndexOf(cBBoxCommunStart) != -1) {
    511             input = input.substring(input.lastIndexOf(cBBoxCommunStart));
    512             input = input.substring(input.indexOf(cBBoxCommunEnd)+cBBoxCommunEnd.length());
    513             int i = input.indexOf(",");
    514             int j = input.indexOf(",", i+1);
    515             String str = input.substring(i+1, j);
    516             double unknown_yet = tryParseDouble(str);
    517             int j_ = input.indexOf(",", j+1);
    518             double angle = Double.parseDouble(input.substring(j+1, j_));
    519             int k = input.indexOf(",", j_+1);
    520             double scale_origin = Double.parseDouble(input.substring(j_+1, k));
    521             int l = input.indexOf(",", k+1);
    522             double dpi = Double.parseDouble(input.substring(k+1, l));
    523             int m = input.indexOf(",", l+1);
    524             double fX = Double.parseDouble(input.substring(l+1, m));
    525             int n = input.indexOf(",", m+1);
    526             double fY = Double.parseDouble(input.substring(m+1, n));
    527             int o = input.indexOf(",", n+1);
    528             double X0 = Double.parseDouble(input.substring(n+1, o));
    529             int p = input.indexOf(",", o+1);
    530             double Y0 = Double.parseDouble(input.substring(o+1, p));
    531             if (X0 != 0.0 && Y0 != 0) {
    532                 wmsLayer.setAlreadyGeoreferenced(true);
    533                 wmsLayer.fX = fX;
    534                 wmsLayer.fY = fY;
    535                 wmsLayer.angle = angle;
    536                 wmsLayer.X0 = X0;
    537                 wmsLayer.Y0 = Y0;
    538             }
    539             System.out.println("parse georef:"+unknown_yet+","+angle+","+scale_origin+","+dpi+","+fX+","+
    540                     fY+","+X0+","+Y0);
    541         }
     510        /* commented since cadastre WMS changes mid july 2013
     511         * until new GeoBox coordinates parsing is solved */
     512//        if (input.lastIndexOf(cBBoxCommunStart) != -1) {
     513//            input = input.substring(input.lastIndexOf(cBBoxCommunStart));
     514//            input = input.substring(input.indexOf(cBBoxCommunEnd)+cBBoxCommunEnd.length());
     515//            int i = input.indexOf(",");
     516//            int j = input.indexOf(",", i+1);
     517//            String str = input.substring(i+1, j);
     518//            double unknown_yet = tryParseDouble(str);
     519//            int j_ = input.indexOf(",", j+1);
     520//            double angle = Double.parseDouble(input.substring(j+1, j_));
     521//            int k = input.indexOf(",", j_+1);
     522//            double scale_origin = Double.parseDouble(input.substring(j_+1, k));
     523//            int l = input.indexOf(",", k+1);
     524//            double dpi = Double.parseDouble(input.substring(k+1, l));
     525//            int m = input.indexOf(",", l+1);
     526//            double fX = Double.parseDouble(input.substring(l+1, m));
     527//            int n = input.indexOf(",", m+1);
     528//            double fY = Double.parseDouble(input.substring(m+1, n));
     529//            int o = input.indexOf(",", n+1);
     530//            double X0 = Double.parseDouble(input.substring(n+1, o));
     531//            int p = input.indexOf(",", o+1);
     532//            double Y0 = Double.parseDouble(input.substring(o+1, p));
     533//            if (X0 != 0.0 && Y0 != 0) {
     534//                wmsLayer.setAlreadyGeoreferenced(true);
     535//                wmsLayer.fX = fX;
     536//                wmsLayer.fY = fY;
     537//                wmsLayer.angle = angle;
     538//                wmsLayer.X0 = X0;
     539//                wmsLayer.Y0 = Y0;
     540//            }
     541//            System.out.println("parse georef:"+unknown_yet+","+angle+","+scale_origin+","+dpi+","+fX+","+
     542//                    fY+","+X0+","+Y0);
     543//        }
    542544    }
    543545
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageModifier.java

    r18544 r29801  
    55import java.awt.image.BufferedImage;
    66import java.awt.image.ComponentColorModel;
     7import java.awt.image.IndexColorModel;
    78
    89import org.openstreetmap.josm.Main;
     
    6061
    6162    private void makeTransparent() {
    62         if (bufferedImage.getColorModel() instanceof ComponentColorModel) {
     63        if (bufferedImage.getColorModel() instanceof ComponentColorModel ||
     64            bufferedImage.getColorModel() instanceof IndexColorModel) {
    6365            int width = bufferedImage.getWidth();
    6466            int height = bufferedImage.getHeight();
Note: See TracChangeset for help on using the changeset viewer.