Changeset 13545 in osm for applications/editors/josm/plugins/cadastre-fr
- Timestamp:
- 2009-02-05T01:00:53+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 4 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
r13497 r13545 117 117 } catch (Exception ex) { 118 118 ex.printStackTrace(System.out); 119 JOptionPane 120 .showMessageDialog(Main.parent, tr("Error loading file"), tr("Error"), JOptionPane.ERROR_MESSAGE); 119 JOptionPane.showMessageDialog(Main.parent, tr("Error loading file"), tr("Error"), JOptionPane.ERROR_MESSAGE); 121 120 return false; 122 121 } … … 125 124 126 125 127 public boolean existCache() {128 try {129 /*130 File pathname = new File(CadastrePlugin.cacheDir);131 String[] fileNames = pathname.list();132 for (String fileName : fileNames) {133 System.out.println("check file:"+fileName);134 //WMSLayer cached = new WMSLayer(new File(cacheDir+fileName));135 }*/136 } catch (Exception e) {137 e.printStackTrace(System.out);138 }139 return false;140 }141 142 126 public synchronized void saveCache(GeorefImage image) { 143 127 imagesLock.lock(); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r13497 r13545 64 64 * - minor fixes due to changes in JOSM core classes 65 65 * - first draft of raster image support 66 * 0.9 draft - grab vectorized full commune bbox and save it in cache 66 * 0.9 05-Feb-2009 - grab vectorized full commune bbox, save in file, convert to OSM way 67 * and simplify 67 68 */ 68 69 public class CadastrePlugin extends Plugin { … … 151 152 JMenuItem menuLambertZone = new JMenuItem(new MenuActionLambertZone()); 152 153 JMenuItem menuLoadFromCache = new JMenuItem(new MenuActionLoadFromCache()); 154 JMenuItem menuActionBoundaries = new JMenuItem(new MenuActionBoundaries()); 153 155 154 156 cadastreJMenu.add(menuGrab); … … 158 160 cadastreJMenu.add(menuLambertZone); 159 161 cadastreJMenu.add(menuLoadFromCache); 162 cadastreJMenu.add(menuActionBoundaries); 160 163 } 161 164 setEnabledAll(menuEnabled); … … 187 190 JMenuItem item = cadastreJMenu.getItem(i); 188 191 if (item != null) 189 if (item.getText().equals(MenuActionGrab.name)) 192 if (item.getText().equals(MenuActionGrab.name) || 193 item.getText().equals(MenuActionBoundaries.name)) { 190 194 item.setEnabled(isEnabled); 191 else if (item.getText().equals(MenuActionLambertZone.name))195 } else if (item.getText().equals(MenuActionLambertZone.name)) { 192 196 item.setEnabled(!isEnabled); 197 } 193 198 } 194 199 menuEnabled = isEnabled; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
r13497 r13545 46 46 } 47 47 if (!sel.isEmpty()) { 48 returndisplaySource(sel);48 displaySource(sel); 49 49 } 50 50 } … … 70 70 * source="cadastre.." if it is approved. 71 71 * @param sel the list of elements added without a key "source" 72 * @return true if it is accepted by user73 72 */ 74 private booleandisplaySource(Collection<OsmPrimitive> sel)73 private void displaySource(Collection<OsmPrimitive> sel) 75 74 { 76 boolean bContinue = true;77 75 if (!sel.isEmpty()) { 78 76 JPanel p = new JPanel(new GridBagLayout()); … … 83 81 l.setVisibleRowCount(l.getModel().getSize() < 6 ? l.getModel().getSize() : 10); 84 82 p.add(new JScrollPane(l), GBC.eol().fill()); 85 b Continue = JOptionPane.showConfirmDialog(Main.parent, p, tr("Add \"source=...\" to elements?"),83 boolean bContinue = JOptionPane.showConfirmDialog(Main.parent, p, tr("Add \"source=Cadastre...\" to ?"), 86 84 JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION; 87 85 if (bContinue) 88 86 Main.main.undoRedo.add(new ChangePropertyCommand(sel, "source", CadastrePlugin.source)); 89 87 } 90 return bContinue;91 88 92 89 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSTask.java
r13497 r13545 60 60 @Override 61 61 protected void finish() { 62 //wmsLayer.saveToCache();63 62 } 64 63 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/EastNorthBound.java
r13497 r13545 14 14 this.max = max; 15 15 } 16 17 public boolean contains(EastNorth eastNorth) { 18 if (eastNorth.east() < min.east() || eastNorth.north() < min.north()) 19 return false; 20 if (eastNorth.east() > max.east() || eastNorth.north() > max.north()) 21 return false; 22 return true; 23 } 24 16 25 @Override public String toString() { 17 26 return "EastNorthBound[" + min.east() + "," + min.north() + "," + max.east() + "," + max.north() + "]"; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/ImageModifier.java
r13497 r13545 28 28 public ImageModifier(BufferedImage bi) { 29 29 bufferedImage = bi; 30 System.out.println("cadastrewms.alterColors="+Main.pref.getBoolean("cadastrewms.alterColors")); 31 System.out.println("cadastrewms.backgroundTransparent="+Main.pref.getBoolean("cadastrewms.backgroundTransparent")); 30 32 if (Main.pref.getBoolean("cadastrewms.alterColors")) { 31 33 changeColors(); … … 47 49 int josmBackgroundColor = ColorHelper.html2color(Main.pref.get("color.background", "#FFFFFF")).getRGB(); 48 50 boolean invertGrey = (Main.pref.getBoolean("cadastrewms.invertGrey")); 51 System.out.println("cadastrewms.invertGrey="+invertGrey); 52 System.out.println("color.background="+Main.pref.get("color.background", "#FFFFFF")); 49 53 for (int x = 0; x < w; x++) { 50 54 for (int y = 0; y < h; y++) { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
r13497 r13545 48 48 String codeCommune = ""; 49 49 boolean resetCookie = false; 50 JLabel labelSectionNewLocation = new JLabel(tr("Add new layer"));50 JLabel labelSectionNewLocation = new JLabel(tr("Add a new layer")); 51 51 JPanel p = new JPanel(new GridBagLayout()); 52 52 JLabel labelLocation = new JLabel(tr("Location")); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java
r13497 r13545 5 5 import java.awt.event.ActionEvent; 6 6 import java.util.ArrayList; 7 8 import javax.swing.JOptionPane; 7 9 8 10 import org.openstreetmap.josm.Main; … … 14 16 private static final long serialVersionUID = 1L; 15 17 16 //private String layerName;17 18 18 public WMSDownloadAction(String layerName) { 19 19 super(layerName, "wmsmenu", tr("Download WMS tile from {0}",layerName), null, false); … … 38 38 if (existingWMSlayers.size() == 1) 39 39 return existingWMSlayers.get(0); 40 return new MenuActionNewLocation().addNewLayer(existingWMSlayers); 40 if (existingWMSlayers.size() == 0) 41 return new MenuActionNewLocation().addNewLayer(existingWMSlayers); 42 JOptionPane.showMessageDialog(Main.parent, 43 tr("More than one WMS layer present\nSelect one of them first, then retry")); 41 44 } 42 45 return null; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r13497 r13545 180 180 @Override 181 181 public String getToolTipText() { 182 return tr("WMS layer ({0}), {1} tile(s) loaded", name, images.size()); 182 String str = tr("WMS layer ({0}), {1} tile(s) loaded", name, images.size()); 183 if (isRaster) { 184 str += "\n"+tr("Is not vectorized."); 185 str += "\n"+tr("Raster center: {0}", rasterCenter); 186 } else 187 str += "\n"+tr("Is vectorized."); 188 str += "\n"+tr("Commune bbox: {0}", communeBBox); 189 return str; 183 190 } 184 191
Note:
See TracChangeset
for help on using the changeset viewer.