Ignore:
Timestamp:
2010-08-03T08:11:51+02:00 (14 years ago)
Author:
jttt
Message:

Adapt to latest josm

Location:
applications/editors/josm/plugins/cadastre-fr
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/build.xml

    r21706 r22547  
    1717**
    1818** To build against the core in ../../core, create a correct manifest and deploy to
    19 ** SVN, 
     19** SVN,
    2020**    set the properties commit.message and plugin.main.version
    2121** and run
     
    3030    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    3131    <property name="ant.build.javac.target" value="1.5"/>
    32        
    33        
     32
     33
    3434
    3535        <property name="commit.message" value="Changed constructor for Plugin" />
    36         <property name="plugin.main.version" value="3174" />
    37        
     36        <property name="plugin.main.version" value="3408" />
     37
    3838    <target name="init">
    3939        <mkdir dir="${plugin.build.dir}"/>
     
    8787        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    8888    </target>
    89        
     89
    9090        <!--
    91                  ************************** Publishing the plugin *********************************** 
     91                 ************************** Publishing the plugin ***********************************
    9292                -->
    9393                        <!--
    94                           ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
     94                          ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    9595                          ** property ${coreversion.info.entry.revision}
    9696                          **
     
    104104                        </exec>
    105105                        <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
    106                                 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>                 
     106                                <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
    107107                                <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
    108108                                <delete file="core.info.xml" />
     
    119119                                            <arg value="-m '${commit.message}'"/>
    120120                                            <arg value="."/>
    121                             </exec>         
     121                            </exec>
    122122                        </target>
    123123
     
    131131                                            <arg value="up"/>
    132132                                            <arg value="."/>
    133                             </exec>         
     133                            </exec>
    134134                                <echo>Updating ${plugin.jar} ...</echo>
    135135                            <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     
    137137                                            <arg value="up"/>
    138138                                            <arg value="../dist/${plugin.jar}"/>
    139                             </exec>         
     139                            </exec>
    140140                        </target>
    141                        
     141
    142142                        <!--
    143                          ** commits the plugin.jar 
     143                         ** commits the plugin.jar
    144144                         -->
    145145                        <target name="commit-dist">
    146146                                        <echo>
    147147        ***** Properties of published ${plugin.jar} *****
    148         Commit message    : '${commit.message}'                                 
     148        Commit message    : '${commit.message}'
    149149        Plugin-Mainversion: ${plugin.main.version}
    150150        JOSM build version: ${coreversion.info.entry.revision}
    151151        Plugin-Version    : ${version.entry.commit.revision}
    152         ***** / Properties of published ${plugin.jar} *****                                     
    153                                                
     152        ***** / Properties of published ${plugin.jar} *****
     153
    154154        Now commiting ${plugin.jar} ...
    155         </echo>                                 
     155        </echo>
    156156                                    <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    157157                                                    <env key="LANG" value="C"/>
    158158                                                                <arg value="-m '${commit.message}'"/>
    159                                                                 <arg value="commit"/>                                           
     159                                                                <arg value="commit"/>
    160160                                                <arg value="${plugin.jar}"/>
    161                                     </exec>         
     161                                    </exec>
    162162                        </target>
    163                                        
     163
    164164                        <target name="publish" depends="core-info,commit-current,update-current,clean,dist,commit-dist">
    165165                        </target>
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java

    r22153 r22547  
    55
    66import java.awt.Color;
    7 import java.awt.Component;
    87import java.awt.Graphics;
    98import java.awt.Graphics2D;
     
    2221import java.util.Vector;
    2322
     23import javax.swing.Action;
    2424import javax.swing.Icon;
    2525import javax.swing.ImageIcon;
    26 import javax.swing.JMenuItem;
    2726import javax.swing.JOptionPane;
    2827
     
    4443public class WMSLayer extends Layer implements ImageObserver {
    4544
    46     Component[] component = null;
    47 
    4845    private int lambertZone = -1;
    4946
     
    5956     */
    6057    protected final int serializeFormatVersion = 4;
    61    
     58
    6259    public static int currentFormat;
    63    
     60
    6461    private static final int cBBoxForBuildings = 50; // hard coded size of grabbed boxes for building layers
    6562
     
    6966
    7067    private String location = "";
    71    
     68
    7269    private String departement = "";
    7370
     
    8885    private double rasterRatio;
    8986
    90     private JMenuItem saveAsPng;
    91    
     87    private Action saveAsPng;
     88
    9289    public boolean adjustModeEnabled;
    9390
     
    106103    }
    107104
    108     public void destroy() {
     105    @Override
     106        public void destroy() {
    109107        // if the layer is currently saving the images in the cache, wait until it's finished
    110108        if (cacheControl != null) {
     
    119117        System.out.println("Layer "+location+" destroyed");
    120118    }
    121    
     119
    122120    private static String buildName(String location, String codeCommune, boolean buildingOnly) {
    123         String ret = new String(location.toUpperCase());
     121        String ret = location.toUpperCase();
    124122        if (codeCommune != null && !codeCommune.equals(""))
    125123            ret += "(" + codeCommune + ")";
     
    136134        grab(grabber, b, true);
    137135    }
    138    
     136
    139137    public void grab(CadastreGrabber grabber, Bounds b, boolean useFactor) throws IOException {
    140138        cancelled = false;
     
    225223        } else {
    226224            // divide to fixed size squares
    227             int cSquare = factor == 4 ? Integer.parseInt(Main.pref.get("cadastrewms.squareSize", "100")) : optionalSize;   
     225            int cSquare = factor == 4 ? Integer.parseInt(Main.pref.get("cadastrewms.squareSize", "100")) : optionalSize;
    228226            minEast = minEast - minEast % cSquare;
    229227            minNorth = minNorth - minNorth % cSquare;
     
    286284        if (this.adjustModeEnabled) {
    287285            WMSAdjustAction.paintAdjustFrames(g, mv);
    288         }           
     286        }
    289287    }
    290288
     
    303301
    304302    @Override
    305     public Component[] getMenuEntries() {
    306         saveAsPng = new JMenuItem(new MenuActionSaveRasterAs(this));
     303    public Action[] getMenuEntries() {
     304        saveAsPng = new MenuActionSaveRasterAs(this);
    307305        saveAsPng.setEnabled(isRaster);
    308         component = new Component[] { new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)),
    309                 new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)),
    310                 new JMenuItem(new MenuActionLoadFromCache()),
     306        return new Action[] {
     307                        LayerListDialog.getInstance().createShowHideLayerAction(),
     308                LayerListDialog.getInstance().createDeleteLayerAction(),
     309                new MenuActionLoadFromCache(),
    311310                saveAsPng,
    312                 new JMenuItem(new LayerListPopup.InfoAction(this)),
     311                new LayerListPopup.InfoAction(this),
    313312
    314313        };
    315         return component;
    316314    }
    317315
     
    443441        double ratio = rasterSizeY/rasterSizeX;
    444442        // keep same ratio on screen as WMS bbox (stored in communeBBox)
    445         rasterMin = new EastNorth(eaMin.getX(), rasterCenter.getY()-(eaMax.getX()-eaMin.getX())*ratio/2); 
    446         rasterMax = new EastNorth(eaMax.getX(), rasterCenter.getY()+(eaMax.getX()-eaMin.getX())*ratio/2); 
     443        rasterMin = new EastNorth(eaMin.getX(), rasterCenter.getY()-(eaMax.getX()-eaMin.getX())*ratio/2);
     444        rasterMax = new EastNorth(eaMax.getX(), rasterCenter.getY()+(eaMax.getX()-eaMin.getX())*ratio/2);
    447445        rasterRatio = (rasterMax.getX()-rasterMin.getX())/rasterSizeX;
    448446    }
     
    598596        rasterRatio = (rasterMax.getX()-rasterMin.getX())/(communeBBox.max.getX() - communeBBox.min.getX());
    599597    }
    600    
     598
    601599    public EastNorthBound getCommuneBBox() {
    602600        return communeBBox;
     
    640638//        double proportion = dst1.distance(dst2)/org1.distance(org2);
    641639        images.get(0).rotate(rasterCenter, angle);
    642         this.angle += angle; 
     640        this.angle += angle;
    643641    }
    644642
Note: See TracChangeset for help on using the changeset viewer.