Package org.eclipse.graphiti.datatypes

Examples of org.eclipse.graphiti.datatypes.IDimension


    Iterator<Shape> iterator = containerShape.getChildren().iterator();
    while (iterator.hasNext()) {
      Shape shape = iterator.next();
      GraphicsAlgorithm shapeGa = shape.getGraphicsAlgorithm();
      IDimension size = gaService.calculateSize(shapeGa);
      if (containerWidth != size.getWidth() && shapeGa instanceof MultiText) {
        gaService.setWidth(shapeGa, containerWidth - 5);
        changed = true;
      }
      if (containerHeight != size.getHeight()) {
        if (shapeGa instanceof Polyline) {
          Polyline line = (Polyline) shapeGa;
          line.getPoints().set(2, getNewPoint(line, 2, containerHeight, gaService));
          line.getPoints().set(3, getNewPoint(line, 3, containerHeight, gaService));
          changed = true;
View Full Code Here


    bounds.setX(loc.getX());
    bounds.setY(loc.getY());

    GraphicsAlgorithm graphicsAlgorithm = element.getGraphicsAlgorithm();
    IDimension size = Graphiti.getGaService().calculateSize(graphicsAlgorithm);
    bounds.setHeight(size.getHeight());
    bounds.setWidth(size.getWidth());

    if (element instanceof ContainerShape) {
      EList<Shape> children = ((ContainerShape) element).getChildren();
      for (Shape shape : children) {
        if (shape instanceof ContainerShape) {
View Full Code Here

      peService.deletePictogramElement(s.getAnchors().get(i));
    }
  }

  public static void addFixedPointAnchors(Shape shape, GraphicsAlgorithm ga) {
    IDimension size = gaService.calculateSize(ga);
    int w = size.getWidth();
    int h = size.getHeight();
    AnchorUtil.createAnchor(shape, AnchorLocation.TOP, w / 2, 0);
    AnchorUtil.createAnchor(shape, AnchorLocation.RIGHT, w, h / 2);
    AnchorUtil.createAnchor(shape, AnchorLocation.BOTTOM, w / 2, h);
    AnchorUtil.createAnchor(shape, AnchorLocation.LEFT, 0, h / 2);
  }
View Full Code Here

    int containerWidth = ga.getWidth();
    int containerHeight = ga.getHeight();
   
    for (final Shape shape : containerShape.getChildren()) {
      final GraphicsAlgorithm shapeGa = shape.getGraphicsAlgorithm();
      final IDimension size = gaService.calculateSize(shapeGa);
     
      if (containerWidth != size.getWidth() && shapeGa instanceof MultiText) {
        gaService.setWidth(shapeGa, containerWidth - 5);
       
        changed = true;
      }
     
      if (containerHeight != size.getHeight()) {
        if (shapeGa instanceof Polyline) {
          final Polyline line = (Polyline) shapeGa;
         
          line.getPoints().set(2, getNewPoint(line, 2, containerHeight, gaService));
          line.getPoints().set(3, getNewPoint(line, 3, containerHeight, gaService));
View Full Code Here


public class TextUtil {

  public static void setTextSize(String text, MultiText textComponent) {
    IDimension textDimension = GraphitiUi.getUiLayoutService().calculateTextSize(text, textComponent.getFont());
    int lineCount = 1;
    if(textDimension.getWidth() > 95) {
      double width = textDimension.getWidth() / 95.0;
      lineCount = (int) Math.floor(width);
      if(lineCount < width) {
        lineCount++;
      }
      lineCount++;
    }
    IGaService gaService = Graphiti.getGaService();
    gaService.setSize(textComponent, 100, lineCount * textDimension.getHeight());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.datatypes.IDimension

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.