Search in sources :

Example 6 with SortingComboBox

use of edu.cmu.tetradapp.util.SortingComboBox in project tetrad by cmu-phil.

the class UpdaterEditingTableModel method makeVarNamesDropdown.

private JComboBox makeVarNamesDropdown() {
    JComboBox varNamesComboBox = new SortingComboBox() {

        public Dimension getMaximumSize() {
            return getPreferredSize();
        }
    };
    varNamesComboBox.setBackground(Color.white);
    Graph graph = updaterWrapper.getBayesUpdater().getManipulatedGraph();
    for (Object o : graph.getNodes()) {
        varNamesComboBox.addItem(o);
    }
    if (selectedNode != null) {
        varNamesComboBox.setSelectedItem(selectedNode);
    } else {
        varNamesComboBox.setSelectedIndex(0);
        this.selectedNode = (Node) varNamesComboBox.getSelectedItem();
    }
    return varNamesComboBox;
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox)

Example 7 with SortingComboBox

use of edu.cmu.tetradapp.util.SortingComboBox in project tetrad by cmu-phil.

the class UpdatedSemImWizard method makeVarNamesDropdown.

private JComboBox makeVarNamesDropdown() {
    JComboBox varNamesComboBox = new SortingComboBox() {

        public Dimension getMaximumSize() {
            return getPreferredSize();
        }
    };
    varNamesComboBox.setBackground(Color.white);
    Graph graph = semUpdater.getManipulatedGraph();
    for (Object o : graph.getNodes()) {
        varNamesComboBox.addItem(o);
    }
    if (selectedNode != null) {
        varNamesComboBox.setSelectedItem(selectedNode);
    } else {
        varNamesComboBox.setSelectedIndex(0);
        this.selectedNode = (Node) varNamesComboBox.getSelectedItem();
    }
    return varNamesComboBox;
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox)

Example 8 with SortingComboBox

use of edu.cmu.tetradapp.util.SortingComboBox in project tetrad by cmu-phil.

the class BayesPmEditorWizard method createVariableChooser.

private void createVariableChooser(BayesPm bayesPm, GraphWorkbench workbench) {
    variableChooser = new SortingComboBox() {

        public Dimension getMaximumSize() {
            return getPreferredSize();
        }
    };
    variableChooser.setBackground(Color.white);
    Graph graphModel = bayesPm.getDag();
    for (Iterator it = graphModel.getNodes().iterator(); it.hasNext(); ) {
        variableChooser.addItem(it.next());
    }
    if (graphModel.getNodes().size() > 0) {
        variableChooser.setSelectedIndex(0);
    }
    workbench.scrollWorkbenchToNode((Node) (variableChooser.getSelectedItem()));
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox)

Example 9 with SortingComboBox

use of edu.cmu.tetradapp.util.SortingComboBox in project tetrad by cmu-phil.

the class BayesEstimatorEditorWizard method createVarNamesComboBox.

private JComboBox createVarNamesComboBox(BayesIm bayesIm) {
    JComboBox varNamesComboBox = new SortingComboBox() {

        public Dimension getMaximumSize() {
            return getPreferredSize();
        }
    };
    varNamesComboBox.setBackground(Color.white);
    Graph graph = bayesIm.getBayesPm().getDag();
    for (Object o : graph.getNodes()) {
        varNamesComboBox.addItem(o);
    }
    if (graph.getNodes().size() > 0) {
        varNamesComboBox.setSelectedIndex(0);
    }
    return varNamesComboBox;
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox)

Example 10 with SortingComboBox

use of edu.cmu.tetradapp.util.SortingComboBox in project tetrad by cmu-phil.

the class BayesImEditorWizard method createVarNamesComboBox.

private JComboBox createVarNamesComboBox(BayesIm bayesIm) {
    JComboBox varNamesComboBox = new SortingComboBox() {

        public Dimension getMaximumSize() {
            return getPreferredSize();
        }
    };
    varNamesComboBox.setBackground(Color.white);
    Graph graph = bayesIm.getBayesPm().getDag();
    for (Object o : graph.getNodes()) {
        varNamesComboBox.addItem(o);
    }
    if (graph.getNodes().size() > 0) {
        varNamesComboBox.setSelectedIndex(0);
    }
    return varNamesComboBox;
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox)

Aggregations

Graph (edu.cmu.tetrad.graph.Graph)10 SortingComboBox (edu.cmu.tetradapp.util.SortingComboBox)10 Node (edu.cmu.tetrad.graph.Node)4 DisplayNode (edu.cmu.tetradapp.workbench.DisplayNode)1