当前位置: 首页>>代码示例>>Java>>正文


Java Edge.getTo方法代码示例

本文整理汇总了Java中com.touchgraph.graphlayout.Edge.getTo方法的典型用法代码示例。如果您正苦于以下问题:Java Edge.getTo方法的具体用法?Java Edge.getTo怎么用?Java Edge.getTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.touchgraph.graphlayout.Edge的用法示例。


在下文中一共展示了Edge.getTo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addEdge

import com.touchgraph.graphlayout.Edge; //导入方法依赖的package包/类
/** Add the Edge <tt>edge</tt> to the graph. */
public void addEdge(Edge edge)
{
    if (edge == null)
    {
        return;
    }
    if (!contains(edge))
    {
        edges.addElement(edge);

        Node from = edge.getFrom();
        from.addEdge(edge);
        edge.setFrom(from);

        Node to = edge.getTo();
        to.addEdge(edge);
        edge.setTo(to);
    }
}
 
开发者ID:dvorka,项目名称:mindraider,代码行数:21,代码来源:GraphEltSet.java

示例2: deleteEdge

import com.touchgraph.graphlayout.Edge; //导入方法依赖的package包/类
/** Delete the Edge <tt>edge</tt>. */
public boolean deleteEdge(Edge edge)
{
    synchronized (edges)
    {
        if (edge == null)
        {
            return false;
        }
        if (!edges.removeElement(edge))
        {
            return false;
        }

        Node from = edge.getFrom();
        from.removeEdge(edge);
        edge.setFrom(from);

        Node to = edge.getTo();
        to.removeEdge(edge);
        edge.setTo(to);
        return true;
    }
}
 
开发者ID:dvorka,项目名称:mindraider,代码行数:25,代码来源:GraphEltSet.java

示例3: deleteStatement

import com.touchgraph.graphlayout.Edge; //导入方法依赖的package包/类
/**
 * Delete statement.
 */
public void deleteStatement() {
    StatusBar.show("Deleting statement...");

    Node predicate = getSelectedNode();

    if (predicate.edgeCount() < 2) {
        StatusBar.show("Error: Uncomplete statement (missing either subject or object)!");
        return;
    }

    if (predicate.getType() != render.getPredicateNodeType()) {
        JOptionPane.showMessageDialog(MindRaider.mainJFrame, "To delete statement, predicate must be selected!",
                "Triplet Delete Error", JOptionPane.ERROR_MESSAGE);
        return;
    }

    Node subject, object;
    Edge e = predicate.edgeAt(0);

    if (predicate == e.getTo()) {
        subject = e.getFrom();
        object = predicate.edgeAt(1).getTo();
    } else {
        subject = e.getTo();
        object = predicate.edgeAt(1).getFrom();
    }

    rdfModel.deleteStatement(subject.rdfNode, (Property) predicate.rdfNode, object.rdfNode);
    save();
    renderModel();
}
 
开发者ID:dvorka,项目名称:mindraider,代码行数:35,代码来源:SpidersGraph.java

示例4: addEdge

import com.touchgraph.graphlayout.Edge; //导入方法依赖的package包/类
/**
 * @see com.touchgraph.graphlayout.graphelements.GraphEltSet#addEdge(com.touchgraph.graphlayout.Edge)
 */
public void addEdge(Edge edge) {
    if (!contains(edge)) {
        super.addEdge(edge);
        Node from = edge.getFrom();
        edge.setFrom(from);
        from.visibleEdgeCnt++;

        Node to = edge.getTo();
        to.visibleEdgeCnt++;
        edge.setTo(to);
    }
}
 
开发者ID:dvorka,项目名称:mindraider,代码行数:16,代码来源:VisibleLocality.java

示例5: removeEdge

import com.touchgraph.graphlayout.Edge; //导入方法依赖的package包/类
/**
 * @see com.touchgraph.graphlayout.graphelements.Locality#removeEdge(com.touchgraph.graphlayout.Edge)
 */
public boolean removeEdge(Edge edge) {
    boolean removed = super.removeEdge(edge);
    if (removed) {
        edge.setVisible(false);
        Node from = edge.getFrom();
        from.visibleEdgeCnt--;
        edge.setFrom(from);

        Node to = edge.getTo();
        to.visibleEdgeCnt--;
        edge.setTo(to);
    }
    return removed;
}
 
开发者ID:dvorka,项目名称:mindraider,代码行数:18,代码来源:VisibleLocality.java

示例6: findEdge

import com.touchgraph.graphlayout.Edge; //导入方法依赖的package包/类
/** Return an Edge spanning Node <tt>from</tt> to Node <tt>to</tt>. */
public Edge findEdge(Node from, Node to)
{
    for (int i = 0; i < from.edgeCount(); i++)
    {
        Edge e = from.edgeAt(i);
        if (e.getTo() == to)
        {
            return e;
        }
    }
    return null;
}
 
开发者ID:dvorka,项目名称:mindraider,代码行数:14,代码来源:GraphEltSet.java

示例7: deleteNode

import com.touchgraph.graphlayout.Edge; //导入方法依赖的package包/类
/** Delete the Node <tt>node</tt>, returning true if successful. */
public boolean deleteNode(Node node)
{
    synchronized (nodes)
    {
        if (node == null)
        {
            return false;
        }
        if (!nodes.removeElement(node))
        {
            return false;
        }

        String id = node.getID();
        if (id != null)
        {
            nodeIDRegistry.remove(id); // remove from registry
        }

        for (int i = 0; i < node.edgeCount(); i++)
        {
            Edge e = node.edgeAt(i);
            Node to = e.getTo();
            Node from = e.getFrom();
            if (from == node)
            {
                edges.removeElement(e); // Delete edge not used, because it would change the node's edges
                to.removeEdge(e);
                e.setTo(to);
                // vector which is being iterated on.
            }
            else if (to == node)
            {
                edges.removeElement(e);
                from.removeEdge(e);
                e.setFrom(from);
            }
            // No edges are deleted from node. Hopefully garbage collection will pick them up.
        }
    }
    return true;
}
 
开发者ID:dvorka,项目名称:mindraider,代码行数:44,代码来源:GraphEltSet.java


注:本文中的com.touchgraph.graphlayout.Edge.getTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。