Exemplo n.º 1
0
        internal void addObjToSelection(ChartObject obj)
        {
            if (obj.getSelected())
            {
                return;
            }

            selectedItems.Add(obj);
            obj.setSelected(true);

            switch (obj.getType())
            {
            case ItemType.Box:
                selectedBoxes.Add((Box)obj);
                break;

            case ItemType.ControlHost:
                selectedHosts.Add((ControlHost)obj);
                break;

            case ItemType.Table:
                selectedTables.Add((Table)obj);
                break;

            case ItemType.Arrow:
                selectedArrows.Add((Arrow)obj);
                break;
            }

            rect = Utilities.unionNonEmptyRects(rect, obj.getRotatedBounds());
        }
Exemplo n.º 2
0
		internal void addObjToSelection(ChartObject obj)
		{
			if (obj.getSelected()) return;

			selectedItems.Add(obj);
			obj.setSelected(true);

			switch (obj.getType())
			{
				case ItemType.Box:
					selectedBoxes.Add((Box)obj);
					break;
				case ItemType.ControlHost:
					selectedHosts.Add((ControlHost)obj);
					break;
				case ItemType.Table:
					selectedTables.Add((Table)obj);
					break;
				case ItemType.Arrow:
					selectedArrows.Add((Arrow)obj);
					break;
			}

			rect = Utilities.unionNonEmptyRects(rect, obj.getRotatedBounds());
		}
Exemplo n.º 3
0
		/// <summary>
		/// Reroutes all links.
		/// </summary>
		internal void routeAllArrows(ChartObject modified)
		{
			Node node = modified as Node;
			if (node != null && !node.Obstacle)
				return;

			undoManager.onStartRoute();

			RectangleF objRect = modified.getRotatedBounds();
			RectangleF invalid = objRect;
			if (node == null ||
				(routingOptions.TriggerRerouting & RerouteArrows.WhenModified) != 0)
			{
				foreach (Arrow arrow in arrows)
				{
					if (!arrow.AutoRoute) continue;

					RectangleF arrowRect = arrow.getBoundingRect();
					if (arrowRect.IntersectsWith(objRect))
					{
						invalid = Utilities.unionRects(invalid, arrowRect);
						undoManager.onRouteArrow(arrow);
						arrow.doRoute();
						invalid = Utilities.unionRects(invalid, arrow.getRepaintRect(false));
					}
				}
			}
			else
			{
				foreach (Arrow arrow in arrows)
				{
					if (rerouteArrow(arrow))
					{
						invalid = Utilities.unionRects(invalid, arrow.getRepaintRect(false));
						undoManager.onRouteArrow(arrow);
						arrow.doRoute();
						invalid = Utilities.unionRects(invalid, arrow.getBoundingRect());
					}
				}
			}

			undoManager.onEndRoute();
			//pkhinvalidate(invalid);
		}