public SizeMoveGripHandle(GraphicBase parent, PointF relPos) { _parent = parent; _drawrPosition = relPos; _fixrPosition = new PointF(relPos.X == 0 ? 1 : 0, relPos.Y == 0 ? 1 : 0); _fixaPosition = _parent.RelativeToAbsolutePosition(_fixrPosition, true); }
/// <summary> /// Scales the position of all items according to xscale and yscale. /// </summary> /// <param name="xscale"></param> /// <param name="yscale"></param> public void ScalePosition(double xscale, double yscale) { foreach (GraphicBase o in this.InnerList) { GraphicBase.ScalePosition(o, xscale, yscale); } }
public RotationGripHandle(GraphicBase parent, PointF relPos) { _parent = parent; _drawrPosition = relPos; _fixrPosition = new PointF(0.5f, 0.5f); _fixaPosition = _parent.RelativeToAbsolutePosition(_fixrPosition, true); }
/// <summary> /// Scales the position of an item according to the provided xscale and yscale. Can be called with null for the item (in this case nothing happens). /// </summary> /// <param name="o">The graphics object whose position is scaled.</param> /// <param name="xscale">The xscale ratio.</param> /// <param name="yscale">The yscale ratio.</param> public static void ScalePosition(GraphicBase o, double xscale, double yscale) { if (o != null) { PointF oldP = o.Position; o.SetPosition(new PointF((float)(oldP.X * xscale), (float)(oldP.Y * yscale))); } }
/// <summary> /// Adds an item to this shape group. /// </summary> /// <param name="obj">Item to add.</param> public void Add(GraphicBase obj) { obj.SetCoordinatesByAppendInverseTransformation(_transformation, Main.EventFiring.Suppressed); _groupedObjects.Add(obj); obj.ParentObject = this; AdjustPosition(); EhSelfChanged(EventArgs.Empty); }
public void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info) { GraphicBase s = (GraphicBase)obj; info.AddValue("Position", s._position); info.AddValue("Bounds", s._bounds); info.AddValue("Rotation", s._rotation); info.AddValue("AutoSize", s._autoSize); }
protected override void CopyFrom(GraphicBase bfrom) { EmbeddedImageGraphic from = bfrom as EmbeddedImageGraphic; if (from != null) { this._imageProxy = null == from._imageProxy ? null : (ImageProxy)from._imageProxy.Clone(); } base.CopyFrom(bfrom); }
protected override void CopyFrom(GraphicBase bfrom) { LinkedImageGraphic from = bfrom as LinkedImageGraphic; if (from != null) { this._imagePath = from._imagePath; this._cachedImage = null == from._cachedImage ? null : (Image)from._cachedImage.Clone(); } base.CopyFrom(bfrom); }
protected override void CopyFrom(GraphicBase bfrom) { ShapeGraphic from = bfrom as ShapeGraphic; if (from != null) { this._fillBrush = (BrushX)from._fillBrush.Clone(); this._linePen = (PenX)from._linePen.Clone(); } base.CopyFrom(bfrom); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { GraphicBase s = (GraphicBase)o; s._position = (PointF)info.GetValue("Position", s); s._bounds = (RectangleF)info.GetValue("Bounds", s); s._rotation = info.GetSingle("Rotation"); s._autoSize = info.GetBoolean("AutoSize"); return(s); }
protected override void CopyFrom(GraphicBase bfrom) { SimpleTextGraphic from = bfrom as SimpleTextGraphic; if (from != null) { this._font = null == from._font ? null : (Font)from._font.Clone(); this._text = from._text; this._color = from._color; } base.CopyFrom(bfrom); }
public int Add(GraphicBase go, bool fireChangedEvent) { go.ParentObject = this; int result = List.Add(go); if (fireChangedEvent) { OnChanged(); } return(result); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { var s = null != o ? (ShapeGroup)o : new ShapeGroup(); info.GetBaseValueEmbedded(s, typeof(ShapeGroup).BaseType, parent); int count = info.OpenArray("Elements"); var list = new GraphicBase[count]; for (int i = 0; i < count; i++) list[i] = (GraphicBase)info.GetValue("e", s); info.CloseArray(count); s.AddRange(list); return s; }
protected virtual void CopyFrom(GraphicBase from) { this._autoSize = from._autoSize; this._bounds = from._bounds; this._position = from._position; this._rotation = from._rotation; bool wasUsed = (null != this._parent); this._parent = from._parent; if (wasUsed) { OnChanged(); } }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { GraphicCollection s = null != o ? (GraphicCollection)o : new GraphicCollection(); int count = info.OpenArray(); for (int i = 0; i < count; i++) { GraphicBase go = (GraphicBase)info.GetValue(s); s.Add(go); } info.CloseArray(count); return(s); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="from">The object to copy the data from.</param> protected GraphicBase(GraphicBase from) { CopyFrom(from); }
/// <summary> /// Creates a new HitTestObject. /// </summary> /// <param name="parent">The hitted object.</param> public GraphicBaseHitTestObject(GraphicBase parent) : base(parent) { }
public int Add(GraphicBase go, bool fireChangedEvent) { go.ParentObject = this; int result = List.Add(go); if (fireChangedEvent) OnChanged(); return result; }
public void AddRange(GraphicBase[] gos) { int len = gos.Length; for(int i=0;i<len;i++) this.Add(gos[i],false); OnChanged(); }
public bool Contains(GraphicBase go) { return(List.Contains(go)); }
public int Add(GraphicBase go) { return Add(go, true); }
public void CopyTo(GraphicBase[] array, int index) { List.CopyTo(array, index); }
public GraphicCollection(GraphicBase[] g) : base() { this.AddRange(g); }
public void Remove(GraphicBase go) { List.Remove(go); OnChanged(); }
public void Insert(int index, GraphicBase go) { List.Insert(index, go); OnChanged(); }
public int IndexOf(GraphicBase go) { return(List.IndexOf(go)); }
protected virtual void CopyFrom(GraphicBase from) { this._autoSize = from._autoSize; this._bounds = from._bounds; this._position = from._position; this._rotation = from._rotation; bool wasUsed = (null != this._parent); this._parent = from._parent; if(wasUsed) OnChanged(); }
/// <summary> /// Tries to remove a child object of this collection. /// </summary> /// <param name="go">The object to remove.</param> /// <returns> If the provided object is a child object and /// the child object could be removed, the return value is true.</returns> public bool Remove(GraphicBase go) { // test our own objects for removal (only that that _are_ removable) if (object.ReferenceEquals(go, this._axisTitle)) { _axisTitle = null; return true; } return false; }
/// <summary> /// Scales the position of an item according to the provided xscale and yscale. Can be called with null for the item (in this case nothing happens). /// </summary> /// <param name="o">The graphics object whose position is scaled.</param> /// <param name="xscale">The xscale ratio.</param> /// <param name="yscale">The yscale ratio.</param> public static void ScalePosition(GraphicBase o, double xscale, double yscale) { if(o!=null) { PointF oldP = o.Position; o.SetPosition(new PointF((float)(oldP.X*xscale),(float)(oldP.Y*yscale))); } }
public int IndexOf(GraphicBase go) { return List.IndexOf(go); }
public int Add(GraphicBase go) { return(Add(go, true)); }
protected override void CopyFrom(GraphicBase bfrom) { TextGraphic from = bfrom as TextGraphic; if (from != null) { this._text = from._text; this._font = from._font == null ? null : (Font)from._font.Clone(); this._textBrush = from._textBrush == null ? null : (BrushX)from._textBrush.Clone(); this._background = from._background == null ? null : (IBackgroundStyle)from._background.Clone(); this._lineSpacingFactor = from._lineSpacingFactor; _xAnchorType = from._xAnchorType; _yAnchorType = from._yAnchorType; // don't clone the cached items this._cachedTextLines = null; this._isStructureInSync = false; this._isMeasureInSync = false; } base.CopyFrom(bfrom); }
/// <summary> /// Adds an item to this shape group. /// </summary> /// <param name="obj">Item to add.</param> public void Add(GraphicBase obj) { obj.SetCoordinatesByAppendInverseTransformation(this._transformation, Main.EventFiring.Suppressed); _groupedObjects.Add(obj); obj.ParentObject = this; AdjustPosition(); EhSelfChanged(EventArgs.Empty); }
public bool Contains(GraphicBase go) { return List.Contains(go); }