use of org.geosdi.geoplatform.gui.action.menu.MenuActionRegistar in project geo-platform by geosdi.
the class GPMapToolbarWidget method createMenu.
/**
* Create a Menu with an Item from each Action.
*
* @param actionTools the list of Action
* @return the Menu
*/
private Menu createMenu(List<ToolbarActionTool> actionTools) {
Menu menu = new Menu();
MenuActionRegistar menuRegistar = BasicGinInjector.MainInjector.getInstance().getMenuActionRegistar();
for (ToolbarActionTool actionTool : actionTools) {
MenuBaseAction action = (MenuBaseAction) menuRegistar.get(actionTool.getId());
MenuItem item = new MenuItem(action.getTitle());
item.addSelectionListener(action);
item.setIcon(action.getImage());
menu.add(item);
}
return menu;
}
use of org.geosdi.geoplatform.gui.action.menu.MenuActionRegistar in project geo-platform by geosdi.
the class LayerWidgetUI method addLayerWidgetAction.
/**
*/
private void addLayerWidgetAction() {
MenuActionRegistar menuRegistar = BasicGinInjector.MainInjector.getInstance().getMenuActionRegistar();
menuRegistar.put("layerMenu", new MenuActionCreator() {
@Override
public MenuAction createAction() {
return new LayerMenuAction();
}
});
menuRegistar.put("manageProjects", new MenuActionCreator() {
@Override
public MenuAction createAction() {
return loadMenuProjects;
}
});
}
use of org.geosdi.geoplatform.gui.action.menu.MenuActionRegistar in project geo-platform by geosdi.
the class LayerTreeBasicMenu method buildBasicMenu.
private Menu buildBasicMenu() {
Menu m = new Menu();
MenuActionRegistar menuRegistar = BasicGinInjector.MainInjector.getInstance().getMenuActionRegistar();
MenuBaseAction baseAction = (MenuBaseAction) menuRegistar.get("aboutGeoPlatform");
SelectionListener selectionListener = (baseAction != null) ? baseAction : new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent ce) {
}
};
MenuItem item = new MenuItem(baseAction.getTitle(), baseAction.getImage(), selectionListener);
m.add(item);
return m;
}
use of org.geosdi.geoplatform.gui.action.menu.MenuActionRegistar in project geo-platform by geosdi.
the class MapWidgetUI method addMapToolbarAction.
private void addMapToolbarAction() {
ToolbarActionRegistar toolbarRegistar = BasicGinInjector.MainInjector.getInstance().getToolbarActionRegistar();
toolbarRegistar.put("ZoomIn", new ToolbarActionCreator() {
@Override
public ToolbarAction createActionTool(GeoPlatformMap mapWidget) {
return new ZoomInAction(mapWidget);
}
});
toolbarRegistar.put("ZoomOut", new ToolbarActionCreator() {
@Override
public ToolbarAction createActionTool(GeoPlatformMap mapWidget) {
return new ZoomOutAction(mapWidget);
}
});
toolbarRegistar.put("ZoomPrevious", new ToolbarActionCreator() {
@Override
public ToolbarAction createActionTool(GeoPlatformMap mapWidget) {
return new ZoomPreviousAction(mapWidget);
}
});
toolbarRegistar.put("ZoomNext", new ToolbarActionCreator() {
@Override
public ToolbarAction createActionTool(GeoPlatformMap mapWidget) {
return new ZoomNextAction(mapWidget);
}
});
toolbarRegistar.put("GetFeatureInfo", new ToolbarActionCreator() {
@Override
public ToolbarAction createActionTool(GeoPlatformMap mapWidget) {
return new GetFeatureInfoAction(mapWidget);
}
});
toolbarRegistar.put("Measure", new ToolbarActionCreator() {
@Override
public ToolbarAction createActionTool(GeoPlatformMap mapWidget) {
return new MeasureAction(mapWidget);
}
});
toolbarRegistar.put("MeasureArea", new ToolbarActionCreator() {
@Override
public ToolbarAction createActionTool(GeoPlatformMap mapWidget) {
return new MeasureAreaAction(mapWidget);
}
});
MenuActionRegistar menuRegistar = BasicGinInjector.MainInjector.getInstance().getMenuActionRegistar();
menuRegistar.put("viewport", new MenuActionCreator() {
@Override
public MenuAction createAction() {
MapLayoutWidget mapLayoutWidget = Registry.get(MapRegistryEnum.MAP_LAYOUT_WIDGET.toString());
return new ViewportAction(mapLayoutWidget.getMap());
}
});
}
use of org.geosdi.geoplatform.gui.action.menu.MenuActionRegistar in project geo-platform by geosdi.
the class Routing method addRoutingMenuAction.
private void addRoutingMenuAction() {
MenuActionRegistar menuRegistar = BasicGinInjector.MainInjector.getInstance().getMenuActionRegistar();
menuRegistar.put("routing", new MenuActionCreator() {
@Override
public MenuAction createAction() {
return new RoutingMenuAction();
}
});
}
Aggregations