/** * Created by W.X. on 16/7/26. */ import {observable, IObservableArray, observe, IArraySplice, map} from "mobx/lib/mobx"; import {ToolbarModel} from "./ui/ui-model/ToolboxModel"; import CommandModel from "./ui/ui-model/CommandModel"; import InspectorModel from "./ui/ui-model/InspectorModel"; import SelectionModel from "./ui/ui-model/SelectionModel"; import DataSourceModel from './ui/ui-model/DataSourceModel'; import {DataSourceTreeModel} from "./ui/ui-model/DataSourceTreeModel"; export default class UIModel { private _commandModel: CommandModel; private _toolboxModel: ToolbarModel; private _inspectorModel: InspectorModel; private _selectionModel: SelectionModel; private _dataSourceModel: DataSourceModel; private _dataSourceTreeModel: DataSourceTreeModel; @observable public snackbar = {msg: "", open: false, duration: 4000}; constructor() { this._commandModel = new CommandModel(); this._toolboxModel = new ToolbarModel(); this._inspectorModel = new InspectorModel(); this._selectionModel = new SelectionModel(); this._dataSourceModel = new DataSourceModel(); this._dataSourceTreeModel = new DataSourceTreeModel(); } get commandModel(): CommandModel { return this._commandModel; } get inspectorModel(): InspectorModel { return this._inspectorModel; } get toolBoxModel(): ToolbarModel { return this._toolboxModel; } get selectionModel(): SelectionModel { return this._selectionModel; } get dataSourceModel(): DataSourceModel { return this._dataSourceModel; } disableToolBox() { this._toolboxModel.useable = false; } restoreToolBox() { this._toolboxModel.useable = true; } get dataSourceTreeModel(): DataSourceTreeModel { return this._dataSourceTreeModel; } }