summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Reilly <jdr0887@renci.org>2011-02-23 15:34:18 (GMT)
committer Jason Reilly <jdr0887@renci.org>2011-02-23 15:34:18 (GMT)
commitee255d5e3d1af6438dc1910c24fab82a9315e526 (patch)
tree0ae52da24799d99e1be412ce40ff48d62c4276f3
parent98d7899863c7f4a42e8485b00e5fc5224a86b8f6 (diff)
parentee7ed73fa1d3d99360bed092966db4a7cc87bb86 (diff)
downloadQCG-Data-ee255d5e3d1af6438dc1910c24fab82a9315e526.zip
QCG-Data-ee255d5e3d1af6438dc1910c24fab82a9315e526.tar.gz
QCG-Data-ee255d5e3d1af6438dc1910c24fab82a9315e526.tar.bz2
Merge branch 'add-splash-screen'
Conflicts: idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
-rw-r--r--README8
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java66
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java195
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java192
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueThread.java36
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java677
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java20
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java14
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java22
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java25
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/images/iDrop.pngbin0 -> 20056 bytes
-rw-r--r--pom.xml41
12 files changed, 890 insertions, 406 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..1016837
--- /dev/null
+++ b/README
@@ -0,0 +1,8 @@
+
+
+
+To run iDrop from the command line & after a Maven build, run the following
+
+cd idrop-swing
+mvn clean install
+mvn exec:java -Dexec.mainClass=org.irods.jargon.idrop.desktop.systraygui.iDrop
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java
new file mode 100644
index 0000000..50efe22
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java
@@ -0,0 +1,66 @@
+package org.irods.jargon.idrop.desktop.systraygui;
+
+import java.util.Timer;
+
+import org.irods.jargon.core.connection.IRODSAccount;
+import org.irods.jargon.idrop.desktop.systraygui.services.IconManager;
+import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
+import org.irods.jargon.transferengine.TransferManager;
+
+public class IDROPCore {
+
+ private IRODSAccount irodsAccount = null;
+
+ private IdropConfig idropConfig = null;
+
+ private TransferManager transferManager = null;
+
+ private IconManager iconManager = null;
+
+ private Timer queueTimer = new Timer();
+
+ public IDROPCore() {
+ super();
+ }
+
+ public IRODSAccount getIrodsAccount() {
+ return irodsAccount;
+ }
+
+ public void setIrodsAccount(IRODSAccount irodsAccount) {
+ this.irodsAccount = irodsAccount;
+ }
+
+ public IdropConfig getIdropConfig() {
+ return idropConfig;
+ }
+
+ public void setIdropConfig(IdropConfig idropConfig) {
+ this.idropConfig = idropConfig;
+ }
+
+ public TransferManager getTransferManager() {
+ return transferManager;
+ }
+
+ public void setTransferManager(TransferManager transferManager) {
+ this.transferManager = transferManager;
+ }
+
+ public IconManager getIconManager() {
+ return iconManager;
+ }
+
+ public void setIconManager(IconManager iconManager) {
+ this.iconManager = iconManager;
+ }
+
+ public Timer getQueueTimer() {
+ return queueTimer;
+ }
+
+ public void setQueueTimer(Timer queueTimer) {
+ this.queueTimer = queueTimer;
+ }
+
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java
new file mode 100644
index 0000000..972d7ab
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java
@@ -0,0 +1,195 @@
+package org.irods.jargon.idrop.desktop.systraygui;
+
+import java.awt.BorderLayout;
+import java.awt.Toolkit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JProgressBar;
+import javax.swing.JWindow;
+import javax.swing.SwingWorker;
+
+import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.idrop.desktop.systraygui.services.IconManager;
+import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
+import org.irods.jargon.idrop.exceptions.IdropException;
+import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.irods.jargon.transferengine.TransferManager;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author jdr0887
+ */
+public class IDropSplashWindow extends JWindow implements Runnable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private final org.slf4j.Logger logger = LoggerFactory.getLogger(IDropSplashWindow.class);
+
+ private ImageIcon splashImage = new ImageIcon(IDropSplashWindow.class.getClassLoader().getResource(
+ "org/irods/jargon/idrop/desktop/images/iDrop.png"));
+
+ private JLabel jlblImage = new JLabel();
+
+ private JProgressBar jProgressBar1 = new JProgressBar();
+
+ private iDrop iDrop;
+
+ public IDropSplashWindow(iDrop iDrop) {
+ super(iDrop);
+ this.iDrop = iDrop;
+ try {
+ init();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * This method stores all initialization commands for the window.
+ */
+ private void init() throws Exception {
+ // jlblImage.setText("jLabel1");
+ jlblImage.setIcon(splashImage);
+ jProgressBar1.setMinimum(1);
+ jProgressBar1.setMaximum(4);
+ jProgressBar1.setStringPainted(true);
+ this.getContentPane().add(jlblImage, BorderLayout.CENTER);
+ this.getContentPane().add(jProgressBar1, BorderLayout.SOUTH);
+
+ Toolkit tk = this.getToolkit();
+ int width = 420;
+ int height = 315;
+ int x = (tk.getScreenSize().width - width) / 2;
+ int y = (tk.getScreenSize().height - height) / 2;
+ this.setLocation(x, y);
+ this.setSize(width, height);
+ this.setAlwaysOnTop(false);
+ this.setVisible(true);
+ this.pack();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ new LauncherTask().run();
+ }
+
+ /**
+ * Sets the text of the progress bar and its value
+ *
+ * @param msg
+ * The message to be displayed in the progress bar
+ * @param theVal
+ * An integer value from 0 to 100
+ */
+ public void setStatus(String msg, int value) {
+ System.out.println(value);
+ jProgressBar1.setString(msg);
+ jProgressBar1.setValue(value);
+ }
+
+ class LauncherTask extends SwingWorker<Void, Void> {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.swing.SwingWorker#done()
+ */
+ @Override
+ protected void done() {
+ super.done();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.swing.SwingWorker#doInBackground()
+ */
+ @Override
+ protected Void doInBackground() throws Exception {
+
+ int count = 0;
+
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ setStatus("Initializing...", ++count);
+
+ try {
+ // load the properties
+ IdropConfig config = new IdropConfig();
+ config.setUpLogging();
+ iDrop.getiDropCore().setIdropConfig(config);
+ iDrop.getiDropCore().setIconManager(new IconManager(iDrop));
+ } catch (IdropException ex) {
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("unable to load iDrop configuration", ex);
+ }
+
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ setStatus("Logging in...", ++count);
+
+ final LoginDialog loginDialog = new LoginDialog(iDrop);
+ Toolkit tk = getToolkit();
+ int x = (tk.getScreenSize().width - loginDialog.getWidth()) / 2;
+ int y = (tk.getScreenSize().height - loginDialog.getHeight()) / 2;
+ loginDialog.setLocation(x, y);
+ loginDialog.setVisible(true);
+
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ setStatus("Starting DB...", ++count);
+
+ try {
+ /*
+ * the transfer manager is the central control for the data transfer queue, as well as the maintainer of
+ * the status of the queue. This app listens to the TransferManager to receive updates about what the
+ * queue is doing.
+ */
+
+ TransferManager transferManager = TransferManager.instanceWithCallbackListenerAndUserLevelDatabase(
+ iDrop, iDrop.getiDropCore().getIdropConfig().isLogSuccessfulTransfers(), iDrop.getiDropCore()
+ .getIdropConfig().getTransferDatabaseName());
+ iDrop.getiDropCore().setTransferManager(transferManager);
+ } catch (JargonException e1) {
+ logger.error(e1.getMessage());
+ System.exit(1);
+ }
+
+ setStatus("Starting Queue...", ++count);
+ QueueThread queueThread = new QueueThread(iDrop);
+ queueThread.start();
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ dispose();
+ return null;
+ }
+ }
+
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
index e13440d..711c113 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
@@ -1,69 +1,87 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/*
- * LoginDialog.java
- *
- * Created on Jul 7, 2010, 4:41:29 PM
- */
package org.irods.jargon.idrop.desktop.systraygui;
import java.awt.Color;
import java.awt.event.ActionEvent;
-import java.beans.PropertyChangeListener;
import java.util.logging.Level;
import java.util.logging.Logger;
+import java.util.prefs.Preferences;
+
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JComponent;
+import javax.swing.JDialog;
import javax.swing.KeyStroke;
+
+import org.apache.commons.lang.StringUtils;
import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.IRODSFileSystem;
import org.irods.jargon.core.pub.UserAO;
import org.irods.jargon.core.pub.domain.User;
-import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
import org.irods.jargon.idrop.desktop.systraygui.utils.IdropPropertiesHelper;
-import org.irods.jargon.idrop.exceptions.IdropException;
import org.slf4j.LoggerFactory;
/**
- *
+ *
* @author mikeconway
*/
-public class LoginDialog extends javax.swing.JDialog {
+public class LoginDialog extends JDialog {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private static final String PREF_LOGIN_HOST = "login.host";
+
+ private static final String PREF_LOGIN_ZONE = "login.zone";
+
+ private static final String PREF_LOGIN_RESOURCE = "login.resource";
+
+ private static final String PREF_LOGIN_USERNAME = "login.username";
+
+ private iDrop iDrop = null;
- private iDrop iDropParent = null;
public static org.slf4j.Logger log = LoggerFactory.getLogger(LoginDialog.class);
- private IdropConfig idropConfig = null;
- /** Creates new form LoginDialog */
- public LoginDialog(iDrop iDropParent) {
- super(iDropParent, true);
- this.iDropParent = iDropParent;
+ private Preferences preferences = Preferences.userRoot();
+
+ public LoginDialog(iDrop iDrop) {
+ super(iDrop, true);
+ this.iDrop = iDrop;
initComponents();
- try {
- // get the properties that determine the layout of the login dialog
- idropConfig = IdropConfig.instance();
-
- if (idropConfig.isLoginPreset()) {
- log.debug("login will use presets");
- lblHost.setVisible(false);
- txtHost.setVisible(false);
- lblPort.setVisible(false);
- txtPort.setVisible(false);
- lblZone.setVisible(false);
- txtZone.setVisible(false);
- lblResource.setVisible(false);
- txtResource.setVisible(false);
- }
- } catch (IdropException ex) {
- Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE, null, ex);
- iDropParent.showIdropException(ex);
- System.exit(1);
+ // predispose based on preferences
+ String host = this.preferences.get(PREF_LOGIN_HOST, null);
+ if (StringUtils.isNotEmpty(host)) {
+ txtHost.setText(host);
+ }
+
+ String zone = this.preferences.get(PREF_LOGIN_ZONE, null);
+ if (StringUtils.isNotEmpty(zone)) {
+ txtZone.setText(zone);
+ }
+
+ String resource = this.preferences.get(PREF_LOGIN_RESOURCE, null);
+ if (StringUtils.isNotEmpty(resource)) {
+ txtResource.setText(resource);
+ }
+
+ String username = this.preferences.get(PREF_LOGIN_USERNAME, null);
+ if (StringUtils.isNotEmpty(username)) {
+ txtUserName.setText(username);
+ }
+
+ if (iDrop.getiDropCore().getIdropConfig().isLoginPreset()) {
+ log.debug("login will use presets");
+ lblHost.setVisible(false);
+ txtHost.setVisible(false);
+ lblPort.setVisible(false);
+ txtPort.setVisible(false);
+ lblZone.setVisible(false);
+ txtZone.setVisible(false);
+ lblResource.setVisible(false);
+ txtResource.setVisible(false);
}
registerKeystrokeListener();
@@ -72,12 +90,13 @@ public class LoginDialog extends javax.swing.JDialog {
/**
* Action to take when login is initiated
+ *
* @return
* @throws NumberFormatException
*/
private boolean processLogin() throws NumberFormatException {
- //validate various inputs based on whether a full login, or a uid only login is indicated
- if (!idropConfig.isLoginPreset()) {
+ // validate various inputs based on whether a full login, or a uid only login is indicated
+ if (!iDrop.getiDropCore().getIdropConfig().isLoginPreset()) {
txtHost.setBackground(Color.white);
txtPort.setBackground(Color.white);
txtZone.setBackground(Color.white);
@@ -113,56 +132,70 @@ public class LoginDialog extends javax.swing.JDialog {
final IRODSAccount irodsAccount;
try {
// validated, now try to log in
- if (idropConfig.isLoginPreset()) {
+ if (iDrop.getiDropCore().getIdropConfig().isLoginPreset()) {
log.debug("creating account with presets");
- String presetHost = idropConfig.getIdropProperties().getProperty(IdropPropertiesHelper.LOGIN_PRESET_HOST);
+ String presetHost = iDrop.getiDropCore().getIdropConfig().getIdropProperties()
+ .getProperty(IdropPropertiesHelper.LOGIN_PRESET_HOST);
log.info("presetHost:{}", presetHost);
- int presetPort = Integer.parseInt(idropConfig.getIdropProperties().getProperty(IdropPropertiesHelper.LOGIN_PRESET_PORT));
+ int presetPort = Integer.parseInt(iDrop.getiDropCore().getIdropConfig().getIdropProperties()
+ .getProperty(IdropPropertiesHelper.LOGIN_PRESET_PORT));
log.info("presetPort:{}", presetPort);
- String presetZone = idropConfig.getIdropProperties().getProperty(IdropPropertiesHelper.LOGIN_PRESET_ZONE);
+ String presetZone = iDrop.getiDropCore().getIdropConfig().getIdropProperties()
+ .getProperty(IdropPropertiesHelper.LOGIN_PRESET_ZONE);
log.info("presetZone:{}", presetZone);
- String presetResource = idropConfig.getIdropProperties().getProperty(IdropPropertiesHelper.LOGIN_PRESET_RESOURCE);
+ String presetResource = iDrop.getiDropCore().getIdropConfig().getIdropProperties()
+ .getProperty(IdropPropertiesHelper.LOGIN_PRESET_RESOURCE);
log.info("presetResource:{}", presetResource);
sb.append('/');
sb.append(presetZone);
sb.append("/home/");
sb.append(txtUserName.getText());
- irodsAccount = IRODSAccount.instance(presetHost, presetPort, txtUserName.getText(), new String(password.getPassword()), sb.toString(), presetZone, presetResource);
+ irodsAccount = IRODSAccount.instance(presetHost, presetPort, txtUserName.getText(),
+ new String(password.getPassword()), sb.toString(), presetZone, presetResource);
} else {
sb.append('/');
sb.append(txtZone.getText());
sb.append("/home/");
sb.append(txtUserName.getText());
- irodsAccount = IRODSAccount.instance(txtHost.getText(), Integer.parseInt(txtPort.getText()), txtUserName.getText(), new String(password.getPassword()), sb.toString(), txtZone.getText(), txtResource.getText());
+ irodsAccount = IRODSAccount.instance(txtHost.getText(), Integer.parseInt(txtPort.getText()),
+ txtUserName.getText(), new String(password.getPassword()), sb.toString(), txtZone.getText(),
+ txtResource.getText());
}
} catch (JargonException ex) {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE, null, ex);
- iDropParent.showIdropException(ex);
+ iDrop.showIdropException(ex);
return true;
}
+
+ // I figure at this point, it's safe to set the preferences...note that we are not caching password
+ preferences.put(PREF_LOGIN_HOST, txtHost.getText());
+ preferences.put(PREF_LOGIN_ZONE, txtZone.getText());
+ preferences.put(PREF_LOGIN_RESOURCE, txtResource.getText());
+ preferences.put(PREF_LOGIN_USERNAME, txtUserName.getText());
+
IRODSFileSystem irodsFileSystem = null;
try {
irodsFileSystem = IRODSFileSystem.instance();
final UserAO userAO = irodsFileSystem.getIRODSAccessObjectFactory().getUserAO(irodsAccount);
final User loggedInUser = userAO.findByName(txtUserName.getText());
- iDropParent.setIrodsAccount(irodsAccount);
+ iDrop.setIrodsAccount(irodsAccount);
this.dispose();
} catch (JargonException ex) {
if (ex.getMessage().indexOf("Connection refused") > -1) {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE, null, ex);
- iDropParent.showMessageFromOperation("Cannot connect to the server, is it down?");
+ iDrop.showMessageFromOperation("Cannot connect to the server, is it down?");
return true;
} else if (ex.getMessage().indexOf("Connection reset") > -1) {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE, null, ex);
- iDropParent.showMessageFromOperation("Cannot connect to the server, is it down?");
+ iDrop.showMessageFromOperation("Cannot connect to the server, is it down?");
return true;
} else if (ex.getMessage().indexOf("io exception opening socket") > -1) {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE, null, ex);
- iDropParent.showMessageFromOperation("Cannot connect to the server, is it down?");
+ iDrop.showMessageFromOperation("Cannot connect to the server, is it down?");
return true;
} else {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE, null, ex);
- iDropParent.showMessageFromOperation("login error - unable to log in, or invalid user id");
+ iDrop.showMessageFromOperation("login error - unable to log in, or invalid user id");
return true;
}
} finally {
@@ -189,17 +222,13 @@ public class LoginDialog extends javax.swing.JDialog {
processLogin();
}
};
- btnOK.registerKeyboardAction(enterAction, enter,
- JComponent.WHEN_IN_FOCUSED_WINDOW);
-
- }
-
+ btnOK.registerKeyboardAction(enterAction, enter, JComponent.WHEN_IN_FOCUSED_WINDOW);
+ }
- /** 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.
+ /**
+ * 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">//GEN-BEGIN:initComponents
@@ -297,7 +326,7 @@ public class LoginDialog extends javax.swing.JDialog {
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
pnlLoginInfo.add(password, gridBagConstraints);
- getContentPane().add(pnlLoginInfo, java.awt.BorderLayout.CENTER);
+ this.getContentPane().add(pnlLoginInfo, java.awt.BorderLayout.CENTER);
pnlToolbar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT, 2, 5));
@@ -319,38 +348,55 @@ public class LoginDialog extends javax.swing.JDialog {
});
pnlToolbar.add(btnCancel);
- getContentPane().add(pnlToolbar, java.awt.BorderLayout.SOUTH);
+ this.getContentPane().add(pnlToolbar, java.awt.BorderLayout.SOUTH);
lblLogin.setText("Please log in to your iDrop data grid");
- getContentPane().add(lblLogin, java.awt.BorderLayout.PAGE_START);
+ this.getContentPane().add(lblLogin, java.awt.BorderLayout.PAGE_START);
pack();
}// </editor-fold>//GEN-END:initComponents
- private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
- processLogin();
- }//GEN-LAST:event_btnOKActionPerformed
+ private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnOKActionPerformed
+ processLogin();
+ }// GEN-LAST:event_btnOKActionPerformed
- private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
+ private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnCancelActionPerformed
System.exit(0);
- }//GEN-LAST:event_btnCancelActionPerformed
- // Variables declaration - do not modify//GEN-BEGIN:variables
+ }// GEN-LAST:event_btnCancelActionPerformed
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+
private javax.swing.JButton btnCancel;
+
private javax.swing.JButton btnOK;
+
private javax.swing.JLabel lblHost;
+
private javax.swing.JLabel lblLogin;
+
private javax.swing.JLabel lblPassword;
+
private javax.swing.JLabel lblPort;
+
private javax.swing.JLabel lblResource;
+
private javax.swing.JLabel lblUserName;
+
private javax.swing.JLabel lblZone;
+
private javax.swing.JPasswordField password;
+
private javax.swing.JPanel pnlLoginInfo;
+
private javax.swing.JPanel pnlToolbar;
+
private javax.swing.JTextField txtHost;
+
private javax.swing.JTextField txtPort;
+
private javax.swing.JTextField txtResource;
+
private javax.swing.JTextField txtUserName;
+
private javax.swing.JTextField txtZone;
// End of variables declaration//GEN-END:variables
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueThread.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueThread.java
new file mode 100644
index 0000000..a0dc36a
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueThread.java
@@ -0,0 +1,36 @@
+package org.irods.jargon.idrop.desktop.systraygui;
+
+import org.irods.jargon.idrop.desktop.systraygui.services.QueueSchedulerTimerTask;
+import org.irods.jargon.idrop.exceptions.IdropException;
+import org.slf4j.LoggerFactory;
+
+public class QueueThread extends Thread {
+
+ private final org.slf4j.Logger logger = LoggerFactory.getLogger(iDrop.class);
+
+ private iDrop iDrop;
+
+ public QueueThread(iDrop iDrop) {
+ super();
+ this.iDrop = iDrop;
+ }
+
+ @Override
+ public void run() {
+
+ /* A timer task monitors the queue, and can be extended to process things like retrys and file synchronization */
+ logger.info("creating timer for queue manager");
+
+ try {
+ QueueSchedulerTimerTask queueTimerTask = new QueueSchedulerTimerTask(iDrop.getiDropCore()
+ .getTransferManager(), iDrop);
+ iDrop.getiDropCore().getQueueTimer()
+ .scheduleAtFixedRate(queueTimerTask, 1000, QueueSchedulerTimerTask.EVERY_10_MINUTES);
+ } catch (IdropException ex) {
+ logger.error(ex.getMessage());
+ System.exit(1);
+ }
+
+ }
+
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index 85277fe..e0591b8 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -1,4 +1,3 @@
-
/*
* IDrop.java
*
@@ -6,10 +5,6 @@
*/
package org.irods.jargon.idrop.desktop.systraygui;
-import java.awt.event.ItemEvent;
-import javax.swing.JToggleButton;
-import javax.swing.event.ListSelectionEvent;
-import org.irods.jargon.core.transfer.TransferStatus;
import java.awt.AWTException;
import java.awt.CheckboxMenuItem;
import java.awt.Cursor;
@@ -22,6 +17,7 @@ import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@@ -31,19 +27,22 @@ import java.net.URL;
import java.text.DateFormat;
import java.util.Enumeration;
import java.util.List;
-import java.util.Timer;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
+import javax.swing.JToggleButton;
import javax.swing.TransferHandler;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
+
import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.CollectionAO;
@@ -54,23 +53,21 @@ import org.irods.jargon.core.pub.domain.Collection;
import org.irods.jargon.core.pub.domain.DataObject;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.core.query.MetaDataAndDomainData.MetadataDomain;
-import org.irods.jargon.idrop.desktop.systraygui.services.IconManager;
-import org.irods.jargon.idrop.desktop.systraygui.services.QueueSchedulerTimerTask;
+import org.irods.jargon.core.transfer.TransferStatus;
import org.irods.jargon.idrop.desktop.systraygui.utils.ColorHelper;
import org.irods.jargon.idrop.desktop.systraygui.utils.IconHelper;
-import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
import org.irods.jargon.idrop.desktop.systraygui.utils.LocalFileUtils;
import org.irods.jargon.idrop.desktop.systraygui.utils.TreeUtils;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.DefaultFileRepresentationPanel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSFileSystemModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSNode;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSSearchTableModel;
-import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileNode;
-import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileSystemModel;
-import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileTree;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTree;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.InfoPanelTransferHandler;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IrodsTreeListenerForBuildingInfoPanel;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileNode;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileSystemModel;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileTree;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.TagCloudListModel;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
@@ -90,79 +87,56 @@ import org.irods.jargon.usertagging.domain.UserTagCloudView;
import org.slf4j.LoggerFactory;
/**
- * Main system tray and GUI. Create system tray menu, start timer process for queue.
+ * Main system tray and GUI. Create system tray menu, start timer process for queue.
+ *
* @author Mike Conway - DICE (www.irods.org)
*/
public class iDrop extends javax.swing.JFrame implements ActionListener, ItemListener, TransferManagerCallbackListener {
+ private static final long serialVersionUID = 1L;
+
private LocalFileSystemModel localFileModel = null;
- public static org.slf4j.Logger log = LoggerFactory.getLogger(iDrop.class);
+
+ private static final org.slf4j.Logger log = LoggerFactory.getLogger(iDrop.class);
+
private boolean formShown = false;
+
private LocalFileTree fileTree = null;
+
private IRODSTree irodsTree = null;
- private TransferManager transferManager = null;
+
private QueueManagerDialog queueManagerDialog = null;
- private Timer queueTimer = null;
- private QueueSchedulerTimerTask queueTimerTask = null;
- private IdropConfig idropConfig = null;
- private IconManager iconManager = null;
- private IRODSAccount irodsAccount = null;
+
+ private IDROPCore iDropCore = new IDROPCore();
+
private CheckboxMenuItem pausedItem = null;
+
private TrayIcon trayIcon = null;
+
private IRODSFileSystem irodsFileSystem = null;
+
private Object lastCachedInfoItem = null;
+
public DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
+
private UserTagCloudView userTagCloudView = null;
+
private PreferencesDialog preferencesDialog = null;
/**
- * Get the IRODSFileSystem that will be the source for all connections and references to access object and file factories.
- * NOTE: there is some legacy code that needs to be converted to use this reference.
+ * Get the IRODSFileSystem that will be the source for all connections and references to access object and file
+ * factories. NOTE: there is some legacy code that needs to be converted to use this reference.
+ *
* @return
*/
public IRODSFileSystem getIrodsFileSystem() {
return irodsFileSystem;
}
- /**
- * Get configuration information for iDrop
- * @return <code>IdropConfig</code> containing relevant configuration
- */
- public IdropConfig getIdropConfig() {
- return idropConfig;
- }
-
- /**
- * Callback from transferManager that indicates that an error has occurred.
- * @param es
- */
- @Override
- public void transferManagerErrorStatusUpdate(ErrorStatus es) {
- iconManager.setErrorStatus(es);
- }
-
- /**
- * Callback from transferManager that the status of running transfers has occurred
- * @param rs
- */
- @Override
- public void transferManagerRunningStatusUpdate(RunningStatus rs) {
- iconManager.setRunningStatus(rs);
- }
-
/** Creates new form IDrop */
public iDrop() {
try {
- // load the properties
- this.idropConfig = IdropConfig.instance();
- idropConfig.setUpLogging();
- } catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("unable to load iDrop configuration", ex);
- }
-
- try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
@@ -179,7 +153,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
// handle exception
}
-
initComponents();
this.pnlLocalTreeArea.setVisible(false);
this.pnlIrodsInfo.setVisible(false);
@@ -191,62 +164,13 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
throw new IdropRuntimeException("error setting up infoPanelTransferHandler", ex);
}
- if (!idropConfig.isAdvancedView()) {
- toolBarInfo.setVisible(false);
- }
-
- Toolkit t = Toolkit.getDefaultToolkit();
- int width = t.getScreenSize().width;
- int height = t.getScreenSize().height;
-
- int showX = width / 2;
- int showY = height / 2;
-
- LoginDialog loginDialog = new LoginDialog(this);
- loginDialog.setLocation(showY, showY);
- loginDialog.setVisible(true);
-
- if (getIrodsAccount() == null) {
- log.warn("no account, exiting");
- System.exit(0);
- }
-
- /* the transfer manager is the central control for the data transfer queue, as well
- * as the maintainer of the status of the queue. This app listens to the TransferManager to receive updates
- * about what the queue is doing.
- */
-
- iconManager = IconManager.instance(this);
-
try {
irodsFileSystem = IRODSFileSystem.instance();
- transferManager = TransferManagerImpl.instanceWithCallbackListenerAndUserLevelDatabase(this, idropConfig.isLogSuccessfulTransfers(), idropConfig.getTransferDatabaseName());
-
- // see if the queue has any pending transfers
-
- if (transferManager.getCurrentQueue().size() > 0) {
- int confirm = showTransferStartupConfirm();
- if (confirm == JOptionPane.NO_OPTION) {
- transferManager.pause();
- }
- }
-
} catch (JargonException ex) {
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
System.exit(1);
}
- /* A timer task monitors the queue, and can be extended to process things like retrys and file synchronization */
- log.info("creating timer for queue manager");
- queueTimer = new Timer();
- try {
- queueTimerTask = QueueSchedulerTimerTask.instance(transferManager, this);
- queueTimer.scheduleAtFixedRate(queueTimerTask, 1000, QueueSchedulerTimerTask.EVERY_10_MINUTES);
- } catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- System.exit(1);
- }
-
tableSearchResults.setModel(new IRODSSearchTableModel());
MouseListener popupListener = new PopupListener();
// add the listener specifically to the header
@@ -255,16 +179,34 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
+ @Override
+ public void transferManagerErrorStatusUpdate(ErrorStatus es) {
+ iDropCore.getIconManager().setErrorStatus(es);
+ }
+
+ @Override
+ public void transferManagerRunningStatusUpdate(RunningStatus rs) {
+ iDropCore.getIconManager().setRunningStatus(rs);
+ }
+
+ @Override
+ public void transferStatusCallback(TransferStatus ts) {
+ log.info("transfer status callback to iDROP:{}", ts);
+ }
+
/**
* Display an error message dialog that indicates an exception has occcurred
+ *
* @param idropException
*/
public void showIdropException(Exception idropException) {
- JOptionPane.showMessageDialog(this, idropException.getMessage(), "iDROP Exception", JOptionPane.WARNING_MESSAGE);
+ JOptionPane
+ .showMessageDialog(this, idropException.getMessage(), "iDROP Exception", JOptionPane.WARNING_MESSAGE);
}
/**
* Utility method to display a dialog with a message.
+ *
* @param messageFromOperation
*/
public void showMessageFromOperation(final String messageFromOperation) {
@@ -274,29 +216,50 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
@Override
public void run() {
- JOptionPane.showMessageDialog(thisIdropGui, messageFromOperation, "iDROP Message", JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showMessageDialog(thisIdropGui, messageFromOperation, "iDROP Message",
+ JOptionPane.INFORMATION_MESSAGE);
}
});
}
/**
- * Start up iDrop as a system tray application. This is the main entry point for iDrop
- * @param args the command line arguments
+ * Start up iDrop as a system tray application. This is the main entry point for iDrop
+ *
+ * @param args
+ * the command line arguments
*/
public static void main(String args[]) {
+
+
+ final iDrop iDropGui = new iDrop();
+
+ //splash work has to be done in different thread
+ final IDropSplashWindow splash = new IDropSplashWindow(iDropGui);
+ new Thread(splash).run();
+
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
- //new IDrop().setVisible(true);
- final iDrop iDropGui = new iDrop();
+
+ if (!iDropGui.getiDropCore().getIdropConfig().isAdvancedView()) {
+ iDropGui.toolBarInfo.setVisible(false);
+ }
+
+ if (iDropGui.getiDropCore().getIrodsAccount() == null) {
+ log.warn("no account, exiting");
+ System.exit(0);
+ }
+
iDropGui.createAndShowSystemTray();
iDropGui.processQueueStartup();
+ // new IDrop().setVisible(true);
}
});
}
/**
* Update the system tray icon based on the current status.
+ *
* @param iconFile
*/
public void updateIcon(final String iconFile) {
@@ -310,8 +273,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
/**
- * Builds the system tray menu and installs the iDrop icon in the system tray.
- * The iDrop GUI is displayed when the iDrop menu item is selected from the system tray
+ * Builds the system tray menu and installs the iDrop icon in the system tray. The iDrop GUI is displayed when the
+ * iDrop menu item is selected from the system tray
*/
protected void createAndShowSystemTray() {
if (!SystemTray.isSupported()) {
@@ -321,8 +284,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
final PopupMenu popup = new PopupMenu();
- trayIcon =
- new TrayIcon(createImage("images/dialog-ok-2.png", "tray icon"));
+ trayIcon = new TrayIcon(createImage("images/dialog-ok-2.png", "tray icon"));
trayIcon.setImageAutoSize(true);
final SystemTray tray = SystemTray.getSystemTray();
@@ -358,7 +320,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pausedItem.addItemListener(this);
aboutItem.addActionListener(this);
- //Add components to pop-up menu
+ // Add components to pop-up menu
popup.add(aboutItem);
popup.add(iDropItem);
popup.add(preferencesItem);
@@ -397,33 +359,36 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
/**
* Get the current iRODS login account.
+ *
* @return <code>IRODSAccount</code> with the current iRODS connection information.
*/
public IRODSAccount getIrodsAccount() {
synchronized (this) {
- return irodsAccount;
+ return this.iDropCore.getIrodsAccount();
}
}
/**
* Set the current connection information.
+ *
* @return <code>IRODSAccount</code> with the current iRODS connection information.
*/
public void setIrodsAccount(IRODSAccount irodsAccount) {
synchronized (this) {
- this.irodsAccount = irodsAccount;
+ this.iDropCore.setIrodsAccount(irodsAccount);
}
}
/**
* Handler for iDrop system tray menu options.
+ *
* @param e
*/
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("Exit")) {
- queueTimer.cancel();
+ getiDropCore().getQueueTimer().cancel();
System.exit(0);
} else if (e.getActionCommand().equals("Logout")) {
this.setIrodsAccount(null);
@@ -440,7 +405,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
} else if (e.getActionCommand().equals("About")) {
AboutDialog aboutDialog = new AboutDialog(this, true);
- aboutDialog.setLocation((int) (this.getLocation().getX() + this.getWidth() / 2), (int) (this.getLocation().getY() + this.getHeight() / 2));
+ aboutDialog.setLocation((int) (this.getLocation().getX() + this.getWidth() / 2), (int) (this.getLocation()
+ .getY() + this.getHeight() / 2));
aboutDialog.setVisible(true);
} else if (e.getActionCommand().equals("Preferences")) {
@@ -450,7 +416,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.info("showing recent items in queue");
try {
if (queueManagerDialog == null) {
- queueManagerDialog = new QueueManagerDialog(this, transferManager, QueueManagerDialog.ViewType.RECENT);
+ queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
+ QueueManagerDialog.ViewType.RECENT);
} else {
queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.RECENT);
}
@@ -469,7 +436,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.info("showing current items in queue");
try {
if (queueManagerDialog == null) {
- queueManagerDialog = new QueueManagerDialog(this, transferManager, QueueManagerDialog.ViewType.CURRENT);
+ queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
+ QueueManagerDialog.ViewType.CURRENT);
} else {
queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.CURRENT);
}
@@ -487,7 +455,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.info("showing error items in queue");
try {
if (queueManagerDialog == null) {
- queueManagerDialog = new QueueManagerDialog(this, transferManager, QueueManagerDialog.ViewType.ERROR);
+ queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
+ QueueManagerDialog.ViewType.ERROR);
} else {
queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.ERROR);
}
@@ -505,7 +474,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.info("showing warning items in queue");
try {
if (queueManagerDialog == null) {
- queueManagerDialog = new QueueManagerDialog(this, transferManager, QueueManagerDialog.ViewType.WARNING);
+ queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
+ QueueManagerDialog.ViewType.WARNING);
} else {
queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.WARNING);
}
@@ -557,8 +527,11 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
/**
* A transfer confirm dialog
- * @param sourcePath <code>String</code> with the source path of the transfer
- * @param targetPath <code>String</code> with the target of the transfer
+ *
+ * @param sourcePath
+ * <code>String</code> with the source path of the transfer
+ * @param targetPath
+ * <code>String</code> with the target of the transfer
* @return <code>int</code> with the dialog user response.
*/
public int showTransferConfirm(final String sourcePath, final String targetPath) {
@@ -569,12 +542,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
sb.append(" to ");
sb.append(targetPath);
- //default icon, custom title
- int n = JOptionPane.showConfirmDialog(
- this,
- sb.toString(),
- "Transfer Confirmaiton",
- JOptionPane.YES_NO_OPTION);
+ // default icon, custom title
+ int n = JOptionPane.showConfirmDialog(this, sb.toString(), "Transfer Confirmaiton", JOptionPane.YES_NO_OPTION);
return n;
}
@@ -584,19 +553,19 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
*/
public int showTransferStartupConfirm() {
-
- //default icon, custom title
- int n = JOptionPane.showConfirmDialog(
- this,
- "There are transfers ready to process, should the transfer queue be started? Click NO to pause the transfersf",
- "Begin Transfer Confirmation",
- JOptionPane.YES_NO_OPTION);
+ // default icon, custom title
+ int n = JOptionPane
+ .showConfirmDialog(
+ this,
+ "There are transfers ready to process, should the transfer queue be started? Click NO to pause the transfersf",
+ "Begin Transfer Confirmation", JOptionPane.YES_NO_OPTION);
return n;
}
/**
* Returns the current iRODS remote tree view component.
+ *
* @return <code>JTree</code> visual representation of the remote iRODS resource
*/
public javax.swing.JTree getTreeStagingResource() {
@@ -611,10 +580,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
if (pausedItem.getState() == true) {
log.info("pausing....");
- transferManager.pause();
+ iDropCore.getTransferManager().pause();
} else {
log.info("resuming queue");
- transferManager.resume();
+ iDropCore.getTransferManager().resume();
}
} catch (Exception ex) {
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
@@ -625,14 +594,16 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
/**
* Get the transferManager that controls the transfer queue
+ *
* @return <code>TransferManager</code> that controls all transfers via the transfer queue
*/
public TransferManager getTransferManager() {
- return transferManager;
+ return iDropCore.getTransferManager();
}
/**
- * Show or hide the iRODS info panel and manage the state of the show info menu and toggle so that they remain in synch
+ * Show or hide the iRODS info panel and manage the state of the show info menu and toggle so that they remain in
+ * synch
*/
private void handleInfoPanelShowOrHide() {
final iDrop idropGuiReference = this;
@@ -642,7 +613,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
public void run() {
pnlIrodsInfo.setVisible(toggleIrodsDetails.isSelected());
jCheckBoxMenuItemShowIrodsInfo.setSelected(toggleIrodsDetails.isSelected());
- // if info is being opened, initialize to the first selected item, or the root of the iRODS tree if none selected
+ // if info is being opened, initialize to the first selected item, or the root of the iRODS tree if none
+ // selected
IRODSNode node;
if (!(irodsTree.getLastSelectedPathComponent() instanceof IRODSNode)) {
log.info("last selected is not a Node, using root node");
@@ -652,7 +624,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
node = (IRODSNode) irodsTree.getLastSelectedPathComponent();
}
try {
- IrodsTreeListenerForBuildingInfoPanel treeBuilder = new IrodsTreeListenerForBuildingInfoPanel(idropGuiReference);
+ IrodsTreeListenerForBuildingInfoPanel treeBuilder = new IrodsTreeListenerForBuildingInfoPanel(
+ idropGuiReference);
treeBuilder.identifyNodeTypeAndInitializeInfoPanel(node);
} catch (Exception ex) {
Logger.getLogger(IrodsTreeListenerForBuildingInfoPanel.class.getName()).log(Level.SEVERE, null, ex);
@@ -670,11 +643,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
*/
private void setUpLocalFileSelectTree() {
-
- /* build a list of the roots (e.g. drives on windows systems). If there is only one, use it
- * as the basis for the file model, otherwise, display an additional panel listing
- * the other roots, and build the tree for the first drive
- * encountered.
+ /*
+ * build a list of the roots (e.g. drives on windows systems). If there is only one, use it as the basis for the
+ * file model, otherwise, display an additional panel listing the other roots, and build the tree for the first
+ * drive encountered.
*/
if (fileTree != null) {
@@ -685,7 +657,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.info("building tree to look at local file system");
final iDrop gui = this;
-
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
@@ -710,7 +681,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
Object selectedItem = listLocalDrives.getSelectedValue();
initializeLocalFileTreeModelWhenDriveIsSelected(selectedItem);
-
}
});
scrollLocalFileTree.setViewportView(fileTree);
@@ -725,7 +695,9 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.debug("selected drive is null, use the first one");
listLocalDrives.setSelectedIndex(0);
- localFileModel = new LocalFileSystemModel(new LocalFileNode(new File((String) listLocalDrives.getSelectedValue())));
+ localFileModel = new LocalFileSystemModel(new LocalFileNode(new File(
+ (String) listLocalDrives.getSelectedValue())));
+
fileTree.setModel(localFileModel);
} else {
log.debug("selected drive is not null, create new root based on selection", selectedDrive);
@@ -785,7 +757,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
CollectionAndDataObjectListingEntry root = new CollectionAndDataObjectListingEntry();
- if (idropConfig.isLoginPreset()) {
+ if (iDropCore.getIdropConfig().isLoginPreset()) {
log.info("using policy preset home directory");
StringBuilder sb = new StringBuilder();
sb.append("/");
@@ -799,7 +771,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
root.setPathOrName("/");
}
-
log.info("building new iRODS tree");
try {
irodsTree = new IRODSTree(gui);
@@ -829,30 +800,19 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
}
irodsTree.setRefreshingTree(false);
- irodsFileSystem.closeAndEatExceptions(irodsAccount);
+ irodsFileSystem.closeAndEatExceptions(iDropCore.getIrodsAccount());
}
});
}
- /**
- * This is the callback method that will be called by the transfer engine to give
- * real-time status. Currently these go in the bit bucket but will be used
- * for progress bars and other things
- * @param <code>TransferStatus</code> with the status of the file transfer as reported in real-time
- * by the transfer engine process.
- */
- @Override
- public void transferStatusCallback(TransferStatus ts) {
- log.info("transfer status callback to iDROP:{}", ts);
- }
-
private void processQueueStartup() {
- if (transferManager.getRunningStatus() == TransferManager.RunningStatus.PAUSED) {
+ if (iDropCore.getTransferManager().getRunningStatus() == TransferManager.RunningStatus.PAUSED) {
pausedItem.setState(true);
}
}
- public void initializeInfoPane(final CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry) throws IdropException {
+ public void initializeInfoPane(final CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry)
+ throws IdropException {
if (!toggleIrodsDetails.isSelected()) {
log.info("info display not selected, don't bother");
return;
@@ -875,19 +835,23 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
if (collectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
log.info("looking up collection to build info panel");
- CollectionAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAO(getIrodsAccount());
- Collection collection = collectionAO.findByAbsolutePath(collectionAndDataObjectListingEntry.getPathOrName());
+ CollectionAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAO(
+ getIrodsAccount());
+ Collection collection = collectionAO.findByAbsolutePath(collectionAndDataObjectListingEntry
+ .getPathOrName());
initializeInfoPanel(collection);
} else {
log.info("looking up data object to build info panel");
- DataObjectAO dataObjectAO = irodsFileSystem.getIRODSAccessObjectFactory().getDataObjectAO(getIrodsAccount());
- DataObject dataObject = dataObjectAO.findByAbsolutePath(collectionAndDataObjectListingEntry.getParentPath() + "/"
- + collectionAndDataObjectListingEntry.getPathOrName());
+ DataObjectAO dataObjectAO = irodsFileSystem.getIRODSAccessObjectFactory().getDataObjectAO(
+ getIrodsAccount());
+ DataObject dataObject = dataObjectAO.findByAbsolutePath(collectionAndDataObjectListingEntry
+ .getParentPath() + "/" + collectionAndDataObjectListingEntry.getPathOrName());
initializeInfoPanel(dataObject);
}
} catch (Exception e) {
- log.error("exception building info panel from collection and data object listing entry:{}", collectionAndDataObjectListingEntry, e);
+ log.error("exception building info panel from collection and data object listing entry:{}",
+ collectionAndDataObjectListingEntry, e);
throw new IdropRuntimeException(e);
} finally {
irodsFileSystem.closeAndEatExceptions(getIrodsAccount());
@@ -899,8 +863,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
/**
- * Initialize the info panel with data from iRODS. In this case, the data is an iRODS data object (file)
- * @param dataObject <code>DataObject</code> iRODS domain object for a file.
+ * Initialize the info panel with data from iRODS. In this case, the data is an iRODS data object (file)
+ *
+ * @param dataObject
+ * <code>DataObject</code> iRODS domain object for a file.
* @throws IdropException
*/
public void initializeInfoPanel(final DataObject dataObject) throws IdropException {
@@ -930,8 +896,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.debug("getting available tags for data object");
try {
- FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
- IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForDataObjectInFreeTagForm(dataObject.getCollectionName() + "/" + dataObject.getDataName());
+ FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
+ irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
+ IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForDataObjectInFreeTagForm(dataObject
+ .getCollectionName() + "/" + dataObject.getDataName());
txtTags.setText(irodsTagGrouping.getSpaceDelimitedTagsForDomain());
pnlInfoIcon.removeAll();
pnlInfoIcon.add(IconHelper.getFileIcon());
@@ -954,7 +922,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
/**
- * Initialize the info panel with data from iRODS. In this case, the data is an iRODS collection (directory).
+ * Initialize the info panel with data from iRODS. In this case, the data is an iRODS collection (directory).
+ *
* @param collection
* @throws IdropException
*/
@@ -987,8 +956,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.debug("getting available tags for data object");
try {
- FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
- IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForCollectionInFreeTagForm(collection.getCollectionName());
+ FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
+ irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
+ IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForCollectionInFreeTagForm(collection
+ .getCollectionName());
txtTags.setText(irodsTagGrouping.getSpaceDelimitedTagsForDomain());
pnlInfoIcon.removeAll();
pnlInfoIcon.add(IconHelper.getFolderIcon());
@@ -1010,6 +981,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
/**
* Get the JTree component that represents the iRODS file system in the iDrop gui.
+ *
* @return <code>IRODSTree</code> that is the JTree component for the iRODS file system view.
*/
public IRODSTree getIrodsTree() {
@@ -1020,11 +992,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
return toggleIrodsDetails;
}
- /** 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.
- *
+ /**
+ * 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.
+ *
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
@@ -1167,7 +1138,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
lblMainSearch.setPreferredSize(new java.awt.Dimension(45, 40));
pnlSearchSizer.add(lblMainSearch);
- comboSearchType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "by name", "by tag", "by name and tag" }));
+ comboSearchType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "by name", "by tag",
+ "by name and tag" }));
comboSearchType.setToolTipText("Select the type of search to be carried out using the supplied search string");
pnlSearchSizer.add(comboSearchType);
@@ -1416,24 +1388,17 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pnlTabSearchResults.setLayout(new java.awt.GridLayout(1, 0));
- tableSearchResults.setModel(new javax.swing.table.DefaultTableModel(
- new Object [][] {
- {null, null, null, null},
- {null, null, null, null},
- {null, null, null, null},
- {null, null, null, null}
- },
- new String [] {
- "Title 1", "Title 2", "Title 3", "Title 4"
- }
- ));
+ tableSearchResults.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {
+ { null, null, null, null }, { null, null, null, null }, { null, null, null, null },
+ { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
scrollPaneSearchResults.setViewportView(tableSearchResults);
pnlTabSearchResults.add(scrollPaneSearchResults);
pnlTabSearch.add(pnlTabSearchResults, java.awt.BorderLayout.CENTER);
- tabIrodsViews.addTab("Search", null, pnlTabSearch, "Search for files and collections in iRODS and display search results");
+ tabIrodsViews.addTab("Search", null, pnlTabSearch,
+ "Search for files and collections in iRODS and display search results");
splitTargetCollections.setLeftComponent(tabIrodsViews);
@@ -1470,7 +1435,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
lblFileParent.setText("Parent path of file:");
pnlInfoCollectionParent.add(lblFileParent, java.awt.BorderLayout.NORTH);
- lblFileParent.getAccessibleContext().setAccessibleDescription("The path of the parent of the file or collection");
+ lblFileParent.getAccessibleContext().setAccessibleDescription(
+ "The path of the parent of the file or collection");
pnlScrollParentPathSizer.setLayout(new java.awt.BorderLayout());
@@ -1694,7 +1660,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
jMenuView.setMnemonic('V');
jMenuView.setText("View");
- jCheckBoxMenuItemShowSourceTree.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK));
+ jCheckBoxMenuItemShowSourceTree.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L,
+ java.awt.event.InputEvent.SHIFT_MASK));
jCheckBoxMenuItemShowSourceTree.setMnemonic('L');
jCheckBoxMenuItemShowSourceTree.setText("Show Local");
jCheckBoxMenuItemShowSourceTree.addActionListener(new java.awt.event.ActionListener() {
@@ -1704,7 +1671,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
});
jMenuView.add(jCheckBoxMenuItemShowSourceTree);
- jCheckBoxMenuItemShowIrodsInfo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK));
+ jCheckBoxMenuItemShowIrodsInfo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L,
+ java.awt.event.InputEvent.SHIFT_MASK));
jCheckBoxMenuItemShowIrodsInfo.setMnemonic('I');
jCheckBoxMenuItemShowIrodsInfo.setText("Show iRODS Info");
jCheckBoxMenuItemShowIrodsInfo.addActionListener(new java.awt.event.ActionListener() {
@@ -1731,19 +1699,19 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pack();
}// </editor-fold>//GEN-END:initComponents
- private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
+ private void formWindowClosed(java.awt.event.WindowEvent evt) {// GEN-FIRST:event_formWindowClosed
this.setVisible(false);
this.formShown = false;
- }//GEN-LAST:event_formWindowClosed
+ }// GEN-LAST:event_formWindowClosed
- private void btnRefreshTargetTreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshTargetTreeActionPerformed
+ private void btnRefreshTargetTreeActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnRefreshTargetTreeActionPerformed
buildTargetTree();
- }//GEN-LAST:event_btnRefreshTargetTreeActionPerformed
+ }// GEN-LAST:event_btnRefreshTargetTreeActionPerformed
- private void toggleLocalFilesStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_toggleLocalFilesStateChanged
- }//GEN-LAST:event_toggleLocalFilesStateChanged
+ private void toggleLocalFilesStateChanged(javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_toggleLocalFilesStateChanged
+ }// GEN-LAST:event_toggleLocalFilesStateChanged
- private void toggleLocalFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toggleLocalFilesActionPerformed
+ private void toggleLocalFilesActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_toggleLocalFilesActionPerformed
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
@@ -1755,26 +1723,28 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
}
});
- }//GEN-LAST:event_toggleLocalFilesActionPerformed
+ }// GEN-LAST:event_toggleLocalFilesActionPerformed
/**
* Display/hide a panel that depicts the local file system.
+ *
* @param evt
*/
- private void jCheckBoxMenuItemShowSourceTreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemShowSourceTreeActionPerformed
+ private void jCheckBoxMenuItemShowSourceTreeActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jCheckBoxMenuItemShowSourceTreeActionPerformed
toggleLocalFiles.setSelected(jCheckBoxMenuItemShowSourceTree.isSelected());
toggleLocalFilesActionPerformed(evt);
- }//GEN-LAST:event_jCheckBoxMenuItemShowSourceTreeActionPerformed
+ }// GEN-LAST:event_jCheckBoxMenuItemShowSourceTreeActionPerformed
- private void jMenuItemExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExitActionPerformed
+ private void jMenuItemExitActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jMenuItemExitActionPerformed
this.setVisible(false);
- }//GEN-LAST:event_jMenuItemExitActionPerformed
+ }// GEN-LAST:event_jMenuItemExitActionPerformed
/**
* Handle the press of the refresh local drives button, refresh the local file tree.
+ *
* @param evt
*/
- private void btnRefreshLocalDrivesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshLocalDrivesActionPerformed
+ private void btnRefreshLocalDrivesActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnRefreshLocalDrivesActionPerformed
// keep track of currently selected paths
log.debug("refreshing local files tree");
@@ -1808,40 +1778,39 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
});
+ }// GEN-LAST:event_btnRefreshLocalDrivesActionPerformed
-
-
- }//GEN-LAST:event_btnRefreshLocalDrivesActionPerformed
-
- private void toggleIrodsDetailsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_toggleIrodsDetailsStateChanged
+ private void toggleIrodsDetailsStateChanged(javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_toggleIrodsDetailsStateChanged
// unused right now
- }//GEN-LAST:event_toggleIrodsDetailsStateChanged
+ }// GEN-LAST:event_toggleIrodsDetailsStateChanged
/**
* Show or hide the irods details panel
+ *
* @param evt
*/
- private void toggleIrodsDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toggleIrodsDetailsActionPerformed
+ private void toggleIrodsDetailsActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_toggleIrodsDetailsActionPerformed
jCheckBoxMenuItemShowIrodsInfo.setSelected(toggleIrodsDetails.isSelected());
handleInfoPanelShowOrHide();
- }//GEN-LAST:event_toggleIrodsDetailsActionPerformed
+ }// GEN-LAST:event_toggleIrodsDetailsActionPerformed
- private void jCheckBoxMenuItemShowIrodsInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItemShowIrodsInfoActionPerformed
+ private void jCheckBoxMenuItemShowIrodsInfoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jCheckBoxMenuItemShowIrodsInfoActionPerformed
toggleIrodsDetails.setSelected(jCheckBoxMenuItemShowIrodsInfo.isSelected());
handleInfoPanelShowOrHide();
- }//GEN-LAST:event_jCheckBoxMenuItemShowIrodsInfoActionPerformed
+ }// GEN-LAST:event_jCheckBoxMenuItemShowIrodsInfoActionPerformed
/**
- * Focus lost on tags, update tags in the info box. Updates are done in the tagging service by taking a delta between
- * the current and desired tag set.
+ * Focus lost on tags, update tags in the info box. Updates are done in the tagging service by taking a delta
+ * between the current and desired tag set.
+ *
* @param evt
*/
- private void txtTagsFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtTagsFocusLost
- }//GEN-LAST:event_txtTagsFocusLost
+ private void txtTagsFocusLost(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_txtTagsFocusLost
+ }// GEN-LAST:event_txtTagsFocusLost
/**
- * Method to clear any cached values when an account changes. Some data is cached and lazily loaded
+ * Method to clear any cached values when an account changes. Some data is cached and lazily loaded
*/
public void signalChangeInAccountSoCachedDataCanBeCleared() {
log.info("clearing any cached data associated with the account");
@@ -1852,13 +1821,14 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
/**
* Tag view master panel has been shown, lazily load the user tag cloud if not loaded
+ *
* @param evt
*/
- private void pnlTagViewMasterComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_pnlTagViewMasterComponentShown
+ private void pnlTagViewMasterComponentShown(java.awt.event.ComponentEvent evt) {// GEN-FIRST:event_pnlTagViewMasterComponentShown
// dont think right event TODO: loose this event
- }//GEN-LAST:event_pnlTagViewMasterComponentShown
+ }// GEN-LAST:event_pnlTagViewMasterComponentShown
- private void tabIrodsViewsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tabIrodsViewsStateChanged
+ private void tabIrodsViewsStateChanged(javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_tabIrodsViewsStateChanged
if (tabIrodsViews.isShowing()) {
if (userTagCloudView == null) {
@@ -1866,17 +1836,19 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
}
- }//GEN-LAST:event_tabIrodsViewsStateChanged
+ }// GEN-LAST:event_tabIrodsViewsStateChanged
/**
- * rebuild the tag cloud list
+ * rebuild the tag cloud list
*/
private void refreshTagCloud(final String tagSearchText) {
log.info("lazily loading user tag cloud for:{}", getIrodsAccount());
try {
- // FIXME: depict data objects/collections? munge together? wha...
- UserTagCloudService userTagCloudService = UserTagCloudServiceImpl.instance(irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
- userTagCloudView = userTagCloudService.searchForTagsForDataObjectsAndCollectionsUsingSearchTermForTheLoggedInUser(tagSearchText);
+ // FIXME: depict data objects/collections? munge together? wha...
+ UserTagCloudService userTagCloudService = UserTagCloudServiceImpl.instance(
+ irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
+ userTagCloudView = userTagCloudService
+ .searchForTagsForDataObjectsAndCollectionsUsingSearchTermForTheLoggedInUser(tagSearchText);
} catch (JargonException ex) {
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
} finally {
@@ -1892,7 +1864,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
}
- private void txtMainSearchKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMainSearchKeyPressed
+ private void txtMainSearchKeyPressed(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_txtMainSearchKeyPressed
// enter key triggers search
if (evt.getKeyCode() != java.awt.event.KeyEvent.VK_ENTER) {
@@ -1901,7 +1873,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
processSearchRequest();
- }//GEN-LAST:event_txtMainSearchKeyPressed
+ }// GEN-LAST:event_txtMainSearchKeyPressed
private void processSearchRequest() {
log.info("do a search based on the search type combo");
@@ -1918,10 +1890,11 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
/**
* Process a selection in the tag cloud list
+ *
* @param evt
*/
- private void listTagCloudListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_listTagCloudListValueChanged
- //value changed on list selection indicates that a tag search should be done
+ private void listTagCloudListValueChanged(javax.swing.event.ListSelectionEvent evt) {// GEN-FIRST:event_listTagCloudListValueChanged
+ // value changed on list selection indicates that a tag search should be done
if (evt.getValueIsAdjusting()) {
return;
}
@@ -1940,14 +1913,14 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
searchTagsAndBuildResultEntries(entry.getIrodsTagValue().getTagData());
- }//GEN-LAST:event_listTagCloudListValueChanged
+ }// GEN-LAST:event_listTagCloudListValueChanged
- private void btnRefreshTagCloudActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshTagCloudActionPerformed
+ private void btnRefreshTagCloudActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnRefreshTagCloudActionPerformed
log.info("refreshing the tag cloud on user action using search text of:{}", txtTagNameSearch.getText());
refreshTagCloud(txtTagNameSearch.getText());
- }//GEN-LAST:event_btnRefreshTagCloudActionPerformed
+ }// GEN-LAST:event_btnRefreshTagCloudActionPerformed
- private void txtTagsKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtTagsKeyPressed
+ private void txtTagsKeyPressed(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_txtTagsKeyPressed
// FIXME: cull this
@@ -1956,21 +1929,23 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
return;
}
- }//GEN-LAST:event_txtTagsKeyPressed
+ }// GEN-LAST:event_txtTagsKeyPressed
/**
* The view menu of iDrop indicates that the user wants to show the preferences dialog
+ *
* @param evt
*/
- private void jMenuItemPreferencesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPreferencesActionPerformed
+ private void jMenuItemPreferencesActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jMenuItemPreferencesActionPerformed
showPreferencesDialog();
- }//GEN-LAST:event_jMenuItemPreferencesActionPerformed
+ }// GEN-LAST:event_jMenuItemPreferencesActionPerformed
/**
* Display the data replication dialog for the collection or data object depicted in the info panel
+ *
* @param evt
*/
- private void btnReplicationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReplicationActionPerformed
+ private void btnReplicationActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnReplicationActionPerformed
if (lastCachedInfoItem == null) {
return;
}
@@ -1978,24 +1953,28 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
ReplicationDialog replicationDialog;
if (lastCachedInfoItem instanceof DataObject) {
DataObject cachedDataObject = (DataObject) lastCachedInfoItem;
- replicationDialog = new ReplicationDialog(this, true, cachedDataObject.getCollectionName(), cachedDataObject.getDataName());
+ replicationDialog = new ReplicationDialog(this, true, cachedDataObject.getCollectionName(),
+ cachedDataObject.getDataName());
} else if (lastCachedInfoItem instanceof Collection) {
Collection collection = (Collection) lastCachedInfoItem;
replicationDialog = new ReplicationDialog(this, true, collection.getCollectionName());
} else {
- showIdropException(new IdropException("Unknown type of object displayed in info area, cannot create the replication dialog"));
+ showIdropException(new IdropException(
+ "Unknown type of object displayed in info area, cannot create the replication dialog"));
throw new IdropRuntimeException("unknown type of object displayed in info area");
}
- replicationDialog.setLocation((int) (this.getLocation().getX() + replicationDialog.getWidth() / 2), (int) (this.getLocation().getY() + replicationDialog.getHeight() / 2));
+ replicationDialog.setLocation((int) (this.getLocation().getX() + replicationDialog.getWidth() / 2), (int) (this
+ .getLocation().getY() + replicationDialog.getHeight() / 2));
replicationDialog.setVisible(true);
- }//GEN-LAST:event_btnReplicationActionPerformed
+ }// GEN-LAST:event_btnReplicationActionPerformed
/**
* Display the metadata edit /view dialog for the item displayed in the info panel
+ *
* @param evt
*/
- private void btnViewMetadataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnViewMetadataActionPerformed
+ private void btnViewMetadataActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnViewMetadataActionPerformed
if (lastCachedInfoItem == null) {
return;
}
@@ -2003,20 +1982,23 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
MetadataViewDialog metadataViewDialog;
if (lastCachedInfoItem instanceof DataObject) {
DataObject cachedDataObject = (DataObject) lastCachedInfoItem;
- metadataViewDialog = new MetadataViewDialog(this, getIrodsAccount(), cachedDataObject.getCollectionName(), cachedDataObject.getDataName());
+ metadataViewDialog = new MetadataViewDialog(this, getIrodsAccount(), cachedDataObject.getCollectionName(),
+ cachedDataObject.getDataName());
} else if (lastCachedInfoItem instanceof Collection) {
Collection collection = (Collection) lastCachedInfoItem;
metadataViewDialog = new MetadataViewDialog(this, getIrodsAccount(), collection.getCollectionName());
} else {
- showIdropException(new IdropException("Unknown type of object displayed in info area, cannot create the replication dialog"));
+ showIdropException(new IdropException(
+ "Unknown type of object displayed in info area, cannot create the replication dialog"));
throw new IdropRuntimeException("unknown type of object displayed in info area");
}
- metadataViewDialog.setLocation((int) (this.getLocation().getX() + metadataViewDialog.getWidth() / 2), (int) (this.getLocation().getY() + metadataViewDialog.getHeight() / 2));
+ metadataViewDialog.setLocation((int) (this.getLocation().getX() + metadataViewDialog.getWidth() / 2),
+ (int) (this.getLocation().getY() + metadataViewDialog.getHeight() / 2));
metadataViewDialog.setVisible(true);
- }//GEN-LAST:event_btnViewMetadataActionPerformed
+ }// GEN-LAST:event_btnViewMetadataActionPerformed
- private void btnUpdateInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateInfoActionPerformed
+ private void btnUpdateInfoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnUpdateInfoActionPerformed
// if I have cached an item, see if it is a file or collection
if (this.lastCachedInfoItem == null) {
@@ -2036,18 +2018,22 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
FreeTaggingService freeTaggingService;
try {
- freeTaggingService = FreeTaggingServiceImpl.instance(irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
+ freeTaggingService = FreeTaggingServiceImpl.instance(irodsFileSystem.getIRODSAccessObjectFactory(),
+ getIrodsAccount());
if (lastCachedInfoItem instanceof Collection) {
log.info("processing tags for collection");
Collection collection = (Collection) lastCachedItemToProcessTagsFor;
- IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.COLLECTION, collection.getCollectionName(), txtTags.getText(), getIrodsAccount().getUserName());
+ IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.COLLECTION, collection
+ .getCollectionName(), txtTags.getText(), getIrodsAccount().getUserName());
log.debug("new tag set is:{}", txtTags.getText());
freeTaggingService.updateTags(irodsTagGrouping);
} else if (lastCachedInfoItem instanceof DataObject) {
log.info("processing tags for data object");
DataObject dataObject = (DataObject) lastCachedItemToProcessTagsFor;
- IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.DATA, dataObject.getCollectionName() + "/" + dataObject.getDataName(), txtTags.getText(), getIrodsAccount().getUserName());
+ IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.DATA, dataObject
+ .getCollectionName() + "/" + dataObject.getDataName(), txtTags.getText(),
+ getIrodsAccount().getUserName());
log.debug("new tag set is:{}", txtTags.getText());
freeTaggingService.updateTags(irodsTagGrouping);
} else {
@@ -2070,21 +2056,22 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
}
});
- }//GEN-LAST:event_btnUpdateInfoActionPerformed
+ }// GEN-LAST:event_btnUpdateInfoActionPerformed
/*
* The search button has been pressed, do a search
*/
- private void btnearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnearchActionPerformed
+ private void btnearchActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnearchActionPerformed
processSearchRequest();
- }//GEN-LAST:event_btnearchActionPerformed
+ }// GEN-LAST:event_btnearchActionPerformed
- private void menuItemShowInHierarchyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItemShowInHierarchyActionPerformed
+ private void menuItemShowInHierarchyActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_menuItemShowInHierarchyActionPerformed
int selRow = tableSearchResults.getSelectedRow();
log.debug("selected:{}", selRow);
IRODSSearchTableModel irodsSearchTableModel = (IRODSSearchTableModel) tableSearchResults.getModel();
- CollectionAndDataObjectListingEntry entry = irodsSearchTableModel.getEntries().get(tableSearchResults.convertRowIndexToModel(selRow));
+ CollectionAndDataObjectListingEntry entry = irodsSearchTableModel.getEntries().get(
+ tableSearchResults.convertRowIndexToModel(selRow));
if (entry == null) {
log.warn("no row found");
}
@@ -2107,7 +2094,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
TreeUtils.expandAll(irodsTree, selPath, true);
irodsTree.scrollPathToVisible(selPath);
tabIrodsViews.setSelectedComponent(pnlTabHierarchicalView);
- }//GEN-LAST:event_menuItemShowInHierarchyActionPerformed
+ }// GEN-LAST:event_menuItemShowInHierarchyActionPerformed
/**
* Common code to show the preferences dialog
@@ -2115,116 +2102,219 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
private void showPreferencesDialog() {
if (preferencesDialog == null) {
preferencesDialog = new PreferencesDialog(this, true);
- preferencesDialog.setLocation((int) (preferencesDialog.getLocation().getX() + preferencesDialog.getWidth() / 2), (int) (preferencesDialog.getLocation().getY() + preferencesDialog.getHeight() / 2));
+ preferencesDialog.setLocation(
+ (int) (preferencesDialog.getLocation().getX() + preferencesDialog.getWidth() / 2),
+ (int) (preferencesDialog.getLocation().getY() + preferencesDialog.getHeight() / 2));
preferencesDialog.setVisible(true);
} else {
preferencesDialog.setVisible(true);
}
}
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnMoveToTrash;
+
private javax.swing.JButton btnRefreshLocalDrives;
+
private javax.swing.JButton btnRefreshTagCloud;
+
private javax.swing.JButton btnRefreshTargetTree;
+
private javax.swing.JButton btnReplication;
+
private javax.swing.JButton btnUpdateInfo;
+
private javax.swing.JButton btnViewMetadata;
+
private javax.swing.JButton btnearch;
+
private javax.swing.JComboBox comboSearchType;
+
private javax.swing.JPanel iDropToolbar;
+
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemShowIrodsInfo;
+
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemShowSourceTree;
+
private javax.swing.JMenuBar jMenuBar1;
+
private javax.swing.JMenu jMenuEdit;
+
private javax.swing.JMenu jMenuFile;
+
private javax.swing.JMenuItem jMenuItemExit;
+
private javax.swing.JMenuItem jMenuItemPreferences;
+
private javax.swing.JMenu jMenuView;
+
private javax.swing.JSplitPane jSplitPanelLocalRemote;
+
private javax.swing.JLabel lblComment;
+
private javax.swing.JLabel lblFileOrCollectionName;
+
private javax.swing.JLabel lblFileParent;
+
private javax.swing.JLabel lblIdropMessage;
+
private javax.swing.JLabel lblInfoCreatedAt;
+
private javax.swing.JLabel lblInfoCreatedAtValue;
+
private javax.swing.JLabel lblInfoLength;
+
private javax.swing.JLabel lblInfoLengthValue;
+
private javax.swing.JLabel lblInfoUpdatedAt;
+
private javax.swing.JLabel lblInfoUpdatedAtValue;
+
private javax.swing.JLabel lblMainSearch;
+
private javax.swing.JLabel lblSearchTags;
+
private javax.swing.JLabel lblTags;
+
private javax.swing.JList listLocalDrives;
+
private javax.swing.JList listTagCloudList;
+
private javax.swing.JMenuItem menuItemShowInHierarchy;
+
private javax.swing.JPanel pnlDrivesFiller;
+
private javax.swing.JPanel pnlFileIconSizer;
+
private javax.swing.JPanel pnlFileNameAndIcon;
+
private javax.swing.JPanel pnlIdropBottom;
+
private javax.swing.JPanel pnlIdropMain;
+
private javax.swing.JPanel pnlInfoButton;
+
private javax.swing.JPanel pnlInfoButtonSizer;
+
private javax.swing.JPanel pnlInfoCollectionParent;
+
private javax.swing.JPanel pnlInfoComment;
+
private javax.swing.JPanel pnlInfoCommentScrollSizer;
+
private javax.swing.JPanel pnlInfoDetails;
+
private javax.swing.JPanel pnlInfoIcon;
+
private javax.swing.JPanel pnlInfoTags;
+
private javax.swing.JPanel pnlInfoTagsSizer;
+
private javax.swing.JPanel pnlIrodsArea;
+
private javax.swing.JPanel pnlIrodsDetailsToggleSizer;
+
private javax.swing.JPanel pnlIrodsInfo;
+
private javax.swing.JPanel pnlIrodsInfoInner;
+
private javax.swing.JPanel pnlIrodsTreeMaster;
+
private javax.swing.JPanel pnlIrodsTreeToolbar;
+
private javax.swing.JPanel pnlLocalRoots;
+
private javax.swing.JPanel pnlLocalToggleSizer;
+
private javax.swing.JPanel pnlLocalTreeArea;
+
private javax.swing.JPanel pnlRefreshButton;
+
private javax.swing.JPanel pnlScrollParentPathSizer;
+
private javax.swing.JPanel pnlSearchSizer;
+
private javax.swing.JPanel pnlTabHierarchicalView;
+
private javax.swing.JPanel pnlTabSearch;
+
private javax.swing.JPanel pnlTabSearchResults;
+
private javax.swing.JPanel pnlTabSearchTop;
+
private javax.swing.JPanel pnlTabTagView;
+
private javax.swing.JPanel pnlTagListing;
+
private javax.swing.JPanel pnlTagResultsInner;
+
private javax.swing.JPanel pnlTagSearch;
+
private javax.swing.JPanel pnlTagSearchSearchBox;
+
private javax.swing.JPanel pnlTagViewMaster;
+
private javax.swing.JPanel pnlTargetTree;
+
private javax.swing.JPanel pnlToolbarInfo;
+
private javax.swing.JPanel pnlToolbarSizer;
+
private javax.swing.JPanel pnlTopToolbarSearchArea;
+
private javax.swing.JScrollPane scrollComment;
+
private javax.swing.JScrollPane scrollIrodsInfo;
+
private javax.swing.JScrollPane scrollIrodsTree;
+
private javax.swing.JScrollPane scrollLocalDrives;
+
private javax.swing.JScrollPane scrollLocalFileTree;
+
private javax.swing.JScrollPane scrollPaneSearchResults;
+
private javax.swing.JScrollPane scrollPaneTagCloudList;
+
private javax.swing.JScrollPane scrollParentPath;
+
private javax.swing.JScrollPane scrollTagResults;
+
protected javax.swing.JPopupMenu searchTablePopupMenu;
+
private javax.swing.JToolBar.Separator separator1;
+
private javax.swing.JToolBar.Separator separator2;
+
private javax.swing.JSplitPane splitTagsAndTagResults;
+
private javax.swing.JSplitPane splitTargetCollections;
+
private javax.swing.JTabbedPane tabIrodsViews;
+
private javax.swing.JTable tableSearchResults;
+
private javax.swing.JToggleButton toggleIrodsDetails;
+
private javax.swing.JToggleButton toggleLocalFiles;
+
private javax.swing.JToolBar toolBarInfo;
+
private javax.swing.JTextArea txtComment;
+
private javax.swing.JTextField txtMainSearch;
+
private javax.swing.JTextArea txtParentPath;
+
private javax.swing.JTextField txtTagNameSearch;
+
private javax.swing.JTextField txtTags;
+
// End of variables declaration//GEN-END:variables
/**
* Process a tag search and build the tag result panels based on the given search text
+ *
* @param searchText
*/
private void searchTagsAndBuildResultEntries(final String searchText) {
@@ -2243,7 +2333,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
+ FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
+ irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
TagQuerySearchResult result = freeTaggingService.searchUsingFreeTagString(searchTerms);
pnlTagResultsInner.removeAll();
pnlTagResultsInner.validate();
@@ -2252,16 +2343,19 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
ColorHelper colorHelper = new ColorHelper();
log.info("doing tag query on {}, build panels based on result");
- //FIXME: this is a bit of a shim for duplicates, i need to look at findWhere() in jargon core to determine whether a distinct option is needed, for now, filter
+ // FIXME: this is a bit of a shim for duplicates, i need to look at findWhere() in jargon core to
+ // determine whether a distinct option is needed, for now, filter
String lastEntry = "";
String thisEntry = "";
- for (CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry : result.getQueryResultEntries()) {
+ for (CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry : result
+ .getQueryResultEntries()) {
if (collectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
thisEntry = collectionAndDataObjectListingEntry.getPathOrName();
} else {
- thisEntry = collectionAndDataObjectListingEntry.getParentPath() + "/" + collectionAndDataObjectListingEntry.getPathOrName();
+ thisEntry = collectionAndDataObjectListingEntry.getParentPath() + "/"
+ + collectionAndDataObjectListingEntry.getPathOrName();
}
if (thisEntry.equals(lastEntry)) {
@@ -2270,8 +2364,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
lastEntry = thisEntry;
}
- DefaultFileRepresentationPanel fileRepresentationPanel =
- new DefaultFileRepresentationPanel(collectionAndDataObjectListingEntry, idropGui, colorHelper.getNextColor());
+ DefaultFileRepresentationPanel fileRepresentationPanel = new DefaultFileRepresentationPanel(
+ collectionAndDataObjectListingEntry, idropGui, colorHelper.getNextColor());
pnlTagResultsInner.add(fileRepresentationPanel);
}
@@ -2311,8 +2405,12 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(irodsAccount);
- IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(collectionAndDataObjectListAndSearchAO.searchCollectionsAndDataObjectsBasedOnName(searchTerms));
+ CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = irodsFileSystem
+ .getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(
+ iDropCore.getIrodsAccount());
+ IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(
+ collectionAndDataObjectListAndSearchAO
+ .searchCollectionsAndDataObjectsBasedOnName(searchTerms));
tableSearchResults.setModel(irodsSearchTableModel);
tabIrodsViews.setSelectedComponent(pnlTabSearch);
} catch (Exception e) {
@@ -2342,9 +2440,11 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
+ FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
+ irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
TagQuerySearchResult result = freeTaggingService.searchUsingFreeTagString(searchTerms);
- IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(result.getQueryResultEntries());
+ IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(result
+ .getQueryResultEntries());
tableSearchResults.setModel(irodsSearchTableModel);
tabIrodsViews.setSelectedComponent(pnlTabSearch);
} catch (Exception e) {
@@ -2376,4 +2476,13 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
}
}
+
+ public IDROPCore getiDropCore() {
+ return iDropCore;
+ }
+
+ public void setiDropCore(IDROPCore iDropCore) {
+ this.iDropCore = iDropCore;
+ }
+
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java
index 2e21326..b9cc4ce 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java
@@ -1,4 +1,3 @@
-
package org.irods.jargon.idrop.desktop.systraygui.services;
import org.irods.jargon.idrop.desktop.systraygui.iDrop;
@@ -6,19 +5,18 @@ import org.irods.jargon.transferengine.TransferManager;
/**
* Manager of icons for the system gui based on the status.
+ *
* @author Mike Conway - DICE (www.irods.org)
*/
public class IconManager {
private TransferManager.ErrorStatus errorStatus = null;
+
private TransferManager.RunningStatus runningStatus = null;
- private final iDrop idropGui;
- public static IconManager instance(final iDrop idropClient) {
- return new IconManager(idropClient);
- }
+ private final iDrop idropGui;
- private IconManager(final iDrop idropClient) {
+ public IconManager(final iDrop idropClient) {
this.idropGui = idropClient;
}
@@ -35,17 +33,17 @@ public class IconManager {
private void updateIcon() {
String iconFile = "";
if (runningStatus == TransferManager.RunningStatus.PAUSED) {
- iconFile="images/media-playback-pause-3.png";
- } else if (errorStatus == TransferManager.ErrorStatus.ERROR) {
+ iconFile = "images/media-playback-pause-3.png";
+ } else if (errorStatus == TransferManager.ErrorStatus.ERROR) {
iconFile = "images/dialog-error-3.png";
} else if (errorStatus == TransferManager.ErrorStatus.WARNING) {
iconFile = "images/dialog-warning.png";
- } else if(runningStatus == TransferManager.RunningStatus.IDLE) {
+ } else if (runningStatus == TransferManager.RunningStatus.IDLE) {
iconFile = "images/dialog-ok-2.png";
- } else if(runningStatus == TransferManager.RunningStatus.PROCESSING) {
+ } else if (runningStatus == TransferManager.RunningStatus.PROCESSING) {
iconFile = "images/system-run-5.png";
} else {
- iconFile = "images/dialog-ok-2.png";
+ iconFile = "images/dialog-ok-2.png";
}
idropGui.updateIcon(iconFile);
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java
index 251d939..33ab4da 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java
@@ -3,6 +3,7 @@ package org.irods.jargon.idrop.desktop.systraygui.services;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
@@ -15,16 +16,18 @@ import org.slf4j.LoggerFactory;
public class QueueSchedulerTimerTask extends TimerTask {
private final TransferManager transferManager;
+
private final iDrop idropGui;
+
public final static long EVERY_10_MINUTES = 1000 * 60 * 10;
+
public final static long EVERY_30_SECONDS = 1000 * 30;
- public static org.slf4j.Logger log = LoggerFactory.getLogger(QueueSchedulerTimerTask.class);
- public static final QueueSchedulerTimerTask instance(final TransferManager transferManager, final iDrop idropGui) throws IdropException {
- return new QueueSchedulerTimerTask(transferManager, idropGui);
- }
+ private final org.slf4j.Logger log = LoggerFactory.getLogger(QueueSchedulerTimerTask.class);
+
+ public QueueSchedulerTimerTask(TransferManager transferManager, iDrop idropGui) throws IdropException {
+ super();
- private QueueSchedulerTimerTask(final TransferManager transferManager, final iDrop idropGui) throws IdropException {
if (transferManager == null) {
throw new IdropException("null transfer manager");
}
@@ -56,6 +59,5 @@ public class QueueSchedulerTimerTask extends TimerTask {
return;
}
-
}
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
index 88da458..b3c2e00 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
@@ -9,6 +9,7 @@ import org.irods.jargon.idrop.exceptions.IdropException;
/**
* Access data about the configuration of Idrop
+ *
* @author Mike Conway - DICE (www.irods.org)
*/
public class IdropConfig {
@@ -19,17 +20,14 @@ public class IdropConfig {
return idropProperties;
}
- public static IdropConfig instance() throws IdropException {
- return new IdropConfig();
- }
-
- private IdropConfig() throws IdropException {
+ public IdropConfig() throws IdropException {
IdropPropertiesHelper idropPropertiesHelper = new IdropPropertiesHelper();
this.idropProperties = idropPropertiesHelper.loadIdropProperties();
}
/**
* Does iDrop need to display policy-aware features?
+ *
* @return <code>boolean</code> that will be <code>true</code> if policy features are displayed.
*/
public boolean isPolicyAware() {
@@ -45,7 +43,8 @@ public class IdropConfig {
}
/**
- * Does iDrop need to display advanced options? Otherwise, a simpler client is presented
+ * Does iDrop need to display advanced options? Otherwise, a simpler client is presented
+ *
* @return <code>boolean</code> that will be <code>true</code> if policy features are displayed.
*/
public boolean isAdvancedView() {
@@ -72,6 +71,7 @@ public class IdropConfig {
/**
* Should iDrop display a preset login limited to a user's home directory?
+ *
* @return
*/
public boolean isLoginPreset() {
@@ -87,11 +87,13 @@ public class IdropConfig {
/**
* Should successful transfers be logged to the internal database?
+ *
* @return
*/
public boolean isLogSuccessfulTransfers() {
boolean logSuccessful = false;
- String logSuccessfulTransfers = idropProperties.getProperty(IdropPropertiesHelper.TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES);
+ String logSuccessfulTransfers = idropProperties
+ .getProperty(IdropPropertiesHelper.TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES);
if (logSuccessfulTransfers != null && logSuccessfulTransfers.equals("true")) {
logSuccessful = true;
@@ -101,7 +103,9 @@ public class IdropConfig {
}
/**
- * Should I have a rolling log in the user dir? Will return null of no logging desired, otherwise, will return a log level
+ * Should I have a rolling log in the user dir? Will return null of no logging desired, otherwise, will return a log
+ * level
+ *
* @return
*/
public String getLogLevelForRollingLog() {
@@ -142,7 +146,7 @@ public class IdropConfig {
rfa.setMaximumFileSize(1000000);
rootLogger.addAppender(rfa);
} catch (IOException e) {
- // e.printStackTrace();
+ // e.printStackTrace();
}
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java
index e08ce78..d0a496b 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java
@@ -1,16 +1,23 @@
package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
import java.io.File;
+import java.util.Collections;
+import java.util.Comparator;
+
import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.MutableTreeNode;
+
import org.slf4j.LoggerFactory;
/**
* (New) tree node for local file tree
+ *
* @author Mike Conway - DICE (www.irods.org)
*/
public class LocalFileNode extends DefaultMutableTreeNode {
private boolean cached = false;
+
public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalFileNode.class);
public LocalFileNode(final File file) {
@@ -44,6 +51,22 @@ public class LocalFileNode extends DefaultMutableTreeNode {
}
+ @Override
+ public void insert(MutableTreeNode arg0, int arg1) {
+ super.insert(arg0, arg1);
+ Collections.sort(this.children, nodeComparator);
+ }
+
+ protected static Comparator nodeComparator = new Comparator() {
+ public int compare(Object o1, Object o2) {
+ return o1.toString().compareToIgnoreCase(o2.toString());
+ }
+
+ public boolean equals(Object obj) {
+ return false;
+ }
+ };
+
public void forceReloadOfChildrenOfThisNode() {
cached = false;
this.removeAllChildren();
@@ -74,13 +97,11 @@ public class LocalFileNode extends DefaultMutableTreeNode {
return false;
}
-
LocalFileNode comparableAsNode = (LocalFileNode) obj;
File thisFile = (File) getUserObject();
File thatFile = (File) comparableAsNode.getUserObject();
-
return thisFile.getAbsolutePath().equals(thatFile.getAbsolutePath());
}
}
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/images/iDrop.png b/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/images/iDrop.png
new file mode 100644
index 0000000..d5aa3c6
--- /dev/null
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/images/iDrop.png
Binary files differ
diff --git a/pom.xml b/pom.xml
index 561cc18..60159f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.irods</groupId>
- <artifactId>irods-idrop</artifactId>
+ <artifactId>iDrop</artifactId>
<packaging>pom</packaging>
<version>0.9.1-SNAPSHOT</version>
<name>iRODS iDrop</name>
@@ -19,9 +19,8 @@
<url>https://code.renci.org/gf/project/irodsidrop/tracker/</url>
</issueManagement>
<scm>
- <connection>scm:git:ssh://anonymous@code.renci.org/gitroot/irodsidrop</connection>
- <developerConnection>scm:git:ssh://developername@code.renci.org/gitroot/irodsidrop</developerConnection>
- <url>scm:git:ssh://developername@code.renci.org/gitroot/irodsidrop</url>
+ <connection>scm:git:ssh://developername@code.renci.org/gitroot/irodsidrop</connection>
+ <developerConnection>scm:git:ssh://${user.name}@code.renci.org/gitroot/irodsidrop</developerConnection>
</scm>
<organization>
<name>DICE</name>
@@ -84,7 +83,7 @@
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
- <repository>
+ <repository>
<id>renci.snapshot.repository</id>
<name>renci.snapshot.repository</name>
<url>http://ci-dev.renci.org/nexus/content/repositories/snapshots</url>
@@ -163,18 +162,18 @@
</reporting>
<dependencyManagement>
<dependencies>
- <dependency>
+ <dependency>
<groupId>org.irods.jargon</groupId>
<artifactId>jargon-core</artifactId>
<version>${jargon.version}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.irods.jargon</groupId>
<artifactId>jargon-test</artifactId>
<version>${jargon.version}</version>
</dependency>
<dependency>
- <groupId>org.irods</groupId>
+ <groupId>org.irods.jargon</groupId>
<artifactId>jargon-transfer-engine</artifactId>
<version>${jargon.version}</version>
</dependency>
@@ -183,12 +182,12 @@
<artifactId>jargon-data-utils</artifactId>
<version>${jargon.version}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.irods.jargon</groupId>
<artifactId>jargon-user-tagging</artifactId>
<version>${jargon.version}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.irods.jargon</groupId>
<artifactId>jargon-security</artifactId>
<version>${jargon.version}</version>
@@ -317,23 +316,23 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.irods.jargon</groupId>
- <artifactId>jargon-core</artifactId>
- <scope>compile</scope>
+ <groupId>org.irods.jargon</groupId>
+ <artifactId>jargon-core</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
- <groupId>org.irods.jargon</groupId>
- <artifactId>jargon-test</artifactId>
- <scope>compile</scope>
+ <groupId>org.irods.jargon</groupId>
+ <artifactId>jargon-test</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
- <groupId>org.irods.jargon</groupId>
- <artifactId>jargon-user-tagging</artifactId>
- <scope>compile</scope>
+ <groupId>org.irods.jargon</groupId>
+ <artifactId>jargon-user-tagging</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
- <groupId>org.irods</groupId>
- <artifactId>jargon-transfer-engine</artifactId>
+ <groupId>org.irods.jargon</groupId>
+ <artifactId>jargon-transfer-engine</artifactId>
</dependency>
</dependencies>
<build>