Examples of FlowBox


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

          Rectangle bounds = figure.getBounds();
          if (figure instanceof CSSFigure) {
            List fragments = ((CSSFigure) figure)
                .getFragmentsForRead();
            if (fragments.size() > 0) {
              FlowBox box = (FlowBox) fragments.get(fragments
                  .size() - 1);
              bounds = LayoutPart.getBounds(box);
            }
          }
View Full Code Here

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

          .booleanValue();
      final int CARET_OFFSET = 1;
      Rectangle bounds = null;
      IFigure figure = ((GraphicalEditPart) part).getFigure();
      if (!caretIsAtRight) {
        FlowBox box;
        if ((box = layoutPart.getLine(0)) != null) {
          bounds = LayoutPart.getBounds(box);
        }
      } else {
        FlowBox box;
        if ((box = layoutPart.getLastLine()) != null) {
          bounds = LayoutPart.getBounds(box);
        }
      }
      if (bounds == null) {
View Full Code Here

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

      // the rectangle.
      Figure childFigure = new BorderFigure();
      childFigure.setBorder(new LineBorder(1));
      this.add(childFigure);

      FlowBox box = (FlowBox) fragments.get(i);
      Rectangle rect = new Rectangle(box.getX(), box.getY(), box.getWidth(), box
          .getHeight());
      cssfigure.translateToAbsolute(rect);

      childFigure.translateToRelative(rect);
      childFigure.setBounds(rect);
View Full Code Here

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

          List frags = ((ICSSFigure) figure).getFragmentsForRead();
          if (frags.size() > 1) // more than one frags, so is a zig
          // zag.
          {
            // check whether is before the first box.
            FlowBox box = (FlowBox) frags.get(0);
            Rectangle rect1 = getAbsoluteBounds(figure, box);
            if (rect1.x > p.x && rect1.y + rect1.height > p.y) {
              // p is at left/above the first box. so we think p
              // is before this child
              result[1] = child;
View Full Code Here

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

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

    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

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

   * @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

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

   * @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

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

   */
  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

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

//    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
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.