/* License: MIT */ package org.autoplot.dfc; import java.awt.Window; import java.util.List; import javax.swing.JPanel; import org.autoplot.datasource.DataSourceEditorPanel; import org.autoplot.datasource.URISplit; import org.das2.util.monitor.ProgressMonitor; /** * * @author cwp */ public class DfcSourceEditorPanel extends javax.swing.JPanel implements DataSourceEditorPanel { /** * Creates new form Das2CatSourceEditorPanel */ public DfcSourceEditorPanel() { initComponents(); } /** * 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") // //GEN-BEGIN:initComponents private void initComponents() { btnGroupRoot = new javax.swing.ButtonGroup(); tabbedPane = new javax.swing.JTabbedPane(); tabNav = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jRadioButton3 = new javax.swing.JRadioButton(); jTextField1 = new javax.swing.JTextField(); jScrollPane3 = new javax.swing.JScrollPane(); jTree2 = new javax.swing.JTree(); tabSrc = new javax.swing.JPanel(); lblNodeOrigin = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); pnlBottom = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); tabbedPane.setMaximumSize(new java.awt.Dimension(8000, 8000)); jLabel1.setText("Catalog:"); btnGroupRoot.add(jRadioButton1); jRadioButton1.setSelected(true); jRadioButton1.setText("Main"); jRadioButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton1ActionPerformed(evt); } }); btnGroupRoot.add(jRadioButton2); jRadioButton2.setText("Test"); btnGroupRoot.add(jRadioButton3); jRadioButton3.setText("Custom Root"); jRadioButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton3ActionPerformed(evt); } }); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jRadioButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jRadioButton3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jRadioButton1) .addComponent(jRadioButton2) .addComponent(jRadioButton3) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jScrollPane3.setViewportView(jTree2); javax.swing.GroupLayout tabNavLayout = new javax.swing.GroupLayout(tabNav); tabNav.setLayout(tabNavLayout); tabNavLayout.setHorizontalGroup( tabNavLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(tabNavLayout.createSequentialGroup() .addGroup(tabNavLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(tabNavLayout.createSequentialGroup() .addGap(5, 5, 5) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(tabNavLayout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane3))) .addContainerGap()) ); tabNavLayout.setVerticalGroup( tabNavLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(tabNavLayout.createSequentialGroup() .addGap(5, 5, 5) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); tabbedPane.addTab("Select Source", tabNav); tabSrc.setLayout(new javax.swing.BoxLayout(tabSrc, javax.swing.BoxLayout.PAGE_AXIS)); lblNodeOrigin.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N lblNodeOrigin.setText("tag:das2.org,2012:site:/uiowa/juno/wav/survey"); lblNodeOrigin.setFocusable(false); lblNodeOrigin.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); tabSrc.add(lblNodeOrigin); jTextArea1.setColumns(20); jTextArea1.setRows(5); jTextArea1.setTabSize(3); jScrollPane1.setViewportView(jTextArea1); tabSrc.add(jScrollPane1); tabbedPane.addTab("Query Options", tabSrc); jButton1.setText("Okay"); jButton2.setText("jButton2"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); javax.swing.GroupLayout pnlBottomLayout = new javax.swing.GroupLayout(pnlBottom); pnlBottom.setLayout(pnlBottomLayout); pnlBottomLayout.setHorizontalGroup( pnlBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnlBottomLayout.createSequentialGroup() .addContainerGap(365, Short.MAX_VALUE) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addGap(10, 10, 10)) ); pnlBottomLayout.setVerticalGroup( pnlBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlBottomLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(pnlBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton2) .addComponent(jButton1)) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(6, 6, 6) .addComponent(pnlBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(5, 5, 5) .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(pnlBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); }// //GEN-END:initComponents private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButton1ActionPerformed {//GEN-HEADEREND:event_jRadioButton1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jRadioButton1ActionPerformed private void jRadioButton3ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jRadioButton3ActionPerformed {//GEN-HEADEREND:event_jRadioButton3ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jRadioButton3ActionPerformed private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jTextField1ActionPerformed {//GEN-HEADEREND:event_jTextField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed {//GEN-HEADEREND:event_jButton2ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jButton2ActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.ButtonGroup btnGroupRoot; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JRadioButton jRadioButton1; private javax.swing.JRadioButton jRadioButton2; private javax.swing.JRadioButton jRadioButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JTextArea jTextArea1; private javax.swing.JTextField jTextField1; private javax.swing.JTree jTree2; private javax.swing.JLabel lblNodeOrigin; private javax.swing.JPanel pnlBottom; private javax.swing.JPanel tabNav; private javax.swing.JPanel tabSrc; private javax.swing.JTabbedPane tabbedPane; // End of variables declaration//GEN-END:variables // I think I am here because the data source factory rejected the given URL, so now // I, the GUI am asked to deal with it. @Override public boolean reject(String sFullUri) throws Exception { // We know how to deal with an empty resource URL, just pull the root nodes if(sFullUri.equals("vap+dfc:")) return false; //URISplit split = URISplit.parse(sFullUri); // If this starts with one of the filsystem URLs, then it needs to handle the // completions first. //if ( split.file==null || split.file.equals("file:///") ) { // return false; //} throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public boolean prepare(String uri, Window parent, ProgressMonitor mon) throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void setURI(String uri) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void markProblems(List problems) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public JPanel getPanel() { return this; } @Override public String getURI() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }