<s> """<STR_LIT>""" <EOL> from pyjamas . ui . HTML import HTML <EOL> from pyjamas . ui . RootPanel import RootPanel <EOL> from pyjamas . ui . SimplePanel import SimplePanel <EOL> import math <EOL> from pyjamas . Timer import Timer <EOL> from pyjamas import Window <EOL> from pyjamas . raphael . raphael import Raphael <EOL> class TestPanel ( SimplePanel ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> SimplePanel . __init__ ( self ) <EOL> colour = "<STR_LIT>" <EOL> width = <NUM_LIT:15> <EOL> r1 = <NUM_LIT> <EOL> r2 = <NUM_LIT> <EOL> cx = r2 + width <EOL> cy = r2 + width <EOL> self . numSectors = <NUM_LIT:12> <EOL> self . canvas = Raphael ( r2 * <NUM_LIT:2> + width * <NUM_LIT:2> , r2 * <NUM_LIT:2> + width * <NUM_LIT:2> ) <EOL> self . sectors = [ ] <EOL> self . opacity = [ ] <EOL> beta = <NUM_LIT:2> * math . pi / self . numSectors <EOL> pathParams = { '<STR_LIT>' : colour , <EOL> '<STR_LIT>' : width , <EOL> '<STR_LIT>' : "<STR_LIT>" } <EOL> for i in range ( self . numSectors ) : <EOL> alpha = beta * i - math . pi / <NUM_LIT:2> <EOL> cos = math . cos ( alpha ) <EOL> sin = math . sin ( alpha ) <EOL> path = self . canvas . path ( data = None , attrs = pathParams ) <EOL> path . moveTo ( cx + r1 * cos , cy + r1 * sin ) <EOL> path . lineTo ( cx + r2 * cos , cy + r2 * sin ) <EOL> self . opacity . append ( <NUM_LIT:1> / self . numSectors * i ) <EOL> self . sectors . append ( path ) <EOL> period = <NUM_LIT:1000> / self . numSectors <EOL> self . _timer = Timer ( notify = self ) <EOL> self . _timer . scheduleRepeating ( period ) <EOL> self . add ( self . canvas ) <EOL> def onTimer ( self , timer ) : <EOL> """<STR_LIT>""" <EOL> self . opacity . insert ( <NUM_LIT:0> , self . opacity . pop ( ) ) <EOL> for i in range ( self . numSectors ) : <EOL> self . sectors [ i ] . setAttr ( "<STR_LIT>" , self . opacity [ i ] ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> panel = TestPanel ( ) <EOL> RootPanel ( ) . add ( panel ) </s>
