Search in sources :

Example 1 with SortingComboBox

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

the class DirichletBayesImProbsWizard method createVarNamesComboBox.

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

        public Dimension getMaximumSize() {
            return getPreferredSize();
        }
    };
    varNamesComboBox.setBackground(Color.WHITE);
    Graph graph = bayesIm.getBayesPm().getDag();
    for (Node node : graph.getNodes()) {
        varNamesComboBox.addItem(node);
    }
    varNamesComboBox.setSelectedIndex(0);
    return varNamesComboBox;
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox) Node(edu.cmu.tetrad.graph.Node)

Example 2 with SortingComboBox

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

the class EMBayesEstimatorEditorWizard method createVarNamesComboBox.

private JComboBox createVarNamesComboBox(BayesPm bayesPm) {
    JComboBox varNamesComboBox = new SortingComboBox() {

        public Dimension getMaximumSize() {
            return getPreferredSize();
        }
    };
    varNamesComboBox.setBackground(Color.white);
    Graph graph = bayesPm.getDag();
    for (Node node : graph.getNodes()) {
        varNamesComboBox.addItem(node);
    }
    varNamesComboBox.setSelectedIndex(0);
    return varNamesComboBox;
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox) Node(edu.cmu.tetrad.graph.Node)

Example 3 with SortingComboBox

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

the class DirichletBayesImCountsWizard method createVarNamesComboBox.

private JComboBox createVarNamesComboBox(DirichletBayesIm 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);
    }
    varNamesComboBox.setSelectedIndex(0);
    return varNamesComboBox;
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox)

Example 4 with SortingComboBox

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

the class StructEMBayesSearchEditorWizard 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 (Node node : graph.getNodes()) {
        varNamesComboBox.addItem(node);
    }
    varNamesComboBox.setSelectedIndex(0);
    return varNamesComboBox;
}
Also used : Graph(edu.cmu.tetrad.graph.Graph) SortingComboBox(edu.cmu.tetradapp.util.SortingComboBox) Node(edu.cmu.tetrad.graph.Node)

Example 5 with SortingComboBox

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

the class UpdaterEditingTableModelObs 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()) {
        // skip latent variables in Identifiability Wrapper
        Node nodeO = (Node) o;
        if (nodeO.getNodeType() == NodeType.MEASURED) {
            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) Node(edu.cmu.tetrad.graph.Node) DisplayNode(edu.cmu.tetradapp.workbench.DisplayNode)

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