Package org.eclipse.wb.draw2d.geometry

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


    refresh();
    HTMLTableInfo grid = getJavaInfoByName("grid");
    CanvasInfo button = getJavaInfoByName("button");
    //
    IGridInfo gridInfo = grid.getGridInfo();
    assertEquals(new Rectangle(0, 0, 0, 0), gridInfo.getComponentCells(button));
  }
View Full Code Here


            "  }",
            "}");
    canvas.refresh();
    CanvasInfo button = getJavaInfoByName("button");
    // check that location applied
    Rectangle bounds = button.getBounds();
    assertThat(bounds.x).isEqualTo(100);
    assertThat(bounds.y).isEqualTo(50);
    assertThat(bounds.width).isEqualTo(BUTTON_WIDTH);
    assertThat(bounds.height).isEqualTo(BUTTON_HEIGHT);
  }
View Full Code Here

            "  }",
            "}");
    canvas.refresh();
    CanvasInfo button = getJavaInfoByName("button");
    // check that location applied
    Rectangle bounds = button.getBounds();
    assertThat(bounds.x).isEqualTo(100);
    assertThat(bounds.y).isEqualTo(50);
    assertThat(bounds.width).isEqualTo(BUTTON_WIDTH);
    assertThat(bounds.height).isEqualTo(BUTTON_HEIGHT);
  }
View Full Code Here

            "  }",
            "}");
    canvas.refresh();
    CanvasInfo button = getJavaInfoByName("button");
    // check that location/size applied
    Rectangle bounds = button.getBounds();
    assertThat(bounds.x).isEqualTo(100);
    assertThat(bounds.y).isEqualTo(50);
    assertThat(bounds.width).isEqualTo(200);
    assertThat(bounds.height).isEqualTo(75);
  }
View Full Code Here

    {
      Integer left = (Integer) ReflectionUtils.invokeMethod2(canvas.getObject(), "getAbsoluteLeft");
      assertThat(left).isEqualTo(0);
    }
    //
    assertThat(canvas.getAbsoluteBounds()).isEqualTo(new Rectangle(0, 0, 450, 300));
  }
View Full Code Here

      assertFalse(creationSupport.canDelete());
      assertFalse(creationSupport.canReorder());
      assertFalse(creationSupport.canReparent());
    }
    // default bounds
    assertEquals(new Rectangle(0, 0, 450, 300), frame.getBounds());
    // set new size
    {
      TopBoundsSupport topBoundsSupport = frame.getTopBoundsSupport();
      topBoundsSupport.setSize(500, 400);
      frame.refresh();
      assertEquals(new Rectangle(0, 0, 500, 400), frame.getBounds());
    }
  }
View Full Code Here

        "  {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /rootPanel.add(button)/ /rootPanel.setWidgetLeftRight(button, 10, Unit.PX, 20, Unit.PX)/ /rootPanel.setWidgetTopBottom(button, 30, Unit.PX, 40, Unit.PX)/}");
    frame.refresh();
    // bounds
    WidgetInfo button = getJavaInfoByName("button");
    {
      Rectangle expected = new Rectangle(10, 30, 450 - 10 - 20, 300 - 30 - 40);
      assertEquals(expected, button.getBounds());
      assertEquals(expected, button.getModelBounds());
    }
  }
