Package org.eclipse.graphiti.mm.pictograms

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


    return null;
  }

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


      context.setTargetContainer(diagram);
      context.setLocation((int) shape.getBounds().getX(), (int) shape.getBounds().getY());
    }

    if (addFeature.canAdd(context)) {
      PictogramElement newContainer = addFeature.add(context);
      featureProvider.link(newContainer, new Object[] { bpmnElement, shape });
      if (bpmnElement instanceof Participant) {
        elements.put(((Participant) bpmnElement).getProcessRef(), newContainer);
      }
      elements.put(bpmnElement, newContainer);
View Full Code Here

   */
  private void createEdge(BPMNEdge bpmnEdge) {
    BaseElement bpmnElement = bpmnEdge.getBpmnElement();
    EObject source = null;
    EObject target = null;
    PictogramElement se = null;
    PictogramElement te = null;

    String id = bpmnElement.getId();

    // for some reason connectors don't have a common interface
    if (bpmnElement instanceof MessageFlow) {
View Full Code Here

    return ModelUtil.hasName(element);
  }

  @Override
  public IReason updateNeeded(IUpdateContext context) {
    PictogramElement container = context.getPictogramElement();

    BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
            BaseElement.class);

    String elementName = ModelUtil.getName(element);
View Full Code Here

    return Reason.createFalseReason();
  }

  @Override
  public boolean update(IUpdateContext context) {
    PictogramElement container = (PictogramElement) context.getPictogramElement();
    BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
            BaseElement.class);
    Shape textShape = getChildElementOfType(container, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
    if (textShape!=null) {
      ((AbstractText) textShape.getGraphicsAlgorithm()).setValue(ModelUtil.getName(element));
View Full Code Here

  }

  public static String getShapeValue(IPictogramElementContext context) {
    String value = null;

    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();
View Full Code Here

  @SuppressWarnings("unchecked")
  public static <T extends EObject> T getChildElementOfType(PictogramElement container, String property, String expectedValue, Class<T> clazz) {
    IPeService peService = Graphiti.getPeService();
    Iterator<PictogramElement> iterator = peService.getAllContainedPictogramElements(container).iterator();
    while (iterator.hasNext()) {
      PictogramElement pe = iterator.next();
      String value = peService.getPropertyValue(pe, property);
      if (value != null && value.equals(expectedValue) && clazz.isInstance(pe)) {
        return (T) pe;
      }
    }
View Full Code Here

  @Override
  public boolean update(IUpdateContext context) {
    // TODO here it should get an updated picture from the element controller

    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();
View Full Code Here

    composite = new JbpmPropertiesComposite(parent, SWT.None);
  }

  @Override
  public void refresh() {
    PictogramElement pe = getSelectedPictogramElement();
    if (pe != null) {
      EObject be = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
      if (be instanceof Participant){
        composite.setEObject((BPMN2Editor) getDiagramEditor(), ((Participant) be).getProcessRef())
      }else if (be instanceof BPMNDiagram){
View Full Code Here

    ChopboxAnchor anchor = peService.createChopboxAnchor(containerShape);
    anchor.setReferencedGraphicsAlgorithm(ellipse);
    AnchorUtil.addFixedPointAnchors(containerShape, ellipse);

    Activity activity = event.getAttachedToRef();
    PictogramElement foundElem = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(), activity);
    if (foundElem != null && foundElem instanceof ContainerShape) {
      ContainerShape activityContainer = (ContainerShape) foundElem;
      PositionOnLine pos = BoundaryEventPositionHelper.getPositionOnLineUsingBPMNShape(containerShape,
              activityContainer);
      BoundaryEventPositionHelper.assignPositionOnLineProperty(containerShape, pos);
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.