Some Text

this start2
Filter:
X
Bind 'this' to selection
Inspector on: lively.morphic.Morph
X

Menu
Workspace
X

Menu
solver = new ClSimplexSolver()
r = lively.morphic.Morph.makeRectangle(0,0,100,100);
always: {
    solver: solver;
    r.getPosition().equals(r.getExtent());
}
r.setPosition(pt(2,2))
[r.getPosition(), r.getExtent()]
X
// changed at Mon Sep 29 2014 14:49:47 GMT+0200 (Central Europe Daylight Time) by timfelgentr
eff  
this.addScript(function addConstraint() {
    bbb.unconstrainAll(this);
    var solver = new ClSimplexSolver();
    always: {
        solver: solver;
        this.getPosition().equals(this.line.start.getPosition().
            addPt(this.line.end.getPosition()).scaleBy(0.5));
    }
}).tag([]);
X
midp
Tag:
run
save
Tests

-- ALL --
addConstraint
onrestore
Scripts
-
+
-
Connections
+
-- ALL --
all
ObjectEditor
X

Menu

this midp
Filter:
this.line.start.setPosition(this.getPosition().addPt(pt(10,10)))
X
Bind 'this' to selection
Inspector on: lively.morphic.Morph
X

Menu
TestRunner
X
M

lively.tests.TestFrameworkTests
Load module

users

timfelgentreff

babelsberg

src_transform_test

MinifyTest

TransformTest

tests

CSPTest

ConstraintTest

InteractionTest

OnErrorTest

PropagationTest

reactive

reactive_test

AssertTest

testAssertSolver

testComplexFunction

testComplexObject

testFailOnConstraintConstruction

testIntegrationWithOtherSolvers

testInvalidAssignmentRevertsValue

testMultipleAssertionsOnSameObject

LayerActivationTest

ScopedConstraintsTest

TriggerTest
Browse
Run
22 run, 1 failed
Reset
Bench
reactive_test.js:AssertTest:-- all --:testMultipleAssertionsOnSameObject (proto)
X

Menu
N
users/timfelgentreff/reactive/
...
../
reactive.js (not parsed)
reactive_test.js
AssertTest
LayerActivationTest
ScopedConstraintsTest
TriggerTest
-- all --
default category
assertWithError (proto)
setUp (proto)
testAssertSolver (proto)
testComplexFunction (proto)
testComplexObject (proto)
testFailOnConstraintConstruction (proto)
testIntegrationWithOtherSolvers (proto)
testInvalidAssignmentRevertsValue (proto)
testMultipleAssertionsOnSameObject (proto)
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
            ctx: {
                pt: pt
            }
        }, function() {
            return pt.x <= 10;
        });
        this.assert(pt.x === 1, "constraint construction modified variable, pt.x: " + pt.x);
        
        // valid assignment
        pt.x = 7;
        this.assert(pt.x === 7, "assignment did not work, pt.x: " + pt.x);
        
        // invalid assignment with respect to first assertion
        this.assertWithError(
            ContinuousAssertError,
            function() { pt.x = -1; },
            "no ContinuousAssertError was thrown"
        );
        this.assert(pt.x === 7, "assignment to variable not reverted, pt.x: " + pt.x);
        
        // invalid assignment with respect to second assertion
X
>
<
constraintinterpreter.js
X

Menu
N

...
../
babelsberg-lively.js (not parsed)
cassowary_ext.js (not parsed)
constraintinterpreter.js
core_ext.js (not parsed)
csp_ext.js (not parsed)
deltablue_ext.js (not parsed)
PerformanceTests.js (not parsed)
src_transform.js (not parsed)
src_transform_test.js (not parsed)
tests.js (not parsed)
uglify.js (not parsed)
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
        } else {
            return null;
        }
    },
    suggestValue: function(valuesource) {
        if (ConstrainedVariable.$$callingSetters) {
            return value;
        }
        if (value !== this.storedValue) {
            var callSetters = !ConstrainedVariable.$$optionalSetters;
            var priorValue = this.storedValue;
            ConstrainedVariable.$$optionalSetters =
                ConstrainedVariable.$$optionalSetters || [];
            try {
                var solver = this.definingSolver;
                recursionGuard(
                    ConstrainedVariable.isSuggestingValue, this.__uuid__,
                    function() {
                        if (this.isSolveable()) {
                            var wasReadonly = false,
                                // recursionGuard per externalVariable?
                                eVar = this.definingExternalVariable;
                            try {
                                if (solver && source) {
                                    solver.weight += 987654321; // XXX Magic Number
                                    this.findTransitiveConnectedVariables().
                                        each(function(cvar) {
                                            cvar.setDownstreamReadonly(true);
                                        });
                                }
                                wasReadonly = eVar.isReadonly();
                                eVar.setReadonly(false);
                                eVar.suggestValue(value);
                                value = this.externalValue;
                            } finally {
                                eVar.setReadonly(wasReadonly);
                            }
                        }
                    },
                    this
                );
X
>
<
Workspace
X

Menu
pt2 = this.get("end")
pt3 = this.get("start1")
pt4 = this.get("end1")
pt5 = this.get("start2")
pt6 = this.get("end2")
pt1.show()
pt3.show()
pt2.show()
[pt1,pt2,pt3,pt4,pt5,pt6].each(function (ea) {
    bbb.unconstrainAll(ea)
})
solver = new ClSimplexSolver()
always: {
    solver: solver
    pt1.getPosition().equals(pt3.getPosition()) &&
    pt4.getPosition().equals(pt6.getPosition()) &&
    pt5.getPosition().equals(pt2.getPosition())
}
X