Changeset 27920 in osm for applications


Ignore:
Timestamp:
2012-02-22T19:59:29+01:00 (13 years ago)
Author:
clever
Message:

moved it to a proper action on the imagery menu

Location:
applications/editors/josm/plugins/canvec_helper
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/canvec_helper/TODO

    r27915 r27920  
    33i need to rewrite it to use http://ftp2.cits.rncan.gc.ca/osm/pub/ZippedOsm.txt
    44
     5replace the temp images (copied from piclayer) with proper ones
  • applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/canvec_helper.java

    r27915 r27920  
    1010                super(info);
    1111                System.out.println("in constructor");
     12                Main.main.menu.imageryMenu.add(new CanvecHelperAction(this));
    1213        }
    1314        public void mapFrameInitialized(MapFrame old, MapFrame new1) {
     
    1617        }
    1718        private synchronized void updateLayer() {
    18                 if(layer == null) {
    19                         layer = new canvec_layer("canvec tile helper",this);
    20                         Main.main.addLayer(layer);
    21                 }
    2219        }
    2320        private canvec_layer layer;
  • applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/canvec_layer.java

    r27915 r27920  
    88import java.awt.Point;
    99import java.awt.Color;
     10import java.awt.Toolkit;
    1011import java.io.IOException;
    1112
    1213import javax.swing.Action;
    1314import javax.swing.Icon;
     15import javax.swing.ImageIcon;
    1416import org.openstreetmap.josm.actions.RenameLayerAction;
    1517import org.openstreetmap.josm.data.Bounds;
     
    2325// most of the layout was copied from the openstreetbugs plugin to get things started
    2426public class canvec_layer extends Layer implements MouseListener {
     27        private Icon layerIcon = null;
    2528        canvec_helper plugin_self;
    2629        private ArrayList<CanVecTile> tiles = new ArrayList<CanVecTile>();
     30
    2731        public canvec_layer(String name,canvec_helper self){
    2832                super(name);
     
    3337                        if (tile.isValid()) tiles.add(tile);
    3438                }
     39                layerIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(getClass().getResource("/images/layericon.png")));
    3540        }
    3641        public Action[] getMenuEntries() {
     
    5257        }
    5358        public void mergeFrom(Layer from) {}
    54         public Icon getIcon() {
    55                 return null; // FIXME
    56         }
     59        public Icon getIcon() { return layerIcon; }
    5760        public void paint(Graphics2D g, MapView mv, Bounds bounds) {
    5861                long start = System.currentTimeMillis();
Note: See TracChangeset for help on using the changeset viewer.