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);
}
Aggregations