diff --git a/src/ibp/shape/circularLamp.js b/src/ibp/shape/circularLamp.js new file mode 100644 index 000000000..ac85f8ae5 --- /dev/null +++ b/src/ibp/shape/circularLamp.js @@ -0,0 +1,18 @@ +import Group from 'zrender/src/container/Group'; +import Arc from 'zrender/src/graphic/shape/Arc'; +import Text from 'zrender/src/graphic/Text'; +import Rect from 'zrender/src/graphic/shape/Rect'; + +export default class CircularLamp extends Group { + constructor(model) { + super(); + this.model = model; + this.zlevel = model.zlevel; + this.z = model.z; + this.create(); + } + + create() { + + } +} diff --git a/src/ibp/shape/element/control.js b/src/ibp/shape/element/control.js deleted file mode 100644 index 5606aab44..000000000 --- a/src/ibp/shape/element/control.js +++ /dev/null @@ -1,105 +0,0 @@ -import Group from 'zrender/src/container/Group'; -import Arc from 'zrender/src/graphic/shape/Arc'; -import Text from 'zrender/src/graphic/Text'; -import { createBoundingRect } from '../../utils/parser'; -import Rect from 'zrender/src/graphic/shape/Rect'; - -export default class Control extends Group { - constructor(model) { - super(); - this.model = model; - this.zlevel = model.zlevel; - this.z = model.z; - this.style = model.style; - this.textStyle = model.text; - this.arcStyle = model.arc; - this.create(); - } - - create() { - this.control = new Arc({ - _subType: 'Control', - zlevel: this.zlevel, - z: this.z, - shape: this.arcStyle.shape, - style: { - lineWidth: this.arcStyle.lineWidth, - fill: this.arcStyle.fill - }, - onmouseover: this.arcStyle.mouseover, - onmouseout: this.arcStyle.mouseout - }); - - this.text = new Text({ - _subType: 'Text', - zlevel: this.zlevel, - z: this.z, - position: this.textStyle.position, - style: { - x: this.textStyle.x, - y: this.textStyle.y, - fontWeight: this.textStyle.fontWeight, - fontSize: this.textStyle.fontSize, - fontFamily: this.textStyle.fontFamily, - text: this.textStyle.text, - textFill: this.textStyle.textFill, - textAlign: this.textStyle.textAlign, - textVerticalAlign: this.textStyle.textVerticalAlign - }, - onmouseover: this.textStyle.mouseover, - onmouseout: this.textStyle.mouseout - }); - const arcRect = this.getArcBoundingRect(); - const textRect = this.getTextBoundingRect(); - this.arcBorder = new Rect({ - zlevel: this.zlevel, - z: this.z, - silent: true, - shape: arcRect, - style: { - lineDash: this.style.arcBorderStyle.lineDash, - stroke: this.style.arcBorderStyle.stroke, - fill: this.style.arcBorderStyle.fill - } - }); - this.textBorder = new Rect({ - zlevel: this.zlevel, - z: this.z-1, - silent: true, - shape: textRect, - style: { - lineDash: this.style.textBorderStyle.lineDash, - stroke: this.style.textBorderStyle.stroke, - fill: this.style.textBorderStyle.fill - } - }); - this.add(this.control); - this.add(this.text); - this.add(this.textBorder); - this.add(this.arcBorder); - this.textBorder.hide(); - this.arcBorder.hide(); - } - setTextBorder(flag) { - flag?this.textBorder.show():this.textBorder.hide(); - } - setArcBorder(flag) { - flag?this.arcBorder.show():this.arcBorder.hide(); - } - getTextBoundingRect() { - return createBoundingRect(this.text); - } - getArcBoundingRect() { - return createBoundingRect(this.control); - } - setControlColor(color) { - if (color) { - this.control.setStyle('fill', color); - } - } - setTextColor(color) { - if (color) { - this.text.setStyle('textFill', color); - } - } -} diff --git a/src/ibp/shape/element/textName.js b/src/ibp/shape/element/textName.js index 50bcb9fdc..fa743f051 100644 --- a/src/ibp/shape/element/textName.js +++ b/src/ibp/shape/element/textName.js @@ -4,7 +4,6 @@ import Text from 'zrender/src/graphic/Text'; /** 名称元素*/ export default function ETextName(model) { const TextName = new Text({ - _subType: 'Text', zlevel: model.zlevel, z: model.z, silent: model.silent || false, @@ -24,48 +23,3 @@ export default function ETextName(model) { }); return TextName; } -// export default class ETextName extends Group { -// constructor(model) { -// super(); -// this.model = model; -// this.zlevel = model.zlevel; -// this.z = model.z; -// this.create(); -// } - -// 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); -// } - -// setStyle(model) { -// this.TextName.setStyle(model); -// } - -// setColor(color) { -// this.TextName.setStyle('textFill', color); -// } - -// hide() { -// this.TextName.hide(); -// } - -// show() { -// this.TextName.show(); -// } -// }