Skip to content
Snippets Groups Projects

Partly resolves "Implement state copy in AST"

Merged Manuel Krombholz requested to merge 30-implement-state-copy-in-ast into dev
All threads resolved!
Files
2
@@ -137,7 +137,9 @@ aspect ItemHandling {
//--- setStateFromBoolean ---
public abstract void Item.setStateFromBoolean(boolean value);
public void ColorItem.setStateFromBoolean(boolean value) {
setBrightness(value ? 100 : 0);
if (getState().getBrightness()==0) {
setBrightness(value ? 100 : 0);
}
}
public void DateTimeItem.setStateFromBoolean(boolean value) {
// there is no good way here
@@ -389,6 +391,12 @@ aspect ItemHandling {
getRoot().addRule(createControllerRule(controllerItem,this));
}
public void Item.synchronizeWith(Item item) {
addControlledBy(item);
addControlling(item);
}
private Rule Item.createControllerRule(Item controllerItem, Item controlledItem) {
Rule rule = new Rule();
Loading