Package org.eclipse.wb.draw2d.geometry

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


      // prepare row interval
      if (m_rowIntervals[row] == null) {
        Object trElement = dom.getParent(td);
        Rectangle trBounds = state.getAbsoluteBounds(trElement);
        container.absoluteToModel(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);
        container.absoluteToModel(tdBounds);
        Interval columnInterval = new Interval(tdBounds.x, tdBounds.width);
        if (colSpan == 1) {
          m_columnIntervals[column] = columnInterval;
        } else {
          spannedColumnIntervals.put(new Interval(column, colSpan), columnInterval);
        }
      }
      //Object widgetElement = dom.getElementById(Container_Info.getID(widget));
    }
    // fix spanned columns/rows
    fetchCells_fixSpannedColumns(spannedColumnIntervals);
    fetchCells_fixSpannedRows(spannedRowIntervals);
    // fill empty columns
    {
      int lastIntervalEnd = 0;
      for (int i = 0; i < m_columnIntervals.length; i++) {
        if (m_columnIntervals[i] != null) {
          lastIntervalEnd = m_columnIntervals[i].end();
        } else {
          Interval in = new Interval(lastIntervalEnd, TableLayoutInfo.E_WIDTH);
          m_columnIntervals[i] = in;
          lastIntervalEnd = in.end();
        }
      }
    }
    // if no rows, fill empty column intervals
    /*if (m_rowIntervals.length == 0) {
View Full Code Here


   * It is possible that some columns don't have individual widgets in not spanned cells, so we can
   * not get exact columns intervals and have to approximate it.
   */
  private void fetchCells_fixSpannedColumns(Map<Interval, Interval> spannedColumnIntervals) {
    for (int column = 0; column < m_columnIntervals.length; column++) {
      Interval rowInterval = m_columnIntervals[column];
      if (rowInterval == null) {
        for (Map.Entry<Interval, Interval> spanEntry : spannedColumnIntervals.entrySet()) {
          if (spanEntry.getKey().contains(column)) {
            int x = spanEntry.getValue().begin;
            int width = spanEntry.getValue().length / spanEntry.getKey().length;
            for (int _column = 0; _column < spanEntry.getKey().length; _column++) {
              m_columnIntervals[column + _column] = new Interval(x, width);
              x += width;
            }
          }
        }
      }
View Full Code Here

   * It is possible that some rows don't have individual widgets in not spanned cells, so we can not
   * get exact row intervals and have to approximate it.
   */
  private void fetchCells_fixSpannedRows(Map<Interval, Interval> spannedRowIntervals) {
    for (int row = 0; row < m_rowIntervals.length; row++) {
      Interval rowInterval = m_rowIntervals[row];
      if (rowInterval == null) {
        for (Map.Entry<Interval, Interval> spanEntry : spannedRowIntervals.entrySet()) {
          if (spanEntry.getKey().contains(row)) {
            int y = spanEntry.getValue().begin;
            int height = spanEntry.getValue().length / spanEntry.getKey().length;
            for (int _row = 0; _row < spanEntry.getKey().length; _row++) {
              m_rowIntervals[row + _row] = new Interval(y, height);
              y += height;
            }
          }
        }
      }
View Full Code Here

  @Override
  protected void refreshVisuals() {
    super.refreshVisuals();
    // prepare column interval
    Interval interval;
    {
      int index = m_dimension.getIndex();
      IGridInfo gridInfo = m_layout.getGridInfo();
      interval = gridInfo.getColumnIntervals()[index];
    }
View Full Code Here

  @Override
  protected void refreshVisuals() {
    super.refreshVisuals();
    // prepare column interval
    Interval interval;
    {
      int index = m_dimension.getIndex();
      IGridInfo gridInfo = m_layout.getGridInfo();
      interval = gridInfo.getRowIntervals()[index];
    }
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.