Package helma.util

Examples of helma.util.MarkdownProcessor$BaseElement


    PictogramElement foundElem = null;

    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement pe : elements) {
      BaseElement be = getFirstElementOfType(pe, e.getClass());
      if (be != null && be.equals(e)) {
        foundElem = pe;
        break;
      }
    }
View Full Code Here


    return true;
  }

  @Override
  public Object[] create(ICreateContext context) {
    BaseElement element = null;
    try {
      ModelHandler handler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      element = add(context.getTargetContainer(), handler);
    } catch (IOException e) {
      Activator.logError(e);
View Full Code Here

      return new Dimension(newWidth, newHeight);
    }
  }

  private static Dimension resizeRecursively(ContainerShape root) {
    BaseElement elem = BusinessObjectUtil.getFirstElementOfType(root, BaseElement.class);
    List<Dimension> dimensions = new ArrayList<Dimension>();
    IGaService service = Graphiti.getGaService();
    int foundContainers = 0;

    for (Shape s : root.getChildren()) {
View Full Code Here

    return new Dimension(width, height);
  }

  private static void postResizeFixLenghts(ContainerShape root) {
    IGaService service = Graphiti.getGaService();
    BaseElement elem = BusinessObjectUtil.getFirstElementOfType(root, BaseElement.class);
    int width = root.getGraphicsAlgorithm().getWidth() - 15;

    for (Shape s : root.getChildren()) {
      Object o = BusinessObjectUtil.getFirstElementOfType(s, BaseElement.class);
      if (checkForResize(elem, s, o)) {
View Full Code Here

      }
      else {
        edge.setSourceElement(de);
      }
     
      BaseElement flow = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), BaseElement.class);
      BaseElement be = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class);
      if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) {
        EStructuralFeature feature = flow.eClass().getEStructuralFeature("targetRef");
        if (feature!=null)
          flow.eSet(feature, be);
      }
View Full Code Here

    super(fp);
  }

  @Override
  public boolean canUpdate(IUpdateContext context) {
    BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
            BaseElement.class);
    if (element == null) {
      return false;
    }
    return ModelUtil.hasName(element);
View Full Code Here

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

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

    String elementName = ModelUtil.getName(element);
    Shape textShape = getChildElementOfType(container, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
    if (textShape!=null) {
View Full Code Here

  }

  @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));
      layoutPictogramElement(context.getPictogramElement());
View Full Code Here

  }

  private void relayoutLanes(List<DiagramElement> ownedElement) {
    for (DiagramElement diagramElement : ownedElement) {
      if (diagramElement instanceof BPMNShape && ((BPMNShape) diagramElement).getBpmnElement() instanceof Lane) {
        BaseElement lane = ((BPMNShape) diagramElement).getBpmnElement();
        ContainerShape shape = (ContainerShape) BusinessObjectUtil.getFirstBaseElementFromDiagram(diagram, lane);
        FeatureSupport.redraw(shape);
      }
    }
  }
View Full Code Here

   * Find a Graphiti feature for given shape and generate necessary diagram elements.
   *
   * @param shape
   */
  private void createShape(BPMNShape shape) {
    BaseElement bpmnElement = shape.getBpmnElement();
    if (shape.getChoreographyActivityShape() != null) {
      // FIXME: we currently generate participant bands automatically
      return;
    }
    IAddFeature addFeature = featureProvider.getAddFeature(new AddContext(new AreaContext(), bpmnElement));

    if (addFeature == null) {
      Activator.logStatus(new Status(IStatus.WARNING, Activator.PLUGIN_ID, "Element not supported: "
          + bpmnElement.eClass().getName()));
      return;
    }

    AddContext context = new AddContext();
    context.putProperty(IMPORT_PROPERTY, true);
    context.setNewObject(bpmnElement);
    context.setSize((int) shape.getBounds().getWidth(), (int) shape.getBounds().getHeight());

    if (bpmnElement instanceof Lane) {
      handleLane(bpmnElement, context, shape);
    } else if (bpmnElement instanceof FlowNode) {
      handleFlowNode((FlowNode) bpmnElement, context, shape);
    } else {
      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);
      handleEvents(bpmnElement, newContainer);
    }
   
    ModelUtil.addID(bpmnElement);
    String id = bpmnElement.getId();
    if (shape.getId() == null)
      shape.setId(id);
   
    if (!bpmnElement.eAdapters().contains(liveValidationContentAdapter)) {
      bpmnElement.eAdapters().add(liveValidationContentAdapter);
    }
  }
View Full Code Here

TOP

Related Classes of helma.util.MarkdownProcessor$BaseElement

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.