Search in sources :

Example 1 with CopasiOptimizationMethodType

use of cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType in project vcell by virtualcell.

the class ParameterEstimationRunTaskPanel method showCopasiMethodHelp.

public void showCopasiMethodHelp() {
    CopasiOptimizationMethodType methodType = ((CopasiOptimizationMethodType) optimizationMethodComboBox.getSelectedItem());
    getCopasiOptimizationHelpPanel().refreshSolverInfo(methodType);
    JOptionPane helpPane = new JOptionPane(copasiHelpPanel, JOptionPane.INFORMATION_MESSAGE);
    JDialog dialog = helpPane.createDialog(this, "Copasi Methods Help Information");
    dialog.setResizable(true);
    dialog.setVisible(true);
}
Also used : CopasiOptimizationMethodType(cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType) JOptionPane(javax.swing.JOptionPane) JDialog(javax.swing.JDialog)

Example 2 with CopasiOptimizationMethodType

use of cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType in project vcell by virtualcell.

the class CopasiOptimizationMethodsHelpPanel method getHyperLinkLabels.

private void getHyperLinkLabels() {
    CopasiOptimizationMethodType[] methods = CopasiOptimizationMethodType.values();
    methodLabels = new HyperLinkLabel[methods.length];
    for (int i = 0; i < methods.length; i++) {
        methodLabels[i] = new HyperLinkLabel(methods[i].getDisplayName(), eventHandler, 0);
    }
}
Also used : CopasiOptimizationMethodType(cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType) HyperLinkLabel(org.vcell.util.gui.HyperLinkLabel)

Example 3 with CopasiOptimizationMethodType

use of cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType in project vcell by virtualcell.

the class ParameterEstimationRunTaskPanel method optimizationMethodComboBox_ActionPerformed.

/**
 * Comment
 */
private void optimizationMethodComboBox_ActionPerformed() {
    CopasiOptimizationMethodType methodType = (CopasiOptimizationMethodType) getOptimizationMethodComboBox().getSelectedItem();
    CopasiOptimizationMethod com = new CopasiOptimizationMethod(methodType);
    if (parameterEstimationTask != null && parameterEstimationTask.getOptimizationSolverSpec() != null) {
        if (parameterEstimationTask.getOptimizationSolverSpec().getCopasiOptimizationMethod() == null || !parameterEstimationTask.getOptimizationSolverSpec().getCopasiOptimizationMethod().getType().getDisplayName().equals(methodType.getDisplayName())) {
            parameterEstimationTask.getOptimizationSolverSpec().setCopasiOptimizationMethod(com);
        }
    }
    optimizationMethodParameterTableModel.setCopasiOptimizationMethod(com);
    if (methodType.isStochasticMethod()) {
        numberOfRunComboBox.setVisible(true);
        numberOfRunLabel.setVisible(true);
    } else {
        numberOfRunComboBox.setVisible(false);
        numberOfRunLabel.setVisible(false);
    }
}
Also used : CopasiOptimizationMethod(cbit.vcell.opt.CopasiOptimizationMethod) CopasiOptimizationMethodType(cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType)

Example 4 with CopasiOptimizationMethodType

use of cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType in project vcell by virtualcell.

the class ParameterEstimationRunTaskPanel method initialize.

private void initialize() {
    setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weighty = 1.0;
    gbc.insets = new java.awt.Insets(4, 4, 4, 4);
    add(getSolverPanel(), 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);
    add(getSolutionPanel(), gbc);
    JPanel panel = new JPanel(new BorderLayout());
    copasiLinkLabel.setFont(new Font("Tahoma", Font.PLAIN, 12));
    panel.add(copasiLinkLabel, BorderLayout.CENTER);
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridwidth = 2;
    gbc.anchor = GridBagConstraints.LINE_END;
    gbc.insets = new Insets(0, 8, 4, 0);
    add(panel, gbc);
    DefaultComboBoxModel model = new DefaultComboBoxModel();
    for (CopasiOptimizationMethodType com : CopasiOptimizationMethodType.values()) {
        model.addElement(com);
    }
    getOptimizationMethodComboBox().setModel(model);
    getOptimizationMethodComboBox().addActionListener(eventHandler);
    getOptimizationMethodComboBox().setSelectedItem(CopasiOptimizationMethodType.EvolutionaryProgram);
    getOptimizationMethodComboBox().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 instanceof CopasiOptimizationMethodType) {
                setText(((CopasiOptimizationMethodType) value).getDisplayName());
            }
            return this;
        }
    });
    getNumberOfRunComboBox().addActionListener(eventHandler);
    getSolveButton().addActionListener(eventHandler);
    helpButton.addActionListener(eventHandler);
    getPlotButton().addActionListener(eventHandler);
    getSaveSolutionAsNewSimButton().addActionListener(eventHandler);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) Font(java.awt.Font) BorderLayout(java.awt.BorderLayout) DefaultListCellRenderer(javax.swing.DefaultListCellRenderer) CopasiOptimizationMethodType(cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType) EventObject(java.util.EventObject) Component(java.awt.Component) JList(javax.swing.JList)

Aggregations

CopasiOptimizationMethodType (cbit.vcell.opt.CopasiOptimizationMethod.CopasiOptimizationMethodType)4 CopasiOptimizationMethod (cbit.vcell.opt.CopasiOptimizationMethod)1 BorderLayout (java.awt.BorderLayout)1 Component (java.awt.Component)1 Font (java.awt.Font)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 EventObject (java.util.EventObject)1 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)1 DefaultListCellRenderer (javax.swing.DefaultListCellRenderer)1 JDialog (javax.swing.JDialog)1 JList (javax.swing.JList)1 JOptionPane (javax.swing.JOptionPane)1 JPanel (javax.swing.JPanel)1 HyperLinkLabel (org.vcell.util.gui.HyperLinkLabel)1