From 3cf90257525ab8396913c6ce28f7d3fcfd22e8ed Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 8 Dec 2019 03:10:12 +0100 Subject: [PATCH] 2019-12-07 --- .idea/codeStyles/codeStyleConfig.xml | 5 +++ README.md | 4 ++ docs/allclasses-index.html | 44 +++++++++++++------ docs/allpackages-index.html | 8 +++- docs/constant-values.html | 4 +- docs/deprecated-list.html | 4 +- docs/element-list | 1 + docs/help-doc.html | 4 +- docs/index.html | 8 +++- docs/member-search-index.js | 2 +- docs/overview-summary.html | 4 +- docs/overview-tree.html | 26 ++++++++--- docs/package-search-index.js | 2 +- docs/serialized-form.html | 4 +- docs/type-search-index.js | 2 +- src/eu/steffo/cleaver/gui/CleaverFrame.java | 10 ++++- .../cleaver/gui/panels/CreateJobPanel.java | 21 +++++++-- .../cleaver/gui/panels/JobsTablePanel.java | 5 ++- src/eu/steffo/cleaver/logic/ChopJob.java | 21 +++++++++ src/eu/steffo/cleaver/logic/Job.java | 18 +++++--- src/eu/steffo/cleaver/logic/StitchJob.java | 5 +++ .../logic/progress/FinishedProgress.java | 8 ++++ .../logic/progress/NotStartedProgress.java | 8 ++++ .../cleaver/logic/progress/Progress.java | 4 ++ .../logic/progress/WorkingProgress.java | 18 ++++++++ 25 files changed, 191 insertions(+), 49 deletions(-) create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 src/eu/steffo/cleaver/logic/progress/FinishedProgress.java create mode 100644 src/eu/steffo/cleaver/logic/progress/NotStartedProgress.java create mode 100644 src/eu/steffo/cleaver/logic/progress/Progress.java create mode 100644 src/eu/steffo/cleaver/logic/progress/WorkingProgress.java diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index f47d988..6edc065 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ The documentation for this project is available [here](https://gh.steffo.eu/clea ### Progress +#### 2019-12-07 + +![](https://i.imgur.com/nlmvEUX.png) + #### 2019-12-06 ![](https://i.imgur.com/TBPgZ4D.png) diff --git a/docs/allclasses-index.html b/docs/allclasses-index.html index 12e161f..1e74b93 100644 --- a/docs/allclasses-index.html +++ b/docs/allclasses-index.html @@ -2,10 +2,10 @@ - + All Classes - + @@ -124,57 +124,73 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));   -Job +FinishedProgress   -JobsButtonsPanel +Job   -JobsTablePanel +JobsButtonsPanel   -Main +JobsTablePanel   -OptionRow +Main   -Row +NotStartedProgress   -SplitByPartsConfig +OptionRow   -SplitBySizeConfig +Progress   -SplitConfig +Row   -SplitRow +SplitByPartsConfig   -StitchJob +SplitBySizeConfig   -StitchPanel +SplitConfig   +SplitRow +  + + +StitchJob +  + + +StitchPanel +  + + TitleRow   + +WorkingProgress +  + diff --git a/docs/allpackages-index.html b/docs/allpackages-index.html index cb08818..f54216c 100644 --- a/docs/allpackages-index.html +++ b/docs/allpackages-index.html @@ -2,10 +2,10 @@ - + All Packages - + @@ -112,6 +112,10 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));   +eu.steffo.cleaver.logic.progress +  + + eu.steffo.cleaver.logic.split   diff --git a/docs/constant-values.html b/docs/constant-values.html index d15b6bb..3308193 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,10 +2,10 @@ - + Constant Field Values - + diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html index ab5003a..46d3c98 100644 --- a/docs/deprecated-list.html +++ b/docs/deprecated-list.html @@ -2,10 +2,10 @@ - + Deprecated List - + diff --git a/docs/element-list b/docs/element-list index 5da0c65..da10e11 100644 --- a/docs/element-list +++ b/docs/element-list @@ -6,4 +6,5 @@ eu.steffo.cleaver.gui.rows.option eu.steffo.cleaver.logic eu.steffo.cleaver.logic.compress eu.steffo.cleaver.logic.crypt +eu.steffo.cleaver.logic.progress eu.steffo.cleaver.logic.split diff --git a/docs/help-doc.html b/docs/help-doc.html index 51c79f8..ccf7ad0 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -2,10 +2,10 @@ - + API Help - + diff --git a/docs/index.html b/docs/index.html index 7600a54..04f40e6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,10 +2,10 @@ - + Overview - + @@ -109,6 +109,10 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));   +eu.steffo.cleaver.logic.progress +  + + eu.steffo.cleaver.logic.split   diff --git a/docs/member-search-index.js b/docs/member-search-index.js index 9f813c1..0c00233 100644 --- a/docs/member-search-index.js +++ b/docs/member-search-index.js @@ -1 +1 @@ -memberSearchIndex = [{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"ChopAndStitchPanel(ActionListener, ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener,java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.logic","c":"ChopJob","l":"ChopJob(File, SplitConfig, CryptConfig, CompressConfig)","url":"%3Cinit%3E(java.io.File,eu.steffo.cleaver.logic.split.SplitConfig,eu.steffo.cleaver.logic.crypt.CryptConfig,eu.steffo.cleaver.logic.compress.CompressConfig)"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"chopPanel"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopPanel","l":"ChopPanel(ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"chopStitchPanel"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"clearSelectedFiles()"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"CleaverFrame(ArrayList)","url":"%3Cinit%3E(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"compressConfig"},{"p":"eu.steffo.cleaver.logic.compress","c":"CompressConfig","l":"CompressConfig()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"compressionCheckBox"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"compressOptionPanel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"CompressRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"createAndAddChopJobs(ArrayList)","url":"createAndAddChopJobs(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"createAndAddJobs(ArrayList)","url":"createAndAddJobs(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"createAndAddStitchJobs(ArrayList)","url":"createAndAddStitchJobs(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.gui.rows","c":"CreateJobButtonRow","l":"createJobButton"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"createJobButtonPanel"},{"p":"eu.steffo.cleaver.gui.rows","c":"CreateJobButtonRow","l":"CreateJobButtonRow(ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"CreateJobPanel(ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"cryptCheckBox"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"cryptConfig"},{"p":"eu.steffo.cleaver.logic.crypt","c":"CryptConfig","l":"CryptConfig(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"cryptOptionPanel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"CryptRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsButtonsPanel","l":"deleteButton"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"file"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"fileChooser"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"fileSelectPanel"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"FileSelectRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"firstSeparator"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getColumnClass(int)"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getColumnCount()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getColumnName(int)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"getCompressConfig()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getCompressConfig()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"getCryptConfig()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getCryptConfig()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getFile()"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopPanel","l":"getJobClass()"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"getJobClass()"},{"p":"eu.steffo.cleaver.gui.panels","c":"StitchPanel","l":"getJobClass()"},{"p":"eu.steffo.cleaver.logic.crypt","c":"CryptConfig","l":"getKey()"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopPanel","l":"getPanelText()"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"getPanelText()"},{"p":"eu.steffo.cleaver.gui.panels","c":"StitchPanel","l":"getPanelText()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitByPartsConfig","l":"getParts()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getRowCount()"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"getSelectedFiles()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"getSelectedJobsIndexes()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitBySizeConfig","l":"getSize()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"getSplitConfig()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getSplitConfig()"},{"p":"eu.steffo.cleaver.logic","c":"ChopJob","l":"getType()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getType()"},{"p":"eu.steffo.cleaver.logic","c":"StitchJob","l":"getType()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getValueAt(int, int)","url":"getValueAt(int,int)"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"isCellEditable(int, int)","url":"isCellEditable(int,int)"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"Job(File, SplitConfig, CryptConfig, CompressConfig)","url":"%3Cinit%3E(java.io.File,eu.steffo.cleaver.logic.split.SplitConfig,eu.steffo.cleaver.logic.crypt.CryptConfig,eu.steffo.cleaver.logic.compress.CompressConfig)"},{"p":"eu.steffo.cleaver","c":"Main","l":"jobs"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"jobs"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"jobs"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"jobsButtonRow"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsButtonsPanel","l":"JobsButtonsPanel(ActionListener, ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener,java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"JobsTableModel()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"jobsTablePanel"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"JobsTablePanel(ArrayList)","url":"%3Cinit%3E(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.logic.crypt","c":"CryptConfig","l":"key"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"keyLabel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"keyTextField"},{"p":"eu.steffo.cleaver","c":"Main","l":"Main()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver","c":"Main","l":"main(String[])","url":"main(java.lang.String[])"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"OptionRow","l":"OptionRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitByPartsConfig","l":"parts"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"partsLabel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"partsTextField"},{"p":"eu.steffo.cleaver.gui.rows","c":"Row","l":"Row()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"secondSeparator"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"selectedFilesText"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"selectFilesButton"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"separator"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"setCompressConfig(CompressConfig)","url":"setCompressConfig(eu.steffo.cleaver.logic.compress.CompressConfig)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"setCryptConfig(CryptConfig)","url":"setCryptConfig(eu.steffo.cleaver.logic.crypt.CryptConfig)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"setEditable(boolean)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"setEditable(boolean)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"OptionRow","l":"setEditable(boolean)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"setEditable(boolean)"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitBySizeConfig","l":"size"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"sizeLabel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"sizeTextField"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"sizeUnitLabel"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitByPartsConfig","l":"SplitByPartsConfig(int)","url":"%3Cinit%3E(int)"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitBySizeConfig","l":"SplitBySizeConfig(int)","url":"%3Cinit%3E(int)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"splitCheckBox"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"splitConfig"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitConfig","l":"SplitConfig()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"splitOptionPanel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"SplitRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsButtonsPanel","l":"startButton"},{"p":"eu.steffo.cleaver.logic","c":"StitchJob","l":"StitchJob(File, SplitConfig, CryptConfig, CompressConfig)","url":"%3Cinit%3E(java.io.File,eu.steffo.cleaver.logic.split.SplitConfig,eu.steffo.cleaver.logic.crypt.CryptConfig,eu.steffo.cleaver.logic.compress.CompressConfig)"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"stitchPanel"},{"p":"eu.steffo.cleaver.gui.panels","c":"StitchPanel","l":"StitchPanel(ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"table"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"tableModel"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"tableScrollPane"},{"p":"eu.steffo.cleaver.gui.rows","c":"TitleRow","l":"titleLabel"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"titlePanel"},{"p":"eu.steffo.cleaver.gui.rows","c":"TitleRow","l":"TitleRow(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"eu.steffo.cleaver.logic.compress","c":"CompressConfig","l":"toString()"},{"p":"eu.steffo.cleaver.logic.crypt","c":"CryptConfig","l":"toString()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitByPartsConfig","l":"toString()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitBySizeConfig","l":"toString()"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"update()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"updateEnabledState()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"updateEnabledState()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"OptionRow","l":"updateEnabledState()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"updateEnabledState()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"updateTableChanged()"}] \ No newline at end of file +memberSearchIndex = [{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"ChopAndStitchPanel(ActionListener, ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener,java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.logic","c":"ChopJob","l":"ChopJob(File, SplitConfig, CryptConfig, CompressConfig)","url":"%3Cinit%3E(java.io.File,eu.steffo.cleaver.logic.split.SplitConfig,eu.steffo.cleaver.logic.crypt.CryptConfig,eu.steffo.cleaver.logic.compress.CompressConfig)"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"chopPanel"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopPanel","l":"ChopPanel(ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"chopStitchPanel"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"clearSelectedFiles()"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"CleaverFrame(ArrayList)","url":"%3Cinit%3E(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"compressConfig"},{"p":"eu.steffo.cleaver.logic.compress","c":"CompressConfig","l":"CompressConfig()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"compressionCheckBox"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"compressOptionPanel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"CompressRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"createAndAddChopJobs(ArrayList)","url":"createAndAddChopJobs(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"createAndAddJobs(ArrayList)","url":"createAndAddJobs(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"createAndAddStitchJobs(ArrayList)","url":"createAndAddStitchJobs(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.gui.rows","c":"CreateJobButtonRow","l":"createJobButton"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"createJobButtonPanel"},{"p":"eu.steffo.cleaver.gui.rows","c":"CreateJobButtonRow","l":"CreateJobButtonRow(ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"CreateJobPanel(ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"cryptCheckBox"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"cryptConfig"},{"p":"eu.steffo.cleaver.logic.crypt","c":"CryptConfig","l":"CryptConfig(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"cryptOptionPanel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"CryptRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsButtonsPanel","l":"deleteButton"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"file"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"fileChooser"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"fileSelectPanel"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"FileSelectRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.logic.progress","c":"FinishedProgress","l":"FinishedProgress()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"firstSeparator"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getColumnClass(int)"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getColumnCount()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getColumnName(int)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"getCompressConfig()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getCompressConfig()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"getCryptConfig()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getCryptConfig()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getFile()"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopPanel","l":"getJobClass()"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"getJobClass()"},{"p":"eu.steffo.cleaver.gui.panels","c":"StitchPanel","l":"getJobClass()"},{"p":"eu.steffo.cleaver.logic.crypt","c":"CryptConfig","l":"getKey()"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopPanel","l":"getPanelText()"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"getPanelText()"},{"p":"eu.steffo.cleaver.gui.panels","c":"StitchPanel","l":"getPanelText()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitByPartsConfig","l":"getParts()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getProgress()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getRowCount()"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"getSelectedFiles()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"getSelectedJobsIndexes()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitBySizeConfig","l":"getSize()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"getSplitConfig()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getSplitConfig()"},{"p":"eu.steffo.cleaver.logic","c":"ChopJob","l":"getType()"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"getType()"},{"p":"eu.steffo.cleaver.logic","c":"StitchJob","l":"getType()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"getValueAt(int, int)","url":"getValueAt(int,int)"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"isCellEditable(int, int)","url":"isCellEditable(int,int)"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"Job(File, SplitConfig, CryptConfig, CompressConfig)","url":"%3Cinit%3E(java.io.File,eu.steffo.cleaver.logic.split.SplitConfig,eu.steffo.cleaver.logic.crypt.CryptConfig,eu.steffo.cleaver.logic.compress.CompressConfig)"},{"p":"eu.steffo.cleaver","c":"Main","l":"jobs"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"jobs"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"jobs"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"jobsButtonRow"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsButtonsPanel","l":"JobsButtonsPanel(ActionListener, ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener,java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel.JobsTableModel","l":"JobsTableModel()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui","c":"CleaverFrame","l":"jobsTablePanel"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"JobsTablePanel(ArrayList)","url":"%3Cinit%3E(java.util.ArrayList)"},{"p":"eu.steffo.cleaver.logic.crypt","c":"CryptConfig","l":"key"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"keyLabel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"keyTextField"},{"p":"eu.steffo.cleaver","c":"Main","l":"Main()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver","c":"Main","l":"main(String[])","url":"main(java.lang.String[])"},{"p":"eu.steffo.cleaver.logic.progress","c":"NotStartedProgress","l":"NotStartedProgress()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"OptionRow","l":"OptionRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitByPartsConfig","l":"parts"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"partsLabel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"partsTextField"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"progress"},{"p":"eu.steffo.cleaver.logic.progress","c":"WorkingProgress","l":"progress"},{"p":"eu.steffo.cleaver.logic.progress","c":"Progress","l":"Progress()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.rows","c":"Row","l":"Row()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.logic","c":"ChopJob","l":"run()"},{"p":"eu.steffo.cleaver.logic","c":"StitchJob","l":"run()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"secondSeparator"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"selectedFilesText"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"selectFilesButton"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"separator"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"setCompressConfig(CompressConfig)","url":"setCompressConfig(eu.steffo.cleaver.logic.compress.CompressConfig)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"setCryptConfig(CryptConfig)","url":"setCryptConfig(eu.steffo.cleaver.logic.crypt.CryptConfig)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"setEditable(boolean)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"setEditable(boolean)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"OptionRow","l":"setEditable(boolean)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"setEditable(boolean)"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitBySizeConfig","l":"size"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"sizeLabel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"sizeTextField"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"sizeUnitLabel"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitByPartsConfig","l":"SplitByPartsConfig(int)","url":"%3Cinit%3E(int)"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitBySizeConfig","l":"SplitBySizeConfig(int)","url":"%3Cinit%3E(int)"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"splitCheckBox"},{"p":"eu.steffo.cleaver.logic","c":"Job","l":"splitConfig"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitConfig","l":"SplitConfig()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"splitOptionPanel"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"SplitRow()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsButtonsPanel","l":"startButton"},{"p":"eu.steffo.cleaver.logic","c":"StitchJob","l":"StitchJob(File, SplitConfig, CryptConfig, CompressConfig)","url":"%3Cinit%3E(java.io.File,eu.steffo.cleaver.logic.split.SplitConfig,eu.steffo.cleaver.logic.crypt.CryptConfig,eu.steffo.cleaver.logic.compress.CompressConfig)"},{"p":"eu.steffo.cleaver.gui.panels","c":"ChopAndStitchPanel","l":"stitchPanel"},{"p":"eu.steffo.cleaver.gui.panels","c":"StitchPanel","l":"StitchPanel(ActionListener)","url":"%3Cinit%3E(java.awt.event.ActionListener)"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"table"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"tableModel"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"tableScrollPane"},{"p":"eu.steffo.cleaver.gui.rows","c":"TitleRow","l":"titleLabel"},{"p":"eu.steffo.cleaver.gui.panels","c":"CreateJobPanel","l":"titlePanel"},{"p":"eu.steffo.cleaver.gui.rows","c":"TitleRow","l":"TitleRow(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"eu.steffo.cleaver.logic.compress","c":"CompressConfig","l":"toString()"},{"p":"eu.steffo.cleaver.logic.crypt","c":"CryptConfig","l":"toString()"},{"p":"eu.steffo.cleaver.logic.progress","c":"FinishedProgress","l":"toString()"},{"p":"eu.steffo.cleaver.logic.progress","c":"NotStartedProgress","l":"toString()"},{"p":"eu.steffo.cleaver.logic.progress","c":"WorkingProgress","l":"toString()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitByPartsConfig","l":"toString()"},{"p":"eu.steffo.cleaver.logic.split","c":"SplitBySizeConfig","l":"toString()"},{"p":"eu.steffo.cleaver.gui.rows","c":"FileSelectRow","l":"update()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CompressRow","l":"updateEnabledState()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"CryptRow","l":"updateEnabledState()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"OptionRow","l":"updateEnabledState()"},{"p":"eu.steffo.cleaver.gui.rows.option","c":"SplitRow","l":"updateEnabledState()"},{"p":"eu.steffo.cleaver.gui.panels","c":"JobsTablePanel","l":"updateTableChanged()"},{"p":"eu.steffo.cleaver.logic.progress","c":"WorkingProgress","l":"WorkingProgress()","url":"%3Cinit%3E()"},{"p":"eu.steffo.cleaver.logic.progress","c":"WorkingProgress","l":"WorkingProgress(float)","url":"%3Cinit%3E(float)"}] \ No newline at end of file diff --git a/docs/overview-summary.html b/docs/overview-summary.html index 0fba5ea..7148163 100644 --- a/docs/overview-summary.html +++ b/docs/overview-summary.html @@ -2,10 +2,10 @@ - + Generated Documentation (Untitled) - + diff --git a/docs/overview-tree.html b/docs/overview-tree.html index 58645ed..82761b3 100644 --- a/docs/overview-tree.html +++ b/docs/overview-tree.html @@ -2,10 +2,10 @@ - + Class Hierarchy - + @@ -77,6 +77,7 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  • eu.steffo.cleaver.logic,
  • eu.steffo.cleaver.logic.compress,
  • eu.steffo.cleaver.logic.crypt,
  • +
  • eu.steffo.cleaver.logic.progress,
  • eu.steffo.cleaver.logic.split
  • @@ -145,17 +146,28 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  • eu.steffo.cleaver.logic.compress.CompressConfig
  • eu.steffo.cleaver.logic.crypt.CryptConfig
  • +
  • eu.steffo.cleaver.Main
  • +
  • eu.steffo.cleaver.logic.progress.Progress + +
  • +
  • eu.steffo.cleaver.logic.split.SplitConfig + +
  • +
  • java.lang.Thread (implements java.lang.Runnable) + diff --git a/docs/package-search-index.js b/docs/package-search-index.js index d05195e..331ae02 100644 --- a/docs/package-search-index.js +++ b/docs/package-search-index.js @@ -1 +1 @@ -packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"},{"l":"eu.steffo.cleaver"},{"l":"eu.steffo.cleaver.gui"},{"l":"eu.steffo.cleaver.gui.panels"},{"l":"eu.steffo.cleaver.gui.rows"},{"l":"eu.steffo.cleaver.gui.rows.option"},{"l":"eu.steffo.cleaver.logic"},{"l":"eu.steffo.cleaver.logic.compress"},{"l":"eu.steffo.cleaver.logic.crypt"},{"l":"eu.steffo.cleaver.logic.split"}] \ No newline at end of file +packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"},{"l":"eu.steffo.cleaver"},{"l":"eu.steffo.cleaver.gui"},{"l":"eu.steffo.cleaver.gui.panels"},{"l":"eu.steffo.cleaver.gui.rows"},{"l":"eu.steffo.cleaver.gui.rows.option"},{"l":"eu.steffo.cleaver.logic"},{"l":"eu.steffo.cleaver.logic.compress"},{"l":"eu.steffo.cleaver.logic.crypt"},{"l":"eu.steffo.cleaver.logic.progress"},{"l":"eu.steffo.cleaver.logic.split"}] \ No newline at end of file diff --git a/docs/serialized-form.html b/docs/serialized-form.html index 9e40938..ffcacaf 100644 --- a/docs/serialized-form.html +++ b/docs/serialized-form.html @@ -2,10 +2,10 @@ - + Serialized Form - + diff --git a/docs/type-search-index.js b/docs/type-search-index.js index 0121fa2..2f3f984 100644 --- a/docs/type-search-index.js +++ b/docs/type-search-index.js @@ -1 +1 @@ -typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"eu.steffo.cleaver.gui.panels","l":"ChopAndStitchPanel"},{"p":"eu.steffo.cleaver.logic","l":"ChopJob"},{"p":"eu.steffo.cleaver.gui.panels","l":"ChopPanel"},{"p":"eu.steffo.cleaver.gui","l":"CleaverFrame"},{"p":"eu.steffo.cleaver.logic.compress","l":"CompressConfig"},{"p":"eu.steffo.cleaver.gui.rows.option","l":"CompressRow"},{"p":"eu.steffo.cleaver.gui.rows","l":"CreateJobButtonRow"},{"p":"eu.steffo.cleaver.gui.panels","l":"CreateJobPanel"},{"p":"eu.steffo.cleaver.logic.crypt","l":"CryptConfig"},{"p":"eu.steffo.cleaver.gui.rows.option","l":"CryptRow"},{"p":"eu.steffo.cleaver.gui.rows","l":"FileSelectRow"},{"p":"eu.steffo.cleaver.logic","l":"Job"},{"p":"eu.steffo.cleaver.gui.panels","l":"JobsButtonsPanel"},{"p":"eu.steffo.cleaver.gui.panels","l":"JobsTablePanel.JobsTableModel"},{"p":"eu.steffo.cleaver.gui.panels","l":"JobsTablePanel"},{"p":"eu.steffo.cleaver","l":"Main"},{"p":"eu.steffo.cleaver.gui.rows.option","l":"OptionRow"},{"p":"eu.steffo.cleaver.gui.rows","l":"Row"},{"p":"eu.steffo.cleaver.logic.split","l":"SplitByPartsConfig"},{"p":"eu.steffo.cleaver.logic.split","l":"SplitBySizeConfig"},{"p":"eu.steffo.cleaver.logic.split","l":"SplitConfig"},{"p":"eu.steffo.cleaver.gui.rows.option","l":"SplitRow"},{"p":"eu.steffo.cleaver.logic","l":"StitchJob"},{"p":"eu.steffo.cleaver.gui.panels","l":"StitchPanel"},{"p":"eu.steffo.cleaver.gui.rows","l":"TitleRow"}] \ No newline at end of file +typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"eu.steffo.cleaver.gui.panels","l":"ChopAndStitchPanel"},{"p":"eu.steffo.cleaver.logic","l":"ChopJob"},{"p":"eu.steffo.cleaver.gui.panels","l":"ChopPanel"},{"p":"eu.steffo.cleaver.gui","l":"CleaverFrame"},{"p":"eu.steffo.cleaver.logic.compress","l":"CompressConfig"},{"p":"eu.steffo.cleaver.gui.rows.option","l":"CompressRow"},{"p":"eu.steffo.cleaver.gui.rows","l":"CreateJobButtonRow"},{"p":"eu.steffo.cleaver.gui.panels","l":"CreateJobPanel"},{"p":"eu.steffo.cleaver.logic.crypt","l":"CryptConfig"},{"p":"eu.steffo.cleaver.gui.rows.option","l":"CryptRow"},{"p":"eu.steffo.cleaver.gui.rows","l":"FileSelectRow"},{"p":"eu.steffo.cleaver.logic.progress","l":"FinishedProgress"},{"p":"eu.steffo.cleaver.logic","l":"Job"},{"p":"eu.steffo.cleaver.gui.panels","l":"JobsButtonsPanel"},{"p":"eu.steffo.cleaver.gui.panels","l":"JobsTablePanel.JobsTableModel"},{"p":"eu.steffo.cleaver.gui.panels","l":"JobsTablePanel"},{"p":"eu.steffo.cleaver","l":"Main"},{"p":"eu.steffo.cleaver.logic.progress","l":"NotStartedProgress"},{"p":"eu.steffo.cleaver.gui.rows.option","l":"OptionRow"},{"p":"eu.steffo.cleaver.logic.progress","l":"Progress"},{"p":"eu.steffo.cleaver.gui.rows","l":"Row"},{"p":"eu.steffo.cleaver.logic.split","l":"SplitByPartsConfig"},{"p":"eu.steffo.cleaver.logic.split","l":"SplitBySizeConfig"},{"p":"eu.steffo.cleaver.logic.split","l":"SplitConfig"},{"p":"eu.steffo.cleaver.gui.rows.option","l":"SplitRow"},{"p":"eu.steffo.cleaver.logic","l":"StitchJob"},{"p":"eu.steffo.cleaver.gui.panels","l":"StitchPanel"},{"p":"eu.steffo.cleaver.gui.rows","l":"TitleRow"},{"p":"eu.steffo.cleaver.logic.progress","l":"WorkingProgress"}] \ No newline at end of file diff --git a/src/eu/steffo/cleaver/gui/CleaverFrame.java b/src/eu/steffo/cleaver/gui/CleaverFrame.java index f71a620..85e7428 100644 --- a/src/eu/steffo/cleaver/gui/CleaverFrame.java +++ b/src/eu/steffo/cleaver/gui/CleaverFrame.java @@ -4,6 +4,7 @@ import eu.steffo.cleaver.gui.panels.ChopAndStitchPanel; import eu.steffo.cleaver.gui.panels.JobsButtonsPanel; import eu.steffo.cleaver.gui.panels.JobsTablePanel; import eu.steffo.cleaver.logic.Job; +import eu.steffo.cleaver.logic.progress.NotStartedProgress; import java.awt.*; import java.awt.event.ActionEvent; @@ -72,7 +73,14 @@ public class CleaverFrame extends JFrame { ActionListener startListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - // TODO + for(Job job : jobs) { + if(job.getProgress().getClass() == NotStartedProgress.class) + { + job.start(); + } + // TODO: refresh the jobs table every once in a while + // TODO: catch exceptions from the jobs + } } }; diff --git a/src/eu/steffo/cleaver/gui/panels/CreateJobPanel.java b/src/eu/steffo/cleaver/gui/panels/CreateJobPanel.java index d96afed..c9f0ef0 100644 --- a/src/eu/steffo/cleaver/gui/panels/CreateJobPanel.java +++ b/src/eu/steffo/cleaver/gui/panels/CreateJobPanel.java @@ -67,13 +67,28 @@ public abstract class CreateJobPanel extends JPanel { } public void createAndAddJobs(ArrayList jobs) { + if(fileSelectPanel.getSelectedFiles().length == 0) { + JOptionPane.showMessageDialog(null, "No files selected.", "Error", JOptionPane.ERROR_MESSAGE); + } for(File file : fileSelectPanel.getSelectedFiles()) { + + SplitConfig sc; try { - Job job = getJobClass().getConstructor(File.class, SplitConfig.class, CryptConfig.class, CompressConfig.class).newInstance(file, splitOptionPanel.getSplitConfig(), cryptOptionPanel.getCryptConfig(), compressOptionPanel.getCompressConfig()); + sc = splitOptionPanel.getSplitConfig(); + } catch (NumberFormatException exc) { + JOptionPane.showMessageDialog(null, "Invalid value in the Split fields.", "Error", JOptionPane.ERROR_MESSAGE); + return; + } + + CryptConfig cc = cryptOptionPanel.getCryptConfig(); + + CompressConfig zc = compressOptionPanel.getCompressConfig(); + + try { + Job job = getJobClass().getConstructor(File.class, SplitConfig.class, CryptConfig.class, CompressConfig.class).newInstance(file, sc, cc, zc); jobs.add(job); } catch (InstantiationException | NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) { - // TODO: open an error jframe instead - ex.printStackTrace(); + JOptionPane.showMessageDialog(null, ex.toString(), "Error", JOptionPane.ERROR_MESSAGE); } } fileSelectPanel.clearSelectedFiles(); diff --git a/src/eu/steffo/cleaver/gui/panels/JobsTablePanel.java b/src/eu/steffo/cleaver/gui/panels/JobsTablePanel.java index a04db5d..9311f25 100644 --- a/src/eu/steffo/cleaver/gui/panels/JobsTablePanel.java +++ b/src/eu/steffo/cleaver/gui/panels/JobsTablePanel.java @@ -71,9 +71,10 @@ public class JobsTablePanel extends JPanel { if(c == null) return ""; return c.toString(); case 5: - return "Not started"; // TODO + return job.getProgress().toString(); + } - return "???"; + return "Unknown"; } } diff --git a/src/eu/steffo/cleaver/logic/ChopJob.java b/src/eu/steffo/cleaver/logic/ChopJob.java index 43f257e..b6b8340 100644 --- a/src/eu/steffo/cleaver/logic/ChopJob.java +++ b/src/eu/steffo/cleaver/logic/ChopJob.java @@ -5,6 +5,10 @@ import eu.steffo.cleaver.logic.crypt.CryptConfig; import eu.steffo.cleaver.logic.split.SplitConfig; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.OutputStream; +import java.util.zip.DeflaterOutputStream; public class ChopJob extends Job { @@ -16,4 +20,21 @@ public class ChopJob extends Job { public String getType() { return "Chop"; } + + @Override + public void run() { + FileInputStream inputStream; + try { + inputStream = new FileInputStream(file); + } catch (FileNotFoundException e) { + e.printStackTrace(); + return; + } + + // TODO: use DeflaterOutputStream to compress + // TODO: create a CipherOutputStream to encrypt + // TODO: create a SplitFileOutputStream to output to multiple files, or use a simple FileOutputStream to output to a single file + + // TODO: end with inputStream.transferTo(outputStream); + } } diff --git a/src/eu/steffo/cleaver/logic/Job.java b/src/eu/steffo/cleaver/logic/Job.java index cfbd844..6c38b54 100644 --- a/src/eu/steffo/cleaver/logic/Job.java +++ b/src/eu/steffo/cleaver/logic/Job.java @@ -4,19 +4,23 @@ import java.io.File; import eu.steffo.cleaver.logic.compress.CompressConfig; import eu.steffo.cleaver.logic.crypt.CryptConfig; +import eu.steffo.cleaver.logic.progress.NotStartedProgress; +import eu.steffo.cleaver.logic.progress.Progress; import eu.steffo.cleaver.logic.split.SplitConfig; -public abstract class Job { - protected File file; - protected SplitConfig splitConfig; - protected CryptConfig cryptConfig; - protected CompressConfig compressConfig; +public abstract class Job extends Thread { + protected final File file; + protected final SplitConfig splitConfig; + protected final CryptConfig cryptConfig; + protected final CompressConfig compressConfig; + protected Progress progress; public Job(File file, SplitConfig splitConfig, CryptConfig cryptConfig, CompressConfig compressConfig) { this.file = file; this.splitConfig = splitConfig; this.cryptConfig = cryptConfig; this.compressConfig = compressConfig; + this.progress = new NotStartedProgress(); } public abstract String getType(); @@ -36,4 +40,8 @@ public abstract class Job { public CompressConfig getCompressConfig() { return compressConfig; } + + public Progress getProgress() { + return progress; + } } diff --git a/src/eu/steffo/cleaver/logic/StitchJob.java b/src/eu/steffo/cleaver/logic/StitchJob.java index c266a2e..b3c20bd 100644 --- a/src/eu/steffo/cleaver/logic/StitchJob.java +++ b/src/eu/steffo/cleaver/logic/StitchJob.java @@ -16,4 +16,9 @@ public class StitchJob extends Job { public String getType() { return "Stitch"; } + + @Override + public void run() { + + } } diff --git a/src/eu/steffo/cleaver/logic/progress/FinishedProgress.java b/src/eu/steffo/cleaver/logic/progress/FinishedProgress.java new file mode 100644 index 0000000..c8e5570 --- /dev/null +++ b/src/eu/steffo/cleaver/logic/progress/FinishedProgress.java @@ -0,0 +1,8 @@ +package eu.steffo.cleaver.logic.progress; + +public class FinishedProgress extends Progress { + @Override + public String toString() { + return "Finished"; + } +} diff --git a/src/eu/steffo/cleaver/logic/progress/NotStartedProgress.java b/src/eu/steffo/cleaver/logic/progress/NotStartedProgress.java new file mode 100644 index 0000000..76eda70 --- /dev/null +++ b/src/eu/steffo/cleaver/logic/progress/NotStartedProgress.java @@ -0,0 +1,8 @@ +package eu.steffo.cleaver.logic.progress; + +public class NotStartedProgress extends Progress { + @Override + public String toString() { + return "Not started"; + } +} diff --git a/src/eu/steffo/cleaver/logic/progress/Progress.java b/src/eu/steffo/cleaver/logic/progress/Progress.java new file mode 100644 index 0000000..20c4e56 --- /dev/null +++ b/src/eu/steffo/cleaver/logic/progress/Progress.java @@ -0,0 +1,4 @@ +package eu.steffo.cleaver.logic.progress; + +public abstract class Progress { +} diff --git a/src/eu/steffo/cleaver/logic/progress/WorkingProgress.java b/src/eu/steffo/cleaver/logic/progress/WorkingProgress.java new file mode 100644 index 0000000..b245013 --- /dev/null +++ b/src/eu/steffo/cleaver/logic/progress/WorkingProgress.java @@ -0,0 +1,18 @@ +package eu.steffo.cleaver.logic.progress; + +public class WorkingProgress extends Progress { + protected float progress; + + public WorkingProgress() { + this.progress = 0f; + } + + public WorkingProgress(float progress) { + this.progress = progress; + } + + @Override + public String toString() { + return String.format("%.0f%%", progress * 100); + } +}