Changeset 28445 in osm for applications/editors/josm
- Timestamp:
- 2012-06-18T22:36:22+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/epsg31287
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified applications/editors/josm/plugins/epsg31287/build.xml ¶
r26605 r28445 36 36 <property name="commit.message" value="fixed proj4 Parameters (thanks to Hetzi + Mikael Rittri)"/> 37 37 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 38 <property name="plugin.main.version" value=" 4394"/>38 <property name="plugin.main.version" value="5248"/> 39 39 <!-- 40 40 ************************************************ … … 154 154 </target> 155 155 <!-- 156 ************************** Publishing the plugin *********************************** 157 --> 158 <!-- 159 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 156 ************************** Publishing the plugin *********************************** 157 --> 158 <!-- 159 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 160 160 ** property ${coreversion.info.entry.revision} 161 161 ** … … 207 207 </target> 208 208 <!-- 209 ** commits the plugin.jar 209 ** commits the plugin.jar 210 210 --> 211 211 <target name="commit-dist"> 212 212 <echo> 213 213 ***** Properties of published ${plugin.jar} ***** 214 Commit message : '${commit.message}' 214 Commit message : '${commit.message}' 215 215 Plugin-Mainversion: ${plugin.main.version} 216 216 JOSM build version: ${coreversion.info.entry.revision} 217 217 Plugin-Version : ${version.entry.commit.revision} 218 ***** / Properties of published ${plugin.jar} ***** 219 218 ***** / Properties of published ${plugin.jar} ***** 219 220 220 Now commiting ${plugin.jar} ... 221 221 </echo> -
TabularUnified applications/editors/josm/plugins/epsg31287/src/org/openstreetmap/josm/plugins/epsg31287/Epsg31287.java ¶
r25262 r28445 3 3 package org.openstreetmap.josm.plugins.epsg31287; 4 4 5 import org.openstreetmap.josm. data.projection.Projections;5 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 6 6 import org.openstreetmap.josm.plugins.Plugin; 7 7 import org.openstreetmap.josm.plugins.PluginInformation; … … 10 10 public Epsg31287(PluginInformation info) { 11 11 super(info); 12 Projection s.addProjection(new ProjectionEPSG31287());12 ProjectionPreference.registerProjectionChoice(new Epsg31287Gui()); 13 13 } 14 14 } -
TabularUnified applications/editors/josm/plugins/epsg31287/src/org/openstreetmap/josm/plugins/epsg31287/ProjectionEPSG31287.java ¶
r25122 r28445 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 6 7 import java.awt.GridBagLayout;8 import java.awt.event.ActionListener;9 7 import java.awt.geom.Point2D; 10 import java.util.Arrays;11 import java.util.Collection;12 13 import javax.swing.JLabel;14 import javax.swing.JPanel;15 import javax.swing.JTextField;16 8 17 9 import org.openstreetmap.josm.data.Bounds; 18 10 import org.openstreetmap.josm.data.coor.EastNorth; 19 11 import org.openstreetmap.josm.data.coor.LatLon; 20 import org.openstreetmap.josm.tools.GBC;21 12 22 public class ProjectionEPSG31287 implements org.openstreetmap.josm.data.projection.Projection , org.openstreetmap.josm.data.projection.ProjectionSubPrefs{13 public class ProjectionEPSG31287 implements org.openstreetmap.josm.data.projection.Projection { 23 14 24 private double dx = 0.0;25 private double dy = 0.0;15 private final double dx; 16 private final double dy; 26 17 private final static String projCode = "EPSG:31287"; 27 18 … … 29 20 30 21 public ProjectionEPSG31287() { 31 super(); 22 this(0,0); 23 } 24 25 public ProjectionEPSG31287(double dx, double dy) { 26 this.dx = dx; 27 this.dy = dy; 32 28 // use use com.jhlabs.map.proj.ProjectionFactory for doing all the math 33 29 projection = com.jhlabs.map.proj.ProjectionFactory.fromPROJ4Specification( … … 45 41 } 46 42 ); 47 }48 49 // PreferencePanel, not used in plugin mode, useful for JOSM custom-build50 @Override51 public void setupPreferencePanel(JPanel p, ActionListener actionListener) {52 //p.add(new HtmlPanel("<i>EPSG:31287 - Bessel 1841 in Lambert_Conformal_Conic_2SP</i>"), GBC.eol().fill(GBC.HORIZONTAL));53 //p.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));54 p.setLayout(new GridBagLayout());55 56 JTextField gdx = new JTextField(""+dx);57 JTextField gdy = new JTextField(""+dy);58 59 p.add(new JLabel(tr("dx")), GBC.std().insets(5,5,0,5));60 p.add(GBC.glue(1, 0), GBC.std().fill(GBC.HORIZONTAL));61 p.add(gdx, GBC.eop().fill(GBC.HORIZONTAL));62 63 p.add(new JLabel(tr("dy")), GBC.std().insets(5,5,0,5));64 p.add(GBC.glue(1, 0), GBC.std().fill(GBC.HORIZONTAL));65 p.add(gdy, GBC.eop().fill(GBC.HORIZONTAL));66 p.add(GBC.glue(1, 1), GBC.eol().fill(GBC.BOTH));67 68 }69 70 // for PreferencePanel, not used in plugin mode, useful for JOSM custom-build71 @Override72 public Collection<String> getPreferences(JPanel p) {73 dx = new Double(((JTextField)p.getComponent(2)).getText());74 dy = new Double(((JTextField)p.getComponent(5)).getText());75 return Arrays.asList(""+dx,""+dy);76 }77 78 // for PreferencePanel, not used in plugin mode, useful for JOSM custom-build79 @Override80 public Collection<String> getPreferencesFromCode(String code) {81 dx = 85.0;82 dy = 45.0;83 return null;84 }85 86 // for PreferencePanel, not used in plugin mode, useful for JOSM custom-build87 @Override88 public void setPreferences(Collection<String> args) {89 if(args != null)90 {91 String[] array = args.toArray(new String[0]);92 if (array.length > 0) {93 try {94 dx = Double.parseDouble(array[0]);95 } catch(NumberFormatException e) {}96 }97 if (array.length > 1) {98 try {99 dy = Double.parseDouble(array[1]);100 } catch(NumberFormatException e) {}101 }102 }103 43 } 104 44 … … 162 102 } 163 103 164 @Override165 public String[] allCodes() {166 return new String[] {projCode};167 }168 104 169 105 }
Note:
See TracChangeset
for help on using the changeset viewer.