Search in sources :

Example 1 with TimeFunctionPanel

use of cbit.plot.gui.TimeFunctionPanel in project vcell by virtualcell.

the class ElectricalStimulusPanel method graphTimeFunction.

public static void graphTimeFunction(Component owner, Expression expr, SymbolTable symbolTable, ReservedSymbol timeSymbol, String title) {
    final TimeFunctionPanel timeFunctionPanel = new TimeFunctionPanel();
    try {
        timeFunctionPanel.setTimeFunction(getProtocolParameterExprPreview(expr, symbolTable, timeSymbol).flatten().infix());
    } catch (Exception e) {
        e.printStackTrace();
        DialogUtils.showErrorDialog(owner, "For plot preview only simple expressions of time are allowed.", e);
        return;
    }
    JDialog jdialog = new JDialog(JOptionPane.getFrameForComponent(owner), true);
    jdialog.setTitle(title);
    jdialog.setContentPane(timeFunctionPanel);
    jdialog.pack();
    BeanUtils.centerOnComponent(jdialog, owner);
    DialogUtils.showModalJDialogOnTop(jdialog, owner);
}
Also used : TimeFunctionPanel(cbit.plot.gui.TimeFunctionPanel) ExpressionException(cbit.vcell.parser.ExpressionException) JDialog(javax.swing.JDialog)

Aggregations

TimeFunctionPanel (cbit.plot.gui.TimeFunctionPanel)1 ExpressionException (cbit.vcell.parser.ExpressionException)1 JDialog (javax.swing.JDialog)1