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

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


  }

  protected IFigure createFigure() {
    // XXX: currently creating of CSSTextFigure is distributed both here
    // and FigureFactory. We may want to unify them later.
    return new CSSTextFigure(this);
  }
View Full Code Here


        && !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();
          Rectangle boxRect = getAbsoluteBounds(box);
          int index = FlowUtilities.getTextInWidth(box.getTextData(),
              figure.getCSSStyle().getCSSFont().getSwtFont(),
              _point.x - boxRect.x, TextLayoutSupport
                  .getAverageCharWidth(box));
          result = new DesignPosition(_part, box._offset + index);
        }
      }
View Full Code Here

      if (data.trim().length() == 0) {
        return;
      }
      // XXX: currently creating of CSSTextFigure is distributed both here
      // and TextEditPart. We may want to unify them later.
      CSSTextFigure figure = new CSSTextFigure(new ICSSTextProvider() {
        /*
         * (non-Javadoc)
         *
         * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSTextProvider#getCSSStyle()
         */
 
View Full Code Here

  public void updateFigure(Element node, CSSFigure oldFigure) {
    setCurrentFigure(oldFigure);
    ICSSWidgetProvider provider = initializeWidgetProvider(node);
    oldFigure.setCSSStyle(provider.getCSSStyle());
    oldFigure
        .setFixedLayoutManager(new CSSWidgetLayout(oldFigure, provider));
  }
View Full Code Here

   */
  public void refresh(boolean recursive) {
    if (!_tagConverter.isVisualByHTML()) {
      _tagConverter.convertRefresh(null);
      ((CSSFigure) getFigure())
          .setFixedLayoutManager(new CSSWidgetLayout(
              (CSSFigure) getFigure(), createHiddenProvider()));
      // nothing to refresh
      // ((CSSWidgetFigure)
      // getFigure()).setProvider(createHiddenProvider());
      return;
View Full Code Here

          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

          .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

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

          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

   * (non-Javadoc)
   *
   * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
   */
  protected IFigure createFigure() {
    FlowPage f = new FlowPage();
    return f;
  }
View Full Code Here

TOP

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

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.