Changeset 22547 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2010-08-03T08:11:51+02:00 (15 years ago)
- 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 17 17 ** 18 18 ** To build against the core in ../../core, create a correct manifest and deploy to 19 ** SVN, 19 ** SVN, 20 20 ** set the properties commit.message and plugin.main.version 21 21 ** and run … … 30 30 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 31 31 <property name="ant.build.javac.target" value="1.5"/> 32 33 32 33 34 34 35 35 <property name="commit.message" value="Changed constructor for Plugin" /> 36 <property name="plugin.main.version" value="3 174" />37 36 <property name="plugin.main.version" value="3408" /> 37 38 38 <target name="init"> 39 39 <mkdir dir="${plugin.build.dir}"/> … … 87 87 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 88 88 </target> 89 89 90 90 <!-- 91 ************************** Publishing the plugin *********************************** 91 ************************** Publishing the plugin *********************************** 92 92 --> 93 93 <!-- 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 95 95 ** property ${coreversion.info.entry.revision} 96 96 ** … … 104 104 </exec> 105 105 <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> 107 107 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo> 108 108 <delete file="core.info.xml" /> … … 119 119 <arg value="-m '${commit.message}'"/> 120 120 <arg value="."/> 121 </exec> 121 </exec> 122 122 </target> 123 123 … … 131 131 <arg value="up"/> 132 132 <arg value="."/> 133 </exec> 133 </exec> 134 134 <echo>Updating ${plugin.jar} ...</echo> 135 135 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> … … 137 137 <arg value="up"/> 138 138 <arg value="../dist/${plugin.jar}"/> 139 </exec> 139 </exec> 140 140 </target> 141 141 142 142 <!-- 143 ** commits the plugin.jar 143 ** commits the plugin.jar 144 144 --> 145 145 <target name="commit-dist"> 146 146 <echo> 147 147 ***** Properties of published ${plugin.jar} ***** 148 Commit message : '${commit.message}' 148 Commit message : '${commit.message}' 149 149 Plugin-Mainversion: ${plugin.main.version} 150 150 JOSM build version: ${coreversion.info.entry.revision} 151 151 Plugin-Version : ${version.entry.commit.revision} 152 ***** / Properties of published ${plugin.jar} ***** 153 152 ***** / Properties of published ${plugin.jar} ***** 153 154 154 Now commiting ${plugin.jar} ... 155 </echo> 155 </echo> 156 156 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 157 157 <env key="LANG" value="C"/> 158 158 <arg value="-m '${commit.message}'"/> 159 <arg value="commit"/> 159 <arg value="commit"/> 160 160 <arg value="${plugin.jar}"/> 161 </exec> 161 </exec> 162 162 </target> 163 163 164 164 <target name="publish" depends="core-info,commit-current,update-current,clean,dist,commit-dist"> 165 165 </target> -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r22153 r22547 5 5 6 6 import java.awt.Color; 7 import java.awt.Component;8 7 import java.awt.Graphics; 9 8 import java.awt.Graphics2D; … … 22 21 import java.util.Vector; 23 22 23 import javax.swing.Action; 24 24 import javax.swing.Icon; 25 25 import javax.swing.ImageIcon; 26 import javax.swing.JMenuItem;27 26 import javax.swing.JOptionPane; 28 27 … … 44 43 public class WMSLayer extends Layer implements ImageObserver { 45 44 46 Component[] component = null;47 48 45 private int lambertZone = -1; 49 46 … … 59 56 */ 60 57 protected final int serializeFormatVersion = 4; 61 58 62 59 public static int currentFormat; 63 60 64 61 private static final int cBBoxForBuildings = 50; // hard coded size of grabbed boxes for building layers 65 62 … … 69 66 70 67 private String location = ""; 71 68 72 69 private String departement = ""; 73 70 … … 88 85 private double rasterRatio; 89 86 90 private JMenuItemsaveAsPng;91 87 private Action saveAsPng; 88 92 89 public boolean adjustModeEnabled; 93 90 … … 106 103 } 107 104 108 public void destroy() { 105 @Override 106 public void destroy() { 109 107 // if the layer is currently saving the images in the cache, wait until it's finished 110 108 if (cacheControl != null) { … … 119 117 System.out.println("Layer "+location+" destroyed"); 120 118 } 121 119 122 120 private static String buildName(String location, String codeCommune, boolean buildingOnly) { 123 String ret = new String(location.toUpperCase());121 String ret = location.toUpperCase(); 124 122 if (codeCommune != null && !codeCommune.equals("")) 125 123 ret += "(" + codeCommune + ")"; … … 136 134 grab(grabber, b, true); 137 135 } 138 136 139 137 public void grab(CadastreGrabber grabber, Bounds b, boolean useFactor) throws IOException { 140 138 cancelled = false; … … 225 223 } else { 226 224 // 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; 228 226 minEast = minEast - minEast % cSquare; 229 227 minNorth = minNorth - minNorth % cSquare; … … 286 284 if (this.adjustModeEnabled) { 287 285 WMSAdjustAction.paintAdjustFrames(g, mv); 288 } 286 } 289 287 } 290 288 … … 303 301 304 302 @Override 305 public Component[] getMenuEntries() {306 saveAsPng = new JMenuItem(newMenuActionSaveRasterAs(this));303 public Action[] getMenuEntries() { 304 saveAsPng = new MenuActionSaveRasterAs(this); 307 305 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(), 311 310 saveAsPng, 312 new JMenuItem(newLayerListPopup.InfoAction(this)),311 new LayerListPopup.InfoAction(this), 313 312 314 313 }; 315 return component;316 314 } 317 315 … … 443 441 double ratio = rasterSizeY/rasterSizeX; 444 442 // 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); 447 445 rasterRatio = (rasterMax.getX()-rasterMin.getX())/rasterSizeX; 448 446 } … … 598 596 rasterRatio = (rasterMax.getX()-rasterMin.getX())/(communeBBox.max.getX() - communeBBox.min.getX()); 599 597 } 600 598 601 599 public EastNorthBound getCommuneBBox() { 602 600 return communeBBox; … … 640 638 // double proportion = dst1.distance(dst2)/org1.distance(org2); 641 639 images.get(0).rotate(rasterCenter, angle); 642 this.angle += angle; 640 this.angle += angle; 643 641 } 644 642
Note:
See TracChangeset
for help on using the changeset viewer.