|
|||||||||||
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.DisplayControl
This class controls the seperate windows and processes their events.
Field Summary | |
protected ArrayList |
windowlist
The list with open windows. |
Constructor Summary | |
DisplayControl()
Constructs a new DisplayControl . |
Method Summary | |
void |
actionPerformed(ActionEvent event)
Processes an event created by an extra window because of user interaction. |
protected File |
browse(DisplayFrame frame)
Makes the window ask the user for a file and returns that. |
void |
closeAllWindows()
Closes all the windows controlled by this class. |
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 |
saveDecrypted(String text,
File file)
Saves the given text into the given file. |
void |
saveEncrypted(int type,
String text,
File file)
Encrypts the given text into the correct type of encryption, and writes it to the given file. |
void |
windowClosing(WindowEvent event)
Closes the DisplayWindow indicated by the given
WindowEvent after doing stuff. |
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 ArrayList windowlist
Constructor Detail |
public DisplayControl()
DisplayControl
.
Method Detail |
public void windowClosing(WindowEvent event)
DisplayWindow
indicated by the given
WindowEvent
after doing stuff.
windowClosing
in interface WindowListener
event
- The event that happened.public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
event
- The event that happened.ActionListener.actionPerformed(java.awt.event.ActionEvent)
public void saveEncrypted(int type, String text, File file) throws IOException
type
- The encryption type to use.text
- The text to encrypt and save.file
- The file to save to.
IOException
- When streamstuffs go wrong.public void saveDecrypted(String text, File file) throws IOException
text
- The text to save.file
- The file to save to.
IOException
- When streamstuffs go wrong.protected File browse(DisplayFrame frame)
public 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.public void closeAllWindows()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |