use of javax.swing.JTextArea in project vcell by virtualcell.
the class ParameterEstimationRunTaskPanel method getOptimizeResultsTextPane.
/**
* Return the JTextPane1 property value.
* @return javax.swing.JTextPane
*/
private JTextArea getOptimizeResultsTextPane() {
if (optimizeResultsTextArea == null) {
try {
optimizeResultsTextArea = new javax.swing.JTextArea(5, 20);
optimizeResultsTextArea.setLineWrap(true);
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
}
return optimizeResultsTextArea;
}
use of javax.swing.JTextArea in project vcell by virtualcell.
the class ClientRequestManager method curateDocument.
/**
* Insert the method's description here.
* Creation date: (6/22/2004 10:50:34 PM)
* @param documentInfo cbit.vcell.document.VCDocumentInfo
*/
public void curateDocument(final VCDocumentInfo documentInfo, final int curateType, final TopLevelWindowManager requester) {
if (documentInfo != null) {
// see if we have this open
String documentID = documentInfo.getVersion().getVersionKey().toString();
if (getMdiManager().haveWindow(documentID)) {
// already open, refuse
PopupGenerator.showErrorDialog(requester, "Selected edition is open, cannot " + CurateSpec.CURATE_TYPE_NAMES[curateType]);
return;
} else {
// don't have it open, try to CURATE it
int confirm = PopupGenerator.showComponentOKCancelDialog(requester.getComponent(), new JTextArea(CurateSpec.CURATE_TYPE_ACTIONS[curateType] + " cannot be undone without VCELL administrative assistance.\n" + CurateSpec.CURATE_TYPE_STATES[curateType] + " versions of documents cannot be deleted without VCELL administrative assistance.\n" + (curateType == CurateSpec.PUBLISH ? CurateSpec.CURATE_TYPE_STATES[curateType] + " versions of documents MUST remain publically accessible to other VCELL users.\n" : "") + "Do you want to " + CurateSpec.CURATE_TYPE_NAMES[curateType] + " document '" + documentInfo.getVersion().getName() + "'" + "\nwith version date '" + documentInfo.getVersion().getDate().toString() + "'?"), "WARNING -- " + CurateSpec.CURATE_TYPE_ACTIONS[curateType] + " operation cannot be undone");
if (confirm == JOptionPane.OK_OPTION) {
AsynchClientTask task1 = new AsynchClientTask(CurateSpec.CURATE_TYPE_ACTIONS[curateType] + " document...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
if (documentInfo instanceof BioModelInfo) {
getDocumentManager().curate(new CurateSpec((BioModelInfo) documentInfo, curateType));
} else if (documentInfo instanceof MathModelInfo) {
getDocumentManager().curate(new CurateSpec((MathModelInfo) documentInfo, curateType));
} else {
throw new RuntimeException(CurateSpec.CURATE_TYPE_ACTIONS[curateType] + " not supported for VCDocumentInfo type " + documentInfo.getClass().getName());
}
}
};
ClientTaskDispatcher.dispatch(requester.getComponent(), new Hashtable<String, Object>(), new AsynchClientTask[] { task1 }, false);
} else {
// user canceled
return;
}
}
} else {
// nothing selected
return;
}
}
use of javax.swing.JTextArea in project vcell by virtualcell.
the class ReactionPropertiesPanel method initialize.
private void initialize() {
try {
setName("KineticsTypeTemplatePanel");
setLayout(new java.awt.GridBagLayout());
nameTextField = new JTextField();
nameTextField.setEditable(false);
nameTextField.addFocusListener(eventHandler);
nameTextField.addActionListener(eventHandler);
isReversibleCheckBox = new JCheckBox("");
isReversibleCheckBox.addActionListener(eventHandler);
isReversibleCheckBox.setBackground(Color.white);
// isReversibleCheckBox.setHorizontalTextPosition(SwingConstants.LEFT);
electricalPropertiesLabel = new JLabel("Electrical Properties");
electricalPropertiesLabel.setVisible(false);
reactionElectricalPropertiesPanel = new ReactionElectricalPropertiesPanel();
reactionElectricalPropertiesPanel.setVisible(false);
int gridy = 0;
GridBagConstraints gbc = new java.awt.GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.insets = new java.awt.Insets(2, 4, 4, 4);
gbc.anchor = GridBagConstraints.LINE_END;
add(new JLabel("Reaction Name"), gbc);
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.insets = new java.awt.Insets(2, 4, 4, 4);
gbc.weightx = 1.0;
gbc.gridwidth = 3;
gbc.fill = GridBagConstraints.HORIZONTAL;
add(nameTextField, gbc);
gridy++;
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.anchor = java.awt.GridBagConstraints.LINE_END;
gbc.insets = new java.awt.Insets(0, 4, 4, 4);
add(electricalPropertiesLabel, gbc);
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.gridwidth = 3;
gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
gbc.insets = new java.awt.Insets(0, 4, 0, 4);
add(reactionElectricalPropertiesPanel, gbc);
// ----------------------------------------------------------------
JPanel p = new JPanel();
p.setLayout(new GridBagLayout());
p.setBackground(Color.white);
int gridyy = 0;
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridyy;
gbc.anchor = GridBagConstraints.LINE_END;
p.add(new JLabel("Reversible"), gbc);
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = gridyy;
gbc.fill = GridBagConstraints.HORIZONTAL;
p.add(isReversibleCheckBox, gbc);
gridy++;
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.weightx = 0;
gbc.insets = new Insets(0, 4, 4, 4);
gbc.anchor = GridBagConstraints.WEST;
gbc.fill = GridBagConstraints.NONE;
add(p, gbc);
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.anchor = GridBagConstraints.LINE_END;
gbc.insets = new java.awt.Insets(0, 4, 4, 4);
add(new JLabel("Kinetic Type"), gbc);
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 2;
gbc.gridy = gridy;
gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
gbc.insets = new java.awt.Insets(0, 4, 4, 4);
add(getKineticsTypeComboBox(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 3;
gbc.gridy = gridy;
gbc.insets = new java.awt.Insets(0, 4, 4, 4);
add(getJToggleButton(), gbc);
gridy++;
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.fill = java.awt.GridBagConstraints.BOTH;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.gridwidth = 4;
add(getScrollPaneTable().getEnclosingScrollPane(), gbc);
CollapsiblePanel collapsiblePanel = new CollapsiblePanel("Annotation and Pathway Links", true);
collapsiblePanel.getContentPanel().setLayout(new GridBagLayout());
JPanel jp1 = new JPanel();
jp1.setLayout(new GridBagLayout());
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.LINE_START;
JLabel pathwayLink = new JLabel("Linked Pathway Object(s): ");
jp1.add(pathwayLink, gbc);
linkedPOScrollPane = new JScrollPane();
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
gbc.weightx = 1.0;
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.fill = GridBagConstraints.HORIZONTAL;
jp1.add(linkedPOScrollPane, gbc);
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.LINE_START;
collapsiblePanel.getContentPanel().add(jp1, gbc);
annotationTextArea = new JTextArea(2, 20);
annotationTextArea.setLineWrap(true);
annotationTextArea.setWrapStyleWord(true);
annotationTextArea.setFont(new Font("monospaced", Font.PLAIN, 11));
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 1;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.LINE_START;
JScrollPane jp2 = new JScrollPane(annotationTextArea);
collapsiblePanel.getContentPanel().add(jp2, gbc);
gridy++;
gbc = new java.awt.GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.gridwidth = 4;
gbc.weightx = 1.0;
gbc.weighty = 0.2;
gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
add(collapsiblePanel, gbc);
setBackground(Color.white);
getKineticsTypeComboBox().addActionListener(eventHandler);
getKineticsTypeComboBox().setEnabled(false);
initKineticChoices();
initConnections();
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
// user code begin {2}
// user code end
}
use of javax.swing.JTextArea in project vcell by virtualcell.
the class PythonConfigurationPanel method initialize.
private void initialize() {
setLayout(new BorderLayout());
Border margin = new EmptyBorder(5, 3, 1, 1);
Border loweredEtchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
TitledBorder panelBorder = BorderFactory.createTitledBorder(loweredEtchedBorder, " Python Properties ");
panelBorder.setTitleJustification(TitledBorder.LEFT);
panelBorder.setTitlePosition(TitledBorder.TOP);
panelBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
JPanel jpanel = new JPanel();
jpanel.setBorder(new CompoundBorder(margin, panelBorder));
add(jpanel, BorderLayout.CENTER);
jpanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.weighty = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridheight = 1;
// CondaSupport.installInBackground(); // or not in background ... ?????
// =============================================================================
//
// python (anaconda) executable
//
// =============================================================================
int gridy = 0;
String managedMiniconda = new File(ResourceUtil.getVcellHome(), "Miniconda").getAbsolutePath();
String vcellPythonText = "Python is required for parameter estimation and other analysis\n\n" + "VCell manages a dedicated Miniconda python installation \n" + "at " + managedMiniconda + ". \n" + "For more information about Miniconda, \n" + "see https://www.continuum.io\n\n";
JTextArea vcellPythonTextArea = new JTextArea(vcellPythonText);
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.gridwidth = 2;
gbc.weightx = 0.5;
gbc.weighty = 1;
// top, left bottom, right
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(vcellPythonTextArea, gbc);
gridy++;
String providedPythonText = "Alternate Anaconda/Miniconda installation directory.";
JLabel providedPythonLabel = new JLabel(providedPythonText);
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.gridwidth = 2;
gbc.weightx = 0.5;
// top, left bottom, right
gbc.insets = new Insets(4, 4, 1, 4);
jpanel.add(providedPythonLabel, gbc);
gridy++;
pythonExeTextField = new JTextField();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.gridwidth = 1;
gbc.weightx = 0.5;
gbc.weighty = 0.0;
gbc.ipady = 1;
gbc.insets = new Insets(0, 4, 2, 2);
jpanel.add(pythonExeTextField, gbc);
pythonExeTextField.addActionListener((ActionEvent e) -> {
VCellConfiguration.setFileProperty(PropertyLoader.pythonExe, new File(pythonExeTextField.getText()));
});
JButton findPythonButton = new JButton("Browse...");
findPythonButton.addActionListener((ActionEvent e) -> browsePythonExe());
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.gridwidth = 1;
gbc.weightx = 0.0;
gbc.ipady = 0;
gbc.insets = new Insets(3, 2, 2, 4);
jpanel.add(findPythonButton, gbc);
// gridy += 4;
// gbc.gridx=0;
// gbc.gridy=5;
// gbc.gridwidth=2;
// jpanel.add(new JSeparator(), gbc);
pythonExeTextField.addActionListener((ActionEvent e) -> {
VCellConfiguration.setFileProperty(PropertyLoader.pythonExe, new File(pythonExeTextField.getText()));
});
initPythonValues();
}
use of javax.swing.JTextArea in project vcell by virtualcell.
the class DocumentWindow method showTransMADialog.
public void showTransMADialog() {
String disclaimer = "Transforming reactions to stochastic capable cannot be undone. You may want to make a copy of the model.\nAlso some existing applications may need to be recreated in order to maintain consistency.\nLast but not least, stochastic transfomation may not be mathematically equivalent to the orignal model. \nDo you wish to proceed?";
JTextArea ta = new JTextArea(disclaimer);
ta.setEditable(false);
int userChoice = PopupGenerator.showComponentOKCancelDialog(this, ta, "Model Transformation Warning");
if (userChoice != JOptionPane.OK_OPTION) {
return;
}
BioModel biomodel = null;
if (getWindowManager().getVCDocument() instanceof BioModel) {
biomodel = (BioModel) getWindowManager().getVCDocument();
}
TransformMassActionPanel transMAPanel = new TransformMassActionPanel();
transMAPanel.setModel(biomodel.getModel());
int choice = DialogUtils.showComponentOKCancelDialog(this, transMAPanel, "Transform to Stochastic Capable Model");
if (choice == JOptionPane.OK_OPTION) {
try {
transMAPanel.saveTransformedReactions();
} catch (Exception e) {
PopupGenerator.showWarningDialog(getTopLevelWindowManager(), null, new UserMessage(e.getMessage(), new String[] { "Ok" }, "Ok"), null);
}
}
}
Aggregations