Exemple #1
0
  public void visit(Way w) {
    if (w.isIncomplete() || w.getNodesCount() < 2) return;
    c.setStrokeStyle(w.isSelected() ? "#ff0000" : "#000000");
    c.beginPath();

    Iterator<Node> it = w.getNodes().iterator();
    if (it.hasNext()) {
      Point lastP = nc.getPoint(it.next());
      c.moveTo(lastP.x, lastP.y);

      for (int orderNumber = 1; it.hasNext(); orderNumber++) {
        Point p = nc.getPoint(it.next());
        c.lineTo(p.x, p.y);
        lastP = p;
      }
      c.stroke();
    }
  }
  public DownloadPlugin(PluginInformation info) {
    super(info);

    // Create a new executor to run our downloads in
    int max_threads = Main.pref.getInteger("plugin.continuos_download.max_threads", 2);
    worker =
        new ThreadPoolExecutor(
            1, max_threads, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());

    active = Main.pref.getBoolean("plugin.continuos_download.active_default", true);

    strats = new HashMap<String, DownloadStrategy>();
    registerStrat(new SimpleStrategy());
    registerStrat(new BoxStrategy());
    timer = new Timer();
    NavigatableComponent.addZoomChangeListener(this);

    MainMenu.add(Main.main.menu.fileMenu, new ToggleAction());
  }
Exemple #3
0
 public void visit(Node n) {
   Point p = nc.getPoint(n);
   int r = 3;
   c.setStrokeStyle(n.isSelected() ? "#ff0000" : "#000000");
   c.strokeRect(p.x - r, p.y - r, 2 * r, 2 * r);
 }