Search in sources :

Example 6 with CollapsiblePanel

use of org.vcell.util.gui.CollapsiblePanel in project vcell by virtualcell.

the class SolverTaskDescriptionAdvancedPanel method getGeneralOptionsPanel.

private CollapsiblePanel getGeneralOptionsPanel() {
    if (generalOptionsPanel == null) {
        generalOptionsPanel = new CollapsiblePanel("General");
        generalOptionsPanel.getContentPanel().setLayout(new GridBagLayout());
        java.awt.GridBagConstraints constraintsTimeBoundsPanel = new java.awt.GridBagConstraints();
        constraintsTimeBoundsPanel.gridx = 0;
        constraintsTimeBoundsPanel.gridy = 0;
        constraintsTimeBoundsPanel.fill = java.awt.GridBagConstraints.BOTH;
        constraintsTimeBoundsPanel.weightx = 1.0;
        constraintsTimeBoundsPanel.weighty = 1.0;
        constraintsTimeBoundsPanel.insets = new java.awt.Insets(4, 4, 4, 4);
        generalOptionsPanel.getContentPanel().add(getTimeBoundsPanel(), constraintsTimeBoundsPanel);
        java.awt.GridBagConstraints constraintsTimeStepPanel = new java.awt.GridBagConstraints();
        constraintsTimeStepPanel.gridx = 1;
        constraintsTimeStepPanel.gridy = 0;
        constraintsTimeStepPanel.fill = java.awt.GridBagConstraints.BOTH;
        constraintsTimeStepPanel.weightx = 1.0;
        constraintsTimeStepPanel.weighty = 1.0;
        constraintsTimeStepPanel.insets = new java.awt.Insets(4, 4, 4, 4);
        generalOptionsPanel.getContentPanel().add(getTimeStepPanel(), constraintsTimeStepPanel);
        java.awt.GridBagConstraints constraintsErrorTolerancePanel = new java.awt.GridBagConstraints();
        constraintsErrorTolerancePanel.fill = java.awt.GridBagConstraints.BOTH;
        constraintsErrorTolerancePanel.gridx = 2;
        constraintsErrorTolerancePanel.gridy = 0;
        constraintsErrorTolerancePanel.weightx = 1.0;
        constraintsErrorTolerancePanel.weighty = 1.0;
        constraintsErrorTolerancePanel.insets = new java.awt.Insets(4, 4, 4, 4);
        constraintsErrorTolerancePanel.anchor = GridBagConstraints.FIRST_LINE_START;
        generalOptionsPanel.getContentPanel().add(getErrorTolerancePanel(), constraintsErrorTolerancePanel);
    }
    return generalOptionsPanel;
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) GridBagConstraints(java.awt.GridBagConstraints) CollapsiblePanel(org.vcell.util.gui.CollapsiblePanel)

Example 7 with CollapsiblePanel

use of org.vcell.util.gui.CollapsiblePanel in project vcell by virtualcell.

the class SolverTaskDescriptionAdvancedPanel method getSensitivityAnalysisPanel.

