Package org.eclipse.wb.core.gef.policy.layout.grid

Examples of org.eclipse.wb.core.gef.policy.layout.grid.IGridInfo


    m_target = new GridTarget();
    // prepare location in model
    Point location = mouseLocation.getCopy();
    PolicyUtils.translateAbsoluteToModel(this, location);
    // prepare grid information
    IGridInfo gridInfo = m_layout.getGridInfo();
    Interval[] columnIntervals = gridInfo.getColumnIntervals();
    Interval[] rowIntervals = gridInfo.getRowIntervals();
    int lastX = columnIntervals.length != 0 ? columnIntervals[columnIntervals.length - 1].end() : 0;
    int lastY = rowIntervals.length != 0 ? rowIntervals[rowIntervals.length - 1].end() : 0;
    // prepare insert bounds
    {
      if (columnIntervals.length != 0) {
View Full Code Here


    WidgetInfo buttonB = panel.getChildrenWidgets().get(1);
    assertEquals(3, panel.getColumns().size());
    assertEquals(1, panel.getRows().size());
    assertEquals("3 1 [2] {(0,0)=(2,1) (1,0)=(1,1)}", panel.getStatus().toString());
    //
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(new Rectangle(0, 0, 2, 1), gridInfo.getComponentCells(buttonA));
    assertEquals(new Rectangle(2, 0, 1, 1), gridInfo.getComponentCells(buttonB));
  }
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    GridInfo panel = (GridInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(0, intervals.length);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(0, 0), intervals[0]);
      assertEquals(new Interval(0, 0), intervals[1]);
    }
  }
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    GridInfo panel = (GridInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(0, 0), intervals[0]);
      assertEquals(new Interval(0, 0), intervals[1]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(0, intervals.length);
    }
  }
View Full Code Here

            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    // check IGridInfo
    IGridInfo gridInfo = panel.getGridInfo();
    assertFalse(gridInfo.hasVirtualColumns());
    assertFalse(gridInfo.hasVirtualRows());
    try {
      gridInfo.getVirtualRowSize();
      fail();
    } catch (NotImplementedException e) {
    }
    try {
      gridInfo.getVirtualRowGap();
      fail();
    } catch (NotImplementedException e) {
    }
    try {
      gridInfo.getVirtualColumnSize();
      fail();
    } catch (NotImplementedException e) {
    }
    try {
      gridInfo.getVirtualColumnGap();
      fail();
    } catch (NotImplementedException e) {
    }
  }
View Full Code Here

            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    // check IGridInfo
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(2, gridInfo.getRowCount());
    assertEquals(2, gridInfo.getColumnCount());
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(2, 100), intervals[0]);
      assertEquals(new Interval(2 + 100 + 2, 200), intervals[1]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(2, 100), intervals[0]);
      assertEquals(new Interval(2 + 100 + 2, 200), intervals[1]);
    }
    // cells rectangle
    {
      {
        Rectangle cells = new Rectangle(0, 0, 1, 1);
        Rectangle expected = new Rectangle(2, 2, 100, 100).getResized(1, 1);
        assertEquals(expected, gridInfo.getCellsRectangle(cells));
      }
      {
        Rectangle cells = new Rectangle(0, 0, 2, 1);
        Rectangle expected = new Rectangle(2, 2, 100 + 2 + 200, 100).getResized(1, 1);
        assertEquals(expected, gridInfo.getCellsRectangle(cells));
      }
      {
        Rectangle cells = new Rectangle(0, 0, 1, 2);
        Rectangle expected = new Rectangle(2, 2, 100, 100 + 2 + 200).getResized(1, 1);
        assertEquals(expected, gridInfo.getCellsRectangle(cells));
      }
    }
  }
View Full Code Here

    refresh();
    HTMLTableInfo panel = getJavaInfoByName("panel");
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    // check IGridInfo
    IGridInfo gridInfo = panel.getGridInfo();
    {
      Rectangle cells = gridInfo.getComponentCells(button_2);
      assertEquals(new Rectangle(0, 0, 1, 1), cells);
    }
    {
      Rectangle cells = gridInfo.getComponentCells(button_1);
      assertEquals(new Rectangle(0, 0, 0, 0), cells);
      Rectangle cellsRectangle = gridInfo.getCellsRectangle(cells);
      assertEquals(new Rectangle(2, 2, 0, 0), cellsRectangle);
    }
  }
View Full Code Here

            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    // check IGridInfo
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(2, gridInfo.getColumnCount());
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(2, 100), intervals[0]);
      assertEquals(new Interval(2 + 100 + 2, 200), intervals[1]);
    }
    // low_getCellOfColumn()
View Full Code Here

            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    // check IGridInfo
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(2, gridInfo.getRowCount());
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(2, 100), intervals[0]);
      assertEquals(new Interval(2 + 100 + 2, 200), intervals[1]);
    }
  }
View Full Code Here

        "    {new: com.google.gwt.user.client.ui.Button} {empty} {/panel.setWidget(2, 1, new Button('2'))/}");
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button_1 = panel.getChildrenWidgets().get(0);
    WidgetInfo button_2 = panel.getChildrenWidgets().get(1);
    // check IGridInfo cells
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(new Rectangle(0, 0, 1, 1), gridInfo.getComponentCells(button_1));
    assertEquals(new Rectangle(1, 2, 1, 1), gridInfo.getComponentCells(button_2));
    // getOccupied()
    assertSame(button_1, gridInfo.getOccupied(0, 0));
    assertSame(button_2, gridInfo.getOccupied(1, 2));
    assertNull(gridInfo.getOccupied(1, 0));
    assertNull(gridInfo.getOccupied(1, 1));
    assertNull(gridInfo.getOccupied(2, 1));
    assertNull(gridInfo.getOccupied(3, 1));
    assertNull(gridInfo.getOccupied(0, 2));
    // we don't support insets
    assertTrue(gridInfo.getInsets().isEmpty());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.gef.policy.layout.grid.IGridInfo

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.