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); }
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); }
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); } } }
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); }
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; }
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); }
public static void Create(IGraphicContext context) { Instance = new GraphicContext(); Instance._nativeInstance = context; }
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); }
protected override void LayoutCore(IGraphicContext graphicContext) { Size = graphicContext.MeasureText(_text.DisplayText, Font.Handwritten, 12); }
protected virtual void DrawCore(IGraphicContext graphicContext) { }
public GraphicDevice CreateDevice(IGraphicContext context) { return(CreateDevice(new GraphicDeviceDesc(context))); }
public override void Draw(IGraphicContext gc) { gc.DrawLine(_from, _to, 2.0f, Color.Red, LineStyle.Sketchy); }
public abstract void Draw(IGraphicContext gc);
protected override void DrawCore(IGraphicContext graphicContext) { _drawings.ForEach(ls => ls.Draw(graphicContext)); }
public override void Draw(IGraphicContext gc) { gc.FillPolygon(_points, Color.Red); }
protected abstract void DrawText(IGraphicContext graphicContext);
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); }
private void DrawOuterFrame(IGraphicContext graphicContext) { graphicContext.DrawRectangle(Location, Size, Style.Fragment.FrameColor, Style.Common.LineStyle); }
protected abstract SwapChain CreateSwapChainImp(IGraphicContext context);
protected abstract void DrawArrow(IGraphicContext graphicContext);
protected virtual void LayoutCore(IGraphicContext graphicContext) { }
protected sealed override void DrawCore(IGraphicContext graphicContext) { DrawArrow(graphicContext); DrawText(graphicContext); }
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; }
public SwapChain(IGraphicContext context) { this.context = context; }
protected override void LayoutCore(IGraphicContext graphicContext) { base.LayoutCore(graphicContext); m_TextSize = graphicContext.MeasureText(m_Signal.Name, Style.Common.Font, Style.Signal.FontSize); }