Package com.smartgwt.client.widgets

Examples of com.smartgwt.client.widgets.IButton


    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(5);
    buttonLayout.setHeight(25);

    // Create a button to show the "roads" objects into a FeatureGrid:
    IButton button1a = new IButton("Show roads");
    button1a.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        VectorLayer layer = (VectorLayer) getMap().getMapModel().getLayer("roadsLayer");
        table.setLayer(layer);
        layer.getFeatureStore().getFeatures(GeomajasConstant.FEATURE_INCLUDE_ALL, new LazyLoadCallback() {

          // Add all the features currently in the layer's FeatureStore to the grid:
          public void execute(List<Feature> response) {
            for (Feature feature : response) {
              table.addFeature(feature);
            }
          }
        });
      }
    });
    button1a.setWidth(110);
    buttonLayout.addMember(button1a);
    mainLayout.addMember(buttonLayout);

    // Create the FeatureGrid that shows alpha-numerical attributes of features:
    table = new FeatureListGrid(map.getMapModel());
View Full Code Here


  // ------------------------------------------------------------------------

  /** Create the button GUI and attach the buttons to this widget. */
  private void createButtonGui() {
    // The search button opens the search widget:
    searchButton = new IButton();
    searchButton.setIcon("[ISOMORPHIC]/geomajas/silk/find.png");
    searchButton.setSize(BTN_WIDTH + "px", BTN_WIDTH + "px");
    searchButton.setRadioGroup("panels");
    searchButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        if (isOpen(searchPanel)) {
          hidePanel();
        } else {
          showPanel(searchPanel);
        }
      }
    });

    // The grid button opens the feature list grid:
    gridButton = new IButton();
    gridButton.setIcon("[ISOMORPHIC]/geomajas/osgeo/table.png");
    gridButton.setSize(BTN_WIDTH + "px", BTN_WIDTH + "px");
    gridButton.setRadioGroup("panels");
    gridButton.addClickHandler(new ClickHandler() {

View Full Code Here

  // ------------------------------------------------------------------------

  /** Create the button GUI and attach the buttons to this widget. */
  private void createButtonGui() {
    // The search button opens the search widget:
    searchButton = new IButton();
    searchButton.setIcon("[ISOMORPHIC]/geomajas/silk/find.png");
    searchButton.setSize(BTN_WIDTH + "px", BTN_WIDTH + "px");
    searchButton.setRadioGroup("panels");
    searchButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        if (isOpen(searchPanel)) {
          hidePanel();
        } else {
          showPanel(searchPanel);
        }
      }
    });

    // The grid button opens the feature list grid:
    gridButton = new IButton();
    gridButton.setIcon("[ISOMORPHIC]/geomajas/osgeo/table.png");
    gridButton.setSize(BTN_WIDTH + "px", BTN_WIDTH + "px");
    gridButton.setRadioGroup("panels");
    gridButton.addClickHandler(new ClickHandler() {

View Full Code Here

    HLayout actionsButtonBar = new HLayout();
    actionsButtonBar.setWidth100();
    actionsButtonBar.setAutoHeight();
    actionsButtonBar.setMembersMargin(10);

    btnPoint = new IButton(messages.geometricSearchWidgetFreeDrawingPoint());
    btnPoint.setIcon(BTN_POINT_CREATE_IMG);
    btnPoint.setAutoFit(true);
    btnPoint.setActionType(SelectionType.RADIO);
    btnPoint.setRadioGroup("drawType");
    btnPoint.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        onDrawPoint();
      }
    });

    btnLine = new IButton(messages.geometricSearchWidgetFreeDrawingLine());
    btnLine.setIcon(BTN_LINE_CREATE_IMG);
    btnLine.setAutoFit(true);
    btnLine.setActionType(SelectionType.RADIO);
    btnLine.setRadioGroup("drawType");
    btnLine.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        onDrawLine();
      }
    });

    btnPolygon = new IButton(messages.geometricSearchWidgetFreeDrawingPolygon());
    btnPolygon.setIcon(BTN_POLYGON_CREATE_IMG);
    btnPolygon.setAutoFit(true);
    btnPolygon.setActionType(SelectionType.RADIO);
    btnPolygon.setRadioGroup("drawType");
    btnPolygon.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        onDrawPolygon();
      }
    });

    IButton btnAdd = new IButton(messages.geometricSearchWidgetFreeDrawingAdd());
    btnAdd.setIcon(BTN_ADD_IMG);
    btnAdd.setAutoFit(true);
    btnAdd.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        onAdd();
      }
    });

    btnUndo = new IButton(messages.geometricSearchWidgetFreeDrawingUndo());
    btnUndo.setIcon(BTN_UNDO_IMG);
    btnUndo.setAutoFit(true);
    btnUndo.setDisabled(true);
    btnUndo.setShowDisabledIcon(false);
    btnUndo.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        onUndo();
      }
    });

    btnRedo = new IButton(messages.geometricSearchWidgetFreeDrawingRedo());
    btnRedo.setIcon(BTN_REDO_IMG);
    btnRedo.setAutoFit(true);
    btnRedo.setDisabled(true);
    btnRedo.setShowDisabledIcon(false);
    btnRedo.addClickHandler(new ClickHandler() {
View Full Code Here

public class SearchPage extends AbstractTab {

  public SearchPage(String title, final MapWidget map) {
    super(title, map);

    IButton btnAttSearch = new IButton("Open Attribute Search Window");
    btnAttSearch.setAutoFit(true);
    btnAttSearch.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        SearchWidgetRegistry.getSearchWidgetInstance(AttributeSearchCreator.IDENTIFIER).showForSearch();
      }
    });

    IButton btnGeoSearch = new IButton("Open Geographic Search window");
    btnGeoSearch.setAutoFit(true);
    btnGeoSearch.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        SearchWidgetRegistry.getSearchWidgetInstance(GeometricSearchCreator.IDENTIFIER).showForSearch();
      }
    });

    IButton btnComSearch = new IButton("Open Combined Search window");
    btnComSearch.setAutoFit(true);
    btnComSearch.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        SearchWidgetRegistry.getSearchWidgetInstance(CombinedSearchCreator.IDENTIFIER).showForSearch();
      }
    });

    IButton btnFavSearch = new IButton("Open Favourite Searches window");
    btnFavSearch.setAutoFit(true);
    btnFavSearch.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        SearchWidgetRegistry.getSearchWidgetInstance(SearchFavouritesListCreator.IDENTIFIER).showForSearch();
      }
    });
