Changeset 154 in josm


Ignore:
Timestamp:
2006-10-08T03:20:53+02:00 (18 years ago)
Author:
imi
Message:
  • enhanced plugin system to integrate osmarender
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • .classpath

    r153 r154  
    33        <classpathentry kind="src" path="src"/>
    44        <classpathentry kind="src" path="test"/>
    5         <classpathentry including="images/" excluding="po/|src/|test/" kind="src" path=""/>
     5        <classpathentry including="images/" excluding="build/|dist/|po/|src/|test/" kind="src" path=""/>
    66        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    77        <classpathentry sourcepath="JUNIT_SRC_HOME/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/>
  • build.xml

    r151 r154  
    1 <project name="openstreetmap" default="dist" basedir=".">
     1<project name="josm" default="dist" basedir=".">
    22
    33        <!-- All jar files necessary to run only JOSM (no tests) -->
     
    2828                        <fileset dir="po/org/openstreetmap/josm" />
    2929                </copy>
    30                
     30
    3131                <!-- create josm-custom.jar -->
    3232                <jar destfile="dist/josm-custom.jar" basedir="build">
     
    7373
    7474    <target name="compile-tests" depends="compile">
    75        
     75
    7676    </target>
    7777
  • src/org/openstreetmap/josm/Main.java

    r153 r154  
    2828import javax.swing.JSeparator;
    2929import javax.swing.JToolBar;
     30import javax.swing.SwingUtilities;
    3031import javax.swing.UIManager;
    3132
     
    272273                        }
    273274                }
     275
     276                SwingUtilities.updateComponentTreeUI(parent);
     277                for (DownloadTask task : downloadAction.downloadTasks)
     278                        task.getCheckBox().updateUI();
    274279        }
    275280
     
    312317        public static JPanel panel = new JPanel(new BorderLayout());
    313318
    314         protected final JMenuBar mainMenu = new JMenuBar();
     319        public final JMenuBar mainMenu = new JMenuBar();
    315320        protected static Rectangle bounds;
    316321
  • src/org/openstreetmap/josm/plugins/Plugin.java

    r153 r154  
    11package org.openstreetmap.josm.plugins;
    22
     3import java.io.FileNotFoundException;
     4import java.io.FileOutputStream;
     5import java.io.IOException;
     6import java.io.InputStream;
    37import java.net.URL;
    48import java.net.URLClassLoader;
     
    6266         */
    6367        public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {}
     68
     69        /**
     70         * Copies the ressource 'from' to the file in the plugin directory named 'to'.
     71         */
     72        public void copy(String from, String to) throws FileNotFoundException, IOException {
     73        FileOutputStream out = new FileOutputStream(getPluginDir()+to);
     74        InputStream in = getClass().getResourceAsStream(from);
     75        byte[] buffer = new byte[8192];
     76        for(int len = in.read(buffer); len > 0; len = in.read(buffer))
     77                out.write(buffer, 0, len);
     78        in.close();
     79        out.close();
     80    }
    6481}
  • src/org/openstreetmap/josm/plugins/PluginProxy.java

    r153 r154  
    2525                try {
    2626                plugin.getClass().getMethod("mapFrameInitialized", MapFrame.class, MapFrame.class).invoke(plugin, oldFrame, newFrame);
     27        } catch (NoSuchMethodException e) {
    2728        } catch (Exception e) {
    2829                throw new PluginException(this, info.name, e);
Note: See TracChangeset for help on using the changeset viewer.