private void func_zigbee_drawLine(ZigbeeNode _temp_node, Graphics e) { if (_temp_node == null || _temp_node.nextpanel == null) return; Pen linePen = new Pen(Color.Black); foreach (ZigbeeNode temp_zigbeenode in _temp_node.nextpanel) { e.DrawLine(linePen, new Point(_temp_node.Location.X + _temp_node.Width / 2, _temp_node.Location.Y + _temp_node.Height / 2), new Point(temp_zigbeenode.Location.X + temp_zigbeenode.Width / 2, temp_zigbeenode.Location.Y + temp_zigbeenode.Height / 2)); func_zigbee_drawLine(temp_zigbeenode, e); } }
public void func_zigbee_createMap(ZigbeeNode _parentpanel) { _parentpanel.Location = new Point(zigbee_startx[_parentpanel.nowm], (_parentpanel.nowm - 1) * zigbee_EVERYHEIGHT); zigbee_startx[_parentpanel.nowm] += zigbee_everydx[_parentpanel.nowm]; foreach (Control temp_control in _parentpanel.Controls) { temp_control.MouseDown += event_zigbee_panel_MouseDown; temp_control.MouseUp += event_zigbee_panel_MouseUp; temp_control.DoubleClick += event_parentPanel_DoubleClick; } _parentpanel.MouseDown += event_zigbee_panel_MouseDown; _parentpanel.MouseUp += event_zigbee_panel_MouseUp; _parentpanel.DoubleClick += event_parentPanel_DoubleClick; panel_zigbee_mainArea.Controls.Add(_parentpanel); if (_parentpanel.nowm == zigbee_lm) return; if (_parentpanel.nowtext == 2) { for (int i = _parentpanel.nowm + 1; i <= zigbee_lm; i++) { zigbee_startx[i] += zigbee_everydx[_parentpanel.nowm]; } return; } for (int i = 0; i < zigbee_cm; i++) { func_zigbee_createMap(_parentpanel.nextpanel[i]); } if (_parentpanel.nowm == zigbee_lm - 1) { zigbee_startx[zigbee_lm] += zigbee_EVERYWIDTH; } }
public void func_zigbee_createAllNode() { zigbee_mapWidth = zigbee_EVERYWIDTH * (int)(Math.Pow(zigbee_cm, (zigbee_lm - 1))) + (int)Math.Pow(zigbee_cm, zigbee_lm - 2) * zigbee_EVERYWIDTH; zigbee_tempPanel = zigbee_headNode; zigbee_startx = new List<int>(); zigbee_everydx = new List<int>(); for (int i = 0; i < zigbee_lm + 1; i++) { int temp_int = 0; zigbee_startx.Add(temp_int); zigbee_everydx.Add(temp_int); } zigbee_startx[zigbee_lm] = 0; zigbee_everydx[zigbee_lm] = zigbee_EVERYWIDTH; if (zigbee_lm != 1) { zigbee_everydx[zigbee_lm - 1] = (zigbee_cm + 1) * zigbee_EVERYWIDTH; zigbee_startx[zigbee_lm - 1] = zigbee_cm * zigbee_EVERYWIDTH / 2 - zigbee_EVERYWIDTH / 2; for (int i = zigbee_lm - 2; i > 0; i--) { zigbee_startx[i] = (zigbee_EVERYWIDTH + (zigbee_cm - 1) * zigbee_everydx[i + 1]) / 2 - zigbee_EVERYWIDTH / 2 + zigbee_startx[i + 1]; zigbee_everydx[i] = zigbee_everydx[i + 1] * zigbee_cm; } } func_zigbee_createMap(zigbee_headNode); }
public void func_zigbee_setAllChild() { ZigbeeNode temp = zigbee_tempPanel; zigbee_tempPanel.addr = zigbee_tempPanel.makefull(zigbee_childNumber); temp.nown = zigbee_childNumber; zigbee_childNumber++; if (zigbee_tempPanel.nowm < zigbee_lm && zigbee_tempPanel.nowtext != 2) { zigbee_tempPanel.createchild(zigbee_cm, zigbee_rm); for (int i = 0; i < zigbee_cm; i++) { zigbee_tempPanel = temp.nextpanel[i]; func_zigbee_setAllChild(); } } }
public void func_zigbee_build() { zigbee_headNode = new ZigbeeNode(0, 0, 1); zigbee_tempPanel = zigbee_headNode; zigbee_childNumber = 0; func_zigbee_setAllChild(); func_zigbee_createAllNode(); //this.Paint += new PaintEventHandler(mypaint); }
public void createchild(int _cm, int _rm) { for (int i = 0; i < _rm; i++) { ZigbeeNode temp_node = new ZigbeeNode(0, 1, nowm + 1); temp_node.parent = this; temp_node.Location = new System.Drawing.Point(0, 0); nextpanel.Add(temp_node); } for (int i = 0; i < _cm - _rm; i++) { ZigbeeNode temp_node = new ZigbeeNode(0, 2, nowm + 1); temp_node.Location = new System.Drawing.Point(0, 0); temp_node.parent = this; nextpanel.Add(temp_node); } }