|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectRecord
public class Record
This class handles the recording of moves and saving of log files. Moves are stored in a linked list and are written to a file all at once when saveLog() is called.
LogFile,
LogEntry| Field Summary | |
|---|---|
(package private) boolean |
isRecording
true if the record object is currently recording |
(package private) java.util.Iterator |
mlIterator
Iterator for the list of log entries |
(package private) java.util.LinkedList |
moveList
A list of LogEntries |
(package private) java.util.Calendar |
nowCalendar
Current calender object |
(package private) CLIPFrame |
parentFrame
The frame that the application runs in |
(package private) java.util.Calendar |
startCalendar
Calender object from the time recording was started |
(package private) long |
timeLast
Stores the time that the last move occured at |
(package private) long |
timeNow
Stores the current time |
(package private) long |
timeStart
Stores the time at which the recording began |
| Constructor Summary | |
|---|---|
Record(CLIPFrame parentF)
Constructor sets the frame object and creates a new move list. |
|
| Method Summary | |
|---|---|
boolean |
isRecording()
Returns true if recording is turned on. |
void |
printList()
A debug function that prints the list of moves to the console. |
void |
recordAddBlankTile(int tileID,
java.lang.String name,
java.lang.String desc)
This records an 'add blank tile' move. |
void |
recordAddBlankTileToGrid(int tileID,
java.lang.String name,
java.lang.String desc,
int x,
int y)
This records an 'add blank tile in grid' move. |
void |
recordEditBlankTile(int tileID,
java.lang.String name,
java.lang.String desc,
java.lang.String oldName,
java.lang.String oldDesc)
This records an 'edit blank tile' move. |
void |
recordLoadLog(long tStart,
long tEnd)
Records a 'load' move. |
void |
recordMove(int type,
int tileID,
int xOld,
int yOld,
int xNew,
int yNew)
This records a 'move' type entry defined by the parameters. |
void |
recordRemoveBlankTile(int moveType,
int tileID,
java.lang.String name,
java.lang.String desc,
int oldX,
int oldY)
This records a 'remove blank tile' move. |
void |
recordSaveLog()
Records a 'save' move. |
void |
recordTileBinWidthChange(int oldX,
int newX)
This records a 'tilebin width change' move. |
boolean |
saveLog(java.lang.String fPath)
This function saves a log file at the specified path. |
private void |
setTimes(LogEntry theMove)
Generates the elapsed time and previous move time then sets them for the passed in LogEntry. |
void |
startRecording()
Starts recording and sets the start time. |
void |
stopRecording()
Stops recording. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
boolean isRecording
true if the record object is currently recording
java.util.Calendar startCalendar
java.util.Calendar nowCalendar
long timeStart
long timeLast
long timeNow
java.util.LinkedList moveList
LogEntryjava.util.Iterator mlIterator
CLIPFrame parentFrame
| Constructor Detail |
|---|
public Record(CLIPFrame parentF)
| Method Detail |
|---|
public boolean isRecording()
true if recording is turned on.
true if recording is turned on;
returns false otherwise.public void startRecording()
public void stopRecording()
public void printList()
print()
function of a LogEntry.
LogEntry.print()private void setTimes(LogEntry theMove)
LogEntry.
theMove - The LogEntry to set the times for
public void recordMove(int type,
int tileID,
int xOld,
int yOld,
int xNew,
int yNew)
type - The type of the movetileID - ID of the tile movedxOld - Old X position of the tileyOld - Old Y position of the tilexNew - New X position of the tileyNew - New Y position of the tile
public void recordAddBlankTile(int tileID,
java.lang.String name,
java.lang.String desc)
tileID - ID of the added tilename - Name of the added tiledesc - Description of the added tile
public void recordAddBlankTileToGrid(int tileID,
java.lang.String name,
java.lang.String desc,
int x,
int y)
tileID - ID of the tile to addname - Name of the tile to adddesc - Description of the tile to addx - X Location of the added tiley - Y Location of the added tile
public void recordEditBlankTile(int tileID,
java.lang.String name,
java.lang.String desc,
java.lang.String oldName,
java.lang.String oldDesc)
tileID - Tile ID of the edited tilename - Name of the edited tiledesc - Description of the edited tileoldName - Old name of the edited tileoldDesc - Old description of the edited tile
public void recordRemoveBlankTile(int moveType,
int tileID,
java.lang.String name,
java.lang.String desc,
int oldX,
int oldY)
moveType - Type of removal (from grid or tilebin)tileID - ID of the removed tilename - Name of the removed tiledesc - Description of the removed tileoldX - Old X position of the removed tileoldY - Old Y position of the removed tileLogEntry
public void recordTileBinWidthChange(int oldX,
int newX)
oldX - Old width of the tilebin (in # of tiles wide)newX - New width of the tilebin (in # of tiles wide)public void recordSaveLog()
public void recordLoadLog(long tStart,
long tEnd)
tStart - Start time of the logtEnd - End time of the log (save time)public boolean saveLog(java.lang.String fPath)
LogFile object, adds the current TileSet
and the move list to it, then outputs the log with
zip compression.
fPath - Path and name of file to save
truefalse on failure.LogFile,
TileSet
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||