public virtual void AddHandle(Shapes.DiagramShape obj, IShapeHandle handle) { if (this.myHandles == null) { this.myHandles = new Hashtable(); } object obj1 = this.myHandles[obj]; if (obj1 == null) { this.myHandles[obj] = handle; } else if (obj1 is ArrayList) { ArrayList list1 = (ArrayList)obj1; list1.Add(handle); } else { ArrayList list2 = new ArrayList(); list2.Add(obj1); list2.Add(handle); this.myHandles[obj] = list2; } if (this.View != null) { this.View.Layers.Default.Add(handle.DiagramShape); } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ResizableRadius) { RectangleF ef1 = this.Bounds; PointF tf1 = new PointF(); float single1 = this.MinorRadius; if (this.Orientation == System.Windows.Forms.Orientation.Vertical) { if ((this.Perspective == Perspective.TopLeft) || (this.Perspective == Perspective.TopRight)) { tf1 = new PointF(ef1.X + (ef1.Width / 2f), ef1.Y + (2f * single1)); } else { tf1 = new PointF(ef1.X + (ef1.Width / 2f), (ef1.Y + ef1.Height) - (2f * single1)); } } else if ((this.Perspective == Perspective.TopLeft) || (this.Perspective == Perspective.BottomLeft)) { tf1 = new PointF(ef1.X + (2f * single1), ef1.Y + (ef1.Height / 2f)); } else { tf1 = new PointF((ef1.X + ef1.Width) - (2f * single1), ef1.Y + (ef1.Height / 2f)); } IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x408, true); base.MakeDiamondResizeHandle(handle1, (this.Orientation == System.Windows.Forms.Orientation.Horizontal) ? 0x40 : 0x80); } }
public virtual void AddHandle(Shapes.DiagramShape obj, IShapeHandle handle) { if (this.myHandles == null) { this.myHandles = new Hashtable(); } object obj1 = this.myHandles[obj]; if (obj1 == null) { this.myHandles[obj] = handle; } else if (obj1 is ArrayList) { ArrayList list1 = (ArrayList)obj1; list1.Add(handle); } else { ArrayList list2 = new ArrayList(); list2.Add(obj1); list2.Add(handle); this.myHandles[obj] = list2; } if (this.View != null) { this.View.Layers.Default.Add(handle.DiagramShape); } }
public virtual IShapeHandle FindHandleByID(Shapes.DiagramShape obj, int id) { if (this.myHandles != null) { object obj1 = this.myHandles[obj]; if (obj1 == null) { return(null); } if (obj1 is ArrayList) { ArrayList list1 = (ArrayList)obj1; foreach (IShapeHandle handle1 in list1) { if (handle1.HandleID == id) { return(handle1); } } return(null); } IShapeHandle handle2 = (IShapeHandle)obj1; if (handle2.HandleID == id) { return(handle2); } } return(null); }
public override void Start() { IShapeHandle handle1 = this.PickResizeHandle(base.FirstInput.DocPoint); if (handle1 != null) { Shapes.DiagramShape obj1 = handle1.HandledObject; if (obj1 != null) { base.CurrentObject = obj1; base.StartTransaction(); if (base.Selection.GetHandleCount(obj1) > 0) { this.mySelectedObject = handle1.SelectedObject; if (this.HidesSelectionHandles || !handle1.SelectedObject.ResizesRealtime) { this.mySelectionHidden = true; obj1.RemoveSelectionHandles(base.Selection); } } this.ResizeHandle = handle1; this.OriginalBounds = obj1.Bounds; this.OriginalPoint = handle1.DiagramShape.GetSpotLocation(1); } } }
public override bool CanStart() { if (base.FirstInput.IsContextButton) { return(false); } if (!base.View.CanLinkObjects()) { return(false); } IShapeHandle handle1 = this.PickRelinkHandle(base.FirstInput.DocPoint); if (handle1 == null) { return(false); } if (handle1.HandleID == 0x400) { base.CurrentObject = handle1.HandledObject; Shapes.IDiagramLine link1 = handle1.SelectedObject as Shapes.IDiagramLine; if (link1 is Shapes.LineGraph) { Shapes.LineGraph link2 = (Shapes.LineGraph)link1; if (link2.AbstractLink != null) { link1 = link2.AbstractLink; } } if (link1 == null) { return(false); } base.Link = link1; base.OriginalEndPort = base.Link.FromPort; return(true); } if (handle1.HandleID != 0x401) { return(false); } base.CurrentObject = handle1.HandledObject; Shapes.IDiagramLine link3 = handle1.SelectedObject as Shapes.IDiagramLine; if (link3 is Shapes.LineGraph) { Shapes.LineGraph link4 = (Shapes.LineGraph)link3; if (link4.AbstractLink != null) { link3 = link4.AbstractLink; } } if (link3 == null) { return(false); } base.Link = link3; base.OriginalEndPort = base.Link.ToPort; return(true); }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ReshapableDepth) { RectangleF ef1 = this.Bounds; PointF tf1 = new PointF(); SizeF ef2 = this.Depth; tf1 = this.getPoints(0f, 0f)[1]; IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x409, true); base.MakeDiamondResizeHandle(handle1, 1); } }
public virtual IShapeHandle CreateBoundingHandle(Shapes.DiagramShape obj, Shapes.DiagramShape selectedObj) { IShapeHandle handle1 = obj.CreateBoundingHandle(); if (handle1 == null) { return(null); } handle1.SelectedObject = selectedObj; Shapes.DiagramShape obj1 = handle1.DiagramShape; if (obj1 == null) { return(null); } obj1.Selectable = false; Shapes.DiagramGraph shape1 = obj1 as Shapes.DiagramGraph; if (shape1 != null) { Color color1 = Color.LightGray; DiagramView view1 = this.View; if (view1 != null) { if (this.Focused) { if ((this.Primary != null) && (this.Primary.SelectionObject == obj)) { color1 = view1.PrimarySelectionColor; } else { color1 = view1.SecondarySelectionColor; } } else { color1 = view1.NoFocusSelectionColor; } } float single1 = view1.BoundingHandlePenWidth; float single2 = (single1 == 0f) ? 0f : (single1 / view1.WorldScale.Width); if (((this.myBoundingHandlePen == null) || (Shapes.DiagramGraph.GoPenInfo.GetPenColor(this.myBoundingHandlePen, color1) != color1)) || (this.myBoundingHandlePen.Width != single2)) { this.myBoundingHandlePen = new Pen(color1, single2); } shape1.Pen = this.myBoundingHandlePen; shape1.Brush = null; } this.AddHandle(obj, handle1); return(handle1); }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ReshapableCorner) { RectangleF ef1 = this.Bounds; PointF tf1 = new PointF(ef1.X + this.Corner.Width, ef1.Y); IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 1030, true); base.MakeDiamondResizeHandle(handle1, 0x40); tf1 = new PointF(ef1.X, ef1.Y + this.Corner.Height); handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x407, true); base.MakeDiamondResizeHandle(handle1, 0x80); } }
public virtual void RemoveHandles(Shapes.DiagramShape obj) { if (this.myHandles != null) { object obj1 = this.myHandles[obj]; if (obj1 != null) { if (this.View != null) { ArrayList list1 = obj1 as ArrayList; if (list1 != null) { for (int num1 = 0; num1 < list1.Count; num1++) { IShapeHandle handle1 = (IShapeHandle)list1[num1]; Shapes.DiagramShape obj2 = handle1.DiagramShape; handle1.SelectedObject = null; if (obj2 != null) { DiagramLayer layer1 = obj2.Layer; if (layer1 != null) { layer1.Remove(obj2); } } } } else { IShapeHandle handle2 = (IShapeHandle)obj1; handle2.SelectedObject = null; Shapes.DiagramShape obj3 = handle2.DiagramShape; if (obj3 != null) { DiagramLayer layer2 = obj3.Layer; if (layer2 != null) { layer2.Remove(obj3); } } } } this.myHandles.Remove(obj); } } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ReshapableSkew) { RectangleF ef1 = this.Bounds; SizeF ef2 = this.Skew; PointF tf1 = new PointF(); if (this.Direction) { tf1 = new PointF(ef1.X + ef2.Width, ef1.Y + ef2.Height); } else { tf1 = new PointF((ef1.X + ef1.Width) - ef2.Width, ef1.Y + ef2.Height); } IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x40e, true); base.MakeDiamondResizeHandle(handle1, 1); } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape()) { if (this.ResizableStartAngle) { RectangleF ef1 = this.Bounds; PointF tf1 = this.GetPointAtAngle(this.StartAngle); IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x40f, true); base.MakeDiamondResizeHandle(handle1, 1); } if (this.ResizableEndAngle) { RectangleF ef2 = this.Bounds; PointF tf2 = this.GetPointAtAngle(this.StartAngle + this.SweepAngle); IShapeHandle handle2 = sel.CreateResizeHandle(this, selectedObj, tf2, 1040, true); base.MakeDiamondResizeHandle(handle2, 1); } } }
public override bool CanStart() { if (base.FirstInput.IsContextButton) { return(false); } if (!base.View.CanResizeObjects()) { return(false); } IShapeHandle handle1 = this.PickResizeHandle(base.FirstInput.DocPoint); if ((handle1 == null) || (handle1.HandledObject == null)) { return(false); } if (!handle1.HandledObject.CanResize()) { return(handle1.HandledObject.CanReshape()); } return(true); }
internal void MakeDiamondResizeHandle(IShapeHandle handle, int spot) { HandleGraph handle1 = handle.DiagramShape as HandleGraph; if (handle1 != null) { handle1.Style = ShapeStyle.Diamond; if (!(handle1.SelectedObject is IDiagramLine)) { handle1.Brush = DiagramGraph.Brushes_Yellow; } RectangleF ef1 = handle1.Bounds; DiagramShape.InflateRect(ref ef1, ef1.Width / 6f, ef1.Height / 6f); handle1.Bounds = ef1; if (spot == 0x40) { handle1.Cursor = Cursors.SizeWE; } else if (spot == 0x80) { handle1.Cursor = Cursors.SizeNS; } else if (spot == 8) { handle1.Cursor = Cursors.SizeNWSE; } else if (spot == 4) { handle1.Cursor = Cursors.SizeNESW; } else if (spot != 0) { handle1.Cursor = Cursors.SizeAll; } } }
public virtual IShapeHandle CreateResizeHandle(Shapes.DiagramShape obj, Shapes.DiagramShape selectedObj, PointF loc, int handleid, bool filled) { IShapeHandle handle1 = obj.CreateResizeHandle(handleid); if (handle1 == null) { return(null); } handle1.HandleID = handleid; handle1.SelectedObject = selectedObj; Shapes.DiagramShape obj1 = handle1.DiagramShape; if (obj1 == null) { return(null); } DiagramView view1 = this.View; SizeF ef1 = obj1.Size; if ((ef1.Width <= 0f) || (ef1.Height <= 0f)) { if (view1 != null) { ef1 = view1.ResizeHandleSize; } else { ef1 = new SizeF(6f, 6f); } } if (view1 != null) { ef1.Width /= view1.WorldScale.Width; ef1.Height /= view1.WorldScale.Height; } obj1.Bounds = new RectangleF(loc.X - (ef1.Width / 2f), loc.Y - (ef1.Height / 2f), ef1.Width, ef1.Height); if (handleid == 0) { obj1.Selectable = false; } else { obj1.Selectable = true; } Shapes.DiagramGraph shape1 = obj1 as Shapes.DiagramGraph; if (shape1 != null) { Color color1 = Color.LightGray; if (view1 != null) { if (this.Focused) { if ((this.Primary != null) && (this.Primary.SelectionObject == obj)) { color1 = view1.PrimarySelectionColor; } else { color1 = view1.SecondarySelectionColor; } } else { color1 = view1.NoFocusSelectionColor; } } if (filled) { float single1 = view1.ResizeHandlePenWidth; float single2 = (single1 == 0f) ? 0f : (single1 / view1.WorldScale.Width); if (((this.myResizeHandlePen == null) || (Shapes.DiagramGraph.GoPenInfo.GetPenColor(this.myResizeHandlePen, this.myResizeHandlePenColor) != this.myResizeHandlePenColor)) || (this.myResizeHandlePen.Width != single2)) { this.myResizeHandlePen = new Pen(this.myResizeHandlePenColor, single2); } shape1.Pen = this.myResizeHandlePen; if ((this.myResizeHandleBrush == null) || (this.myResizeHandleBrush.Color != color1)) { this.myResizeHandleBrush = new SolidBrush(color1); } shape1.Brush = this.myResizeHandleBrush; } else { float single3 = view1.ResizeHandlePenWidth; float single4 = (single3 == 0f) ? 0f : ((single3 + 1f) / view1.WorldScale.Width); if (((this.myResizeHandlePen == null) || (Shapes.DiagramGraph.GoPenInfo.GetPenColor(this.myResizeHandlePen, color1) != color1)) || (this.myResizeHandlePen.Width != single4)) { this.myResizeHandlePen = new Pen(color1, single4); } shape1.Pen = this.myResizeHandlePen; shape1.Brush = null; } } this.AddHandle(obj, handle1); return(handle1); }