UNPKG

molstar

Version:

A comprehensive macromolecular library.

39 lines (38 loc) 1.73 kB
/** * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ import { __extends } from "tslib"; import { PluginBehavior } from '../../../behavior'; import { ParamDefinition as PD } from '../../../../../mol-util/param-definition'; import { SecondaryStructureProvider } from '../../../../../mol-model-props/computed/secondary-structure'; export var SecondaryStructure = PluginBehavior.create({ name: 'computed-secondary-structure-prop', category: 'custom-props', display: { name: 'Secondary Structure' }, ctor: /** @class */ (function (_super) { __extends(class_1, _super); function class_1() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.provider = SecondaryStructureProvider; return _this; } class_1.prototype.update = function (p) { var updated = (this.params.autoAttach !== p.autoAttach); this.params.autoAttach = p.autoAttach; this.ctx.customStructureProperties.setDefaultAutoAttach(this.provider.descriptor.name, this.params.autoAttach); return updated; }; class_1.prototype.register = function () { this.ctx.customStructureProperties.register(this.provider, this.params.autoAttach); }; class_1.prototype.unregister = function () { this.ctx.customStructureProperties.unregister(this.provider.descriptor.name); }; return class_1; }(PluginBehavior.Handler)), params: function () { return ({ autoAttach: PD.Boolean(false) }); } });