Package y.base

Examples of y.base.Node


     */
    private void checkAndUpdateParentNode(AbstractFamixEntity entity) {
        AbstractFamixEntity parent = entity.getParent();
        if (parent != null) {
            if (fGraph.contains(parent) && fGraph.contains(entity)) {
                Node parentNode = fGraph.getNode(parent);
                Node childNode = fGraph.getNode(entity);
                if (!parentNode.equals(fHierarchyManager.getParentNode(childNode))) {
                    fHierarchyManager.setParentNode(childNode, parentNode);
                    sLogger.debug("reassigned node '" + childNode + "' to parent '" + parentNode + "'");
                }
            }
View Full Code Here


    /**
     * Update entity type visibility.
     */
    private void updateEntityTypeVisibility() {
        Node anchor = fPanel.getHierarchyManager().getAnchorNode(fPanel.getGraph());
        updateEntityTypeVisibility(fPanel.getHierarchyManager().getChildren(anchor), false);
    }
View Full Code Here

     * @param parentNodes Parent nodes.
     * @param hide Enforce hiding of child nodes.
     */
    private void updateEntityTypeVisibility(NodeCursor parentNodes, boolean hide) {
        for (NodeCursor nc = parentNodes; nc.ok(); nc.next()) {
            Node parentNode = nc.node();
            AbstractFamixEntity entity = fPanel.getGraph().getFamixEntity(parentNode);
            if (!hide && fPanel.getViewConfigModel().getEntityTypeVisibility().get(entity.getClass()).booleanValue()) {
                NodeRealizer parentRealizer = fPanel.getGraph().getRealizer(parentNode);
                parentRealizer.setVisible(true);
                updateEntityTypeVisibility(fPanel.getHierarchyManager().getChildren(parentNode), false);
View Full Code Here

        // navigateToInnerGraph(v);
        // } else {
        // navigateToParentGraph();
        // }
        // } else {
        Node node = getHitInfo(e).getHitNode();
        if (node != null && !getHierarchyManager().isNormalNode(node)) {
            double x = translateX(e.getX());
            double y = translateY(e.getY());
            Graph2D graph = getView().getGraph2D();
            NodeRealizer r = graph.getRealizer(node);
View Full Code Here

     * @param entity The FAMIX entity to create a node for.
     *
     * @return The created yFiles node.
     */
    public Node createNode(AbstractFamixEntity entity) {
        Node node = null;

        if (!this.contains(entity)) {
            Graph2D graph = getGraph(entity);
            if (isContainerEntityNode(entity)) {
                node = getHierarchyManager().createFolderNode(graph);
View Full Code Here

     * @return The created yFiles edge.
     */
    public Edge createEdge(FamixAssociation association) {
        Edge edge = null;

        Node nodeFrom = this.getNode(association.getFrom());
        Node nodeTo = this.getNode(association.getTo());
        if (nodeFrom != null && nodeTo != null) {
            if (!nodeFrom.equals(nodeTo)) {
                if (!this.contains(association)) {
                    edge = this.getHierarchyManager().createEdge(nodeFrom, nodeTo);

View Full Code Here

     * @return True if the entity/node has been removed otherwise false.
     */
    public boolean removeFamixEntity(AbstractFamixEntity entity) {
        boolean isRemoved = false;

        Node node = this.getNode(entity);
        if (node != null) {
            this.getFamixToNodeMap().remove(entity);
            this.getNodeToFamixMap().set(node, null);
            Graph graph = node.getGraph(); // if parent node has been removed, than node is not in the graph anymore
            if (graph != null) {
                node.getGraph().removeNode(node);
            }
            isRemoved = true;
        }

        return isRemoved;
View Full Code Here

    public Edge reinsertLowLevelEdge(Edge lowLevelEdge) {
        Edge reinsertedEdge = null;

        FamixAssociation association = this.getAssociation(lowLevelEdge);
        if (association != null) {
            Node from = this.getNode(association.getFrom());
            Node to = this.getNode(association.getTo());
            reinsertedEdge = getHierarchyManager().createEdge(from, to);

            getEdgeToFamixMap().set(lowLevelEdge, null); // delete old edge

            getEdgeToFamixMap().set(reinsertedEdge, association); // add link between new low level edge and association
View Full Code Here

        } else {
            if (!this.contains(parent)) {
                // parent node not in graph
                graph = this;
            } else {
                Node parentNode = this.getNode(parent);
                graph = (Graph2D) getHierarchyManager().getInnerGraph(parentNode);
            }
        }

        return graph;
View Full Code Here

        List<Edge> allEdges = new ArrayList<Edge>();

        HierarchyManager hierarchyManager = getRootGraph().getHierarchyManager();
        Graph rootGraph = hierarchyManager.getRootGraph();
        for (NodeCursor nc = rootGraph.nodes(); nc.ok(); nc.next()) {
            Node v = nc.node();
            for (EdgeCursor ec = v.outEdges(); ec.ok(); ec.next()) {
                Edge e = ec.edge();
                allEdges.add(e);
            }
        }
        group(allEdges);
View Full Code Here

TOP

Related Classes of y.base.Node

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.