Package org.eclipse.graphiti.mm.pictograms

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


   * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
   */
  @Override
  public boolean isAvailable(IContext context) {
    ICustomContext cc = (ICustomContext) context;
    PictogramElement _pe = cc.getPictogramElements()[0] instanceof Connection ? ((Connection) cc.getPictogramElements()[0])
                .getStart().getParent() : cc.getPictogramElements()[0];
        final Object bo = getBusinessObjectForPictogramElement(_pe);
      
        if (bo instanceof AbstractNode) {
          AbstractNode _ep = (AbstractNode) bo;
View Full Code Here


    // get the business-objects for all pictogram-elements
    // we already verified, that all business-objets are EClasses
    PictogramElement[] pes = context.getPictogramElements();
    Object[] bos = new Object[pes.length];
    for (int i = 0; i < pes.length; i++) {
      PictogramElement pe = pes[i];
      bos[i] = getBusinessObjectForPictogramElement(pe);
    }
    // put all business objects to the clipboard
    putToClipboard(bos);
  }
View Full Code Here

      return CamelDebugUtils.getBreakpointsForContext(fileName, projectName).length>0 && isRouteSelected(context);
  }
 
  private boolean isRouteSelected(IContext context) {
    ICustomContext cc = (ICustomContext) context;
    PictogramElement _pe = cc.getPictogramElements()[0] instanceof Connection ? ((Connection) cc.getPictogramElements()[0])
                .getStart().getParent() : cc.getPictogramElements()[0];
        final Object bo = getBusinessObjectForPictogramElement(_pe);
      
        return bo == null || bo instanceof RouteSupport;
  }
View Full Code Here

    } else {
      Activator.getLogger().warning("Warning! Could not find currently selectedNode, so can't associate this node with the route!: " + node);
    }

    // do the add
    PictogramElement pe = addGraphicalRepresentation(context, node);

    getFeatureProvider().link(pe, node);
   
    // activate direct editing after object creation
    getFeatureProvider().getDirectEditingInfo().setActive(true);
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
   */
  @Override
  public void execute(ICustomContext context) {
    PictogramElement _pe = context.getPictogramElements()[0] instanceof Connection ? ((Connection) context.getPictogramElements()[0])
                .getStart().getParent() : context.getPictogramElements()[0];
        final Object bo = getBusinessObjectForPictogramElement(_pe);
      
        if (bo instanceof AbstractNode) {
          AbstractNode _ep = (AbstractNode) bo;
View Full Code Here

   * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
   */
  @Override
  public boolean isAvailable(IContext context) {
    ICustomContext cc = (ICustomContext) context;
    PictogramElement _pe = cc.getPictogramElements()[0] instanceof Connection ? ((Connection) cc.getPictogramElements()[0])
                .getStart().getParent() : cc.getPictogramElements()[0];
        final Object bo = getBusinessObjectForPictogramElement(_pe);
      
        if (bo instanceof AbstractNode) {
          AbstractNode _ep = (AbstractNode) bo;
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.graphiti.features.custom.ICustomFeature#execute(org.eclipse.graphiti.features.context.ICustomContext)
   */
  @Override
  public void execute(ICustomContext context) {
    PictogramElement _pe = context.getPictogramElements()[0] instanceof Connection ? ((Connection) context.getPictogramElements()[0])
                .getStart().getParent() : context.getPictogramElements()[0];
        final Object bo = getBusinessObjectForPictogramElement(_pe);
        final IResource resource = getResource();
      
        if (bo instanceof AbstractNode) {
View Full Code Here

   * @see org.eclipse.graphiti.features.custom.AbstractCustomFeature#isAvailable(org.eclipse.graphiti.features.context.IContext)
   */
  @Override
  public boolean isAvailable(IContext context) {
    ICustomContext cc = (ICustomContext) context;
    PictogramElement _pe = cc.getPictogramElements()[0] instanceof Connection ? ((Connection) cc.getPictogramElements()[0])
                .getStart().getParent() : cc.getPictogramElements()[0];
        final Object bo = getBusinessObjectForPictogramElement(_pe);
      
        if (bo instanceof AbstractNode) {
          AbstractNode _ep = (AbstractNode) bo;
View Full Code Here

    addContext.setY(y);
    y += 100;

    IAddFeature addFeature = featureProvider.getAddFeature(addContext);
    if (addFeature.canAdd(addContext)) {
      PictogramElement destState = null;
      if (processedNodes.contains(node) == false) {
        destState = addFeature.add(addContext);
      } else {
        destState = featureProvider.getPictogramElementForBusinessObject(node);
      }
      // remember the node
      processedNodes.add(node);
     
      if (!(route instanceof RouteSupport)) {
        // lets remove the current connection between the parent and node so that
        // createFeature.canCreate() returns true
        route.removeConnection(node);

        CreateFlowFeature createFeature = new CreateFlowFeature(featureProvider);
        CreateConnectionContext connectContext = new CreateConnectionContext();
        PictogramElement srcState = featureProvider.getPictogramElementForBusinessObject(route);
        //PictogramElement destState = featureProvider.getPictogramElementForBusinessObject(node);
        if (srcState == destState) {
          Activator.getLogger().debug("Should not be the same element for different nodes: " + route + " and " + node);
        }
        connectContext.setSourcePictogramElement(srcState);
View Full Code Here

    super(fp);
  }

  public boolean canLayout(ILayoutContext context) {
    // return true, if pictogram element is linked to an EClass
    PictogramElement pe = context.getPictogramElement();
    if (!(pe instanceof ContainerShape))
      return false;
   
    Object[] bos = getAllBusinessObjectsForPictogramElement(pe);
   
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.