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

71 lines
1.6 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-31 18:19:15 +08:00
_subType: 'Text',
2019-07-19 14:30:26 +08:00
zlevel: model.zlevel,
z: model.z,
silent: model.silent || false,
style: {
x: model.x,
y: model.y,
2019-07-24 11:24:13 +08:00
fontWeight: model.fontWeight,
fontSize: model.fontSize,
fontFamily: model.fontFamily,
2019-07-19 14:30:26 +08:00
text: model.text,
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;
2019-07-31 14:59:38 +08:00
// this.create();
2019-07-19 14:30:26 +08:00
// }
2019-07-16 16:03:56 +08:00
2019-07-31 14:59:38 +08:00
// create() {
2019-07-19 14:30:26 +08:00
// 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();
// }
// }