Example #1
0
        public TransformViewChangeBox(TransformControler controller)
        {
            Items.Add(new BoxItem(ViewVersion.Round, "Окружность"));

            SelectedIndexChanged += (sender, ev) => {
                controller.SwitchView(((BoxItem)SelectedItem).Type);
            };
        }
Example #2
0
        public SpectrumView(TransformControler transformer)
        {
            //кнопка изменения типа представления
            var changeBox = new TransformViewChangeBox(transformer);
            //панель представления преобразования
            var viewer = new TransformViewDisplay(transformer);

            //viewButton.Dock = DockStyle.Top;
            viewer.Dock = DockStyle.Fill;

            Controls.Add(changeBox);
            Controls.Add(viewer);
        }
Example #3
0
        public SpectrumPanel(TransformControler transformer)
        {
            var view    = new SpectrumView(transformer);
            var options = new SpectrumOptionsPanel();

            Controls.Add(options);
            Controls.Add(view);

            SizeChanged += (sender, ev) =>
            {
                var chartSize = Math.Min(Width, Height * 70 / 100);
                view.Size = new Size(chartSize, chartSize);
                options.SetBounds(0, chartSize + 25, Width, Math.Max(250, Height / 4));
                Invalidate();
            };
        }
        public TransformViewDisplay(TransformControler controller)
        {
            transform = controller;

            viewers = new Dictionary <ViewVersion, ISpectrumViewer>
            {
                [ViewVersion.Round] = new RoundSpectrum(transform.View)
            };

            DoubleBuffered = true;

            transform.ViewChanged += () =>
            {
                Invalidate();
            };

            Paint += (sender, ev) =>
            {
                RedrawView(ev.Graphics);
            };

            Invalidate();
        }
Example #5
0
 public ApplicationModel()
 {
     Signal    = new SignallController();
     Transform = new TransformControler(Signal);
 }