Package com.smartgwt.client.widgets.layout

Examples of com.smartgwt.client.widgets.layout.VLayout


  protected VLayout mainLayout;

  AbstractTab(String title, MapWidget map) {
    super(title);
    this.map = map;
    mainLayout = new VLayout();
    mainLayout.setWidth100();
    mainLayout.setHeight100();
    setPane(mainLayout);
  }
View Full Code Here


  public Application() {
  }

  public void onModuleLoad() {
    VLayout mainLayout = new VLayout();
    mainLayout.setWidth100();
    mainLayout.setHeight100();
    mainLayout.setBackgroundColor("#A0A0A0");

    HLayout layout = new HLayout();
    layout.setWidth100();
    layout.setHeight100();
    layout.setMembersMargin(10);
    layout.setMargin(10);

    // ---------------------------------------------------------------------
    // Create the left-side (map and tabs):
    // ---------------------------------------------------------------------
    final MapWidget map = new MapWidget("mapMain", "app");
    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);
    toolbar.setBackgroundColor("#647386");
    toolbar.setBackgroundImage("");
    toolbar.setBorder("0px");

    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        Label title = new Label("Geomajas GWT: hello world");
        title.setStyleName("appTitle");
        title.setWidth(260);
        toolbar.addFill();
        toolbar.addMember(title);
      }
    });

    VLayout mapLayout = new VLayout();
    mapLayout.addMember(toolbar);
    mapLayout.addMember(map);
    mapLayout.setHeight("65%");

    VLayout leftLayout = new VLayout();
    leftLayout.setBorder("10px solid #777777");
    leftLayout.setStyleName("round_corner");
    leftLayout.addMember(mapLayout);

    layout.addMember(leftLayout);

    // Add a search panel to the top-right of the map:
    SearchPanel searchPanel = new SearchPanel(map.getMapModel(), mapLayout);
View Full Code Here

    // Create the button GUI:
    createButtonGui();

    // Create the 2 panels:
    panelLayout = new VLayout();
    panelLayout.setBackgroundColor("#647386");
    panelLayout.setTop(TOP_OFFSET);
    panelLayout.setLeft(parent.getWidth() - PANEL_WIDTH);
    panelLayout.setHeight(PANEL_HEIGHT);
    panelLayout.setWidth(PANEL_WIDTH);
