import { HTMLUtilities } from "../../CommonUI/HTMLUtilities";
import { StateManager } from "../../CommonUI/StateManagement/StateManager";
import { RuleBuilderPage } from "../DesignUI/RuleBuilderPage";
import { TreeRuleConstant } from "./Common/TreeRuleConstant";
export class TreeRuleEditContext {
    constructor(definition) {
        this.mode = RuleBuilderPage.Rule;
        this._selectedForColor = undefined;
        this.definition = definition;
    }
    onCopy(id) { }
    onCut(id) { }
    onDelete(id) { }
    onPaste(id) { }
    set notification(notification) {
        this._notification = notification;
        StateManager.propertyChanged(this, "notification");
    }
    get notification() {
        return this._notification;
    }
    set selected(node) {
        this._selected = node;
        StateManager.propertyChanged(this, "selected");
    }
    get selected() {
        return this._selected;
    }
    get selectedForColor() {
        return this._selectedForColor;
    }
    set selectedForColor(sel) {
        this._selectedForColor = sel;
        StateManager.propertyChanged(this, "selectedForColor");
    }
    setSelectedForColor(sequence, element) {
        let pos = HTMLUtilities.getGeometryFromElement(element, TreeRuleConstant.DESIGN_SURFACE_ID);
        this.selectedForColor = {
            instance: sequence,
            position: {
                x: (pos === null || pos === void 0 ? void 0 : pos.left) || 0,
                y: (pos === null || pos === void 0 ? void 0 : pos.top) || 0,
            },
        };
    }
}
//# sourceMappingURL=TreeRuleEditContext.js.map