GridData gd = new GridData( GridData.FILL_BOTH ); Canvas cCenter = new Canvas( sh, SWT.NONE ); cCenter.setLayoutData( gd ); cCenter.addPaintListener( dcViewer );
Display display = Display.getDefault( ); Shell shell = new Shell( display ); shell.setSize( 600, 400 ); shell.setLayout( new GridLayout( ) );
	public static void main( String[] args )	{		DialChartViewer dcViewer = new DialChartViewer( );		GridLayout gl = new GridLayout( );		gl.numColumns = 1;		Display d = Display.getDefault( );		Shell sh = new Shell( d );		sh.setSize( 600, 400 );		sh.setLayout( gl );		sh.setText( dcViewer.getClass( ).getName( ) + " [device="//$NON-NLS-1$				+ dcViewer.idr.getClass( ).getName( ) + "]" );//$NON-NLS-1$		GridData gd = new GridData( GridData.FILL_BOTH );		Canvas cCenter = new Canvas( sh, SWT.NONE );		cCenter.setLayoutData( gd );		cCenter.addPaintListener( dcViewer );		Composite choicePanel = new Composite( sh, SWT.NONE );		gd = new GridData( GridData.FILL_HORIZONTAL );		choicePanel.setLayoutData( gd );		choicePanel.setLayout( new RowLayout( ) );		Label la = new Label( choicePanel, SWT.NONE );		la.setText( "Choose: " );//$NON-NLS-1$		Combo cbType = new Combo( choicePanel, SWT.DROP_DOWN | SWT.READ_ONLY );		cbType.add( "Single Dial, Multi Regions" );//$NON-NLS-1$		cbType.add( "Multi Dials, Multi Regions" );//$NON-NLS-1$		cbType.add( "Single Dial, Single Region" );//$NON-NLS-1$		cbType.add( "Multi Dials, Single Region" );//$NON-NLS-1$		cbType.select( 0 );		Button btn = new Button( choicePanel, SWT.NONE );		btn.setText( "Update" );//$NON-NLS-1$		btn.addSelectionListener( dcViewer );		dcViewer.cb = cbType;		dcViewer.ca = cCenter;		sh.open( );		while ( !sh.isDisposed( ) )		{			if ( !d.readAndDispatch( ) )			{				d.sleep( );			}		}	}