Package org.eclipse.wb.draw2d.geometry

Examples of org.eclipse.wb.draw2d.geometry.Point


  /**
   * @return the offset of {@link Figure} with headers relative to the absolute layer.
   */
  public final Point getOffset() {
    Point offset = new Point(0, 0);
    FigureUtils.translateFigureToAbsolute2(m_containerFigure, offset);
    offset.translate(m_layout.getContainer().getClientAreaInsets());
    return offset;
  }
View Full Code Here


            "com.smartgwt.client.widgets.form.DynamicForm",
            new ConstructorCreationSupport());
    {
      // drop Canvas on RootPanel
      panel.command_CREATE2(parentCanvas, null);
      panel.command_BOUNDS(parentCanvas, new Point(10, 10), new Dimension(700, 500));
      // broadcast for set widget as "live"
      parentCanvas.addBroadcastListener(new JavaInfoSetObjectAfter() {
        public void invoke(JavaInfo target, Object o) throws Exception {
          if (target == parentCanvas) {
            parentCanvas.removeBroadcastListener(this);
View Full Code Here

            "  </g:StackPanel>",
            "</ui:UiBinder>");
    // drag header of "button_2"
    {
      Rectangle bounds = panel.getWidgetHandles().get(1).getBounds();
      Point handleCenter = bounds.getCenter();
      canvas.moveTo(panel, handleCenter.x, handleCenter.y);
      canvas.beginDrag().dragTo(panel, 0.5, 0).endDrag();
    }
    assertXML(
        "// filler filler filler filler filler",
View Full Code Here

            "  </g:StackPanel>",
            "</ui:UiBinder>");
    // drag header of "button_1"
    {
      Rectangle bounds = panel.getWidgetHandles().get(0).getBounds();
      Point handleCenter = bounds.getCenter();
      canvas.moveTo(panel, handleCenter.x, handleCenter.y);
      canvas.beginDrag().dragTo(panel, 0.5, -1).endDrag();
    }
    assertXML(
        "// filler filler filler filler filler",
View Full Code Here

    assertTrue(isVisible(button_1));
    assertFalse(isVisible(button_2));
    // double click handle of "button_1"
    {
      Rectangle bounds = panel.getWidgetHandles().get(1).getBounds();
      Point handleCenter = bounds.getCenter();
      canvas.moveTo(panel, handleCenter.x, handleCenter.y).doubleClick();
    }
    // now "button_2" is visible
    assertFalse(isVisible(button_1));
    assertTrue(isVisible(button_2));
View Full Code Here

            "  </g:StackPanel>",
            "</ui:UiBinder>");
    // select header
    {
      Rectangle bounds = panel.getWidgetHandles().get(0).getBounds();
      Point handleCenter = bounds.getCenter();
      canvas.moveTo(panel, handleCenter.x, handleCenter.y).click();
    }
    // do direct edit
    canvas.performDirectEdit("123");
    assertXML(
View Full Code Here

      @Override
      protected void executeEdit() throws Exception {
        placementsSupport.commitAdd();
        Rectangle widgetModelBounds = component.getModelBounds();
        m_layout.command_CREATE(component, null);
        Point location = widgetModelBounds.getLocation();
        Dimension size = getSize(widgetModelBounds);
        m_layout.command_BOUNDS(component, location, size);
      }

      private Dimension getSize(Rectangle widgetModelBounds) {
View Full Code Here

  @Override
  protected boolean isRequestCondition(Request request) {
    // active only in top 15 pixels
    if (request instanceof LocationRequest) {
      LocationRequest locationRequest = (LocationRequest) request;
      Point location = locationRequest.getLocation().getCopy();
      PolicyUtils.translateAbsoluteToModel(this, location);
      if (location.y >= 15) {
        eraseTargetFeedback(request);
        return false;
      }
View Full Code Here

          // add Canvases heights
          for (CanvasInfo canvasInfo : sectionInfo.getCanvases()) {
            int canvasHeight = canvasInfo.getModelBounds().height;
            height += canvasHeight;
            // correct children Canvases bounds
            canvasInfo.setModelBounds(translateCanvas2Section(canvasInfo, new Point(0, -top)));
          }
          if (reverseOrder) {
            // reverse tweak children Canvases bounds
            for (CanvasInfo canvasInfo : sectionInfo.getCanvases()) {
              canvasInfo.setModelBounds(canvasInfo.getModelBounds().getTranslated(0, height));
View Full Code Here

  /**
   * @return the child {@link CanvasInfo} bounds translated to {@link SectionStackSectionInfo} area.
   */
  protected Rectangle translateCanvas2Section(CanvasInfo child, Point shift) {
    Point parentLocation = getModelBounds().getLocation();
    Point translatedLocation = parentLocation.getNegated().getTranslated(shift);
    if (!isRoot()) {
      UIObjectInfo root = (UIObjectInfo) getRootJava();
      translatedLocation.translate(root.getModelBounds().getLocation().getNegated());
    }
    Rectangle childBounds = child.getModelBounds();
    return childBounds.getTranslated(translatedLocation);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.draw2d.geometry.Point

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.