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 />

}<br />

}<br />

public void tryToOpenSafe(int id)<br />

{<br />

try<br />

{<br />

safeDialog.show(id);<br />

}<br />

catch(Exception e)<br />

{<br />

Debugger.debug(getClass(),1,e.getMessage());<br />

}<br />

}<br />

protected void openSafe(String safeKeyFilePath, String safePassword) throws Exception<br />

{<br />

Debugger.debug(getClass(), 1, "Opening safe using...");<br />

Debugger.debug(getClass(), 1, " Filepath: " + safeKeyFilePath);<br />

}<br />

Debugger.debug(getClass(), 1, " Password: " + safePassword);<br />

control.openSafe(safeKeyFilePath, safePassword);<br />

this.safeKeyFilePath = safeKeyFilePath;<br />

this.safePassword = safePassword;<br />

Debugger.debug(getClass(), 1, " Successful.");<br />

safeInfoExists = true;<br />

protected void wakeUpControlThreads()<br />

{<br />

control.wakeUptheSleeping();<br />

}<br />

protected void showStatus()<br />

{<br />

showMessage("Money status:\n " + getSafeStatus());<br />

}<br />

protected String getSafeStatus()<br />

{<br />

return control.getSafe().toString();<br />

}<br />

//Centers the window on the screen<br />

private void center()<br />

{<br />

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();<br />

Dimension frameSize = getSize();<br />

int x = (screenSize.width - frameSize.width) / 2;<br />

int y = (screenSize.height - frameSize.height) / 2;<br />

setLocation(x, y);<br />

}<br />

private void shutdown()<br />

{<br />

control.shutdown();<br />

}<br />

private class listener implements ActionListener<br />

{<br />

public void actionPerformed(ActionEvent e)<br />

{<br />

if(e.getActionCommand().equals("Money Status"))<br />

{<br />

Debugger.debug(getClass(),3,"Money status...");<br />

if(safeInfoExists && control.getSafe().isOpen())<br />

{<br />

showStatus();<br />

246

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

Saved successfully!

Ooh no, something went wrong!