| OLD | NEW |
| 1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 // Copyright 1996 John Maloney and Mario Wolczko | 2 // Copyright 1996 John Maloney and Mario Wolczko |
| 3 // | 3 // |
| 4 // This file is part of GNU Smalltalk. | 4 // This file is part of GNU Smalltalk. |
| 5 // | 5 // |
| 6 // GNU Smalltalk is free software; you can redistribute it and/or modify it | 6 // GNU Smalltalk is free software; you can redistribute it and/or modify it |
| 7 // under the terms of the GNU General Public License as published by the Free | 7 // under the terms of the GNU General Public License as published by the Free |
| 8 // Software Foundation; either version 2, or (at your option) any later version. | 8 // Software Foundation; either version 2, or (at your option) any later version. |
| 9 // | 9 // |
| 10 // GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT | 10 // GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 void destroyConstraint() { | 143 void destroyConstraint() { |
| 144 if (isSatisfied()) planner.incrementalRemove(this); | 144 if (isSatisfied()) planner.incrementalRemove(this); |
| 145 removeFromGraph(); | 145 removeFromGraph(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 /** | 148 /** |
| 149 * Normal constraints are not input constraints. An input constraint | 149 * Normal constraints are not input constraints. An input constraint |
| 150 * is one that depends on external state, such as the mouse, the | 150 * is one that depends on external state, such as the mouse, the |
| 151 * keybord, a clock, or some arbitraty piece of imperative code. | 151 * keybord, a clock, or some arbitrary piece of imperative code. |
| 152 */ | 152 */ |
| 153 bool isInput() => false; | 153 bool isInput() => false; |
| 154 } | 154 } |
| 155 | 155 |
| 156 /** | 156 /** |
| 157 * Abstract superclass for constraints having a single possible output variable. | 157 * Abstract superclass for constraints having a single possible output variable. |
| 158 */ | 158 */ |
| 159 abstract class UnaryConstraint extends Constraint { | 159 abstract class UnaryConstraint extends Constraint { |
| 160 final Variable myOutput; | 160 final Variable myOutput; |
| 161 bool satisfied = false; | 161 bool satisfied = false; |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 EditConstraint edit = new EditConstraint(v, PREFERRED); | 696 EditConstraint edit = new EditConstraint(v, PREFERRED); |
| 697 Plan plan = planner.extractPlanFromConstraints(<EditConstraint>[edit]); | 697 Plan plan = planner.extractPlanFromConstraints(<EditConstraint>[edit]); |
| 698 for (int i = 0; i < 10; i++) { | 698 for (int i = 0; i < 10; i++) { |
| 699 v.value = newValue; | 699 v.value = newValue; |
| 700 plan.execute(); | 700 plan.execute(); |
| 701 } | 701 } |
| 702 edit.destroyConstraint(); | 702 edit.destroyConstraint(); |
| 703 } | 703 } |
| 704 | 704 |
| 705 Planner planner; | 705 Planner planner; |
| OLD | NEW |