public void ClearPaint() { ColorClear(); this.ArryQuestNode.Clear(); this.CurrentNode = null; this.Refresh(); }
public void AddNode(OneNode node) { if (node != null) { ArryQuestNode.Add(node); } }
public bool reloadAll(string keyword) { if (!bHasInitHashTable) { InitHashtable(); bHasInitHashTable = true; } panelEx1.ClearPaint(); string[] keywords = keyword.Split(new char[] { ',' }); if (keywords.Length != 2) { MessageBox.Show("错误的reloadAll参数"); } int questid = Convert.ToInt32(keywords[1]); if (questid < 0) { return(false); } QuestId = questid; nodeRoot.Text = GetQuestName(questid); reloadNodes(questid); nodeCurrent = nodeRoot.Nodes[0].Tag as OneNode; UpdateStatus(); dgvQuestInfo.DataSource = GetQuestMoreInfo(); return(true); }
private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { DevComponents.AdvTree.Node advTreeNode = e.Node; if (advTreeNode == nodeRoot) { return; } OneNode nodeTag = advTreeNode.Tag as OneNode; nodeCurrent = nodeTag; panelEx1.CurrentNode = nodeCurrent; UpdateStatus(); }
private void SaveOneNode(OneNode node) { if (node.IsChanged) { string strKey = node.ColumnNameKey; string ColumnName_nMapId = string.Format("{0}_MapId", strKey); string ColumnName_Areas = string.Format("{0}_Areas", strKey); string sql = string.Format( " update {0} set {1} = {2}, {3} = '{4}' where QuestId ={5}", QuestGuideTableName, ColumnName_nMapId, node.MapId, ColumnName_Areas, node.StringGrayIds, QuestId ); Helper.SqlNoneQureyExcute(Conn, sql); node.BackUp(); } }
private void AddRegionNodes(string[] columns, DataRow row, Color treeColor, bool needEdit, TemplateType ttype) { string ColumnName_MapID; string ColumnName_Areas; int nValue_MapID; string strValue_Areas; foreach (string columnkey in columns) { ColumnName_MapID = string.Format("{0}_MapId", columnkey); ColumnName_Areas = string.Format("{0}_Areas", columnkey); if (!needEdit && (row.IsNull(ColumnName_MapID) || Convert.ToInt32(row[ColumnName_MapID]) == 0) ) { continue; } nValue_MapID = row.IsNull(ColumnName_MapID) ? 0 : Convert.ToInt32(row[ColumnName_MapID]); strValue_Areas = row.IsNull(ColumnName_Areas) ? "" : row[ColumnName_Areas].ToString(); if (nValue_MapID == 0) { nValue_MapID = DefaultMapId; } OneNode nodeTag = new OneNode(); nodeTag.Init(nValue_MapID, strValue_Areas, ttype, columnkey); nodeTag.CanEdit = needEdit; SetBrothers(ref nodeTag, columnkey); MapConfig config = htMapConfig[nValue_MapID] as MapConfig; if (config != null) { nodeTag.imageMap = config.TagImage; } DevComponents.AdvTree.Node newTreenode = new DevComponents.AdvTree.Node(); newTreenode.Text = htColumnNameDisplay[columnkey].ToString(); newTreenode.Tag = nodeTag; newTreenode.Style = new ElementStyle(); newTreenode.Style.TextColor = treeColor; nodeRoot.Nodes.Add(newTreenode); ArryNodes.Add(nodeTag); } }
private void SetBrothers(ref OneNode node, string ColumnName) { int mapid = node.MapId; string mapName = ""; if (htMapIDName.ContainsKey(mapid)) { mapName = htMapIDName[mapid].ToString(); } if (mapName == "") { return; } int nTemplateId = GetTemplateId(QuestId, ColumnName); ArrayList arrBrothers = GetBrothers(mapName, nTemplateId, node.templateType); node.arrBrothers = arrBrothers; }
private void SetMoreInfo(ref OneNode node) { int mapid = node.MapId; MapConfig config = htMapConfig[mapid] as MapConfig; if (config == null) { node.imageMap = null; node.fScaleX = 0.5f; node.fScaleY = 0.5f; return; } int cfgWidth = 0; int cfgHeight = 0; float cfgScale = 0.0f; float cfgStartx = 0; float cfgStarty = 0; config.GetConfig(ref cfgWidth, ref cfgHeight, ref cfgStartx, ref cfgStarty, ref cfgScale); node.fScaleX = (node.nX - cfgStartx) / (cfgWidth / cfgScale); node.fScaleY = 1 - (node.nY - cfgStarty) / (cfgHeight / cfgScale); node.imageMap = config.TagImage; }
private void PaintNodeBrothers(OneNode node, Graphics g) { if (node == null || node.nodeType == NodeType.POINT) { return; } ArrayList arrBrothers = node.arrBrothers; if (arrBrothers == null) { return; } float mydiameter = Diameter * 0.5f; foreach (object ob in arrBrothers) { MapLogicalFileReader.fPoint2d fpoint = (MapLogicalFileReader.fPoint2d)ob; float fx = fpoint.fX * CanvasWidth; float fy = fpoint.fY * canvasHeight; g.FillEllipse(Brushes.Purple, fx - mydiameter / 2, fy - mydiameter / 2, mydiameter, mydiameter); } }
/// <summary> /// 开始和结束的节点 /// </summary> /// <param name="columns"></param> /// <param name="row"></param> /// <param name="color"></param> /// <param name="treeColor"></param> private void AddPointNodes(string[] columns, DataRow row, Brush color, Color treeColor) { string ColumnName_MapID; string ColumnName_nX; string ColumnName_nY; int nValue_MapID; int nValue_nX; int nValue_nY; foreach (string columnkey in columns) { ColumnName_MapID = string.Format("{0}_MapId", columnkey); ColumnName_nX = string.Format("{0}_nX", columnkey); ColumnName_nY = string.Format("{0}_nY", columnkey); if (row.IsNull(ColumnName_MapID) || Convert.ToInt32(row[ColumnName_MapID]) == 0) { continue; } nValue_MapID = row.IsNull(ColumnName_MapID) ? 0 : Convert.ToInt32(row[ColumnName_MapID]); nValue_nX = row.IsNull(ColumnName_nX) ? 0 : Convert.ToInt32(row[ColumnName_nX]); nValue_nY = row.IsNull(ColumnName_nY) ? 0 : Convert.ToInt32(row[ColumnName_nY]); OneNode nodeTag = new OneNode(); nodeTag.Init(nValue_MapID, nValue_nX, nValue_nY, color); SetMoreInfo(ref nodeTag); DevComponents.AdvTree.Node newTreenode = new DevComponents.AdvTree.Node(); newTreenode.Text = htColumnNameDisplay[columnkey].ToString(); newTreenode.Tag = nodeTag; newTreenode.Style = new ElementStyle(); newTreenode.Style.TextColor = treeColor; nodeRoot.Nodes.Add(newTreenode); panelEx1.AddNode(nodeTag); } }
private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { DevComponents.AdvTree.Node advTreeNode = e.Node; if (advTreeNode == nodeRoot) { return; } OneNode nodeTag = advTreeNode.Tag as OneNode; nodeCurrent = nodeTag; panelEx1.CurrentNode = nodeCurrent; UpdateStatus(); }
private void SetBrothers(ref OneNode node, string ColumnName) { int mapid = node.MapId; string mapName = ""; if (htMapIDName.ContainsKey(mapid)) { mapName = htMapIDName[mapid].ToString(); } if (mapName == "") { return; } int nTemplateId = GetTemplateId(QuestId, ColumnName); ArrayList arrBrothers = GetBrothers(mapName, nTemplateId, node.templateType); node.arrBrothers = arrBrothers; }
private void SetMoreInfo(ref OneNode node) { int mapid = node.MapId; MapConfig config = htMapConfig[mapid] as MapConfig; if (config == null) { node.imageMap = null; node.fScaleX = 0.5f; node.fScaleY = 0.5f; return; } int cfgWidth = 0; int cfgHeight = 0; float cfgScale = 0.0f; float cfgStartx = 0; float cfgStarty = 0; config.GetConfig(ref cfgWidth, ref cfgHeight, ref cfgStartx, ref cfgStarty, ref cfgScale); node.fScaleX = (node.nX - cfgStartx) / (cfgWidth / cfgScale); node.fScaleY = 1 - (node.nY - cfgStarty) / (cfgHeight / cfgScale); node.imageMap = config.TagImage; }
/// <summary> /// 开始和结束的节点 /// </summary> /// <param name="columns"></param> /// <param name="row"></param> /// <param name="color"></param> /// <param name="treeColor"></param> private void AddPointNodes(string[] columns, DataRow row, Brush color, Color treeColor) { string ColumnName_MapID; string ColumnName_nX; string ColumnName_nY; int nValue_MapID; int nValue_nX; int nValue_nY; foreach (string columnkey in columns) { ColumnName_MapID = string.Format("{0}_MapId", columnkey); ColumnName_nX = string.Format("{0}_nX", columnkey); ColumnName_nY = string.Format("{0}_nY", columnkey); if (row.IsNull(ColumnName_MapID) || Convert.ToInt32(row[ColumnName_MapID]) == 0) { continue; } nValue_MapID = row.IsNull(ColumnName_MapID) ? 0 : Convert.ToInt32(row[ColumnName_MapID]); nValue_nX = row.IsNull(ColumnName_nX) ? 0 : Convert.ToInt32(row[ColumnName_nX]); nValue_nY = row.IsNull(ColumnName_nY) ? 0 : Convert.ToInt32(row[ColumnName_nY]); OneNode nodeTag = new OneNode(); nodeTag.Init(nValue_MapID, nValue_nX, nValue_nY, color); SetMoreInfo(ref nodeTag); DevComponents.AdvTree.Node newTreenode = new DevComponents.AdvTree.Node(); newTreenode.Text = htColumnNameDisplay[columnkey].ToString(); newTreenode.Tag = nodeTag; newTreenode.Style = new ElementStyle(); newTreenode.Style.TextColor = treeColor; nodeRoot.Nodes.Add(newTreenode); panelEx1.AddNode(nodeTag); } }
private void AddRegionNodes(string[] columns, DataRow row, Color treeColor, bool needEdit, TemplateType ttype) { string ColumnName_MapID; string ColumnName_Areas; int nValue_MapID; string strValue_Areas; foreach (string columnkey in columns) { ColumnName_MapID = string.Format("{0}_MapId", columnkey); ColumnName_Areas = string.Format("{0}_Areas", columnkey); if (!needEdit && (row.IsNull(ColumnName_MapID) || Convert.ToInt32(row[ColumnName_MapID]) == 0) ) { continue; } nValue_MapID = row.IsNull(ColumnName_MapID) ? 0 : Convert.ToInt32(row[ColumnName_MapID]); strValue_Areas = row.IsNull(ColumnName_Areas) ? "" : row[ColumnName_Areas].ToString(); if (nValue_MapID == 0) { nValue_MapID = DefaultMapId; } OneNode nodeTag = new OneNode(); nodeTag.Init(nValue_MapID, strValue_Areas, ttype, columnkey); nodeTag.CanEdit = needEdit; SetBrothers(ref nodeTag, columnkey); MapConfig config = htMapConfig[nValue_MapID] as MapConfig; if (config != null) { nodeTag.imageMap = config.TagImage; } DevComponents.AdvTree.Node newTreenode = new DevComponents.AdvTree.Node(); newTreenode.Text = htColumnNameDisplay[columnkey].ToString(); newTreenode.Tag = nodeTag; newTreenode.Style = new ElementStyle(); newTreenode.Style.TextColor = treeColor; nodeRoot.Nodes.Add(newTreenode); ArryNodes.Add(nodeTag); } }
private void PaintNodeBrothers(OneNode node, Graphics g) { if (node == null || node.nodeType == NodeType.POINT) { return; } ArrayList arrBrothers = node.arrBrothers; if (arrBrothers == null) { return; } float mydiameter = Diameter * 0.5f; foreach (object ob in arrBrothers) { MapLogicalFileReader.fPoint2d fpoint = (MapLogicalFileReader.fPoint2d)ob; float fx = fpoint.fX * CanvasWidth; float fy = fpoint.fY * canvasHeight; g.FillEllipse(Brushes.Purple, fx - mydiameter / 2, fy - mydiameter / 2, mydiameter, mydiameter); } }
public void ClearNodes() { ArryQuestNode.Clear(); CurrentNode = null; }
public void AddNode(OneNode node) { if (node != null) { ArryQuestNode.Add(node); } }
public void ClearNodes() { ArryQuestNode.Clear(); CurrentNode = null; }
private void SaveOneNode(OneNode node) { if (node.IsChanged) { string strKey = node.ColumnNameKey; string ColumnName_nMapId = string.Format("{0}_MapId", strKey); string ColumnName_Areas = string.Format("{0}_Areas", strKey); string sql = string.Format( " update {0} set {1} = {2}, {3} = '{4}' where QuestId ={5}", QuestGuideTableName, ColumnName_nMapId, node.MapId, ColumnName_Areas, node.StringGrayIds, QuestId ); Helper.SqlNoneQureyExcute(Conn, sql); node.BackUp(); } }
public bool reloadAll(string keyword) { if (!bHasInitHashTable) { InitHashtable(); bHasInitHashTable = true; } panelEx1.ClearPaint(); string[] keywords = keyword.Split(new char[] {','}); if (keywords.Length != 2) MessageBox.Show("错误的reloadAll参数"); int questid = Convert.ToInt32(keywords[1]); if (questid < 0) { return false; } QuestId = questid; nodeRoot.Text = GetQuestName(questid); reloadNodes(questid); nodeCurrent = nodeRoot.Nodes[0].Tag as OneNode; UpdateStatus(); dgvQuestInfo.DataSource = GetQuestMoreInfo(); return true; }
public void ClearPaint() { ColorClear(); this.ArryQuestNode.Clear(); this.CurrentNode = null; this.Refresh(); }