private void initialize() {
		log.debug("Initializing new Graph");
		
		// register handler for connection events
		this.canvas.addEventHandler(ConnectorEvent.CONNECTOR_SELECTED, new EventHandler<ConnectorEvent>() {
			public void handle(ConnectorEvent e) {

				// if the line is null, we create a new one at the given point
				if (connRqLine == null) {
					log.debug("Requesting connection from source connector: " + e.getConnector());
					connRqSource = e.getConnector();
					
					GraphNode sn = e.getConnector().getGraphNode();
					Point2D  sp = sn.getPointByConnector(e.getConnector());
				
					connRqLine = viewFactory.getConnectionFactory().getConnectionRequestNode(e.getConnector());
					connRqLine.setStart(new Point2D(sp.getX(), sp.getY()));
					connRqLine.setEnd(new Point2D(sp.getX()-4, sp.getY()-4));
					canvas.getChildren().add(connRqLine);
				} else {
					// otherwise we create a new connection between connRqSource and the current connector
					log.debug("Targeting connection on connector : " + e.getConnector());
					
					if (acceptor != null) {
						if (acceptor.accepts(connRqSource, e.getConnector()))
							createConnection(connRqSource, e.getConnector());
						else {
							connRqSource.onConnectionRequestCancelled();
							e.getConnector().onConnectionRequestCancelled();
							canvas.fireEvent(new ConnectionEvent(ConnectionEvent.CONNECTION_DENIED, null));
						}
					} else if (acceptor == null) 
						createConnection(connRqSource, e.getConnector());
					
					// remove the line
					canvas.getChildren().remove(connRqLine);
					connRqSource = null;
					connRqLine   = null;
				}
				e.consume();
			}
		});
		
		this.canvas.addEventHandler(ConnectorEvent.CONNECTOR_HOVERED, new EventHandler<ConnectorEvent>() {
			@Override
			public void handle(ConnectorEvent e) {
				if (connRqLine != null) {
					Connector target = e.getConnector();
					boolean aRes = acceptor.accepts(connRqSource, target);
					connRqSource.onConnectionRequested(true, aRes);
					target.onConnectionRequested(false, aRes);
				}
			}
		});
		
		this.canvas.addEventHandler(ConnectorEvent.CONNECTOR_UNHOVERED, new EventHandler<ConnectorEvent>() {
			@Override
			public void handle(ConnectorEvent arg0) {
				if (connRqSource != null) 
					connRqSource.onConnectionRequestCancelled();
				arg0.getConnector().onConnectionRequestCancelled();
			}
		});
		
	
		// register click handler for right click
		this.canvas.setOnMouseClicked(new EventHandler<MouseEvent>() {
			public void handle(MouseEvent e) {
				if (e.getButton() == MouseButton.SECONDARY && connRqLine != null) {
					log.debug("Cancel creation of connection.");
					canvas.getChildren().remove(connRqLine);
					connRqLine = null;
				}
			}
		});
		
		// register mouse move handler
		this.canvas.setOnMouseMoved(new EventHandler<MouseEvent>() {
			public void handle(MouseEvent arg0) {
				if (connRqLine != null) {
					connRqLine.setEnd(new Point2D(arg0.getX()-4, arg0.getY()-4));
				}
			}
		});
	}