Changeset 33536 in osm for applications
- Timestamp:
- 2017-08-26T02:33:23+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/trustosm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/trustosm/build.xml
r32680 r33536 5 5 <property name="commit.message" value="New plugin for digital signing osm data"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 0580" />7 <property name="plugin.main.version" value="12663" /> 8 8 <property name="plugin.author" value="Christoph Wagner" /> 9 9 <property name="plugin.class" value="org.openstreetmap.josm.plugins.trustosm.TrustOSMplugin" /> -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/TrustOSMplugin.java
r32903 r33536 29 29 import org.openstreetmap.josm.Main; 30 30 import org.openstreetmap.josm.actions.ExtensionFileFilter; 31 import org.openstreetmap.josm.gui.MainApplication; 31 32 import org.openstreetmap.josm.gui.MainMenu; 32 33 import org.openstreetmap.josm.gui.MapFrame; … … 41 42 import org.openstreetmap.josm.plugins.trustosm.io.SigImporter; 42 43 import org.openstreetmap.josm.plugins.trustosm.util.TrustGPG; 44 import org.openstreetmap.josm.tools.Logging; 43 45 44 46 public class TrustOSMplugin extends Plugin { … … 102 104 c.doFinal(data); 103 105 } catch (InvalidKeyException e) { 104 Main.warn(e, "It seems that the Unrestricted Policy Files are not available in this JVM. "+105 "So high level crypto is not allowed. Problems may occur." );106 Logging.log(Logging.LEVEL_WARN, "It seems that the Unrestricted Policy Files are not available in this JVM. "+ 107 "So high level crypto is not allowed. Problems may occur.", e); 106 108 installUnrestrictedPolicyFiles(); 107 109 } catch (BadPaddingException | IllegalBlockSizeException | NoSuchPaddingException | NoSuchAlgorithmException e) { 108 Main.error(e);110 Logging.error(e); 109 111 } 110 112 } … … 254 256 255 257 public static void refreshMenu() { 256 MainMenu menu = Main .main.menu;258 MainMenu menu = MainApplication.getMenu(); 257 259 258 260 if (gpgJMenu == null) { -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/actions/GetMissingDataAction.java
r32533 r33536 15 15 import org.openstreetmap.josm.actions.JosmAction; 16 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 import org.openstreetmap.josm.gui.MainApplication; 17 18 import org.openstreetmap.josm.plugins.trustosm.TrustOSMplugin; 18 19 import org.openstreetmap.josm.plugins.trustosm.data.TrustOsmPrimitive; … … 50 51 51 52 if (n == JOptionPane.YES_OPTION) { 52 Main .worker.submit(new DownloadSignedOsmDataTask(missingData, Main.getLayerManager().getEditLayer()));53 MainApplication.worker.submit(new DownloadSignedOsmDataTask(missingData, getLayerManager().getEditLayer())); 53 54 return true; 54 55 } … … 59 60 60 61 public void getMissing(Map<String, TrustOsmPrimitive> trustitems, Collection<OsmPrimitive> missingData) { 61 Collection<OsmPrimitive> presentData = Main.getLayerManager().getEditDataSet().allPrimitives();62 Collection<OsmPrimitive> presentData = getLayerManager().getEditDataSet().allPrimitives(); 62 63 for (TrustOsmPrimitive t : trustitems.values()) { 63 64 OsmPrimitive osm = t.getOsmPrimitive(); -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/data/TrustSignatures.java
r32533 r33536 14 14 import org.bouncycastle.bcpg.BCPGOutputStream; 15 15 import org.bouncycastle.openpgp.PGPSignature; 16 import org.openstreetmap.josm. Main;16 import org.openstreetmap.josm.tools.Logging; 17 17 18 18 public class TrustSignatures { … … 146 146 147 147 } catch (Exception e) { 148 Main.error(e);148 Logging.error(e); 149 149 return "Error - read console Output"; 150 150 } … … 168 168 return baos.toString("UTF-8"); 169 169 } catch (Exception e) { 170 Main.error(e);170 Logging.error(e); 171 171 return "Error - read console Output"; 172 172 } -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/DownloadSignedOsmDataTask.java
r33058 r33536 10 10 import javax.swing.SwingUtilities; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.actions.AutoScaleAction; 14 13 import org.openstreetmap.josm.data.osm.DataSet; 15 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 15 import org.openstreetmap.josm.gui.ExceptionDialogUtil; 16 import org.openstreetmap.josm.gui.MainApplication; 17 17 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 18 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 53 53 @Override 54 54 protected void finish() { 55 Main .map.repaint();55 MainApplication.getMap().repaint(); 56 56 if (canceled) 57 57 return; -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustDialog.java
r33057 r33536 39 39 import javax.swing.tree.TreePath; 40 40 41 import org.openstreetmap.josm.Main;42 41 import org.openstreetmap.josm.actions.JosmAction; 43 42 import org.openstreetmap.josm.data.Bounds; 44 43 import org.openstreetmap.josm.data.SelectionChangedListener; 45 44 import org.openstreetmap.josm.data.osm.DataSet; 45 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 46 46 import org.openstreetmap.josm.data.osm.Node; 47 47 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 51 51 import org.openstreetmap.josm.data.osm.WaySegment; 52 52 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 53 import org.openstreetmap.josm.gui. DefaultNameFormatter;53 import org.openstreetmap.josm.gui.MainApplication; 54 54 import org.openstreetmap.josm.gui.MapView; 55 55 import org.openstreetmap.josm.gui.SideButton; … … 158 158 KeyEvent.VK_T, Shortcut.ALT_CTRL), 150); 159 159 160 Main .map.mapView.addTemporaryLayer(this);160 MainApplication.getMap().mapView.addTemporaryLayer(this); 161 161 162 162 // setting up the properties table … … 268 268 } 269 269 } 270 Main .map.mapView.repaint();270 MainApplication.getMap().mapView.repaint(); 271 271 } 272 272 }); … … 647 647 648 648 // sanity checks 649 if (Main .map.mapView == null) return;649 if (MainApplication.getMap().mapView == null) return; 650 650 651 651 Graphics2D g2 = g; -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/gui/dialogs/TrustSignaturesDialog.java
r32533 r33536 22 22 import org.jdesktop.swingx.JXTreeTable; 23 23 import org.openstreetmap.josm.Main; 24 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 24 25 import org.openstreetmap.josm.data.osm.Node; 25 import org.openstreetmap.josm.gui.DefaultNameFormatter;26 26 import org.openstreetmap.josm.gui.ExtendedDialog; 27 27 import org.openstreetmap.josm.plugins.trustosm.TrustOSMplugin; -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigImporter.java
r32533 r33536 11 11 import java.util.Map; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.actions.ExtensionFileFilter; 15 14 import org.openstreetmap.josm.data.osm.DataSet; 15 import org.openstreetmap.josm.gui.MainApplication; 16 16 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 17 17 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; … … 44 44 45 45 protected void importData(InputStream in, File associatedFile) throws IllegalDataException { 46 if (Main .getLayerManager().getEditLayer() == null) {46 if (MainApplication.getLayerManager().getEditLayer() == null) { 47 47 DataSet dataSet = new DataSet(); 48 48 final OsmDataLayer layer = new OsmDataLayer(dataSet, associatedFile.getName(), associatedFile); 49 Main .getLayerManager().addLayer(layer);49 MainApplication.getLayerManager().addLayer(layer); 50 50 } 51 51 // Set<OsmPrimitive> missingData = new HashSet<OsmPrimitive>(); -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/io/SigReader.java
r33058 r33536 21 21 import org.bouncycastle.openpgp.PGPObjectFactory; 22 22 import org.bouncycastle.openpgp.PGPSignatureList; 23 import org.openstreetmap.josm.Main;24 23 import org.openstreetmap.josm.data.osm.Node; 25 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 28 27 import org.openstreetmap.josm.data.osm.RelationMember; 29 28 import org.openstreetmap.josm.data.osm.Way; 29 import org.openstreetmap.josm.gui.MainApplication; 30 30 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 31 31 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 104 104 105 105 // search corresponding OsmPrimitive 106 OsmPrimitive osm = Main .getLayerManager().getEditDataSet().getPrimitiveById(uid, t);106 OsmPrimitive osm = MainApplication.getLayerManager().getEditDataSet().getPrimitiveById(uid, t); 107 107 if (osm == null) { 108 108 switch (t) { -
applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustGPG.java
r33057 r33536 94 94 import org.openstreetmap.josm.tools.GBC; 95 95 import org.openstreetmap.josm.tools.ImageProvider; 96 import org.openstreetmap.josm.tools.Logging; 96 97 97 98 import com.toedter.calendar.JDateChooser; … … 155 156 generateKey(); 156 157 } catch (Exception e) { 157 Main.error(e);158 Main.error("GPG Key Ring File could not be created in: "+158 Logging.error(e); 159 Logging.error("GPG Key Ring File could not be created in: "+ 159 160 Main.pref.getPluginsDirectory().getPath() + "/trustosm/gnupg/secring.gpg"); 160 161 } … … 242 243 } 243 244 } catch (NoSuchAlgorithmException | NoSuchProviderException | PGPException | IOException e) { 244 Main.error(e);245 Logging.error(e); 245 246 } 246 247 } });
Note:
See TracChangeset
for help on using the changeset viewer.