29.07.2013 Views

Master of Science thesis Fighting Spam

Master of Science thesis Fighting Spam

Master of Science thesis Fighting Spam

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

else<br />

safeDialog.show(OpenSafeDialog.SAFE_STATUS_ID, 0.0,null,null);<br />

}<br />

else if(e.getActionCommand().equals("Generate Key-file"))<br />

{<br />

Debugger.debug(getClass(),3,"Generate pressed...");<br />

String s="";<br />

try<br />

{<br />

s = control.generateKeyFile(Config.defaultSafeKeyFilePath);<br />

}<br />

catch(Exception ex)<br />

{<br />

errorDialog.showError("A new key for the safe could not be<br />

generated.");<br />

return;<br />

}<br />

showMessage("A new key for the safe has been generated and saved in the<br />

file: "+s);<br />

}<br />

else if(e.getActionCommand().equals("Hide"))<br />

setState(Frame.ICONIFIED);<br />

else<br />

shutdown();<br />

}<br />

}<br />

}<br />

private class WindowIsClosing extends WindowAdapter<br />

{<br />

public void windowClosing(WindowEvent e)<br />

{<br />

shutdown();<br />

}<br />

}<br />

10.1.4.i OpenSafeDialog<br />

package <strong>Spam</strong>Cash.Client.GUI;<br />

import javax.swing.*;<br />

import java.awt.event.*;<br />

import java.awt.*;<br />

import java.io.*;<br />

import <strong>Spam</strong>Cash.Utilities.Debugger;<br />

import <strong>Spam</strong>Cash.Utilities.*;<br />

public class OpenSafeDialog extends JDialog<br />

{<br />

private MainFrame frame;<br />

private final String informationtext =<br />

"Please provide the path for the key-file and the password to access the safefile.<br />

This is needed to get access to the e-cash and the private-key.";<br />

private final String[] labels =<br />

{"Path <strong>of</strong> the key-file ", "Password "};<br />

private final String[] buttonTypeNames =<br />

{"_normal", "_pressed", "_point"};<br />

private FormPanel logonPanel;<br />

private TopPanel topPanel;<br />

private JTextArea informationTextArea;<br />

private double amount;<br />

//To specify if it is a deposit or withdrawal<br />

247

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!