Lines Matching defs:this

4  * you may not use this file except in compliance with the License.
32 this.t1_ = Date.now();
33 this.fileName_ = fn;
34 this.parser_ = new LogParser(result);
35 this.inited_ = false;
38 this.data_ = result;
39 this.direct_ = null;
40 this.selectPoint_ = [];
41 this.visable_ = null;
43 this.loaded_ = false;
45 this.offx_ = Scr.logicw / 2;
46 this.offy_ = 30;
50 let files = Object.keys(this.data_);
51 this.selectFile_ = new XSelect(files, files[0]);
52 this.selectFile_.move(tx, ty, 550, 20);
53 this.selectFile_.registCallback(this.changeFile.bind(this));
57 this.selectFunc_ = new XSelect([], '');
58 this.selectFunc_.move(tx, ty, 290, 20);
59 this.selectFunc_.registCallback(this.changeFunc.bind(this));
62 this.selectMethod_ = new XSelect([], '');
63 this.selectMethod_.move(tx, ty, 250, 20);
64 this.selectMethod_.registCallback(this.changeMethod.bind(this));
68 this.btnGo_ = [];
69 this.mask_ = 0xffff;
79 this.mask_ = (this.mask_ & ~(1 << btn.inTypeId_)) | (btn.inTypeMask_ << btn.inTypeId_);
80 this.changeVisable();
82 this.btnGo_.push(btn);
88 let bms = [['隐藏选中(Hide selected)', () => { this.hideNode(0); }],
89 ['隐藏未选中(Hide unselected)', () => { this.hideNode(1); }],
90 ['显示隐藏(Show hide)', () => { this.hideNode(2); }],
91 ['选中前继(Select pred)', () => { this.selectNode(0); }],
92 ['选中后继(Select suc)', () => { this.selectNode(1); }],
93 ['刷新(refresh)', () => { this.freshNode(); }]];
98 this.btnGo_.push(btn);
102 this.btnGo_.push(this.selectFile_, this.selectFunc_, this.selectMethod_);
103 this.btnGo_.sort((a, b) => {
107 this.scrollY_ = new XScroll({ type: 'right' });
108 this.scrollX_ = new XScroll({ type: 'button' });
109 this.scrollY_.move(Scr.logicw - 20, 100, 20, Scr.logich - 100 - 20);
110 this.scrollX_.move(20, Scr.logich - 20, Scr.logicw - 40, 20);
112 this.hideNodeIds_ = [];
113 this.pointFile_ = files[0];
116 this.scrollY_.setBarOff(0);
117 this.scrollX_.setBarOff(0.5);
118 IrToPicture.resetPicture(this.visable_.nodes, this.direct_.type.startsWith('block:'));
122 this.hideNodeIds_ = this.hideNodeIds_.concat(this.selectPoint_);
125 let nodes = this.visable_.nodes;
127 if (this.selectPoint_.indexOf(parseInt(nodes[k].ir.id)) >= 0) {
130 this.hideNodeIds_.push(parseInt(nodes[k].ir.id));
134 this.hideNodeIds_ = [];
136 this.changeVisable();
140 let nodes = this.visable_.nodes;
141 let lines = this.visable_.lines;
150 if (type === 0 && (n1.mask & this.mask_) !== 0 && this.selectPoint_.indexOf(id2) >= 0) { //选中前继
151 idx = this.hideNodeIds_.indexOf(id1);
154 if (type === 1 && (n2.mask & this.mask_) !== 0 && this.selectPoint_.indexOf(id1) >= 0) { //选中后继
155 idx = this.hideNodeIds_.indexOf(id2);
159 this.hideNodeIds_.splice(idx, 1);
163 this.selectPoint_ = [...sel];
165 this.changeVisable();
169 if (this.loaded_) {
172 if (this.parser_.parsing()) {
175 if (!this.inited_) {
176 this.inited_ = true;
177 this.InitViewer(this.parser_.output_);
183 for (let file in this.data_) {
184 for (let func in this.data_[file]) {
185 for (let method of this.data_[file][func]) {
206 this.loaded_ = true;
207 this.changeFile(this.pointFile_);
208 NapiLog.logInfo('load cost', Date.now() - this.t1_);
212 this.pointFile_ = name;
213 let funcs = Object.keys(this.data_[this.pointFile_]);
214 this.selectFunc_.resetList(funcs, funcs[0]);
215 this.changeFunc(funcs[0]);
218 this.pointFunc_ = name;
220 for (let i = 0; i < this.data_[this.pointFile_][this.pointFunc_].length; i++) {
221 methods.push((i + 1) + ',' + this.data_[this.pointFile_][this.pointFunc_][i].type);
223 this.selectMethod_.resetList(methods, methods[0]);
224 this.changeMethod(methods[0]);
227 this.pointMethod_ = name;
229 this.direct_ = this.data_[this.pointFile_][this.pointFunc_][p];
230 this.changeVisable();
233 this.visable_ = this.direct_.irAll;
234 let nodes = this.visable_.nodes;
235 let lines = this.visable_.lines;
240 if (this.hideNodeIds_.indexOf(parseInt(n.ir.id)) >= 0) {
244 n.hide = (n.mask & this.mask_) === 0;
253 if ((this.mask_ & (1 << i) !== 0) && (n.mask & (1 << i) !== 0)) { //进入点也加进来
262 if (this.hideNodeIds_.indexOf(parseInt(n.ir.id)) >= 0) {
266 this.scrollY_.setBarOff(0);
267 this.scrollX_.setBarOff(0.5);
286 let [tx, ty, w, h] = this.smallMapRect;
301 if (this.selectPoint_.indexOf(parseInt(k)) >= 0) {
302 if (this.drapSelect_) {
303 dx += this.drapSelect_.dx;
304 dy += this.drapSelect_.dy;
311 if (this.selectPoint_.indexOf(parseInt(inl.fromId)) >= 0) {
318 if (this.selectPoint_.indexOf(parseInt(outl.toId)) >= 0) {
332 X2DFast.gi().drawRect(tx - (this.offx_ + x1) * sw, ty - (this.offy_ + y1) * sh, Math.min(Scr.logicw * sw, w), Math.min(Scr.logich * sh, h), 0xff00ff00, 1);
335 if (this.loading()) {
340 this.smallMapRect = [Scr.logicw - 50 - smallMapSize, 50, smallMapSize, smallMapSize];
341 let nodes = this.visable_.nodes;
342 let lines = this.visable_.lines;
343 let levely = this.makeLevely(nodes);
360 if (maxx < n.pos.x + n.nameWidth + this.offx_) {
361 maxx = n.pos.x + n.nameWidth + this.offx_;
363 if (minx > n.pos.x + this.offx_) {
364 minx = n.pos.x + this.offx_;
367 if (XTools.InRect(XTools.MOUSE_POS.x, XTools.MOUSE_POS.y, n.pos.x + this.offx_ - 3, n.pos.y + this.offy_ - 10, n.nameWidth + 6, 20)) {
372 this.selectLines_ = [];
373 let mmx1 = this.drawLines(this.offx_, this.offy_, nodes, lines, levely, [minx - 20, maxx + 20], false); //未选中的线
378 n.pos.x = mmx1[1] - this.offx_ + 20;
384 let dx = n.pos.x + this.offx_;
385 let dy = n.pos.y + this.offy_;
386 if (this.selectPoint_.indexOf(parseInt(k)) >= 0) {
387 if (this.drapSelect_) {
388 dx += this.drapSelect_.dx;
389 dy += this.drapSelect_.dy;
398 if (this.selectPoint_.indexOf(parseInt(inl.fromId)) >= 0) {
405 if (this.selectPoint_.indexOf(parseInt(outl.toId)) >= 0) {
417 this.drawLines(this.offx_, this.offy_, nodes, lines, levely, [minx - 20, maxx + 20], true); //选中的线
418 for (let ln of this.selectLines_) {
423 this.drawLine(ln[0], ln[1], ln[2], ln[3], 0xff000000 | (r << 16) | (g << 8) | b, ln[5] + 1);
445 for (let btn of this.btnGo_) {
472 x1 = Math.min(mmx1[0] - this.offx_, x1) - Scr.logicw / 3;
473 x2 = Math.max(mmx1[1] - this.offx_, x2) + Scr.logicw / 3;
476 this.dragScoll = {
484 this.dragScoll.hh = scrollH - Scr.logich;
485 this.dragScoll.ww = scrollW - Scr.logicw;
486 if (this.dragScoll.hh < 1) {
487 this.dragScoll.hh = 1;
489 if (this.dragScoll.ww < 1) {
490 this.dragScoll.ww = 1;
492 if (this.drapBackground_) {
493 this.scrollY_.setBarOff(-(this.offy_ + this.dragScoll.y1) / this.dragScoll.hh);
494 this.scrollX_.setBarOff(-(this.offx_ + this.dragScoll.x1) / this.dragScoll.ww);
497 this.offy_ = (-this.scrollY_.getBarOff()) * this.dragScoll.hh - this.dragScoll.y1;
498 this.offx_ = (-this.scrollX_.getBarOff()) * this.dragScoll.ww - this.dragScoll.x1;
500 if (this.dragScoll.hh > 1) {
501 this.scrollY_.move(Scr.logicw - 20, 100, 20, Scr.logich - 100 - 20).draw();
503 if (this.dragScoll.ww > 1) {
504 this.scrollX_.move(20, Scr.logich - 20, Scr.logicw - 40, 20).draw();
507 this.drawSmallMap(nodes, x1, x2, y1, y2);
509 if (this.searchInput) {
510 let x = this.searchInput.pos[0];
511 let y = this.searchInput.pos[1];
512 let w = this.searchInput.pos[2];
513 let h = this.searchInput.pos[3];
517 this.searchInput.result.length === 0 ? '0/0' :
518 this.searchInput.point + 1 + '/' + this.searchInput.result.length;
520 this.searchInput.btnUp.move(x + 20, y + 50, 32, 24).draw();
535 this.searchInput.btnDown.move(x + w - 20 - 32, y + 50, 32, 24).draw();
536 this.searchInput.btnClose.move(x + w - 40, y + 10, 30, 30).draw();
556 if (this.checkLevel(levely, n1, n2)) { }
580 if (this.selectPoint_.indexOf(l.fromId) >= 0 || this.selectPoint_.indexOf(l.toId) >= 0) {
582 if (this.drapSelect_) {
583 if (this.selectPoint_.indexOf(l.fromId) >= 0) {
584 x1 += this.drapSelect_.dx;
585 y1 += this.drapSelect_.dy;
587 if (this.selectPoint_.indexOf(l.toId) >= 0) {
588 x2 += this.drapSelect_.dx;
589 y2 += this.drapSelect_.dy;
595 if (this.checkLevel(levely, n1, n2)) { }
610 if (this.checkLevel(levely, n1, n2)) {
628 mouseOn |= this.drawLine(...ln);
631 this.selectLines_.push(...ls);
661 this.selectPoint_ = [parseInt(p)];
662 let nodes = this.visable_.nodes;
665 this.offx_ = Scr.logicw / 2 - n.pos.x;
666 this.offy_ = Scr.logich / 2 - n.pos.y;
667 this.scrollY_.setBarOff(-(this.offy_ + this.dragScoll.y1) / this.dragScoll.hh);
668 this.scrollX_.setBarOff(-(this.offx_ + this.dragScoll.x1) / this.dragScoll.ww);
669 this.offy_ = (-this.scrollY_.getBarOff()) * this.dragScoll.hh - this.dragScoll.y1;
670 this.offx_ = (-this.scrollX_.getBarOff()) * this.dragScoll.ww - this.dragScoll.x1;
673 if (this.searchInput) {
674 this.searchInput.point += 1;
675 if (this.searchInput.point >= this.searchInput.result.length) {
676 this.searchInput.point = 0;
678 this.locateNode(this.searchInput.result[this.searchInput.point]);
682 let [tx, ty, w, h] = this.smallMapRect;
683 let [x1, y1, x2, y2] = [this.dragScoll.x1, this.dragScoll.y1, this.dragScoll.x2, this.dragScoll.y2];
689 this.offx_ = (tx - x + Scr.logicw * sw / 2) / sw - x1;
690 this.offy_ = (ty - y + Scr.logich * sh / 2) / sh - y1;
691 this.scrollY_.setBarOff(-(this.offy_ + this.dragScoll.y1) / this.dragScoll.hh);
692 this.scrollX_.setBarOff(-(this.offx_ + this.dragScoll.x1) / this.dragScoll.ww);
693 this.offy_ = (-this.scrollY_.getBarOff()) * this.dragScoll.hh - this.dragScoll.y1;
694 this.offx_ = (-this.scrollX_.getBarOff()) * this.dragScoll.ww - this.dragScoll.x1;
698 if (msg === 3 && this.drapSelect_) {
699 let nodes = this.visable_.nodes;
700 for (let k of this.selectPoint_) {
701 nodes[k].pos.x += this.drapSelect_.dx;
702 nodes[k].pos.y += this.drapSelect_.dy;
704 this.drapSelect_ = null;
709 if (this.drapBackground_) {
711 this.offx_ -= this.drapBackground_.x - x;
712 this.offy_ -= this.drapBackground_.y - y;
713 this.drapBackground_.x = x;
714 this.drapBackground_.y = y;
721 if (this.drapSelect_) {
723 if (Math.abs(this.drapSelect_.x - x) > 10 ||
724 Math.abs(this.drapSelect_.y - y) > 10 ||
725 this.drapSelect_.dx !== 0 ||
726 this.drapSelect_.dy !== 0) {
727 this.drapSelect_.dx -= this.drapSelect_.x - x;
728 this.drapSelect_.dy -= this.drapSelect_.y - y;
729 this.drapSelect_.x = x;
730 this.drapSelect_.y = y;
738 if (this.searchInput) {
739 if (XTools.InRect(x, y, ...this.searchInput.pos)) {
740 if (this.searchInput.btnUp.onTouch(msg, x, y)) {
741 if (this.searchInput.btnUp.isClicked()) {
742 this.searchInput.point -= 1;
743 if (this.searchInput.point < 0) {
744 this.searchInput.point = this.searchInput.result.length - 1;
746 this.locateNode(this.searchInput.result[this.searchInput.point]);
749 if (this.searchInput.btnDown.onTouch(msg, x, y)) {
750 if (this.searchInput.btnDown.isClicked()) {
751 this.findNext();
754 if (this.searchInput.btnClose.onTouch(msg, x, y)) {
755 if (this.searchInput.btnClose.isClicked()) {
756 this.searchInput = null;
767 let nodes = this.visable_.nodes;
773 if (XTools.InRect(x, y, n.pos.x + this.offx_ - 3, n.pos.y + this.offy_ - 10, n.nameWidth + 6, 20)) {
775 this.selectPoint_.push(parseInt(k));
778 if (this.selectPoint_.indexOf(parseInt(k)) < 0) {
779 this.selectPoint_ = [parseInt(k)];
782 this.drapSelect_ = {
791 this.selectPoint_ = [];
796 if (this.loading()) {
799 if (this.smallMapLocked_) {
801 this.resetOffset(x, y);
804 this.smallMapLocked_ = false;
809 this.drapBackground_ = null;
811 this.checkMsgAndDrapSelect_(msg, x, y)
812 this.checkDrapBackground_(msg, x, y)
813 this.checkDrapSelect_(msg, x, y)
814 if (this.scrollX_.onTouch(msg, x, y)) {
817 if (this.scrollY_.onTouch(msg, x, y)) {
820 if (XTools.InRect(x, y, ...this.smallMapRect)) {
822 this.resetOffset(x, y);
823 this.smallMapLocked_ = true;
827 this.checkSearchInput(msg, x, y)
828 for (let i = this.btnGo_.length - 1; i >= 0; i--) {
829 if (this.btnGo_[i].onTouch(msg, x, y)) {
833 this.checkMsg(msg, x, y)
835 this.drapBackground_ = {
843 if (this.loading()) {
846 if (this.searchInput) {
851 this.selectNode(0);
854 this.selectNode(1);
858 this.hideNode(0);
861 this.hideNode(1);
865 this.hideNode(2);
868 this.freshNode();
872 this.searchInput = {
880 let x = this.searchInput.pos[0];
881 let y = this.searchInput.pos[1];
882 let w = this.searchInput.pos[2];
883 let h = this.searchInput.pos[3];
884 this.searchInput.Open = () => {
894 this.searchInput.result = [];
896 let nodes = this.visable_.nodes;
897 this.selectPoint_ = [];
911 this.searchInput.result.push(i);
914 if (this.searchInput.result.length > 0) {
915 this.locateNode(this.searchInput.result[0]);
916 this.searchInput.point = 0;
919 }, this.findNext.bind(this));
921 CanvasInput.SetSafeArea(...this.searchInput.pos);
922 this.searchInput.Open();