View Full Code Here

    addMember(closeBtn);
  }

  /** Create the layout for the search panel. Also connect it to the feature grid. */
  private Canvas createSearchPanel(final MapModel mapModel) {
    VLayout layout = new VLayout();
    layout.setSize("100%", "100%");
    layout.setVisible(false);
    layout.setStyleName("search_panel_inner");

    // Create a SearchWidget, based upon a map's model:
    final FeatureSearch searchWidget = new FeatureSearch(mapModel, true);

    // What to do when the result of a search comes in?
    // The DefaultSearchHandler will add all the features in the result to the given FeatureListGrid.
    searchWidget.addSearchHandler(new DefaultSearchHandler(featureListGrid) {

      // After the features have been added to the FeatureListGrid, make sure the tab with the grid is visible:
      public void afterSearch() {
        showPanel(gridPanel);
      }
    });

    // Limit the maximum number of features that a search may produce:
    searchWidget.setMaximumResultSize(20);
    searchWidget.setBackgroundColor("#F0F0F0");
    layout.addMember(searchWidget);

    mapModel.addMapModelHandler(new MapModelHandler() {

      // On map initialization: Select the countries layer in the search panel.
      public void onMapModelChange(MapModelEvent event) {
View Full Code Here

    return layout;
  }

  /** Create the panel containing the feature grid. This will display the search results. */
  private Canvas createGridPanel(MapModel mapModel) {
    VLayout layout = new VLayout();
    layout.setSize("100%", "100%");
    layout.setVisible(false);
    layout.setStyleName("search_panel_inner");

    // Create the FeatureListGrid - a table for displaying attributes:
    featureListGrid = new FeatureListGrid(mapModel);
    featureListGrid.setEditingEnabled(true);
    layout.addMember(featureListGrid);
    return layout;
  }
View Full Code Here

    // Create the button GUI:
    createButtonGui();

    // Create the 2 panels:
    panelLayout = new VLayout();
    panelLayout.setBackgroundColor("#647386");
    panelLayout.setTop(TOP_OFFSET);
    panelLayout.setLeft(parent.getWidth() - PANEL_WIDTH);
    panelLayout.setHeight(PANEL_HEIGHT);
    panelLayout.setWidth(PANEL_WIDTH);
View Full Code Here

    addMember(closeBtn);
  }

  /** Create the layout for the search panel. Also connect it to the feature grid. */
  private Canvas createSearchPanel(final MapModel mapModel) {
    VLayout layout = new VLayout();
    layout.setSize("100%", "100%");
    layout.setVisible(false);
    layout.setStyleName("search_panel_inner");

    // Create a SearchWidget, based upon a map's model:
    final FeatureSearch searchWidget = new FeatureSearch(mapModel, true);

    // What to do when the result of a search comes in?
    // The DefaultSearchHandler will add all the features in the result to the given FeatureListGrid.
    searchWidget.addSearchHandler(new DefaultSearchHandler(featureListGrid) {

      // After the features have been added to the FeatureListGrid, make sure the tab with the grid is visible:
      public void afterSearch() {
        showPanel(gridPanel);
      }
    });

    // Limit the maximum number of features that a search may produce:
    searchWidget.setMaximumResultSize(20);
    searchWidget.setBackgroundColor("#F0F0F0");
    layout.addMember(searchWidget);

    mapModel.addMapModelHandler(new MapModelHandler() {

      // On map initialization: Select the countries layer in the search panel.
      public void onMapModelChange(MapModelEvent event) {
View Full Code Here

    return layout;
  }

  /** Create the panel containing the feature grid. This will display the search results. */
  private Canvas createGridPanel(MapModel mapModel) {
    VLayout layout = new VLayout();
    layout.setSize("100%", "100%");
    layout.setVisible(false);
    layout.setStyleName("search_panel_inner");

    // Create the FeatureListGrid - a table for displaying attributes:
    featureListGrid = new FeatureListGrid(mapModel);
    featureListGrid.setEditingEnabled(true);
    layout.addMember(featureListGrid);
    return layout;
  }
View Full Code Here

  public Application() {
  }

  public void onModuleLoad() {
    VLayout mainLayout = new VLayout();
    mainLayout.setWidth100();
    mainLayout.setHeight100();
    mainLayout.setBackgroundColor("#A0A0A0");

    HLayout layout = new HLayout();
    layout.setWidth100();
    layout.setHeight100();
    layout.setMembersMargin(10);
    layout.setMargin(10);

    // ---------------------------------------------------------------------
    // Create the left-side (map and tabs):
    // ---------------------------------------------------------------------
    final MapWidget map = new MapWidget("mapMain", "app");
    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);
    toolbar.setBackgroundColor("#647386");
    toolbar.setBackgroundImage("");
    toolbar.setBorder("0px");

    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        Label title = new Label("Geomajas GWT: hello world");
        title.setStyleName("appTitle");
        title.setWidth(260);
        toolbar.addFill();
        toolbar.addMember(title);
        GetMapImageAction getMapImage = new GetMapImageAction(map);
        toolbar.addSeparator();
        toolbar.addActionButton(getMapImage);
        GetLegendImageAction getLegendImageAll = new GetLegendImageAction(map, true);
        toolbar.addSeparator();
        toolbar.addActionButton(getLegendImageAll);
        GetLegendImageAction getLegendImage = new GetLegendImageAction(map, false);
        toolbar.addSeparator();
        toolbar.addActionButton(getLegendImage);
        // switch all labels on
        for (Layer layer : map.getMapModel().getLayers()) {
          layer.setLabeled(true);
        }
      }
    });
   
    map.getMapModel().addLayerSelectionHandler(new LayerSelectionHandler() {

      public void onSelectLayer(LayerSelectedEvent event) {
        for (Layer layer : map.getMapModel().getLayers()) {
          if (layer.isSelected()) {
            layer.setVisible(true);
          } else {
            layer.setVisible(false);
          }
        }
      }

      public void onDeselectLayer(LayerDeselectedEvent event) {
      }
    });

    VLayout mapLayout = new VLayout();
    mapLayout.addMember(toolbar);
    mapLayout.addMember(map);
    mapLayout.setHeight("65%");

    VLayout leftLayout = new VLayout();
    leftLayout.setBorder("10px solid #777777");
    leftLayout.setStyleName("round_corner");
    leftLayout.addMember(mapLayout);

    layout.addMember(leftLayout);

    // Add a search panel to the top-right of the map:
    SearchPanel searchPanel = new SearchPanel(map.getMapModel(), mapLayout);
View Full Code Here

  public GeomajasEntryPoint() {
  }

  public void onModuleLoad() {

    VLayout mainLayout = new VLayout();
    mainLayout.setWidth100();
    mainLayout.setHeight100();

    // top bar

    ToolStrip topBar = new ToolStrip();
    topBar.setHeight(33);
    topBar.setWidth100();
    topBar.addSpacer(6);

    Img icon = new Img("[ISOMORPHIC]/geomajas/geomajas_desktopicon_small.png");
    icon.setSize(24);
    topBar.addMember(icon);
    topBar.addSpacer(6);

    Label title = new Label("Geomajas, geocoder GWT widget example");
    title.setStyleName("sgwtTitle");
    title.setWidth(400);
    topBar.addMember(title);

    mainLayout.addMember(topBar);

    HLayout layout = new HLayout();
    layout.setWidth100();
    layout.setHeight100();
    layout.setMembersMargin(5);
    layout.setMargin(5);

    // create the map and toolbar

    // @extract-start createGwtWidget, Create GWT widget in toolbar
    MapWidget map = new MapWidget("mapOsm", "app");
    Toolbar toolbar = new Toolbar(map);
    // @extract-skip-start
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);
    // @extract-skip-end

    toolbar.addMember(new GeocoderWidget(map, "description", "Geocoder"));

    VLayout mapLayout = new VLayout();
    mapLayout.addMember(toolbar);
    mapLayout.addMember(map);
    mapLayout.setHeight("100%");
    layout.addMember(mapLayout);
    // @extract-end

    // finally draw everything:
    mainLayout.addMember(layout);
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.layout.VLayout

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.