Changeset 14120 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2009-03-18T15:55:16+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/build.xml
r14015 r14120 26 26 <attribute name="Plugin-Description" value="A special handler for the french land registry WMS server."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/> 28 <attribute name="Plugin-Mainversion" value="14 65"/>28 <attribute name="Plugin-Mainversion" value="1498"/> 29 29 <attribute name="Plugin-Stage" value="60"/> 30 30 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r13784 r14120 1 1 package cadastre_fr; 2 2 3 import static org.openstreetmap.josm.tools.I18n.marktr; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 4 5 … … 10 11 import javax.swing.JCheckBoxMenuItem; 11 12 import javax.swing.JMenu; 12 import javax.swing.JMenuBar;13 13 import javax.swing.JMenuItem; 14 14 import javax.swing.JOptionPane; … … 20 20 import org.openstreetmap.josm.actions.UploadAction.UploadHook; 21 21 import org.openstreetmap.josm.gui.IconToggleButton; 22 import org.openstreetmap.josm.gui.MainMenu; 22 23 import org.openstreetmap.josm.gui.MapFrame; 23 24 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 26 27 27 28 /** 28 * 29 * 29 30 * Plugin to access the french Cadastre WMS server at www.cadastre.gouv.fr This 30 31 * WMS server requires some specific handling like retrieving a cookie for a 31 32 * limitation in case of no activity, or the request to the server shall provide 32 33 * a city/town/village code. 33 * 34 * @author Pieren <pieren3@gmail.com>, 34 * 35 * @author Pieren <pieren3@gmail.com>, 35 36 * @author <matthieu.lochegnies@gmail.com> for the extension to codeCommune 36 37 * @version 0.8 37 * History: 38 * 0.1 17-Jun-2008 first prototype using a first Lambert projection impl. in core 38 * History: 39 * 0.1 17-Jun-2008 first prototype using a first Lambert projection impl. in core 39 40 * 0.2 22-Jun-2008 first stable version 40 41 * 0.3 24-Jun-2008 add code departement … … 43 44 * - add option to force a Lambert zone (for median locations) 44 45 * - add auto-sourcing 45 * 0.5 16-Aug-2008 - add transparency in layer (allowing multiple wms layers displayed together) 46 * 0.5 16-Aug-2008 - add transparency in layer (allowing multiple wms layers displayed together) 46 47 * - no overlapping of grabbed images if transparency is enabled 47 48 * - set one layer per location … … 61 62 * - validate projection name by Lambert.toString() method 62 63 * 0.8 25-Jan-2009 - display returned list of communes if direct name is not recognized by server 63 * - new possible grab factor of 100 square meters fixed size 64 * - new possible grab factor of 100 square meters fixed size 64 65 * - minor fixes due to changes in JOSM core classes 65 * - first draft of raster image support 66 * - first draft of raster image support 66 67 * 0.9 05-Feb-2009 - grab vectorized full commune bbox, save in file, convert to OSM way 67 68 * and simplify 68 * 1.0 18-Feb-2009 - fix various bugs in color management and preference dialog 69 * 1.0 18-Feb-2009 - fix various bugs in color management and preference dialog 69 70 * - increase PNG picture size requested to WMS (800x1000) 70 * - set 4th grab scale fixed size configurable (from 25 to 1000 meters) 71 * - set 4th grab scale fixed size configurable (from 25 to 1000 meters) 71 72 */ 72 73 public class CadastrePlugin extends Plugin { … … 78 79 79 80 public static String source = ""; 80 81 81 82 // true if the checkbox "auto-sourcing" is set in the plugin menu 82 83 public static boolean autoSourcing = false; 83 84 84 85 // true when the plugin is first used, e.g. grab from WMS or download cache file 85 86 public static boolean pluginUsed = false; 86 87 87 88 public static String cacheDir = null; 88 89 89 90 public static boolean alterColors = false; 90 91 91 92 public static boolean backgroundTransparent = false; 92 93 93 94 public static float transparency = 1.0f; 94 95 95 96 public static boolean drawBoundaries = false; 96 97 97 98 static private boolean menuEnabled = false; 98 99 99 100 /** 100 101 * Creates the plugin and setup the default settings if necessary 101 * 102 * 102 103 * @throws Exception 103 104 */ … … 123 124 public void refreshMenu() throws Exception { 124 125 boolean isLambertProjection = Main.proj.toString().equals(new Lambert().toString()); 125 JMenuBarmenu = Main.main.menu;126 MainMenu menu = Main.main.menu; 126 127 127 128 if (cadastreJMenu == null) { 128 cadastreJMenu = new JMenu(tr("Cadastre")); 129 cadastreJMenu.setMnemonic(KeyEvent.VK_C); 130 menu.add(cadastreJMenu, menu.getMenuCount()-2); 129 cadastreJMenu = menu.addMenu(marktr("Cadastre"), KeyEvent.VK_C, menu.defaultMenuPos); 131 130 if (isLambertProjection) { 132 131 JosmAction grab = new MenuActionGrab(); … … 138 137 JMenuItem menuSettings = new JMenuItem(new MenuActionNewLocation()); 139 138 final JCheckBoxMenuItem menuSource = new JCheckBoxMenuItem(tr("Auto sourcing")); 140 menuSource.setSelected(autoSourcing); 139 menuSource.setSelected(autoSourcing); 141 140 menuSource.addActionListener(new ActionListener() { 142 141 public void actionPerformed(ActionEvent ev) { … … 145 144 } 146 145 }); 147 146 148 147 JMenuItem menuResetCookie = new JMenuItem(new MenuActionResetCookie()); 149 148 JMenuItem menuLambertZone = new JMenuItem(new MenuActionLambertZone()); … … 151 150 //JMenuItem menuActionBoundaries = new JMenuItem(new MenuActionBoundaries()); 152 151 //JMenuItem menuActionBuildings = new JMenuItem(new MenuActionBuildings()); 153 152 154 153 cadastreJMenu.add(menuGrab); 155 154 cadastreJMenu.add(menuSettings); … … 159 158 cadastreJMenu.add(menuLoadFromCache); 160 159 // all SVG features disabled until official WMS is released 161 //cadastreJMenu.add(menuActionBoundaries); 160 //cadastreJMenu.add(menuActionBoundaries); 162 161 //cadastreJMenu.add(menuActionBuildings); 163 162 } else {
Note:
See TracChangeset
for help on using the changeset viewer.