Package org.eclipse.graphiti.mm.pictograms

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


  }

  @Override
  public void delete(IDeleteContext context) {
    IFeatureProvider fp = getFeatureProvider();
    PictogramElement pictogramElement = context.getPictogramElement();
    if (pictogramElement instanceof ContainerShape) {
      ContainerShape cShape = (ContainerShape) pictogramElement;
      EList<Anchor> anchors = cShape.getAnchors();
      for (Anchor anchor : anchors) {
        deleteConnections(fp, anchor.getIncomingConnections());
View Full Code Here


  @Override
  public boolean canUpdate(IUpdateContext context) {
    EObject container = context.getPictogramElement().eContainer();
    if (container instanceof PictogramElement) {
      PictogramElement containerElem = (PictogramElement) container;
      if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
        return false;
      }
    }
    return BusinessObjectUtil.containsElementOfType(context.getPictogramElement(), Participant.class)
View Full Code Here

  @Override
  public IReason updateNeeded(IUpdateContext context) {
    EObject container = context.getPictogramElement().eContainer();
    if (container instanceof PictogramElement) {
      PictogramElement containerElem = (PictogramElement) container;
      if (BusinessObjectUtil.containsElementOfType(containerElem, ChoreographyActivity.class)) {
        return Reason.createFalseReason();
      }
    }
    if (!(context.getPictogramElement() instanceof ContainerShape)) {
View Full Code Here

    }
    return null;
  }

  public static PictogramElement getFirstBaseElementFromDiagram(Diagram diagram, BaseElement e) {
    PictogramElement foundElem = null;

    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement pe : elements) {
      BaseElement be = getFirstElementOfType(pe, e.getClass());
View Full Code Here

    return foundElem;
  }

  public static PictogramElement getPictogramElementFromDiagram(Diagram diagram, BPMNShape bpmnShape) {
    PictogramElement foundElem = null;

    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement pe : elements) {
      BPMNShape s = getFirstElementOfType(pe, BPMNShape.class);
View Full Code Here

  }

  public static void clearGateway(PictogramElement element) {
    Iterator<PictogramElement> iterator = peService.getAllContainedPictogramElements(element).iterator();
    while (iterator.hasNext()) {
      PictogramElement childElement = iterator.next();
      boolean deletable = Boolean.parseBoolean(peService.getPropertyValue(childElement, DELETABLE_PROPERTY));
      if (deletable) {
        peService.deletePictogramElement(childElement);
      }
    }
View Full Code Here

  public static boolean clearEvent(ContainerShape shape) {
    boolean cleared = false;

    Iterator<PictogramElement> iterator = peService.getAllContainedPictogramElements(shape).iterator();
    while (iterator.hasNext()) {
      PictogramElement element = iterator.next();

      if (element.getLink() == null) {
        continue;
      }

      EList<EObject> objects = element.getLink().getBusinessObjects();

      if (!objects.isEmpty() && objects.size() > 1) {
        return false;
      }
View Full Code Here

  }

  @Override
  public void setValue(String value, IDirectEditingContext context) {
    getBusinessObject(context).setName(value);
    PictogramElement e = context.getPictogramElement();
    updatePictogramElement(((Shape) e).getContainer());
  }
View Full Code Here

    updatePictogramElement(((Shape) e).getContainer());
  }

  @Override
  public boolean canDirectEdit(IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    Object bo = getBusinessObjectForPictogramElement(pe);
    return bo != null && bo instanceof FlowElement && context.getGraphicsAlgorithm() instanceof Text;
  }
View Full Code Here

    return TYPE_TEXT;
  }

  @Override
  public String getInitialValue(IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    ExclusiveGateway eClass = (ExclusiveGateway) getBusinessObjectForPictogramElement(pe);
    return eClass.getName();
  }
View Full Code Here

TOP

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

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.