Package org.eclipse.graphiti.mm.algorithms

Examples of org.eclipse.graphiti.mm.algorithms.AbstractText


        // Set name in pictogram model
        if (pictogramElement instanceof ContainerShape) {
            ContainerShape cs = (ContainerShape) pictogramElement;
            for (Shape shape : cs.getChildren()) {
                if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
                  AbstractText text =
                      (AbstractText) shape.getGraphicsAlgorithm();
   
                    text.setValue(businessValue);
                 
                    //We can user the layoutservice to get the new size
                    //but it seems to be broken wrt new lines so we need
                    //to multiply up by number of lines.
                    IDimension dim = GraphitiUi.getUiLayoutService(
                        ).calculateTextSize(
                            businessValue, text.getFont());
                   
                    text.setHeight(2 + (dim.getHeight() *
                        businessValue.split("\n").length));
                    cs.getGraphicsAlgorithm().setHeight(text.getHeight());
                    if (cs.eContainer() instanceof ContainerShape) {
                      ((ContainerShape) cs.eContainer()
                          ).getGraphicsAlgorithm().setHeight(
                              text.getHeight() + 20);
                    }
                   
                    return true;
                }
            }
View Full Code Here


    PictogramElement pe = context.getPictogramElement();
    if (pe instanceof ContainerShape) {
      ContainerShape cs = (ContainerShape) pe;
      for (Shape shape : cs.getChildren()) {
        if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
          AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
          value = text.getValue();
        }
      }
    }
    return value;
  }
View Full Code Here

    PictogramElement pe = context.getPictogramElement();
    if (pe instanceof ContainerShape) {
      ContainerShape cs = (ContainerShape) pe;
      for (Shape shape : cs.getChildren()) {
        if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
          AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
          text.setValue(FeatureSupport.getBusinessValue(context));
          return true;
        }
      }
    }
    return false;
View Full Code Here

    final PictogramElement pictogramElement = context.getPictogramElement();
    if (pictogramElement instanceof ContainerShape) {
      final ContainerShape cs = (ContainerShape) pictogramElement;
      for (final Shape shape : cs.getChildren()) {
      if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
        final AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
         
        pictogramText = text.getValue();
      }
      }
    }
   
    String businessText = null;
View Full Code Here

   
    if (pe instanceof ContainerShape) {
      final ContainerShape cs = (ContainerShape) pe;
      for (Shape shape : cs.getChildren()) {
        if (shape.getGraphicsAlgorithm() instanceof AbstractText) {
          final AbstractText text = (AbstractText) shape.getGraphicsAlgorithm();
         
          text.setValue(businessText);
         
          return true;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.mm.algorithms.AbstractText

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.