/**
   * Initializes the plugin.
   *
   * @param info Context information about the plugin.
   */
  public ElevationProfilePlugin(PluginInformation info) {
    super(info);

    createColorMaps();

    // TODO: Disable this view as long as it is not stable
    MainMenu.add(Main.main.menu.imagerySubMenu, new AddElevationLayerAction(), false, 0);
  }
示例#2
0
  public static void refreshMenu() {
    MainMenu menu = Main.main.menu;

    if (cadastreJMenu == null) {
      cadastreJMenu =
          menu.addMenu(
              marktr("Cadastre"), KeyEvent.VK_C, menu.defaultMenuPos, ht("/Plugin/CadastreFr"));
      JosmAction grab = new MenuActionGrab();
      JMenuItem menuGrab = new JMenuItem(grab);
      KeyStroke ks = grab.getShortcut().getKeyStroke();
      if (ks != null) {
        menuGrab.setAccelerator(ks);
      }
      JMenuItem menuActionGrabPlanImage = new JMenuItem(new MenuActionGrabPlanImage());
      JMenuItem menuSettings = new JMenuItem(new MenuActionNewLocation());
      final JCheckBoxMenuItem menuSource = new JCheckBoxMenuItem(tr("Auto sourcing"));
      menuSource.setSelected(autoSourcing);
      menuSource.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent ev) {
              Main.pref.put("cadastrewms.autosourcing", menuSource.isSelected());
              autoSourcing = menuSource.isSelected();
            }
          });

      // JMenuItem menuResetCookie = new JMenuItem(new MenuActionResetCookie());
      // JMenuItem menuLambertZone = new JMenuItem(new MenuActionLambertZone());
      JMenuItem menuLoadFromCache = new JMenuItem(new MenuActionLoadFromCache());
      // temporary disabled:
      // JMenuItem menuActionBoundaries = new JMenuItem(new MenuActionBoundaries());
      // JMenuItem menuActionBuildings = new JMenuItem(new MenuActionBuildings());

      cadastreJMenu.add(menuGrab);
      cadastreJMenu.add(menuActionGrabPlanImage);
      cadastreJMenu.add(menuSettings);
      cadastreJMenu.add(menuSource);
      // cadastreJMenu.add(menuResetCookie); not required any more
      // cadastreJMenu.add(menuLambertZone);
      // if (Main.pref.getBoolean("cadastrewms.buildingsMenu", false))
      //    cadastreJMenu.add(menuActionBuildings);
      cadastreJMenu.add(menuLoadFromCache);
      // all SVG features disabled until official WMS is released
      // cadastreJMenu.add(menuActionBoundaries);
    }
    setEnabledAll(menuEnabled);
  }
 public ReverterPlugin(PluginInformation info) {
   super(info);
   JMenu historyMenu =
       Main.main.menu.addMenu(
           marktr("History"),
           KeyEvent.VK_S,
           Main.main.menu.defaultMenuPos,
           ht("/Plugin/Reverter"));
   // MainMenu.add(historyMenu, new ObjectsHistoryAction());
   MainMenu.add(historyMenu, new RevertChangesetAction());
   UploadAction.registerUploadHook(new ReverterUploadHook(this));
 }
  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());
  }
示例#5
0
 @Override
 public void setVisible(boolean visible) {
   if (visible) {
     new WindowGeometry(
             getClass().getName() + ".geometry",
             WindowGeometry.centerInWindow(getParent(), new Dimension(600, 400)))
         .applySafe(this);
   } else if (isShowing()) { // Avoid IllegalComponentStateException like in #8775
     new WindowGeometry(this).remember(getClass().getName() + ".geometry");
   }
   if (windowMenuItem != null && !visible) {
     Main.main.menu.windowMenu.remove(windowMenuItem);
     windowMenuItem = null;
   }
   if (windowMenuItem == null && visible) {
     windowMenuItem =
         MainMenu.add(Main.main.menu.windowMenu, focusAction, MainMenu.WINDOW_MENU_GROUP.VOLATILE);
   }
   super.setVisible(visible);
 }
 public LakewalkerPlugin(PluginInformation info) {
   super(info);
   MainMenu.add(Main.main.menu.moreToolsMenu, new LakewalkerAction(tr("Lake Walker")));
 }
示例#7
0
 public Smed2(PluginInformation info) {
   super(info);
   MainMenu.add(Main.main.menu.toolsMenu, new Smed2Action());
 }
示例#8
0
  public UtilsPlugin2(PluginInformation info) {
    super(info);
    JMenu toolsMenu = Main.main.menu.moreToolsMenu;
    JMenu dataMenu = Main.main.menu.dataMenu;
    JMenu selectionMenu = Main.main.menu.selectionMenu;

    addIntersections = MainMenu.add(toolsMenu, new AddIntersectionsAction());
    splitObject = MainMenu.add(toolsMenu, new SplitObjectAction());
    alignWayNodes = MainMenu.add(toolsMenu, new AlignWayNodesAction());
    symmetry = MainMenu.add(toolsMenu, new SymmetryAction());
    splitOnIntersections = MainMenu.add(toolsMenu, new SplitOnIntersectionsAction());
    unglueRelation = MainMenu.add(toolsMenu, new UnGlueRelationAction());
    toolsMenu.addSeparator();
    replaceGeometry = MainMenu.add(toolsMenu, new ReplaceGeometryAction());
    extractPoint = MainMenu.add(toolsMenu, new ExtractPointAction());
    tagBuffer = MainMenu.add(toolsMenu, new TagBufferAction());
    sourceTag = MainMenu.add(toolsMenu, new TagSourceAction());
    pasteRelations = MainMenu.add(toolsMenu, new PasteRelationsAction());
    wiki = MainMenu.add(dataMenu, new OpenPageAction());
    latlon = MainMenu.add(toolsMenu, new LatLonAction());
    drawArc = MainMenu.add(toolsMenu, new CurveAction());

    selectionMenu.addSeparator();

    selectWayNodes = MainMenu.add(selectionMenu, new SelectWayNodesAction());
    adjNodes = MainMenu.add(selectionMenu, new AdjacentNodesAction());
    unsNodes = MainMenu.add(selectionMenu, new UnselectNodesAction());
    midNodes = MainMenu.add(selectionMenu, new MiddleNodesAction());
    adjWays = MainMenu.add(selectionMenu, new AdjacentWaysAction());
    adjWaysAll = MainMenu.add(selectionMenu, new ConnectedWaysAction());
    intWays = MainMenu.add(selectionMenu, new IntersectedWaysAction());
    intWaysR = MainMenu.add(selectionMenu, new IntersectedWaysRecursiveAction());
    allInside = MainMenu.add(selectionMenu, new SelectAllInsideAction());
    selModifiedNodes = MainMenu.add(selectionMenu, new SelectModNodesAction());
    selModifiedWays = MainMenu.add(selectionMenu, new SelectModWaysAction());
    undoSelection = MainMenu.add(selectionMenu, new UndoSelectionAction());
    selectHighway = MainMenu.add(selectionMenu, new SelectHighwayAction());
    selectAreaBoundary = MainMenu.add(selectionMenu, new SelectBoundaryAction());

    selectURL = MainMenu.add(dataMenu, new ChooseURLAction());

    // register search operators
    SearchCompiler.addMatchFactory(new UtilsUnaryMatchFactory());
  }