Examples of DimensionInfo


Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

    int suggestedWith = _blockBox.getContentWidth();
    int suggestedHeight = _blockBox.getContentHeight();
    // int suggestedWith = getSuggestedWidth(line, style, provider);
    // int suggestedHeight = getSuggestedHeight(line, style, provider);

    DimensionInfo resultInfo = provider.getPreferredDimension(
        suggestedWith, suggestedHeight);
    Dimension resultSize = resultInfo.getDimension();

    _widgetBox = new WidgetBox(); // ((CSSWidgetFigure)getFlowFigure()).getWidgetBox();
    // if (provider.isHandlingBorder() || style == null)
    // {
    _widgetBox.setWidth(resultSize.width);
    _widgetBox.setHeight(resultSize.height);
    _widgetBox.setAscent(resultInfo.getAscent());
    // }
    // else
    // {
    // widgetBox.setWidth(resultSize.width +
    // style.getBorderInsets().getWidth());
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

    }
    if (height <= 0) {
      height = getDefaultHeight();
    }
    return new DimensionInfo(width, height, -1);
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

      width = getDefaultWidth();
    }
    if (height <= 0) {
      height = getDefaultHeight();
    }
    return new DimensionInfo(width, height, -1);
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

      width = getDefaultWidth();
    }
    if (height <= 0) {
      height = getDefaultHeight();
    }
    return new DimensionInfo(width, height, -1);
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

    if (height > 0 && minHeight > height) {
      prefHeight = minHeight;
    } else if (height != 0) {
      prefHeight = height;
    }
    return new DimensionInfo(prefWidth, prefHeight, -1);
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

    }
    if (height <= 0) {
      height = getDefaultHeight();
    }
    return new DimensionInfo(new Dimension(width, height), -1);
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

   */
  public DimensionInfo getPreferredDimension(int width, int height) {
    if (width <= 0 && height <= 0) {
      // we are free, so use image size
      org.eclipse.swt.graphics.Rectangle a = _image.getBounds();
      return new DimensionInfo(a.width, a.height, -1);
    } else if (width > 0 && height > 0) {
      return new DimensionInfo(width, height, -1);
    } else if (height > 0) {
      width = (int) ((double) _imageWidth * height / _imageHeight);
      return new DimensionInfo(width, height, -1);
    } else {
      height = (int) ((double) _imageHeight * width / _imageWidth);
      return new DimensionInfo(width, height, -1);
    }
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

      width = getDefaultWidth();
    }
    if (height <= 0) {
      height = getDefaultWidth();
    }
    return new DimensionInfo(width, height, height * 4 / 5);
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

      width = getDefaultWidth();
    }
    if (height <= 0) {
      height = getDefaultWidth();
    }
    return new DimensionInfo(new Dimension(width, height), height * 4 / 5);
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.provider.DimensionInfo

      preWidth = getLabelWidth() + _imageWidth;
    }
    if (height <= 0) {
      preHeight = Math.max(getLabelHeight(), _imageHeight);
    }
    return new DimensionInfo(preWidth, preHeight, -1);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.