|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.kirkwarez.wdysdv.system.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 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 |
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. |
protected void |
openWindow(File file,
int type,
int mode)
This method opens a new window on the GUI, that contains the contents of the given file for editing. |
void |
processBatch(Batch batch)
Processes the given batch. |
void |
processSingle(Task task)
Processes a single task. |
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. |
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 actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
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
WVException
public void openFile(File file, int type, int mode)
file
- The file to open.public void openFolder(File folder, int type, int mode)
folder
- The folder with the files to open.public void openBatch(Batch batch)
batch
- The batch with the files to open.public void processSingle(Task task) throws IOException
task
- The task to process.
IOException
- When the file stuff barfs.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 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.
protected void updateBatchList(Batch batch)
batch
- The batch to update with.protected void openWindow(File file, int type, int mode) throws IOException
This method opens a new window on the GUI, that contains the contents of the given file for editing. The contents are decrypted using the given type of encryption depending on the mode.
If the mode is to decrypt, the file will be decrypted before it is shown. However if the mode is to encrypt, the file will be shown as is, because one can assume that is what the user wants to see.
file
- The file to show.type
- The type of encryption (Uru ot MYST V).mode
- The mode of encryption (encrypt or decrypt).
IOException
- When the window can't do its streamstuff without errors.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |