/**
* The builder of the frame.
* @since 3.0
*/
private void buildFrame(final MProgressBar progressBar) {
final LCanvas canvas = getCanvas();
final IDrawing drawing = getDrawing();
tabbedPanel = new MTabbedPane(true);
layeredPanel = new MLayeredPane(false, false);
layeredPanel.add(canvas.getScrollpane(), JLayeredPane.DEFAULT_LAYER);
layeredPanel.addComponentsToResize(canvas.getScrollpane());
if(progressBar!=null)
progressBar.addToProgressBar(5);
/* Creation of the rulers. */
yScaleRuler = new YScaleRuler(canvas);
xScaleRuler = new XScaleRuler(canvas, yScaleRuler);
if(progressBar!=null)
progressBar.addToProgressBar(5);
/* Initialisation of the mapping between the model and the canvas. */
MappingRegistry.REGISTRY.addMapping(new ShapeList2ViewListMapping(drawing.getShapes(), canvas.getViews(), canvas.getBorderInstrument()));
MappingRegistry.REGISTRY.addMapping(new Drawing2CanvasMapping(drawing, canvas));
MappingRegistry.REGISTRY.addMapping(new Selection2BorderMapping(drawing.getSelection().getShapes(), canvas.getBorderInstrument()));
MappingRegistry.REGISTRY.addMapping(new Zoom2ScaleRuler(canvas.getZoomUnary(), xScaleRuler));
MappingRegistry.REGISTRY.addMapping(new Zoom2ScaleRuler(canvas.getZoomUnary(), yScaleRuler));
MappingRegistry.REGISTRY.addMapping(new Unit2ScaleRuler(ScaleRuler.getUnitSingleton(), xScaleRuler));
MappingRegistry.REGISTRY.addMapping(new Unit2ScaleRuler(ScaleRuler.getUnitSingleton(), yScaleRuler));
if(progressBar!=null)
progressBar.addToProgressBar(5);