Ejemplo n.º 1
0
        protected override void DrawCore(IGraphicContext graphicContext)
        {
            float xFromCenterAbsoulute = Width / 2 * m_Activity.Level;
            float xFromCenterRelative  = m_Activity.Orientation == Orientation.Left
                                            ? -xFromCenterAbsoulute
                                            : xFromCenterAbsoulute;

            float x = m_Column.Body.Middle + xFromCenterRelative - Width / 2;

            float yStart = m_StartRow.Body.Bottom;
            float yEnd   = m_EndRow.Body.Bottom;

            var location = new Point(x, yStart);
            var size     = new Size(Width, yEnd - yStart);

            graphicContext.FillRectangle(location, size, Style.Activity.BackColor);
            graphicContext.DrawRectangle(location, size, Style.Activity.FrameColor, Style.Common.LineStyle);

            base.DrawCore(graphicContext);
        }
Ejemplo n.º 2
0
        protected override void LayoutCore(IGraphicContext graphicContext)
        {
            base.LayoutCore(graphicContext);

            m_TextSize = graphicContext.MeasureText(m_Fragment.Title, Style.Common.Font, Style.Fragment.FontSize);

            m_InnerPadding = m_PaddingDepth * Style.Fragment.FramePadding;

            Width = m_TextSize.Width + Style.Fragment.FramePadding;

            var firstChild             = Children.FirstOrDefault() as OperandVisualBase;
            var firstChildBottomOffset = firstChild != null ? firstChild.BottomOffset : 0;

            BottomOffset = firstChildBottomOffset + m_TextSize.Height;

            TopRow.TopGap.Allocate(BottomOffset + 4);
            BottomRow.BottomGap.Allocate(m_InnerPadding.Bottom);

            LeftColumn.LeftGap.Allocate(m_InnerPadding.Left);
            RightColumn.RightGap.Allocate(m_InnerPadding.Right);
        }
        public SwapChainPresenter(IGraphicContext context)
        {
            if (_msaa.Count == 0)
            {
                _msaa.Count = 1;
            }

            _displaySize             = new Size(context.BackBufferWidth, context.BackBufferHeight);
            this._backBufferFormat   = context.BackBufferFormat;
            this._depthStencilFormat = context.DepthStencilFormat;
            this._msaa = context.Sampling;

            _viewport  = new ViewPort(0, 0, _displaySize.Width, _displaySize.Height);
            _swapChain = GraphicDeviceFactory.Device.CreateSwapChain(context);

            _depthBuffer = GraphicDeviceFactory.Device.CreateDepthStencil(
                context.BackBufferWidth,
                context.BackBufferHeight,
                _depthStencilFormat,
                _msaa);
        }
Ejemplo n.º 4
0
        private void DrawCellAreas(IGraphicContext graphicContext)
        {
            foreach (var row in Rows)
            {
                var rowTop        = row.Top;
                var rowHeight     = row.Bottom - rowTop;
                var rowBodyTop    = row.Body.Top;
                var rowBodyHeight = row.Body.Bottom - row.Body.Top;

                foreach (var column in Columns)
                {
                    var columnLeft      = column.Left;
                    var columnWidth     = column.Right - columnLeft;
                    var columnBodyLeft  = column.Body.Left;
                    var columnBodyWidth = column.Body.Right - columnBodyLeft;

                    graphicContext.FillRectangle(
                        new Point(columnLeft, rowTop),
                        new Size(columnWidth, rowHeight),
                        new Color(50, Color.Green));

                    graphicContext.DrawRectangle(
                        new Point(columnLeft, rowTop),
                        new Size(columnWidth, rowHeight),
                        new Color(100, Color.Green),
                        Style.Common.LineStyle);

                    graphicContext.FillRectangle(
                        new Point(columnBodyLeft, rowBodyTop),
                        new Size(columnBodyWidth, rowBodyHeight),
                        new Color(50, Color.Red));

                    graphicContext.DrawRectangle(
                        new Point(columnBodyLeft, rowBodyTop),
                        new Size(columnBodyWidth, rowBodyHeight),
                        new Color(100, Color.Red),
                        Style.Common.LineStyle);
                }
            }
        }
Ejemplo n.º 5
0
        protected override void LayoutCore(IGraphicContext graphicContext)
        {
            base.LayoutCore(graphicContext);

            Size = string.IsNullOrEmpty(m_GuardExpressionText)
                ? Size.Empty
                : graphicContext.MeasureText(m_GuardExpressionText, Style.Common.Font, Style.GuardExpression.FontSize);

            float childBottomOffset =
                Children
                .Where(visual => visual is FragmentVisual)
                .Cast <FragmentVisual>()
                .Where(fragment => fragment.TopRow == m_TopRow)
                .Select(fragment => fragment.BottomOffset)
                .DefaultIfEmpty()
                .Max();

            BottomOffset = childBottomOffset + Size.Height + 8;

            m_TopRow.TopGap.Allocate(BottomOffset);

            this.GridLayout.AllocateBetween(m_LeftColumn, m_RightColumn, this.Size.Width);
        }
