|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.WindowAdapter
com.kirkwarez.wdysdv.control.WVControl
This class acts a control class that processes all the user's actions in the main window.
Field Summary | |
protected Batch |
batch
The batch. |
protected DisplayControl |
displaycontrol
The control class for the extra windows. |
protected WVFrame |
gui
The associated GUI. |
protected Processor |
processor
Our personal batch processor. |
Constructor Summary | |
WVControl(WVFrame gui)
Constructs a new control class related with the given GUI. |
Method Summary | |
void |
actionPerformed(ActionEvent event)
Processes an event created by the GUI because of user interaction. |
void |
addTask(Task task)
Adds the given task to the batchlist. |
void |
addTasks(File infolder,
File outfolder)
Adds the given folder of files to the batchlist by making tasks of each, using the settings in the GUI and adapting the filenames. |
protected File |
browseInFile()
Makes the GUI ask the user for an input file and returns that. |
protected File |
browseOutFile()
Makes the GUI ask the user for an output file and returns that. |
protected void |
clearTask()
Clears the GUI's task settings. |
protected boolean |
folder()
Returns whether the input field is a file or a folder. |
protected File[] |
getFiles(File folder)
Returns all the files in the given folder that comply with the current settings in the GUI. |
protected Task |
getNewTask()
Retrieves data from the GUI and makes a Task out of it. |
protected File |
getSuggestedOutFile(File in,
File folder)
Sets the suggested output filename in the output filename field. |
void |
itemStateChanged(ItemEvent event)
Processes a checkbox event. |
void |
openBatch(Batch batch)
Opens all the files in the batch in the GUI in new windows. |
void |
openFile(File file,
int type,
int mode)
Opens the given file in the GUI in a new window. |
void |
openFolder(File folder,
int type,
int mode)
Opens all the files in the given folder in the GUI in new windows. |
void |
processBatch(Batch batch)
Processes the given batch. |
void |
processTask(Task task)
Processes a single task. |
void |
processTasks(File infolder,
File outfolder)
Processes a folder of tasks :^P |
void |
removeAllTasks()
Removes all Task s from the batch. |
void |
removeTask(int index)
Removes the Task on the given index from the batch. |
void |
returnTask(int index)
Removes the Task on the given index from the batch and put it in the
GUI. |
void |
setInFile(File in)
Sets the input file field in the GUI to the given file. |
protected void |
setNewTask(Task task)
Takes the given Task and puts its data in the GUI. |
void |
setOutFile(File out)
Sets the output file field in the GUI to the given file. |
protected boolean |
single()
Returns whether the GUI is in single or in batch mode. |
protected void |
updateBatchList(Batch batch)
Updates the lsit in the GUI with the given batch. |
void |
windowClosing(WindowEvent event)
Closes the GUI and exists the program. |
Methods inherited from class java.awt.event.WindowAdapter |
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Batch batch
protected Processor processor
protected DisplayControl displaycontrol
protected WVFrame gui
Constructor Detail |
public WVControl(WVFrame gui)
Method Detail |
public void windowClosing(WindowEvent event)
windowClosing
in interface WindowListener
event
- The event that happened.public void itemStateChanged(ItemEvent event)
itemStateChanged
in interface ItemListener
event
- The event.public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
event
- The event that happened.ActionListener.actionPerformed(java.awt.event.ActionEvent)
public void setInFile(File in)
in
- The file to set it to.public void setOutFile(File out)
out
- The file to set it to.public void addTask(Task task)
task
- The task to add.public void addTasks(File infolder, File outfolder) throws WVException
infolder
- The folder of files to batch.outfolder
- The output folder where the batched files go to.
WVException
- When folders aren't folders.public void openFile(File file, int type, int mode) throws IOException
file
- The file to open.
IOException
- When the window can't do its streamstuff without errors.public void openFolder(File folder, int type, int mode) throws IOException
folder
- The folder with the files to open.
IOException
- When the windows can't do their streamstuff without errors.public void openBatch(Batch batch) throws IOException
batch
- The batch with the files to open.
IOException
- When the windows can't do their streamstuff without errors.public void processTask(Task task) throws IOException
task
- The task to process.
IOException
- When the file stuff barfs.public void processTasks(File infolder, File outfolder) throws IOException, WVException
infolder
- The folder of files to batch.outfolder
- The output folder where the batched tasks go to.
IOException
- When the file stuff barfs.
WVException
- When folders aren't folders.public void processBatch(Batch batch) throws IOException
batch
- The batch with tasks to process.
IOException
- When the file stuff barfs.public void removeTask(int index)
Task
on the given index from the batch.
index
- The index of the task.public void removeAllTasks()
Task
s from the batch.
public void returnTask(int index)
Task
on the given index from the batch and put it in the
GUI.
index
- The index of the task.protected boolean single()
protected boolean folder()
protected File browseInFile()
protected File browseOutFile()
protected File getSuggestedOutFile(File in, File folder)
in
- The input filename to construct it from.folder
- The folder to use as output folder.
protected File[] getFiles(File folder)
NullPointerException
- When the given folder is null.protected Task getNewTask() throws WVException
Task
out of it.
Task
.
WVException
- If the user didn't fill in a file field.protected void setNewTask(Task task)
Task
and puts its data in the GUI.
task
- The Task
to put up in the GUI.protected void updateBatchList(Batch batch)
batch
- The batch to update with.protected void clearTask()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |