Esempio n. 1
0
        protected override void drawExtras(ref Rectangle?dirty, Context g, ShapeEngine engine)
        {
            if (engine.ControlPoints.Count > 0)
            {
                //Draw the arrows for the currently active shape.

                GeneratedPoint[] genPoints = engine.GeneratedPoints;

                for (int i = 0; i < engine.ControlPoints.Count; ++i)
                {
                    LineCurveSeriesEngine lCSEngine = (LineCurveSeriesEngine)engine;

                    if (lCSEngine.Arrow1.Show)
                    {
                        if (genPoints.Length > 1)
                        {
                            dirty = dirty.UnionRectangles(lCSEngine.Arrow1.Draw(g, lCSEngine.OutlineColor,
                                                                                genPoints[0].Position, genPoints[1].Position));
                        }
                    }

                    if (lCSEngine.Arrow2.Show)
                    {
                        if (genPoints.Length > 1)
                        {
                            dirty = dirty.UnionRectangles(lCSEngine.Arrow2.Draw(g, lCSEngine.OutlineColor,
                                                                                genPoints[genPoints.Length - 1].Position, genPoints[genPoints.Length - 2].Position));
                        }
                    }
                }
            }

            base.drawExtras(ref dirty, g, engine);
        }
Esempio n. 2
0
        public override void UpdateToolbarSettings(ShapeEngine engine)
        {
            if (engine != null && engine.ShapeType == ShapeTypes.RoundedLineSeries)
            {
                RoundedLineEngine rLEngine = (RoundedLineEngine)engine;

                Radius = rLEngine.Radius;

                base.UpdateToolbarSettings(engine);
            }
        }
        protected ShapeEngine(ShapeEngine src)
        {
            DrawingLayer = src.DrawingLayer;
            ShapeType    = src.ShapeType;
            AntiAliasing = src.AntiAliasing;
            Closed       = src.Closed;
            OutlineColor = src.OutlineColor.Clone();
            FillColor    = src.OutlineColor.Clone();
            BrushWidth   = src.BrushWidth;

            // Don't clone the GeneratedPoints or OrganizedPoints, as they will be calculated.
            ControlPoints = src.ControlPoints.Select(i => i.Clone()).ToList();
            DashPattern   = src.DashPattern;
        }
Esempio n. 4
0
        /// <summary>
        /// Create a ShapeEngine clone with all of the common and added extra data (that depends on the ShapeEngine child type).
        /// </summary>
        /// <returns>The partially cloned shape data.</returns>
        public ShapeEngine PartialClone()
        {
            //The actual type of ShapeEngine child created for the clone must be done in an overridden method.
            ShapeEngine clonedCE = cloneSpecific();

            clonedCE.ControlPoints = ControlPoints.Select(i => i.Clone()).ToList();

            //Don't clone the GeneratedPoints or OrganizedPoints, as they will be calculated.

            clonedCE.DashPattern = DashPattern;

            clonedCE.BrushWidth = BrushWidth;

            return(clonedCE);
        }
Esempio n. 5
0
        protected ShapeEngine(ShapeEngine src)
        {
            DrawingLayer = src.DrawingLayer;
            ShapeType    = src.ShapeType;
            AntiAliasing = src.AntiAliasing;
            Closed       = src.Closed;
            OutlineColor = src.OutlineColor.Clone();
            FillColor    = src.FillColor.Clone();
            BrushWidth   = src.BrushWidth;

            // Don't clone the GeneratedPoints or OrganizedPoints, as they will be calculated.
            ControlPoints = src.ControlPoints.Select(i => i.Clone()).ToList();
            DashPattern   = src.DashPattern;
            parent_layer  = null !;           // NRT - This constructor needs to set parent_layer somehow as code expects it to be not-null
        }
Esempio n. 6
0
        public override void updateToolbarSettings(ShapeEngine engine)
        {
            if (engine != null && engine.ShapeType == ShapeTypes.OpenLineCurveSeries)
            {
                if (showArrowOneBox != null)
                {
                    LineCurveSeriesEngine lCSEngine = (LineCurveSeriesEngine)engine;

                    showArrowOneBox.Active = lCSEngine.Arrow1.Show;
                    showArrowTwoBox.Active = lCSEngine.Arrow2.Show;

                    if (showOtherArrowOptions)
                    {
                        (arrowSize.ComboBox as Gtk.ComboBoxEntry).Entry.Text         = lCSEngine.Arrow1.ArrowSize.ToString();
                        (arrowAngleOffset.ComboBox as Gtk.ComboBoxEntry).Entry.Text  = lCSEngine.Arrow1.AngleOffset.ToString();
                        (arrowLengthOffset.ComboBox as Gtk.ComboBoxEntry).Entry.Text = lCSEngine.Arrow1.LengthOffset.ToString();
                    }
                }

                base.updateToolbarSettings(engine);
            }
        }
Esempio n. 7
0
        public override void UpdateToolbarSettings(ShapeEngine engine)
        {
            if (engine != null && engine.ShapeType == ShapeTypes.OpenLineCurveSeries)
            {
                if (showArrowOneBox != null)
                {
                    LineCurveSeriesEngine lCSEngine = (LineCurveSeriesEngine)engine;

                    ArrowOneEnabledCheckBox.Widget.Active = lCSEngine.Arrow1.Show;
                    ArrowTwoEnabledCheckBox.Widget.Active = lCSEngine.Arrow2.Show;

                    if (ArrowOneEnabled || ArrowTwoEnabled)
                    {
                        ArrowSize.Widget.Value         = lCSEngine.Arrow1.ArrowSize;
                        ArrowAngleOffset.Widget.Value  = lCSEngine.Arrow1.AngleOffset;
                        ArrowLengthOffset.Widget.Value = lCSEngine.Arrow1.LengthOffset;
                    }
                }

                base.UpdateToolbarSettings(engine);
            }
        }