Package org.gephi.visualization.model

Examples of org.gephi.visualization.model.ModelClass


                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() {
            @Override
            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);
                }
            }
        });

        vizModel.addPropertyChangeListener(new PropertyChangeListener() {
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());
        }
    }
View Full Code Here

TOP

Related Classes of org.gephi.visualization.model.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.