edu.trinity.cs.gamecore
Class ScreenEditor
java.lang.Object
edu.trinity.cs.gamecore.ScreenEditor
public class ScreenEditor
- extends java.lang.Object
This class is designed to let humans easily interact with and build
screens once the class for that screen has been written. Students don't
call this code from their code. Instead, they can run the main in this.
It should be passed two arguments, a class name and the name of a file to
save the screens in.
Constructor Summary |
ScreenEditor(java.lang.String className,
java.lang.String fileName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScreenEditor
public ScreenEditor(java.lang.String className,
java.lang.String fileName)
main
public static void main(java.lang.String[] args)
getSelectedBlock
public Block getSelectedBlock()
getSelectedGameEntity
public GameEntity getSelectedGameEntity()
blockSelected
public void blockSelected()
entitySelected
public void entitySelected()
readScreenVector
public static java.util.Vector readScreenVector(java.lang.String fileName)
throws java.io.FileNotFoundException,
java.io.IOException,
java.lang.ClassNotFoundException
- Call this function to read in Screen objects that have been saved by the
ScreenEditor. You should provide the file name.
- Parameters:
fileName
- A string for the name of the file to be loaded.
- Throws:
java.lang.ClassCastException
- The data read in isn't a Vector this is thrown.
java.io.FileNotFoundException
- The filename provided doesn't correspond to a file.
java.io.IOException
- There was an error reading the file.
java.lang.ClassNotFoundException
- The class that was deserialzed couldn't be found in the classpath.
readScreenVector
public static java.util.Vector readScreenVector(java.io.InputStream is)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Call this function to read in Screen objects that have been saved by the
ScreenEditor. You should provide a valid input stream that it can be
read from. This form is particularly handy when you are reading the
data from someplace other than a file, like across a network. In that
case you can pass it an InputStream that you get from a URL or Socket
object.
- Parameters:
is
- An input stream from which the screen data can be read.
- Throws:
java.lang.ClassCastException
- If the data read in isn't a Vector this is thrown.
java.io.IOException
- There was an error reading the file.
java.lang.ClassNotFoundException
- The class that was deserialzed couldn't be found in the classpath.