View Full Code Here

    // prepare target header
    ColumnHeaderEditPart target = null;
    {
      for (EditPart editPart : getHost().getChildren()) {
        ColumnHeaderEditPart columnEditPart = (ColumnHeaderEditPart) editPart;
        Rectangle bounds = columnEditPart.getFigure().getBounds();
        if (location.x < bounds.getCenter().x) {
          target = columnEditPart;
          break;
        }
      }
    }
    // prepare grid information
    IGridInfo gridInfo = m_panel.getGridInfo();
    Interval[] columnIntervals = gridInfo.getColumnIntervals();
    Interval[] rowIntervals = gridInfo.getRowIntervals();
    int y1 = rowIntervals[0].begin - 5;
    int y2 = rowIntervals[rowIntervals.length - 1].end() + 5;
    // prepare index of target column and position for insert feedbacks
    final int targetIndex;
    int x;
    int size = AbstractGridLayoutEditPolicy.INSERT_COLUMN_SIZE;
    if (target != null) {
      targetIndex = target.getIndex();
      x = columnIntervals[targetIndex].begin - size / 2;
      if (targetIndex != 0) {
        x -= (columnIntervals[targetIndex].begin - columnIntervals[targetIndex - 1].end()) / 2;
      }
    } else {
      targetIndex = m_panel.getColumns().size();
      x = columnIntervals[columnIntervals.length - 1].end() - size / 2;
    }
    // show insert feedbacks
    {
      // ...on main viewer
      m_mainPolicy.showInsertFeedbacks(new Rectangle(x, y1, size, y2 - y1), null);
      // ...on header viewer
      {
        if (m_insertFeedback.getParent() == null) {
          addFeedback(m_insertFeedback);
        }
        // set bounds
        Point offset = headerEditPart.getOffset();
        Rectangle bounds = new Rectangle(x + offset.x, 0, size, getHostFigure().getSize().height);
        m_insertFeedback.setBounds(bounds);
      }
    }
    // show text feedback
    {
View Full Code Here

    // prepare target header
    RowHeaderEditPart target = null;
    {
      for (EditPart editPart : getHost().getChildren()) {
        RowHeaderEditPart rowEditPart = (RowHeaderEditPart) editPart;
        Rectangle bounds = rowEditPart.getFigure().getBounds();
        if (location.y < bounds.getCenter().y) {
          target = rowEditPart;
          break;
        }
      }
    }
    // prepare grid information
    IGridInfo gridInfo = m_panel.getGridInfo();
    Interval[] columnIntervals = gridInfo.getColumnIntervals();
    Interval[] rowIntervals = gridInfo.getRowIntervals();
    int x1 = columnIntervals[0].begin - 5;
    int x2 = columnIntervals[columnIntervals.length - 1].end() + 5;
    // prepare index of target column and position for insert feedbacks
    final int targetIndex;
    int y;
    int size = AbstractGridLayoutEditPolicy.INSERT_ROW_SIZE;
    if (target != null) {
      targetIndex = target.getIndex();
      y = rowIntervals[targetIndex].begin - size / 2;
      if (targetIndex != 0) {
        y -= (rowIntervals[targetIndex].begin - rowIntervals[targetIndex - 1].end()) / 2;
      }
    } else {
      targetIndex = m_panel.getRows().size();
      y = rowIntervals[rowIntervals.length - 1].end() - size / 2;
    }
    // show insert feedbacks
    {
      // ...on main viewer
      m_mainPolicy.showInsertFeedbacks(new Rectangle(x1, y, x2 - x1, size), null);
      // ...on header viewer
      {
        if (m_insertFeedback.getParent() == null) {
          addFeedback(m_insertFeedback);
        }
        // set bounds
        Point offset = headerEditPart.getOffset();
        Rectangle bounds = new Rectangle(0, y + offset.y, getHostFigure().getSize().width, size);
        m_insertFeedback.setBounds(bounds);
      }
    }
    // show text feedback
    {
View Full Code Here

    composite.refresh();
    assertNoErrors(composite);
    assertFalse(composite.isEmpty());
    // check Composite bounds
    {
      Rectangle bounds = composite.getBounds();
      assertEquals(new Rectangle(0, 0, 450, 300), bounds);
    }
    {
      Image image = composite.getImage();
      assertNotNull(image);
      assertThat(image.getBounds().width).isEqualTo(450);
      assertThat(image.getBounds().height).isEqualTo(300);
    }
    // check Button bounds
    {
      Rectangle bounds = panel.getBounds();
      assertEquals(new Rectangle(0, 0, 450, 300), bounds);
    }
  }
View Full Code Here

TOP

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

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.