Changeset 31721 for main


Ignore:
Timestamp:
2017-06-02T17:37:25+12:00 (7 years ago)
Author:
ak19
Message:

Removed unnecessary comments. Emacs tabbing.

Location:
main/trunk/gli/src/org/greenstone/gatherer/download
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java

    r31720 r31721  
    212212        previous_state = getState();
    213213        if (getState() == RUNNING) {
    214         //setState(STOPPED);
    215         stopDownload(); // cancels any running SafeProcess
     214        stopDownload(); // cancels any running SafeProcess, will set the current state to STOPPED when the time is right
    216215        } else {
    217         //previous_state = getState();
    218216        setState(RUNNING);
    219217        mummy.resumeThread();
     
    225223        if(getState() == RUNNING) {
    226224        previous_state = getState();
    227         //setState(STOPPED); // do we need to do anything else to stop this? YES, we do:
    228         stopDownload(); // cancels any running SafeProcess
     225        stopDownload(); // cancels any running SafeProcess, will set the current state to STOPPED when the time is right
    229226        }
    230227        mummy.deleteDownloadJob(this);
     
    731728
    732729    SafeProcess.log("@@@@ DONE callDownload()");
    733    
    734     /*
    735     // Regardless of whether state==STOPPED or ends up being COMPLETE, the process is at an end now.
    736     // Notify the DownloadScrollPane which is waiting on this job to complete that we are ready
    737     synchronized(this) {
    738         System.err.println("**************** Notifying download scrollpane");
    739         this.notify();
    740     }
    741     */ 
    742730
    743731    // refresh the workspace tree
     
    758746        boolean hadToSendInterrupt = prcs.cancelRunningProcess(); // returns false if it was already terminating/terminated, true if interrupt sent
    759747
    760 
    761         /*
    762           // if process terminating naturally but waiting for process' worker threads to join(),
    763           // shall we just remove the progress bar display for this download?
    764           // If so, do this section in place of the 2 calls to progress.enableCancelJob(boolean) below
    765         if(!hadToSendInterrupt && SwingUtilities.isEventDispatchThread()) {
    766         if(getState() == DownloadJob.RUNNING) {
    767             progress.mirrorComplete();
    768             previous_state = getState();
    769             setState(DownloadJob.COMPLETE);     
    770         }
    771         mummy.deleteCurrentDownloadJob(this); // why wait for the cleanup which can't be interrupted anyway?
    772         }
    773         */
    774748    } else {
    775749        System.err.println("@@@@ No process to interrupt");
     
    807781        mummy.deleteCurrentDownloadJob(this);
    808782        }
    809     } /*else {
    810         // If we've got to here and the state isn't STOPPED then the
    811         // job is complete.
    812         System.err.println("**************** NOT Notifying download scrollpane");
    813         if(getState() == DownloadJob.RUNNING) {
    814         progress.mirrorComplete();
    815         previous_state = getState();
    816         setState(DownloadJob.COMPLETE);     
    817         }
    818     }
    819    
    820     // Regardless of whether state==STOPPED or ends up being COMPLETE, the process is at an end now.
    821     // Notify the DownloadScrollPane which is waiting on this job to complete that we are ready
    822     synchronized(this) {
    823         System.err.println("**************** Notifying download scrollpane");
    824         this.notify();
    825         }*/
    826 
     783    }
    827784    }
    828785
  • main/trunk/gli/src/org/greenstone/gatherer/download/DownloadScrollPane.java

    r31692 r31721  
    7979    }
    8080
    81     /**
    82     * To be used with DownloadJob.java's old_callDownload() and old_actionPerformed()
    83     * OR by uncommenting the "synchronized(this)" section in Download.java at the end of
    84     * its new callDownload() along with commenting out "mummy.deleteCurrentDownloadJob(this);"
    85     * in Download.java's doneCleanup().
    86     */
     81    /**
     82    * To be used with DownloadJob.java's old_callDownload() and old_actionPerformed()
     83    * OR by uncommenting the "synchronized(this)" section in Download.java at the end of
     84    * its new callDownload() along with commenting out "mummy.deleteCurrentDownloadJob(this);"
     85    * in Download.java's doneCleanup().
     86     */
    8787    public void old_deleteDownloadJob(DownloadJob delete_me) {
    8888    if (delete_me == job) {
     
    107107    }
    108108
    109     /**
    110     * If called to delete the current download job, this method won't do anything.
    111     * But if called on any inactive download job, its display is removed.
    112     */
     109    /**
     110    * If called to delete the current download job, this method won't do anything.
     111    * But if called on any inactive download job, its display is removed.
     112     */
    113113    public void deleteDownloadJob(DownloadJob delete_me) {
    114114    if (delete_me != job) {
     
    121121    }
    122122
    123     /**
    124     * To be called when we're ready to delete the current download job,
    125     * else this method won't do anything
    126     */
     123    /**
     124    * To be called when we're ready to delete the current download job,
     125    * else this method won't do anything
     126     */
    127127    public void deleteCurrentDownloadJob(DownloadJob delete_me) {
    128128    if (delete_me == job) {
Note: See TracChangeset for help on using the changeset viewer.