Author: pwang
Date: 2011-07-21 12:32:29 -0700 (Thu, 21 Jul 2011)
New Revision: 26238
Added:
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/TunableDialog.java
Log:
Renamed
Added:
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/TunableDialog.java
===================================================================
---
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/TunableDialog.java
(rev 0)
+++
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/TunableDialog.java
2011-07-21 19:32:29 UTC (rev 26238)
@@ -0,0 +1,115 @@
+package org.cytoscape.work.swing;
+
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+import java.awt.Component;
+
+public class TunableDialog extends JDialog {
+
+ protected JPanel parentPanel = null;
+ private String userInput= "";
+
+ public TunableDialog(){
+ this.setModal(true);
+ initComponents();
+ }
+
+ //
+ public void addComponent(Component optionPanel){
+ jScrollPane1.setViewportView(optionPanel);
+ pack();
+ this.setSize(this.getSize().width+30, this.getSize().height+30);
+ }
+
+ // Set the text to replace the "OK" string on OK button
+ public void setOKtext(String okText){
+ this.btnOK.setText(okText);
+ }
+
+ private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {
+ this.userInput="OK";
+ this.jScrollPane1.removeAll();
+ this.dispose();
+ }
+
+ private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {
+ this.userInput="CANCEL";
+ this.jScrollPane1.removeAll();
+ this.dispose();
+ }
+
+ public String getUserInput(){
+ return userInput;
+ }
+
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">
+ private void initComponents() {
+ java.awt.GridBagConstraints gridBagConstraints;
+
+ jScrollPane1 = new javax.swing.JScrollPane();
+ pnlButtons = new javax.swing.JPanel();
+ btnOK = new javax.swing.JButton();
+ btnCancel = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setName("Form"); // NOI18N
+ getContentPane().setLayout(new java.awt.GridBagLayout());
+
+ jScrollPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1,
1, 1, 1));
+ jScrollPane1.setName("jScrollPane1"); // NOI18N
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.CENTER;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
+ getContentPane().add(jScrollPane1, gridBagConstraints);
+
+ pnlButtons.setName("pnlButtons"); // NOI18N
+
+ btnOK.setText("OK"); // NOI18N
+ btnOK.setName("btnOK"); // NOI18N
+ btnOK.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnOKActionPerformed(evt);
+ }
+ });
+ pnlButtons.add(btnOK);
+
+ btnCancel.setText("Cancel"); // NOI18N
+ btnCancel.setName("btnCancel"); // NOI18N
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+ pnlButtons.add(btnCancel);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
+ getContentPane().add(pnlButtons, gridBagConstraints);
+
+ pack();
+ }// </editor-fold>
+
+ // Variables declaration - do not modify
+ private javax.swing.JButton btnCancel;
+ private javax.swing.JButton btnOK;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JPanel pnlButtons;
+ // End of variables declaration
+}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.