Package org.openbp.cockpit.modeler.figures.process

Examples of org.openbp.cockpit.modeler.figures.process.TextElementFigure$SizeHandleLocator


          copyFlavor = ClientFlavors.PROCESS_ITEM;
        }

        else if (next instanceof TextElementFigure)
        {
          TextElementFigure textElementFigure = (TextElementFigure) next;
          textElementFigure.encodeGeometry();

          TextElement textElement = textElementFigure.getTextElement();

          // Clone the element and add it to the process
          textElement = (TextElement) textElement.clone();
          process.addTextElement(textElement);
View Full Code Here


      target.addTextElement(textElement);

      // Rebuild the references after adding the object to the target
      textElement.maintainReferences(ModelObject.SYNC_GLOBAL_REFNAMES);

      TextElementFigure textElementFigure = drawing.createTextElementFigure(textElement);
      if (textElementFigure == null)
      {
        target.removeTextElement(textElement);
        continue;
      }
View Full Code Here

        add(p);
    }

    for (Iterator it = process.getTextElements(); it.hasNext();)
    {
      TextElementFigure p = createTextElementFigure((TextElement) it.next());
      if (p != null)
      {
        add(p);
      }
    }
View Full Code Here

   * @param  textElement The text element
   * @return The new figure or null on error
   */
  public TextElementFigure createTextElementFigure(TextElement textElement)
  {
    TextElementFigure figure = new TextElementFigure();
    figure.connect(textElement, this);
    return figure;
  }
View Full Code Here

        editor.startUndo("Add Text Element");

        TextElement textElement = process.createTextElement();
        process.addTextElement(textElement);

        TextElementFigure textElementFigure = createTextElementFigure(textElement);

        Rectangle db = textElementFigure.displayBox();
        db.x = p.x - db.width / 2;
        db.y = p.y - db.height / 2;
        textElementFigure.displayBox(db);

        add(textElementFigure);

        addedFigure = textElementFigure;
      }
View Full Code Here

  // @@ AbstractHandle overrides
  //////////////////////////////////////////////////

  public void invokeStart(int x, int y, DrawingView view)
  {
    TextElementFigure textOwner = (TextElementFigure) owner();
    currentFont = textOwner.getFont();
  }
View Full Code Here

    currentFont = textOwner.getFont();
  }

  public void invokeStep(int x, int y, int anchorX, int anchorY, DrawingView view)
  {
    TextElementFigure textOwner = (TextElementFigure) owner();

    // Compute the distance to the original position; apply a factor so the resizing effect won't be too strong
    int xDiff = x - anchorX;
    int yDiff = y - anchorY;
    int dist = (int) Math.sqrt(xDiff * xDiff + yDiff * yDiff) / 10;
    if (xDiff + yDiff < 0)
    {
      // Moving to the upper left means smaller
      dist = -dist;
    }

    int newSize = currentFont.getSize() + dist;
    if (newSize < 8)
    {
      // No smaller than 8 pt
      newSize = 8;
    }

    textOwner.setFont(new Font(currentFont.getName(), currentFont.getStyle(), newSize));
  }
View Full Code Here

TOP

Related Classes of org.openbp.cockpit.modeler.figures.process.TextElementFigure$SizeHandleLocator

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.