Added documentation, fleshed out accessors for class Timeline.

This commit is contained in:
Jonathan Bernard
2010-01-06 09:57:17 -06:00
parent 6d212ea771
commit 7f2c1a6d53
9 changed files with 160 additions and 65 deletions

View File

@ -8,8 +8,12 @@ class TimeStamperMainController {
def model
def view
def syncTimers = [:]
void mvcGroupInit(Map args) {
def configFile
logger.traceIfEnabled("Initializing TimeStamperMain MVC...")
def thisMVC = ['model': model, 'view': view, 'controller': this]
@ -23,13 +27,13 @@ class TimeStamperMainController {
// load application properties
Properties prop = new Properties()
String userHomeDir = System.getProperty('user.home')
model.configFile = new File(userHomeDir, ".timestamperrc")
if (!model.configFile.exists()) model.configFile.createNewFile()
configFile = new File(userHomeDir, ".timestamperrc")
if (!configFile.exists()) configFile.createNewFile()
logger.traceIfEnabled("Reading configuration from "
+ "'${model.configFile.name}'")
+ "'${configFile.name}'")
try { model.configFile.withInputStream { prop.load(it) } }
try { configFile.withInputStream { prop.load(it) } }
catch (IOException ioe) {
logger.error('Unable to load configuration', ioe)
}
@ -45,8 +49,9 @@ class TimeStamperMainController {
logger.traceIfEnabled("Reading Timeline properties from '${lastUsed}'")
File propertyFile = new File(lastUsed)
if (!propertyFile.exists()) propertyFile.createNewFile()
model.timelinePropertiesFile = new File(lastUsed)
if (!model.timelinePropertiesFile.exists())
model.timelinePropertiesFile.createNewFile()
load(propertyFile)
}