View Full Code Here

    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(5);
    buttonLayout.setHeight(25);

    // Create a button to show the "roads" objects into a FeatureGrid:
    IButton button1a = new IButton("Show roads");
    button1a.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        VectorLayer layer = (VectorLayer) getMap().getMapModel().getLayer("roadsLayer");
        table.setLayer(layer);
        layer.getFeatureStore().getFeatures(GeomajasConstant.FEATURE_INCLUDE_ALL, new LazyLoadCallback() {

          // Add all the features currently in the layer's FeatureStore to the grid:
          public void execute(List<Feature> response) {
            for (Feature feature : response) {
              table.addFeature(feature);
            }
          }
        });
      }
    });
    button1a.setWidth(110);
    buttonLayout.addMember(button1a);
    mainLayout.addMember(buttonLayout);

    // Create the FeatureGrid that shows alpha-numerical attributes of features:
    table = new FeatureListGrid(map.getMapModel());
View Full Code Here

    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(5);
    buttonLayout.setHeight(25);

    // Create a button to show the "roads" objects into a FeatureGrid:
    IButton button1a = new IButton("Show roads");
    button1a.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        VectorLayer layer = (VectorLayer) getMap().getMapModel().getLayer("roadsLayer");
        table.setLayer(layer);
        layer.getFeatureStore().getFeatures(GeomajasConstant.FEATURE_INCLUDE_ALL, new LazyLoadCallback() {

          // Add all the features currently in the layer's FeatureStore to the grid:
          public void execute(List<Feature> response) {
            for (Feature feature : response) {
              table.addFeature(feature);
            }
          }
        });
      }
    });
    button1a.setWidth(110);
    buttonLayout.addMember(button1a);
    mainLayout.addMember(buttonLayout);

    // Create the FeatureGrid that shows alpha-numerical attributes of features:
    table = new FeatureListGrid(map.getMapModel());
