psl调整
This commit is contained in:
parent
2b31e14d90
commit
8a995bf63b
@ -1 +1 @@
|
|||||||
Subproject commit 19514bc55091b2afb559d6e6f9a3c1e3b2699be1
|
Subproject commit 8403e90692f1848d38b7928ba3b9ecfe3f381722
|
@ -8,14 +8,6 @@
|
|||||||
label="Psl按钮"
|
label="Psl按钮"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
/>
|
/>
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
class="q-mt-sm"
|
|
||||||
v-model="pslButtonModel.topAnnotation"
|
|
||||||
@blur="onUpdate"
|
|
||||||
label="上方注释"
|
|
||||||
lazy-rules
|
|
||||||
/>
|
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
class="q-mt-sm"
|
class="q-mt-sm"
|
||||||
|
@ -8,22 +8,6 @@
|
|||||||
label="Psl钥匙"
|
label="Psl钥匙"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
/>
|
/>
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
class="q-mt-sm"
|
|
||||||
v-model="pslKeyModel.topAnnotation"
|
|
||||||
@blur="onUpdate"
|
|
||||||
label="上方注释"
|
|
||||||
lazy-rules
|
|
||||||
/>
|
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
class="q-mt-sm"
|
|
||||||
v-model="pslKeyModel.rightAnnotation"
|
|
||||||
@blur="onUpdate"
|
|
||||||
label="右侧注释"
|
|
||||||
lazy-rules
|
|
||||||
/>
|
|
||||||
</q-form>
|
</q-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -8,14 +8,6 @@
|
|||||||
label="Psl按钮"
|
label="Psl按钮"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
/>
|
/>
|
||||||
<q-input
|
|
||||||
outlined
|
|
||||||
class="q-mt-sm"
|
|
||||||
v-model="pslLightModel.topAnnotation"
|
|
||||||
@blur="onUpdate"
|
|
||||||
label="上方注释"
|
|
||||||
lazy-rules
|
|
||||||
/>
|
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
class="q-mt-sm"
|
class="q-mt-sm"
|
||||||
|
@ -26,12 +26,6 @@ export class PslButtonData extends GraphicDataBase implements IPslButtonData {
|
|||||||
set code(v: string) {
|
set code(v: string) {
|
||||||
this.data.code = v;
|
this.data.code = v;
|
||||||
}
|
}
|
||||||
get topAnnotation(): string {
|
|
||||||
return this.data.topAnnotation;
|
|
||||||
}
|
|
||||||
set topAnnotation(v: string) {
|
|
||||||
this.data.topAnnotation = v;
|
|
||||||
}
|
|
||||||
get buttonColor(): pslGraphicData.PslElementColor {
|
get buttonColor(): pslGraphicData.PslElementColor {
|
||||||
return this.data.buttonColor;
|
return this.data.buttonColor;
|
||||||
}
|
}
|
||||||
|
@ -26,18 +26,6 @@ export class PslKeyData extends GraphicDataBase implements IPslKeyData {
|
|||||||
set code(v: string) {
|
set code(v: string) {
|
||||||
this.data.code = v;
|
this.data.code = v;
|
||||||
}
|
}
|
||||||
get topAnnotation(): string {
|
|
||||||
return this.data.topAnnotation;
|
|
||||||
}
|
|
||||||
set topAnnotation(v: string) {
|
|
||||||
this.data.topAnnotation = v;
|
|
||||||
}
|
|
||||||
get rightAnnotation(): string {
|
|
||||||
return this.data.rightAnnotation;
|
|
||||||
}
|
|
||||||
set rightAnnotation(v: string) {
|
|
||||||
this.data.rightAnnotation = v;
|
|
||||||
}
|
|
||||||
clone(): PslKeyData {
|
clone(): PslKeyData {
|
||||||
return new PslKeyData(this.data.cloneMessage());
|
return new PslKeyData(this.data.cloneMessage());
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,6 @@ export class PslLightData extends GraphicDataBase implements IPslLightData {
|
|||||||
set code(v: string) {
|
set code(v: string) {
|
||||||
this.data.code = v;
|
this.data.code = v;
|
||||||
}
|
}
|
||||||
get topAnnotation(): string {
|
|
||||||
return this.data.topAnnotation;
|
|
||||||
}
|
|
||||||
set topAnnotation(v: string) {
|
|
||||||
this.data.topAnnotation = v;
|
|
||||||
}
|
|
||||||
get lightColor(): pslGraphicData.PslElementColor {
|
get lightColor(): pslGraphicData.PslElementColor {
|
||||||
return this.data.lightColor;
|
return this.data.lightColor;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
GraphicState,
|
GraphicState,
|
||||||
JlGraphic,
|
JlGraphic,
|
||||||
JlGraphicTemplate,
|
JlGraphicTemplate,
|
||||||
VectorText,
|
|
||||||
} from 'src/jl-graphic';
|
} from 'src/jl-graphic';
|
||||||
import Psl_Button_Assets from './psl-button-spritesheet.png';
|
import Psl_Button_Assets from './psl-button-spritesheet.png';
|
||||||
import Psl_Button_JSON from './psl-button-data.json';
|
import Psl_Button_JSON from './psl-button-data.json';
|
||||||
@ -19,18 +18,10 @@ interface PslButtonTextures {
|
|||||||
export interface IPslButtonData extends GraphicData {
|
export interface IPslButtonData extends GraphicData {
|
||||||
get code(): string;
|
get code(): string;
|
||||||
set code(v: string);
|
set code(v: string);
|
||||||
get topAnnotation(): string;
|
|
||||||
set topAnnotation(v: string);
|
|
||||||
get buttonColor(): pslGraphicData.PslElementColor;
|
get buttonColor(): pslGraphicData.PslElementColor;
|
||||||
set buttonColor(v: pslGraphicData.PslElementColor);
|
set buttonColor(v: pslGraphicData.PslElementColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pslConst = {
|
|
||||||
annotationFontSize: 14,
|
|
||||||
annotationColor: '0XFFFFFF',
|
|
||||||
topAnnotationOffset: -40,
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface IPslButtonState extends GraphicState {
|
export interface IPslButtonState extends GraphicState {
|
||||||
get state(): number;
|
get state(): number;
|
||||||
set state(v: number);
|
set state(v: number);
|
||||||
@ -39,7 +30,6 @@ export interface IPslButtonState extends GraphicState {
|
|||||||
export class PslButton extends JlGraphic {
|
export class PslButton extends JlGraphic {
|
||||||
static Type = 'PslButton';
|
static Type = 'PslButton';
|
||||||
_pslButton: Sprite;
|
_pslButton: Sprite;
|
||||||
topAnnotation: VectorText;
|
|
||||||
pslButtonTextures: PslButtonTextures;
|
pslButtonTextures: PslButtonTextures;
|
||||||
__state = 0;
|
__state = 0;
|
||||||
|
|
||||||
@ -47,12 +37,9 @@ export class PslButton extends JlGraphic {
|
|||||||
super(PslButton.Type);
|
super(PslButton.Type);
|
||||||
this.pslButtonTextures = pslButtonTextures;
|
this.pslButtonTextures = pslButtonTextures;
|
||||||
this._pslButton = new Sprite();
|
this._pslButton = new Sprite();
|
||||||
this.topAnnotation = new VectorText();
|
|
||||||
this.topAnnotation.name = 'topAnnotation';
|
|
||||||
this._pslButton.texture = this.pslButtonTextures.redBtn;
|
this._pslButton.texture = this.pslButtonTextures.redBtn;
|
||||||
this._pslButton.anchor.set(0.5);
|
this._pslButton.anchor.set(0.5);
|
||||||
this.addChild(this._pslButton);
|
this.addChild(this._pslButton);
|
||||||
this.addChild(this.topAnnotation);
|
|
||||||
}
|
}
|
||||||
get datas(): IPslButtonData {
|
get datas(): IPslButtonData {
|
||||||
return this.getDatas<IPslButtonData>();
|
return this.getDatas<IPslButtonData>();
|
||||||
@ -64,23 +51,6 @@ export class PslButton extends JlGraphic {
|
|||||||
} else {
|
} else {
|
||||||
this._pslButton.texture = this.pslButtonTextures.redBtn;
|
this._pslButton.texture = this.pslButtonTextures.redBtn;
|
||||||
}
|
}
|
||||||
if (this.datas.topAnnotation) {
|
|
||||||
this.topAnnotation.text = this.datas.topAnnotation || '';
|
|
||||||
this.topAnnotation.style.fill = pslConst.annotationColor;
|
|
||||||
this.topAnnotation.setVectorFontSize(pslConst.annotationFontSize);
|
|
||||||
this.topAnnotation.anchor.set(0.5);
|
|
||||||
const taTransform = this.datas.childTransforms?.find(
|
|
||||||
(item) => item.name === this.topAnnotation.name
|
|
||||||
);
|
|
||||||
if (taTransform) {
|
|
||||||
const position = taTransform?.transform.position;
|
|
||||||
const rotation = taTransform?.transform?.rotation;
|
|
||||||
this.topAnnotation.position.set(position?.x, position?.y);
|
|
||||||
this.topAnnotation.rotation = rotation || 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.topAnnotation.position.set(0, pslConst.topAnnotationOffset);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,22 +133,12 @@ export class PslButtonInteraction extends GraphicInteractionPlugin<PslButton> {
|
|||||||
g.scalable = true;
|
g.scalable = true;
|
||||||
g.rotatable = true;
|
g.rotatable = true;
|
||||||
g.on('transformstart', this.transformstart, this);
|
g.on('transformstart', this.transformstart, this);
|
||||||
g.topAnnotation.draggable = true;
|
|
||||||
g.topAnnotation.selectable = true;
|
|
||||||
g.topAnnotation.rotatable = true;
|
|
||||||
g.topAnnotation.transformSave = true;
|
|
||||||
g.topAnnotation.eventMode = 'static';
|
|
||||||
}
|
}
|
||||||
unbind(g: PslButton): void {
|
unbind(g: PslButton): void {
|
||||||
g.eventMode = 'none';
|
g.eventMode = 'none';
|
||||||
g.scalable = false;
|
g.scalable = false;
|
||||||
g.rotatable = false;
|
g.rotatable = false;
|
||||||
g.off('transformstart', this.transformstart, this);
|
g.off('transformstart', this.transformstart, this);
|
||||||
g.topAnnotation.draggable = false;
|
|
||||||
g.topAnnotation.selectable = false;
|
|
||||||
g.topAnnotation.rotatable = false;
|
|
||||||
g.topAnnotation.transformSave = false;
|
|
||||||
g.topAnnotation.eventMode = 'none';
|
|
||||||
}
|
}
|
||||||
transformstart(e: GraphicTransformEvent) {
|
transformstart(e: GraphicTransformEvent) {
|
||||||
const target = e.target as DisplayObject;
|
const target = e.target as DisplayObject;
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
GraphicState,
|
GraphicState,
|
||||||
JlGraphic,
|
JlGraphic,
|
||||||
JlGraphicTemplate,
|
JlGraphicTemplate,
|
||||||
VectorText,
|
|
||||||
} from 'src/jl-graphic';
|
} from 'src/jl-graphic';
|
||||||
import Psl_Key_Assets from './psl-key-spritesheet.png';
|
import Psl_Key_Assets from './psl-key-spritesheet.png';
|
||||||
import Psl_Key_JSON from './psl-key-data.json';
|
import Psl_Key_JSON from './psl-key-data.json';
|
||||||
@ -17,19 +16,8 @@ interface PslKeyTextures {
|
|||||||
export interface IPslKeyData extends GraphicData {
|
export interface IPslKeyData extends GraphicData {
|
||||||
get code(): string;
|
get code(): string;
|
||||||
set code(v: string);
|
set code(v: string);
|
||||||
get topAnnotation(): string;
|
|
||||||
set topAnnotation(v: string);
|
|
||||||
get rightAnnotation(): string;
|
|
||||||
set rightAnnotation(v: string);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const pslConst = {
|
|
||||||
annotationFontSize: 14,
|
|
||||||
annotationColor: '0XFFFFFF',
|
|
||||||
topAnnotationOffset: -40,
|
|
||||||
rightAnnotationOffset: 60,
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface IPslKeyState extends GraphicState {
|
export interface IPslKeyState extends GraphicState {
|
||||||
get state(): number;
|
get state(): number;
|
||||||
set state(v: number);
|
set state(v: number);
|
||||||
@ -38,8 +26,6 @@ export interface IPslKeyState extends GraphicState {
|
|||||||
export class PslKey extends JlGraphic {
|
export class PslKey extends JlGraphic {
|
||||||
static Type = 'PslKey';
|
static Type = 'PslKey';
|
||||||
_pslKey: Sprite;
|
_pslKey: Sprite;
|
||||||
topAnnotation: VectorText;
|
|
||||||
rightAnnotation: VectorText;
|
|
||||||
pslkeyTextures: PslKeyTextures;
|
pslkeyTextures: PslKeyTextures;
|
||||||
__state = 0;
|
__state = 0;
|
||||||
|
|
||||||
@ -47,15 +33,9 @@ export class PslKey extends JlGraphic {
|
|||||||
super(PslKey.Type);
|
super(PslKey.Type);
|
||||||
this.pslkeyTextures = pslkeyTextures;
|
this.pslkeyTextures = pslkeyTextures;
|
||||||
this._pslKey = new Sprite();
|
this._pslKey = new Sprite();
|
||||||
this.topAnnotation = new VectorText();
|
|
||||||
this.rightAnnotation = new VectorText();
|
|
||||||
this.topAnnotation.name = 'topAnnotation';
|
|
||||||
this.rightAnnotation.name = 'rightAnnotation';
|
|
||||||
this._pslKey.texture = this.pslkeyTextures.pslKey;
|
this._pslKey.texture = this.pslkeyTextures.pslKey;
|
||||||
this._pslKey.anchor.set(0.5);
|
this._pslKey.anchor.set(0.5);
|
||||||
this.addChild(this._pslKey);
|
this.addChild(this._pslKey);
|
||||||
this.addChild(this.topAnnotation);
|
|
||||||
this.addChild(this.rightAnnotation);
|
|
||||||
}
|
}
|
||||||
get datas(): IPslKeyData {
|
get datas(): IPslKeyData {
|
||||||
return this.getDatas<IPslKeyData>();
|
return this.getDatas<IPslKeyData>();
|
||||||
@ -63,40 +43,6 @@ export class PslKey extends JlGraphic {
|
|||||||
doRepaint(): void {
|
doRepaint(): void {
|
||||||
this._pslKey.rotation = 0;
|
this._pslKey.rotation = 0;
|
||||||
this._pslKey.texture = this.pslkeyTextures.pslKey;
|
this._pslKey.texture = this.pslkeyTextures.pslKey;
|
||||||
if (this.datas.topAnnotation) {
|
|
||||||
this.topAnnotation.text = this.datas.topAnnotation || '';
|
|
||||||
this.topAnnotation.style.fill = pslConst.annotationColor;
|
|
||||||
this.topAnnotation.setVectorFontSize(pslConst.annotationFontSize);
|
|
||||||
this.topAnnotation.anchor.set(0.5);
|
|
||||||
const taTransform = this.datas.childTransforms?.find(
|
|
||||||
(item) => item.name === this.topAnnotation.name
|
|
||||||
);
|
|
||||||
if (taTransform) {
|
|
||||||
const position = taTransform?.transform.position;
|
|
||||||
const rotation = taTransform?.transform?.rotation;
|
|
||||||
this.topAnnotation.position.set(position?.x, position?.y);
|
|
||||||
this.topAnnotation.rotation = rotation || 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.topAnnotation.position.set(0, pslConst.topAnnotationOffset);
|
|
||||||
}
|
|
||||||
if (this.datas.rightAnnotation) {
|
|
||||||
this.rightAnnotation.text = this.datas.rightAnnotation || '';
|
|
||||||
this.rightAnnotation.style.fill = pslConst.annotationColor;
|
|
||||||
this.rightAnnotation.setVectorFontSize(pslConst.annotationFontSize);
|
|
||||||
this.rightAnnotation.anchor.set(0.5);
|
|
||||||
const taTransform = this.datas.childTransforms?.find(
|
|
||||||
(item) => item.name === this.rightAnnotation.name
|
|
||||||
);
|
|
||||||
if (taTransform) {
|
|
||||||
const position = taTransform?.transform.position;
|
|
||||||
const rotation = taTransform?.transform?.rotation;
|
|
||||||
this.rightAnnotation.position.set(position?.x, position?.y);
|
|
||||||
this.rightAnnotation.rotation = rotation || 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.rightAnnotation.position.set(pslConst.rightAnnotationOffset, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,32 +126,12 @@ export class PslKeyInteraction extends GraphicInteractionPlugin<PslKey> {
|
|||||||
g.scalable = true;
|
g.scalable = true;
|
||||||
g.rotatable = true;
|
g.rotatable = true;
|
||||||
g.on('transformstart', this.transformstart, this);
|
g.on('transformstart', this.transformstart, this);
|
||||||
g.topAnnotation.draggable = true;
|
|
||||||
g.topAnnotation.selectable = true;
|
|
||||||
g.topAnnotation.rotatable = true;
|
|
||||||
g.topAnnotation.transformSave = true;
|
|
||||||
g.topAnnotation.eventMode = 'static';
|
|
||||||
g.rightAnnotation.draggable = true;
|
|
||||||
g.rightAnnotation.selectable = true;
|
|
||||||
g.rightAnnotation.rotatable = true;
|
|
||||||
g.rightAnnotation.transformSave = true;
|
|
||||||
g.rightAnnotation.eventMode = 'static';
|
|
||||||
}
|
}
|
||||||
unbind(g: PslKey): void {
|
unbind(g: PslKey): void {
|
||||||
g.eventMode = 'none';
|
g.eventMode = 'none';
|
||||||
g.scalable = false;
|
g.scalable = false;
|
||||||
g.rotatable = false;
|
g.rotatable = false;
|
||||||
g.off('transformstart', this.transformstart, this);
|
g.off('transformstart', this.transformstart, this);
|
||||||
g.topAnnotation.draggable = false;
|
|
||||||
g.topAnnotation.selectable = false;
|
|
||||||
g.topAnnotation.rotatable = false;
|
|
||||||
g.topAnnotation.transformSave = false;
|
|
||||||
g.topAnnotation.eventMode = 'none';
|
|
||||||
g.rightAnnotation.draggable = false;
|
|
||||||
g.rightAnnotation.selectable = false;
|
|
||||||
g.rightAnnotation.rotatable = false;
|
|
||||||
g.rightAnnotation.transformSave = false;
|
|
||||||
g.rightAnnotation.eventMode = 'none';
|
|
||||||
}
|
}
|
||||||
transformstart(e: GraphicTransformEvent) {
|
transformstart(e: GraphicTransformEvent) {
|
||||||
const target = e.target as DisplayObject;
|
const target = e.target as DisplayObject;
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 40 KiB |
@ -3,7 +3,6 @@ import {
|
|||||||
GraphicState,
|
GraphicState,
|
||||||
JlGraphic,
|
JlGraphic,
|
||||||
JlGraphicTemplate,
|
JlGraphicTemplate,
|
||||||
VectorText,
|
|
||||||
} from 'src/jl-graphic';
|
} from 'src/jl-graphic';
|
||||||
import Psl_Light_Assets from './psl-light-spritesheet.png';
|
import Psl_Light_Assets from './psl-light-spritesheet.png';
|
||||||
import Psl_Light_JSON from './psl-light-data.json';
|
import Psl_Light_JSON from './psl-light-data.json';
|
||||||
@ -23,18 +22,10 @@ interface PslLightTextures {
|
|||||||
export interface IPslLightData extends GraphicData {
|
export interface IPslLightData extends GraphicData {
|
||||||
get code(): string;
|
get code(): string;
|
||||||
set code(v: string);
|
set code(v: string);
|
||||||
get topAnnotation(): string;
|
|
||||||
set topAnnotation(v: string);
|
|
||||||
get lightColor(): pslGraphicData.PslElementColor;
|
get lightColor(): pslGraphicData.PslElementColor;
|
||||||
set lightColor(v: pslGraphicData.PslElementColor);
|
set lightColor(v: pslGraphicData.PslElementColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pslConst = {
|
|
||||||
annotationFontSize: 14,
|
|
||||||
annotationColor: '0XFFFFFF',
|
|
||||||
topAnnotationOffset: -40,
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface IPslLightState extends GraphicState {
|
export interface IPslLightState extends GraphicState {
|
||||||
get state(): number;
|
get state(): number;
|
||||||
set state(v: number);
|
set state(v: number);
|
||||||
@ -43,7 +34,6 @@ export interface IPslLightState extends GraphicState {
|
|||||||
export class PslLight extends JlGraphic {
|
export class PslLight extends JlGraphic {
|
||||||
static Type = 'PslLight';
|
static Type = 'PslLight';
|
||||||
_pslLight: Sprite;
|
_pslLight: Sprite;
|
||||||
topAnnotation: VectorText;
|
|
||||||
pslLightTextures: PslLightTextures;
|
pslLightTextures: PslLightTextures;
|
||||||
__state = 0;
|
__state = 0;
|
||||||
|
|
||||||
@ -51,12 +41,9 @@ export class PslLight extends JlGraphic {
|
|||||||
super(PslLight.Type);
|
super(PslLight.Type);
|
||||||
this.pslLightTextures = pslLightTextures;
|
this.pslLightTextures = pslLightTextures;
|
||||||
this._pslLight = new Sprite();
|
this._pslLight = new Sprite();
|
||||||
this.topAnnotation = new VectorText();
|
|
||||||
this.topAnnotation.name = 'topAnnotation';
|
|
||||||
this._pslLight.texture = this.pslLightTextures.redOff;
|
this._pslLight.texture = this.pslLightTextures.redOff;
|
||||||
this._pslLight.anchor.set(0.5);
|
this._pslLight.anchor.set(0.5);
|
||||||
this.addChild(this._pslLight);
|
this.addChild(this._pslLight);
|
||||||
this.addChild(this.topAnnotation);
|
|
||||||
}
|
}
|
||||||
get datas(): IPslLightData {
|
get datas(): IPslLightData {
|
||||||
return this.getDatas<IPslLightData>();
|
return this.getDatas<IPslLightData>();
|
||||||
@ -70,23 +57,6 @@ export class PslLight extends JlGraphic {
|
|||||||
} else {
|
} else {
|
||||||
this._pslLight.texture = this.pslLightTextures.redOff;
|
this._pslLight.texture = this.pslLightTextures.redOff;
|
||||||
}
|
}
|
||||||
if (this.datas.topAnnotation) {
|
|
||||||
this.topAnnotation.text = this.datas.topAnnotation || '';
|
|
||||||
this.topAnnotation.style.fill = pslConst.annotationColor;
|
|
||||||
this.topAnnotation.setVectorFontSize(pslConst.annotationFontSize);
|
|
||||||
this.topAnnotation.anchor.set(0.5);
|
|
||||||
const taTransform = this.datas.childTransforms?.find(
|
|
||||||
(item) => item.name === this.topAnnotation.name
|
|
||||||
);
|
|
||||||
if (taTransform) {
|
|
||||||
const position = taTransform.transform.position;
|
|
||||||
const rotation = taTransform.transform.rotation;
|
|
||||||
this.topAnnotation.position.set(position?.x, position?.y);
|
|
||||||
this.topAnnotation.rotation = rotation || 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.topAnnotation.position.set(0, pslConst.topAnnotationOffset);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,22 +126,12 @@ export class PslLightInteraction extends GraphicInteractionPlugin<PslLight> {
|
|||||||
g.scalable = true;
|
g.scalable = true;
|
||||||
g.rotatable = true;
|
g.rotatable = true;
|
||||||
g.on('transformstart', this.transformstart, this);
|
g.on('transformstart', this.transformstart, this);
|
||||||
g.topAnnotation.draggable = true;
|
|
||||||
g.topAnnotation.selectable = true;
|
|
||||||
g.topAnnotation.rotatable = true;
|
|
||||||
g.topAnnotation.transformSave = true;
|
|
||||||
g.topAnnotation.eventMode = 'static';
|
|
||||||
}
|
}
|
||||||
unbind(g: PslLight): void {
|
unbind(g: PslLight): void {
|
||||||
g.eventMode = 'none';
|
g.eventMode = 'none';
|
||||||
g.scalable = false;
|
g.scalable = false;
|
||||||
g.rotatable = false;
|
g.rotatable = false;
|
||||||
g.off('transformstart', this.transformstart, this);
|
g.off('transformstart', this.transformstart, this);
|
||||||
g.topAnnotation.draggable = false;
|
|
||||||
g.topAnnotation.selectable = false;
|
|
||||||
g.topAnnotation.rotatable = false;
|
|
||||||
g.topAnnotation.transformSave = false;
|
|
||||||
g.topAnnotation.eventMode = 'none';
|
|
||||||
}
|
}
|
||||||
transformstart(e: GraphicTransformEvent) {
|
transformstart(e: GraphicTransformEvent) {
|
||||||
const target = e.target as DisplayObject;
|
const target = e.target as DisplayObject;
|
||||||
|
@ -155,7 +155,6 @@ export namespace pslGraphicData {
|
|||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
common?: dependency_1.graphicData.CommonInfo;
|
common?: dependency_1.graphicData.CommonInfo;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
lightColor?: PslElementColor;
|
lightColor?: PslElementColor;
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
@ -167,9 +166,6 @@ export namespace pslGraphicData {
|
|||||||
if ("code" in data && data.code != undefined) {
|
if ("code" in data && data.code != undefined) {
|
||||||
this.code = data.code;
|
this.code = data.code;
|
||||||
}
|
}
|
||||||
if ("topAnnotation" in data && data.topAnnotation != undefined) {
|
|
||||||
this.topAnnotation = data.topAnnotation;
|
|
||||||
}
|
|
||||||
if ("lightColor" in data && data.lightColor != undefined) {
|
if ("lightColor" in data && data.lightColor != undefined) {
|
||||||
this.lightColor = data.lightColor;
|
this.lightColor = data.lightColor;
|
||||||
}
|
}
|
||||||
@ -190,12 +186,6 @@ export namespace pslGraphicData {
|
|||||||
set code(value: string) {
|
set code(value: string) {
|
||||||
pb_1.Message.setField(this, 2, value);
|
pb_1.Message.setField(this, 2, value);
|
||||||
}
|
}
|
||||||
get topAnnotation() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
||||||
}
|
|
||||||
set topAnnotation(value: string) {
|
|
||||||
pb_1.Message.setField(this, 3, value);
|
|
||||||
}
|
|
||||||
get lightColor() {
|
get lightColor() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 4, PslElementColor.red) as PslElementColor;
|
return pb_1.Message.getFieldWithDefault(this, 4, PslElementColor.red) as PslElementColor;
|
||||||
}
|
}
|
||||||
@ -205,7 +195,6 @@ export namespace pslGraphicData {
|
|||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
lightColor?: PslElementColor;
|
lightColor?: PslElementColor;
|
||||||
}): PslLight {
|
}): PslLight {
|
||||||
const message = new PslLight({});
|
const message = new PslLight({});
|
||||||
@ -215,9 +204,6 @@ export namespace pslGraphicData {
|
|||||||
if (data.code != null) {
|
if (data.code != null) {
|
||||||
message.code = data.code;
|
message.code = data.code;
|
||||||
}
|
}
|
||||||
if (data.topAnnotation != null) {
|
|
||||||
message.topAnnotation = data.topAnnotation;
|
|
||||||
}
|
|
||||||
if (data.lightColor != null) {
|
if (data.lightColor != null) {
|
||||||
message.lightColor = data.lightColor;
|
message.lightColor = data.lightColor;
|
||||||
}
|
}
|
||||||
@ -227,7 +213,6 @@ export namespace pslGraphicData {
|
|||||||
const data: {
|
const data: {
|
||||||
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
lightColor?: PslElementColor;
|
lightColor?: PslElementColor;
|
||||||
} = {};
|
} = {};
|
||||||
if (this.common != null) {
|
if (this.common != null) {
|
||||||
@ -236,9 +221,6 @@ export namespace pslGraphicData {
|
|||||||
if (this.code != null) {
|
if (this.code != null) {
|
||||||
data.code = this.code;
|
data.code = this.code;
|
||||||
}
|
}
|
||||||
if (this.topAnnotation != null) {
|
|
||||||
data.topAnnotation = this.topAnnotation;
|
|
||||||
}
|
|
||||||
if (this.lightColor != null) {
|
if (this.lightColor != null) {
|
||||||
data.lightColor = this.lightColor;
|
data.lightColor = this.lightColor;
|
||||||
}
|
}
|
||||||
@ -252,8 +234,6 @@ export namespace pslGraphicData {
|
|||||||
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
|
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
|
||||||
if (this.code.length)
|
if (this.code.length)
|
||||||
writer.writeString(2, this.code);
|
writer.writeString(2, this.code);
|
||||||
if (this.topAnnotation.length)
|
|
||||||
writer.writeString(3, this.topAnnotation);
|
|
||||||
if (this.lightColor != PslElementColor.red)
|
if (this.lightColor != PslElementColor.red)
|
||||||
writer.writeEnum(4, this.lightColor);
|
writer.writeEnum(4, this.lightColor);
|
||||||
if (!w)
|
if (!w)
|
||||||
@ -271,9 +251,6 @@ export namespace pslGraphicData {
|
|||||||
case 2:
|
case 2:
|
||||||
message.code = reader.readString();
|
message.code = reader.readString();
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
message.topAnnotation = reader.readString();
|
|
||||||
break;
|
|
||||||
case 4:
|
case 4:
|
||||||
message.lightColor = reader.readEnum();
|
message.lightColor = reader.readEnum();
|
||||||
break;
|
break;
|
||||||
@ -294,7 +271,6 @@ export namespace pslGraphicData {
|
|||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
common?: dependency_1.graphicData.CommonInfo;
|
common?: dependency_1.graphicData.CommonInfo;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
buttonColor?: PslElementColor;
|
buttonColor?: PslElementColor;
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
@ -306,9 +282,6 @@ export namespace pslGraphicData {
|
|||||||
if ("code" in data && data.code != undefined) {
|
if ("code" in data && data.code != undefined) {
|
||||||
this.code = data.code;
|
this.code = data.code;
|
||||||
}
|
}
|
||||||
if ("topAnnotation" in data && data.topAnnotation != undefined) {
|
|
||||||
this.topAnnotation = data.topAnnotation;
|
|
||||||
}
|
|
||||||
if ("buttonColor" in data && data.buttonColor != undefined) {
|
if ("buttonColor" in data && data.buttonColor != undefined) {
|
||||||
this.buttonColor = data.buttonColor;
|
this.buttonColor = data.buttonColor;
|
||||||
}
|
}
|
||||||
@ -329,12 +302,6 @@ export namespace pslGraphicData {
|
|||||||
set code(value: string) {
|
set code(value: string) {
|
||||||
pb_1.Message.setField(this, 2, value);
|
pb_1.Message.setField(this, 2, value);
|
||||||
}
|
}
|
||||||
get topAnnotation() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
||||||
}
|
|
||||||
set topAnnotation(value: string) {
|
|
||||||
pb_1.Message.setField(this, 3, value);
|
|
||||||
}
|
|
||||||
get buttonColor() {
|
get buttonColor() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 4, PslElementColor.red) as PslElementColor;
|
return pb_1.Message.getFieldWithDefault(this, 4, PslElementColor.red) as PslElementColor;
|
||||||
}
|
}
|
||||||
@ -344,7 +311,6 @@ export namespace pslGraphicData {
|
|||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
buttonColor?: PslElementColor;
|
buttonColor?: PslElementColor;
|
||||||
}): PslButton {
|
}): PslButton {
|
||||||
const message = new PslButton({});
|
const message = new PslButton({});
|
||||||
@ -354,9 +320,6 @@ export namespace pslGraphicData {
|
|||||||
if (data.code != null) {
|
if (data.code != null) {
|
||||||
message.code = data.code;
|
message.code = data.code;
|
||||||
}
|
}
|
||||||
if (data.topAnnotation != null) {
|
|
||||||
message.topAnnotation = data.topAnnotation;
|
|
||||||
}
|
|
||||||
if (data.buttonColor != null) {
|
if (data.buttonColor != null) {
|
||||||
message.buttonColor = data.buttonColor;
|
message.buttonColor = data.buttonColor;
|
||||||
}
|
}
|
||||||
@ -366,7 +329,6 @@ export namespace pslGraphicData {
|
|||||||
const data: {
|
const data: {
|
||||||
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
buttonColor?: PslElementColor;
|
buttonColor?: PslElementColor;
|
||||||
} = {};
|
} = {};
|
||||||
if (this.common != null) {
|
if (this.common != null) {
|
||||||
@ -375,9 +337,6 @@ export namespace pslGraphicData {
|
|||||||
if (this.code != null) {
|
if (this.code != null) {
|
||||||
data.code = this.code;
|
data.code = this.code;
|
||||||
}
|
}
|
||||||
if (this.topAnnotation != null) {
|
|
||||||
data.topAnnotation = this.topAnnotation;
|
|
||||||
}
|
|
||||||
if (this.buttonColor != null) {
|
if (this.buttonColor != null) {
|
||||||
data.buttonColor = this.buttonColor;
|
data.buttonColor = this.buttonColor;
|
||||||
}
|
}
|
||||||
@ -391,8 +350,6 @@ export namespace pslGraphicData {
|
|||||||
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
|
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
|
||||||
if (this.code.length)
|
if (this.code.length)
|
||||||
writer.writeString(2, this.code);
|
writer.writeString(2, this.code);
|
||||||
if (this.topAnnotation.length)
|
|
||||||
writer.writeString(3, this.topAnnotation);
|
|
||||||
if (this.buttonColor != PslElementColor.red)
|
if (this.buttonColor != PslElementColor.red)
|
||||||
writer.writeEnum(4, this.buttonColor);
|
writer.writeEnum(4, this.buttonColor);
|
||||||
if (!w)
|
if (!w)
|
||||||
@ -410,9 +367,6 @@ export namespace pslGraphicData {
|
|||||||
case 2:
|
case 2:
|
||||||
message.code = reader.readString();
|
message.code = reader.readString();
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
message.topAnnotation = reader.readString();
|
|
||||||
break;
|
|
||||||
case 4:
|
case 4:
|
||||||
message.buttonColor = reader.readEnum();
|
message.buttonColor = reader.readEnum();
|
||||||
break;
|
break;
|
||||||
@ -433,8 +387,6 @@ export namespace pslGraphicData {
|
|||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
common?: dependency_1.graphicData.CommonInfo;
|
common?: dependency_1.graphicData.CommonInfo;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
rightAnnotation?: string;
|
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||||
@ -445,12 +397,6 @@ export namespace pslGraphicData {
|
|||||||
if ("code" in data && data.code != undefined) {
|
if ("code" in data && data.code != undefined) {
|
||||||
this.code = data.code;
|
this.code = data.code;
|
||||||
}
|
}
|
||||||
if ("topAnnotation" in data && data.topAnnotation != undefined) {
|
|
||||||
this.topAnnotation = data.topAnnotation;
|
|
||||||
}
|
|
||||||
if ("rightAnnotation" in data && data.rightAnnotation != undefined) {
|
|
||||||
this.rightAnnotation = data.rightAnnotation;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get common() {
|
get common() {
|
||||||
@ -468,23 +414,9 @@ export namespace pslGraphicData {
|
|||||||
set code(value: string) {
|
set code(value: string) {
|
||||||
pb_1.Message.setField(this, 2, value);
|
pb_1.Message.setField(this, 2, value);
|
||||||
}
|
}
|
||||||
get topAnnotation() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
||||||
}
|
|
||||||
set topAnnotation(value: string) {
|
|
||||||
pb_1.Message.setField(this, 3, value);
|
|
||||||
}
|
|
||||||
get rightAnnotation() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
|
||||||
}
|
|
||||||
set rightAnnotation(value: string) {
|
|
||||||
pb_1.Message.setField(this, 4, value);
|
|
||||||
}
|
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
rightAnnotation?: string;
|
|
||||||
}): PslKey {
|
}): PslKey {
|
||||||
const message = new PslKey({});
|
const message = new PslKey({});
|
||||||
if (data.common != null) {
|
if (data.common != null) {
|
||||||
@ -493,20 +425,12 @@ export namespace pslGraphicData {
|
|||||||
if (data.code != null) {
|
if (data.code != null) {
|
||||||
message.code = data.code;
|
message.code = data.code;
|
||||||
}
|
}
|
||||||
if (data.topAnnotation != null) {
|
|
||||||
message.topAnnotation = data.topAnnotation;
|
|
||||||
}
|
|
||||||
if (data.rightAnnotation != null) {
|
|
||||||
message.rightAnnotation = data.rightAnnotation;
|
|
||||||
}
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
toObject() {
|
toObject() {
|
||||||
const data: {
|
const data: {
|
||||||
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
topAnnotation?: string;
|
|
||||||
rightAnnotation?: string;
|
|
||||||
} = {};
|
} = {};
|
||||||
if (this.common != null) {
|
if (this.common != null) {
|
||||||
data.common = this.common.toObject();
|
data.common = this.common.toObject();
|
||||||
@ -514,12 +438,6 @@ export namespace pslGraphicData {
|
|||||||
if (this.code != null) {
|
if (this.code != null) {
|
||||||
data.code = this.code;
|
data.code = this.code;
|
||||||
}
|
}
|
||||||
if (this.topAnnotation != null) {
|
|
||||||
data.topAnnotation = this.topAnnotation;
|
|
||||||
}
|
|
||||||
if (this.rightAnnotation != null) {
|
|
||||||
data.rightAnnotation = this.rightAnnotation;
|
|
||||||
}
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
serialize(): Uint8Array;
|
serialize(): Uint8Array;
|
||||||
@ -530,10 +448,6 @@ export namespace pslGraphicData {
|
|||||||
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
|
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
|
||||||
if (this.code.length)
|
if (this.code.length)
|
||||||
writer.writeString(2, this.code);
|
writer.writeString(2, this.code);
|
||||||
if (this.topAnnotation.length)
|
|
||||||
writer.writeString(3, this.topAnnotation);
|
|
||||||
if (this.rightAnnotation.length)
|
|
||||||
writer.writeString(4, this.rightAnnotation);
|
|
||||||
if (!w)
|
if (!w)
|
||||||
return writer.getResultBuffer();
|
return writer.getResultBuffer();
|
||||||
}
|
}
|
||||||
@ -549,12 +463,6 @@ export namespace pslGraphicData {
|
|||||||
case 2:
|
case 2:
|
||||||
message.code = reader.readString();
|
message.code = reader.readString();
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
message.topAnnotation = reader.readString();
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
message.rightAnnotation = reader.readString();
|
|
||||||
break;
|
|
||||||
default: reader.skipField();
|
default: reader.skipField();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user