refactoring in DiagramDesigner widget and Keyboard handling v0.1