Class: JLDrill::LoadTatoebaContext
Overview
Load the kanji, radicals and kana files one after another.
Instance Attribute Summary collapse
#mainView, #parent, #viewBridge
Instance Method Summary
collapse
#addView, #exit, #isEntered?, #onExit, #peekAtView, #setupViews
Constructor Details
Returns a new instance of LoadTatoebaContext.
Instance Attribute Details
#japaneseFile ⇒ Object
Returns the value of attribute japaneseFile.
13
14
15
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 13
def japaneseFile
@japaneseFile
end
|
#sentencesFile ⇒ Object
Returns the value of attribute sentencesFile.
13
14
15
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 13
def sentencesFile
@sentencesFile
end
|
Instance Method Details
#createViews ⇒ Object
24
25
26
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 24
def createViews
@mainView = @viewBridge.VBoxView.new(self)
end
|
#destroyViews ⇒ Object
28
29
30
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 28
def destroyViews
@mainView = nil
end
|
#enter(parent, tatoebaDatabase) ⇒ Object
74
75
76
77
78
79
80
81
82
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 74
def enter(parent, tatoebaDatabase)
super(parent)
@db = tatoebaDatabase
if !@db.sentences.loaded?
loadSentences()
else
loadLanguage()
end
end
|
#exitLoadTatoebaContext ⇒ Object
62
63
64
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 62
def exitLoadTatoebaContext
self.exit
end
|
#loadChinese ⇒ Object
55
56
57
58
59
60
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 55
def loadChinese
@loadFileContext.onExit do
exitLoadTatoebaContext
end
@loadFileContext.enter(self, @db.chineseIndeces, @linksFile)
end
|
#loadJapanese ⇒ Object
48
49
50
51
52
53
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 48
def loadJapanese
@loadFileContext.onExit do
exitLoadTatoebaContext
end
@loadFileContext.enter(self, @db.japaneseIndeces, @japaneseFile)
end
|
#loadLanguage ⇒ Object
39
40
41
42
43
44
45
46
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 39
def loadLanguage()
language = @parent.quiz.options.language
if language.eql?("Chinese")
loadChinese
else
loadJapanese
end
end
|
#loadSentences ⇒ Object
32
33
34
35
36
37
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 32
def loadSentences()
@loadFileContext.onExit do
loadLanguage()
end
@loadFileContext.enter(self, @db.sentences, @sentencesFile)
end
|
#startLongEvent ⇒ Object
66
67
68
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 66
def startLongEvent()
@parent.startLongEvent()
end
|
#stopLongEvent ⇒ Object
70
71
72
|
# File 'lib/jldrill/contexts/LoadTatoebaContext.rb', line 70
def stopLongEvent()
@parent.stopLongEvent()
end
|