de.caff.maze
Class NullSystemAccess

java.lang.Object
  extended by de.caff.maze.TemporaryDataStorage
      extended by de.caff.maze.NullSystemAccess
All Implemented Interfaces:
DataStorage, SystemAccess

 class NullSystemAccess
extends TemporaryDataStorage
implements SystemAccess

A minimalist system access which does not actually access the system. Persistent data is only stored for the given session.

 

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.caff.maze.SystemAccess
SystemAccess.FileType
 
Field Summary
 
Fields inherited from class de.caff.maze.TemporaryDataStorage
persistentData
 
Fields inherited from interface de.caff.maze.SystemAccess
IMAGE_FILE_TYPE, MAZE_FILE_TYPE
 
Constructor Summary
NullSystemAccess()
           
 
Method Summary
 byte[] getUserFileContent(SystemAccess.FileType filetype)
          Get the contents of a user selected file.
 boolean print(java.awt.print.Printable printable)
          Print the given printable.
 boolean saveUserFileContent(byte[] content, SystemAccess.FileType filetype)
          Save a byte array into a user selected file.
 void setMainFrame(javax.swing.JFrame frame)
          Sets the main frame of the application.
 
Methods inherited from class de.caff.maze.TemporaryDataStorage
getBoolean, getColor, getDouble, getInt, getLong, getString, hasKey, setBoolean, setColor, setDouble, setInt, setLong, setString, storePersistentData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.caff.maze.DataStorage
getBoolean, getColor, getDouble, getInt, getLong, getString, hasKey, setBoolean, setColor, setDouble, setInt, setLong, setString, storePersistentData
 

Constructor Detail

NullSystemAccess

NullSystemAccess()
Method Detail

print

public boolean print(java.awt.print.Printable printable)
Print the given printable.

Specified by:
print in interface SystemAccess
Parameters:
printable - printable to be printed
Returns:
true: printing was successful, false: printing failed or was canceled

getUserFileContent

public byte[] getUserFileContent(SystemAccess.FileType filetype)
                          throws java.io.IOException
Get the contents of a user selected file.

Specified by:
getUserFileContent in interface SystemAccess
Throws:
java.io.IOException - on errors during file access
Parameters:
filetype - type of file to be used
Returns:
byte array or null if the user canceled the operation

saveUserFileContent

public boolean saveUserFileContent(byte[] content,
                                   SystemAccess.FileType filetype)
                            throws java.io.IOException
Save a byte array into a user selected file.

Specified by:
saveUserFileContent in interface SystemAccess
Throws:
java.io.IOException - on errors during file access
Parameters:
content - the content of the file
filetype - type of file to be used
Returns:
true if the user saved the file, false otherwise

setMainFrame

public void setMainFrame(javax.swing.JFrame frame)
Sets the main frame of the application. This is useful for centering dialogs.

Specified by:
setMainFrame in interface SystemAccess
Parameters:
frame - application's main frame