<s> import DOM <EOL> class UIObject : <EOL> def getElement ( self ) : <EOL> return self . element <EOL> def setElement ( self , element ) : <EOL> self . element = element <EOL> def setStyleName ( self , style ) : <EOL> DOM . setAttribute ( self . element , "<STR_LIT>" , style ) <EOL> class Widget ( UIObject ) : <EOL> def setParent ( self , parent ) : <EOL> self . parent = parent <EOL> class Panel ( Widget ) : <EOL> pass <EOL> class ComplexPanel ( Panel ) : <EOL> def __init__ ( self ) : <EOL> self . children = [ ] <EOL> def add ( self , widget ) : <EOL> self . children . append ( widget ) <EOL> widget . setParent ( self ) <EOL> return True <EOL> class AbsolutePanel ( ComplexPanel ) : <EOL> def __init__ ( self ) : <EOL> ComplexPanel . __init__ ( self ) <EOL> self . setElement ( DOM . createDiv ( ) ) <EOL> DOM . setStyleAttribute ( self . getElement ( ) , "<STR_LIT>" , "<STR_LIT>" ) <EOL> def add ( self , widget ) : <EOL> ComplexPanel . add ( self , widget ) <EOL> DOM . appendChild ( self . getElement ( ) , widget . getElement ( ) ) <EOL> return True <EOL> class RootPanel ( AbsolutePanel ) : <EOL> def __init__ ( self ) : <EOL> AbsolutePanel . __init__ ( self ) <EOL> element = self . getBodyElement ( ) <EOL> self . setElement ( element ) <EOL> def getBodyElement ( self ) : <EOL> JS ( """<STR_LIT>""" ) </s>
