示例#1
0
 public MainWindow()
 {
     InitializeComponent();
     // IDAO dao = new DatabaseDAO("ARTHASASYAN\\SQLEXPRESS01", "InformationalEdition", "Kost", "localadmin");
     _tableDrawer   = new DataGridDrawer();
     _graphicDrawer = new HistogramDrawer();
 }
示例#2
0
        public AssetDrawer CreateAssetDrawer(object target)
        {
            int length   = this.elements.Length;
            var graphics = new IAssetGraphic[length];
            var drawers  = new IGraphicDrawer[length];

            for (int i = 0; i < length; i++)
            {
                var graphic = elements[i].CreateAssetGraphic(target);
                graphics[i] = graphic;
                drawers[i]  = pipeline.CreateGraphicDrawer(graphic.GraphicType);
            }

            return(new AssetDrawer(graphics, drawers));
        }
示例#3
0
 public void SetUp()
 {
     imageHolder = A.Fake <IImageHolder>();
     settings    = A.Fake <ICircularCloudLayouterWithWordsSettings>();
     palette     = A.Fake <IPalette>();
     layouter    = A.Fake <ICircularCloudLayouter>();
     graphics    = A.Fake <IGraphicDrawer>();
     A.CallTo(() => imageHolder.GetImageSize()).Returns(new Size(600, 600));
     A.CallTo(() => imageHolder.StartDrawing()).Returns(graphics);
     A.CallTo(() => settings.CenterX).Returns(300);
     A.CallTo(() => settings.Scale).Returns(5);
     A.CallTo(() => settings.CenterY).Returns(300);
     A.CallTo(() => palette.PrimaryColor).Returns(Color.Black);
     A.CallTo(() => palette.BackgroundColor).Returns(Color.Black);
     A.CallTo(() => palette.SecondaryColor).Returns(Color.Black);
 }
示例#4
0
        private void DrawRectangle(IGraphicDrawer graphics, string word, int wordFrequency, Brush backgroundBrush, Pen rectPen, Brush textBrush)
        {
            var font = new Font("Arial", Math.Min(72, wordFrequency * settings.Scale));
            var size = new Size(TextRenderer.MeasureText(word, font).Width, TextRenderer.MeasureText(word, font).Height);
            var rect = layouter.PutNextRectangle(size);

            if (settings.Fill)
            {
                graphics.FillRectangle(backgroundBrush, rect);
            }
            if (settings.Frame)
            {
                graphics.DrawRectangle(rectPen, rect);
            }
            graphics.DrawString(word, font, textBrush, new PointF(rect.X, rect.Y));
        }
示例#5
0
 public void SetUp()
 {
     imageHolder = A.Fake <IImageHolder>();
     settings    = A.Fake <ICircularCloudLayouterSettings>();
     palette     = A.Fake <IPalette>();
     layouter    = A.Fake <ICircularCloudLayouter>();
     graphics    = A.Fake <IGraphicDrawer>();
     A.CallTo(() => imageHolder.GetImageSize()).Returns(new Size(600, 600));
     A.CallTo(() => imageHolder.StartDrawing()).Returns(graphics);
     A.CallTo(() => settings.MinSize).Returns(10);
     A.CallTo(() => settings.MaxSize).Returns(30);
     A.CallTo(() => settings.CenterX).Returns(300);
     A.CallTo(() => settings.CenterY).Returns(300);
     A.CallTo(() => settings.IterationsCount).Returns(5);
     A.CallTo(() => settings.XCompression).Returns(1);
     A.CallTo(() => settings.YCompression).Returns(1);
     A.CallTo(() => palette.PrimaryColor).Returns(Color.Black);
     A.CallTo(() => palette.BackgroundColor).Returns(Color.Black);
     A.CallTo(() => palette.SecondaryColor).Returns(Color.Black);
 }
示例#6
0
            public void SetValue(object value)
            {
                assetReference = value as AssetReference;

                if (assetReference != null && assetReference.editorAsset != null)
                {
                    var resultType = assetReference.editorAsset.GetType();

                    if (wrappedDrawer == null || wrappedDrawerType != resultType)
                    {
                        wrappedDrawer     = factory.pipeline.CreateGraphicDrawer(resultType);
                        wrappedDrawerType = resultType;
                    }
                    if (wrappedDrawer != null)
                    {
                        wrappedDrawer.SetValue(assetReference.editorAsset);
                    }
                }
                else
                {
                    wrappedDrawer = null;
                }
            }
示例#7
0
 private void DrawRectangle(IGraphicDrawer graphics, SolidBrush backgroundBrush, Pen rectPen, Rectangle rectangle)
 {
     graphics.FillRectangle(backgroundBrush, rectangle);
     graphics.DrawRectangle(rectPen, rectangle);
 }