canvas.getViewport( ).setHorizontalRangeModel( editor.getViewport( ).getHorizontalRangeModel( ) );
canvas.getViewport( ).setHorizontalRangeModel(new RulerDefaultRangeModel( editor.getViewport( ).getHorizontalRangeModel( ) ));
	private GraphicalViewer createRulerContainer( int orientation )	{		ScrollingGraphicalViewer viewer = new RulerViewer( );		final boolean isHorizontal = orientation == PositionConstants.NORTH				|| orientation == PositionConstants.SOUTH;		// Finish initialize the viewer		viewer.setRootEditPart( new EditorRulerRootEditPart( isHorizontal ) );		viewer.setEditPartFactory( new EditorRulerEditPartFactory(				diagramViewer ) );		viewer.createControl( this );		( (GraphicalEditPart) viewer.getRootEditPart( ) ).getFigure( )				.setBorder( new RulerBorder( isHorizontal ) );		viewer.setProperty( GraphicalViewer.class.toString( ), diagramViewer );		// Configure the viewer's control		FigureCanvas canvas = (FigureCanvas) viewer.getControl( );		canvas.setScrollBarVisibility( FigureCanvas.NEVER );		if ( font == null )		{			FontData[] data = canvas.getFont( ).getFontData( );			for ( int i = 0; i < data.length; i++ )			{				data[i].setHeight( data[i].getHeight( ) - 1 );			}			font = new Font( Display.getCurrent( ), data );		}		canvas.setFont( font );		if ( isHorizontal )		{			canvas.getViewport( ).setHorizontalRangeModel(					editor.getViewport( ).getHorizontalRangeModel( ) );		}		else		{			canvas.getViewport( ).setVerticalRangeModel(					editor.getViewport( ).getVerticalRangeModel( ) );		}		// Add the viewer to the rulerEditDomain		if ( rulerEditDomain == null )		{			rulerEditDomain = new EditDomain( );			rulerEditDomain.setCommandStack( diagramViewer.getEditDomain( )					.getCommandStack( ) );		}		rulerEditDomain.addViewer( viewer );		return viewer;	}