Examples of Graph2D


Examples of y.view.Graph2D

     * to the entity's type.
     *
     * @param node The node to configure.
     */
    private void configureNode(Node node) {
        Graph2D graph = (Graph2D) node.getGraph();
        DependencyGraph rootGraph = (DependencyGraph) graph.getHierarchyManager().getRootGraph();
        AbstractFamixEntity entity = rootGraph.getFamixEntity(node);

        NodeRealizer nr = graph.getRealizer(node);
        NodeRealizer newNodeRealizer = null;
        if (nr instanceof GroupNodeRealizer) {
            newNodeRealizer = new FamixGroupNodeRealizer(nr);
        } else {
            if (entity instanceof FamixAttribute) {
                newNodeRealizer = new FamixAttributeNodeRealizer(nr);
            } else {
                newNodeRealizer = new DefaultFamixNodeRealizer(nr);
            }
        }
        ((IFamixNodeRealizer) newNodeRealizer).initAttributes(entity);
        graph.setRealizer(node, newNodeRealizer);
    }
View Full Code Here

Examples of y.view.Graph2D

     * Configure high level edge.
     *
     * @param edge the edge
     */
    private void configureHighLevelEdge(Edge edge) {
        Graph2D graph = (Graph2D) edge.getGraph();
        DependencyGraph rootGraph = (DependencyGraph) graph.getHierarchyManager().getRootGraph();

        Class<? extends FamixAssociation> associationType = rootGraph.getEdgeType(edge);
        EdgeRealizer er = graph.getRealizer(edge);
        EdgeRealizer newEdgeRealizer = null;
        if (associationType.equals(FamixInvocation.class)) {
            newEdgeRealizer = new DefaultFamixEdgeRealizer(er);
        } else if (associationType.equals(FamixInheritance.class)) {
            newEdgeRealizer = new DeltaEdgeRealizer(er);
        } else if (associationType.equals(FamixSubtyping.class)) {
            newEdgeRealizer = new DashedDeltaEdgeRealizer(er);
        } else if (associationType.equals(FamixCastTo.class)) {
            newEdgeRealizer = new DefaultFamixEdgeRealizer(er);
        } else if (associationType.equals(FamixCheckInstanceOf.class)) {
            newEdgeRealizer = new DefaultFamixEdgeRealizer(er);
        } else if (associationType.equals(FamixAccess.class)) {
            newEdgeRealizer = new DefaultFamixEdgeRealizer(er);
        } else {
            sLogger.warn("Edgetype of " + associationType + " currently not supported - using default");
            newEdgeRealizer = new DefaultFamixEdgeRealizer(er);
        }

        List<Edge> lowLevelEdges = rootGraph.getLowLevelEdges(edge);
        int nrLowLevelEdges = 1;
        if (lowLevelEdges != null) {
            nrLowLevelEdges = lowLevelEdges.size();
        }

        ((IFamixEdgeRealizer) newEdgeRealizer).initAttributes(associationType, nrLowLevelEdges);
        graph.setRealizer(edge, newEdgeRealizer);
    }
View Full Code Here

Examples of y.view.Graph2D

     * {@inheritDoc}
     */
    public void execute() {
        setEditResult(new EditResult());

        Graph2D rootGraph = (Graph2D) getGraphLoader().getHierarchyManager().getRootGraph();
        NodeRealizer nr = rootGraph.getRealizer(fSelectedNode);
        if (nr instanceof GroupNodeRealizer) {
            fireGraphPreEvent();

            for (NodeCursor nc = getGraphLoader().getGraph().nodes(); nc.ok(); nc.next()) {
                getEdgeGrouper().reinsertLowLevelEdges(nc.node());
View Full Code Here

Examples of y.view.Graph2D

*
*/
public class NodePresenter extends AbstractPresenter<Node> {
  @Override
  protected void bind( @NotNull final Node presentation, @NotNull final StructPart struct, @NotNull Lookup lookup ) {
    final Graph2D graph2D = getGraph( presentation );

    lookup.bind( Action.class, new LookupChangeListener<Action>() {
      public void lookupChanged( @NotNull LookupChangeEvent<? extends Action> event ) {
        Action newValue = event.getNewValue();
        if ( newValue != null ) {
          graph2D.getRealizer( presentation ).setLabelText( ( String ) newValue.getValue( Action.NAME ) );
        } else {
          graph2D.getRealizer( presentation ).setLabelText( struct.getName() );
        }
        graph2D.updateViews();
      }
    } );
  }
View Full Code Here

Examples of y.view.Graph2D

    } );
  }

  @Override
  protected boolean addChildPresentation( @NotNull Node presentation, @NotNull StructPart child, int index ) {
    Graph2D graph2D = getGraph( presentation );
    Node childNode = getChildPresenter( child ).present( child );
    graph2D.createEdge( presentation, childNode );
    Graph2DPresenter.update( getGraph() );
    return true;
  }
View Full Code Here

Examples of y.view.Graph2D

    return getGraph().createNode();
  }

  @NotNull
  protected Graph2D getGraph( Node presentation ) {
    Graph2D graph = ( Graph2D ) presentation.getGraph();
    Graph2DPresenter.graphLocal.set( graph );
    return graph;
  }
View Full Code Here

Examples of y.view.Graph2D

  }

  @Override
  @NotNull
  protected Graph2D createPresentation() {
    graphLocal.set( new Graph2D() );
    rootNode = getGraph().createNode();
    return getGraph();
  }
View Full Code Here

Examples of y.view.Graph2D

  @Override
  @NotNull
  protected JFrame createFrame() {
    JFrame frame = super.createFrame();

    Graph2D graph2D = new Graph2DPresenter().present( rootNode );

    Graph2DView graph2DView = new Graph2DView( graph2D );
    graph2DView.addViewMode( new NavigationMode() );
    graph2DView.fitContent();
    frame.getContentPane().add( graph2DView );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.