Package org.eclipse.jst.pagedesigner.css2.layout

Examples of org.eclipse.jst.pagedesigner.css2.layout.FlowBox


    String verticalStyle = getVerticalAlign();
    int linesHeight = 0;

    if (lines != null && !lines.isEmpty()) {
      FlowBox bottomBox = ((FlowBox) lines.get(lines.size() - 1));
      FlowBox topBox = ((FlowBox) lines.get(0));
      linesHeight = bottomBox.getY() + bottomBox.getHeight() - topBox.getY();
    }
    int movement = 0;
    if (VerticalAlignMeta.BOTTOM.equals(verticalStyle)) {
      movement = _blockBox.getHeight() - linesHeight
          - _blockBox.getBorderPaddingHeight() / 2;
View Full Code Here


    graphics.setLineWidth(1);
    graphics.setLineStyle(Graphics.LINE_DASH);
    graphics.setForegroundColor(ColorConstants.lightGray);
    List fragments = figure.getFragmentsForRead();
    for (int i = 0, size = fragments.size(); i < size; i++) {
      FlowBox box = (FlowBox) fragments.get(i);
      // XXX: why -1?
      graphics.drawRectangle(box.getX(), box.getY(), box.getWidth() - 1, box
          .getHeight() - 1);
    }
    graphics.restoreState();
  }
View Full Code Here

   * @param g
   */
  public static void maskFigure(CSSFigure figure, Graphics g) {
    List fragments = figure.getFragmentsForRead();
    for (int i = 0, size = fragments.size(); i < size; i++) {
      FlowBox box = (FlowBox) fragments.get(i);
      maskRectangle(g, new Rectangle(box.getX(), box.getY(), box.getWidth(), box
          .getHeight()), null);
    }
  }
View Full Code Here

   * @param part
   * @param point
   * @return
   */
  private FlowBox getClosestBox() {
    FlowBox closestBox = null;
    List fragments = getLines(_part);

    // if there is one which are at the same line with relative,
    // calculate that line first;
    for (int i = 0; i < fragments.size(); i++) {
      FlowBox box = (FlowBox) fragments.get(i);
      Rectangle boxRect = getAbsoluteBounds(box);
      if (boxRect.contains(_point.x, _point.y)) {
        closestBox = box;
        break;
      }
View Full Code Here

   */
  public DesignPosition resolveTextPosition() {
    DesignPosition result = null;
    if (_part instanceof TextEditPart
        && !EditModelQuery.isTransparentText(Target.resolveNode(_part))) {
      FlowBox flowBox = getBox();
      if (flowBox instanceof TextFragmentBox) {
        TextFragmentBox box = (TextFragmentBox) flowBox;
        if (((TextEditPart) _part).getFigure() instanceof CSSTextFigure) {
          CSSTextFigure figure = (CSSTextFigure) ((TextEditPart) _part)
              .getFigure();
View Full Code Here

//    return ((GraphicalEditPart) _part).getFigure();
//  }

  private boolean isAfterPoint(Point point) {
    boolean result = false;
    FlowBox flowBox = getLine(0);
    if (IHTMLConstants.TAG_BR.equalsIgnoreCase(Target.resolveNode(_part)
        .getNodeName())) {
      if (flowBox != null) {
        Rectangle boxRect = getAbsoluteBounds(flowBox);
        result = CaretPositionResolver.getYDistance(boxRect, point) == 0;
View Full Code Here

  }

  /*package*/ boolean isBeforePoint(Point point) {
    boolean result = false;
    FlowBox flowBox = getLastLine();
    if (flowBox != null) {
      Rectangle boxRect = getAbsoluteBounds(flowBox);
      if (IHTMLConstants.TAG_BR.equalsIgnoreCase(Target
          .resolveNode(_part).getNodeName())) {
        return CaretPositionResolver.getYDistance(boxRect, point) == 0;
View Full Code Here

  /*package*/ boolean isBeforePoint() {
    return isBeforePoint(_point);
  }

  /*package*/ boolean atLeftPart(Point point) {
    FlowBox flowBox = getBox();
    if (flowBox != null) {
      Rectangle boxRect = getAbsoluteBounds(flowBox);
      return CaretPositionResolver.toXMiddle(boxRect, point) < 0;
    }
    return true;
View Full Code Here

  public Point getPoint() {
    return _point;
  }

  FlowBox getLine(int index) {
    FlowBox result = null;
    List lines = getLines(_part);
    if (lines.size() > 0 && index >= 0 && index <= lines.size() - 1) {
      result = (FlowBox) lines.get(index);
    }
    return result;
View Full Code Here

    }
    return result;
  }

  FlowBox getLastLine() {
    FlowBox result = null;
    List lines = getLines(_part);
    if (lines.size() > 0) {
      result = (FlowBox) lines.get(lines.size() - 1);
    }
    return result;
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.css2.layout.FlowBox

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.