Package org.gephi.visualization.api.objects

Examples of org.gephi.visualization.api.objects.ModelClass


        graph.readLock();



        ModelClass nodeClass = object3dClasses[AbstractEngine.CLASS_NODE];
        if (nodeClass.isEnabled() && (graph.getNodeVersion() > nodeVersion || modeManager.requireModeChange())) {
            updateNodes(graph);
            nodeClass.setCacheMarker(cacheMarker);
        }

        ModelClass edgeClass = object3dClasses[AbstractEngine.CLASS_EDGE];
        if (edgeClass.isEnabled() && (graph.getEdgeVersion() > edgeVersion || modeManager.requireModeChange())) {
            updateEdges(graph);
            updateMetaEdges(graph);
            edgeClass.setCacheMarker(cacheMarker);
            if (!undirected && vizConfig.isShowArrows()) {
                object3dClasses[AbstractEngine.CLASS_ARROW].setCacheMarker(cacheMarker);
            }
        }

        ModelClass potatoClass = object3dClasses[AbstractEngine.CLASS_POTATO];
        if (potatoClass.isEnabled() && (graph.getNodeVersion() > nodeVersion || modeManager.requireModeChange())) {
            updatePotatoes(graph);
            potatoClass.setCacheMarker(cacheMarker);
        }

        nodeVersion = graph.getNodeVersion();
        edgeVersion = graph.getEdgeVersion();
View Full Code Here


        limits.setMaxMetaWeight(maxWeight);
    }

    public void updatePotatoes(HierarchicalGraph graph) {

        ModelClass potatoClass = engine.getModelClasses()[AbstractEngine.CLASS_POTATO];
        if (potatoClass.isEnabled()) {
            Modeler potInit = engine.getModelClasses()[AbstractEngine.CLASS_POTATO].getCurrentModeler();

            List<ModelImpl> hulls = new ArrayList<ModelImpl>();
            Node[] nodes = graph.getNodes().toArray();
            for (Node n : nodes) {
View Full Code Here

                vizModel.setAdjustByText(adjustTextCheckbox.isSelected());
            }
        });

        final DefaultComboBoxModel comboModel = new DefaultComboBoxModel();
        final ModelClass nodeClass = VizController.getInstance().getModelClassLibrary().getNodeClass();
        for (Modeler modeler : nodeClass.getModelers()) {
            comboModel.addElement(modeler);
        }
        comboModel.setSelectedItem(nodeClass.getCurrentModeler());
        shapeCombo.setModel(comboModel);
        shapeCombo.addActionListener(new ActionListener() {

            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);
//                    }
                } else {
                    nodeClass.setCurrentModeler(modeler);
                }
            }
        });

        showHullsCheckbox.setSelected(vizModel.isShowHulls());
View Full Code Here

        VizModel vizModel = VizController.getInstance().getVizModel();
        setEnable(!vizModel.isDefaultModel());
        if (vizModel.isDefaultModel()) {
            return;
        }
        final ModelClass nodeClass = VizController.getInstance().getModelClassLibrary().getNodeClass();
        if (shapeCombo.getSelectedItem() != nodeClass.getCurrentModeler()) {
            shapeCombo.setSelectedItem(nodeClass.getCurrentModeler());
        }
        if (adjustTextCheckbox.isSelected() != vizModel.isAdjustByText()) {
            adjustTextCheckbox.setSelected(vizModel.isAdjustByText());
        }
        if (showHullsCheckbox.isSelected() != vizModel.isShowHulls()) {
View Full Code Here

TOP

Related Classes of org.gephi.visualization.api.objects.ModelClass

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.