Package org.fusesource.ide.camel.model

Examples of org.fusesource.ide.camel.model.Flow


   * @see org.eclipse.zest.core.viewers.IGraphContentProvider#getSource(java.lang.Object)
   */
  @Override
  public Object getSource(Object rel) {
    if (rel instanceof Flow) {
      Flow flow = (Flow) rel;
      return flow.getSource();
    }
    return null;
  }
View Full Code Here


   * @see org.eclipse.zest.core.viewers.IGraphContentProvider#getDestination(java.lang.Object)
   */
  @Override
  public Object getDestination(Object rel) {
    if (rel instanceof Flow) {
      Flow flow = (Flow) rel;
      return flow.getTarget();
    }
    return null;
  }
View Full Code Here

            route.addChild(target);
          }
        }
      } else {
        // create new business object
        Flow eReference = createFlow(source, target);

        // add connection for business object
        AddConnectionContext addContext = new AddConnectionContext(
            context.getSourceAnchor(), context.getTargetAnchor());
        addContext.setNewObject(eReference);
View Full Code Here

  /**
   * Creates a EReference between two EClasses.
   */
  private Flow createFlow(AbstractNode source, AbstractNode target) {
    Flow flow = new Flow(source, target);
    flow.setName("new Flow"); //$NON-NLS-1$

    return flow;
  }
View Full Code Here

   * @see org.eclipse.graphiti.func.IAdd#add(org.eclipse.graphiti.features.context.IAddContext)
   */
  @Override
  public PictogramElement add(IAddContext context) {
    IAddConnectionContext addConContext = (IAddConnectionContext) context;
    Flow addedEReference = (Flow) context.getNewObject();

    IPeCreateService peCreateService = Graphiti.getPeCreateService();
    // CONNECTION WITH POLYLINE
    Connection connection = peCreateService.createFreeFormConnection(getDiagram());
    connection.setStart(addConContext.getSourceAnchor());
    connection.setEnd(addConContext.getTargetAnchor());
   
    IGaService gaService = Graphiti.getGaService();
    Polyline polyline = gaService.createPolyline(connection);
    polyline.setStyle(StyleUtil.getStyleForEClass(getDiagram()));
    polyline.setForeground(manageColor(StyleUtil.getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_CONNECTION_COLOR))));

    // create link and wire it
    link(connection, addedEReference);

    // add dynamic text decorator for the reference name
    ConnectionDecorator textDecorator = peCreateService.createConnectionDecorator(connection, true, 0.5, true);
    Text text = gaService.createDefaultText(getDiagram(), getDiagram().getGraphicsAlgorithm());
    textDecorator.setConnection(connection);
    text.setStyle(StyleUtil.getStyleForCamelText((getDiagram())));
    gaService.setLocation(text, 10, 0);
    // set reference name in the text decorator
    Flow flow = (Flow) context.getNewObject();
    text.setValue(flow.getName());
   
    // add static graphical decorators (composition and navigable)
    ConnectionDecorator cd;
    cd = peCreateService.createConnectionDecorator(connection, false, 1.0, true);
    createArrow(cd);
View Full Code Here

        return label;
      } else if (element instanceof HasName) {
        HasName h = (HasName) element;
        return h.getName();
      } else if (element instanceof Flow) {
        Flow flow = (Flow) element;
        INodeStatistics stats = getStatsFor(flow);
        if (stats != null) {
          return statsLabel(stats);
        } else {
          return null;
View Full Code Here

        label = "[" + id + "] " + label;
      }
      // TODO add link to docs!
      return new Label(label);
    } else if (entity instanceof Flow) {
      Flow flow = (Flow) entity;
      INodeStatistics stats = getStatsFor(flow);
      if (stats != null) {
        return statsToolTip(stats);
      } else {
        return null;
View Full Code Here

TOP

Related Classes of org.fusesource.ide.camel.model.Flow

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.