private CollapsiblePanel getSensitivityAnalysisPanel() {
    if (sensitivityAnalysisCollapsiblePanel == null) {
        sensitivityAnalysisComboBox = new javax.swing.JComboBox();
        performSensitivityAnalysisCheckBox = new JCheckBox("Perform sensitivity analysis");
        sensitivityAnalysisHelpButton = new JButton(" ? ");
        Font font = sensitivityAnalysisHelpButton.getFont().deriveFont(Font.BOLD);
        Border border = BorderFactory.createEmptyBorder(1, 1, 1, 1);
        sensitivityAnalysisHelpButton.setBorder(border);
        sensitivityAnalysisHelpButton.setFont(font);
        sensitivityAnalysisCollapsiblePanel = new CollapsiblePanel("Local Sensitivity Analysis", false);
        sensitivityAnalysisCollapsiblePanel.getContentPanel().setLayout(new GridBagLayout());
        GridBagConstraints gbc = new java.awt.GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gbc.insets = new java.awt.Insets(4, 4, 4, 4);
        sensitivityAnalysisCollapsiblePanel.getContentPanel().add(performSensitivityAnalysisCheckBox, gbc);
        gbc = new java.awt.GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.anchor = GridBagConstraints.LINE_START;
        gbc.insets = new java.awt.Insets(4, 4, 4, 4);
        sensitivityAnalysisCollapsiblePanel.getContentPanel().add(sensitivityAnalysisHelpButton, gbc);
        gbc = new java.awt.GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gbc.weightx = 1.0;
        gbc.gridwidth = 2;
        gbc.insets = new java.awt.Insets(4, 4, 4, 4);
        sensitivityAnalysisCollapsiblePanel.getContentPanel().add(sensitivityAnalysisComboBox, gbc);
    }
    return sensitivityAnalysisCollapsiblePanel;
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JButton(javax.swing.JButton) GridBagConstraints(java.awt.GridBagConstraints) CollapsiblePanel(org.vcell.util.gui.CollapsiblePanel) Font(java.awt.Font) JCheckBox(javax.swing.JCheckBox) Border(javax.swing.border.Border)

Example 8 with CollapsiblePanel

use of org.vcell.util.gui.CollapsiblePanel in project vcell by virtualcell.

the class StochSimOptionsPanel method initialize.

private void initialize() {
    try {
        getContentPanel().setLayout(new java.awt.GridBagLayout());
        // 1
        JPanel trialPanel = new JPanel(new GridLayout(0, 1));
        trialPanel.add(getTrajectoryButton());
        trialPanel.add(getHistogramButton());
        JPanel panela = new JPanel(new FlowLayout(FlowLayout.LEFT));
        panela.add(getNumOfTrialsLabel());
        panela.add(getJTextFieldNumOfTrials());
        trialPanel.add(panela);
        trialPanel.setBorder(new EtchedBorder());
        // 2
        JPanel seedPanel = new JPanel(new GridLayout(0, 1));
        JPanel panelb = new JPanel(new FlowLayout(FlowLayout.LEFT));
        panelb.add(getRandomSeedRadioButton());
        seedPanel.add(panelb);
        panelb = new JPanel(new FlowLayout(FlowLayout.LEFT));
        panelb.add(getCustomizedSeedRadioButton());
        panelb.add(getJTextFieldCustomSeed());
        seedPanel.add(panelb);
        seedPanel.setBorder(new EtchedBorder());
        CollapsiblePanel advancedPanel = new CollapsiblePanel("Advanced", false);
        advancedPanel.getContentPanel().setLayout(new GridBagLayout());
        // 0
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.anchor = GridBagConstraints.LINE_END;
        gbc.insets = new Insets(4, 4, 4, 4);
        // gbc.weightx = 1.0;
        advancedPanel.getContentPanel().add(getEpsilonLabel(), gbc);
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.weightx = 1.0;
        gbc.insets = new Insets(4, 4, 4, 4);
        advancedPanel.getContentPanel().add(getEpsilonTextField(), gbc);
        gbc = new GridBagConstraints();
        gbc.gridx = 2;
        gbc.gridy = 0;
        // gbc.weightx = 1.0;
        gbc.insets = new Insets(4, 4, 4, 4);
        gbc.anchor = GridBagConstraints.LINE_END;
        advancedPanel.getContentPanel().add(getLambdaLabel(), gbc);
        gbc = new GridBagConstraints();
        gbc.gridx = 3;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.weightx = 1.0;
        gbc.insets = new Insets(4, 4, 4, 4);
        advancedPanel.getContentPanel().add(getLambdaTextField(), gbc);
        // 1
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 1;
        // gbc.weightx = 1.0;
        gbc.insets = new Insets(4, 4, 4, 4);
        gbc.anchor = GridBagConstraints.LINE_END;
        advancedPanel.getContentPanel().add(getMSRToleranceLabel(), gbc);
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 1;
        gbc.insets = new Insets(4, 4, 4, 4);
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.weightx = 1.0;
        advancedPanel.getContentPanel().add(getMSRToleranceTextField(), gbc);
        gbc = new GridBagConstraints();
        gbc.gridx = 2;
        gbc.gridy = 1;
        gbc.insets = new Insets(4, 4, 4, 4);
        // gbc.weightx = 1.0;
        gbc.anchor = GridBagConstraints.LINE_END;
        advancedPanel.getContentPanel().add(getSDEToleranceLabel(), gbc);
        gbc = new GridBagConstraints();
        gbc.gridx = 3;
        gbc.gridy = 1;
        gbc.insets = new Insets(4, 4, 4, 4);
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.weightx = 1.0;
        advancedPanel.getContentPanel().add(getSDEToleranceTextField(), gbc);
        // 
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1.0;
        gbc.insets = new Insets(4, 4, 4, 4);
        getContentPanel().add(trialPanel, gbc);
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.insets = new Insets(4, 4, 4, 4);
        getContentPanel().add(seedPanel, gbc);
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 2;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.insets = new Insets(10, 4, 10, 4);
        getContentPanel().add(advancedPanel, gbc);
        getButtonGroupSeed().add(getRandomSeedRadioButton());
        getButtonGroupSeed().add(getCustomizedSeedRadioButton());
        // trial radio button group
        getButtonGroupTrials().add(getTrajectoryButton());
        getButtonGroupTrials().add(getHistogramButton());
    } catch (java.lang.Throwable ivjExc) {
        handleException(ivjExc);
    }
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) EtchedBorder(javax.swing.border.EtchedBorder) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) GridBagLayout(java.awt.GridBagLayout) CollapsiblePanel(org.vcell.util.gui.CollapsiblePanel)

