예제 #1
0
		public TableItem(TableItem prototype)
		{
			mText = prototype.Text;
			mFont = prototype.Font;
			mForecolor = prototype.Forecolor;
			mBackcolor = prototype.Backcolor;
			mIndent = prototype.Indent;
			mTag = prototype.Tag;
			mParent = prototype.Parent;
			mTable = prototype.Table;
		}
예제 #2
0
		public Table(Table prototype): base(prototype)
		{
			mHeadingHeight = prototype.HeadingHeight;
			mHeading = prototype.Heading;
			mSubHeading = prototype.SubHeading;
			mGroupHeight = prototype.GroupHeight;
			mRowHeight = prototype.RowHeight;
			mRowIndent = prototype.Indent;
			mExpanded = prototype.Expanded;
			mDrawExpand = prototype.DrawExpand;
			mForecolor = prototype.Forecolor;
			GradientColor = prototype.GradientColor;
			mDrawSelectedItem = prototype.DrawSelectedItem;
			mFont = prototype.Font;

			ContractedSize = prototype.ContractedSize;
			ExpandedSize = prototype.ExpandedSize;
			
			Groups = new TableItems(typeof(TableGroup));
			Rows = new TableItems(typeof(TableRow));

			Table.CopyGroups(prototype.Groups,Groups);
			Table.CopyRows(prototype.Rows,Rows);
		}
예제 #3
0
		public virtual Shape CreateTable(PointF start,SizeF size)
		{
			Table table = new Table();
			table.Location = start;
			if (!size.IsEmpty) table.Size = size;

			OnCreateElement(table);
			return table;
		}
예제 #4
0
		public virtual Shape CreateTable()
		{
			Table table = new Table();

			OnCreateElement(table);
			return table;
		}
예제 #5
0
		//Sets the internal table reference
		protected internal virtual void SetTable(Table table)
		{
			mTable = table;
		}
예제 #6
0
 private void ResetTable(TableItem item, Table table) {
     if (item is TableRow) {
         TableRow tableRow = (TableRow)item;
         if (tableRow is EsriTableRow) {
             ((EsriTableRow)tableRow).SetTable2(table);
         }
     }
     else if (item is TableGroup) {
         TableGroup tableGroup = (TableGroup)item;
         if (tableGroup is EsriTableGroup) {
             ((EsriTableGroup)tableGroup).SetTable2(table);
         }
         foreach (TableItem item2 in tableGroup.Groups) {
             this.ResetTable(item2, table);
         }
         foreach (TableItem item3 in tableGroup.Rows) {
             this.ResetTable(item3, table);
         }
     }
 }
예제 #7
0
파일: RoomsTab.cs 프로젝트: jandar78/Novus
		private async void FillMap(Room room) {
           await Task.Run(() => {
                AI.PathFinding.TreeNode startNode = new AI.PathFinding.TreeNode(room);
                startNode.Parent = startNode;
                AI.PathFinding.TreeTraverser traverser = new AI.PathFinding.TreeTraverser(startNode, "");
                Stack<AI.PathFinding.TreeNode> traversedTree = traverser.GetTraversedNodes();

                Crainiate.Diagramming.Model model = new Model();

                PointF position = new PointF(200, 400);

                Table roomNode = new Table();
                roomNode.BackColor = Color.Green;


                foreach (AI.PathFinding.TreeNode treeNode in traversedTree.Reverse()) {
                    if (model.Shapes.ContainsKey(treeNode.ID.ToString())) {
                        position = model.Shapes[treeNode.ID.ToString()].Location;
                    }

                    roomNode.Location = position;

                    roomNode.Heading = treeNode.ID.ToString();
                    roomNode.SubHeading = treeNode.Title;

                    if (!model.Shapes.ContainsKey(treeNode.ID.ToString())) {
                        model.Shapes.Add(treeNode.ID.ToString(), roomNode);
                    }

                    Arrow arrow = new Arrow();
                    arrow.DrawBackground = false;
                    arrow.Inset = 0;

                    foreach (var adjNode in treeNode.AdjacentNodes) {
                        RoomExits direction = (RoomExits)Enum.Parse(typeof(RoomExits), adjNode.Key);

                        Table adjShape = new Table();
                        adjShape.Heading = adjNode.Value.ID.ToString();
                        adjShape.SubHeading = adjNode.Value.Title;
                        adjShape.BackColor = Color.LightBlue;

                        switch (direction) {
                            case RoomExits.North:
                                adjShape.Location = new PointF(position.X, position.Y - 100);
                                break;
                            case RoomExits.South:
                                adjShape.Location = new PointF(position.X, position.Y + 100);
                                break;
                            case RoomExits.East:
                                adjShape.Location = new PointF(position.X + 150, position.Y);
                                break;
                            case RoomExits.West:
                                adjShape.Location = new PointF(position.X - 150, position.Y);
                                break;
                            case RoomExits.Up:
                                adjShape.Location = new PointF(position.X - 150, position.Y - 100);
                                break;
                            case RoomExits.Down:
                                adjShape.Location = new PointF(position.X + 150, position.Y + 100);
                                break;
                        }

                        if (!model.Shapes.ContainsKey(adjNode.Value.ID.ToString())) {
                            model.Shapes.Add(adjNode.Value.ID.ToString(), adjShape);
                        }
                        Connector line = new Connector(model.Shapes[treeNode.ID.ToString()], model.Shapes[adjNode.Value.ID.ToString()]);
                        line.End.Marker = arrow;

                        model.Lines.Add(model.Lines.CreateKey(), line);

                        adjShape = new Table();
                    }

                    roomNode = new Table();
                }

                mapDiagram.SetModel(model);
                mapDiagram.Invoke((MethodInvoker)delegate { mapDiagram.Refresh(); });
            });
		}
예제 #8
0
 public void SetTable2(Table table) {
     this.SetTable(table);
 }