Ignore:
Timestamp:
2008-12-23T15:07:05+01:00 (15 years ago)
Author:
stoecker
Message:

removed usage of tab stops

File:
1 edited

Legend:

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

    r873 r1169  
    2424 *
    2525 * The actual implementation of this class is optional, as all functions will be called
    26  * via reflection. This is to be able to change this interface without the need of 
     26 * via reflection. This is to be able to change this interface without the need of
    2727 * recompiling or even breaking the plugins. If your class does not provide a
    2828 * function here (or does provide a function with a mismatching signature), it will not
     
    3232 * are provided (you can register yourself to more callbacks in your plugin class
    3333 * constructor).
    34  * 
     34 *
    3535 * Subclassing Plugin and overriding some functions makes it easy for you to keep sync
    3636 * with the correct actual plugin architecture of JOSM.
     
    4040public abstract class Plugin {
    4141
    42         /**
    43         * This is the info available for this plugin. You can access this from your
    44         * constructor.
    45         *
    46         * (The actual implementation to request the info from a static variable
    47         * is a bit hacky, but it works).
    48         */
    49         public final PluginInformation info = PluginInformation.currentPluginInitialization;
     42    /**
     43    * This is the info available for this plugin. You can access this from your
     44    * constructor.
     45    *
     46    * (The actual implementation to request the info from a static variable
     47    * is a bit hacky, but it works).
     48    */
     49    public final PluginInformation info = PluginInformation.currentPluginInitialization;
    5050
    51         /**
    52         * @return The directory for the plugin to store all kind of stuff.
    53         */
    54         public final String getPluginDir() {
    55                 return new File(Main.pref.getPluginsDirFile(), info.name).getPath();
    56         }
     51    /**
     52    * @return The directory for the plugin to store all kind of stuff.
     53    */
     54    public final String getPluginDir() {
     55        return new File(Main.pref.getPluginsDirFile(), info.name).getPath();
     56    }
    5757
    58         /**
    59         * Called after Main.mapFrame is initalized. (After the first data is loaded).
    60         * You can use this callback to tweak the newFrame to your needs, as example install
    61         * an alternative Painter.
    62         */
    63         public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {}
     58    /**
     59    * Called after Main.mapFrame is initalized. (After the first data is loaded).
     60    * You can use this callback to tweak the newFrame to your needs, as example install
     61    * an alternative Painter.
     62    */
     63    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {}
    6464
    65         /**
    66         * Called in the preferences dialog to create a preferences page for the plugin,
    67         * if any available.
    68         */
    69         public PreferenceSetting getPreferenceSetting() { return null; }
    70        
    71         /**
    72         * Called in the download dialog to give the plugin a chance to modify the list
    73         * of bounding box selectors.
    74         */
    75         public void addDownloadSelection(List<DownloadSelection> list) {}
    76        
    77         /**
    78         * Copies the ressource 'from' to the file in the plugin directory named 'to'.
    79         */
    80         public void copy(String from, String to) throws FileNotFoundException, IOException {
    81                 String pluginDirName = Main.pref.getPreferencesDir()+"plugins/"+info.name+"/";
     65    /**
     66    * Called in the preferences dialog to create a preferences page for the plugin,
     67    * if any available.
     68    */
     69    public PreferenceSetting getPreferenceSetting() { return null; }
     70
     71    /**
     72    * Called in the download dialog to give the plugin a chance to modify the list
     73    * of bounding box selectors.
     74    */
     75    public void addDownloadSelection(List<DownloadSelection> list) {}
     76
     77    /**
     78    * Copies the ressource 'from' to the file in the plugin directory named 'to'.
     79    */
     80    public void copy(String from, String to) throws FileNotFoundException, IOException {
     81        String pluginDirName = Main.pref.getPreferencesDir()+"plugins/"+info.name+"/";
    8282        File pluginDir = new File(pluginDirName);
    8383        if (!pluginDir.exists())
    84                 pluginDir.mkdirs();
     84            pluginDir.mkdirs();
    8585        FileOutputStream out = new FileOutputStream(pluginDirName+to);
    8686        InputStream in = getClass().getResourceAsStream(from);
    8787        byte[] buffer = new byte[8192];
    8888        for(int len = in.read(buffer); len > 0; len = in.read(buffer))
    89                 out.write(buffer, 0, len);
     89            out.write(buffer, 0, len);
    9090        in.close();
    9191        out.close();
Note: See TracChangeset for help on using the changeset viewer.