clear_theme()
click to toggle source
def clear_theme
super
clear_waiting
clear_transition
@waited_draw_procs = @default_waited_draw_procs.dup
end
clear_transition()
click to toggle source
def clear_transition
@transition = nil
end
clear_waiting()
click to toggle source
def clear_waiting
@drawing_index = 0
end
draw(canvas, simulation=nil)
click to toggle source
Calls superclass method
def draw(canvas, simulation=nil)
if simulation.nil?
begin
draw(canvas, true)
draw(canvas, false)
rescue StandardError, LoadError
canvas.logger.warn($!)
end
else
canvas.draw_slide(self, simulation) do
compile(canvas, 0, 0, canvas.width, canvas.height)
super(simulation)
end
end
end
first?(index=nil)
click to toggle source
def first?(index=nil)
(index || @drawing_index).zero?
end
flush()
click to toggle source
def flush
@drawing_index = @waited_draw_procs.size
end
last?(index=nil)
click to toggle source
def last?(index=nil)
@waited_draw_procs.size == (index || @drawing_index)
end
move_to_next()
click to toggle source
def move_to_next
@drawing_index += 1 unless last?
end
move_to_previous()
click to toggle source
def move_to_previous
@drawing_index -= 1 unless first?
end
register_default_wait_proc(target, exact=false, &proc)
click to toggle source
def register_default_wait_proc(target, exact=false, &proc)
@default_waited_draw_procs << [target, exact, proc]
end
register_wait_proc(target, exact=false, &proc)
click to toggle source
def register_wait_proc(target, exact=false, &proc)
@waited_draw_procs << [target, exact, proc]
end
slide()
click to toggle source
title()
click to toggle source
def title
@elements.first.text
end
waited_draw_procs(target)
click to toggle source
def waited_draw_procs(target)
procs = []
candidates = @waited_draw_procs[0, @drawing_index]
candidates.each_with_index do |(t, exact, proc), i|
next unless target == t
if exact
procs << proc if i == @drawing_index - 1
else
procs << proc
end
end
procs
end