This commit is contained in:
joylink_zhaoerwei 2023-06-05 16:03:53 +08:00
parent fb82a1339f
commit d541e1445b
3 changed files with 0 additions and 36 deletions

View File

@ -10,7 +10,6 @@ import {
GraphicInteractionPlugin, GraphicInteractionPlugin,
JlDrawApp, JlDrawApp,
JlGraphic, JlGraphic,
KeyListener,
getRectangleCenter, getRectangleCenter,
} from 'src/jlgraphic'; } from 'src/jlgraphic';
@ -28,15 +27,6 @@ export class PlatformDraw extends GraphicDrawAssistant<
platformGraphic: Graphics = new Graphics(); platformGraphic: Graphics = new Graphics();
doorGraphic: Graphics = new Graphics(); doorGraphic: Graphics = new Graphics();
// 快捷绘制
keypListener: KeyListener = new KeyListener({
value: 'KeyP',
global: true,
onPress: () => {
this.graphicTemplate.hasdoor = true;
},
});
constructor(app: JlDrawApp, createData: () => IPlatformData) { constructor(app: JlDrawApp, createData: () => IPlatformData) {
super( super(
app, app,
@ -53,11 +43,9 @@ export class PlatformDraw extends GraphicDrawAssistant<
bind(): void { bind(): void {
super.bind(); super.bind();
this.app.addKeyboardListener(this.keypListener);
} }
unbind(): void { unbind(): void {
super.unbind(); super.unbind();
this.app.removeKeyboardListener(this.keypListener);
} }
clearCache(): void { clearCache(): void {

View File

@ -14,7 +14,6 @@ import {
GraphicTransformEvent, GraphicTransformEvent,
JlDrawApp, JlDrawApp,
JlGraphic, JlGraphic,
KeyListener,
linePoint, linePoint,
} from 'src/jlgraphic'; } from 'src/jlgraphic';
@ -44,15 +43,6 @@ export class RectDraw extends GraphicDrawAssistant<RectTemplate, IRectData> {
point2: Point | null = null; point2: Point | null = null;
rectGraphic: Graphics = new Graphics(); rectGraphic: Graphics = new Graphics();
// 快捷绘制
keypListener: KeyListener = new KeyListener({
value: 'KeyR',
global: true,
onPress: () => {
//this.graphicTemplate.hasdoor = true;
},
});
constructor(app: JlDrawApp, createData: () => IRectData) { constructor(app: JlDrawApp, createData: () => IRectData) {
super(app, new RectTemplate(), createData, Rect.Type, '站台Rect'); super(app, new RectTemplate(), createData, Rect.Type, '站台Rect');
this.container.addChild(this.rectGraphic); this.container.addChild(this.rectGraphic);
@ -61,11 +51,9 @@ export class RectDraw extends GraphicDrawAssistant<RectTemplate, IRectData> {
bind(): void { bind(): void {
super.bind(); super.bind();
this.app.addKeyboardListener(this.keypListener);
} }
unbind(): void { unbind(): void {
super.unbind(); super.unbind();
this.app.removeKeyboardListener(this.keypListener);
} }
clearCache(): void { clearCache(): void {

View File

@ -4,7 +4,6 @@ import {
GraphicInteractionPlugin, GraphicInteractionPlugin,
JlDrawApp, JlDrawApp,
JlGraphic, JlGraphic,
KeyListener,
VectorText, VectorText,
} from 'src/jlgraphic'; } from 'src/jlgraphic';
@ -21,15 +20,6 @@ export class StationDraw extends GraphicDrawAssistant<
point: Point = new Point(0, 0); point: Point = new Point(0, 0);
codeGraph: VectorText = new VectorText(''); codeGraph: VectorText = new VectorText('');
// 快捷绘制
keypListener: KeyListener = new KeyListener({
value: 'KeyO',
global: true,
onPress: () => {
//this.graphicTemplate.hasdoor = true;
},
});
constructor(app: JlDrawApp, createData: () => IStationData) { constructor(app: JlDrawApp, createData: () => IStationData) {
super(app, new StationTemplate(), createData, Station.Type, '车站Station'); super(app, new StationTemplate(), createData, Station.Type, '车站Station');
this.container.addChild(this.codeGraph); this.container.addChild(this.codeGraph);
@ -38,11 +28,9 @@ export class StationDraw extends GraphicDrawAssistant<
bind(): void { bind(): void {
super.bind(); super.bind();
this.app.addKeyboardListener(this.keypListener);
} }
unbind(): void { unbind(): void {
super.unbind(); super.unbind();
this.app.removeKeyboardListener(this.keypListener);
} }
clearCache(): void { clearCache(): void {