summaryrefslogtreecommitdiffstats
path: root/idrop-lite
diff options
context:
space:
mode:
authorMike Conway <michael.c.conway@gmail.com>2011-10-10 13:20:10 (GMT)
committer Mike Conway <michael.c.conway@gmail.com>2011-10-10 13:20:10 (GMT)
commitc94cd46c237ffaf7afd1eb0783a084ac11d42272 (patch)
tree29459dcde452095decc7aaa178f32b8762c65408 /idrop-lite
parent1e569dc33d09ab8ae95bbbc2e236c1b3391e6904 (diff)
parentd3094a21b8b1b8769cafa99b098a9c728fa8805f (diff)
downloadQCG-Data-c94cd46c237ffaf7afd1eb0783a084ac11d42272.zip
QCG-Data-c94cd46c237ffaf7afd1eb0783a084ac11d42272.tar.gz
QCG-Data-c94cd46c237ffaf7afd1eb0783a084ac11d42272.tar.bz2
Merge branch 'idrop-lite'
Diffstat (limited to 'idrop-lite')
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java16
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java4
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java2
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java53
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableCancelRenderer.java23
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java4
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form316
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java986
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteCore.java12
-rw-r--r--idrop-lite/src/main/resources/cancel.gifbin0 -> 342 bytes
-rw-r--r--idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties17
11 files changed, 968 insertions, 465 deletions
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java
index 1660f48..781a66c 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java
@@ -15,12 +15,12 @@ public class GetTransferRunner implements Runnable {
private final List<File> sourceFiles;
private final String targetIrodsFileAbsolutePath;
private final iDropLiteApplet idropGui;
-// private final TransferControlBlock transferControlBlock;
+ private final TransferControlBlock transferControlBlock;
public GetTransferRunner(final iDropLiteApplet gui,
final String targetPath,
- final List<File> files)
- //final TransferControlBlock transferControlBlock)
+ final List<File> files,
+ final TransferControlBlock transferControlBlock)
throws JargonException {
if (files == null) {
@@ -35,14 +35,14 @@ public class GetTransferRunner implements Runnable {
throw new JargonException("null idrop gui");
}
-// if (transferControlBlock == null) {
-// throw new JargonException("null transferControlBlock");
-// }
+ if (transferControlBlock == null) {
+ throw new JargonException("null transferControlBlock");
+ }
this.targetIrodsFileAbsolutePath = targetPath;
this.sourceFiles = files;
this.idropGui = gui;
-// this.transferControlBlock = transferControlBlock;
+ this.transferControlBlock = transferControlBlock;
}
@@ -57,7 +57,7 @@ public class GetTransferRunner implements Runnable {
try {
DataTransferOperations dto = idropGui.getiDropCore().getIRODSAccessObjectFactory().getDataTransferOperations(
idropGui.getIrodsAccount());
- dto.getOperation(transferFile.getAbsolutePath(), targetIrodsFileAbsolutePath, idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui, null);
+ dto.getOperation(transferFile.getAbsolutePath(), targetIrodsFileAbsolutePath, idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui, transferControlBlock);
} catch (JargonException ex) {
java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java
index 078cd0a..f159533 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java
@@ -290,7 +290,7 @@ public class IRODSTreeTransferHandler extends TransferHandler {
// process the drop as a put
try {
currentTransferRunner = new PutTransferRunner(idropGui, targetIrodsFileAbsolutePath,
- sourceFiles);
+ sourceFiles, idropGui.getiDropCore().getTransferControlBlock());
final Thread transferThread = new Thread(currentTransferRunner);
log.info("launching transfer thread");
transferThread.start();
@@ -412,7 +412,7 @@ public class IRODSTreeTransferHandler extends TransferHandler {
// process the drop as a put
try {
currentTransferRunner = new PutTransferRunner(idropGui, targetIrodsFileAbsolutePath,
- sourceFiles);
+ sourceFiles, idropGui.getiDropCore().getTransferControlBlock());
final Thread transferThread = new Thread(currentTransferRunner);
log.info("launching transfer thread");
transferThread.start();
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java
index 73a1048..2c3f34f 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java
@@ -192,7 +192,7 @@ public class LocalTreeTransferHandler extends TransferHandler {
// process the drop as a get
try {
currentTransferRunner = new GetTransferRunner(idropGui, tempTargetLocalFileAbsolutePath,
- sourceFiles);
+ sourceFiles, idropGui.getiDropCore().getTransferControlBlock());
final Thread transferThread = new Thread(currentTransferRunner);
log.info("launching transfer thread");
transferThread.start();
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java
index be9cdbd..8224ec4 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java
@@ -10,20 +10,20 @@ import org.slf4j.LoggerFactory;
public class PutTransferRunner implements Runnable {
- public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTreeTransferHandler.class);
- private final List<File> sourceFiles;
- private final String targetIrodsFileAbsolutePath;
- private final iDropLiteApplet idropGui;
-// private final TransferControlBlock transferControlBlock;
-
- public PutTransferRunner(final iDropLiteApplet gui,
- final String targetPath,
- final List<File> files)
- //final TransferControlBlock transferControlBlock)
- throws JargonException {
-
- if (files == null) {
- throw new JargonException("null file list");
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTreeTransferHandler.class);
+ private final List<File> sourceFiles;
+ private final String targetIrodsFileAbsolutePath;
+ private final iDropLiteApplet idropGui;
+ private final TransferControlBlock transferControlBlock;
+
+ public PutTransferRunner(final iDropLiteApplet gui,
+ final String targetPath,
+ final List<File> files,
+ final TransferControlBlock transferControlBlock)
+ throws JargonException {
+
+ if (files == null) {
+ throw new JargonException("null file list");
}
if (targetPath == null) {
@@ -33,30 +33,31 @@ public class PutTransferRunner implements Runnable {
if (gui == null) {
throw new JargonException("null idrop gui");
}
-//
-// if (transferControlBlock == null) {
-// throw new JargonException("null transferControlBlock");
-// }
-//
+
+ if (transferControlBlock == null) {
+ throw new JargonException("null transferControlBlock");
+ }
+
this.targetIrodsFileAbsolutePath = targetPath;
this.sourceFiles = files;
this.idropGui = gui;
-// this.transferControlBlock = transferControlBlock;
+ this.transferControlBlock = transferControlBlock;
+
+ }
- }
- @Override
- public void run() {
- for (File transferFile : sourceFiles) {
+ @Override
+ public void run() {
+ for (File transferFile : sourceFiles) {
log.info("process a put from source: {}", transferFile.getAbsolutePath());
String localSourceAbsolutePath = transferFile.getAbsolutePath();
String sourceResource = idropGui.getIrodsAccount().getDefaultStorageResource();
log.info("initiating put transfer");
try {
- idropGui.getiDropCore().getTransferManager().putOperation(localSourceAbsolutePath,
- targetIrodsFileAbsolutePath, sourceResource, idropGui, null);
+ idropGui.getiDropCore().getTransferManager().putOperation(localSourceAbsolutePath,
+ targetIrodsFileAbsolutePath, sourceResource, idropGui, transferControlBlock);
} catch (JargonException ex) {
java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableCancelRenderer.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableCancelRenderer.java
new file mode 100644
index 0000000..cf6ddb3
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableCancelRenderer.java
@@ -0,0 +1,23 @@
+package org.irods.jargon.idrop.lite;
+
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.table.DefaultTableCellRenderer;
+
+public class UploadTableCancelRenderer extends DefaultTableCellRenderer {
+
+ ImageIcon cancelIcon = null;
+
+ public UploadTableCancelRenderer(ImageIcon image) {
+ this.cancelIcon = image;
+ setHorizontalAlignment(JLabel.CENTER);
+ }
+ //public CancelRenderer() { super(); }
+
+ public void setValue(Object value) {
+ if(cancelIcon != null) {
+ setIcon(cancelIcon);
+ }
+ }
+
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java
index 7dc085a..0ea31c8 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java
@@ -143,7 +143,7 @@ public class UploadTableTransferHandler extends TransferHandler {
String localSourceAbsolutePath = transferFile.getAbsolutePath();
Object [] rowData = new Object[2];
rowData[0] = localSourceAbsolutePath;
- rowData[1] = Boolean.TRUE;
+ //rowData[1] = Boolean.TRUE;
tm.addRow(rowData);
}
}
@@ -179,7 +179,7 @@ public class UploadTableTransferHandler extends TransferHandler {
Object [] rowData = new Object[2];
rowData[0] = localSourceAbsolutePath;
- rowData[1] = Boolean.TRUE;
+ //rowData[1] = Boolean.TRUE;
tm.addRow(rowData);
}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
index e6d15af..ac490aa 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
@@ -720,6 +720,119 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlTitlleBar">
+ <Properties>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[700, 24]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="North"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel5">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[150, 27]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[285, 20]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="2.0" weightY="0.2"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel3">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Lucida Grande" size="14" style="0"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.jLabel3.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[150, 17]"/>
+ </Property>
+ </Properties>
+ <AccessibilityProperties>
+ <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.jLabel3.AccessibleContext.accessibleName_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </AccessibilityProperties>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="jPanel7">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 0]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 24]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.1" weightY="0.2"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="84" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="24" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Container class="javax.swing.JPanel" name="jPanel6">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[252, 27]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[310, 17]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="1.6" weightY="0.2"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel4">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Lucida Grande" size="14" style="0"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.jLabel4.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[200, 17]"/>
+ </Property>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
<Container class="javax.swing.JPanel" name="pnlUploadTrees">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@@ -740,7 +853,7 @@
<Container class="javax.swing.JPanel" name="pnlUploadLocalTree">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[0, 0]"/>
+ <Dimension value="[150, 0]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[285, 380]"/>
@@ -748,7 +861,7 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.4" weightY="0.2"/>
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="2.0" weightY="0.2"/>
</Constraint>
</Constraints>
@@ -867,7 +980,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
- <EmptySpace min="0" pref="289" max="32767" attributes="0"/>
+ <EmptySpace min="0" pref="242" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@@ -903,43 +1016,146 @@
</Container>
<Container class="javax.swing.JPanel" name="pnlUploadCenterTools">
<Properties>
+ <Property name="autoscrolls" type="boolean" value="true"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[65, 32767]"/>
+ <Dimension value="[80, 32767]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[30, 100]"/>
+ <Dimension value="[80, 100]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[50, 380]"/>
+ <Dimension value="[80, 380]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="3" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.2"/>
+ <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.1" weightY="0.2"/>
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
- <Component class="javax.swing.JButton" name="btnUploadMove">
+ <Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnUploadMove.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 100]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="11" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="80" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="100" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Container class="javax.swing.JPanel" name="jPanel3">
+ <Properties>
+ <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[32767, 80]"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 80]"/>
</Property>
- <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
- <Insets value="[0, 0, 0, 0]"/>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 80]"/>
</Property>
</Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadMoveActionPerformed"/>
- </Events>
<Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="Center"/>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="11" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
- </Component>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
+ <Property name="columns" type="int" value="1"/>
+ <Property name="rows" type="int" value="2"/>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnUploadMove">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnUploadMove.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
+ <Insets value="[0, 0, 0, 0]"/>
+ </Property>
+ <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[75, 50]"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[75, 50]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 40]"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadMoveActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnUploadCancel">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Lucida Grande" size="10" style="0"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnUploadCancel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[50, 40]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 40]"/>
+ </Property>
+ <Property name="requestFocusEnabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadCancelActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="jPanel4">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 0]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 100]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="11" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="80" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="100" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnlUploadTable">
@@ -950,7 +1166,7 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.4" weightY="0.2"/>
+ <GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="1.6" weightY="0.2"/>
</Constraint>
</Constraints>
@@ -978,8 +1194,8 @@
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="3" rowCount="0">
<Column editable="false" title="File Name" type="java.lang.String"/>
- <Column editable="true" title="Import?" type="java.lang.Boolean"/>
- <Column editable="true" title="Upload Status" type="java.lang.Object"/>
+ <Column editable="false" title="Upload Status" type="java.lang.Object"/>
+ <Column editable="false" title="Cancel/Remove" type="java.lang.Boolean"/>
</Table>
</Property>
<Property name="bounds" type="java.awt.Rectangle" editor="org.netbeans.beaninfo.editors.RectangleEditor">
@@ -995,7 +1211,7 @@
<Dimension value="[285, 380]"/>
</Property>
<Property name="rowMargin" type="int" value="2"/>
- <Property name="showGrid" type="boolean" value="true"/>
+ <Property name="showGrid" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
@@ -1102,16 +1318,40 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel1">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[215, 0]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[275, 40]"/>
+ </Property>
+ <Property name="requestFocusEnabled" type="boolean" value="false"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="2.2" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
+ <Property name="columns" type="int" value="1"/>
+ <Property name="rows" type="int" value="2"/>
+ </Layout>
+ </Container>
<Container class="javax.swing.JPanel" name="pnlUploadToolStatus">
<Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[175, 32]"/>
+ </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[500, 34]"/>
+ <Dimension value="[175, 34]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="18" weightX="140.0" weightY="0.0"/>
+ <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.7" weightY="0.0"/>
</Constraint>
</Constraints>
@@ -1149,28 +1389,22 @@
<ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnUploadBeginImport.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadBeginImportActionPerformed"/>
- </Events>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="50.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
- </Component>
- <Component class="javax.swing.JButton" name="btnUploadCancel">
- <Properties>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnUploadCancel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[115, 29]"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[115, 29]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[115, 29]"/>
</Property>
</Properties>
<Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadCancelActionPerformed"/>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadBeginImportActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.6" weightY="0.0"/>
+ <GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.5" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
index 6bef58e..787542c 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
@@ -21,8 +21,8 @@ import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.DropMode;
-import javax.swing.JCheckBox;
-import javax.swing.JList;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
@@ -37,10 +37,11 @@ import org.irods.jargon.core.pub.domain.DataObject;
import org.irods.jargon.core.pub.domain.Collection;
import org.irods.jargon.core.pub.io.IRODSFileFactory;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.core.transfer.TransferControlBlock;
+import org.irods.jargon.core.transfer.DefaultTransferControlBlock;
import org.irods.jargon.core.transfer.TransferStatus;
import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.packinstr.TransferOptions;
import org.irods.jargon.core.pub.DataTransferOperations;
import org.irods.jargon.core.pub.IRODSFileSystem;
import org.irods.jargon.core.pub.io.IRODSFile;
@@ -81,18 +82,18 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private LocalFileSystemModel localUploadFileModel = null;
private Boolean transferInProgress = false;
private String currentUploadFile = null;
+ private ImageIcon cancelIcon;
/** Initializes the applet NewJApplet */
public void init() {
- this.applet = this;
+ this.applet = this;
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
-
public void run() {
- getAppletParams();
- if (doStartup()) {
- initComponents();
- doPostInitWork();
+ getAppletParams();
+ if(doStartup()) {
+ initComponents();
+ doPostInitWork();
}
}
});
@@ -208,7 +209,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
showMessageFromOperation("Unsupported Login Mode");
return false;
- }
+ }
try {
@@ -246,16 +247,17 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
return true;
}
+
protected boolean doStartup() {
log.info("initiating startup sequence...");
log.info("creating irods file system instance...");
try {
- irodsFileSystem = IRODSFileSystem.instance();
- } catch (JargonException ex) {
- Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
- }
+ irodsFileSystem = IRODSFileSystem.instance();
+ } catch (JargonException ex) {
+ Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
+ }
log.info("creating temporary irods account...");
this.irodsAccount = new IRODSAccount(host, port, user, tempPswd, absPath, zone, defaultStorageResource);
@@ -263,8 +265,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
log.info("creating idropCore...");
iDropCore = new iDropLiteCore();
- if (!processLogin()) {
- return false;
+ if(!processLogin()) {
+ return false;
}
buildTargetTree();
@@ -273,18 +275,26 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
try {
- DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory().getDataTransferOperations(irodsAccount);
- iDropCore.setTransferManager(dataTransferOperations);
- } catch (JargonException ex) {
- Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
+ DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory()
+ .getDataTransferOperations(irodsAccount);
+ iDropCore.setTransferManager(dataTransferOperations);
}
+ catch(JargonException ex) {
+ Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ try {
+ iDropCore.setTransferControlBlock(DefaultTransferControlBlock.instance());
+ } catch (JargonException ex) {
+ Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
+ }
return true;
}
-
+
private void doPostInitWork() {
- populateUploadDestination();
- setupUploadTable();
+ populateUploadDestination();
+ setupUploadTable();
}
public void buildTargetTree() {
@@ -300,6 +310,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
log.info("using root path, no login preset");
root.setPathOrName("/");
+
log.info("building new iRODS tree");
try {
if (irodsTree == null) {
@@ -335,7 +346,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
//irodsTree.getSelectionModel().setSelectionInterval(10, 12);
Rectangle rect = irodsTree.getPathBounds(selectedPath);
scrIrodsTreeView.getViewport().scrollRectToVisible(rect);
- } catch (IdropException ex) {
+ }
+ catch(IdropException ex) {
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
}
/*
@@ -351,7 +363,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}
});
}
-
+
+
// NEED TO REFACTOR ALL OF THE FOLLOWING DUPLICATION!!!!!!!!
private void setUpLocalFileSelectTree() {
@@ -401,7 +414,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
});
}
-
+
private void setUpUploadLocalFileSelectTree() {
/*
@@ -450,7 +463,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
});
}
-
+
private void initializeLocalFileTreeModelWhenDriveIsSelected(
final Object selectedDrive) {
if (selectedDrive == null) {
@@ -500,7 +513,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
scrollLocalDrives.setVisible(true);
}
}
-
+
private void initializeUploadLocalFileTreeModelWhenDriveIsSelected(
final Object selectedDrive) {
if (selectedDrive == null) {
@@ -550,29 +563,42 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
scrollUploadLocalDrives.setVisible(true);
}
}
-
+
private void populateUploadDestination() {
- if ((uploadDest != null) && (uploadDest.length() > 0)) {
- txtIRODSUploadDest.setText(uploadDest);
- btnUploadBeginImport.setEnabled(true);
- }
+ if((uploadDest != null) && (uploadDest.length() > 0)) {
+ txtIRODSUploadDest.setText(uploadDest);
+ btnUploadBeginImport.setEnabled(true);
+ }
}
-
+
private void setupUploadTable() {
- //set FillsViewportHeight so user can drop onto an empty table
- tblUploadTable.setFillsViewportHeight(true);
-
- tblUploadTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- tblUploadTable.setDropMode(DropMode.INSERT_ROWS);
- tblUploadTable.setDragEnabled(true);
- UploadTableTransferHandler tth = new UploadTableTransferHandler();
- tth.setGUI(this);
- tblUploadTable.getModel().addTableModelListener(applet);
- tblUploadTable.setTransferHandler(tth);
-
- // add rendered for progress bars in third column
- tblUploadTable.getColumnModel().getColumn(2).setCellRenderer(new UploadTableProgressBar());
-
+
+ // load table cancel icon
+ java.net.URL imgURL = getClass().getResource("cancel.gif");
+ if (imgURL != null) {
+ cancelIcon = new ImageIcon(imgURL, "image used to denote cancel or remove table entry");
+ }
+ else {
+ log.error("cannot find image: cancel.gif for Upload Table");
+ }
+ //set FillsViewportHeight so user can drop onto an empty table
+ tblUploadTable.setFillsViewportHeight(true);
+ tblUploadTable.setShowGrid(true);
+ tblUploadTable.setShowVerticalLines(false);
+ tblUploadTable.getColumnModel().getColumn(2).setPreferredWidth(6);
+
+ tblUploadTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+ tblUploadTable.setDropMode(DropMode.INSERT_ROWS);
+ tblUploadTable.setDragEnabled(true);
+ UploadTableTransferHandler tth = new UploadTableTransferHandler();
+ tth.setGUI(this);
+ tblUploadTable.getModel().addTableModelListener(applet);
+ tblUploadTable.setTransferHandler(tth);
+
+ // add rendered for progress bars in second column
+ tblUploadTable.getColumnModel().getColumn(1).setCellRenderer(new UploadTableProgressBar());
+ tblUploadTable.getColumnModel().getColumn(2).setCellRenderer(new UploadTableCancelRenderer(cancelIcon));
+
}
public IRODSAccount getIrodsAccount() {
@@ -581,6 +607,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}
}
+
public void showIdropException(Exception idropException) {
JOptionPane.showMessageDialog(this, idropException.getMessage(), "iDROP Exception", JOptionPane.WARNING_MESSAGE);
}
@@ -599,197 +626,194 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}
@Override
- public void statusCallback(final TransferStatus ts) {
- log.info("transfer status callback to iDropLiteApplet:{}", ts);
-
- if (true) {
- java.awt.EventQueue.invokeLater(new Runnable() {
+ public void statusCallback(final TransferStatus ts) {
+ log.info("transfer status callback to iDropLiteApplet:{}", ts);
- @Override
- public void run() {
- log.info("in statusCallback thread");
+ java.awt.EventQueue.invokeLater(new Runnable() {
- //String file = ts.getSourceFileAbsolutePath();
- int tableRow = -1;
- if (currentUploadFile != null) {
- tableRow = getUploadTableProgressRow(currentUploadFile);
+ @Override
+ public void run() {
+ log.info("in statusCallback thread");
+
+ //String file = ts.getSourceFileAbsolutePath();
+ int tableRow = -1;
+ if(currentUploadFile != null) {
+ tableRow = getUploadTableProgressRow(currentUploadFile);
+ }
+
+ if (ts.isIntraFileStatusReport()) {
+
+ // intra file reports update the progress bar
+ lblTransferByteCounts.setText("Current File (kb):"
+ + (ts.getBytesTransfered() / 1024) + " / "
+ + (ts.getTotalSize() / 1024));
+ progressIntraFile.setMinimum(0);
+ progressIntraFile.setMaximum((int) ts.getTotalSize());
+ progressIntraFile.setValue((int) ts.getBytesTransfered());
+
+ // if uploading from mode 2 table
+ if((tableRow >= 0) && (ts.getTotalSize() > 0)) {
+ float bt = ts.getBytesTransfered() * 100;
+ float tot = ts.getTotalSize();
+ float percentDone = bt/tot;
+ tblUploadTable.getModel().setValueAt((int)percentDone, tableRow, 1);
}
- if (ts.isIntraFileStatusReport()) {
-
- // intra file reports update the progress bar
- lblTransferByteCounts.setText("Current File (kb):"
- + (ts.getBytesTransfered() / 1024) + " / "
- + (ts.getTotalSize() / 1024));
- progressIntraFile.setMinimum(0);
- progressIntraFile.setMaximum((int) ts.getTotalSize());
- progressIntraFile.setValue((int) ts.getBytesTransfered());
-
- // if uploading from mode 2 table
- if ((tableRow >= 0) && (ts.getTotalSize() > 0)) {
- float bt = ts.getBytesTransfered() * 100;
- float tot = ts.getTotalSize();
- float percentDone = bt / tot;
- tblUploadTable.getModel().setValueAt((int) percentDone, tableRow, 2);
- }
-
- } else if (ts.getTransferState() == TransferStatus.TransferState.IN_PROGRESS_START_FILE) {
-
- // start of a file operation
- progressIntraFile.setMinimum(0);
- progressIntraFile.setMaximum((int) ts.getTotalSize());
- progressIntraFile.setValue(0);
- lblCurrentFile.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
-
- //currentUploadFile = ts.getSourceFileAbsolutePath();
- if (currentUploadFile != null) {
- tableRow = getUploadTableProgressRow(currentUploadFile);
- }
- if ((tableRow >= 0)) {
- tblUploadTable.getModel().setValueAt(0, tableRow, 2);
- }
+ } else if (ts.getTransferState() == TransferStatus.TransferState.IN_PROGRESS_START_FILE) {
+
+ // start of a file operation
+ progressIntraFile.setMinimum(0);
+ progressIntraFile.setMaximum((int) ts.getTotalSize());
+ progressIntraFile.setValue(0);
+ lblCurrentFile.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
+
+ //currentUploadFile = ts.getSourceFileAbsolutePath();
+ if(currentUploadFile != null) {
+ tableRow = getUploadTableProgressRow(currentUploadFile);
+ }
+ if((tableRow >= 0)) {
+ tblUploadTable.getModel().setValueAt(0, tableRow, 1);
+ }
- } else if (ts.getTransferState() == TransferStatus.TransferState.IN_PROGRESS_COMPLETE_FILE) {
-
- progressIntraFile.setMinimum(0);
- progressIntraFile.setMaximum(10);
- progressIntraFile.setValue(10);
- lblTransferByteCounts.setText("Current File (kb):"
- + (ts.getTotalSize() / 1024) + " / "
- + (ts.getTotalSize() / 1024));
- transferStatusProgressBar.setMaximum(ts.getTotalFilesToTransfer());
- transferStatusProgressBar.setValue(ts.getTotalFilesTransferredSoFar());
- lblTransferFilesCounts.setText("Files: "
- + ts.getTotalFilesTransferredSoFar() + " / "
- + ts.getTotalFilesToTransfer());
-
- // if uploading from mode 2 table
- if ((tableRow >= 0) && (ts.getTotalSize() > 0)) {
- float bt = ts.getBytesTransfered() * 100;
- float tot = ts.getTotalSize();
- float percentDone = bt / tot;
- tblUploadTable.getModel().setValueAt((int) percentDone, tableRow, 2);
- }
+ } else if (ts.getTransferState() == TransferStatus.TransferState.IN_PROGRESS_COMPLETE_FILE) {
+
+ progressIntraFile.setMinimum(0);
+ progressIntraFile.setMaximum(10);
+ progressIntraFile.setValue(10);
+ lblTransferByteCounts.setText("Current File (kb):"
+ + (ts.getTotalSize() / 1024) + " / "
+ + (ts.getTotalSize() / 1024));
+ transferStatusProgressBar.setMaximum(ts.getTotalFilesToTransfer());
+ transferStatusProgressBar.setValue(ts.getTotalFilesTransferredSoFar());
+ lblTransferFilesCounts.setText("Files: "
+ + ts.getTotalFilesTransferredSoFar() + " / "
+ + ts.getTotalFilesToTransfer());
+
+ // if uploading from mode 2 table
+ if((tableRow >= 0) && (ts.getTotalSize() > 0)) {
+ float bt = ts.getBytesTransfered() * 100;
+ float tot = ts.getTotalSize();
+ float percentDone = bt/tot;
+ tblUploadTable.getModel().setValueAt((int)percentDone, tableRow, 1);
+ }
- } else {
+ } else {
- transferStatusProgressBar.setMaximum(ts.getTotalFilesToTransfer());
- transferStatusProgressBar.setValue(ts.getTotalFilesTransferredSoFar());
- lblTransferFilesCounts.setText("Files: "
- + ts.getTotalFilesTransferredSoFar() + " / "
- + ts.getTotalFilesToTransfer());
- lblTransferByteCounts.setText("Current File (kb):"
- + (ts.getBytesTransfered() / 1024) + " / "
- + (ts.getTotalSize() / 1024));
+ transferStatusProgressBar.setMaximum(ts.getTotalFilesToTransfer());
+ transferStatusProgressBar.setValue(ts.getTotalFilesTransferredSoFar());
+ lblTransferFilesCounts.setText("Files: "
+ + ts.getTotalFilesTransferredSoFar() + " / "
+ + ts.getTotalFilesToTransfer());
+ lblTransferByteCounts.setText("Current File (kb):"
+ + (ts.getBytesTransfered() / 1024) + " / "
+ + (ts.getTotalSize() / 1024));
- lblCurrentFile.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
- }
+ lblCurrentFile.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
}
- });
- }
+ }
+ });
}
- @Override
- public void overallStatusCallback(final TransferStatus ts) {
-
- final IRODSOutlineModel irodsTreeModel = (IRODSOutlineModel) irodsTree.getModel();
+ @Override
+ public void overallStatusCallback(final TransferStatus ts) {
+
+ final IRODSOutlineModel irodsTreeModel = (IRODSOutlineModel) irodsTree.getModel();
final iDropLiteApplet idropGui = this;
idropGui.setTransferInProgress(true);
- if (true) {
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run() {
+ java.awt.EventQueue.invokeLater(new Runnable() {
- int tableRow = -1;
- if (currentUploadFile != null) {
- tableRow = getUploadTableProgressRow(currentUploadFile);
+ @Override
+ public void run() {
+
+ int tableRow = -1;
+ if(currentUploadFile != null) {
+ tableRow = getUploadTableProgressRow(currentUploadFile);
+ }
+
+ /*
+ * Handle appropriate tree notifications, so some filtering to prevent notifications when for a different host/zone
+ */
+ if (ts.getTransferType() == TransferStatus.TransferType.SYNCH || ts.getTransferType() == TransferStatus.TransferType.REPLICATE) {
+ log.info("no need to notify tree for synch or replicate");
+ } else if (ts.getTransferType() == TransferStatus.TransferType.GET
+ && ts.getTransferState() == TransferStatus.TransferState.OVERALL_COMPLETION) {
+ try {
+ ((LocalFileSystemModel) idropGui.getFileTree().getModel()).notifyCompletionOfOperation(idropGui.getFileTree(), ts);
+
+ } catch (IdropException ex) {
+ log.error("error on tree notify after operation", ex);
+ throw new IdropRuntimeException("error processing overall status callback", ex);
}
-
- /*
- * Handle appropriate tree notifications, so some filtering to prevent notifications when for a different host/zone
- */
- if (ts.getTransferType() == TransferStatus.TransferType.SYNCH || ts.getTransferType() == TransferStatus.TransferType.REPLICATE) {
- log.info("no need to notify tree for synch or replicate");
- } else if (ts.getTransferType() == TransferStatus.TransferType.GET
- && ts.getTransferState() == TransferStatus.TransferState.OVERALL_COMPLETION) {
+ } else if (ts.getTransferType() == TransferStatus.TransferType.COPY || ts.getTransferType() == TransferStatus.TransferType.PUT) {
+ if (ts.getTransferZone().equals(
+ iDropCore.getIrodsAccount().getZone()) && ts.getTransferHost().equals(iDropCore.getIrodsAccount().getHost())) {
try {
- ((LocalFileSystemModel) idropGui.getFileTree().getModel()).notifyCompletionOfOperation(idropGui.getFileTree(), ts);
-
+ // should leave PUT, and COPY
+ irodsTreeModel.notifyCompletionOfOperation(irodsTree, ts);
} catch (IdropException ex) {
log.error("error on tree notify after operation", ex);
throw new IdropRuntimeException("error processing overall status callback", ex);
}
- } else if (ts.getTransferType() == TransferStatus.TransferType.COPY || ts.getTransferType() == TransferStatus.TransferType.PUT) {
- if (ts.getTransferZone().equals(
- iDropCore.getIrodsAccount().getZone()) && ts.getTransferHost().equals(iDropCore.getIrodsAccount().getHost())) {
- try {
- // should leave PUT, and COPY
- irodsTreeModel.notifyCompletionOfOperation(irodsTree, ts);
- } catch (IdropException ex) {
- log.error("error on tree notify after operation", ex);
- throw new IdropRuntimeException("error processing overall status callback", ex);
- }
- }
-
}
- /*
- * Handle progress bar and messages. These are cleared on overall initiation
- */
- if (ts.getTransferState() == TransferStatus.TransferState.OVERALL_INITIATION || ts.getTransferState() == TransferStatus.TransferState.SYNCH_INITIALIZATION) {
- clearProgressBar();
- // on initiation, clear and reset the status bar info
- lblTransferType.setText(ts.getTransferType().name());
- lblTransferFilesCounts.setText("Files: "
- + ts.getTotalFilesTransferredSoFar() + " / "
- + ts.getTotalFilesToTransfer());
- lblTransferByteCounts.setText("Bytes (kb):"
- + (ts.getBytesTransfered() / 1024) + " / "
- + (ts.getTotalSize() / 1024));
- lblCurrentFile.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
- transferStatusProgressBar.setMinimum(0);
- transferStatusProgressBar.setMaximum(ts.getTotalFilesToTransfer());
- transferStatusProgressBar.setValue(0);
-
- currentUploadFile = ts.getSourceFileAbsolutePath();
- enableUploadButtons(false);
- }
+ }
- if (ts.getTransferState() == TransferStatus.TransferState.OVERALL_COMPLETION) {
- if (tableRow >= 0) {
- tblUploadTable.getModel().setValueAt(false, tableRow, 1);
- }
- currentUploadFile = null;
- idropGui.setTransferInProgress(false);
- enableUploadButtons(true);
- }
+ /*
+ * Handle progress bar and messages. These are cleared on overall initiation
+ */
+ if (ts.getTransferState() == TransferStatus.TransferState.OVERALL_INITIATION || ts.getTransferState() == TransferStatus.TransferState.SYNCH_INITIALIZATION) {
+ clearProgressBar();
+ // on initiation, clear and reset the status bar info
+ lblTransferType.setText(ts.getTransferType().name());
+ lblTransferFilesCounts.setText("Files: "
+ + ts.getTotalFilesTransferredSoFar() + " / "
+ + ts.getTotalFilesToTransfer());
+ lblTransferByteCounts.setText("Bytes (kb):"
+ + (ts.getBytesTransfered() / 1024) + " / "
+ + (ts.getTotalSize() / 1024));
+ lblCurrentFile.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
+ transferStatusProgressBar.setMinimum(0);
+ transferStatusProgressBar.setMaximum(ts.getTotalFilesToTransfer());
+ transferStatusProgressBar.setValue(0);
+
+ currentUploadFile = ts.getSourceFileAbsolutePath();
+ enableUploadButtons(false);
+ }
+
+ if (ts.getTransferState() == TransferStatus.TransferState.OVERALL_COMPLETION) {
+ if(tableRow >= 0) {
+ //tblUploadTable.getModel().setValueAt(false, tableRow, 1);
+ }
+ currentUploadFile = null;
+ idropGui.setTransferInProgress(false);
+ enableUploadButtons(true);
+ }
- /*
- * Handle any text messages
- */
- if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_INITIALIZATION) {
- lblTransferStatusMessage.setText("Synchronization Initializing");
- } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_DIFF_GENERATION) {
- lblTransferStatusMessage.setText("Synchronization looking for updates");
- } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_DIFF_STEP) {
- lblTransferStatusMessage.setText("Synchronizing differences");
- } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_COMPLETION) {
- lblTransferStatusMessage.setText("Synchronization complete");
- } else if (ts.getTransferEnclosingType() == TransferStatus.TransferType.SYNCH) {
- lblTransferStatusMessage.setText("Transfer to synchronize local and iRODS");
- } else if (ts.getTransferState() == TransferStatus.TransferState.OVERALL_INITIATION) {
- // initiation not within a synch
- lblTransferStatusMessage.setText("Processing a " + ts.getTransferType().name() + " operation");
- }
+ /*
+ * Handle any text messages
+ */
+ if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_INITIALIZATION) {
+ lblTransferStatusMessage.setText("Synchronization Initializing");
+ } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_DIFF_GENERATION) {
+ lblTransferStatusMessage.setText("Synchronization looking for updates");
+ } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_DIFF_STEP) {
+ lblTransferStatusMessage.setText("Synchronizing differences");
+ } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_COMPLETION) {
+ lblTransferStatusMessage.setText("Synchronization complete");
+ } else if (ts.getTransferEnclosingType() == TransferStatus.TransferType.SYNCH) {
+ lblTransferStatusMessage.setText("Transfer to synchronize local and iRODS");
+ } else if (ts.getTransferState() == TransferStatus.TransferState.OVERALL_INITIATION) {
+ // initiation not within a synch
+ lblTransferStatusMessage.setText("Processing a " + ts.getTransferType().name() + " operation");
}
- });
- }
- }
+ }
+ });
- private void clearProgressBar() {
+ }
+
+ private void clearProgressBar() {
lblTransferType.setText("");
lblTransferFilesCounts.setText("Files: / ");
@@ -800,16 +824,26 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
transferStatusProgressBar.setMaximum(100);
transferStatusProgressBar.setValue(0);
}
+
+ public void setTransferInProgress(Boolean state) {
+ this.transferInProgress = state;
+ }
+
+ public Boolean isTransferInProgress() {
+ return this.transferInProgress;
+ }
+
+ public void cancelTransfer() {
+ java.awt.EventQueue.invokeLater(new Runnable() {
- public void setTransferInProgress(Boolean state) {
- this.transferInProgress = state;
- }
-
- public Boolean isTransferInProgress() {
- return this.transferInProgress;
- }
+ @Override
+ public void run() {
+ iDropCore.getTransferControlBlock().setCancelled(true);
+ }
+ });
+ }
- private final String abbreviateFileName(final String fileName) {
+ private final String abbreviateFileName(final String fileName) {
if (fileName == null) {
throw new IllegalArgumentException("null fileName");
@@ -828,82 +862,101 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
return sb.toString();
}
-
- private int getUploadTableProgressRow(String filename) {
- int row = -1;
- int numRows = tblUploadTable.getModel().getRowCount();
- for (int i = 0; i < numRows; i++) {
- if ((String) tblUploadTable.getModel().getValueAt(i, 0) == filename) {
- row = i;
- break;
- }
- }
-
- return row;
- }
-
- private void enableUploadButtons(Boolean state) {
- btnUploadBeginImport.setEnabled(state);
- btnUploadCancel.setEnabled(state);
- btnUploadMove.setEnabled(state);
- btnBrowseIRODSUploadDest.setEnabled(state);
- }
-
- public void setTotalFileUpload(int total) {
- String phrase = "Total Files To Upload: ";
-
- if (total > 0) {
- Integer itotal = new Integer(total);
- lblUploadTotalFiles.setText(phrase.concat(itotal.toString()));
- } else {
- lblUploadTotalFiles.setText(phrase);
- }
- }
-
- public void setTotalSizeUpload(long total) {
- String phrase = "Total File Size: ";
- String postfix = " (kb)";
- if (total > 0) {
- Long ltotal = new Long(total / 1024);
- lblUploadTotalSize.setText(phrase.concat(ltotal.toString()).concat(postfix));
- } else {
- lblUploadTotalSize.setText(phrase);
- }
- }
-
- public void updateFileStats(DefaultTableModel tm) {
-
- int numRows = tm.getRowCount();
- long totalSize = 0;
- int totalFiles = 0;
-
- for (int i = 0; i < numRows; i++) {
- // only count if it is currently checked for upload
- if ((Boolean) tm.getValueAt(i, 1)) {
- String fileName = (String) tm.getValueAt(i, 0);
- if (fileName != null) {
- File file = new File(fileName);
- if (file.exists()) {
- if (file.isDirectory()) {
- totalFiles += FileUtils.listFiles(file, null, true).size();
- totalSize += FileUtils.sizeOfDirectory(file);
- } else {
- totalFiles++;
- totalSize += file.length();
- }
- }
- }
- }
- }
- setTotalFileUpload(totalFiles);
- setTotalSizeUpload(totalSize);
- }
-
- @Override
- public void tableChanged(TableModelEvent tme) {
- DefaultTableModel tm = (DefaultTableModel) tblUploadTable.getModel();
- updateFileStats(tm);
+
+ private int getUploadTableProgressRow(String filename) {
+ int row=-1;
+ int numRows = tblUploadTable.getModel().getRowCount();
+ for(int i=0; i<numRows; i++) {
+ if((String)tblUploadTable.getModel().getValueAt(i, 0) == filename) {
+ row = i;
+ break;
+ }
+ }
+
+ return row;
+ }
+
+ private void enableUploadButtons(Boolean state) {
+ btnUploadBeginImport.setEnabled(state);
+ btnUploadCancel.setEnabled(state);
+ btnUploadMove.setEnabled(state);
+ btnBrowseIRODSUploadDest.setEnabled(state);
+ }
+
+ public void setTotalFileUpload(int total) {
+ String phrase = "Total Files To Upload: ";
+
+ if(total > 0) {
+ Integer itotal = new Integer(total);
+ lblUploadTotalFiles.setText(phrase.concat(itotal.toString()));
+ }
+ else {
+ lblUploadTotalFiles.setText(phrase);
+ }
+ }
+
+ public void setTotalSizeUpload(long total) {
+ String phrase = "Total File Size: ";
+ String postfix = " (kb)";
+ if(total > 0) {
+ Long ltotal = new Long(total/1024);
+ lblUploadTotalSize.setText(phrase.concat(ltotal.toString()).concat(postfix));
+ }
+ else {
+ lblUploadTotalSize.setText(phrase);
+ }
+ }
+
+ public void updateFileStats(DefaultTableModel tm) {
+
+ int numRows = tm.getRowCount();
+ long totalSize = 0;
+ int totalFiles = 0;
+
+ for(int i=0; i<numRows; i++) {
+ // only count if it is currently checked for upload
+ //if((Boolean)tm.getValueAt(i, 1)) {
+ String fileName = (String)tm.getValueAt(i, 0);
+ if(fileName != null) {
+ File file = new File(fileName);
+ if(file.exists()) {
+ if(file.isDirectory()) {
+ totalFiles+=FileUtils.listFiles(file, null, true).size();
+ totalSize+=FileUtils.sizeOfDirectory(file);
+ }
+ else {
+ totalFiles++;
+ totalSize+=file.length();
+ }
+ }
+ }
+ //}
+ }
+ setTotalFileUpload(totalFiles);
+ setTotalSizeUpload(totalSize);
}
+
+ @Override
+ public void tableChanged(TableModelEvent tme) {
+ int type = tme.getType();
+ int row = tme.getFirstRow();
+ int column = tme.getColumn();
+ DefaultTableModel tm = (DefaultTableModel)tblUploadTable.getModel();
+
+ if(type == TableModelEvent.UPDATE && column == 2) {
+ //log.info("canceling or removing??");
+ if(isTransferInProgress()) {
+ this.cancelTransfer();
+ }
+ else {
+ tm.removeRow(row);
+ tm.fireTableRowsDeleted(row, row);
+ }
+ }
+ else {
+ updateFileStats(tm);
+ }
+ }
public IRODSTree getIrodsTree() {
return irodsTree;
@@ -920,11 +973,13 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
public Outline getTreeStagingResource() {
return irodsTree;
}
+
- private void bntRefreshIrodsTreeActionPerformed(java.awt.event.ActionEvent evt) {
- // FIX ME: get current view of irods tree and pass to buildTargetTree
- buildTargetTree();
- }
+// private void bntRefreshIrodsTreeActionPerformed(java.awt.event.ActionEvent evt) {
+// // FIX ME: get current view of irods tree and pass to buildTargetTree
+// buildTargetTree();
+// }
+
private boolean tempOnlyAccount() {
String pswd = null;
@@ -998,6 +1053,12 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
lblCurrentFile = new javax.swing.JLabel();
transferStatusProgressBar = new javax.swing.JProgressBar();
pnlOperationMode2 = new javax.swing.JPanel();
+ pnlTitlleBar = new javax.swing.JPanel();
+ jPanel5 = new javax.swing.JPanel();
+ jLabel3 = new javax.swing.JLabel();
+ jPanel7 = new javax.swing.JPanel();
+ jPanel6 = new javax.swing.JPanel();
+ jLabel4 = new javax.swing.JLabel();
pnlUploadTrees = new javax.swing.JPanel();
pnlUploadLocalTree = new javax.swing.JPanel();
pnlUploadRoots = new javax.swing.JPanel();
@@ -1008,7 +1069,11 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlUploadLocalDrivesFiller = new javax.swing.JPanel();
scrollUploadLocalTree = new javax.swing.JScrollPane();
pnlUploadCenterTools = new javax.swing.JPanel();
+ jPanel2 = new javax.swing.JPanel();
+ jPanel3 = new javax.swing.JPanel();
btnUploadMove = new javax.swing.JButton();
+ btnUploadCancel = new javax.swing.JButton();
+ jPanel4 = new javax.swing.JPanel();
pnlUploadTable = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
tblUploadTable = new javax.swing.JTable();
@@ -1018,11 +1083,11 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
btnBrowseIRODSUploadDest = new javax.swing.JButton();
txtIRODSUploadDest = new javax.swing.JTextField();
pnlUploadToolbar = new javax.swing.JPanel();
+ jPanel1 = new javax.swing.JPanel();
pnlUploadToolStatus = new javax.swing.JPanel();
lblUploadTotalFiles = new javax.swing.JLabel();
lblUploadTotalSize = new javax.swing.JLabel();
btnUploadBeginImport = new javax.swing.JButton();
- btnUploadCancel = new javax.swing.JButton();
pnlOperationMode3 = new javax.swing.JPanel();
pnlProgressTable = new javax.swing.JPanel();
jScrollPane4 = new javax.swing.JScrollPane();
@@ -1081,7 +1146,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlSearchSizer.setLayout(pnlSearchSizerLayout);
pnlSearchSizerLayout.setHorizontalGroup(
pnlSearchSizerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(0, 350, Short.MAX_VALUE)
+ .add(0, 396, Short.MAX_VALUE)
);
pnlSearchSizerLayout.setVerticalGroup(
pnlSearchSizerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
@@ -1201,14 +1266,14 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
.add(pnlIrodsSearchLayout.createSequentialGroup()
.add(83, 83, 83)
.add(jLabel1)
- .addContainerGap(141, Short.MAX_VALUE))
+ .addContainerGap(187, Short.MAX_VALUE))
);
pnlIrodsSearchLayout.setVerticalGroup(
pnlIrodsSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(pnlIrodsSearchLayout.createSequentialGroup()
.add(84, 84, 84)
.add(jLabel1)
- .addContainerGap(155, Short.MAX_VALUE))
+ .addContainerGap(176, Short.MAX_VALUE))
);
tabIrodsViews.addTab(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.pnlIrodsSearch.TabConstraints.tabTitle"), pnlIrodsSearch); // NOI18N
@@ -1217,11 +1282,11 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlIrodsTree.setLayout(pnlIrodsTreeLayout);
pnlIrodsTreeLayout.setHorizontalGroup(
pnlIrodsTreeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(tabIrodsViews, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
+ .add(tabIrodsViews, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE)
);
pnlIrodsTreeLayout.setVerticalGroup(
pnlIrodsTreeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(tabIrodsViews, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE)
+ .add(tabIrodsViews, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)
);
pnlSplitPaneLocalRemote.setRightComponent(pnlIrodsTree);
@@ -1318,11 +1383,74 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlOperationMode2.setPreferredSize(new java.awt.Dimension(700, 450));
pnlOperationMode2.setLayout(new java.awt.BorderLayout());
+ pnlTitlleBar.setPreferredSize(new java.awt.Dimension(700, 24));
+ pnlTitlleBar.setLayout(new java.awt.GridBagLayout());
+
+ jPanel5.setMinimumSize(new java.awt.Dimension(150, 27));
+ jPanel5.setPreferredSize(new java.awt.Dimension(285, 20));
+
+ jLabel3.setFont(new java.awt.Font("Lucida Grande", 0, 14)); // NOI18N
+ jLabel3.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.jLabel3.text")); // NOI18N
+ jLabel3.setPreferredSize(new java.awt.Dimension(150, 17));
+ jPanel5.add(jLabel3);
+ jLabel3.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.jLabel3.AccessibleContext.accessibleName_1")); // NOI18N
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 2.0;
+ gridBagConstraints.weighty = 0.2;
+ pnlTitlleBar.add(jPanel5, gridBagConstraints);
+
+ jPanel7.setMinimumSize(new java.awt.Dimension(80, 0));
+ jPanel7.setPreferredSize(new java.awt.Dimension(80, 24));
+
+ org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7);
+ jPanel7.setLayout(jPanel7Layout);
+ jPanel7Layout.setHorizontalGroup(
+ jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 80, Short.MAX_VALUE)
+ );
+ jPanel7Layout.setVerticalGroup(
+ jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 24, Short.MAX_VALUE)
+ );
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 0.1;
+ gridBagConstraints.weighty = 0.2;
+ pnlTitlleBar.add(jPanel7, gridBagConstraints);
+
+ jPanel6.setMinimumSize(new java.awt.Dimension(252, 27));
+ jPanel6.setPreferredSize(new java.awt.Dimension(310, 17));
+
+ jLabel4.setFont(new java.awt.Font("Lucida Grande", 0, 14)); // NOI18N
+ jLabel4.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.jLabel4.text")); // NOI18N
+ jLabel4.setPreferredSize(new java.awt.Dimension(200, 17));
+ jPanel6.add(jLabel4);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 2;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 1.6;
+ gridBagConstraints.weighty = 0.2;
+ pnlTitlleBar.add(jPanel6, gridBagConstraints);
+
+ pnlOperationMode2.add(pnlTitlleBar, java.awt.BorderLayout.NORTH);
+
pnlUploadTrees.setMinimumSize(new java.awt.Dimension(250, 160));
pnlUploadTrees.setPreferredSize(new java.awt.Dimension(700, 385));
pnlUploadTrees.setLayout(new java.awt.GridBagLayout());
- pnlUploadLocalTree.setMinimumSize(new java.awt.Dimension(0, 0));
+ pnlUploadLocalTree.setMinimumSize(new java.awt.Dimension(150, 0));
pnlUploadLocalTree.setPreferredSize(new java.awt.Dimension(285, 380));
pnlUploadLocalTree.setLayout(new java.awt.BorderLayout());
@@ -1366,7 +1494,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlUploadLocalDrivesFiller.setLayout(pnlUploadLocalDrivesFillerLayout);
pnlUploadLocalDrivesFillerLayout.setHorizontalGroup(
pnlUploadLocalDrivesFillerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(0, 289, Short.MAX_VALUE)
+ .add(0, 298, Short.MAX_VALUE)
);
pnlUploadLocalDrivesFillerLayout.setVerticalGroup(
pnlUploadLocalDrivesFillerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
@@ -1387,30 +1515,100 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
- gridBagConstraints.weightx = 0.4;
+ gridBagConstraints.weightx = 2.0;
gridBagConstraints.weighty = 0.2;
pnlUploadTrees.add(pnlUploadLocalTree, gridBagConstraints);
- pnlUploadCenterTools.setMaximumSize(new java.awt.Dimension(65, 32767));
- pnlUploadCenterTools.setMinimumSize(new java.awt.Dimension(30, 100));
- pnlUploadCenterTools.setPreferredSize(new java.awt.Dimension(50, 380));
+ pnlUploadCenterTools.setAutoscrolls(true);
+ pnlUploadCenterTools.setMaximumSize(new java.awt.Dimension(80, 32767));
+ pnlUploadCenterTools.setMinimumSize(new java.awt.Dimension(80, 100));
+ pnlUploadCenterTools.setPreferredSize(new java.awt.Dimension(80, 380));
pnlUploadCenterTools.setRequestFocusEnabled(false);
- pnlUploadCenterTools.setLayout(new java.awt.BorderLayout());
+ pnlUploadCenterTools.setLayout(new java.awt.GridBagLayout());
+
+ jPanel2.setPreferredSize(new java.awt.Dimension(80, 100));
+
+ org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
+ jPanel2.setLayout(jPanel2Layout);
+ jPanel2Layout.setHorizontalGroup(
+ jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 80, Short.MAX_VALUE)
+ );
+ jPanel2Layout.setVerticalGroup(
+ jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 100, Short.MAX_VALUE)
+ );
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
+ pnlUploadCenterTools.add(jPanel2, gridBagConstraints);
+
+ jPanel3.setMaximumSize(new java.awt.Dimension(32767, 80));
+ jPanel3.setMinimumSize(new java.awt.Dimension(80, 80));
+ jPanel3.setPreferredSize(new java.awt.Dimension(80, 80));
+ jPanel3.setLayout(new java.awt.GridLayout(2, 1));
btnUploadMove.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnUploadMove.text")); // NOI18N
btnUploadMove.setMargin(new java.awt.Insets(0, 0, 0, 0));
+ btnUploadMove.setMaximumSize(new java.awt.Dimension(75, 50));
+ btnUploadMove.setMinimumSize(new java.awt.Dimension(75, 50));
+ btnUploadMove.setPreferredSize(new java.awt.Dimension(80, 40));
btnUploadMove.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUploadMoveActionPerformed(evt);
}
});
- pnlUploadCenterTools.add(btnUploadMove, java.awt.BorderLayout.CENTER);
+ jPanel3.add(btnUploadMove);
+
+ btnUploadCancel.setFont(new java.awt.Font("Lucida Grande", 0, 10));
+ btnUploadCancel.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnUploadCancel.text")); // NOI18N
+ btnUploadCancel.setMinimumSize(new java.awt.Dimension(50, 40));
+ btnUploadCancel.setPreferredSize(new java.awt.Dimension(80, 40));
+ btnUploadCancel.setRequestFocusEnabled(false);
+ btnUploadCancel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUploadCancelActionPerformed(evt);
+ }
+ });
+ jPanel3.add(btnUploadCancel);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
+ pnlUploadCenterTools.add(jPanel3, gridBagConstraints);
+
+ jPanel4.setMinimumSize(new java.awt.Dimension(80, 0));
+ jPanel4.setPreferredSize(new java.awt.Dimension(80, 100));
+
+ org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
+ jPanel4.setLayout(jPanel4Layout);
+ jPanel4Layout.setHorizontalGroup(
+ jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 80, Short.MAX_VALUE)
+ );
+ jPanel4Layout.setVerticalGroup(
+ jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 100, Short.MAX_VALUE)
+ );
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
+ pnlUploadCenterTools.add(jPanel4, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
- gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 0.1;
gridBagConstraints.weighty = 0.2;
pnlUploadTrees.add(pnlUploadCenterTools, gridBagConstraints);
@@ -1424,14 +1622,14 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
},
new String [] {
- "File Name", "Import?", "Upload Status"
+ "File Name", "Upload Status", "Cancel/Remove"
}
) {
Class[] types = new Class [] {
- java.lang.String.class, java.lang.Boolean.class, java.lang.Object.class
+ java.lang.String.class, java.lang.Object.class, java.lang.Boolean.class
};
boolean[] canEdit = new boolean [] {
- false, true, true
+ false, false, false
};
public Class getColumnClass(int columnIndex) {
@@ -1447,7 +1645,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
tblUploadTable.setGridColor(new java.awt.Color(204, 204, 204));
tblUploadTable.setPreferredSize(new java.awt.Dimension(285, 380));
tblUploadTable.setRowMargin(2);
- tblUploadTable.setShowGrid(true);
+ tblUploadTable.setShowGrid(false);
jScrollPane3.setViewportView(tblUploadTable);
pnlUploadTable.add(jScrollPane3, java.awt.BorderLayout.CENTER);
@@ -1490,7 +1688,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
- gridBagConstraints.weightx = 0.4;
+ gridBagConstraints.weightx = 1.6;
gridBagConstraints.weighty = 0.2;
pnlUploadTrees.add(pnlUploadTable, gridBagConstraints);
@@ -1501,7 +1699,20 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlUploadToolbar.setPreferredSize(new java.awt.Dimension(700, 40));
pnlUploadToolbar.setLayout(new java.awt.GridBagLayout());
- pnlUploadToolStatus.setPreferredSize(new java.awt.Dimension(500, 34));
+ jPanel1.setMinimumSize(new java.awt.Dimension(215, 0));
+ jPanel1.setPreferredSize(new java.awt.Dimension(275, 40));
+ jPanel1.setRequestFocusEnabled(false);
+ jPanel1.setLayout(new java.awt.GridLayout(2, 1));
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 2.2;
+ pnlUploadToolbar.add(jPanel1, gridBagConstraints);
+
+ pnlUploadToolStatus.setMinimumSize(new java.awt.Dimension(175, 32));
+ pnlUploadToolStatus.setPreferredSize(new java.awt.Dimension(175, 34));
pnlUploadToolStatus.setRequestFocusEnabled(false);
pnlUploadToolStatus.setLayout(new java.awt.BorderLayout());
@@ -1512,40 +1723,30 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlUploadToolStatus.add(lblUploadTotalSize, java.awt.BorderLayout.SOUTH);
gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
- gridBagConstraints.weightx = 140.0;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ gridBagConstraints.weightx = 0.7;
gridBagConstraints.insets = new java.awt.Insets(5, 10, 0, 0);
pnlUploadToolbar.add(pnlUploadToolStatus, gridBagConstraints);
btnUploadBeginImport.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnUploadBeginImport.text")); // NOI18N
btnUploadBeginImport.setEnabled(false);
+ btnUploadBeginImport.setMaximumSize(new java.awt.Dimension(115, 29));
+ btnUploadBeginImport.setMinimumSize(new java.awt.Dimension(115, 29));
+ btnUploadBeginImport.setPreferredSize(new java.awt.Dimension(115, 29));
btnUploadBeginImport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUploadBeginImportActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 0;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
- gridBagConstraints.weightx = 50.0;
- pnlUploadToolbar.add(btnUploadBeginImport, gridBagConstraints);
-
- btnUploadCancel.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnUploadCancel.text")); // NOI18N
- btnUploadCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnUploadCancelActionPerformed(evt);
- }
- });
- gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
- gridBagConstraints.weightx = 0.6;
- pnlUploadToolbar.add(btnUploadCancel, gridBagConstraints);
+ gridBagConstraints.weightx = 0.5;
+ pnlUploadToolbar.add(btnUploadBeginImport, gridBagConstraints);
pnlOperationMode2.add(pnlUploadToolbar, java.awt.BorderLayout.SOUTH);
@@ -1585,14 +1786,15 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}//GEN-LAST:event_btnIrodsTreeRefreshActionPerformed
private void btnUploadMoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadMoveActionPerformed
-
- TreePath[] paths = fileUploadTree.getSelectionPaths();
- for (TreePath path : paths) {
- DefaultTableModel tm = (DefaultTableModel) tblUploadTable.getModel();
- Object[] rowData = new Object[2];
- rowData[0] = LocalFileUtils.makeLocalFilePath(path);
- rowData[1] = Boolean.TRUE;
- tm.addRow(rowData);
+
+ TreePath [] paths = fileUploadTree.getSelectionPaths();
+ for(TreePath path: paths) {
+ DefaultTableModel tm = (DefaultTableModel)tblUploadTable.getModel();
+ Object [] rowData = new Object[3];
+ rowData[0] = LocalFileUtils.makeLocalFilePath(path);
+ rowData[1] = 0;
+ rowData[2] = Boolean.TRUE;
+ tm.addRow(rowData);
}
}//GEN-LAST:event_btnUploadMoveActionPerformed
@@ -1611,58 +1813,69 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}//GEN-LAST:event_btnToggleLocalViewActionPerformed
private void btnUploadBeginImportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadBeginImportActionPerformed
- // if (!isTransferInProgress()) {
- try {
- PutTransferRunner currentTransferRunner = null;
- final List<File> sourceFiles = new ArrayList<File>();
-
- // make sure IRODS destination is legal
- final String targetPath = txtIRODSUploadDest.getText();
-
-
- IRODSFile ifile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(targetPath);
- if (!ifile.isDirectory()) {
- JOptionPane.showMessageDialog(this, "Please enter a valid IRODS destination for upload.");
- return;
- }
-
- // now go through and process selected import files from table
-
+
+ PutTransferRunner currentTransferRunner = null;
+ final List<File> sourceFiles = new ArrayList<File>();
+
+ // make sure IRODS destination is legal
+ final String targetPath = txtIRODSUploadDest.getText();
- // collect list of files in the table
- int rows = tblUploadTable.getRowCount();
- for (int row = 0; row < rows; row++) {
- // only select files checked for import
- if ((Boolean) tblUploadTable.getValueAt(row, 1)) {
- sourceFiles.add(new File((String) tblUploadTable.getValueAt(row, 0)));
- }
- }
-
- currentTransferRunner = new PutTransferRunner(applet, targetPath, sourceFiles);
+ try {
+ IRODSFileService irodsFS = new IRODSFileService(iDropCore.getIrodsAccount(), IRODSFileSystem.instance());
+ IRODSFile ifile = irodsFS.getIRODSFileForPath(targetPath);
+ if(!ifile.isDirectory()) {
+ JOptionPane.showMessageDialog(this, "Please enter a valid IRODS destination for upload.");
+ return;
+ }
+ }
+ catch(Exception ex) {
+ JOptionPane.showMessageDialog(this, "Please enter a valid IRODS destination for upload.");
+ return;
+ }
+
+ // now go through and process selected import files from table
+ if(!isTransferInProgress()) {
+
+ // collect list of files in the table
+ int rows = tblUploadTable.getRowCount();
+ for(int row=0; row<rows; row++) {
+ // only select files checked for import
+ //if((Boolean)tblUploadTable.getValueAt(row, 1)) {
+ sourceFiles.add(new File((String)tblUploadTable.getValueAt(row, 0)));
+ //}
+ }
+
+ // set Upload button test to Cancel
+ try {
+ currentTransferRunner = new PutTransferRunner(applet, targetPath, sourceFiles, iDropCore.getTransferControlBlock());
final Thread transferThread = new Thread(currentTransferRunner);
log.info("launching transfer thread");
// close so that transfer thread can grab account
irodsFileSystem.closeAndEatExceptions();
transferThread.start();
- transferThread.join();
+ //transferThread.join();
} catch (Exception e) {
log.error("exception choosings iRODS file");
throw new IdropRuntimeException("exception choosing irods file", e);
} finally {
iDropCore.getIrodsFileSystem().closeAndEatExceptions();
}
- // }
+ }
}//GEN-LAST:event_btnUploadBeginImportActionPerformed
private void btnUploadCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadCancelActionPerformed
- DefaultTableModel tm = (DefaultTableModel) tblUploadTable.getModel();
- tm.getDataVector().removeAllElements();
- tm.fireTableDataChanged();
+ DefaultTableModel tm = (DefaultTableModel)tblUploadTable.getModel();
+ int numRows = tm.getRowCount();
+ tm.getDataVector().removeAllElements();
+ if(numRows > 0) {
+ tm.getDataVector().removeAllElements();
+ tm.fireTableRowsDeleted(0, numRows-1);
+ }
}//GEN-LAST:event_btnUploadCancelActionPerformed
private void btnUploadLocalRefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadLocalRefreshActionPerformed
- setUpUploadLocalFileSelectTree();
+ setUpUploadLocalFileSelectTree();
}//GEN-LAST:event_btnUploadLocalRefreshActionPerformed
private void txtIRODSUploadDestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIRODSUploadDestActionPerformed
@@ -1670,10 +1883,10 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}//GEN-LAST:event_txtIRODSUploadDestActionPerformed
private void btnBrowseIRODSUploadDestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBrowseIRODSUploadDestActionPerformed
- IRODSFinderDialog finderDialog = new IRODSFinderDialog(true, iDropCore);
+ IRODSFinderDialog finderDialog = new IRODSFinderDialog(true, iDropCore);
finderDialog.setVisible(true);
String targetPath = finderDialog.getSelectedAbsolutePath();
- if (targetPath != null) {
+ if(targetPath != null) {
//then do stuff
log.info("upload drop target selected:{}", targetPath);
txtIRODSUploadDest.setText(targetPath);
@@ -1681,6 +1894,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}
finderDialog.dispose();
}//GEN-LAST:event_btnBrowseIRODSUploadDestActionPerformed
+
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnBrowseIRODSUploadDest;
private javax.swing.JButton btnIrodsTreeRefresh;
@@ -1692,6 +1907,15 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private javax.swing.JButton btnUploadMove;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JPanel jPanel2;
+ private javax.swing.JPanel jPanel3;
+ private javax.swing.JPanel jPanel4;
+ private javax.swing.JPanel jPanel5;
+ private javax.swing.JPanel jPanel6;
+ private javax.swing.JPanel jPanel7;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JLabel lblCurrentFile;
@@ -1727,6 +1951,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private javax.swing.JPanel pnlSearchSizer;
private javax.swing.JSplitPane pnlSplitPaneLocalRemote;
private javax.swing.JTabbedPane pnlTabbedMain;
+ private javax.swing.JPanel pnlTitlleBar;
private javax.swing.JPanel pnlToolBarSizer;
private javax.swing.JPanel pnlTransferByteCounts;
private javax.swing.JPanel pnlTransferFileCounts;
@@ -1755,4 +1980,5 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private javax.swing.JProgressBar transferStatusProgressBar;
private javax.swing.JTextField txtIRODSUploadDest;
// End of variables declaration//GEN-END:variables
+
}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteCore.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteCore.java
index d5e961c..2035df7 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteCore.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteCore.java
@@ -19,6 +19,8 @@ import org.irods.jargon.core.pub.IRODSFileSystem;
import org.irods.jargon.core.pub.io.IRODSFileFactory;
//import org.irods.jargon.idrop.desktop.systraygui.services.IconManager;
//import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
+import org.irods.jargon.core.transfer.DefaultTransferControlBlock;
+import org.irods.jargon.core.transfer.TransferControlBlock;
public class iDropLiteCore {
@@ -27,6 +29,8 @@ public class iDropLiteCore {
private IRODSFileSystem irodsFileSystem = null;
private DataTransferOperations dataTransferOps = null;
+
+ private TransferControlBlock transferControlBlock = null;
public IRODSFileSystem getIrodsFileSystem() {
return irodsFileSystem;
@@ -183,5 +187,13 @@ public class iDropLiteCore {
}
}
+
+ public void setTransferControlBlock(TransferControlBlock tcb) {
+ this.transferControlBlock = tcb;
+ }
+
+ public TransferControlBlock getTransferControlBlock() {
+ return this.transferControlBlock;
+ }
}
diff --git a/idrop-lite/src/main/resources/cancel.gif b/idrop-lite/src/main/resources/cancel.gif
new file mode 100644
index 0000000..be7887f
--- /dev/null
+++ b/idrop-lite/src/main/resources/cancel.gif
Binary files differ
diff --git a/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
index 90a65e4..fa1c8f6 100644
--- a/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
+++ b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
@@ -1,7 +1,7 @@
NewJApplet.btnToggleLocalView.text=jButton1
-iDropLiteApplet.btnUploadBeginImport.text=Begin Import
+iDropLiteApplet.btnUploadBeginImport.text=Begin Upload
iDropLiteApplet.pnlOperationMode3.TabConstraints.tabTitle=Progress
-iDropLiteApplet.btnUploadCancel.text=Clear
+iDropLiteApplet.btnUploadCancel.text=<html><center>Remove<br>All</center><html>\n
iDropLiteApplet.pnlMain.TabConstraints.tabTitle=Main
iDropLiteApplet.jLabel1.text=Coming soon!
iDropLiteApplet.pnlIrodsSearch.TabConstraints.tabTitle=Search
@@ -11,10 +11,10 @@ iDropLiteApplet.btnUploadMove.text=>>
iDropLiteApplet.btnLocalRefresh.text=Refresh
iDropLiteApplet.pnlOperationMode2.TabConstraints.tabTitle=Upload
iDropLiteApplet.btnToggleLocalView.text=<<<Local Files
-iDropLiteApplet.btnUploadLocalRefresh.text=Refresh
-iDropLiteApplet.jLabel2.text=List of items to import to:
+iDropLiteApplet.btnUploadLocalRefresh.text=Refresh Local File View
+iDropLiteApplet.jLabel2.text=List of items to upload to:
iDropLiteApplet.txtIRODSUploadDest.text=
-iDropLiteApplet.btnBrowseIRODSUploadDest.text=Browse
+iDropLiteApplet.btnBrowseIRODSUploadDest.text=Update
iDropLiteApplet.jLabel4.TabConstraints.tabTitle=tab4
iDropLiteApplet.lblUploadTotalSize.text=Total File Size:
iDropLiteApplet.lblUploadTotalFiles.text=Total Files to Upload:
@@ -25,3 +25,10 @@ iDropLiteApplet.lblTransferFilesCounts.text=Files: /
iDropLiteApplet.lblTransferType.text=\
iDropLiteApplet.lblTransferTypeLabel.text=Transfer Type:
iDropLiteApplet.lblTransferTypeLabel.text=Transfer Type:
+iDropLiteApplet.btnUploadCancel.label=<html><div align=center>Rem</div><div align=center>All</dv></html>
+iDropLiteApplet.jPanel1.TabConstraints.tabTitle=tab4
+iDropLiteApplet.jLabel3.AccessibleContext.accessibleName=Move files from your local file tree
+iDropLiteApplet.jPanel5.TabConstraints.tabTitle=tab4
+iDropLiteApplet.jLabel3.text=Local File Tree View
+iDropLiteApplet.jLabel4.text=iRODS Upload Table View
+iDropLiteApplet.jLabel3.AccessibleContext.accessibleName_1=Local File Tree View