Package org.eclipse.graphiti.mm.pictograms

Examples of org.eclipse.graphiti.mm.pictograms.Shape



    // SHAPE WITH TEXT
    {
      // create shape for text
      Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      MultiText text = gaService.createDefaultMultiText(
          getDiagram(), shape, Utility.getLiteralValue(addedObj));
      text.setStyle(StyleUtil.getStyleForText(getDiagram()));
View Full Code Here


    return super.getUpdateFeature(context);
  }

  @Override
  public IMoveShapeFeature getMoveShapeFeature(IMoveShapeContext context) {
    Shape shape = context.getShape();
    Object bo = getBusinessObjectForPictogramElement(shape);
    if (bo instanceof AbstractNode) {
      return new MoveNodeFeature(this);
    }
    return super.getMoveShapeFeature(context);
View Full Code Here

    return new RemoveNodeFeature(this);
  }
 
  @Override
  public IResizeShapeFeature getResizeShapeFeature(IResizeShapeContext context) {
    Shape shape = context.getShape();
    Object bo = getBusinessObjectForPictogramElement(shape);
    if (bo instanceof AbstractNode) {
      return new ResizeNodeFeature(this);
    }
    return super.getResizeShapeFeature(context);
View Full Code Here

    NodeList myNodes = new NodeList();
    myNodes.addAll(graph.nodes);
    myNodes.addAll(graph.subgraphs);
    for (Object object : myNodes) {
      Node node = (Node) object;
      Shape shape = (Shape) node.data;
      shape.getGraphicsAlgorithm().setX(node.x);
      shape.getGraphicsAlgorithm().setY(node.y);
      shape.getGraphicsAlgorithm().setWidth(node.width);
      shape.getGraphicsAlgorithm().setHeight(node.height);
    }
    return null;
  }
View Full Code Here

    boolean canMove = super.canMoveShape(context);

    // perform further check only if move allowed by default feature
    if (canMove) {
      // don't allow move if the class name has the length of 1
      Shape shape = context.getShape();
      Object bo = getBusinessObjectForPictogramElement(shape);
      if (bo instanceof EClass) {
        EClass c = (EClass) bo;
        if (c.getName() != null && c.getName().length() == 1) {
          canMove = false;
View Full Code Here

    }
   
    // image
    {
      // create shape for image
      final Shape shape = peCreateService.createShape(containerShape, false);

      // create and set image
      final Image image = gaService.createImage(shape, ImageProvider.getKeyForLargeIcon(addedClass.getIconName()));
      gaService.setLocationAndSize(image, imageRect.x, imageRect.y, imageRect.width, imageRect.height);

      // if addedClass has no resource we add it to the resource of the diagram
      // in a real scenario the business model would have its own resource
//      if (addedClass.eResource() == null) {
//        getDiagram().eResource().getContents().add(addedClass);
//      }
    }

    // SHAPE WITH TEXT
    {
      // create shape for text
      final Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      final Text text = gaService.createDefaultText(getDiagram(), shape, label);

      Style style = StyleUtil.getStyleForCamelText(getDiagram());
View Full Code Here

        xy = new int[] { 0, 11, whalf, 0, width, 11 };
        Polyline lineTop = gaService.createPolyline(invisibleRect, xy, bend);
        lineTop.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

        Shape textShape = peService.createShape(container, false);
        peService
            .setPropertyValue(textShape, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
        Text text = gaService.createDefaultText(getDiagram(), textShape, store.getName());
        text.setStyle(StyleUtil.getStyleForText(getDiagram()));
        text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
View Full Code Here

    Graphiti.getPeService().setPropertyValue(container, TRIGGERED_BY_EVENT, "false");

    IPeService peService = Graphiti.getPeService();
    IGaService gaService = Graphiti.getGaService();

    Shape textShape = peService.createShape(container, false);
    Text text = gaService.createDefaultText(getDiagram(), textShape, activity.getName());
    gaService.setLocationAndSize(text, 5, 5, width - 10, 15);
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
View Full Code Here

      boolean drawCollectionMarker = data.isIsCollection();

      Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
      while (iterator.hasNext()) {
        Shape shape = iterator.next();
        String prop = peService.getPropertyValue(shape, Properties.HIDEABLE_PROPERTY);
        if (prop != null && new Boolean(prop)) {
          Polyline line = (Polyline) shape.getGraphicsAlgorithm();
          line.setLineVisible(drawCollectionMarker);
        }
      }

      peService.setPropertyValue(container, Properties.COLLECTION_PROPERTY,
View Full Code Here

      protected void hook(Activity activity, ContainerShape container, IAddContext context, int width, int height) {
        super.hook(activity, container, context, width, height);
        IPeService peService = Graphiti.getPeService();
        Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
        while (iterator.hasNext()) {
          Shape shape = iterator.next();
          String property = peService.getPropertyValue(shape, GraphicsUtil.ACTIVITY_MARKER_CONTAINER);
          if (property != null && new Boolean(property)) {
            Polyline tilde = GraphicsUtil.createActivityMarkerAdHoc((ContainerShape) shape);
            tilde.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
          }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.mm.pictograms.Shape

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.