# HG changeset patch # User Daniele Nicolodi # Date 1323098406 -3600 # Node ID 54f14716c7215a2c9a2d33fb9908389406b92e54 # Parent 01b86b780ba7b399341c7e64a49dc3a572b0b443 Update Java code diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/main/MainWindow.form --- a/src/MPipeline2/src/mpipeline/main/MainWindow.form Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/main/MainWindow.form Mon Dec 05 16:20:06 2011 +0100 @@ -481,23 +481,6 @@ - - - - - - - - - - - - - - - - - @@ -506,9 +489,9 @@ - + - + @@ -585,13 +568,13 @@ - + - + @@ -603,7 +586,7 @@ - + @@ -708,9 +691,9 @@ - + - + @@ -728,7 +711,7 @@ - + @@ -833,14 +816,14 @@ - + - + @@ -893,13 +876,13 @@ - + - + @@ -930,13 +913,13 @@ - + - + @@ -1009,7 +992,7 @@ - + @@ -1017,10 +1000,10 @@ - + - + @@ -1029,7 +1012,7 @@ - + @@ -1164,13 +1147,13 @@ - + - + - + @@ -1188,7 +1171,7 @@ - + @@ -1379,7 +1362,7 @@ - + @@ -1539,7 +1522,7 @@ - + diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/main/MainWindow.java --- a/src/MPipeline2/src/mpipeline/main/MainWindow.java Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/main/MainWindow.java Mon Dec 05 16:20:06 2011 +0100 @@ -114,9 +114,6 @@ import mpipeline.ltpdapreferences.DisplayPrefGroup; import mpipeline.ltpdapreferences.LTPDAPreferences; import mpipeline.parametersoverview.ParametersOverviewDialog; -import mpipeline.repository.RepositoryConnection; -import mpipeline.repository.RepositoryManager; -import mpipeline.repository.RepositoryQueryDialog; import mpipeline.repository.SubmissionInfo; import mpipeline.pipelinelist.PipelineList; import mpipeline.pipelinelist.PipelineListTree; @@ -205,7 +202,6 @@ private JMenuItem RebuildLibraryMenuItem = new JMenuItem(); private JMenuItem PlotSelectedMenuItem = new JMenuItem(); private JMenuItem ltpdaPreferencesMenuItem = new JMenuItem(); - private JMenuItem ltpdaRepoGuiMenuItem = new JMenuItem(); private JMenuItem ltpdaPZmodelHelperMenuItem = new JMenuItem(); private JMenuItem ltpdaSpecwinViewerMenuItem = new JMenuItem(); private JMenuItem ltpdaConstructorHelperMenuItem = new JMenuItem(); @@ -255,7 +251,6 @@ private ExecutionPlanView execPlanView = new ExecutionPlanView(this, saved); private Timer autosaveTimer = null; private boolean preferencesApplied = false; - private RepositoryManager repositoryManager = null; /** Parameters overview **/ private ParametersOverviewDialog parametersOverviewDialog = null; private ConsoleDialog console = null; @@ -2123,11 +2118,9 @@ ltpdaPreferencesMenuItem.setText("LTPDA Preferences"); MainMenuTools.add(ltpdaPreferencesMenuItem); - ltpdaRepoGuiMenuItem.setText("LTPDA Repository GUI"); - MainMenuTools.add(ltpdaRepoGuiMenuItem); ltpdaPZmodelHelperMenuItem.setText("Pole/zero Model Helper"); - MainMenuTools.add(ltpdaRepoGuiMenuItem); + MainMenuTools.add(ltpdaPZmodelHelperMenuItem); ltpdaSpecwinViewerMenuItem.setText("Spectral Window Viewer"); MainMenuTools.add(ltpdaSpecwinViewerMenuItem); @@ -2471,7 +2464,6 @@ jSeparator5 = new javax.swing.JToolBar.Separator(); repoSubmitTBB = new javax.swing.JButton(); repoSearchTBB = new javax.swing.JButton(); - repoConnectTBB = new javax.swing.JButton(); jPanel5 = new javax.swing.JPanel(); jSplitPane1 = new javax.swing.JSplitPane(); DocumentPane = new javax.swing.JDesktopPane(); @@ -2775,21 +2767,8 @@ repoSearchTBB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); repoSearchTBB.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/search_database_ro.png"))); // NOI18N repoSearchTBB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - repoSearchTBB.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - repoSearchTBBActionPerformed(evt); - } - }); MainToolbar.add(repoSearchTBB); - repoConnectTBB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/link.png"))); // NOI18N - repoConnectTBB.setToolTipText("Open LTPDA RepositoryManager"); - repoConnectTBB.setFocusable(false); - repoConnectTBB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - repoConnectTBB.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/link_ro.png"))); // NOI18N - repoConnectTBB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - MainToolbar.add(repoConnectTBB); - jSplitPane1.setBorder(null); jSplitPane1.setDividerLocation(280); jSplitPane1.setMinimumSize(new java.awt.Dimension(10, 41)); @@ -2849,13 +2828,13 @@ pipelineTab.setLayout(pipelineTabLayout); pipelineTabLayout.setHorizontalGroup( pipelineTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jScrollPane6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) + .add(jScrollPane6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, pipelineTabLayout.createSequentialGroup() .addContainerGap() .add(pipelineTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(pipelineTabLayout.createSequentialGroup() .add(mvPipelineUpBtn, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 98, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 101, Short.MAX_VALUE) .add(deletePipelineBtn, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(mvPipelineDownBtn, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) @@ -2955,9 +2934,9 @@ libraryTab.setLayout(libraryTabLayout); libraryTabLayout.setHorizontalGroup( libraryTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, libraryTabLayout.createSequentialGroup() - .addContainerGap(50, Short.MAX_VALUE) + .addContainerGap(53, Short.MAX_VALUE) .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(4, 4, 4) .add(libraryTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) @@ -2971,7 +2950,7 @@ libraryTabLayout.setVerticalGroup( libraryTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(libraryTabLayout.createSequentialGroup() - .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 339, Short.MAX_VALUE) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(libraryTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER) .add(jLabel1) @@ -3007,7 +2986,7 @@ shelfTab.setLayout(shelfTabLayout); shelfTabLayout.setHorizontalGroup( shelfTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) + .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE) ); shelfTabLayout.setVerticalGroup( shelfTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -3058,7 +3037,7 @@ jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) + .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -3127,16 +3106,16 @@ .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap() .add(ApplyBtn) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 59, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 62, Short.MAX_VALUE) .add(ParamRmvBtn, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(ParamAddBtn, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .add(jPanel2Layout.createSequentialGroup() .addContainerGap() - .add(setCombo, 0, 170, Short.MAX_VALUE) + .add(setCombo, 0, 173, Short.MAX_VALUE) .addContainerGap()) - .add(jScrollPane5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) + .add(jScrollPane5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -3144,7 +3123,7 @@ .addContainerGap() .add(setCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jScrollPane5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 302, Short.MAX_VALUE) + .add(jScrollPane5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(ParamAddBtn, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) @@ -3161,7 +3140,7 @@ paramsTab.setLayout(paramsTabLayout); paramsTabLayout.setHorizontalGroup( paramsTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jSplitPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) + .add(jSplitPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE) ); paramsTabLayout.setVerticalGroup( paramsTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -3351,7 +3330,7 @@ .add(tableBtn, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(reportBtn, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(104, Short.MAX_VALUE)) + .addContainerGap(107, Short.MAX_VALUE)) ); jPanel4Layout.linkSize(new java.awt.Component[] {DisplayBtn, ExploreBtn, HistoryBtn, PlotBtn, exportWorkspaceBtn, reportBtn, saveObjectBtn, tableBtn}, org.jdesktop.layout.GroupLayout.HORIZONTAL); @@ -3405,7 +3384,7 @@ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(jLabel2)) .add(vebosityCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(72, Short.MAX_VALUE)) + .addContainerGap(81, Short.MAX_VALUE)) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -3422,12 +3401,12 @@ controlsTabLayout.setHorizontalGroup( controlsTabLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(controlsTabLayout.createSequentialGroup() - .add(jSeparator6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE) + .add(jSeparator6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE) .addContainerGap()) - .add(jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) + .add(jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE) .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(controlsTabLayout.createSequentialGroup() - .add(jSeparator7, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE) + .add(jSeparator7, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE) .addContainerGap()) .add(jPanel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); @@ -3458,9 +3437,9 @@ jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1073, Short.MAX_VALUE) + .add(jSplitPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1084, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel5Layout.createSequentialGroup() - .addContainerGap(883, Short.MAX_VALUE) + .addContainerGap(895, Short.MAX_VALUE) .add(jLabel4) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(instanceIdLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 93, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) @@ -3501,12 +3480,12 @@ } }); MainMenuWindow.addMenuListener(new javax.swing.event.MenuListener() { - public void menuCanceled(javax.swing.event.MenuEvent evt) { + public void menuSelected(javax.swing.event.MenuEvent evt) { + MainMenuWindowMenuSelected(evt); } public void menuDeselected(javax.swing.event.MenuEvent evt) { } - public void menuSelected(javax.swing.event.MenuEvent evt) { - MainMenuWindowMenuSelected(evt); + public void menuCanceled(javax.swing.event.MenuEvent evt) { } }); MainMenuBar.add(MainMenuWindow); @@ -3520,11 +3499,11 @@ getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(MainToolbar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1085, Short.MAX_VALUE) + .add(MainToolbar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1096, Short.MAX_VALUE) .add(layout.createSequentialGroup() .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) - .add(statusLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1085, Short.MAX_VALUE) + .add(statusLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1096, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -5295,19 +5274,6 @@ this.showPipelineListPopupMenu(evt); }//GEN-LAST:event_pipelineListTreeMouseReleased -private void repoSearchTBBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_repoSearchTBBActionPerformed - - if (repositoryManager != null) { - - RepositoryConnection conn = repositoryManager.selectConnection(this); - - if (conn != null && conn.isConnected()) { - RepositoryQueryDialog rqd = new RepositoryQueryDialog(this, false, conn, true); - rqd.setVisible(true); - } - } -}//GEN-LAST:event_repoSearchTBBActionPerformed - private void librarySearchPreviousActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_librarySearchPreviousActionPerformed String searchText = BlockSearchTxt.getText(); @@ -7170,14 +7136,6 @@ * * @return */ - public JMenuItem getLtpdaRepoGuiMenuItem() { - return ltpdaRepoGuiMenuItem; - } - - /** - * - * @return - */ public JMenuItem getLtpdaSignalBuilderMenuItem() { return ltpdaSignalBuilderMenuItem; } @@ -7433,8 +7391,8 @@ return repoSubmitTBB; } - public JButton getRepoConnectTBB() { - return repoConnectTBB; + public JButton getRepoSearchTBB() { + return repoSearchTBB; } public JButton getTableBtn() { @@ -7449,18 +7407,10 @@ return prefsDialog; } - public RepositoryManager getRepositoryManager() { - return repositoryManager; - } - public LTPDAPreferences getLtpdaPreferences2() { return ltpdaPreferences2; } - public void setRepositoryManager(RepositoryManager repositoryManager) { - this.repositoryManager = repositoryManager; - } - /** * * @param setCombo @@ -7608,7 +7558,6 @@ private javax.swing.JPanel pipelineTab; private final javax.swing.JTable plistTable = new PlistTable(this); private javax.swing.JButton redoTBB; - private javax.swing.JButton repoConnectTBB; private javax.swing.JButton repoSearchTBB; private javax.swing.JButton repoSubmitTBB; private javax.swing.JButton reportBtn; diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/plisttable/JParamValueSpecialEditor.java --- a/src/MPipeline2/src/mpipeline/plisttable/JParamValueSpecialEditor.java Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/plisttable/JParamValueSpecialEditor.java Mon Dec 05 16:20:06 2011 +0100 @@ -366,26 +366,6 @@ } } - else if (key.toLowerCase().equals("hostname")) { - - ArrayList ports = blk.getInputPortNumbersAsStrings(); - ArrayList choices = getChoices(mw.getRepositoryManager().getRepoHosts().toArray(), ports); - String s = (String) JOptionPane.showInputDialog( - null, - "Hostname", - "Select hostname", - JOptionPane.PLAIN_MESSAGE, - null, - choices.toArray(), - currentValue.toString()); - - //If a string was returned, say so. - if ((s != null) && (s.length() > 0)) { - response = s; - } - - - } else if (key.toLowerCase().equals("built-in")) { ArrayList models = null; diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/repository/MySQLUtils.java --- a/src/MPipeline2/src/mpipeline/repository/MySQLUtils.java Mon Dec 05 16:20:06 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* - * Class MySQLUtils - * - * Copyright (c) 2009 Max-Planck-Gesellschaft, Martin Hewitson - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - -package mpipeline.repository; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author Martin Hewitson - */ -public class MySQLUtils { - - - public static int[] getObjectIDsFromCollectionID(RepositoryConnection conn, int cid) { - - if (!conn.isConnected()) { - conn.openConnection(); - } - - if (!conn.isConnected()) { - return null; - } - - Statement stmt = conn.createStatement(); - ResultSet rs; - try { - rs = stmt.executeQuery("select obj_ids from collections where id='" + cid + "';"); - while (rs.next()) { - String obj_ids = rs.getString(1); - String[] sints = obj_ids.split(","); - int[] ids = new int[sints.length]; - for (int kk = 0; kk < sints.length; kk++) { - Integer id = Integer.parseInt(sints[kk]); - ids[kk] = id.intValue(); - } - return ids; - } - } catch (SQLException ex) { - Logger.getLogger(RepositoryQueryDialog.class.getName()).log(Level.SEVERE, null, ex); - } - - return null; - } - - public static String getObjectTypeForID(RepositoryConnection conn, int id) { - - String obj_type = null; - if (!conn.isConnected()) { - conn.openConnection(); - } - - if (!conn.isConnected()) { - return null; - } - - Statement stmt = conn.createStatement(); - ResultSet rs; - try { - rs = stmt.executeQuery("select obj_type from objmeta where obj_id='" + id + "';"); - while (rs.next()) { - obj_type = rs.getString(1); - } - } catch (SQLException ex) { - Logger.getLogger(RepositoryQueryDialog.class.getName()).log(Level.SEVERE, null, ex); - } - - return obj_type; - } - -} diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/repository/QueryResultsTableDialog.form --- a/src/MPipeline2/src/mpipeline/repository/QueryResultsTableDialog.form Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/repository/QueryResultsTableDialog.form Mon Dec 05 16:20:06 2011 +0100 @@ -1,4 +1,4 @@ - +
@@ -64,7 +64,7 @@ - + diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/repository/QueryResultsTableDialog.java --- a/src/MPipeline2/src/mpipeline/repository/QueryResultsTableDialog.java Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/repository/QueryResultsTableDialog.java Mon Dec 05 16:20:06 2011 +0100 @@ -29,6 +29,8 @@ import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.ArrayList; +import java.util.regex.Pattern; +import java.util.regex.Matcher; import javax.swing.JButton; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; @@ -49,7 +51,7 @@ private ResultSet results = null; private ArrayList colNames = new ArrayList(); private MainWindow mw = null; - private RepositoryConnection usedConn = null; + private java.sql.Connection conn = null; /** Creates new form QueryResultsTable * @param parent @@ -118,10 +120,6 @@ return cancelled; } - public RepositoryConnection getUsedConn() { - return usedConn; - } - public JButton getCreateConstructors() { return createConstructors; } @@ -133,11 +131,11 @@ public ArrayList getColNames() { return colNames; } + + public void setUsedConn(java.sql.Connection conn) { + this.conn = conn; + } - public void setUsedConn(RepositoryConnection usedConn) { - this.usedConn = usedConn; - } - /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is @@ -269,15 +267,18 @@ } int obj_id = Integer.parseInt(o.toString()); - // get connection - if (usedConn == null) { - usedConn = mw.getRepositoryManager().selectConnection(mw); + // get object type + String obj_type = null; + try { + java.sql.PreparedStatement stmt = conn.prepareStatement( + "SELECT obj_type FROM objmeta WHERE obj_id=?"); + stmt.setInt(1, obj_id); + ResultSet rs = stmt.executeQuery(); + rs.next(); + obj_type = (String) rs.getObject(1); } - - usedConn.openConnection(); - // get object type - String obj_type = MySQLUtils.getObjectTypeForID(usedConn, obj_id); - + catch (SQLException ex) { } + if (obj_type == null) { JOptionPane.showMessageDialog(this, "Unable to determine object type for object with id: " + obj_id, @@ -288,7 +289,7 @@ // build constructor block ArrayList algos = mw.getLibrary().findMatches(obj_type); - if (algos.size() == 0) { + if (algos.isEmpty()) { JOptionPane.showMessageDialog(this, "No constructor block found for object type: " + obj_type, "Search error", @@ -304,11 +305,18 @@ MBlock b = new MBlock(algos.get(0)); b.removeAllInputs(); - + // extract hostname and database from connection object + String url = conn.getMetaData().getURL(); + Pattern r = Pattern.compile("^jdbc:mysql://(.*)/(.*)$"); + Matcher m = r.matcher(url); + m.find(); + String hostname = m.group(1); + String database = m.group(2); + // make a plist for this block JPlist pl = new JPlist(); - pl.add("HOSTNAME", usedConn.getHostname(), "char"); - pl.add("DATABASE", usedConn.getDatabase(), "char"); + pl.add("HOSTNAME", hostname, "char"); + pl.add("DATABASE", database, "char"); pl.add("ID", "" + obj_id, "char"); pl.add("BINARY", true, "logical"); diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/repository/RepositoryQueryDialog.form --- a/src/MPipeline2/src/mpipeline/repository/RepositoryQueryDialog.form Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/repository/RepositoryQueryDialog.form Mon Dec 05 16:20:06 2011 +0100 @@ -1,4 +1,4 @@ - + @@ -71,16 +71,16 @@ - + - + - + @@ -277,7 +277,7 @@ - + diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/repository/RepositoryQueryDialog.java --- a/src/MPipeline2/src/mpipeline/repository/RepositoryQueryDialog.java Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/repository/RepositoryQueryDialog.java Mon Dec 05 16:20:06 2011 +0100 @@ -48,18 +48,18 @@ private boolean cancelled = true; private MainWindow mw = null; private boolean modal = true; - private RepositoryConnection repoConnection = null; + private java.sql.Connection repoConnection = null; private ArrayList tables = new ArrayList(); private ArrayList fields = new ArrayList(); private boolean showConstructorButton = true; - + /** Creates new form RepositoryQueryDialgo * @param parent * @param modal * @param conn * @param showConstructorButton */ - public RepositoryQueryDialog(MainWindow parent, boolean modal, RepositoryConnection conn, boolean showConstructorButton) { + public RepositoryQueryDialog(MainWindow parent, boolean modal, java.sql.Connection conn, boolean showConstructorButton) { super(parent, modal); initComponents(); @@ -67,47 +67,27 @@ this.showConstructorButton = showConstructorButton; this.modal = modal; - // Set or get connection - if (conn != null) { - repoConnection = conn; - } - if ((repoConnection == null) && (mw != null)) { - repoConnection = mw.getRepositoryManager().selectConnection(mw); - } - // Return if the connection is invalid(); - if (repoConnection == null) { + if (conn == null) { dispose(); return; } - - // Set title - if (repoConnection != null) { - this.setTitle("Query: " + repoConnection.getHostname() + "/" + repoConnection.getDatabase()); - } - - // connect to repository - if (!repoConnection.isConnected()) { - repoConnection.openConnection(); - } + repoConnection = conn; // get a table list - if (repoConnection.isConnected()) { - Statement stmt = repoConnection.createStatement(); + try { ResultSet rs; - try { - rs = stmt.executeQuery("SHOW TABLES"); - while (rs.next()) { - String str = rs.getString(1); - tables.add(str); - } + Statement stmt = repoConnection.createStatement(); + rs = stmt.executeQuery("SHOW TABLES"); + while (rs.next()) { + String str = rs.getString(1); + tables.add(str); } - catch (SQLException ex) { - Logger.getLogger(RepositoryQueryDialog.class.getName()).log(Level.SEVERE, null, ex); - } - - tablesCombo.setModel(new DefaultComboBoxModel(tables.toArray())); } + catch (SQLException ex) { + Logger.getLogger(RepositoryQueryDialog.class.getName()).log(Level.SEVERE, null, ex); + } + tablesCombo.setModel(new DefaultComboBoxModel(tables.toArray())); if (tables.contains("objmeta")) { tablesCombo.setSelectedItem("objmeta"); @@ -126,13 +106,12 @@ if (o != null) { String tbl = o.toString(); - String q = "describe " + tbl; - Statement stmt = repoConnection.createStatement(); - ResultSet rs; DefaultListModel mdl = new DefaultListModel(); - + try { + ResultSet rs; + Statement stmt = repoConnection.createStatement(); fields.clear(); rs = stmt.executeQuery(q); while (rs.next()) { @@ -210,40 +189,30 @@ @Override public void dispose() { super.dispose(); + if (repoConnection != null) { + try { + repoConnection.close(); + } catch (SQLException ex) { } + } } protected void executeActionPerformed(java.awt.event.ActionEvent evt) { - + String q = queryTxtField.getText(); - - if (!repoConnection.isConnected()) { - repoConnection.openConnection(); - } - - if (repoConnection.isConnected()) { - // lock connection - repoConnection.setLocked(true); - + try { Statement stmt = repoConnection.createStatement(); ResultSet rs; - try { - rs = stmt.executeQuery(q); - - // pass to query results table - QueryResultsTableDialog qrt = new QueryResultsTableDialog(mw, modal, rs, q, showConstructorButton); - qrt.setUsedConn(repoConnection); - qrt.setVisible(true); - - } - catch (Exception ex) { - - JOptionPane.showMessageDialog(mw, - ex.getMessage(), - "Query error", - JOptionPane.ERROR_MESSAGE); - } - repoConnection.setLocked(false); - + rs = stmt.executeQuery(q); + // pass to query results table + QueryResultsTableDialog qrt = new QueryResultsTableDialog(mw, modal, rs, q, showConstructorButton); + qrt.setUsedConn(repoConnection); + qrt.setVisible(true); + } + catch (Exception ex) { + JOptionPane.showMessageDialog(mw, + ex.getMessage(), + "Query error", + JOptionPane.ERROR_MESSAGE); } } @@ -251,7 +220,7 @@ return queryTxtField; } - public RepositoryConnection getRepoConnection() { + public java.sql.Connection getRepoConnection() { return repoConnection; } diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/workspace/WorkspaceBrowserDialog.form --- a/src/MPipeline2/src/mpipeline/workspace/WorkspaceBrowserDialog.form Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/workspace/WorkspaceBrowserDialog.form Mon Dec 05 16:20:06 2011 +0100 @@ -1,4 +1,4 @@ - + @@ -168,20 +168,6 @@ - - - - - - - - - - - - - - @@ -198,7 +184,7 @@ - + diff -r 01b86b780ba7 -r 54f14716c721 src/MPipeline2/src/mpipeline/workspace/WorkspaceBrowserDialog.java --- a/src/MPipeline2/src/mpipeline/workspace/WorkspaceBrowserDialog.java Mon Dec 05 16:20:06 2011 +0100 +++ b/src/MPipeline2/src/mpipeline/workspace/WorkspaceBrowserDialog.java Mon Dec 05 16:20:06 2011 +0100 @@ -83,164 +83,155 @@ * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { + // //GEN-BEGIN:initComponents + private void initComponents() { - jToolBar1 = new javax.swing.JToolBar(); - plotBtn = new javax.swing.JButton(); - displayBtn = new javax.swing.JButton(); - plotHistoryBtn = new javax.swing.JButton(); - exploreBtn = new javax.swing.JButton(); - jSeparator1 = new javax.swing.JToolBar.Separator(); - submitBtn = new javax.swing.JButton(); - queryBtn = new javax.swing.JButton(); - retrieveBtn = new javax.swing.JButton(); - repositoryManagerBtn = new javax.swing.JButton(); - jPanel2 = new javax.swing.JPanel(); - doneBtn = new javax.swing.JButton(); - refreshBtn = new javax.swing.JButton(); - jScrollPane1 = new javax.swing.JScrollPane(); - workspaceTree = new WorkspaceTree(mw); + jToolBar1 = new javax.swing.JToolBar(); + plotBtn = new javax.swing.JButton(); + displayBtn = new javax.swing.JButton(); + plotHistoryBtn = new javax.swing.JButton(); + exploreBtn = new javax.swing.JButton(); + jSeparator1 = new javax.swing.JToolBar.Separator(); + submitBtn = new javax.swing.JButton(); + queryBtn = new javax.swing.JButton(); + retrieveBtn = new javax.swing.JButton(); + jPanel2 = new javax.swing.JPanel(); + doneBtn = new javax.swing.JButton(); + refreshBtn = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + workspaceTree = new WorkspaceTree(mw); - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setTitle("Workspace Browser"); - setLocationByPlatform(true); + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Workspace Browser"); + setLocationByPlatform(true); - jToolBar1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); - jToolBar1.setFloatable(false); - jToolBar1.setOrientation(1); - jToolBar1.setRollover(true); - - plotBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/plot_small.png"))); // NOI18N - plotBtn.setToolTipText("Plot the selected AOs."); - plotBtn.setFocusable(false); - plotBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - plotBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/plot_small_ro.png"))); // NOI18N - plotBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - jToolBar1.add(plotBtn); + jToolBar1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); + jToolBar1.setFloatable(false); + jToolBar1.setOrientation(javax.swing.SwingConstants.VERTICAL); + jToolBar1.setRollover(true); - displayBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/display.png"))); // NOI18N - displayBtn.setToolTipText("Display the selected object(s) on the Matlab terminal"); - displayBtn.setFocusable(false); - displayBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - displayBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/display_ro.png"))); // NOI18N - displayBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - jToolBar1.add(displayBtn); + plotBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/plot_small.png"))); // NOI18N + plotBtn.setToolTipText("Plot the selected AOs."); + plotBtn.setFocusable(false); + plotBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + plotBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/plot_small_ro.png"))); // NOI18N + plotBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(plotBtn); - plotHistoryBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/history_small.png"))); // NOI18N - plotHistoryBtn.setToolTipText("Display the history of the selected objects."); - plotHistoryBtn.setFocusable(false); - plotHistoryBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - plotHistoryBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/history_small_ro.png"))); // NOI18N - plotHistoryBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - jToolBar1.add(plotHistoryBtn); + displayBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/display.png"))); // NOI18N + displayBtn.setToolTipText("Display the selected object(s) on the Matlab terminal"); + displayBtn.setFocusable(false); + displayBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + displayBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/display_ro.png"))); // NOI18N + displayBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(displayBtn); - exploreBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/explore.png"))); // NOI18N - exploreBtn.setToolTipText("Explore the selected objects."); - exploreBtn.setFocusable(false); - exploreBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - exploreBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/explore_ro.png"))); // NOI18N - exploreBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - jToolBar1.add(exploreBtn); - jToolBar1.add(jSeparator1); + plotHistoryBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/history_small.png"))); // NOI18N + plotHistoryBtn.setToolTipText("Display the history of the selected objects."); + plotHistoryBtn.setFocusable(false); + plotHistoryBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + plotHistoryBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/history_small_ro.png"))); // NOI18N + plotHistoryBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(plotHistoryBtn); - submitBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/add_to_database.png"))); // NOI18N - submitBtn.setToolTipText("Submit the selected objects to a repository."); - submitBtn.setFocusable(false); - submitBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - submitBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/add_to_database_ro.png"))); // NOI18N - submitBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - jToolBar1.add(submitBtn); + exploreBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/explore.png"))); // NOI18N + exploreBtn.setToolTipText("Explore the selected objects."); + exploreBtn.setFocusable(false); + exploreBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + exploreBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/explore_ro.png"))); // NOI18N + exploreBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(exploreBtn); + jToolBar1.add(jSeparator1); - queryBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/search_database.png"))); // NOI18N - queryBtn.setToolTipText("Query an LTPDA Repository"); - queryBtn.setFocusable(false); - queryBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - queryBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/search_database_ro.png"))); // NOI18N - queryBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - jToolBar1.add(queryBtn); + submitBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/add_to_database.png"))); // NOI18N + submitBtn.setToolTipText("Submit the selected objects to a repository."); + submitBtn.setFocusable(false); + submitBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + submitBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/add_to_database_ro.png"))); // NOI18N + submitBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(submitBtn); - retrieveBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/download_database.png"))); // NOI18N - retrieveBtn.setToolTipText("Retrieve objecst from a repository."); - retrieveBtn.setFocusable(false); - retrieveBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - retrieveBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/download_database_ro.png"))); // NOI18N - retrieveBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - jToolBar1.add(retrieveBtn); + queryBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/search_database.png"))); // NOI18N + queryBtn.setToolTipText("Query an LTPDA Repository"); + queryBtn.setFocusable(false); + queryBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + queryBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/search_database_ro.png"))); // NOI18N + queryBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(queryBtn); - repositoryManagerBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/link.png"))); // NOI18N - repositoryManagerBtn.setToolTipText("Open the LTPDA repositorynamager"); - repositoryManagerBtn.setFocusable(false); - repositoryManagerBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - repositoryManagerBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/link_ro.png"))); // NOI18N - repositoryManagerBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); - jToolBar1.add(repositoryManagerBtn); + retrieveBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/download_database.png"))); // NOI18N + retrieveBtn.setToolTipText("Retrieve objecst from a repository."); + retrieveBtn.setFocusable(false); + retrieveBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + retrieveBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/download_database_ro.png"))); // NOI18N + retrieveBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); + jToolBar1.add(retrieveBtn); - jPanel2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); + jPanel2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); - doneBtn.setText("Done"); - doneBtn.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - doneBtnActionPerformed(evt); - } - }); + doneBtn.setText("Done"); + doneBtn.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + doneBtnActionPerformed(evt); + } + }); - refreshBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/refresh_small.png"))); // NOI18N - refreshBtn.setToolTipText("Refresh the workspace."); - refreshBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/refresh_small_ro.png"))); // NOI18N + refreshBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/refresh_small.png"))); // NOI18N + refreshBtn.setToolTipText("Refresh the workspace."); + refreshBtn.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/mpipeline/icons/refresh_small_ro.png"))); // NOI18N - org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); - jPanel2.setLayout(jPanel2Layout); - jPanel2Layout.setHorizontalGroup( - jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel2Layout.createSequentialGroup() - .add(refreshBtn) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 101, Short.MAX_VALUE) - .add(doneBtn) - .addContainerGap()) - ); - jPanel2Layout.setVerticalGroup( - jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jPanel2Layout.createSequentialGroup() - .addContainerGap() - .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(doneBtn) - .add(refreshBtn)) - .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); + org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel2Layout.createSequentialGroup() + .add(refreshBtn) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 140, Short.MAX_VALUE) + .add(doneBtn) + .addContainerGap()) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) + .add(doneBtn) + .add(refreshBtn)) + .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); - jPanel2Layout.linkSize(new java.awt.Component[] {doneBtn, refreshBtn}, org.jdesktop.layout.GroupLayout.VERTICAL); + jPanel2Layout.linkSize(new java.awt.Component[] {doneBtn, refreshBtn}, org.jdesktop.layout.GroupLayout.VERTICAL); - jScrollPane1.setViewportView(workspaceTree); + jScrollPane1.setViewportView(workspaceTree); - org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .addContainerGap() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() - .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .addContainerGap() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE) - .add(jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE) + .add(jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); - pack(); - }// //GEN-END:initComponents + pack(); + }// //GEN-END:initComponents private void doneBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doneBtnActionPerformed @@ -248,23 +239,22 @@ }//GEN-LAST:event_doneBtnActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton displayBtn; - private javax.swing.JButton doneBtn; - private javax.swing.JButton exploreBtn; - private javax.swing.JPanel jPanel2; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JToolBar.Separator jSeparator1; - private javax.swing.JToolBar jToolBar1; - private javax.swing.JButton plotBtn; - private javax.swing.JButton plotHistoryBtn; - private javax.swing.JButton queryBtn; - private javax.swing.JButton refreshBtn; - private javax.swing.JButton repositoryManagerBtn; - private javax.swing.JButton retrieveBtn; - private javax.swing.JButton submitBtn; - private javax.swing.JTree workspaceTree; - // End of variables declaration//GEN-END:variables + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton displayBtn; + private javax.swing.JButton doneBtn; + private javax.swing.JButton exploreBtn; + private javax.swing.JPanel jPanel2; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JToolBar.Separator jSeparator1; + private javax.swing.JToolBar jToolBar1; + private javax.swing.JButton plotBtn; + private javax.swing.JButton plotHistoryBtn; + private javax.swing.JButton queryBtn; + private javax.swing.JButton refreshBtn; + private javax.swing.JButton retrieveBtn; + private javax.swing.JButton submitBtn; + private javax.swing.JTree workspaceTree; + // End of variables declaration//GEN-END:variables public JTree getWorkspaceTree() { @@ -302,10 +292,6 @@ return retrieveBtn; } - public JButton getRepositoryManagerBtn() { - return repositoryManagerBtn; - } - public TreePath[] getSelectedPaths() { return workspaceTree.getSelectionPaths(); }