Example 9 with CollapsiblePanel

use of org.vcell.util.gui.CollapsiblePanel in project vcell by virtualcell.

the class ChomboSolverSpecPanel method initialize.

private void initialize() {
    setMaximumSize(new Dimension(500, 150));
    setPreferredSize(new Dimension(500, 200));
    maxBoxSizeComboBox = new JComboBox<Integer>();
    int start = 8;
    for (int i = 0; i < 9; ++i) {
        maxBoxSizeComboBox.addItem(start);
        start *= 2;
    }
    maxBoxSizeComboBox.addItem(0);
    blockFactorComboBox = new JComboBox<Integer>();
    start = 4;
    for (int i = 0; i < 4; ++i) {
        blockFactorComboBox.addItem(start);
        start *= 2;
    }
    blockFactorComboBox.setEnabled(false);
    checkBoxTagsGrow = new JCheckBox("Tags Grow");
    viewLevelFinestRadioButton = new JRadioButton("Finest");
    viewLevelUserSelectRadioButton = new JRadioButton("Select");
    viewLevelFinestRadioButton.addActionListener(eventHandler);
    viewLevelUserSelectRadioButton.addActionListener(eventHandler);
    ButtonGroup bg = new ButtonGroup();
    bg.add(viewLevelFinestRadioButton);
    bg.add(viewLevelUserSelectRadioButton);
    viewLevelComboBox = new JComboBox<Integer>();
    viewLevelComboBox.setEnabled(false);
    viewLevelComboBox.setRenderer(new DefaultListCellRenderer() {

        @Override
        public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            if (value != null && (Integer) value <= simulation.getSolverTaskDescription().getChomboSolverSpec().getNumRefinementLevels()) {
                int dim = simulation.getMathDescription().getGeometry().getDimension();
                ISize xyz = simulation.getSolverTaskDescription().getChomboSolverSpec().getLevelSamplingSize(simulation.getMeshSpecification().getSamplingSize(), (Integer) value);
                setText(GuiUtils.getMeshSizeText(dim, xyz, false));
            }
            return this;
        }
    });
    fillRatioTextField = new JTextField();
    fillRatioTextField.addFocusListener(eventHandler);
    CollapsiblePanel southPanel = new CollapsiblePanel("Advanced", false);
    southPanel.getContentPanel().setLayout(new GridBagLayout());
    int gridy = 0;
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new java.awt.Insets(4, 4, 4, 1);
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.anchor = GridBagConstraints.EAST;
    southPanel.getContentPanel().add(new JLabel("Max Box Size"), gbc);
    gbc = new GridBagConstraints();
    gbc.insets = new java.awt.Insets(4, 1, 4, 4);
    gbc.gridx = 1;
    gbc.gridy = gridy;
    gbc.weightx = 0.1;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    southPanel.getContentPanel().add(maxBoxSizeComboBox, gbc);
    gbc = new GridBagConstraints();
    gbc.insets = new java.awt.Insets(4, 4, 4, 1);
    gbc.gridx = 2;
    gbc.gridy = gridy;
    gbc.anchor = GridBagConstraints.EAST;
    southPanel.getContentPanel().add(new JLabel("Fill Ratio"), gbc);
    gbc = new GridBagConstraints();
    gbc.insets = new java.awt.Insets(4, 1, 4, 4);
    gbc.gridx = 3;
    gbc.gridy = gridy;
    gbc.weightx = 0.1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    southPanel.getContentPanel().add(fillRatioTextField, gbc);
    gbc = new GridBagConstraints();
    gbc.insets = new java.awt.Insets(4, 4, 4, 1);
    gbc.gridx = 4;
    gbc.gridy = gridy;
    gbc.anchor = GridBagConstraints.EAST;
    southPanel.getContentPanel().add(new JLabel("Block Factor"), gbc);
    gbc = new GridBagConstraints();
    gbc.insets = new java.awt.Insets(4, 1, 4, 4);
    gbc.gridx = 5;
    gbc.gridy = gridy;
    gbc.weightx = 0.1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    southPanel.getContentPanel().add(blockFactorComboBox, gbc);
    gbc = new GridBagConstraints();
    gbc.insets = new java.awt.Insets(4, 1, 4, 4);
    gbc.gridx = 6;
    gbc.gridy = gridy;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    southPanel.getContentPanel().add(checkBoxTagsGrow, gbc);
    JPanel northPanel = new JPanel(new GridBagLayout());
    JLabel lbl = new JLabel("<html>Enter Boolean expressions for regions of interest to refine, and set max refinement level desired for each ROI, where each level doubles the mesh resolution.</html>");
    gbc = new GridBagConstraints();
    gbc.insets = new java.awt.Insets(4, 4, 4, 4);
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 1.0;
    northPanel.add(lbl, gbc);
    getContentPanel().setLayout(new BorderLayout(0, 2));
    getContentPanel().add(southPanel, BorderLayout.SOUTH);
    getContentPanel().add(northPanel, BorderLayout.NORTH);
    getContentPanel().add(getRefinementPanel(), BorderLayout.CENTER);
    maxBoxSizeComboBox.addActionListener(eventHandler);
    blockFactorComboBox.addActionListener(eventHandler);
    checkBoxTagsGrow.addActionListener(eventHandler);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) JRadioButton(javax.swing.JRadioButton) GridBagLayout(java.awt.GridBagLayout) ISize(org.vcell.util.ISize) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField) CollapsiblePanel(org.vcell.util.gui.CollapsiblePanel) JCheckBox(javax.swing.JCheckBox) BorderLayout(java.awt.BorderLayout) ButtonGroup(javax.swing.ButtonGroup) DefaultListCellRenderer(javax.swing.DefaultListCellRenderer) Component(java.awt.Component)

Example 10 with CollapsiblePanel

use of org.vcell.util.gui.CollapsiblePanel in project vcell by virtualcell.

the class BioModelEditorPathwayCommonsPanel method initialize.

private void initialize() {
    searchTextField = new TextFieldAutoCompletion();
    searchTextField.addActionListener(eventHandler);
    searchTextField.putClientProperty("JTextField.variant", "search");
    filterTextField = new TextFieldAutoCompletion();
    filterTextField.addActionListener(eventHandler);
    filterTextField.addKeyListener(eventHandler);
    filterTextField.putClientProperty("JTextField.variant", "filter");
    searchButton = new JButton("Search");
    searchButton.addActionListener(eventHandler);
    sortButton = new JButton("Sort");
    sortButton.addActionListener(eventHandler);
    showPathwayButton = new JButton("Preview");
    showPathwayButton.addActionListener(eventHandler);
    showPathwayButton.setEnabled(false);
    gotoPathwayButton = new JButton("Open Web Link");
    gotoPathwayButton.addActionListener(eventHandler);
    gotoPathwayButton.setEnabled(false);
    responseTree = new JTree();
    responseTreeModel = new ResponseTreeModel();
    responseTree.setModel(responseTreeModel);
    ToolTipManager.sharedInstance().registerComponent(responseTree);
    CollapsiblePanel searchPanel = new CollapsiblePanel("Search", true);
    searchPanel.getContentPanel().setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.LINE_START;
    searchPanel.getContentPanel().add(searchTextField, gbc);
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.insets = new Insets(0, 4, 0, 0);
    searchPanel.getContentPanel().add(searchButton, gbc);
    setPreferredSize(new Dimension(475, 300));
    setLayout(new GridBagLayout());
    int gridy = 0;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1.0;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(4, 4, 4, 4);
    add(searchPanel, gbc);
    gridy++;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.insets = new Insets(4, 4, 4, 4);
    gbc.fill = GridBagConstraints.BOTH;
    add(new JScrollPane(responseTree), gbc);
    gridy++;
    CollapsiblePanel filterPanel = new CollapsiblePanel("Filter", true);
    filterPanel.getContentPanel().setLayout(new GridBagLayout());
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.weightx = 1.0;
    gbc.insets = new Insets(2, 2, 2, 2);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.LINE_START;
    filterPanel.getContentPanel().add(filterTextField, gbc);
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.insets = new Insets(0, 4, 0, 0);
    filterPanel.getContentPanel().add(sortButton, gbc);
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1.0;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(4, 4, 4, 4);
    filterPanel.expand(true);
    add(filterPanel, gbc);
    // JPanel optionsField = new JPanel(new GridLayout());
    // ButtonGroup buttonGroup = new ButtonGroup();
    // JRadioButton o1, o2, o3;
    // o1 = new JRadioButton(" Entity ");
    // buttonGroup.add(o1);
    // optionsField.add(o1);
    // o2 = new JRadioButton(" Database ");
    // buttonGroup.add(o2);
    // optionsField.add(o2);
    // o3 = new JRadioButton(" Organism ");
    // buttonGroup.add(o3);
    // optionsField.add(o3);
    // o3.setSelected(true);
    // 
    // gridy ++;
    // CollapsiblePanel optionsPanel = new CollapsiblePanel("Group by... ", true);
    // optionsPanel.getContentPanel().setLayout(new GridBagLayout());
    // gbc = new GridBagConstraints();
    // gbc.gridx = 0;
    // gbc.gridy = gridy;
    // gbc.weightx = 1.0;
    // gbc.fill = GridBagConstraints.HORIZONTAL;
    // gbc.anchor = GridBagConstraints.LINE_START;
    // optionsPanel.getContentPanel().add(optionsField, gbc);
    // 
    // gbc = new GridBagConstraints();
    // gbc.gridx = 0;
    // gbc.gridy = gridy;
    // gbc.weightx = 1.0;
    // gbc.gridwidth = GridBagConstraints.REMAINDER;
    // gbc.fill = GridBagConstraints.HORIZONTAL;
    // gbc.insets = new Insets(4,4,4,4);
    // optionsPanel.expand(false);
    // add(optionsPanel, gbc);
    gridy++;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(4, 4, 4, 1);
    add(showPathwayButton, gbc);
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = gridy;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(4, 1, 4, 4);
    add(gotoPathwayButton, gbc);
    sortButton.setIcon(bAscending ? VCellIcons.sortDownIcon : VCellIcons.sortUpIcon);
    ResponseTreeCellRenderer renderer = new ResponseTreeCellRenderer();
    // renderer.setLeafIcon(null);
    // renderer.setClosedIcon(null);
    // renderer.setOpenIcon(null);
    renderer.setLeafIcon(VCellIcons.pathwayLeafIcon);
    responseTree.setCellRenderer(renderer);
    responseTree.setRootVisible(false);
    responseTree.getSelectionModel().addTreeSelectionListener(eventHandler);
    responseTree.addMouseListener(new MouseAdapter() {

        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() <= 1) {
                return;
            }
            showPathway();
        }
    });
    responseTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {

        public void valueChanged(TreeSelectionEvent e) {
            Object obj = responseTree.getLastSelectedPathComponent();
            if (obj == null || !(obj instanceof BioModelNode)) {
                return;
            }
            BioModelNode selectedNode = (BioModelNode) obj;
            Object userObject = selectedNode.getUserObject();
            setSelectedObjects(new Object[] { userObject });
        }
    });
}
Also used : JScrollPane(javax.swing.JScrollPane) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) MouseEvent(java.awt.event.MouseEvent) GridBagLayout(java.awt.GridBagLayout) JButton(javax.swing.JButton) MouseAdapter(java.awt.event.MouseAdapter) TreeSelectionListener(javax.swing.event.TreeSelectionListener) BioModelNode(cbit.vcell.desktop.BioModelNode) Dimension(java.awt.Dimension) CollapsiblePanel(org.vcell.util.gui.CollapsiblePanel) JTree(javax.swing.JTree) TextFieldAutoCompletion(cbit.gui.TextFieldAutoCompletion) TreeSelectionEvent(javax.swing.event.TreeSelectionEvent)

Aggregations

CollapsiblePanel (org.vcell.util.gui.CollapsiblePanel)12 GridBagConstraints (java.awt.GridBagConstraints)11 GridBagLayout (java.awt.GridBagLayout)11 Insets (java.awt.Insets)8 JScrollPane (javax.swing.JScrollPane)6 JCheckBox (javax.swing.JCheckBox)5 JLabel (javax.swing.JLabel)5 JPanel (javax.swing.JPanel)5 JButton (javax.swing.JButton)4 JTextField (javax.swing.JTextField)4 BorderLayout (java.awt.BorderLayout)3 Dimension (java.awt.Dimension)3 Font (java.awt.Font)3 JTree (javax.swing.JTree)3 BioModelNode (cbit.vcell.desktop.BioModelNode)2 MouseAdapter (java.awt.event.MouseAdapter)2 MouseEvent (java.awt.event.MouseEvent)2 JTextArea (javax.swing.JTextArea)2 Border (javax.swing.border.Border)2 EtchedBorder (javax.swing.border.EtchedBorder)2