the classes the figure class the figure class (an abstract superclass of the figure class hierarchycaptures the elements which are common to graphic objects displayed within drawing the point defines the position of the figurewhile the size attribute defines the size of the figure note that the figure is subclass of wx panel and thus the display is constructed from inner panels onto which the various figure shapes are drawn the figure class defines single abstract method on_paint(dcthat must be implemented by all concrete subclasses this method should define how the shape is drawn on the drawing panel class figure(wx panel)def __init__(selfparentid=wx id_anypos=nonesize=nonestyle=wx tab_traversal)wx panel __init__(selfparentid=idpos=possize=sizestyle=styleself point pos self size size @abstractmethod def on_paint(selfdc)pass the square class this is subclass of figure that specifies how to draw square shape in drawing it implements the on_paint(method inherited from figure class square(figure)def __init__(selfparentpossize)super(__init__(parent=parentpos=possize=sizedef on_paint(selfdc)dc drawrectangle(self pointself size