Package org.eclipse.draw2d.graph

Examples of org.eclipse.draw2d.graph.Subgraph


   * @param parent
   *            If non-null, the parent subgraph.
   */
  @SuppressWarnings("unchecked")
  void addNodes(NodeList nodes) {
    subgraph = new Subgraph(this);
    subgraph.innerPadding = new Insets(0, 0, 0, 0);
    subgraph.insets = new Insets(20, 0, 0, 0);
    Figure figure = (Figure) getFigure();
    subgraph.setSize(figure.getPreferredSize());
    subgraph.setPadding(new Insets(2, 2, 2, 2));
View Full Code Here


  @Override
  public void contributeNodesToGraph(CompoundDirectedGraph graph, Subgraph s,
      Map<AbstractGraphicalEditPart, Object> map) {
    GraphAnimation.recordInitialState(getContentPane());
    Subgraph me = new Subgraph(this, s);

    me.outgoingOffset = 5;
    me.incomingOffset = 5;
    IFigure fig = getFigure();
    if (fig instanceof SubgraphFigure) {
View Full Code Here

    map.put(this, n);
    graph.nodes.add(n);

    for (int i = 0; i < getSourceConnections().size(); i++) {
      TransitionPart trans = (TransitionPart) getSourceConnections().get(i);
      Subgraph sub = (Subgraph) map.get(getViewer().getContents());
      trans.contributeNodesToGraph(graph, s, map);
    }
  }
View Full Code Here

  @Override
  protected void contributeNodesToGraph(CompoundDirectedGraph graph, Subgraph s,
      Map<AbstractGraphicalEditPart, Object> map) {
    GraphAnimation.recordInitialState(getContentPane());
    Subgraph me = new Subgraph(this, s);
    // me.setRowConstraint(getActivity().getSortIndex());
    me.outgoingOffset = 5;
    me.incomingOffset = 5;
    IFigure fig = getFigure();
    if (fig instanceof SubgraphFigure) {
      if (graph.getDirection() == PositionConstants.EAST) {
        if (fig instanceof ParallelActivityFigure) {
          me.width = fig.getPreferredSize(me.width, me.height).width;
          int tagHeight = ((SubgraphFigure) fig).getHeader().getPreferredSize().height;
          int tagWidth = ((SubgraphFigure) fig).getHeader().getPreferredSize().width;
          me.insets.left = tagHeight;
          me.insets.top = tagWidth;
          me.insets.right = tagHeight;
        }
        else if (fig instanceof SequentialActivityFigure) {
          me.height = fig.getPreferredSize(me.width, me.height).height;
          int tagWidth = ((SubgraphFigure) fig).getHeader().getPreferredSize().width;
          me.insets.top = tagWidth;
          me.insets.left = 0;
          me.insets.bottom = tagWidth;
        }
      }
      else {
        me.width = fig.getPreferredSize(me.width, me.height).width;
        int tagHeight = ((SubgraphFigure) fig).getHeader().getPreferredSize().height;
        me.insets.top = tagHeight;
        me.insets.left = 0;
        me.insets.bottom = tagHeight;
      }
    }
    me.innerPadding = new Insets(0);
    if (graph.getDirection() == PositionConstants.EAST) {
      me.setPadding(new Insets(6, 8, 6, 8));
    }
    else {
      me.setPadding(new Insets(8, 6, 8, 6));
    }
    map.put(this, me);
    graph.nodes.add(me);

    for (int i = 0; i < getChildren().size(); i++) {
      ActivityPart activity = (ActivityPart) getChildren().get(i);
      activity.contributeNodesToGraph(graph, me, map);
    }
    for (int i = 0; i < getSourceConnections().size(); i++) {
      TransitionPart trans = (TransitionPart) getSourceConnections().get(i);
      Subgraph sub = (Subgraph) map.get(getViewer().getContents());
      trans.contributeNodesToGraph(graph, s, map);
    }
  }
View Full Code Here

  @Override
  public void contributeNodesToGraph(CompoundDirectedGraph graph, Subgraph s,
      Map<AbstractGraphicalEditPart, Object> map) {
    GraphAnimation.recordInitialState(getContentPane());
    Subgraph me = new Subgraph(this, s);

    me.outgoingOffset = 5;
    me.incomingOffset = 5;
    IFigure fig = getFigure();
    if (fig instanceof SubgraphFigure) {
View Full Code Here

  @SuppressWarnings("unchecked")
  public void contributeNodesToGraph(CompoundDirectedGraph graph, Subgraph s,
      Map map) {
    GraphAnimation.recordInitialState(getContentPane());
    Subgraph me = new Subgraph(this, s);
    IState state = (IState) getModel();

    if (!(state instanceof IWebflowState)) {
      int index = -1;
      int stateCount = ((IWebflowState) state.getElementParent())
          .getStates().size();
      if (state instanceof IInlineFlowState) {
        index = ((IWebflowState) state.getElementParent())
            .getInlineFlowStates().indexOf(state)
            + stateCount;
      }
      else {
        index = ((IWebflowState) state.getElementParent()).getStates()
            .indexOf(state);
      }
      me.setRowConstraint(index);
    }

    me.outgoingOffset = 5;
    me.incomingOffset = 5;
    IFigure fig = getFigure();
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.graph.Subgraph

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.