From 1549924ab0387b9c6bdb419369a6973910089d0d Mon Sep 17 00:00:00 2001 From: ArtemiiBezguzikov Date: Fri, 5 May 2017 04:16:07 +0300 Subject: [PATCH] Code refactor --- .../controller/DiagramEditorController.ts | 7 ++- .../editorCore/controller/SceneController.ts | 6 ++- .../WEB-INF/views/editor/bpmn/toolbar.jsp | 5 ++- .../com/qreal/wmp/selector/Application.java | 6 +-- .../com/qreal/wmp/selector/ConfigsMerger.java | 26 +++-------- .../qreal/wmp/selector/RestController.java | 14 +++--- .../configs/editor/folders/folderArea.json | 2 +- .../headerpanel/DiagramStoreService.java | 6 +-- .../headerpanel/EditorHeaderPanelImpl.java | 18 ++++++-- .../headerpanel/folderwindow/FileItem.java | 44 ++++++++++++++----- .../folderwindow/FolderAreaImpl.java | 33 ++++++++++---- .../folderwindow/SaveDiagramConfirm.java | 19 +++++--- .../mousegestures/RobotCalibration.java | 5 +++ .../innertests/SaveOpenDiagramTest.java | 2 - 14 files changed, 125 insertions(+), 68 deletions(-) diff --git a/editor-core/src/main/webapp/app/core/editorCore/controller/DiagramEditorController.ts b/editor-core/src/main/webapp/app/core/editorCore/controller/DiagramEditorController.ts index 1f237839..f88bf1f7 100644 --- a/editor-core/src/main/webapp/app/core/editorCore/controller/DiagramEditorController.ts +++ b/editor-core/src/main/webapp/app/core/editorCore/controller/DiagramEditorController.ts @@ -35,7 +35,12 @@ export class DiagramEditorController { return this.getNodeType(type); }; this.diagramEditor = new DiagramEditor(); - this.sceneController = new SceneController(this, this.diagramEditor.getScene(), selectorService.scene); + this.sceneController = new SceneController( + this, + this.diagramEditor.getScene(), + selectorService.scene, + selectorService.gestures); + this.elementsTypeLoader = new ElementsTypeLoader(); $scope.undo = () => { diff --git a/editor-core/src/main/webapp/app/core/editorCore/controller/SceneController.ts b/editor-core/src/main/webapp/app/core/editorCore/controller/SceneController.ts index d208fa84..1e079a76 100644 --- a/editor-core/src/main/webapp/app/core/editorCore/controller/SceneController.ts +++ b/editor-core/src/main/webapp/app/core/editorCore/controller/SceneController.ts @@ -30,8 +30,9 @@ export class SceneController { private paperCommandFactory: SceneCommandFactory; private contextMenuId; private selectorService : any; + private gestures : any; - constructor(diagramEditorController: DiagramEditorController, paper: DiagramScene, selectorService: any) { + constructor(diagramEditorController: DiagramEditorController, paper: DiagramScene, selectorService: any, gestures: any) { this.diagramEditorController = diagramEditorController; this.undoRedoController = diagramEditorController.getUndoRedoController(); this.scene = paper; @@ -44,6 +45,7 @@ export class SceneController { this.lastCellScrollPosition = { x: 0, y: 0 }; this.contextMenuId = selectorService.contextMenu.id; this.selectorService = selectorService; + this.gestures = gestures; this.scene.on('cell:pointerdown', (cellView, event, x, y): void => { this.cellPointerdownListener(cellView, event, x, y); @@ -172,7 +174,7 @@ export class SceneController { var contextMenu = new ContextMenu(); var menuDiv = document.createElement("div"); - menuDiv.id = this.selectorService.gestures.gesturesMenu.id; + menuDiv.id = this.gestures.gesturesMenu.id; menuDiv.className = "gestures-menu"; menuDiv.style.left = event.x + "px"; menuDiv.style.top = event.y + "px"; diff --git a/editor-service/src/main/webapp/WEB-INF/views/editor/bpmn/toolbar.jsp b/editor-service/src/main/webapp/WEB-INF/views/editor/bpmn/toolbar.jsp index 7e109170..3550ff7b 100644 --- a/editor-service/src/main/webapp/WEB-INF/views/editor/bpmn/toolbar.jsp +++ b/editor-service/src/main/webapp/WEB-INF/views/editor/bpmn/toolbar.jsp @@ -1,8 +1,9 @@ <%JSONObject headerPanelSelector = selectors.getJSONObject("editorHeaderPanel"); %> -