Examples of VLayout


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

  /**
   * @return The viewPanel Canvas
   */
  public Canvas getViewPanel() {
    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();

    // Create the map, using the wmsMap configuration (mapOsm.xml):
    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");

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

    VLayout labelLayout = new VLayout();
    final Label label = new Label();
    labelLayout.addMember(label);

    /**
     * Listener implementation that prints out the mouse position.
     *
     * @author Pieter De Graef
View Full Code Here

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

      return new AttributeIncludeInFormSample();
    }
  };

  public Canvas getViewPanel() {
    final VLayout layout = new VLayout();
    layout.setMembersMargin(10);
    layout.setWidth100();
    layout.setHeight100();

    // Map with ID beansMap is defined in the XML configuration. (contains any type of attribute)
    final MapWidget map = new MapWidget("mapBeansIncludeInForm", "gwt-samples");
    map.setVisible(false);
    layout.addMember(map);
    map.init();

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

      public void onMapModelChange(MapModelEvent event) {
        VectorLayer layer = (VectorLayer) map.getMapModel().getLayer("beansLayerIncludeInForm");
        FeatureAttributeEditor editor = new FeatureAttributeEditor(layer, false);
        editor.setWidth(400);
        layout.addMember(editor);
      }
    });

    return layout;
  }
View Full Code Here

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

      return new OpenStreetMapSample();
    }
  };

  public Canvas getViewPanel() {
    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();

    // Map with ID mapOsm is defined in the XML configuration. (mapOsm.xml)
    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");

    // Set a panning controller on the map:
    map.setController(new PanController(map));
    layout.addMember(map);
    return layout;
  }
View Full Code Here

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

      return new CommandSecuritySample();
    }
  };

  public Canvas getViewPanel() {
    final VLayout layout = new VLayout();
    layout.setMembersMargin(10);
    layout.setWidth100();
    layout.setHeight100();

    // Create horizontal layout for login buttons:
    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(10);
    buttonLayout.setHeight(20);

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

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

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

      public void onClick(ClickEvent event) {
        Authentication.getInstance().login("luc", "luc", null);
      }
    });
    buttonLayout.addMember(loginButtonLuc);

    // Create horizontal layout for login buttons:
    HLayout commandLayout = new HLayout();
    commandLayout.setMembersMargin(10);
    commandLayout.setHeight(20);

    // Create a button that calls the GetMapConfigurationCommand:
    IButton getMapButton = new IButton("command.GetMap");
    getMapButton.setWidth(150);
    getMapButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        GwtCommand commandRequest = new GwtCommand(GetMapConfigurationRequest.COMMAND);
        commandRequest.setCommandRequest(new GetMapConfigurationRequest("mapOsm", "gwt-samples"));
        GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {

          public void execute(CommandResponse response) {
            SC.say("Command executed successfully");
          }
        });
      }
    });
    commandLayout.addMember(getMapButton);

    // Create a button that calls the GetMapConfigurationCommand:
    IButton getResourcesButton = new IButton("command.GetResources");
    getResourcesButton.setWidth(150);
    getResourcesButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        GetResourcesRequest request = new GetResourcesRequest(
            new String[] { "WEB-INF/security.xml" });
        GwtCommand command = new GwtCommand("example.gwt.server.samples.GetSourceCommand");
        command.setCommandRequest(request);
        GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

          public void execute(CommandResponse response) {
            // User mark should never get here...
            SC.say("Command executed successfully");
          }
        });
      }
    });
    commandLayout.addMember(getResourcesButton);

    layout.addMember(buttonLayout);
    layout.addMember(commandLayout);
    return layout;
  }
View Full Code Here

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

      return new RenderingSample();
    }
  };

  public Canvas getViewPanel() {
    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();
    layout.setMembersMargin(10);

    HLayout mapLayout = new HLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setHeight("60%");

    // Map with ID wmsMap is defined in the XML configuration. (mapOsm.xml)
    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");
    map.setController(new PanController(map));
    mapLayout.addMember(map);

    // Layout with a huge list of buttons to test the rendering:
    HLayout buttonLayout = new HLayout();
    buttonLayout.setPadding(10);
    buttonLayout.setMembersMargin(10);
    VLayout column1 = new VLayout();
    column1.setMembersMargin(10);
    VLayout column2 = new VLayout();
    column2.setMembersMargin(10);
    VLayout column3 = new VLayout();
    column3.setMembersMargin(10);

    final Composite group1 = new Composite("some-group");
    final Composite group2 = new Composite("another-group");

    // Button1: Draw circle
    IButton button1 = new IButton(I18nProvider.getSampleMessages().renderingDrawCircle());
    button1.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        ShapeStyle style = new ShapeStyle("#66CC22", 0.5f, "#66AA22", 1, 2);
        map.getVectorContext().drawCircle(group1, "circle", new Coordinate(200, 100), 30, style);
      }
    });
    button1.setWidth100();
    column1.addMember(button1);

    // Button2: Draw LineString
    IButton button2 = new IButton(I18nProvider.getSampleMessages().renderingDrawLineString());
    button2.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        LineString geometry = map.getMapModel().getGeometryFactory().createLineString(
            new Coordinate[] { new Coordinate(60, 20), new Coordinate(120, 80), new Coordinate(80, 100) });
        ShapeStyle style = new ShapeStyle("#994488", 0.0f, "#993388", 1, 2);
        map.getVectorContext().drawLine(group2, "LineString", geometry, style);
      }
    });
    button2.setWidth100();
    column1.addMember(button2);

    // Button3: Draw Polygon
    IButton button3 = new IButton(I18nProvider.getSampleMessages().renderingDrawPolygon());
    button3.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        GeometryFactory factory = map.getMapModel().getGeometryFactory();
        LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(110, 10),
            new Coordinate(210, 10), new Coordinate(210, 110), new Coordinate(110, 110),
            new Coordinate(110, 10) });
        LinearRing hole = factory.createLinearRing(new Coordinate[] { new Coordinate(140, 40),
            new Coordinate(170, 40), new Coordinate(170, 70), new Coordinate(140, 70),
            new Coordinate(140, 40) });
        Polygon polygon = factory.createPolygon(shell, new LinearRing[] { hole });
        ShapeStyle style = new ShapeStyle("#9933EE", 0.5f, "#9900FF", 1, 2);
        map.getVectorContext().drawPolygon(group2, "Polygon", polygon, style);
      }
    });
    button3.setWidth100();
    column1.addMember(button3);

    // Button4: Draw Text
    IButton button4 = new IButton(I18nProvider.getSampleMessages().renderingDrawText());
    button4.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        FontStyle style = new FontStyle("#FF0000", 12, "Verdana", "normal", "normal");
        map.getVectorContext()
            .drawText(group1, "text", "This is some text...", new Coordinate(100, 120), style);
      }
    });
    button4.setWidth100();
    column2.addMember(button4);

    // Button5: Draw Rectangle
    IButton button5 = new IButton(I18nProvider.getSampleMessages().renderingDrawRectangle());
    button5.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        ShapeStyle style = new ShapeStyle("#337788", 0.5f, "#337766", 1, 2);
        map.getVectorContext().drawRectangle(group2, "rectangle", new Bbox(50, 200, 200, 50), style);
      }
    });
    button5.setWidth100();
    column2.addMember(button5);

    // Button6: Draw Image
    IButton button6 = new IButton(I18nProvider.getSampleMessages().renderingDrawImage());
    button6.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        Image image = new Image("image");
        image.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
        image.setBounds(new Bbox(250, 70, 48, 48));
        image.setStyle(new PictureStyle(0.5));
        // map.render(image, "all");
        map.getVectorContext().drawImage(group1, image.getId(), image.getHref(), image.getBounds(),
            (PictureStyle) image.getStyle());
      }
    });
    button6.setWidth100();
    column2.addMember(button6);

    // Button7: Set cursor
    IButton button7 = new IButton(I18nProvider.getSampleMessages().renderingNewCursor());
    button7.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().setCursor(group2, "rectangle", "wait");
      }
    });
    button7.setWidth100();
    column3.addMember(button7);

    // Button8: Transform elements
    IButton button8 = new IButton(I18nProvider.getSampleMessages().renderingTransform());
    button8.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1,
            new Matrix(0, 0, 0, 0, 150, 00));
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2,
            new Matrix(0, 0, 0, 0, 0, 100));
      }
    });
    button8.setWidth100();
    column3.addMember(button8);

    // Button9: Delete everything
    IButton button9 = new IButton(I18nProvider.getSampleMessages().renderingDelete());
    button9.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().deleteGroup(group1);
        map.getVectorContext().deleteGroup(group2);
      }
    });
    button9.setWidth100();
    column3.addMember(button9);

    buttonLayout.addMember(column1);
    buttonLayout.addMember(column2);
    buttonLayout.addMember(column3);
View Full Code Here

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

      return new CustomControllerSample();
    }
  };

  public Canvas getViewPanel() {
    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();

    VLayout mapLayout = new VLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setHeight("60%");

    // Map with ID wmsMap is defined in the XML configuration. (mapWms.xml)
    final MapWidget map = new MapWidget("mapWms", "gwt-samples");
    mapLayout.addMember(map);

    VLayout labelLayout = new VLayout();
    final Label label = new Label();
    labelLayout.addMember(label);

    // Create the custom controller:
    GraphicsController customController = new AbstractGraphicsController(map) {
     
      public void onMouseMove(MouseMoveEvent event) {
View Full Code Here

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

      return new GeoToolsSample();
    }
  };

  public Canvas getViewPanel() {
    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();

    // Map with ID geotoolsMap is defined in the XML configuration. (mapGeoTools.xml)
    final MapWidget map = new MapWidget("mapGeotools", "gwt-samples");

    // Set a panning controller on the map:
    map.setController(new PanController(map));
    layout.addMember(map);

    return layout;
  }
View Full Code Here

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

  };

  public Canvas getViewPanel() {
    final Bbox belgiumBounds = new Bbox(135977.5229612165, 6242678.930647222, 679887.6148060877, 625824.2623034349);

    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();
    layout.setMembersMargin(10);

    HLayout mapLayout = new HLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setHeight("60%");

    // Map with ID mapOsm is defined in the XML configuration. (mapOsm.xml)
    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");
    map.setController(new PanController(map));
    mapLayout.addMember(map);

    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(10);

    // Create a button to toggle bounds between the whole world an Belgium
    final IButton butToggleMaxBounds = new IButton(I18nProvider.getSampleMessages().toggleMaxBoundsBelgium());
    butToggleMaxBounds.setWidth100();
    buttonLayout.addMember(butToggleMaxBounds);

    butToggleMaxBounds.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        if (isBelgiumBoundsEnabled) { // switch to whole world bounds
          isBelgiumBoundsEnabled = false;
          map.getMapModel().getMapView().setMaxBounds(maxBounds);
          butToggleMaxBounds.setTitle(I18nProvider.getSampleMessages().toggleMaxBoundsBelgium());
        } else { // switch to Belgium bounds
          if (maxBounds == null) {
            // First we save the World bounds:
            maxBounds = map.getMapModel().getMapView().getMaxBounds();
          }
         
          map.getMapModel().getMapView().setMaxBounds(belgiumBounds);
          // force a new scale level so we go inside the bounding box of Belgium
          map.getMapModel().getMapView().applyBounds(belgiumBounds, ZoomOption.LEVEL_FIT);
          isBelgiumBoundsEnabled = true;
          butToggleMaxBounds.setTitle(I18nProvider.getSampleMessages().toggleMaxBoundsWorld());
        }
      }
    });

    layout.addMember(mapLayout);
    layout.addMember(buttonLayout);

    return layout;
  }
View Full Code Here

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

      return new LoginSample();
    }
  };

  public Canvas getViewPanel() {
    final VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();
    layout.setMembersMargin(20);

    // Create horizontal layout for the buttons:
    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(10);
    buttonLayout.setHeight(25);

    // Create a button that displays the login window on click:
    final IButton loginButton = new IButton("Log in");
    loginButton.setIcon("[ISOMORPHIC]/geomajas/silk/key.png");
    loginButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        LoginWindow loginWindow = new LoginWindow();
        loginWindow.setKeepInParentRect(true);
        layout.addMember(loginWindow);
      }
    });

    // Add a login handler that disables the login button on successful login:
    Authentication.getInstance().addLoginHandler(new LoginHandler() {

      public void onLoginFailure(LoginFailureEvent event) {
      }

      public void onLoginSuccess(LoginSuccessEvent event) {
        loginButton.setDisabled(true);
      }
    });

    // Create a log out button, and attach an event handler:
    LogoutButton logoutButton = new LogoutButton(new LogoutHandler() {

      // Show localized messages:
      public void onLogoutFailure(LogoutFailureEvent event) {
        SC.warn(I18nProvider.getSampleMessages().logoutFailure());
      }

      // Logout success - enable the login button again:
      public void onLogoutSuccess(LogoutSuccessEvent event) {
        SC.say(I18nProvider.getSampleMessages().logoutSuccess());
        loginButton.setDisabled(false);
      }
    });

    buttonLayout.addMember(loginButton);
    buttonLayout.addMember(logoutButton);
    layout.addMember(buttonLayout);
    return layout;
  }
View Full Code Here

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

      return new UnitTypesSample();
    }
  };

  public Canvas getViewPanel() {
    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();
    layout.setMembersMargin(10);

    HLayout mapLayout = new HLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setHeight("60%");

    // Map with ID mapOsm is defined in the XML configuration. (mapOsm.xml)
    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");
    map.setController(new PanController(map));
    mapLayout.addMember(map);

    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(10);

    IButton butSwitch = new IButton(I18nProvider.getSampleMessages().switchUnitTypes());
    butSwitch.setWidth100();
    buttonLayout.addMember(butSwitch);

    butSwitch.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {

        if (map.getMapModel().getMapInfo().getDisplayUnitType() == UnitType.METRIC) {
          SC.say(I18nProvider.getSampleMessages().unitTypeEnglish());
          map.getMapModel().getMapInfo().setDisplayUnitType(UnitType.ENGLISH); // set English
        } else {
          SC.say(I18nProvider.getSampleMessages().unitTypeMetric());
          map.getMapModel().getMapInfo().setDisplayUnitType(UnitType.METRIC); // set Metric
        }
        map.setScalebarEnabled(false); // force an update of the scale-bar...
        map.setScalebarEnabled(true); // force an update of the scale-bar...
      }
    });

    layout.addMember(mapLayout);
    layout.addMember(buttonLayout);

    return layout;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.