Skip to content

Inputs mapper #313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 243 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from 237 commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
9f8ffd4
initial
oetiker Jun 13, 2018
bc72477
first complete schema
oetiker Jun 13, 2018
05a998c
renamed
oetiker Jun 13, 2018
013f76a
renamed
oetiker Jun 13, 2018
1c9800f
Initial import of comp. services
Jun 13, 2018
7e2a2e3
Adapt sidecar to dockerfile/compose layout
Jun 13, 2018
ca2a7ad
fix requirements
Jun 13, 2018
52bb450
Merge branch 'master' into json-schema
oetiker Jun 13, 2018
5fab282
added key property
oetiker Jun 13, 2018
b8f4bb7
Add server parts needed for comp. backend
Jun 13, 2018
ca84ccf
added initial Avj wrapper
oetiker Jun 13, 2018
76ab87f
rename source --> src
Jun 13, 2018
e84ff9b
added a little validation test to the main app ...
oetiker Jun 13, 2018
ba51898
fix publish/subscribe initialization and add up to date mockup data
Jun 14, 2018
80d8b4a
change default indentation for python in vscode-tmplate
Jun 14, 2018
f3ec478
change build context for services such that we can copy files from th…
Jun 14, 2018
2edb5fb
minor cleanup
Jun 14, 2018
2043c59
change build context for server
Jun 14, 2018
a76d220
rename debug to devel
Jun 14, 2018
8034118
Adds code coverage output
Jun 14, 2018
8c46412
Add local minio for devel and template with credentials
Jun 14, 2018
c6fee87
update readme
Jun 14, 2018
01b8569
WIP: improving first web/client qx docker. Minor cleanup in compose f…
Jun 14, 2018
e9131db
fix JS syntax
oetiker Jun 15, 2018
e4facd8
Merge branch 'master' into comp_backend
Jun 15, 2018
2bc95bb
Improved server/client qx compiler container. - non-root user - dev/p…
Jun 15, 2018
8aaa103
Renamed web/client dockerfile. Emphasizes that it is only to build th…
Jun 15, 2018
703ad74
Adds log messages while installing qx contribs
Jun 15, 2018
92c0d73
Renamed client dockerfile since it is multitarget
Jun 15, 2018
e836528
Renamed webserver dockerfile since it targets ci
Jun 15, 2018
95c8a0a
docker ci version of webserver builds
Jun 15, 2018
dafd2ea
WIP: Implementing webserver devel docker
Jun 15, 2018
bbe1287
Deploying Web-server in devel mode.
Jun 18, 2018
8590498
Deploying web server:
Jun 18, 2018
38534f9
Fixed mounted volumes
Jun 18, 2018
cf21f31
Removed tmp scripts and added mask to ignore them
Jun 18, 2018
b8c833f
Merged git://github.com/mguidon/osparc-simcore.git comp_backend branc…
Jun 18, 2018
b229dac
Fixes bind mount from source-ouput into server's client folder
Jun 18, 2018
8c60310
Merge branch 'master' into comp_backend
pcrespov Jun 19, 2018
9743a72
fix merge conflict
Jun 19, 2018
4d73bbb
Merge branch 'pcrespov-mguidon-comp_backend' into comp_backend
Jun 19, 2018
596ab2d
Mising file save
Jun 19, 2018
a581a53
Merge branch 'master' into comp_backend
pcrespov Jun 19, 2018
0014d1b
TODO for logger
Jun 20, 2018
4ca7852
Merge branch 'comp_backend' of github.com:mguidon/osparc-simcore into…
Jun 20, 2018
7154ee0
Merge branch 'master' into json-schema
oetiker Jun 20, 2018
c0c7180
Add repo query
Jun 20, 2018
0da30c6
filter for comp in image name
Jun 20, 2018
e236426
Merge branch 'master' into registry_api
Jun 20, 2018
f5baa3e
fix too-many-nested-blocks
Jun 20, 2018
b97373b
provide a map between input/output keys and actual files
oetiker Jun 20, 2018
bb8be98
Merge branch 'master' into json-schema
oetiker Jun 20, 2018
f489eb3
fix mapping syntax
oetiker Jun 20, 2018
4bff0a3
fix file2key map logic
oetiker Jun 20, 2018
e218c56
minor
Jun 20, 2018
9ec61e8
Merge branch 'mguidon-registry_api'
Jun 20, 2018
c2851b3
minor
Jun 20, 2018
e11a2fc
switch to pattern properties and add displayOrder key for ordering
oetiker Jun 20, 2018
1db7403
"desc" -> "description"
Jun 20, 2018
05147dd
Create metadata dynamically
Jun 20, 2018
bc1cd61
minor fix
Jun 20, 2018
b9cb303
added integer type
oetiker Jun 21, 2018
69fd030
Merge branch 'mguidon-registry_api'
Jun 21, 2018
8ece964
Merge remote-tracking branch 'upstream/master'
Jun 22, 2018
b0d711e
Merge remote-tracking branch 'upstream/master'
Jun 22, 2018
56daabd
Merge remote-tracking branch 'upstream/master'
Jun 25, 2018
371a24f
Merge remote-tracking branch 'upstream/master'
Jun 25, 2018
98f1fc0
Merge remote-tracking branch 'upstream/master'
Jun 25, 2018
9b4c875
Merge remote-tracking branch 'upstream/master'
Jun 26, 2018
23ef557
Merge branch 'master' into json-schema
oetiker Jun 26, 2018
b470a0e
Merge remote-tracking branch 'upstream/master'
Jun 26, 2018
bc19e81
Merge remote-tracking branch 'upstream/master'
Jun 26, 2018
197d142
Merge remote-tracking branch 'upstream/master'
Jun 27, 2018
ef98049
Merge remote-tracking branch 'upstream/master'
Jun 27, 2018
aa217d0
Merge remote-tracking branch 'upstream/master'
Jun 29, 2018
59a04fb
Merge branch 'master' of github.com:ITISFoundation/osparc-simcore
Jun 29, 2018
c0b99f9
add pattern check to the displayOrder property
oetiker Jul 4, 2018
44f097a
Merge branch 'master' into json-schema
oetiker Jul 4, 2018
3a75c75
Update Application.js
oetiker Jul 4, 2018
aaa831e
Merge remote-tracking branch 'upstream/master'
Jul 4, 2018
145dd64
add content-type definition
oetiker Jul 4, 2018
fbf945d
Update node-meta-v0.0.1.json
oetiker Jul 4, 2018
c5a4ee9
Update node-meta-v0.0.1.json
oetiker Jul 4, 2018
5fa7ad1
Merge branch 'master' into json-schema
oetiker Jul 4, 2018
d4d3fca
Update node-meta-v0.0.1.json
oetiker Jul 4, 2018
9e87235
Update node-meta-v0.0.1.json
oetiker Jul 4, 2018
960a854
Update node-meta-v0.0.1.json
oetiker Jul 4, 2018
19027eb
Update node-meta-v0.0.1.json
oetiker Jul 4, 2018
3c2a75e
allow for longer keys
oetiker Jul 4, 2018
34f5781
Merge remote-tracking branch 'upstream/master'
Jul 4, 2018
da9f8c5
updated fake data
oetiker Jul 4, 2018
5160f12
Merge branch 'master' into settings-updates
oetiker Jul 4, 2018
e2b6211
Merge remote-tracking branch 'upstream/master'
Jul 4, 2018
1583f03
added new project schema
oetiker Jul 4, 2018
67c8609
switch to explicit types
oetiker Jul 4, 2018
48c0697
Merge branch 'master' into settings-updates
oetiker Jul 4, 2018
4786ae0
update samples
oetiker Jul 4, 2018
1b7a3fb
updated examples
oetiker Jul 4, 2018
8e35bc1
Merge remote-tracking branch 'upstream/master'
Jul 9, 2018
9181e7d
Nodeports allow update to s3 (#150)
sanderegg Jul 4, 2018
64d2a8a
Celery stability (#158)
mguidon Jul 5, 2018
ad93fb9
Feature/fakeserver for authentication (#106)
pcrespov Jul 6, 2018
c8bea96
Socket io (#159)
mguidon Jul 6, 2018
e88e3a8
Fixes typos in client after bad merge (#160)
pcrespov Jul 6, 2018
ec9418e
#5 kember postprocessing (#157)
sanderegg Jul 6, 2018
9234201
Login hotfix (#161)
mguidon Jul 6, 2018
8479659
updated fake data
oetiker Jul 4, 2018
e551c5e
update samples
oetiker Jul 4, 2018
95d796b
updated examples
oetiker Jul 4, 2018
b077469
Merge branch 'master' into settings-updates
oetiker Jul 10, 2018
8f5a9f6
Merge branch 'master' into json-schema
oetiker Jul 10, 2018
b90e304
don't need Fake.js anymore ...
oetiker Jul 10, 2018
c01aa84
remove inband signalling
oetiker Jul 10, 2018
366a1f0
Merge branch 'json-schema' into settings-updates
oetiker Jul 10, 2018
a32c604
cleanup formats and sync fake data
oetiker Jul 10, 2018
55551a9
allow comalCase properties
oetiker Jul 10, 2018
2a56a1e
fix syntax
oetiker Jul 10, 2018
5c1e487
make os check more portable
oetiker Jul 10, 2018
8424c89
move schema check so that it actually gets executed
oetiker Jul 10, 2018
cd15a2d
fix path
oetiker Jul 10, 2018
0fafacf
fiz schema and sample data to actually comply
oetiker Jul 10, 2018
b359359
Merge branch 'master' into settings-updates
oetiker Jul 10, 2018
9ca35a1
Merge branch 'master' into settings-updates
oetiker Jul 11, 2018
fa090dc
fix syntax so that the generator does not complain
oetiker Jul 11, 2018
23daa9f
sync
oetiker Jul 11, 2018
6b240e5
fix coding style compliance
oetiker Jul 11, 2018
d1e473c
Merge remote-tracking branch 'upstream/master'
Jul 13, 2018
b6c6976
Merge branch 'master' into settings-updates
oetiker Jul 17, 2018
3113966
Merge remote-tracking branch 'upstream/master'
Jul 17, 2018
2d16d82
merged
oetiker Jul 17, 2018
89e3a85
I think we can use the content element directly
oetiker Jul 17, 2018
68b33a6
create a new project editor for each project
oetiker Jul 17, 2018
5127674
we get to know the project at creation time
oetiker Jul 17, 2018
3e256de
we get to know the project at creation time
oetiker Jul 17, 2018
717d2ac
switch to new 'compliant' data model
oetiker Jul 17, 2018
7f185e4
lets call it 'projectId'
oetiker Jul 17, 2018
146e14b
ignore backup files
oetiker Jul 17, 2018
790da50
moved functionality to nodeBase
oetiker Jul 18, 2018
5a38ca1
lets call it metaData
oetiker Jul 18, 2018
1b67fa6
improve consistancy
oetiker Jul 18, 2018
47850d8
WIP sync to for rebase
oetiker Jul 18, 2018
5e2b367
SettingsEditionDone -> SettingsEdited
oetiker Jul 18, 2018
6b2e817
Merge remote-tracking branch 'upstream/master'
Jul 18, 2018
42ce306
Merge branch 'master' of github.com:ITISFoundation/osparc-simcore
Aug 6, 2018
1d5f0b4
sync updates
oetiker Aug 7, 2018
e434ae4
Merge branch 'master' into settings-updates
oetiker Aug 7, 2018
c3cde78
Merge branch 'master' of github.com:ITISFoundation/osparc-simcore
Aug 7, 2018
5605cb1
Merge branch 'master' into settings-updates
oetiker Aug 7, 2018
b6300f4
sorting input and outputs
oetiker Aug 7, 2018
d098bd3
make settings view shows again with new data model
oetiker Aug 7, 2018
4c77aa1
Merge branch 'master' into settings-updates
oetiker Aug 7, 2018
2599eaf
Load Data from project file into nodes
oetiker Aug 7, 2018
f53184c
fix linting problems
oetiker Aug 7, 2018
76333ef
Merge branch 'master' of github.com:ITISFoundation/osparc-simcore
Aug 8, 2018
81041b8
Merge branch 'master' into settings-updates
oetiker Aug 9, 2018
fd7f6eb
get settings view to work
oetiker Aug 9, 2018
fab8c7c
Merge remote-tracking branch 'upstream/master'
Aug 15, 2018
099c451
Merge branch 'settings-updates' of https://github.com/oetiker/osparc-…
Aug 15, 2018
9bcbfb4
Merge remote-tracking branch 'upstream/master'
Aug 21, 2018
8bfbaf8
Merge remote-tracking branch 'upstream/master'
Aug 23, 2018
a14f91c
Merge remote-tracking branch 'upstream/master'
Sep 4, 2018
72c7c7b
Merge remote-tracking branch 'upstream/master'
Sep 14, 2018
44f7372
Merge remote-tracking branch 'upstream/master'
Sep 17, 2018
c6d351c
Merge remote-tracking branch 'upstream/master'
Sep 18, 2018
1edc2ea
Merge remote-tracking branch 'upstream/master'
Sep 18, 2018
2e06b65
Merge remote-tracking branch 'upstream/master'
Sep 18, 2018
8b59e86
Merge remote-tracking branch 'upstream/master'
Oct 12, 2018
3c985a7
Merge remote-tracking branch 'upstream/master'
Oct 17, 2018
45dfea4
Merge remote-tracking branch 'upstream/master'
Oct 18, 2018
f1c4448
Merge remote-tracking branch 'upstream/master'
Oct 19, 2018
52cb648
Merge remote-tracking branch 'upstream/master'
Oct 22, 2018
8b2218f
Merge branch 'master' of github.com:ITISFoundation/osparc-simcore
Oct 24, 2018
7579059
Merge remote-tracking branch 'upstream/master'
Oct 25, 2018
882ed0b
Merge remote-tracking branch 'upstream/master'
Oct 26, 2018
6d04e7b
Merge remote-tracking branch 'upstream/master'
Oct 27, 2018
035fe79
Merge remote-tracking branch 'upstream/master'
Oct 30, 2018
f3b288e
Fixed renaming folder apis -> api
Oct 30, 2018
1e2feb6
Added fake getItemList and getItem data to Store
Oct 30, 2018
f8f9a1d
Convert from APIList To VirtualTreeModel
Oct 30, 2018
a463e9a
ask for listitems when port.type === "node-output-list-api-v0.0.1"
Oct 30, 2018
4251c3e
Merge remote-tracking branch 'upstream/master'
Oct 31, 2018
d7edc5a
Merge remote-tracking branch 'upstream/master'
Oct 31, 2018
cd37313
Increased PLATFORM_VERSION to 3.19
Oct 31, 2018
0b1226d
Revert "Increased PLATFORM_VERSION to 3.19"
Oct 31, 2018
a9ff4ac
Merge branch 'master' into feature/materialDBOuputsList
Oct 31, 2018
8507b40
Extended fake data
Oct 31, 2018
9f9cdf9
Using NodeOutputList class
Oct 31, 2018
f5b1a3f
minor
Nov 1, 2018
1d90295
Font added
Nov 1, 2018
b721a5c
minor aesthetics
Nov 1, 2018
7b14a83
Fake data extended
Nov 1, 2018
64b4440
InputsMapper widget added
Nov 1, 2018
9a34f2a
minor
Nov 2, 2018
b0da0b8
Fake data updated to use "mapper"s
Nov 2, 2018
4794406
minor
Nov 2, 2018
dc47605
Showing mapper
Nov 2, 2018
cae2c63
minor
Nov 2, 2018
aa013b4
minor
Nov 2, 2018
a5dfc1c
Show/Hide some modeler bars
Nov 2, 2018
c6e6115
minor
Nov 2, 2018
dfe220d
"demodec" path added to fake services
Nov 2, 2018
92ebbf3
Added some comments
Nov 2, 2018
3d26b8e
minor
Nov 2, 2018
42e862e
More fake data
Nov 2, 2018
cf7ce4d
Node Model keeps key and version
Nov 2, 2018
dbb095b
More fake data
Nov 2, 2018
292556f
NodeOutputLabel added
Nov 2, 2018
f4d506f
NodeOutputLabel added (2)
Nov 2, 2018
62e4aa6
inputsDefault concept in
Nov 2, 2018
25df215
Fake data updated
Nov 2, 2018
69eff9e
minor
Nov 5, 2018
7233914
added nodeKey and portKey info to draggable items in NodeOutputList
Nov 5, 2018
f2ed8a3
dragover and compatibility working
Nov 5, 2018
953b43a
Fake data extended
Nov 5, 2018
146e5ad
Drag&Drop working
Nov 5, 2018
9f4511d
typo
Nov 5, 2018
57431f8
InputsMapper is a widget
Nov 5, 2018
d992c19
Working like a charm
Nov 5, 2018
7b45eab
Using our own tree item for mapper
Nov 5, 2018
fea51f8
minor
Nov 5, 2018
4bc904f
Mapper Drag&Drop mechanism improved
Nov 5, 2018
b5e70f7
Fake data updated
Nov 6, 2018
a6ebff2
Fake data updated
Nov 6, 2018
d7c7e48
Neuroman node added
Nov 6, 2018
beff719
minor
Nov 6, 2018
c27bfab
typo
Nov 6, 2018
e152eb3
small refactoring
Nov 6, 2018
846ff0a
comments
Nov 6, 2018
68873ab
make swarm work on osx
oetiker Nov 6, 2018
62dc80a
inputDefault and output widgets belong to nodeModel (not recreated al…
Nov 6, 2018
f7c19b3
minor
Nov 6, 2018
b44cc1d
Merge branch 'master' into feature/materialDBOuputsList
odeimaiz Nov 6, 2018
7ae4563
workaround merge problem for command porperty in swarm
oetiker Nov 6, 2018
eb66a2e
compose for production element
oetiker Nov 6, 2018
3f623e5
TreeItemRenamer widget created
Nov 6, 2018
67d5f57
Input mapper also uses the TreeItemRenamer
Nov 6, 2018
a9a422b
Merge branch 'feature/materialDBOuputsList' of github.com:odeimaiz/os…
Nov 6, 2018
7b0a4ab
Pressing "Delete", removes branch or leaf
Nov 6, 2018
7a6ceee
minor
Nov 6, 2018
e460e75
Mockup data for StimulationSelectivity added
Nov 6, 2018
b861135
Merge branch 'osx-swarm-support' of git://github.com/oetiker/osparc-s…
Nov 6, 2018
f51f615
Revert "Merge branch 'osx-swarm-support' of git://github.com/oetiker/…
Nov 6, 2018
b10e180
typo
Nov 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 32 additions & 17 deletions services/dy-modeling/client/source/class/qxapp/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,19 @@ qx.Class.define("qxapp.Application", {
let docHeight = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);

// initialize components
const menuBarHeight = 35;
const avaiBarHeight = 55;
let menuBarHeight = 35;
let avaiBarHeight = 55;
const showMenuBar = false;
const showUserMenu = false;
const showModelingTools = true;

this._menuBar = new qxapp.component.MenuBar(
docWidth, menuBarHeight,
this._appModel.getColors().getMenuBar()
.getBackground(), this._appModel.getColors().getMenuBar()
.getFont());

this._userMenu = new qxapp.component.UserMenu(
let userMenu = new qxapp.component.UserMenu(
this._appModel,
this._appModel.getColors().getMenuBar()
.getBackground(), this._appModel.getColors().getMenuBar()
Expand Down Expand Up @@ -116,15 +119,23 @@ qx.Class.define("qxapp.Application", {
backgroundColor: "white",
allowGrowY: false
});
toolBarcontainer.add(this._menuBar);
toolBarcontainer.add(this.__availableServicesBar);
// toolBarcontainer.add(this.__threeView);

if (showMenuBar) {
toolBarcontainer.add(this._menuBar);
}
if (showModelingTools) {
toolBarcontainer.add(this.__availableServicesBar);
}
doc.add(toolBarcontainer);

doc.add(this._userMenu, {
right: 30
});
if (showUserMenu) {
doc.add(userMenu, {
right: 30
});
}

menuBarHeight = showMenuBar ? menuBarHeight : 0;
avaiBarHeight = showModelingTools ? avaiBarHeight : 0;
this.__entityList.moveTo(10, menuBarHeight + avaiBarHeight + 10);
this.__entityList.open();

Expand Down Expand Up @@ -177,6 +188,17 @@ qx.Class.define("qxapp.Application", {
return this._appModel.getUsers().toArray()[activeUserId].getName();
},

loadModel: function(modelName) {
if (!this._socket.slotExists("importModelScene")) {
this._socket.on("importModelScene", function(val) {
if (val.type === "importModelScene") {
this.__threeView.importSceneFromBuffer(val.value);
}
}, this);
}
this._socket.emit("importModel", modelName);
},

_initSignals: function() {
// Menu bar
this._menuBar.addListener("fileNewPressed", function(e) {
Expand Down Expand Up @@ -208,14 +230,7 @@ qx.Class.define("qxapp.Application", {

this._menuBar.addListener("fileLoadModelPressed", function(e) {
let selectedModel = e.getData();
if (!this._socket.slotExists("importModelScene")) {
this._socket.on("importModelScene", function(val) {
if (val.type === "importModelScene") {
this.__threeView.importSceneFromBuffer(val.value);
}
}, this);
}
this._socket.emit("importModel", selectedModel);
this.loadModel(selectedModel);
}, this);

this._menuBar.addListener("editPreferencesPressed", function(e) {
Expand Down
Empty file modified services/sidecar/boot.sh
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/* eslint no-underscore-dangle: ["error", { "allowAfterThis": true, "allow": ["__willBeBranch", "__willBeLeaf", "__tree"] }] */

qx.Class.define("qxapp.component.widget.InputsMapper", {
extend: qx.ui.core.Widget,

construct: function(nodeModel, mapper) {
this.base();

let widgetLayout = new qx.ui.layout.VBox(5);
this._setLayout(widgetLayout);

this.setNodeModel(nodeModel);
this.setMapper(mapper);

let tree = this.__tree = new qx.ui.tree.VirtualTree(null, "label", "children").set({
openMode: "none"
});
this._add(tree, {
flex: 1
});
tree.getSelection().addListener("change", this.__onTreeSelectionChanged, this);

let that = this;
tree.setDelegate({
createItem: () => new qxapp.component.widget.inputs.NodeOutputListItem(),
bindItem: (c, item, id) => {
c.bindDefaultProperties(item, id);
// c.bindProperty("key", "key", null, item, id);
c.bindProperty("isDir", "isDir", null, item, id);
c.bindProperty("isRoot", "isRoot", null, item, id);
},
configureItem: item => {
item.set({
droppable: true
});
item.addListener("dragover", e => {
item.set({
droppable: item.getIsDir()
});
let compatible = false;
if (e.supportsType("osparc-mapping")) {
const from = e.getRelatedTarget();
const to = e.getCurrentTarget();
const fromKey = from.getNodeKey();
if (to.getIsRoot()) {
// root
compatible = from.getIsDir() && that.__willBeBranch(fromKey);
} else {
// non root
compatible = to.getIsDir() && !from.getIsDir() && that.__willBeLeaf(fromKey);
}
}
if (!compatible) {
e.preventDefault();
}
});
item.addListener("drop", e => {
if (e.supportsType("osparc-mapping")) {
const from = e.getRelatedTarget();
const fromNodeKey = from.getNodeKey();
const fromPortKey = from.getPortKey();
let data = {
key: from.getModel(),
label: from.getLabel(),
nodeKey: from.getNodeKey(),
portKey: from.getPortKey(),
isDir: from.getIsDir()
};
const willBeBranch = that.__willBeBranch(fromNodeKey);
if (willBeBranch) {
data["children"] = [];
}
let newItem = qx.data.marshal.Json.createModel(data, true);
const to = e.getCurrentTarget();
to.getModel().getChildren()
.push(newItem);
if (willBeBranch) {
const nodeInstanceUUID = null;
const itemProps = qxapp.data.Store.getInstance().getItem(nodeInstanceUUID, fromPortKey, newItem.getKey());
if (itemProps) {
let form = new qxapp.component.form.Auto(itemProps);
let propsWidget = new qxapp.component.form.renderer.PropForm(form);
newItem["propsWidget"] = propsWidget;
}
}
to.setOpen(true);
tree.focus();
}
});
}
});

let data = {
label: nodeModel.getLabel(),
isRoot: true,
children: []
};
let model = qx.data.marshal.Json.createModel(data, true);
tree.setModel(model);

this.addListener("keypress", function(keyEvent) {
let treeSelection = this.__tree.getSelection();
if (treeSelection.length < 1) {
return;
}
let selectedItem = treeSelection.toArray()[0];
if (selectedItem.getIsRoot && selectedItem.getIsRoot()) {
return;
}
switch (keyEvent.getKeyIdentifier()) {
case "F2": {
let treeItemRenamer = new qxapp.component.widget.TreeItemRenamer(selectedItem);
treeItemRenamer.addListener("LabelChanged", e => {
let newLabel = e.getData()["newLabel"];
selectedItem.setLabel(newLabel);
}, this);
treeItemRenamer.center();
treeItemRenamer.open();
break;
}
case "Delete": {
let branches = this.__tree.getModel().getChildren();
// branch
let removed = branches.remove(selectedItem);
if (!removed) {
// leaf
let br = branches.toArray();
for (let i=0; i<br.length; i++) {
let branch = br[i];
removed = branch.getChildren().remove(selectedItem);
if (removed) {
break;
}
}
}
break;
}
}
}, this);
},

properties: {
nodeModel: {
check: "qxapp.data.model.NodeModel",
nullable: false
},

mapper: {
nullable: false
}
},

members: {
__tree: null,

__willBeBranch: function(candidate) {
let isBranch = false;
const maps = this.getMapper().maps;
if (Object.prototype.hasOwnProperty.call(maps, "branch")) {
if (maps["branch"] === candidate) {
isBranch = true;
}
}
const isDefault = candidate === this.getNodeModel().getKey();
return isDefault || isBranch;
},

__willBeLeaf: function(candidate) {
let isLeave = false;
const maps = this.getMapper().maps;
if (Object.prototype.hasOwnProperty.call(maps, "leaf")) {
if (maps["leaf"] === candidate) {
isLeave = true;
}
}
return isLeave;
},

__onTreeSelectionChanged: function() {
// remove all but the tree
while (this._getChildren().length > 1) {
this._removeAt(1);
}
let selectedItems = this.__tree.getSelection();
if (selectedItems.length < 1) {
return;
}
let selectedItem = selectedItems.toArray()[0];
if (Object.prototype.hasOwnProperty.call(selectedItem, "propsWidget")) {
this._add(selectedItem["propsWidget"]);
}
}
}
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* ************************************************************************
Copyright: 2018 ITIS Foundation
License: MIT
Authors: Odei Maiz <[email protected]>
Utf8Check: äöü
************************************************************************ */

/**
* Creates the widget that represents what needs to be exposed
* to outsise the container.
*
*/

qx.Class.define("qxapp.component.widget.NodeExposed", {
extend: qx.ui.core.Widget,

Expand Down Expand Up @@ -56,7 +69,6 @@ qx.Class.define("qxapp.component.widget.NodeExposed", {
this.__inputPort = {};
this.__outputPort = {};
this.__createUIPorts(true, metaData.inputs);
// this.__createUIPorts(false, metaData.outputs);
},

getInputPort: function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* ************************************************************************
Copyright: 2018 ITIS Foundation
License: MIT
Authors: Odei Maiz <[email protected]>
Utf8Check: äöü
************************************************************************ */

/**
* Creates the widget that represents an input node.
* It shows nothing more than the name of the input node in the middle of a box.
*
*/

qx.Class.define("qxapp.component.widget.NodeInput", {
extend: qx.ui.core.Widget,

Expand All @@ -13,10 +26,14 @@ qx.Class.define("qxapp.component.widget.NodeInput", {

let atom = new qx.ui.basic.Atom().set({
label: nodeModel.getLabel(),
center : true,
center: true,
draggable: true,
droppable: true
});
const title16Font = qx.bom.Font.fromConfig(qxapp.theme.Font.fonts["title-16"]);
atom.getChildControl("label").set({
font: title16Font
});

this._add(atom, {
flex: 1
Expand Down
Loading