rt-sim-training-client/src/jmap/shape/element/ETextName.js

69 lines
1.5 KiB
JavaScript
Raw Normal View History

2019-07-19 14:30:26 +08:00
// import Group from 'zrender/src/container/Group';
2019-07-16 16:03:56 +08:00
import Text from 'zrender/src/graphic/Text';
/** 名称元素*/
2019-07-19 14:30:26 +08:00
export default function ETextName(model) {
2019-07-22 13:39:33 +08:00
const TextName = new Text({
2019-07-19 14:30:26 +08:00
_subType: model._subType,
zlevel: model.zlevel,
z: model.z,
silent: model.silent || false,
style: {
x: model.x,
y: model.y,
text: model.text,
textFont: model.textFont,
textFill: model.textFill,
textAlign: model.textAlign,
textPosition: model.textPosition || 'inside',
textVerticalAlign: model.textVerticalAlign || null
}
});
2019-07-22 13:39:33 +08:00
return TextName;
2019-07-19 14:30:26 +08:00
}
// export default class ETextName extends Group {
// constructor(model) {
// super();
// this.model = model;
// this.zlevel = model.zlevel;
// this.z = model.z;
// this._create();
// }
2019-07-16 16:03:56 +08:00
2019-07-19 14:30:26 +08:00
// _create() {
// this.TextName = new Text({
// _subType: this.model._subType,
// zlevel: this.zlevel,
// z: this.z,
// silent: this.model.silent || false,
// style: {
// x: this.model.x,
// y: this.model.y,
// text: this.model.text,
// textFont: this.model.textFont,
// textFill: this.model.textFill,
// textAlign: this.model.textAlign,
// textPosition: this.model.textPosition || 'inside',
// textVerticalAlign: this.model.textVerticalAlign || null
// }
// });
// this.add(this.TextName);
// }
2019-07-16 16:03:56 +08:00
2019-07-19 14:30:26 +08:00
// setStyle(model) {
// this.TextName.setStyle(model);
// }
2019-07-16 16:03:56 +08:00
2019-07-19 14:30:26 +08:00
// setColor(color) {
// this.TextName.setStyle('textFill', color);
// }
2019-07-16 18:37:49 +08:00
2019-07-19 14:30:26 +08:00
// hide() {
// this.TextName.hide();
// }
2019-07-16 16:03:56 +08:00
2019-07-19 14:30:26 +08:00
// show() {
// this.TextName.show();
// }
// }