net.sf.filePiper.gui
Class GuiPipelineEnvironment

java.lang.Object
  extended by net.sf.filePiper.gui.GuiPipelineEnvironment
All Implemented Interfaces:
PipelineEnvironment

public class GuiPipelineEnvironment
extends Object
implements PipelineEnvironment


Constructor Summary
GuiPipelineEnvironment(Pipeline processPipeline, PiperMainPanel mainPanel)
           
 
Method Summary
 void abortProcessing()
          Tell this environment that the current file processing should be aborted.
 boolean canOverwriteFile(File existingFile)
          Check if an existing file can be overwritten by the pipe-line processing.
 void fileSkipped(File dest)
          Notify the environment of the currently processed output file is not written to avoid overriding an existing file.
 void finished(Exception e)
          Notify the environment that the pipe-line processing is finished.
 OutputStream getConsoleStream()
          Get an output stream to write to the console.
 File getCurrentInputFile()
           
 File getCurrentOutputFile()
           
 boolean isAborted()
           
 boolean isErrored()
           
 boolean isRunning()
           
 void outputtingToFile(File dest)
          Notify the environment of the currently processed output file.
 void processInputFile(File src)
          Notify the environment of the currently processed input file.
 void scanningDirectory(File dir)
          Notify the environment that the pipeline is scanning directory to find file to process.
 boolean shouldContinue()
          Check if the processing should continue.
 void startProcessing()
          Notify the environment that the pipe-line processing has started.
 void startUpdate()
           
 void stopUpdate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiPipelineEnvironment

public GuiPipelineEnvironment(Pipeline processPipeline,
                              PiperMainPanel mainPanel)
Method Detail

startUpdate

public void startUpdate()

stopUpdate

public void stopUpdate()

startProcessing

public void startProcessing()
Description copied from interface: PipelineEnvironment
Notify the environment that the pipe-line processing has started.

Specified by:
startProcessing in interface PipelineEnvironment

abortProcessing

public void abortProcessing()
Description copied from interface: PipelineEnvironment
Tell this environment that the current file processing should be aborted.
Once this method is called, shouldContinue() must return false.

Specified by:
abortProcessing in interface PipelineEnvironment

finished

public void finished(Exception e)
Description copied from interface: PipelineEnvironment
Notify the environment that the pipe-line processing is finished.

Specified by:
finished in interface PipelineEnvironment
Parameters:
e - if not null, it means that the processing was stopped by this exception.

getCurrentInputFile

public File getCurrentInputFile()

getCurrentOutputFile

public File getCurrentOutputFile()

outputtingToFile

public void outputtingToFile(File dest)
Description copied from interface: PipelineEnvironment
Notify the environment of the currently processed output file.

Specified by:
outputtingToFile in interface PipelineEnvironment

scanningDirectory

public void scanningDirectory(File dir)
Description copied from interface: PipelineEnvironment
Notify the environment that the pipeline is scanning directory to find file to process.

Specified by:
scanningDirectory in interface PipelineEnvironment

processInputFile

public void processInputFile(File src)
Description copied from interface: PipelineEnvironment
Notify the environment of the currently processed input file.

Specified by:
processInputFile in interface PipelineEnvironment

shouldContinue

public boolean shouldContinue()
Description copied from interface: PipelineEnvironment
Check if the processing should continue. The environment can decide to abort the pipe-line processing by returning false.

Specified by:
shouldContinue in interface PipelineEnvironment
Returns:
true to continue, false to abort.

canOverwriteFile

public boolean canOverwriteFile(File existingFile)
Description copied from interface: PipelineEnvironment
Check if an existing file can be overwritten by the pipe-line processing.

Specified by:
canOverwriteFile in interface PipelineEnvironment
Parameters:
existingFile - the existing file that is about to be overwritten.
Returns:
true to overwrite, false to skip.

fileSkipped

public void fileSkipped(File dest)
Description copied from interface: PipelineEnvironment
Notify the environment of the currently processed output file is not written to avoid overriding an existing file.

Specified by:
fileSkipped in interface PipelineEnvironment

getConsoleStream

public OutputStream getConsoleStream()
Description copied from interface: PipelineEnvironment
Get an output stream to write to the console.

Specified by:
getConsoleStream in interface PipelineEnvironment
Returns:
an output stream to write to the console.

isRunning

public boolean isRunning()
Specified by:
isRunning in interface PipelineEnvironment

isAborted

public boolean isAborted()
Specified by:
isAborted in interface PipelineEnvironment

isErrored

public boolean isErrored()
Specified by:
isErrored in interface PipelineEnvironment


Copyright © 2010. All Rights Reserved.