예제 #1
0
        public void Paint(Graphics g, PriceGraphicMapping priceGraphic, IPriceShape shape)
        {
            switch (shape.GetShapeType())
            {
            case PriceShapeType.Point:
                shapePainter_Point.Paint(g, priceGraphic, shape);
                break;

            case PriceShapeType.Line:
                shapePainter_Line.Paint(g, priceGraphic, shape);
                break;

            case PriceShapeType.PolyLine:
                shapePainter_PolyLine.Paint(g, priceGraphic, shape);
                break;

            case PriceShapeType.Label:
                shapePainter_Label.Paint(g, priceGraphic, shape);
                break;

            case PriceShapeType.Rect:
                shapePainter_Rect.Paint(g, priceGraphic, shape);
                break;
            }
        }
예제 #2
0
        private void DrawShape(IPriceShape shape)
        {
            if (shape is StrategyShape)
            {
                this.DrawShape2((StrategyShape)shape);
            }
            else
            {
                PriceRectangle priceRect = mapping.PriceRect;
                int            start     = priceRect.StartIndex;
                int            end       = priceRect.EndIndex;

                if (shape.GetShapeType() == PriceShapeType.Point)
                {
                    PriceShape_Point point = (PriceShape_Point)shape;
                    if (point.X < start || point.X > end)
                    {
                        return;
                    }
                }
                this.drawer.DrawPriceShape(shape);
            }
        }