Package diva.graph

Examples of diva.graph.GraphEvent


                    FSMGraphModel.this, container, moml);
            request.addChangeListener(new ChangeListener() {
                public void changeFailed(ChangeRequest change,
                        Exception exception) {
                    // If we fail, then issue structureChanged.
                    dispatchGraphEvent(new GraphEvent(eventSource,
                            GraphEvent.STRUCTURE_CHANGED, getRoot()));
                }

                public void changeExecuted(ChangeRequest change) {
                    // If we succeed, then issue structureChanged, since
                    // this is likely connected to something.
                    dispatchGraphEvent(new GraphEvent(eventSource,
                            GraphEvent.STRUCTURE_CHANGED, getRoot()));
                }
            });
            request.setUndoable(true);
            container.requestChange(request);
View Full Code Here


     */
    public void addNode(Object eventSource, Object node, Object parent) {
        Object prevParent = getMutableNodeModel(node).getParent(node);
        getMutableNodeModel(node).setParent(node, parent);

        GraphEvent e = new GraphEvent(eventSource, GraphEvent.NODE_ADDED, node,
                prevParent);
        dispatchGraphEvent(e);
    }
View Full Code Here

        Object prevTail = getMutableEdgeModel(edge).getTail(edge);
        Object prevHead = getMutableEdgeModel(edge).getHead(edge);
        getMutableEdgeModel(edge).setHead(edge, headNode);
        getMutableEdgeModel(edge).setTail(edge, tailNode);

        GraphEvent e1 = new GraphEvent(eventSource,
                GraphEvent.EDGE_HEAD_CHANGED, edge, prevHead);
        dispatchGraphEvent(e1);

        GraphEvent e2 = new GraphEvent(eventSource,
                GraphEvent.EDGE_TAIL_CHANGED, edge, prevTail);
        dispatchGraphEvent(e2);
    }
View Full Code Here

        Object tail = model.getTail(edge);
        model.setTail(edge, null);
        model.setHead(edge, null);

        if (head != null) {
            GraphEvent e = new GraphEvent(eventSource,
                    GraphEvent.EDGE_HEAD_CHANGED, edge, head);
            dispatchGraphEvent(e);
        }

        if (tail != null) {
            GraphEvent e = new GraphEvent(eventSource,
                    GraphEvent.EDGE_TAIL_CHANGED, edge, tail);
            dispatchGraphEvent(e);
        }
    }
View Full Code Here

        // remove the node.
        Object prevParent = getMutableNodeModel(node).getParent(node);
        getMutableNodeModel(node).setParent(node, null);

        GraphEvent e = new GraphEvent(eventSource, GraphEvent.NODE_REMOVED,
                node, prevParent);
        dispatchGraphEvent(e);
    }
View Full Code Here

     */
    public void setEdgeHead(Object eventSource, Object edge, Object head) {
        Object prevHead = getMutableEdgeModel(edge).getHead(edge);
        getMutableEdgeModel(edge).setHead(edge, head);

        GraphEvent e = new GraphEvent(eventSource,
                GraphEvent.EDGE_HEAD_CHANGED, edge, prevHead);
        dispatchGraphEvent(e);
    }
View Full Code Here

     */
    public void setEdgeTail(Object eventSource, Object edge, Object tail) {
        Object prevTail = getMutableEdgeModel(edge).getTail(edge);
        getMutableEdgeModel(edge).setTail(edge, tail);

        GraphEvent e = new GraphEvent(eventSource,
                GraphEvent.EDGE_TAIL_CHANGED, edge, prevTail);
        dispatchGraphEvent(e);
    }
View Full Code Here

TOP

Related Classes of diva.graph.GraphEvent

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.