Reducing Funcitonality to Floating Object Only
This commit is contained in:
1 parent
64e154d165
commit
e19dbd5655
3 files changed
+74
-69
No files matched your search
@@ -102,6 +102,7 @@ function newFloatingObject () {
|
||||
}
|
||||
|
||||
function getContainer (point) {
|
||||
if (thisObject.isCollapsed === true && thisObject.collapsedManually === false) { return }
|
||||
let container
|
||||
|
||||
container = thisObject.payload.uiObject.getContainer(point)
|
||||
@@ -336,14 +337,17 @@ function newFloatingObject () {
|
||||
}
|
||||
|
||||
function drawBackground () {
|
||||
if (thisObject.isCollapsed === true && thisObject.collapsedManually === false) { return }
|
||||
thisObject.payload.uiObject.drawBackground()
|
||||
}
|
||||
|
||||
function drawMiddleground () {
|
||||
if (thisObject.isCollapsed === true && thisObject.collapsedManually === false) { return }
|
||||
thisObject.payload.uiObject.drawMiddleground()
|
||||
}
|
||||
|
||||
function drawForeground () {
|
||||
if (thisObject.isCollapsed === true && thisObject.collapsedManually === false) { return }
|
||||
thisObject.payload.uiObject.drawForeground()
|
||||
}
|
||||
|
||||
@@ -455,4 +459,3 @@ function newFloatingObject () {
|
||||
function updateRadius () {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,8 +137,6 @@ function newStrategyPart () {
|
||||
}
|
||||
|
||||
function getContainer (point) {
|
||||
if (thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) { return }
|
||||
|
||||
let container
|
||||
|
||||
if (isDragging === false && thisObject.isOnFocus === true) {
|
||||
@@ -522,7 +520,6 @@ function newStrategyPart () {
|
||||
}
|
||||
|
||||
function drawBackground () {
|
||||
if (thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) { return }
|
||||
if (thisObject.isOnFocus === false) {
|
||||
drawConnectingLine()
|
||||
|
||||
@@ -533,7 +530,6 @@ function newStrategyPart () {
|
||||
}
|
||||
|
||||
function drawMiddleground () {
|
||||
if (thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) { return }
|
||||
if (thisObject.isOnFocus === false) {
|
||||
drawValue()
|
||||
drawText()
|
||||
@@ -542,7 +538,6 @@ function newStrategyPart () {
|
||||
}
|
||||
|
||||
function drawForeground () {
|
||||
if (thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) { return }
|
||||
if (thisObject.isOnFocus === false) {
|
||||
drawBodyAndPicture()
|
||||
if (isDragging === false) {
|
||||
|
||||
@@ -80,6 +80,57 @@ function newStrategyPartConstructor () {
|
||||
return
|
||||
}
|
||||
|
||||
function addLeftIcons (menuItemsInitialValues, floatingObject) {
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Tense / Untense',
|
||||
actionFunction: floatingObject.tensionToggle,
|
||||
actionStatus: floatingObject.getTensionStatus,
|
||||
currentStatus: true,
|
||||
label: undefined,
|
||||
visible: false,
|
||||
iconPathOn: 'compass',
|
||||
iconPathOff: 'headphones',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -165
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Freeze / Unfreeze',
|
||||
actionFunction: floatingObject.freezeToggle,
|
||||
actionStatus: floatingObject.getFreezeStatus,
|
||||
currentStatus: true,
|
||||
label: undefined,
|
||||
visible: false,
|
||||
iconPathOn: 'broken-link',
|
||||
iconPathOff: 'targeting',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 165
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Collapse / Uncollapse',
|
||||
actionFunction: floatingObject.collapseToggle,
|
||||
actionStatus: floatingObject.getCollapeseStatus,
|
||||
currentStatus: false,
|
||||
label: undefined,
|
||||
visible: false,
|
||||
iconPathOn: 'tap',
|
||||
iconPathOff: 'layout',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 135
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function getMenuItemsInitialValues (strategyPart, floatingObject, payload) {
|
||||
let menuItemsInitialValues = []
|
||||
switch (payload.node.type) {
|
||||
@@ -118,63 +169,8 @@ function newStrategyPartConstructor () {
|
||||
case 'Trading System': {
|
||||
floatingObject.isPinned = true
|
||||
floatingObject.positionLocked = true
|
||||
menuItemsInitialValues = [
|
||||
{
|
||||
action: 'Pin / Unpin',
|
||||
actionFunction: floatingObject.pinToggle,
|
||||
actionStatus: floatingObject.getPinStatus,
|
||||
currentStatus: true,
|
||||
label: undefined,
|
||||
visible: false,
|
||||
iconPathOn: 'target',
|
||||
iconPathOff: 'security',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -135
|
||||
},
|
||||
{
|
||||
action: 'Tense / Untense',
|
||||
actionFunction: floatingObject.tensionToggle,
|
||||
actionStatus: floatingObject.getTensionStatus,
|
||||
currentStatus: true,
|
||||
label: undefined,
|
||||
visible: false,
|
||||
iconPathOn: 'compass',
|
||||
iconPathOff: 'headphones',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -165
|
||||
},
|
||||
{
|
||||
action: 'Freeze / Unfreeze',
|
||||
actionFunction: floatingObject.freezeToggle,
|
||||
actionStatus: floatingObject.getFreezeStatus,
|
||||
currentStatus: true,
|
||||
label: undefined,
|
||||
visible: false,
|
||||
iconPathOn: 'broken-link',
|
||||
iconPathOff: 'targeting',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 165
|
||||
},
|
||||
{
|
||||
action: 'Collapse / Uncollapse',
|
||||
actionFunction: floatingObject.collapseToggle,
|
||||
actionStatus: floatingObject.getCollapeseStatus,
|
||||
currentStatus: false,
|
||||
label: undefined,
|
||||
visible: false,
|
||||
iconPathOn: 'tap',
|
||||
iconPathOff: 'layout',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 135
|
||||
},
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Run Trading System',
|
||||
actionFunction: payload.uiObject.run,
|
||||
@@ -186,7 +182,9 @@ function newStrategyPartConstructor () {
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -70
|
||||
},
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Save Trading System',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
@@ -201,7 +199,9 @@ function newStrategyPartConstructor () {
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -40
|
||||
},
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Trading System',
|
||||
askConfirmation: true,
|
||||
@@ -215,7 +215,9 @@ function newStrategyPartConstructor () {
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: -10
|
||||
},
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'New Strategy',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
@@ -228,7 +230,9 @@ function newStrategyPartConstructor () {
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: +10
|
||||
},
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Parameters',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
@@ -241,7 +245,9 @@ function newStrategyPartConstructor () {
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 40
|
||||
},
|
||||
}
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Download',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
@@ -253,7 +259,8 @@ function newStrategyPartConstructor () {
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 70
|
||||
}]
|
||||
}
|
||||
)
|
||||
break
|
||||
}
|
||||
case 'Parameters': {
|
||||
|
||||
Reference in new issue
Block a user