Changeset 153 in josm for src/org/openstreetmap/josm/plugins


Ignore:
Timestamp:
2006-10-07T18:14:07+02:00 (19 years ago)
Author:
imi
Message:
  • added possibility to create new download tasks (download data types).
  • removed WMS stuff (now available as landsat - plugin)
  • updated translation files
Location:
src/org/openstreetmap/josm/plugins
Files:
1 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/plugins/Plugin.java

    r149 r153  
    1313 * (or else, the plugin jar will not be within the class path).
    1414 *
    15  * All plugins should have at least one class subclassing this abstract base class. 
    16  * 
     15 * All plugins should have at least one class subclassing this abstract base class.
     16 *
    1717 * The actual implementation of this interface is optional, as all functions will be called
    1818 * via reflection. This is to be able to change this interface without the need of recompiling
     
    2525 *
    2626 *
    27  * The pluginname provided to the constructor is also the name of the directory to 
     27 * The pluginname provided to the constructor is also the name of the directory to
    2828 * store the plugin's own stuff (located under the josm preferences directory)
    2929 *
     
    4040                name = s.substring(lastSlash+1, s.length()-4);
    4141    }
    42        
     42
    4343        /**
    4444         * @return The name of this plugin. This is the name of the .jar file.
     
    5454        }
    5555
    56        
     56
    5757
    5858        /**
     
    6262         */
    6363        public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {}
    64 
    65         /**
    66          * Called to retrieve a one-liner description of what this plugin does for tooltips.
    67          * @return <code>null</code>, which means: "no description available".
    68          */
    69         public String getDescription() {return null;}
    70 
    7164}
  • src/org/openstreetmap/josm/plugins/PluginProxy.java

    r149 r153  
    66/**
    77 * Helper class for the JOSM system to communicate with the plugin.
    8  * 
     8 *
    99 * This class should be of no interest for sole plugin writer.
    10  * 
     10 *
    1111 * @author Immanuel.Scholz
    1212 */
     
    1414
    1515        public final Object plugin;
    16         public final String name;
     16        public final PluginInformation info;
    1717        public boolean misbehaving = false;
    1818
    19         public PluginProxy(Object plugin, String name) {
     19        public PluginProxy(Object plugin, PluginInformation info) {
    2020                this.plugin = plugin;
    21                 this.name = name;
     21                this.info = info;
    2222    }
    2323
    24 
    25        
    2624        @Override public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    2725                try {
    2826                plugin.getClass().getMethod("mapFrameInitialized", MapFrame.class, MapFrame.class).invoke(plugin, oldFrame, newFrame);
    2927        } catch (Exception e) {
    30                 throw new PluginException(this, name, e);
    31         }
    32     }
    33 
    34         @Override public String getDescription() {
    35             try {
    36                 return (String)plugin.getClass().getMethod("getDescription").invoke(plugin);
    37         } catch (NoSuchMethodException e) {
    38                 return super.getDescription();
    39         } catch (Exception e) {
    40                 throw new PluginException(this, name, e);
     28                throw new PluginException(this, info.name, e);
    4129        }
    4230    }
Note: See TracChangeset for help on using the changeset viewer.