View Full Code Here

    mapLayout.setShowEdges(true);
    final MapWidget map = new MapWidget("mapLegend", "gwt-samples");
    map.setController(new PanController(map));
    mapLayout.addMember(map);

    IButton rasterButton = new IButton("Toggle Raster layer");
    rasterButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Layer<?> layer = map.getMapModel().getLayer("clientLayerWms");
        layer.setVisible(!layer.isShowing());
      }
    });
    rasterButton.setWidth100();
    buttonLayout.addMember(rasterButton);

    IButton lineButton = new IButton("Toggle Line layer");
    lineButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Layer<?> layer = map.getMapModel().getLayer("clientLayerRivers50m");
        layer.setVisible(!layer.isShowing());
      }
    });
    lineButton.setWidth100();
    buttonLayout.addMember(lineButton);

    IButton polygonButton = new IButton("Toggle Polygon layer");
    polygonButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Layer<?> layer = map.getMapModel().getLayer("clientLayerCountries110m");
        layer.setVisible(!layer.isShowing());
      }
    });
    polygonButton.setWidth100();
    buttonLayout.addMember(polygonButton);

    IButton pointButton = new IButton("Toggle Point layer");
    pointButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Layer<?> layer = map.getMapModel().getLayer("clientLayerPopulatedPlaces110m");
        layer.setVisible(!layer.isShowing());
      }
    });
    pointButton.setWidth100();
    buttonLayout.addMember(pointButton);

    VLayout legendLayout = new VLayout();
    legendLayout.setShowEdges(true);
View Full Code Here

    mapLayout.setShowEdges(true);
    mapLayout.setHeight("60%");
    mapLayout.addMember(map);

    // Create a button that centers the map to (0,0):
    IButton centerBTN = new IButton(I18nProvider.getSampleMessages().navigationBtnPosition());
    centerBTN.setWidth100();
    centerBTN.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getMapModel().getMapView().setCenterPosition(new Coordinate(-10000000, 2000000));
      }
    });

    // Create a button that translate the map:
    IButton translateBTN = new IButton(I18nProvider.getSampleMessages().navigationBtnTranslate());
    translateBTN.setWidth100();
    translateBTN.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getMapModel().getMapView().translate(1000000, -500000);
      }
    });

    // Create a button that applies a bounding box to zoom to:
    IButton bboxBTN = new IButton(I18nProvider.getSampleMessages().navigationBtnBbox());
    bboxBTN.setWidth100();
    bboxBTN.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getMapModel().getMapView().applyBounds(new Bbox(1200000, 4600000, 1400000, 1400000),
            ZoomOption.EXACT);
      }
    });

    // Create a button that zooms out:
    IButton zoomOutBTN = new IButton(I18nProvider.getSampleMessages().navigationBtnZoomOut());
    zoomOutBTN.setWidth100();
    zoomOutBTN.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getMapModel().getMapView().scale(0.5, ZoomOption.LEVEL_CHANGE);
      }
    });

    // Create a button that zooms in:
    IButton zoomInBTN = new IButton(I18nProvider.getSampleMessages().navigationBtnZoomIn());
    zoomInBTN.setWidth100();
    zoomInBTN.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getMapModel().getMapView().scale(2, ZoomOption.LEVEL_CHANGE);
      }
    });
View Full Code Here

        }
      }
    };

    // Create a button that logs in user "marino":
    IButton loginButtonMarino = new IButton(I18nProvider.getSampleMessages().securityLogInWith("jan"));
    loginButtonMarino.setWidth("50%");
    loginButtonMarino.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Authentication.getInstance().login("jan", "jan", initMapCallback);
      }
    });
    buttonLayout.addMember(loginButtonMarino);

    // Create a button that logs in user "luc":
    IButton loginButtonLuc = new IButton(I18nProvider.getSampleMessages().securityLogInWith("luc"));
    loginButtonLuc.setWidth("50%");
    loginButtonLuc.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Authentication.getInstance().login("luc", "luc", initMapCallback);
      }
    });
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.IButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.