Esempio n. 1
0
 public static void Show(Form owner, ISelectionHolder selectionHolder, Core core, ChartHelper chart)
 {
     using (FrmPopoutPlot frm = new FrmPopoutPlot(selectionHolder, core, chart))
     {
         frm.ShowDialog(owner);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Creates the captionbar at the bottom of the specified control.
        /// </summary>
        public CaptionBar(Control parent, ISelectionHolder selector)
        {
            this._selector = selector;

            this._flp = new FlowLayoutPanel
            {
                AutoSize     = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink,
                Dock         = DockStyle.Bottom,
                Visible      = true
            };

            this._label = new LinkLabel
            {
                AutoSize  = true,
                Text      = "",
                Visible   = true,
                LinkColor = Color.DarkGray
            };

            this._label.LinkClicked += this._label_LinkClicked;
            this._label.LinkBehavior = LinkBehavior.NeverUnderline;

            parent.Controls.Add(this._flp);
            this._flp.Controls.Add(this._label);

            this._label.SendToBack();
        }
Esempio n. 3
0
        private FrmPca(Core core, FrmMain frmMain)
        {
            this.InitializeComponent();
            UiControls.SetIcon(this);
            UiControls.ColourMenuButtons(this.toolStrip1);

            this._frmMain = frmMain;
            this._core    = core;

            this._peakFilter = PeakFilter.Empty;
            this._obsFilter  = ObsFilter.Empty;

            this._selectedCorrection = core.Options.SelectedMatrixProvider;

            this._colourBy._colourByPeak             = ColumnManager.GetColumns <Peak>(this._core).First(z => z.Id == Peak.ID_COLUMN_CLUSTERCOMBINATION);
            this._colourBy._colourByObervation       = ColumnManager.GetColumns <ObservationInfo>(this._core).First(z => z.Id == nameof(ObservationInfo.Group));
            this._regressAgainst._colourByPeak       = this._colourBy._colourByPeak;
            this._regressAgainst._colourByObervation = this._colourBy._colourByObervation;

            this._chart.AddControls(this.toolStripDropDownButton1);
            this._chart.Style.LegendDisplay = ELegendDisplay.Visible;

            this.UpdateScores();
        }
Esempio n. 4
0
 public ChartHelperForPeaks(ISelectionHolder selector, Core core, Control targetSite)
     : base(selector, core, targetSite, false)
 {
 }
Esempio n. 5
0
 public FrmPopoutPlot(ISelectionHolder selectionHolder, Core core, ChartHelper chart)
     : this()
 {
     this._chart = new ChartHelper(selectionHolder, core, this, true);
     this._chart.Chart.SetPlot(chart.Chart.CurrentPlot); // TODO: Not sure about using same plot on two graphs!
 }
 /// <summary>
 /// Ctor
 /// </summary>
 public ChartHelperForClusters(ISelectionHolder selector, Core core, Control targetSite)
     : base(selector, core, targetSite, true)
 {
     this._chart.SelectionChanging += this._chart_SelectionChanging;
 }
Esempio n. 7
0
        public ChartHelper(ISelectionHolder selector, Core core, Control targetSite, bool describePeaks)
        {
            this._selector = selector;
            this._core     = core;

            Color c  = core.Options.Colours.MinorGrid;
            Color c2 = core.Options.Colours.MajorGrid;


            // CHART
            this._chart      = new MChart();
            this._chart.Name = "_CHART_IN_" + (targetSite != null ? targetSite.Name : "NOTHING");

            this._chart.Style.Animate           = false;
            this._chart.Style.SelectionColour   = Color.Blue;
            this._chart.Style.HighlightColour   = Color.Black;
            this._chart.Style.HighlightMinWidth = 5;

            this._chart.SelectionChanged += this._chart_SelectionChanged;

            if (targetSite == null)
            {
                return;
            }

            this._chart.Dock = DockStyle.Fill;
            targetSite.Controls.Add(this._chart);

            // CAPTION BAR
            this._captionBar = new CaptionBar(targetSite, selector);

            // MENU BAR
            this._menuBar = new ToolStrip();
            //_menuBar.Font = FontHelper.RegularFont;
            //_menuBar.ImageScalingSize = new Size(24, 24);
            this._menuBar.AutoSize  = true;
            this._menuBar.Padding   = new Padding(0, 0, 0, 0);
            this._menuBar.Dock      = DockStyle.Top;
            this._menuBar.GripStyle = ToolStripGripStyle.Hidden;
            this._menuBar.BackColor = Color.FromKnownColor(KnownColor.Control);
            targetSite.Controls.Add(this._menuBar);
            this._menuBar.SendToBack();

            // PLOT BUTTON
            this._mnuPlot                   = new ToolStripDropDownButton("...");
            this._mnuPlot.Visible           = false;
            this._mnuPlot.AutoSize          = true;
            this._mnuPlot.ShowDropDownArrow = false;
            this._menuBar.Items.Add(this._mnuPlot);

            // USER DETAILS BUTTON
            this._mnuCustomText = new ToolStripDropDownButton(Resources.IconInformation);
            this._mnuCustomText.DropDownItems.Add("Copy", Resources.MnuCopy, this._userDetailsCopyButton_Clicked);
            this._mnuCustomText.DropDownItems.Add("Configure...", null, this._userDetailsButton_Clicked);
            this._mnuCustomText.ShowDropDownArrow = false;
            this._mnuCustomText.Visible           = false;
            this._mnuCustomText.AutoSize          = true;
            this._menuBar.Items.Add(this._mnuCustomText);

            // GENERIC CHART BAR
            this._chart.AddControls(this._menuBar);

            // SELECTION BUTTONS
            this._mnuSelectedIntensity = this.CreateSelectionButton(Resources.IconIntensity);
            this._mnuSelectedReplicate = this.CreateSelectionButton(Resources.IconReplicate);
            this._mnuSelectedTime      = this.CreateSelectionButton(Resources.IconTime);
            this._mnuSelectedGroup     = this.CreateSelectionButton(Resources.MnuWarning);
            this._mnuSelectedPeak      = this.CreateSelectionButton(Resources.IconPeak);
            this._mnuSelectedSeries    = this.CreateSelectionButton(Resources.MnuWarning);

            // PLOT BUTTON ITEMS
            this._mnuPlot.DropDownOpening += this._menuButtonMenu_Opening;

            /**** MENU *****/
            /* select xxxx */ this._btnNavigateToSelected = this._mnuPlot.DropDownItems.Add("Select this", null, this._menu_selectThis);
            /* ----------- */ this._mnuPlot.DropDownItems.Add(new ToolStripSeparator());
            /* popout      */ this._mnuPlot.DropDownItems.Add("Popout", Resources.MnuEnlarge, this.menu_popout_Click);
            /* export      */ this._mnuPlot.DropDownItems.Add("Export...", null, this._menu_exportImage);
            /* display:    */ this._mnuSelectionDisplay = (ToolStripMenuItem)this._mnuPlot.DropDownItems.Add("Selection display", null, null);
            /*   custom    */ this._chkShowCustom       = this.AddCheckButton("Custom text", true);
            /*   peak      */ this._chkShowPeak         = this.AddCheckButton("Peak", describePeaks);
            /*   series    */ this._chkShowSeries       = this.AddCheckButton("Series", true);
            /*   group     */ this._chkShowGroup        = this.AddCheckButton("Group", describePeaks);
            /*   replicate */ this._chkShowReplicate    = this.AddCheckButton("Replicate", !describePeaks);
            /*   time      */ this._chkShowTime         = this.AddCheckButton("Time", !describePeaks);
            /*   intensity */ this._chkShowIntensity    = this.AddCheckButton("Intensity", !describePeaks);

            this._btnNavigateToSelected.Font    = new Font(this._btnNavigateToSelected.Font, FontStyle.Bold);
            this._btnNavigateToSelected.Enabled = this._selector != null;
        }