public static void main( String[] args ) throws IOException {
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		frame.setBounds( 20, 20, 800, 600 );
		
		final UmlDiagramRepository repository = UmlDiagramRepository.createDefaultRepository();
		repository.getConfiguration().getComment().setPathShape( PathShape.CURVED );
		repository.getConfiguration().getComment().source().setDirection( Direction.ORTHOGONAL );

		UmlDiagramView view = repository.createView();
		
		JMenu menu = new JMenu( "Actions" );
		menu.add( saveImage( view ) );
		
		JMenuBar menuBar = new JMenuBar();
		menuBar.add( menu );
		frame.setJMenuBar( menuBar );

		frame.setLayout( new GridBagLayout() );
		Insets insets = new Insets( 0, 0, 0, 0 );
		frame.add( view.getComponent(), new GridBagConstraints( 0, 1, 100, 100, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insets, 0, 0 ) );
		frame.add( createTools( view.getTools() ), new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, insets, 0, 0 ) );

		UmlDiagram diagram = tryRead( repository );
		if( diagram == null ) {
			diagram = repository.createEmptyDiagram();

			TypeBox a = diagram.createType();
			a.setText( "alpha" );
			a.setLocation( 50, 50 );

			TypeBox b = diagram.createType();
			b.setText( "beta" );
			b.setLocation( 350, 350 );

			TypeBox c = diagram.createType();
			c.setText( "gamma" );
			c.setLocation( 50, 450 );

			TypeBox d = diagram.createType();
			d.setText( "delta" );
			d.setLocation( 350, 70 );

			a.addInheritsFrom( b );
			a.addImplementsFrom( c );

			Connection con = b.addAggregation( d );
			c.addComposition( d );

			CommentBox co = a.addComment( "some comment text" );
			co.setLocation( 250, 170 );
			
			con.addLabel( ConnectionLabelConfiguration.SOURCE ).setText( "source" );
			con.addLabel( ConnectionLabelConfiguration.MIDDLE ).setText( "middle" );
			con.addLabel( ConnectionLabelConfiguration.TARGET ).setText( "target" );
		}

		diagram.addItemContextListener( disposingListener( diagram ) );
		diagram.addItemSelectionListener( selectionListener() );

		view.setDiagram( diagram );
		frame.addWindowListener( writeOnClose( diagram, repository ) );
		frame.setVisible( true );
	}