Ignore:
Timestamp:
2008-11-14T12:04:03+01:00 (16 years ago)
Author:
stoecker
Message:

updated lakewalker integration to current JOSM

Location:
applications/editors/josm/plugins/lakewalker
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/lakewalker/build.xml

    r9876 r11924  
    5959        <attribute name="Plugin-Description" value="Interface to Lakewalker module" />
    6060        <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     61        <attribute name="Plugin-Mainversion" value="1065"/>
    6162        <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    6263        <attribute name="Author" value="Brent Easton &lt;b.easton@uws.edu.au>, Jason Reid &lt;jrreid@ucalgary.ca>"/>
  • applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java

    r11920 r11924  
    3333import org.openstreetmap.josm.command.Command;
    3434import org.openstreetmap.josm.command.SequenceCommand;
     35import org.openstreetmap.josm.tools.ShortCut;
    3536
    3637import org.xml.sax.SAXException;
     
    5455 
    5556  public LakewalkerAction(String name) {
    56     super(name, "lakewalker-sml", tr("Lake Walker."), KeyEvent.VK_L, KeyEvent.CTRL_MASK
    57         | KeyEvent.SHIFT_MASK, true);
     57    super(name, "lakewalker-sml", tr("Lake Walker."),
     58    ShortCut.registerShortCut("tools:lakewalker", tr("Tool: {0}", tr("Lake Walker")),
     59    KeyEvent.VK_L, ShortCut.GROUP_EDIT, ShortCut.SHIFT_DEFAULT), true);
    5860    this.name = name;
    5961    setEnabled(true);
     
    6163 
    6264  public void actionPerformed(ActionEvent e) {
     65    if(Main.map == null || Main.map.mapView == null)
     66      return;
    6367
    6468    Main.map.mapView.setCursor(oldCursor);
     
    150154         */
    151155       
    152         setStatus("Running vertex reduction...");
     156        setStatus(tr("Running vertex reduction..."));
    153157       
    154158        nodelist = lw.vertexReduce(nodelist, epsilon);
    155159       
    156         System.out.println("After vertex reduction "+nodelist.size()+" nodes remain.");
     160        //System.out.println("After vertex reduction "+nodelist.size()+" nodes remain.");
    157161       
    158162        /**
     
    160164         */
    161165       
    162         setStatus("Running Douglas-Peucker approximation...");
     166        setStatus(tr("Running Douglas-Peucker approximation..."));
    163167       
    164168        nodelist = lw.douglasPeucker(nodelist, epsilon);
    165169       
    166         System.out.println("After Douglas-Peucker approximation "+nodelist.size()+" nodes remain.");
     170        //System.out.println("After Douglas-Peucker approximation "+nodelist.size()+" nodes remain.");
    167171         
    168172        /**
     
    170174         */
    171175       
    172         setStatus("Removing duplicate nodes...");
     176        setStatus(tr("Removing duplicate nodes..."));
    173177       
    174178        nodelist = lw.duplicateNodeRemove(nodelist);
    175179       
    176         System.out.println("After removing duplicate nodes, "+nodelist.size()+" nodes remain.");
     180        //System.out.println("After removing duplicate nodes, "+nodelist.size()+" nodes remain.");
    177181         
    178182       
  • applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPlugin.java

    r6949 r11924  
    1616 */
    1717public class LakewalkerPlugin extends Plugin {
     18  public LakewalkerPlugin() {
     19    Main.main.menu.add(Main.main.menu.toolsMenu, new LakewalkerAction(tr("Lake Walker")));
     20  }
    1821
    19   public static final String VERSION = "0.4";
    20  
    21   protected String name;
    22   protected String name2;
    23 
    24   public LakewalkerPlugin() {
    25     name = tr("Lake Walker");
    26     name2 = tr("Lake Walker (Old)");
    27     JMenu toolsMenu = null;
    28     for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
    29       JMenu menu = Main.main.menu.getMenu(i);
    30       String name = menu.getText();
    31       if (name != null && name.equals(tr("Tools"))) {
    32         toolsMenu = menu;
    33       }
    34     }
    35 
    36     if (toolsMenu == null) {
    37       toolsMenu = new JMenu(name);
    38       toolsMenu.add(new JMenuItem(new LakewalkerActionOld(name2)));
    39       toolsMenu.add(new JMenuItem(new LakewalkerAction(name)));
    40       Main.main.menu.add(toolsMenu, 2);
    41     }
    42     else {
    43       toolsMenu.addSeparator();
    44       toolsMenu.add(new JMenuItem(new LakewalkerAction(name)));
    45       toolsMenu.add(new JMenuItem(new LakewalkerActionOld(name2)));
    46     }
    47    
    48   }
    49  
    5022  public PreferenceSetting getPreferenceSetting()
    5123  {
  • applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java

    r11920 r11924  
    11package org.openstreetmap.josm.plugins.lakewalker;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import org.openstreetmap.josm.Main;
     
    4143        public BufferedImage getTile(int x, int y) throws LakewalkerException {
    4244                String status = getStatus();
    43                 setStatus("Downloading image tile...");
     45                setStatus(tr("Downloading image tile..."));
    4446               
    4547                String layer = "global_mosaic_base";
     
    144146           
    145147            if(this.image == null){
    146                 throw new LakewalkerException("Could not acquire image");
     148                throw new LakewalkerException(tr("Could not acquire image"));
    147149            }
    148150               
Note: See TracChangeset for help on using the changeset viewer.