Package org.gephi.graph.dhns.event

Examples of org.gephi.graph.dhns.event.GraphEventDataImpl


            }
        }
    }

    private GraphEvent createEvent(AbstractEvent event, List<Object> compress) {
        final GraphEventDataImpl eventData = (event instanceof GeneralEvent) ? null : new GraphEventDataImpl();
        final GraphEventImpl graphEventImpl = new GraphEventImpl(event.getView(), event.getEventType(), eventData);
        if (event instanceof NodeEvent) {
            Node[] nodes;
            if (compress != null) {
                nodes = compress.toArray(new Node[0]);
            } else {
                nodes = new Node[]{(Node) event.getData()};
            }
            switch (event.getEventType()) {
                case ADD_NODES:
                    eventData.setAddedNodes(nodes);
                    break;
                case REMOVE_NODES:
                    eventData.setRemovedNodes(nodes);
                    break;
                case EXPAND:
                    eventData.setExpandedNodes(nodes);
                    break;
                case RETRACT:
                    eventData.setRetractedNodes(nodes);
                    break;
                case MOVE_NODES:
                    eventData.setMovedNodes(nodes);
                    break;
            }
        } else if (event instanceof EdgeEvent) {
            Edge[] edges;
            if (compress != null) {
                edges = compress.toArray(new Edge[0]);
            } else {
                edges = new Edge[]{(Edge) event.getData()};
            }
            switch (event.getEventType()) {
                case ADD_EDGES:
                    eventData.setAddedEdges(edges);
                    break;
                case REMOVE_EDGES:
                    eventData.setRemovedEdges(edges);
                    break;
            }
        } else if (event instanceof ViewEvent) {
            eventData.setView((GraphView) event.getData());
        }
        return graphEventImpl;
    }
View Full Code Here

TOP

Related Classes of org.gephi.graph.dhns.event.GraphEventDataImpl

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.