From 38e3d462aaa72fcc83101b5d90b93133d1879458 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 12 May 2020 12:16:41 +0200 Subject: [PATCH] Side Space Added --- Canvas.js | 8 ++++++-- .../Workspace/FunctionLibraries/UiObjectsFromNodes.js | 4 ++-- {ControlsToolBox => SideSpace}/SidePanelTab.js | 0 Spaces/ChartingSpace.js | 2 ++ Spaces/CockpitSpace.js | 6 ++++-- ControlsToolBox/SidePanel.js => Spaces/SideSpace.js | 9 +++++++-- 6 files changed, 21 insertions(+), 8 deletions(-) rename {ControlsToolBox => SideSpace}/SidePanelTab.js (100%) rename ControlsToolBox/SidePanel.js => Spaces/SideSpace.js (96%) diff --git a/Canvas.js b/Canvas.js index 51ad14431..014fee0e0 100644 --- a/Canvas.js +++ b/Canvas.js @@ -32,11 +32,11 @@ function newCanvas () { let thisObject = { eventHandler: undefined, topSpace: undefined, + sideSpace: undefined, chartingSpace: undefined, floatingSpace: undefined, panelsSpace: undefined, cockpitSpace: undefined, - bottomSpace: undefined, designSpace: undefined, animation: undefined, mouse: undefined, @@ -63,6 +63,7 @@ function newCanvas () { function finalize () { try { + thisObject.sideSpace.finalize() thisObject.chartingSpace.finalize() thisObject.floatingSpace.finalize() thisObject.shorcutNumbers = undefined @@ -121,7 +122,8 @@ function newCanvas () { thisObject.chartingSpace = newChartingSpace() thisObject.chartingSpace.initialize() - thisObject.bottomSpace = thisObject.cockpitSpace + thisObject.sideSpace = newSideSpace() + thisObject.sideSpace.initialize() splashScreen = newSplashScreen() splashScreen.initialize() @@ -137,6 +139,7 @@ function newCanvas () { animation.addCallBackFunction('Charting Space Physics', thisObject.chartingSpace.physics) animation.addCallBackFunction('Design Space Physics', thisObject.designSpace.physics) animation.addCallBackFunction('Panels Space Physics', thisObject.panelsSpace.physics) + animation.addCallBackFunction('Side Space Physics', thisObject.sideSpace.physics) /* Spcaces Drawing */ animation.addCallBackFunction('Floating Space Draw', thisObject.floatingSpace.draw) @@ -145,6 +148,7 @@ function newCanvas () { animation.addCallBackFunction('CockpitSpace Draw', thisObject.cockpitSpace.draw) animation.addCallBackFunction('Design Space Draw', thisObject.designSpace.draw) animation.addCallBackFunction('Top Space Draw', thisObject.topSpace.draw) + animation.addCallBackFunction('Side Space Draw', thisObject.sideSpace.draw) animation.addCallBackFunction('Splash Screen Draw', splashScreen.draw) animation.start() } catch (err) { diff --git a/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js b/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js index 992a37b8f..a376f5806 100644 --- a/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js +++ b/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js @@ -238,7 +238,7 @@ function newUiObjectsFromNodes () { switch (property.type) { case 'node': { if (property.name !== previousPropertyName) { - createUiObjectFromNode(node[property.name], node, node, positionOffset) + setTimeout(createUiObjectFromNode, 1, node[property.name], node, node, positionOffset) previousPropertyName = property.name } } @@ -247,7 +247,7 @@ function newUiObjectsFromNodes () { let nodePropertyArray = node[property.name] for (let m = 0; m < nodePropertyArray.length; m++) { let arrayItem = nodePropertyArray[m] - createUiObjectFromNode(arrayItem, node, node, positionOffset) + setTimeout(createUiObjectFromNode, 1, arrayItem, node, node, positionOffset) } } break diff --git a/ControlsToolBox/SidePanelTab.js b/SideSpace/SidePanelTab.js similarity index 100% rename from ControlsToolBox/SidePanelTab.js rename to SideSpace/SidePanelTab.js diff --git a/Spaces/ChartingSpace.js b/Spaces/ChartingSpace.js index 91568cacf..a3959971c 100644 --- a/Spaces/ChartingSpace.js +++ b/Spaces/ChartingSpace.js @@ -92,6 +92,8 @@ function newChartingSpace () { function initialize () { if (isInitialized === true) { return } + if (canvas.designSpace === undefined) { return } + if (canvas.designSpace.workspace === undefined) { return } let rootNodes = canvas.designSpace.workspace.workspaceNode.rootNodes for (let i = 0; i < rootNodes.length; i++) { diff --git a/Spaces/CockpitSpace.js b/Spaces/CockpitSpace.js index ed8cfb932..33be244fa 100644 --- a/Spaces/CockpitSpace.js +++ b/Spaces/CockpitSpace.js @@ -272,8 +272,10 @@ printLabel(statusText, position.x, position.y, 1, 15, textColor, true, thisObject.container) } - if (canvas.designSpace.workspace.enabled === true && statusText === undefined) { - arrow() + if (canvas.designSpace !== undefined) { + if (canvas.designSpace.workspace.enabled === true && statusText === undefined) { + arrow() + } } } diff --git a/ControlsToolBox/SidePanel.js b/Spaces/SideSpace.js similarity index 96% rename from ControlsToolBox/SidePanel.js rename to Spaces/SideSpace.js index 8c133e6cc..43297fd04 100644 --- a/ControlsToolBox/SidePanel.js +++ b/Spaces/SideSpace.js @@ -1,9 +1,10 @@ -function newSidePanel () { - const MODULE_NAME = 'Side Panel' +function newSideSpace () { + const MODULE_NAME = 'Side Space' let thisObject = { areas: [], sidePanelTab: undefined, container: undefined, + physics: physics, draw: draw, getContainer: getContainer, initialize: initialize @@ -50,6 +51,10 @@ function newSidePanel () { } } + function physics () { + + } + function draw () { if (isInitialized === false) { return } borders()