require "objectteam"
require "graphics"
require "composite"
require "deploy"
figure = Figure.new
group = Group.new
line = Line.new
square = Square.new
text = Text.new
#static connector: we have an addChild method:
square.addChild(text) #does nothing
group.addChild(line) #group is a composite
group.addChild(square)
group.addChild(text) #figure is a composite
figure.addChild(group)#composite in composite
figure.addChild(group)#2nd time
#call paint on figure
figure.paint
syntax highlighted by Code2HTML, v. 0.9.1