Пример #1
0
 private static Match compileMatch(String match) throws Exception {
   try {
     return SearchCompiler.compile(match);
   } catch (Exception e) {
     throw new Exception("can't compile expression for: " + match, e);
   }
 }
Пример #2
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());
  }