ht.lib = ht.lib || {};
if (!ht.lib['排布图图元']) {
ht.lib['排布图图元'] = function (x, y, width, height, angle, localVarObj, localDynamicVar, nodename) {
_ratio = GD.getRatioWithRotation(0, ratio);
ht.lib['排布图图元'].superClass.constructor.apply(this);
this.localVarObj = localVarObj;
this.localDynamicVar = localDynamicVar;
this.childNodes = [];
this._styleObject = {};
this._originWidth = 40.54861*_ratio.ratioX;
this._originHeight = 64.21875*_ratio.ratioY;
this._baseClass = "ht.lib.排布图图元";
this._background = new ht.Node();
this._background.setWidth(this._originWidth);
this._background.setHeight(this._originHeight);
this._background.setPosition(this._originWidth/2, this._originHeight/2);
this._background.setImage({
width: width,
height: height,
clip: true,
comps: [
{
type: 'rect',
background: 'rgba(0,255,0,0)',
rect: [0,0,width, height]
}
]
});
this._background.__parentLib = nodename;
this._background.isLibBackground = true;
this.childNodes.push(this._background);
dataModel.add(this._background);
/*@PageBackgroundInit@*/
/*@PageBeforeInit@*/
_ratio = GD.getRatioWithRotation(0*Math.PI/180, ratio);
var Lib_排布图图元Node0_0type = 'rect';
var Lib_排布图图元Node0_0 = new ht.Node(),
Lib_排布图图元Node0_0BorderWidth = 1*2;
if (Lib_排布图图元Node0_0type === 'arc') {
Lib_排布图图元Node0_0BorderWidth *= 1;
}
Lib_排布图图元Node0_0.setImage(GD.getRectJSON(38*_ratio.ratioX, 16*_ratio.ratioY, Lib_排布图图元Node0_0type, '@arcFrom@', '@arcTo@', '@arcClose@'));
Lib_排布图图元Node0_0.setPosition(19*ratio.ratioX, 54*ratio.ratioY);
Lib_排布图图元Node0_0.setSize(38*_ratio.ratioX, 16*_ratio.ratioY);
Lib_排布图图元Node0_0.s({
'pixelPerfect':true
/*@AddPara@*/
});
Lib_排布图图元Node0_0.a('node.width', 38*_ratio.ratioX);
Lib_排布图图元Node0_0.a('node.height', 16*_ratio.ratioY);
Lib_排布图图元Node0_0.a('node.type', Lib_排布图图元Node0_0type);
Lib_排布图图元Node0_0.a('node.rect', [0, 0, 38*_ratio.ratioX, 16*_ratio.ratioY]);
Lib_排布图图元Node0_0.a('node.background', 'rgba(20,61,42,1)');
Lib_排布图图元Node0_0.a('node.gradientcolor', 'rgba(20,61,42,1)');
Lib_排布图图元Node0_0.a('node.gradient', '');
Lib_排布图图元Node0_0.a('node.borderwidth', Lib_排布图图元Node0_0BorderWidth);
Lib_排布图图元Node0_0.a('node.color', 'rgba(20,61,42,1)');
Lib_排布图图元Node0_0.a('node.fillrect', [0,0,0,0]);
Lib_排布图图元Node0_0.a('node.fillbackcolor', 'rgba(0,0,0,0)');
Lib_排布图图元Node0_0.a('node.fillgradientcolor', 'rgba(0,0,0,0)');
Lib_排布图图元Node0_0.a('node.fillgradient', '');
if (Lib_排布图图元Node0_0type !== 'rect') {
Lib_排布图图元Node0_0.a('node.arcFrom', parseFloat('@arcFrom@'));
Lib_排布图图元Node0_0.a('node.arcTo', parseFloat('@arcTo@'));
Lib_排布图图元Node0_0.a('node.arcClose', '@arcClose@' === 'true' ? true : false);
}
if (Lib_排布图图元Node0_0type === 'arc') {
Lib_排布图图元Node0_0.a('node.arcOval', true);
}
Lib_排布图图元Node0_0.setRotation(0*Math.PI/180);
Lib_排布图图元Node0_0.borderWidth = Lib_排布图图元Node0_0BorderWidth;
Lib_排布图图元Node0_0.borderFillwidth = Lib_排布图图元Node0_0BorderWidth;
dataModel.add(Lib_排布图图元Node0_0);
Lib_排布图图元Node0_0._nodename = 'Lib_排布图图元Node0_0'
Lib_排布图图元Node0_0._nodeType = 'rect';
zoomNodeList.push({
node: Lib_排布图图元Node0_0,
attr: 'node.borderwidth'
});
(function (node, _img) {
var setWidth = node.setWidth,
setHeight = node.setHeight;
node.setWidth = function (width) {
if (width === this.getWidth()) return ;
var height = this.getHeight();
this.a('node.width', width);
this.a('node.rect', [0,0,width, height]);
setWidth.apply(this, arguments);
}
node.setHeight = function (height) {
if (height === this.getHeight()) return ;
var width = this.getWidth();
this.a('node.height', height);
this.a('node.rect', [0,0,width, height]);
setHeight.apply(this, arguments);
}
})(Lib_排布图图元Node0_0, Lib_排布图图元Node0_0.getImage());_ratio = GD.getRatioWithRotation(0*Math.PI/180, ratio);
var Lib_排布图图元Node0_1 = new ht.Node();
var Lib_排布图图元Node0_1textStart, Lib_排布图图元Node0_1textWidth, Lib_排布图图元Node0_1lineStart, Lib_排布图图元Node0_1align = 'center', Lib_排布图图元Node0_1fontSize = 13.3333*_ratio.ratioY,Lib_排布图图元Node0_1width = 39*_ratio.ratioX, Lib_排布图图元Node0_1height = 18*_ratio.ratioY;
(function () {
if (Lib_排布图图元Node0_1align === 'left') {
Lib_排布图图元Node0_1textStart = Lib_排布图图元Node0_1fontSize * 0.2 > 2 ? Lib_排布图图元Node0_1fontSize * 0.2 - 4 : Lib_排布图图元Node0_1fontSize * 0.2 - 9;
Lib_排布图图元Node0_1textWidth = Lib_排布图图元Node0_1width;
Lib_排布图图元Node0_1lineStart = 1;
} else if (Lib_排布图图元Node0_1align === 'right') {
Lib_排布图图元Node0_1textStart = 0;
Lib_排布图图元Node0_1textWidth =Lib_排布图图元Node0_1fontSize <= 8 ? Lib_排布图图元Node0_1width + Lib_排布图图元Node0_1fontSize * 0.2 + 6 : Lib_排布图图元Node0_1width - Lib_排布图图元Node0_1fontSize * 0.2;
Lib_排布图图元Node0_1lineStart = (Lib_排布图图元Node0_1width - (ht.Default.getTextSize('B14', 'bold '+ Lib_排布图图元Node0_1fontSize + 'px "Arial"').width + 6)) * 0.5;
} else if (Lib_排布图图元Node0_1align === 'center') {
Lib_排布图图元Node0_1textStart = -3;
Lib_排布图图元Node0_1textWidth = Lib_排布图图元Node0_1width;
Lib_排布图图元Node0_1lineStart = Lib_排布图图元Node0_1width - ht.Default.getTextSize('B14', 'bold '+ Lib_排布图图元Node0_1fontSize + 'px "Arial"').width - 11;
}
})();
Lib_排布图图元Node0_1.setImage(GD.getTextJSON(Lib_排布图图元Node0_1width, Lib_排布图图元Node0_1height, true, false, false, 'bold '+ Lib_排布图图元Node0_1fontSize + 'px "Arial"'))
Lib_排布图图元Node0_1.setPosition(20*ratio.ratioX, 55*ratio.ratioY);
Lib_排布图图元Node0_1.setWidth(Lib_排布图图元Node0_1width);
Lib_排布图图元Node0_1.setHeight(Lib_排布图图元Node0_1height);
Lib_排布图图元Node0_1._nodeType = 'text';
Lib_排布图图元Node0_1._disallowEvert = true;
Lib_排布图图元Node0_1.setRotation(0*Math.PI/180);
Lib_排布图图元Node0_1.a('node.width', Lib_排布图图元Node0_1width);
Lib_排布图图元Node0_1.a('node.height', Lib_排布图图元Node0_1height);
Lib_排布图图元Node0_1.a('node.rect', [0, 0, Lib_排布图图元Node0_1width, Lib_排布图图元Node0_1height]);
Lib_排布图图元Node0_1.a('node.bordercolor','rgba(255,255,255,1)');
Lib_排布图图元Node0_1.a('node.borderwidth', 0);
Lib_排布图图元Node0_1.a('node.background','' || 'rgba(0,0,0,0)');
Lib_排布图图元Node0_1.a('node.gradient','');
Lib_排布图图元Node0_1.a('node.gradientcolor','');
Lib_排布图图元Node0_1.a('node.text','B14');
Lib_排布图图元Node0_1.a('node.textalign','center');
Lib_排布图图元Node0_1.a('node.textvAlign','middle');
Lib_排布图图元Node0_1.a('node.textrect', [Lib_排布图图元Node0_1textStart, 0, Lib_排布图图元Node0_1textWidth, Lib_排布图图元Node0_1height]);
Lib_排布图图元Node0_1.a('node.color','rgba(255,255,255,1)');
Lib_排布图图元Node0_1.a('node.font','bold '+ Lib_排布图图元Node0_1fontSize + 'px "Arial"');
Lib_排布图图元Node0_1.a('node.textvisible',true);
Lib_排布图图元Node0_1.a('node.linefeed',false);
if (false) {
Lib_排布图图元Node0_1.a('node.textfunc',function(g) {
g.beginPath();
var str=Lib_排布图图元Node0_1.a('node.text') || 'B14';
var color=Lib_排布图图元Node0_1.a('node.color') || 'rgba(255,255,255,1)';
canvasTextAutoLine(str,0,13.3333*0.5*_ratio.ratioY,Lib_排布图图元Node0_1width,Lib_排布图图元Node0_1height,13.3333*_ratio.ratioY,"center",color,'bold '+ Lib_排布图图元Node0_1fontSize + 'px "Arial"', 0,g);
});
}
if (false) {
Lib_排布图图元Node0_1.a('node.underlinepoints',[Lib_排布图图元Node0_1lineStart, (18 - 13.3333) * 0.5 * _ratio.ratioY + Lib_排布图图元Node0_1fontSize + 2 , ht.Default.getTextSize('B14', 'bold '+ Lib_排布图图元Node0_1fontSize + 'px "Arial"').width + 6, (Lib_排布图图元Node0_1height - Lib_排布图图元Node0_1fontSize) * 0.5*_ratio.ratioY + Lib_排布图图元Node0_1fontSize + 2 ]);
Lib_排布图图元Node0_1.a('node.underlinevisible',false);
Lib_排布图图元Node0_1.a('node.underlineBorderWidth', 1);
}
dataModel.add(Lib_排布图图元Node0_1);
zoomNodeList.push({
node: Lib_排布图图元Node0_1,
borderWidth: 0,
attr: 'node.borderwidth'
});
var Lib_排布图图元Node1_0 = new ht.HtmlNode();
_ratio = GD.getRatioWithRotation(0*Math.PI/180, ratio);
Lib_排布图图元Node1_0.setPosition(20*ratio.ratioX, 22*ratio.ratioY);
Lib_排布图图元Node1_0.setSize(31*_ratio.ratioX, 44*_ratio.ratioY);
Lib_排布图图元Node1_0.setHtml("");
Lib_排布图图元Node1_0.setRotation(0*Math.PI/180);
Lib_排布图图元Node1_0._nodeType = 'imageAnimate';
Lib_排布图图元Node1_0._disallowEvert = true;
dataModel.add(Lib_排布图图元Node1_0);
var Lib_排布图图元Node1_0tooltip = new ht.HtmlNode();
Lib_排布图图元Node1_0tooltip.s('2d.visible',false);
var Lib_排布图图元Node1_1;
(function () {
var _ratio = GD.getRatioWithRotation(0*Math.PI/180, ratio);
var ratioX, ratioY;
if ('Default' === 'False') {
ratioX = 1;
ratioY = 1;
} else if ('Default' === 'X') {
ratioX = ratioY = _ratio.ratioX;
} else if ('Default' === 'Y') {
ratioX = ratioY = _ratio.ratioY;
} else {
ratioX = _ratio.ratioX;
ratioY = _ratio.ratioY;
}
ht.Default.setImage('imgimage//page_zmt_fjx_gray0.png', PAGEROOTDIR + 'image//page_zmt_fjx_gray0.png');
Lib_排布图图元Node1_1 = new ht.Node();
Lib_排布图图元Node1_1.setPosition(20*ratio.ratioX, 22*ratio.ratioY);
Lib_排布图图元Node1_1.setSize(31*ratioX, 44*ratioY);
Lib_排布图图元Node1_1.setImage('imgimage//page_zmt_fjx_gray0.png');
Lib_排布图图元Node1_1.setRotation(0*Math.PI/180);
Lib_排布图图元Node1_1._zoomBy = 'Default';
Lib_排布图图元Node1_1._nodeType = 'image';
Lib_排布图图元Node1_1._disallowEvert = true;
dataModel.add(Lib_排布图图元Node1_1);
})();
var Lib_排布图图元Node1_1tooltip = new ht.HtmlNode();
Lib_排布图图元Node1_1tooltip.s('2d.visible',false);
var Lib_排布图图元Node1_2;
(function () {
var _ratio = GD.getRatioWithRotation(0*Math.PI/180, ratio);
var ratioX, ratioY;
if ('Default' === 'False') {
ratioX = 1;
ratioY = 1;
} else if ('Default' === 'X') {
ratioX = ratioY = _ratio.ratioX;
} else if ('Default' === 'Y') {
ratioX = ratioY = _ratio.ratioY;
} else {
ratioX = _ratio.ratioX;
ratioY = _ratio.ratioY;
}
ht.Default.setImage('imgimage//page_zmt_fjx_orange0.png', PAGEROOTDIR + 'image//page_zmt_fjx_orange0.png');
Lib_排布图图元Node1_2 = new ht.Node();
Lib_排布图图元Node1_2.setPosition(20*ratio.ratioX, 22*ratio.ratioY);
Lib_排布图图元Node1_2.setSize(31*ratioX, 44*ratioY);
Lib_排布图图元Node1_2.setImage('imgimage//page_zmt_fjx_orange0.png');
Lib_排布图图元Node1_2.setRotation(0*Math.PI/180);
Lib_排布图图元Node1_2._zoomBy = 'Default';
Lib_排布图图元Node1_2._nodeType = 'image';
Lib_排布图图元Node1_2._disallowEvert = true;
dataModel.add(Lib_排布图图元Node1_2);
})();
var Lib_排布图图元Node1_2tooltip = new ht.HtmlNode();
Lib_排布图图元Node1_2tooltip.s('2d.visible',false);
var Lib_排布图图元Node1_3;
(function () {
var _ratio = GD.getRatioWithRotation(0*Math.PI/180, ratio);
var ratioX, ratioY;
if ('Default' === 'False') {
ratioX = 1;
ratioY = 1;
} else if ('Default' === 'X') {
ratioX = ratioY = _ratio.ratioX;
} else if ('Default' === 'Y') {
ratioX = ratioY = _ratio.ratioY;
} else {
ratioX = _ratio.ratioX;
ratioY = _ratio.ratioY;
}
ht.Default.setImage('imgimage//page_zmt_fjx_green0.png', PAGEROOTDIR + 'image//page_zmt_fjx_green0.png');
Lib_排布图图元Node1_3 = new ht.Node();
Lib_排布图图元Node1_3.setPosition(20*ratio.ratioX, 22*ratio.ratioY);
Lib_排布图图元Node1_3.setSize(31*ratioX, 44*ratioY);
Lib_排布图图元Node1_3.setImage('imgimage//page_zmt_fjx_green0.png');
Lib_排布图图元Node1_3.setRotation(0*Math.PI/180);
Lib_排布图图元Node1_3._zoomBy = 'Default';
Lib_排布图图元Node1_3._nodeType = 'image';
Lib_排布图图元Node1_3._disallowEvert = true;
dataModel.add(Lib_排布图图元Node1_3);
})();
var Lib_排布图图元Node1_3tooltip = new ht.HtmlNode();
Lib_排布图图元Node1_3tooltip.s('2d.visible',false);
var Lib_排布图图元Node1_4;
(function () {
var _ratio = GD.getRatioWithRotation(0*Math.PI/180, ratio);
var ratioX, ratioY;
if ('Default' === 'False') {
ratioX = 1;
ratioY = 1;
} else if ('Default' === 'X') {
ratioX = ratioY = _ratio.ratioX;
} else if ('Default' === 'Y') {
ratioX = ratioY = _ratio.ratioY;
} else {
ratioX = _ratio.ratioX;
ratioY = _ratio.ratioY;
}
ht.Default.setImage('imgimage//page_zmt_fjx_pink0.png', PAGEROOTDIR + 'image//page_zmt_fjx_pink0.png');
Lib_排布图图元Node1_4 = new ht.Node();
Lib_排布图图元Node1_4.setPosition(20*ratio.ratioX, 22*ratio.ratioY);
Lib_排布图图元Node1_4.setSize(31*ratioX, 44*ratioY);
Lib_排布图图元Node1_4.setImage('imgimage//page_zmt_fjx_pink0.png');
Lib_排布图图元Node1_4.setRotation(0*Math.PI/180);
Lib_排布图图元Node1_4._zoomBy = 'Default';
Lib_排布图图元Node1_4._nodeType = 'image';
Lib_排布图图元Node1_4._disallowEvert = true;
dataModel.add(Lib_排布图图元Node1_4);
})();
var Lib_排布图图元Node1_4tooltip = new ht.HtmlNode();
Lib_排布图图元Node1_4tooltip.s('2d.visible',false);
var Lib_排布图图元Node1_5;
(function () {
var _ratio = GD.getRatioWithRotation(0*Math.PI/180, ratio);
var ratioX, ratioY;
if ('Default' === 'False') {
ratioX = 1;
ratioY = 1;
} else if ('Default' === 'X') {
ratioX = ratioY = _ratio.ratioX;
} else if ('Default' === 'Y') {
ratioX = ratioY = _ratio.ratioY;
} else {
ratioX = _ratio.ratioX;
ratioY = _ratio.ratioY;
}
ht.Default.setImage('imgimage//page_zmt_fjx_red0.png', PAGEROOTDIR + 'image//page_zmt_fjx_red0.png');
Lib_排布图图元Node1_5 = new ht.Node();
Lib_排布图图元Node1_5.setPosition(20*ratio.ratioX, 22*ratio.ratioY);
Lib_排布图图元Node1_5.setSize(31*ratioX, 44*ratioY);
Lib_排布图图元Node1_5.setImage('imgimage//page_zmt_fjx_red0.png');
Lib_排布图图元Node1_5.setRotation(0*Math.PI/180);
Lib_排布图图元Node1_5._zoomBy = 'Default';
Lib_排布图图元Node1_5._nodeType = 'image';
Lib_排布图图元Node1_5._disallowEvert = true;
dataModel.add(Lib_排布图图元Node1_5);
})();
var Lib_排布图图元Node1_5tooltip = new ht.HtmlNode();
Lib_排布图图元Node1_5tooltip.s('2d.visible',false);
/*@GraphList@*/
setBorderOpacity(Lib_排布图图元Node0_0,0.78,"Lib_排布图图元Node0_0");
setShapeOpacity(Lib_排布图图元Node0_0,0.7,"Lib_排布图图元Node0_0");
/*@PageInit@*/
var localVarObj = this.localVarObj;
var localDynamicVarObj = this.localDynamicVar();
var zhuangtai= localVarObj.zhuangtai || localDynamicVarObj.zhuangtai;
var bianhao= localVarObj.bianhao || localDynamicVarObj.bianhao;
var fengsu= localVarObj.fengsu || localDynamicVarObj.fengsu;
var gonglv= localVarObj.gonglv || localDynamicVarObj.gonglv;
this['Lib_排布图图元Node0_0'] = Lib_排布图图元Node0_0;
Lib_排布图图元Node0_0.__parentLib = nodename;
Lib_排布图图元Node0_0.__parent = this;
this.childNodes.push(Lib_排布图图元Node0_0);
this['Lib_排布图图元Node0_1'] = Lib_排布图图元Node0_1;
Lib_排布图图元Node0_1.__parentLib = nodename;
Lib_排布图图元Node0_1.__parent = this;
this.childNodes.push(Lib_排布图图元Node0_1);
this['Lib_排布图图元Node1_0'] = Lib_排布图图元Node1_0;
Lib_排布图图元Node1_0.__parentLib = nodename;
Lib_排布图图元Node1_0.__parent = this;
this.childNodes.push(Lib_排布图图元Node1_0);
this['Lib_排布图图元Node1_0tooltip'] = Lib_排布图图元Node1_0tooltip;
Lib_排布图图元Node1_0tooltip.__parentLib = nodename;
this['Lib_排布图图元Node1_1'] = Lib_排布图图元Node1_1;
Lib_排布图图元Node1_1.__parentLib = nodename;
Lib_排布图图元Node1_1.__parent = this;
this.childNodes.push(Lib_排布图图元Node1_1);
this['Lib_排布图图元Node1_1tooltip'] = Lib_排布图图元Node1_1tooltip;
Lib_排布图图元Node1_1tooltip.__parentLib = nodename;
this['Lib_排布图图元Node1_2'] = Lib_排布图图元Node1_2;
Lib_排布图图元Node1_2.__parentLib = nodename;
Lib_排布图图元Node1_2.__parent = this;
this.childNodes.push(Lib_排布图图元Node1_2);
this['Lib_排布图图元Node1_2tooltip'] = Lib_排布图图元Node1_2tooltip;
Lib_排布图图元Node1_2tooltip.__parentLib = nodename;
this['Lib_排布图图元Node1_3'] = Lib_排布图图元Node1_3;
Lib_排布图图元Node1_3.__parentLib = nodename;
Lib_排布图图元Node1_3.__parent = this;
this.childNodes.push(Lib_排布图图元Node1_3);
this['Lib_排布图图元Node1_3tooltip'] = Lib_排布图图元Node1_3tooltip;
Lib_排布图图元Node1_3tooltip.__parentLib = nodename;
this['Lib_排布图图元Node1_4'] = Lib_排布图图元Node1_4;
Lib_排布图图元Node1_4.__parentLib = nodename;
Lib_排布图图元Node1_4.__parent = this;
this.childNodes.push(Lib_排布图图元Node1_4);
this['Lib_排布图图元Node1_4tooltip'] = Lib_排布图图元Node1_4tooltip;
Lib_排布图图元Node1_4tooltip.__parentLib = nodename;
this['Lib_排布图图元Node1_5'] = Lib_排布图图元Node1_5;
Lib_排布图图元Node1_5.__parentLib = nodename;
Lib_排布图图元Node1_5.__parent = this;
this.childNodes.push(Lib_排布图图元Node1_5);
this['Lib_排布图图元Node1_5tooltip'] = Lib_排布图图元Node1_5tooltip;
Lib_排布图图元Node1_5tooltip.__parentLib = nodename;
/*@ControlContextMenu@*/
/*@Declare@*/
this.init(x, y, width, height, angle);
};
ht.Default.def('ht.lib.排布图图元', Object, {
refresh10ms: function () {
var localVarObj = this.localVarObj;
var localDynamicVarObj = this.localDynamicVar();
var zhuangtai= localVarObj.zhuangtai || localDynamicVarObj.zhuangtai;
var bianhao= localVarObj.bianhao || localDynamicVarObj.bianhao;
var fengsu= localVarObj.fengsu || localDynamicVarObj.fengsu;
var gonglv= localVarObj.gonglv || localDynamicVarObj.gonglv;
var Lib_排布图图元Node0_0= this.Lib_排布图图元Node0_0;
var Lib_排布图图元Node0_1= this.Lib_排布图图元Node0_1;
var Lib_排布图图元Node1_0= this.Lib_排布图图元Node1_0;
var Lib_排布图图元Node1_0tooltip = this.Lib_排布图图元Node1_0tooltip;
var Lib_排布图图元Node1_1= this.Lib_排布图图元Node1_1;
var Lib_排布图图元Node1_1tooltip = this.Lib_排布图图元Node1_1tooltip;
var Lib_排布图图元Node1_2= this.Lib_排布图图元Node1_2;
var Lib_排布图图元Node1_2tooltip = this.Lib_排布图图元Node1_2tooltip;
var Lib_排布图图元Node1_3= this.Lib_排布图图元Node1_3;
var Lib_排布图图元Node1_3tooltip = this.Lib_排布图图元Node1_3tooltip;
var Lib_排布图图元Node1_4= this.Lib_排布图图元Node1_4;
var Lib_排布图图元Node1_4tooltip = this.Lib_排布图图元Node1_4tooltip;
var Lib_排布图图元Node1_5= this.Lib_排布图图元Node1_5;
var Lib_排布图图元Node1_5tooltip = this.Lib_排布图图元Node1_5tooltip;
/*@refresh10ms@*/
},
refresh100ms: function () {
var localVarObj = this.localVarObj;
var localDynamicVarObj = this.localDynamicVar();
var zhuangtai= localVarObj.zhuangtai || localDynamicVarObj.zhuangtai;
var bianhao= localVarObj.bianhao || localDynamicVarObj.bianhao;
var fengsu= localVarObj.fengsu || localDynamicVarObj.fengsu;
var gonglv= localVarObj.gonglv || localDynamicVarObj.gonglv;
var Lib_排布图图元Node0_0= this.Lib_排布图图元Node0_0;
var Lib_排布图图元Node0_1= this.Lib_排布图图元Node0_1;
var Lib_排布图图元Node1_0= this.Lib_排布图图元Node1_0;
var Lib_排布图图元Node1_0tooltip = this.Lib_排布图图元Node1_0tooltip;
var Lib_排布图图元Node1_1= this.Lib_排布图图元Node1_1;
var Lib_排布图图元Node1_1tooltip = this.Lib_排布图图元Node1_1tooltip;
var Lib_排布图图元Node1_2= this.Lib_排布图图元Node1_2;
var Lib_排布图图元Node1_2tooltip = this.Lib_排布图图元Node1_2tooltip;
var Lib_排布图图元Node1_3= this.Lib_排布图图元Node1_3;
var Lib_排布图图元Node1_3tooltip = this.Lib_排布图图元Node1_3tooltip;
var Lib_排布图图元Node1_4= this.Lib_排布图图元Node1_4;
var Lib_排布图图元Node1_4tooltip = this.Lib_排布图图元Node1_4tooltip;
var Lib_排布图图元Node1_5= this.Lib_排布图图元Node1_5;
var Lib_排布图图元Node1_5tooltip = this.Lib_排布图图元Node1_5tooltip;
Lib_排布图图元Node0_1.a('node.text',''+bianhao+'');
/*@refresh100ms@*/
},
refresh500ms: function () {
var localVarObj = this.localVarObj;
var localDynamicVarObj = this.localDynamicVar();
var zhuangtai= localVarObj.zhuangtai || localDynamicVarObj.zhuangtai;
var bianhao= localVarObj.bianhao || localDynamicVarObj.bianhao;
var fengsu= localVarObj.fengsu || localDynamicVarObj.fengsu;
var gonglv= localVarObj.gonglv || localDynamicVarObj.gonglv;
var Lib_排布图图元Node0_0= this.Lib_排布图图元Node0_0;
var Lib_排布图图元Node0_1= this.Lib_排布图图元Node0_1;
var Lib_排布图图元Node1_0= this.Lib_排布图图元Node1_0;
var Lib_排布图图元Node1_0tooltip = this.Lib_排布图图元Node1_0tooltip;
var Lib_排布图图元Node1_1= this.Lib_排布图图元Node1_1;
var Lib_排布图图元Node1_1tooltip = this.Lib_排布图图元Node1_1tooltip;
var Lib_排布图图元Node1_2= this.Lib_排布图图元Node1_2;
var Lib_排布图图元Node1_2tooltip = this.Lib_排布图图元Node1_2tooltip;
var Lib_排布图图元Node1_3= this.Lib_排布图图元Node1_3;
var Lib_排布图图元Node1_3tooltip = this.Lib_排布图图元Node1_3tooltip;
var Lib_排布图图元Node1_4= this.Lib_排布图图元Node1_4;
var Lib_排布图图元Node1_4tooltip = this.Lib_排布图图元Node1_4tooltip;
var Lib_排布图图元Node1_5= this.Lib_排布图图元Node1_5;
var Lib_排布图图元Node1_5tooltip = this.Lib_排布图图元Node1_5tooltip;
if((1 )>0) {if(((getVarValue(zhuangtai)==1)>0 )){Lib_排布图图元Node1_0.s('2d.visible',true&&this.getStyle('2d.visible'));}else{Lib_排布图图元Node1_0.s('2d.visible',false&&this.getStyle('2d.visible'));}}
if((1 )>0) {if(((getVarValue(zhuangtai)==3)>0 )){Lib_排布图图元Node1_1.s('2d.visible',true&&this.getStyle('2d.visible'));}else{Lib_排布图图元Node1_1.s('2d.visible',false&&this.getStyle('2d.visible'));}}
if((1 )>0) {if(((getVarValue(zhuangtai)==4)>0 )){Lib_排布图图元Node1_2.s('2d.visible',true&&this.getStyle('2d.visible'));}else{Lib_排布图图元Node1_2.s('2d.visible',false&&this.getStyle('2d.visible'));}}
if((1 )>0) {if(((getVarValue(zhuangtai)==0)>0 )){Lib_排布图图元Node1_3.s('2d.visible',true&&this.getStyle('2d.visible'));}else{Lib_排布图图元Node1_3.s('2d.visible',false&&this.getStyle('2d.visible'));}}
if((1 )>0) {if(((getVarValue(zhuangtai)==5||getVarValue(zhuangtai)==6)>0 )){Lib_排布图图元Node1_4.s('2d.visible',true&&this.getStyle('2d.visible'));}else{Lib_排布图图元Node1_4.s('2d.visible',false&&this.getStyle('2d.visible'));}}
if((1 )>0) {if(((getVarValue(zhuangtai)==2)>0 )){Lib_排布图图元Node1_5.s('2d.visible',true&&this.getStyle('2d.visible'));}else{Lib_排布图图元Node1_5.s('2d.visible',false&&this.getStyle('2d.visible'));}}
/*@refresh500ms@*/
},
refresh1s: function () {
var Counter1s = arguments[0] || 0;
var localVarObj = this.localVarObj;
var localDynamicVarObj = this.localDynamicVar();
var zhuangtai= localVarObj.zhuangtai || localDynamicVarObj.zhuangtai;
var bianhao= localVarObj.bianhao || localDynamicVarObj.bianhao;
var fengsu= localVarObj.fengsu || localDynamicVarObj.fengsu;
var gonglv= localVarObj.gonglv || localDynamicVarObj.gonglv;
var Lib_排布图图元Node0_0= this.Lib_排布图图元Node0_0;
var Lib_排布图图元Node0_1= this.Lib_排布图图元Node0_1;
var Lib_排布图图元Node1_0= this.Lib_排布图图元Node1_0;
var Lib_排布图图元Node1_0tooltip = this.Lib_排布图图元Node1_0tooltip;
var Lib_排布图图元Node1_1= this.Lib_排布图图元Node1_1;
var Lib_排布图图元Node1_1tooltip = this.Lib_排布图图元Node1_1tooltip;
var Lib_排布图图元Node1_2= this.Lib_排布图图元Node1_2;
var Lib_排布图图元Node1_2tooltip = this.Lib_排布图图元Node1_2tooltip;
var Lib_排布图图元Node1_3= this.Lib_排布图图元Node1_3;
var Lib_排布图图元Node1_3tooltip = this.Lib_排布图图元Node1_3tooltip;
var Lib_排布图图元Node1_4= this.Lib_排布图图元Node1_4;
var Lib_排布图图元Node1_4tooltip = this.Lib_排布图图元Node1_4tooltip;
var Lib_排布图图元Node1_5= this.Lib_排布图图元Node1_5;
var Lib_排布图图元Node1_5tooltip = this.Lib_排布图图元Node1_5tooltip;
getAlarmDataColor();
(typeof Lib_排布图图元Node1_0tooltip !== 'undefined' && Lib_排布图图元Node1_0tooltip.s('2d.visible') === true)&&changeToolTipContentColor(Lib_排布图图元Node1_0tooltip,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'});
getAlarmDataColor();
(typeof Lib_排布图图元Node1_1tooltip !== 'undefined' && Lib_排布图图元Node1_1tooltip.s('2d.visible') === true)&&changeToolTipContentColor(Lib_排布图图元Node1_1tooltip,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'});
getAlarmDataColor();
(typeof Lib_排布图图元Node1_2tooltip !== 'undefined' && Lib_排布图图元Node1_2tooltip.s('2d.visible') === true)&&changeToolTipContentColor(Lib_排布图图元Node1_2tooltip,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'});
getAlarmDataColor();
(typeof Lib_排布图图元Node1_3tooltip !== 'undefined' && Lib_排布图图元Node1_3tooltip.s('2d.visible') === true)&&changeToolTipContentColor(Lib_排布图图元Node1_3tooltip,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'});
getAlarmDataColor();
(typeof Lib_排布图图元Node1_4tooltip !== 'undefined' && Lib_排布图图元Node1_4tooltip.s('2d.visible') === true)&&changeToolTipContentColor(Lib_排布图图元Node1_4tooltip,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'});
getAlarmDataColor();
(typeof Lib_排布图图元Node1_5tooltip !== 'undefined' && Lib_排布图图元Node1_5tooltip.s('2d.visible') === true)&&changeToolTipContentColor(Lib_排布图图元Node1_5tooltip,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'});
/*@refresh1s@*/
},
refresh5s: function () {
var localVarObj = this.localVarObj;
var localDynamicVarObj = this.localDynamicVar();
var zhuangtai= localVarObj.zhuangtai || localDynamicVarObj.zhuangtai;
var bianhao= localVarObj.bianhao || localDynamicVarObj.bianhao;
var fengsu= localVarObj.fengsu || localDynamicVarObj.fengsu;
var gonglv= localVarObj.gonglv || localDynamicVarObj.gonglv;
var Lib_排布图图元Node0_0= this.Lib_排布图图元Node0_0;
var Lib_排布图图元Node0_1= this.Lib_排布图图元Node0_1;
var Lib_排布图图元Node1_0= this.Lib_排布图图元Node1_0;
var Lib_排布图图元Node1_0tooltip = this.Lib_排布图图元Node1_0tooltip;
var Lib_排布图图元Node1_1= this.Lib_排布图图元Node1_1;
var Lib_排布图图元Node1_1tooltip = this.Lib_排布图图元Node1_1tooltip;
var Lib_排布图图元Node1_2= this.Lib_排布图图元Node1_2;
var Lib_排布图图元Node1_2tooltip = this.Lib_排布图图元Node1_2tooltip;
var Lib_排布图图元Node1_3= this.Lib_排布图图元Node1_3;
var Lib_排布图图元Node1_3tooltip = this.Lib_排布图图元Node1_3tooltip;
var Lib_排布图图元Node1_4= this.Lib_排布图图元Node1_4;
var Lib_排布图图元Node1_4tooltip = this.Lib_排布图图元Node1_4tooltip;
var Lib_排布图图元Node1_5= this.Lib_排布图图元Node1_5;
var Lib_排布图图元Node1_5tooltip = this.Lib_排布图图元Node1_5tooltip;
/*@refresh5s@*/
},
/*@PageDynamic@*/
onEvent: function (e, data, type, origin, offset, objMouseOn, ctm) {
var localVarObj = this.localVarObj;
var localDynamicVarObj = this.localDynamicVar();
var zhuangtai= localVarObj.zhuangtai || localDynamicVarObj.zhuangtai;
var bianhao= localVarObj.bianhao || localDynamicVarObj.bianhao;
var fengsu= localVarObj.fengsu || localDynamicVarObj.fengsu;
var gonglv= localVarObj.gonglv || localDynamicVarObj.gonglv;
var Lib_排布图图元Node0_0= this.Lib_排布图图元Node0_0;
var Lib_排布图图元Node0_1= this.Lib_排布图图元Node0_1;
var Lib_排布图图元Node1_0= this.Lib_排布图图元Node1_0;
var Lib_排布图图元Node1_0tooltip = this.Lib_排布图图元Node1_0tooltip;
var Lib_排布图图元Node1_1= this.Lib_排布图图元Node1_1;
var Lib_排布图图元Node1_1tooltip = this.Lib_排布图图元Node1_1tooltip;
var Lib_排布图图元Node1_2= this.Lib_排布图图元Node1_2;
var Lib_排布图图元Node1_2tooltip = this.Lib_排布图图元Node1_2tooltip;
var Lib_排布图图元Node1_3= this.Lib_排布图图元Node1_3;
var Lib_排布图图元Node1_3tooltip = this.Lib_排布图图元Node1_3tooltip;
var Lib_排布图图元Node1_4= this.Lib_排布图图元Node1_4;
var Lib_排布图图元Node1_4tooltip = this.Lib_排布图图元Node1_4tooltip;
var Lib_排布图图元Node1_5= this.Lib_排布图图元Node1_5;
var Lib_排布图图元Node1_5tooltip = this.Lib_排布图图元Node1_5tooltip;
if (type === 'click') {
/*@EvnentClicked@*/
} else if (type === 'mousedown') {
mouseX=e.clientX;
mouseY=e.clientY;
/*@EvnentMouseDown@*/
} else if (type === 'mouseup') {
/*@EvnentMouseUp@*/
} else if (type === 'mousemove') {
var mouseX, mouseY, position, zoom;
position=origin.getLogicalPoint(e);
zoom = graphView.getZoom();
if (origin === graphView) {
mouseX= position.x + origin.tx();
mouseY = position.y + origin.ty();
} else {
offset = offset || {x: 0, y: 0};
mouseX = position.x / zoom + offset.x + origin.tx();
mouseY = position.y / zoom + offset.y + origin.ty();
}
if(data !== Lib_排布图图元Node1_0&& objMouseOn===Lib_排布图图元Node1_0){Lib_排布图图元Node1_0tooltip.s('2d.visible',false); destoryDomToolTip(); }
if(data !== Lib_排布图图元Node1_1&& objMouseOn===Lib_排布图图元Node1_1){Lib_排布图图元Node1_1tooltip.s('2d.visible',false); destoryDomToolTip(); }
if(data !== Lib_排布图图元Node1_2&& objMouseOn===Lib_排布图图元Node1_2){Lib_排布图图元Node1_2tooltip.s('2d.visible',false); destoryDomToolTip(); }
if(data !== Lib_排布图图元Node1_3&& objMouseOn===Lib_排布图图元Node1_3){Lib_排布图图元Node1_3tooltip.s('2d.visible',false); destoryDomToolTip(); }
if(data !== Lib_排布图图元Node1_4&& objMouseOn===Lib_排布图图元Node1_4){Lib_排布图图元Node1_4tooltip.s('2d.visible',false); destoryDomToolTip(); }
if(data !== Lib_排布图图元Node1_5&& objMouseOn===Lib_排布图图元Node1_5){Lib_排布图图元Node1_5tooltip.s('2d.visible',false); destoryDomToolTip(); }
/*@EvnentMouseLeave@*/
if(data === Lib_排布图图元Node1_0){createPageTooltip(Lib_排布图图元Node1_0tooltip,mouseX,mouseY,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'},'Up'); }
if(data === Lib_排布图图元Node1_1){createPageTooltip(Lib_排布图图元Node1_1tooltip,mouseX,mouseY,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'},'Up'); }
if(data === Lib_排布图图元Node1_2){createPageTooltip(Lib_排布图图元Node1_2tooltip,mouseX,mouseY,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'},'Up'); }
if(data === Lib_排布图图元Node1_3){createPageTooltip(Lib_排布图图元Node1_3tooltip,mouseX,mouseY,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'},'Up'); }
if(data === Lib_排布图图元Node1_4){createPageTooltip(Lib_排布图图元Node1_4tooltip,mouseX,mouseY,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'},'Up'); }
if(data === Lib_排布图图元Node1_5){createPageTooltip(Lib_排布图图元Node1_5tooltip,mouseX,mouseY,{backColor:'rgba(0,0,0,0.007843138)',fontColor:'rgba(0,0,0,1)',value:'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 0px 2px'},{backColor:'rgba(20,61,42,0.6980392)',fontColor:'rgba(255,255,255,1)',value:getColorValue('',fengsu,'m/s')+'
'+getColorValue('',gonglv,'MW')+'',fontSize:10,fontFamily:'Arial',padding:'2px 2px 2px 2px'},'Up'); }
/*@EvnentMouseOver@*/
} else if (type === 'keydown') {
/*@EvnentKeyDown@*/
} else if (type === 'contextmenu') {
/*@Declare@*/
/*@SetNodeContextMenu@*/
/*@SetPageContextMenu@*/
}
/*@LibEvent@*/
},
getBaseClass: function () {
return this._baseClass;
},
getWidth: function () {
return this._width;
},
getHeight: function () {
return this._height;
},
getSize: function () {
return {
width: this._width,
height: this._height
}
},
setWidth: function (width) {
if (width === undefined || width === null || width != width) {
return ;
}
var originWidth = this._width;
var ratio = width / originWidth;
var childNodes = this.childNodes, childNode, p, op = this.getPosition(), w, cw, ox, rotation = this.getRotation();
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
p = childNode.getPosition();
cw = childNode.getWidth();
w = cw >=2 ? cw * ratio : cw;
childNode.setWidth(w);
ox = op.x + (p.x - op.x) * ratio;
childNode.setPosition(ox, p.y);
rotation = GD.calcRotation(rotation);
if (rotation === 0 || rotation === Math.PI) {
// 图元未旋转
ox = op.x + (p.x - op.x)*ratio;
childNode.setPosition(ox, p.y);
} else if (rotation === 90 * Math.PI / 180) {
// 图元旋转以后
ox = op.y + (p.y - op.y)*ratio;
childNode.setPosition(p.x, ox);
}
}
this._width = width;
this._originWidth = width;
this._ratioX = ratio;
return this;
},
setHeight: function (height) {
if (height === undefined || height === null || height != height) {
return ;
}
var originHeight = this._height;
var ratio = height / originHeight;
var childNodes = this.childNodes, childNode, p, op = this.getPosition(), h, ch, oy, rotation = this.getRotation();
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
p = childNode.getPosition();
ch = childNode.getHeight();
h = ch >=2 ? ch * ratio : ch;
childNode.setHeight(h);
rotation = GD.calcRotation(rotation);
if (rotation === 0 || rotation === Math.PI) {
// 图元未旋转
oy = op.y + (p.y - op.y)*ratio;
childNode.setPosition(p.x, oy);
} else if (rotation === 90 * Math.PI / 180) {
// 图元旋转以后
oy = op.x + (p.x - op.x)*ratio;
childNode.setPosition(oy, p.y);
}
}
this._height = height;
this._originHeight = height;
this._ratioY = ratio;
return this;
},
setSize: function (size) {
// var args = Array.prototype.slice.call(arguments, 0);
// var height, width;
// if (args.length === 0) {
// return ;
// }else if (args.length === 1) {
// height = args[0].height;
// width = args[0].width;
// } else {
// width = args[0];
// height = args[1];
// }
// var wh = GD.getRatioWithRotation(angle, wid)
// this.setHeight(height);
// this.setWidth(width);
// return this;
var args = Array.prototype.slice.call(arguments, 0);
var height, width;
if (args.length === 0) {
return ;
}else if (args.length === 1) {
height = args[0].height;
width = args[0].width;
angle = 0;
} else if (args.length === 2) {
if (typeof args[0] === 'object') {
width = args[0].width;
height = args[0].height;
angle = args[1] || 0;
} else {
width = args[0];
height = args[1];
angle = 0;
}
} else if (args.length === 3) {
width = args[0];
height = args[1];
angle = args[2] || 0;
}
var wh = GD.getRatioWithRotation(0, width, height);
this.setHeight(wh.ratioY);
this.setWidth(wh.ratioX);
return this;
},
getPosition: function () {
return {
x: this._x,
y: this._y
}
},
setPosition: function () {
var args = Array.prototype.slice.call(arguments, 0), x, y;
if (args.length === 0) {
return this;
} else if (args.length === 1) {
if (typeof args[0] != 'object') {
return this;
}
x = args[0].x;
y = args[0].y;
} else {
x = args[0];
y = args[1];
}
if ((x !== 0 && !x) || (y !== 0 && !y)) {
return this;
}
// var childNodes = this.childNodes, offset, childNode, p;
// for (var i = 0, len = childNodes.length; i < len; i++) {
// childNode = childNodes[i];
// p = childNode.getPosition();
// childNode.setPosition(x - (this._x-p.x)*this._ratioX, y - (this._y-p.y)*this._ratioY);
// }
// this._x = x;
// this._y = y;
// return this;
var childNodes, childNode, background, offset = {}, op, cp;
childNodes = this.childNodes;
background = this._background;
op = background.getPosition();
offset.x = x - op.x;
offset.y = y - op.y;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
cp = childNode.getPosition();
childNode.setPosition(cp.x + offset.x, cp.y + offset.y);
}
this._x = x;
this._y = y;
this._position = {x: x, y: y};
return this;
},
getStyle: function (key) {
if (!key) {
return undefined;
}
return this._styleObject[key];
},
setStyle: function (key, value, force) {
var childNodes = this.childNodes, childNode;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
if (key === '2d.visible') {
if (value === graphView.isVisible(childNode)) {
continue;
}
if (!value) {
childNode._savedIsVisible = graphView.isVisible(childNode);
childNode.s({
'2d.visible': false
})
} else {
childNode.s({
'2d.visible': childNode._savedIsVisible
})
}
continue;
}
childNode.s({
key: value
});
}
this._styleObject[key] = value;
return this;
},
calcSize: function () {
var background = this._background;
var position = background.getPosition(),
width = background.getWidth(),
height = background.getHeight();
this._width = width;
this._height = height;
this._x = position.x;
this._y = position.y;
this._position = {
x: this._x,
y: this._y
}
return this;
return this;
},
s: function (styleObj, force) {
var args = Array.prototype.slice.call(arguments, 0);
var styleObj;
if (args.length === 0) {
return this;
} else if (args.length === 1) {
styleObj = args[0];
} else {
this.setStyle(args[0], args[1]);
return this;
}
for (var key in styleObj) {
if (!styleObj.hasOwnProperty(key)) {
continue;
}
this.setStyle(key, styleObj[key], force);
}
return this;
},
init: function (x, y, width, height, angle) {
var that = this;
this.calcSize();
(function (width, height, angle) {
// that.setSize(width, height, angle);
// var wh = GD.getRatioWithRotation(angle, width, height);
// width = wh.ratioX;
// height = wh.ratioY;
var originHeight = that._height;
var originWidth = that._width;
var ratioY = height / originHeight;
var ratioX = width / originWidth;
var childNodes = that.childNodes,
childNode,p, op = that.getPosition(), h, ch, oy, w, cw, ox, name, borderRatio, borderWidth;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
p = childNode.getPosition();
childNode.originHeight = childNode.originHeight || childNode.getHeight();
ch = childNode.getHeight();
cw = childNode.getWidth();
if (ch > 2) {
h = ch * ratioY;
childNode.setHeight(h);
}
if (cw > 2) {
w = cw * ratioX;
childNode.setWidth(w);
}
borderRatio = (ratioX + ratioY)*0.5;
if (childNode._nodeType === 'line') { // 如果是线,
if (childNode.getWidth() > childNode.getHeight()) {
borderRatio = ratioX;
} else {
borderRatio = ratioY;
}
}
name = childNode._nodename;
// if (childNode.borderWidth && name && ch > 2 && cw > 2) {
// borderWidth = childNode.borderWidth / borderRatio;
// if (borderWidth > ch*0.5 || borderWidth > cw *0.5) {
// // borderWidth = childNode.borderWidth;
// }
// childNode.borderWidth = borderWidth;
// childNode.a(name + '.borderwidth', borderWidth);
// }
}
that._height = height;
that._originHeight = height;
that._ratioY = ratioY;
that._width = width;
that._originWidth = width;
that._ratioX = ratioX;
})(width, height, angle);
that._x = width / 2;
that._y = height / 2;
that._rotation = 0;
// that.setPosition(x, y);
(function (x, y) {
var childNodes = that.childNodes, offset, childNode;
var w2 = that.getWidth() / 2, h2 = that.getHeight()/2;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
offset = childNode.getPosition();
childNode.setPosition(x + offset.x * that._ratioX - w2, y + offset.y * that._ratioY - h2);
}
that._x = x;
that._y = y;
})(x, y);
// setTimeout(that.addEVent, 1000);
},
setRotation: function (angle) {
var that = this, _angle = that.getRotation();
if (angle!==0 && !angle || angle === _angle) {
return this;
}
var childNodes = this.childNodes, childNode, p = this.getPosition(), px = p.x, py = p.y;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
var x = childNode.getPosition().x - px;
var y = childNode.getPosition().y - py;
childNode.setPosition(Math.cos(angle-_angle) * x - Math.sin(angle-_angle) * y + px, Math.cos(angle-_angle) * y + Math.sin(angle-_angle) * x + py);
childNode.setRotation(angle);
}
this._rotation = angle;
return this;
},
getRotation: function () {
return this._rotation;
},
setScale: function (sx, sy) {
var that = this,
childNodes = this.childNodes,
childNode;
if (sx === undefined || sx === null) return ;
if (sy === undefined || sy === null) {
sy = sx;
}
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
if (typeof childNode.setScale === 'function') {
childNode.setScale(sx, sy);
}
}
},
getScale: function () {
return this._background.getScale();
},
setScaleX: function (sx) {
if (sx === undefined || sx === null) return;
var that = this,
childNodes = this.childNodes,
childNode;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
if (typeof childNode.setScaleX === 'function') {
childNode.setScaleX(sx);
}
}
},
setScaleY: function (sy) {
if (sy === undefined || sy === null) return;
var that = this,
childNodes = this.childNodes,
childNode;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
if (typeof childNode.setScaleY === 'function') {
childNode.setScaleY(sy);
}
}
},
getScaleX: function () {
return this._background.getScaleX();
},
getScaleY: function () {
return this._background.getScaleY();
},
evert: function () {
var that = this,
childNodes = this.childNodes,
background = this._background,
bp = background.getPosition(),
bx = bp.x,
by = bp.y,
childNode, distanceX, distanceY, x, y, p, nx, ny;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
p = childNode.getPosition();
x = p.x;
y = p.y;
distanceX = bx - x;
distanceY = by - y;
nx = bx + distanceX;
ny = by + distanceY;
childNode.setPosition(nx, ny);
if (typeof childNode.setScale === 'function') {
if (!(childNode._disallowEvert === true))
childNode.setScale(-1, -1);
}
}
},
evertX: function () {
var that = this,
childNodes = this.childNodes,
background = this._background,
bx = background.getPosition().x,
childNode, distance, x, p, nx;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
p = childNode.getPosition();
x = p.x;
distance = bx - x;
nx = bx + distance;
childNode.setPosition(nx, p.y);
if (typeof childNode.setScaleX === 'function') {
if (!(childNode._disallowEvert === true))
childNode.setScaleX(-1);
}
}
},
evertY: function () {
var that = this,
childNodes = this.childNodes,
background = this._background,
by = background.getPosition().y,
childNode, distance, y, p, ny;
for (var i = 0, len = childNodes.length; i < len; i++) {
childNode = childNodes[i];
p = childNode.getPosition();
y = p.y;
distance = by - y;
ny = by + distance;
childNode.setPosition(p.x, ny);
if (typeof childNode.setScaleY === 'function') {
if (!(childNode._disallowEvert === true))
childNode.setScaleY(-1);
}
}
},
attr: function (key, value) {
var _attrObj = this._attrObj || {};
if (arguments.length === 1) {
return _attrObj[key];
}
var childNodes = this.childNodes, childNode;
_attrObj[key] = value;
for (var i = 0; childNode = childNodes[i++];) {
if (typeof childNode.a === 'function') {
childNode.a(key, value);
}
}
},
a: function () {
return this.attr.apply(this, arguments);
}
});
}