Files
bim_engine/src/components/button-group/toolbar/index.ts
yuding 31b60e84ce refactor: 重构 Manager 架构,引入 ManagerRegistry 和 BaseManager 基类
- 新增 ManagerRegistry 单例注册表,统一管理所有 Manager 实例
- 新增 BaseManager 基类,自动管理事件订阅清理
- 新增 BaseDialogManager 基类,统一对话框生命周期管理
- 重构 15 个 Manager 使用新基类
- 重构 Toolbar 按钮和 Menu 按钮移除 engine 参数依赖
- 删除 BimComponent 基类(已不再使用)
- 为所有 Manager 和核心模块添加中文 JSDoc 注释
2026-01-22 15:23:57 +08:00

41 lines
1.9 KiB
TypeScript

import { BimButtonGroup } from '../index';
export class Toolbar extends BimButtonGroup {
public async init(): Promise<void> {
await super.init();
const { createHomeButton } = await import('./buttons/home');
const { createZoomBoxButton } = await import('./buttons/zoom-box');
const { createWalkMenuButton } = await import('./buttons/walk/walk-menu');
const { createMapButton } = await import('./buttons/map');
const { createPropertyButton } = await import('./buttons/property');
const { createSettingButton } = await import('./buttons/setting');
const { createInfoButton } = await import('./buttons/info');
const { createFullscreenButton } = await import('./buttons/fullscreen');
const { createMeasureButton } = await import('./buttons/measure');
const { createSectionMenuButton } = await import('./buttons/section/section-menu');
const { createSectionPlaneButton } = await import('./buttons/section/section-plane');
const { createSectionAxisButton } = await import('./buttons/section/section-axis');
const { createSectionBoxButton } = await import('./buttons/section/section-box');
this.addGroup('group-1');
this.addButton(createHomeButton());
this.addButton(createZoomBoxButton());
this.addButton(createMeasureButton());
this.addButton(createSectionMenuButton());
this.addButton(createSectionPlaneButton());
this.addButton(createSectionAxisButton());
this.addButton(createSectionBoxButton());
this.addButton(createWalkMenuButton());
this.addButton(createMapButton());
this.addButton(createPropertyButton());
this.addGroup('group-2');
this.addButton(createSettingButton());
this.addButton(createInfoButton());
this.addButton(createFullscreenButton());
this.render();
}
}