Package org.eclipse.wb.draw2d.geometry

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


    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
      assertEquals(new Interval(RS + RA + RS, RA), intervals[1]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CE), intervals[0]);
      assertEquals(new Interval(CS + CE + CS, CA), intervals[1]);
      assertEquals(new Interval(CS + CE + CS + CA + CS, CA), intervals[2]);
    }
  }
View Full Code Here


    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
      assertEquals(new Interval(RS + RA + RS, RA), intervals[1]);
      assertEquals(new Interval(RS + RA + RS + RA + RS, RA), intervals[2]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CA), intervals[0]);
      assertEquals(new Interval(CS + CA + CS, CE), intervals[1]);
      assertEquals(new Interval(CS + CA + CS + CE + CS, CA), intervals[2]);
    }
  }
View Full Code Here

    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CA), intervals[0]);
      assertEquals(new Interval(CS + CA + CS, CA / 2), intervals[1]);
      assertEquals(new Interval(CS + CA + CS + CA / 2, CA / 2), intervals[2]);
    }
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(1, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
    }
  }
View Full Code Here

    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(3, intervals.length);
      int spanHeight = RA / 2;
      assertEquals(new Interval(RS, spanHeight), intervals[0]);
      assertEquals(new Interval(RS + spanHeight, spanHeight), intervals[1]);
      assertEquals(new Interval(RS + spanHeight + spanHeight, RA), intervals[2]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(CS, CE), intervals[0]);
      assertEquals(new Interval(CS + CE + CS, CA), intervals[1]);
    }
    // check TABLE element
    {
      assertEquals(3, ReflectionUtils.invokeMethod(panel.getObject(), "getRowCount()"));
      assertEquals(1, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 0));
View Full Code Here

    assertEquals("2 1 [1] {(0,0)=(2,1)}", panel.getStatus().toString());
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(1, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(CS, CA / 2), intervals[0]);
      assertEquals(new Interval(CS + CA / 2, CA / 2), intervals[1]);
    }
    // check TABLE element
    {
      assertEquals(1, ReflectionUtils.invokeMethod(panel.getObject(), "getRowCount()"));
      assertEquals(1, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 0));
View Full Code Here

      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

    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

    super.refreshVisuals();
    Figure figure = getFigure();
    // bounds
    {
      int index = getIndex();
      Interval interval = m_panel.getGridInfo().getColumnIntervals()[index];
      Rectangle bounds =
          new Rectangle(interval.begin,
              0,
              interval.length + 1,
              ((GraphicalEditPart) getParent()).getFigure().getSize().height);
View Full Code Here

    super.refreshVisuals();
    Figure figure = getFigure();
    // bounds
    {
      int index = getIndex();
      Interval interval = m_panel.getGridInfo().getRowIntervals()[index];
      Rectangle bounds =
          new Rectangle(0,
              interval.begin,
              ((GraphicalEditPart) getParent()).getFigure().getSize().width,
              interval.length + 1);
View Full Code Here

        // prepare row interval
        if (m_rowIntervals[row] == null) {
          Object trElement = dom.getParent(td);
          Rectangle trBounds = state.getAbsoluteBounds(trElement);
          absoluteToRelative(trBounds);
          Interval trInterval = new Interval(trBounds.y, trBounds.height);
          if (rowSpan == 1) {
            m_rowIntervals[row] = trInterval;
          } else {
            Rectangle tdBounds = state.getAbsoluteBounds(td);
            Interval spannedInterval = new Interval(trBounds.y, tdBounds.height);
            spannedRowIntervals.put(new Interval(row, rowSpan), spannedInterval);
          }
        }
        // prepare column interval
        if (m_columnIntervals[column] == null) {
          Rectangle tdBounds = state.getAbsoluteBounds(td);
          absoluteToRelative(tdBounds);
          Interval columnInterval = new Interval(tdBounds.x, tdBounds.width);
          if (colSpan == 1) {
            m_columnIntervals[column] = columnInterval;
          } else {
            spannedColumnIntervals.put(new Interval(column, colSpan), columnInterval);
          }
        }
        // next column
        column += colSpan;
      }
    }
    // fix spanned columns/rows
    fetchCells_fixSpannedColumns(spannedColumnIntervals);
    fetchCells_fixSpannedRows(spannedRowIntervals);
    // if no rows, fill column intervals
    if (m_rowIntervals.length == 0) {
      for (int i = 0; i < m_columnIntervals.length; i++) {
        m_columnIntervals[i] = new Interval();
      }
    }
    // if no columns, fill row intervals
    if (m_columnIntervals.length == 0) {
      for (int i = 0; i < m_rowIntervals.length; i++) {
        m_rowIntervals[i] = new Interval();
      }
    }
    // ensure that widget has at least some cells
    for (WidgetInfo widget : getChildrenWidgets()) {
      Rectangle cells = m_widgetToCells.get(widget);
View Full Code Here

TOP

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

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.