Ejemplo n.º 6
0
        protected override void DrawCore(IGraphicContext graphicContext)
        {
            float yLine = m_TopRow.TopGap.Bottom - BottomOffset + 4;
            float yText = yLine + 2;

            float xStart = Parent.Location.X;
            float xEnd   = Parent.Location.X + Parent.Size.Width;

            if (!m_IsFirst)
            {
                graphicContext.DrawDashedLine(new Point(xStart, yLine), new Point(xEnd, yLine), Style.Fragment.OperandSeparatorWidth, Style.Fragment.OperandSeparatorColor, Style.Common.LineStyle);
            }

            Point textLocation = new Point(xStart + 5, yText);

            graphicContext.FillRectangle(textLocation, Size, Color.SemiTransparent);
            graphicContext.DrawText(
                textLocation, Size,
                m_GuardExpressionText,
                Style.Common.Font, Style.GuardExpression.FontSize, Style.GuardExpression.TextColor,
                HorizontalAlignment.Left, VerticalAlignment.Middle);

            base.DrawCore(graphicContext);
        }
        protected override void LayoutCore(IGraphicContext graphicContext)
        {
            base.LayoutCore(graphicContext);

            Size = m_GridLayout.Size;
        }
Ejemplo n.º 8
0
 protected override void DrawCore(IGraphicContext graphicContext)
 {
     Location = Parent.Location;
     graphicContext.DrawText(Location, Size, m_Name, Style.Common.Font, Style.Lifeline.NameFontSize, Style.Lifeline.NameTextColor, HorizontalAlignment.Center, VerticalAlignment.Middle);
 }
Ejemplo n.º 9
0
 public static void Create(IGraphicContext context)
 {
     Instance = new GraphicContext();
     Instance._nativeInstance = context;
 }
Ejemplo n.º 10
0
        protected void DrawInternal(float xEnd, float xStart, float yEnd, float yStart, IGraphicContext graphicContext)
        {
            Location = new Point(xStart, yStart);
            Size     = new Size(xEnd - xStart, yEnd - yStart);

            if (!string.IsNullOrEmpty(m_Fragment.Title))
            {
                DrawTextFrame(xStart, yStart, graphicContext);
                DrawText(graphicContext);
            }

            DrawOuterFrame(graphicContext);
        }
Ejemplo n.º 11
0
 protected override void LayoutCore(IGraphicContext graphicContext)
 {
     Size = graphicContext.MeasureText(_text.DisplayText, Font.Handwritten, 12);
 }
Ejemplo n.º 12
0
 protected virtual void DrawCore(IGraphicContext graphicContext)
 {
 }
Ejemplo n.º 13
0
 public GraphicDevice CreateDevice(IGraphicContext context)
 {
     return(CreateDevice(new GraphicDeviceDesc(context)));
 }
Ejemplo n.º 14
0
 public override void Draw(IGraphicContext gc)
 {
     gc.DrawLine(_from, _to, 2.0f, Color.Red, LineStyle.Sketchy);
 }
Ejemplo n.º 15
0
 public abstract void Draw(IGraphicContext gc);
Ejemplo n.º 16
0
 protected override void DrawCore(IGraphicContext graphicContext)
 {
     _drawings.ForEach(ls => ls.Draw(graphicContext));
 }
Ejemplo n.º 17
0
 public override void Draw(IGraphicContext gc)
 {
     gc.FillPolygon(_points, Color.Red);
 }
Ejemplo n.º 18
0
 protected abstract void DrawText(IGraphicContext graphicContext);
Ejemplo n.º 19
0
        private void DrawText(IGraphicContext graphicContext)
        {
            Size textArea = m_TextSize + new Padding(Style.Fragment.FramePadding / 2);

            graphicContext.DrawText(Location, textArea, m_Fragment.Title, Style.Common.Font, Style.Fragment.FontSize, Style.Fragment.TextColor, HorizontalAlignment.Center, VerticalAlignment.Middle);
        }
Ejemplo n.º 20
0
 private void DrawOuterFrame(IGraphicContext graphicContext)
 {
     graphicContext.DrawRectangle(Location, Size, Style.Fragment.FrameColor, Style.Common.LineStyle);
 }
 protected abstract SwapChain CreateSwapChainImp(IGraphicContext context);
Ejemplo n.º 22
0
 protected abstract void DrawArrow(IGraphicContext graphicContext);
Ejemplo n.º 23
0
 protected virtual void LayoutCore(IGraphicContext graphicContext)
 {
 }
Ejemplo n.º 24
0
 protected sealed override void DrawCore(IGraphicContext graphicContext)
 {
     DrawArrow(graphicContext);
     DrawText(graphicContext);
 }
Ejemplo n.º 25
0
 protected override void DrawCore(IGraphicContext graphicContext)
 {
     // TODO debug flag graphicContext.FillRectangle(Location, Size, Color.Green);
 }
 protected override SwapChain CreateSwapChainImp(IGraphicContext context)
 {
     throw new NotImplementedException();
 }
        protected override void LayoutCore(IGraphicContext graphicContext)
        {
            base.LayoutCore(graphicContext);

            GridLayout.AllocateBetween(LeftColumn, RightColumn, Width + 3 * Style.Fragment.FramePadding);
        }
 public GraphicDeviceDesc(IGraphicContext context)
     : this()
 {
     this.Context = context;
 }
Ejemplo n.º 29
0
 public SwapChain(IGraphicContext context)
 {
     this.context = context;
 }
Ejemplo n.º 30
0
        protected override void LayoutCore(IGraphicContext graphicContext)
        {
            base.LayoutCore(graphicContext);

            m_TextSize = graphicContext.MeasureText(m_Signal.Name, Style.Common.Font, Style.Signal.FontSize);
        }