Babelsberg/JS Demo World
Un-minimize any window. The ConverterExample and RegionExample are implementations of code examples from the ECOOP'14 paper Babelsberg/JS - A Browser-based Implementation of an Object Constraint Language. What they demonstrate is explained in their help texts. Click also on the links in the text to open ObjectEditors on relevant code. The other windows are further examples. Each window has a help button to explain what the example is about.
RegionExample
X

Menu
Circuits
X

Menu
ConverterExample
X

Menu
ColorGameZ3
X

Menu
sNAKE
X

Menu
Thermometer Demo
X

Menu
NaCLZ3
X

Menu
Z3Engine
X

Menu
users.timfelgentreff.layout.layout
browse
load now
is loaded
Module Part
X
M

NaClZ3.js:NaCLZ3Ast:-- all --
X

Menu
N
users/timfelgentreff/z3/
...
../
lib32/
lib64/
CommandLineZ3.js (not parsed)
NaClZ3.js
ServerZ3.js (not parsed)
Z3Server.js (not parsed)
Z3ServerInterface.js (not parsed)
NaCLZ3
NaCLZ3Ast
NaCLZ3BinaryExpression
NaCLZ3Constant
NaCLZ3Constraint
NaCLZ3UnaryExpression
NaCLZ3Variable
-- all --
default category
cnEquals (proto)
cnGeq (proto)
cnGreater (proto)
cnLeq (proto)
cnLess (proto)
cos (proto)
divide (proto)
isConstraintObject (proto)
minus (proto)
plus (proto)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Object.subclass('NaCLZ3Ast', {
    cnEquals: function (r) {
        return new NaCLZ3BinaryExpression("=", this, r, this.solver);
    },
    cnGeq: function (r) {
        return new NaCLZ3BinaryExpression(">=", this, r, this.solver);
    },
    cnGreater: function (r) {
        return new NaCLZ3BinaryExpression(">", this, r, this.solver);
    },
    cnLeq: function (r) {
        return new NaCLZ3BinaryExpression("<=", this, r, this.solver);
    },
    cnLess: function (r) {
        return new NaCLZ3BinaryExpression("<", this, r, this.solver);
    },
    divide: function (r) {
        return new NaCLZ3BinaryExpression("/", this, r, this.solver);
    },
    times: function (r) {
        return new NaCLZ3BinaryExpression("*", this, r, this.solver);
    },
    sin: function() {
        return  this.minus(
                this.pow(3).divide(6)).plus(
X
>
<
LayoutConstraintP
X
Enter search term:
Next
regexp
Prev
Occur

X
LayoutConstraintP
X
Enter search term:
Next
regexp
Prev
Occur

X
LayoutConstraintBoxSameExtent
X
Enter search term:
Next
regexp
Prev
Occur

X
// changed at Sat May 03 2014 13:47:24 GMT+0200 (W. Europe Daylight Time) by stefanlehma
nn  
this.addScript(function sameExtentExample() {
    this.layoutSolver = new LayoutSolver();
    
    this.child1 = this.get("Rectangle1");
    this.child2 = this.get("Rectangle2");
    // clean up
    bbb.unconstrain(this, "child1");
    bbb.unconstrain(this, "child2");
    bbb.unconstrain(this.child1.shape, "_Extent");
    bbb.unconstrain(this.child2.shape, "_Extent");
    always: { solver: this.layoutSolver
        this.child1.sameExtent(this.child2)
    }
    console.log(this);
}).tag([]);
X
<lively.morphic.Box#DFA69... - Rectangle>
Tag:
run
save
Tests

-- ALL --
sameExtentExample
Scripts
-
+
-
Connections
+
-- ALL --
all
ObjectEditor
X

Menu
layout.js
X

Menu
N

...
../
layout.js
LayoutConstraint
LayoutConstraintBoxSameExtent
LayoutConstraintVariable
LayoutConstraintVariableBox
LayoutConstraintVariablePoint
LayoutObject
LayoutSolver
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
            return extentConstrainedVariable;
            
            // TODO: constrain x and y coordinates as well
            // var xConstrainedVariable = 0;
            // var yConstrainedVariable = 0;
        },
        
        /*
         * accepted functions for Boxes
         */
        sameExtent: function(rightHandSideBox) {
            return new LayoutConstraintBoxSameExtent(this, rightHandSideBox, this.solver);
        }
    });
    
    LayoutConstraintVariable.subclass('LayoutConstraintVariablePoint', {
        suggestValue: function(val) {
            console.log("This is the new _Extent:", val, this);
            // HACK: replace hard reference with plan implementation
            this.__cvar__.box.changed = true;
            this.solver.solve();
        }
        /*
         * accepted functions for Points
         */
    });
    // TODO: add further types of constraint variables
    // for Submorphs array (to enable jQuery style of definitions)
X
>
<