Package org.gephi.visualization.model.node

Examples of org.gephi.visualization.model.node.NodeModeler


        this.limits = VizController.getInstance().getLimits();
    }

    public synchronized boolean updateWorld() {
        if (observer != null && observer.hasGraphChanged()) {
            NodeModeler nodeModeler = (NodeModeler) engine.getNodeClass().getCurrentModeler();
            EdgeModeler edgeModeler = (EdgeModeler) engine.getEdgeClass().getCurrentModeler();
            Octree octree = engine.getOctree();

            //Stats
            int removedNodes = 0;
            int addedNodes = 0;
            int removedEdges = 0;
            int addedEdges = 0;

            for (int i = 0; i < nodes.length; i++) {
                NodeModel node = nodes[i];
                if (node != null && node.getNode().getStoreId() == -1) {
                    //Removed
                    octree.removeNode(node);
                    nodes[i] = null;
                    removedNodes++;
                }
            }
            for (Node node : graph.getNodes()) {
                int id = node.getStoreId();
                if (id >= nodes.length || nodes[id] == null) {
                    growNodes(id);
                    NodeModel model = nodeModeler.initModel(node);
                    octree.addNode(model);
                    nodes[id] = model;
                    addedNodes++;
                }
            }
View Full Code Here


    }

    @Override
    public void display(GL2 gl, GLU glu) {
        //Update viewport
        NodeModeler nodeModeler = (NodeModeler) nodeClass.getCurrentModeler();
        for (Iterator<NodeModel> itr = octree.getNodeIterator(); itr.hasNext();) {       //TODO Move this
            NodeModel obj = itr.next();
            nodeModeler.setViewportPosition(obj);
        }

        markTime++;

        VizModel vizModel = VizController.getInstance().getVizModel();
View Full Code Here

            public void actionPerformed(ActionEvent e) {
                if (nodeClass.getCurrentModeler() == comboModel.getSelectedItem()) {
                    return;
                }
                VizModel vizModel = VizController.getInstance().getVizModel();
                NodeModeler modeler = (NodeModeler) comboModel.getSelectedItem();
                if (modeler.is3d() && !vizModel.isUse3d()) {
//                    String msg = NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.defaultShape.message3d");
//                    if (JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), msg, NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.defaultShape.message.title"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                    //enable 3d
                    vizModel.setUse3d(true);
                    nodeClass.setCurrentModeler(modeler);
//                    }

                } else if (!modeler.is3d() && vizModel.isUse3d()) {
//                    String msg = NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.defaultShape.message2d");
//                    if (JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), msg, NbBundle.getMessage(NodeSettingsPanel.class, "NodeSettingsPanel.defaultShape.message.title"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                    //disable 3d
                    vizModel.setUse3d(false);
                    nodeClass.setCurrentModeler(modeler);
View Full Code Here

TOP

Related Classes of org.gephi.visualization.model.node.NodeModeler

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.