public IsotopeDistributionForm(Workspace workspace)
     : base(workspace)
 {
     InitializeComponent();
     _msGraphControl = new MSGraphControlEx {Dock = DockStyle.Fill};
     _msGraphControl.GraphPane.XAxis.Title.Text = "M/Z";
     _msGraphControl.GraphPane.YAxis.Title.Text = "Intensity";
     colMass.DefaultCellStyle.Format = "0.######";
     colIntensity.DefaultCellStyle.Format = "0.######";
     splitContainer1.Panel2.Controls.Add(_msGraphControl);
 }
Exemplo n.º 2
0
        public OpenDataSourceDialog()
        {
            InitializeComponent();

            listViewColumnSorter = new ListViewColumnSorter();
            listView.ListViewItemSorter = listViewColumnSorter;

            DialogResult = DialogResult.Cancel;

            string[] sourceTypes = new string[]
            {
                "Any spectra format",
				"mzML",
				//"mzData",
				"mzXML",
                "mz5",
				"Thermo RAW",
                "Waters RAW",
				"ABSciex WIFF",
				//"Bruker/Agilent YEP",
                //"Bruker BAF",
                //"Bruker FID",
                "Bruker Analysis",
                "Agilent MassHunter",
				"Mascot Generic",
                "Bruker Data Exchange",
				//"Sequest DTA"
            };

            sourceTypeComboBox.Items.AddRange( sourceTypes );
            sourceTypeComboBox.SelectedIndex = 0;

            ImageList smallImageList = new ImageList();
            smallImageList.ColorDepth = ColorDepth.Depth32Bit;
            smallImageList.Images.Add( Properties.Resources.folder );
            smallImageList.Images.Add( Properties.Resources.file );
            smallImageList.Images.Add( Properties.Resources.DataProcessing );
            listView.SmallImageList = smallImageList;

            TreeView tv = new TreeView();
            tv.Indent = 8;
            TreeNode lookInNode = tv.Nodes.Add( "My Recent Documents", "My Recent Documents", 0, 0 );
            lookInNode.Tag = lookInNode.Text;
            lookInComboBox.Items.Add( lookInNode );
            TreeNode desktopNode = tv.Nodes.Add( "Desktop", "Desktop", 1, 1 );
            desktopNode.Tag = desktopNode.Text;
            lookInComboBox.Items.Add( desktopNode );
            lookInNode = desktopNode.Nodes.Add( "My Documents", "My Documents", 2, 2 );
            lookInNode.Tag = lookInNode.Text;
            lookInComboBox.Items.Add( lookInNode );
            TreeNode myComputerNode = desktopNode.Nodes.Add( "My Computer", "My Computer", 3, 3 );
            myComputerNode.Tag = myComputerNode.Text;
            lookInComboBox.Items.Add( myComputerNode );
            lookInComboBox.SelectedIndex = 1;
            lookInComboBox.IntegralHeight = false;
            lookInComboBox.DropDownHeight = lookInComboBox.Items.Count * lookInComboBox.ItemHeight + 2;

            ticGraphControl = new MSGraphControl()
            {
                Dock = DockStyle.Fill,
            };
            ticGraphControl.GraphPane.Legend.IsVisible = false;
            ticGraphControl.Visible = false;
            splitContainer1.Panel2.Controls.Add( ticGraphControl );
            splitContainer1.Panel2Collapsed = false;
        }
Exemplo n.º 3
0
        public SpectrumViewer(string filename, object index, string interpretation)
        {
            // Prepare the annotation
            annotation = new PeptideFragmentationAnnotation(interpretation, 1, 2, false, true, false, false, true, false, false, true, false, true);
            annotation.OptionsPanel.Dock = DockStyle.None;
            annotation.OptionsPanel.Dock = DockStyle.Fill;

            // Get the mass spectrum
            spectrum = SpectrumCache.GetMassSpectrum(filename,index);
            if(spectrum == null)
                return;

            // Add annotation to the mass spectrum and get a new graph control
            spectrum.AnnotationList.Clear();
            spectrum.AnnotationList.Add((IAnnotation)annotation);
            graph = new MSGraphControl();
            graph.AddGraphItem(graph.GraphPane, spectrum);
            graph.Dock = DockStyle.Fill;
  

            // Create new panels and add the graph and annotations
            spectrumPanel = new Panel();
            spectrumPanel.Controls.Add(graph);
            spectrumPanel.Dock = DockStyle.None;
            spectrumPanel.Dock = DockStyle.Fill;
            annotationPanel = new Panel();
            annotationPanel.Controls.Add(annotation.OptionsPanel);
            annotationPanel.Dock = DockStyle.None;
            annotationPanel.Dock = DockStyle.Fill;
            fragmentationPanel = new Panel();
            annotation.FragmentInfoGridView.Location = new Point(0,0);
            annotation.FragmentInfoGridView.ScrollBars = ScrollBars.Both;
            annotation.FragmentInfoGridView.Dock = DockStyle.None;
            annotation.FragmentInfoGridView.Dock = DockStyle.Fill;
            annotation.FragmentInfoGridView.BorderStyle = BorderStyle.FixedSingle;
            fragmentationPanel.Controls.Add(annotation.FragmentInfoGridView);
            fragmentationPanel.Dock = DockStyle.None;
            fragmentationPanel.Dock = DockStyle.Fill;

            // Add the call back for refreshing
            annotation.OptionsChanged += new EventHandler(OnOptionsChanged);
        }
Exemplo n.º 4
0
 private MSGraphPane InsertMsGraphPane(MSGraphControl graphControl, int iInsert)
 {
     var pane = new MSGraphPane
     {
         Border = { IsVisible = false },
         AllowCurveOverlap = true,
     };
     ApplySettingsToGraphPane(pane);
     var primaryPane = graphControl.GraphPane;
     pane.CurrentItemType = primaryPane.CurrentItemType;
     pane.ZoomStack.AddRange(primaryPane.ZoomStack);
     var zoomState = new ZoomState(primaryPane, ZoomState.StateType.Zoom);
     zoomState.ApplyState(pane);
     pane.YAxis.Title.Text = primaryPane.YAxis.Title.Text;
     pane.XAxis.Title.Text = primaryPane.XAxis.Title.Text;
     graphControl.MasterPane.PaneList.Insert(iInsert, pane);
     return pane;
 }
Exemplo n.º 5
0
 public MSGraphPane GetOrCreateGraphPane(MSGraphControl graphControl, PaneKey graphPaneKey)
 {
     var pane = GetGraphPane(graphControl, graphPaneKey);
     if (null != pane)
     {
         return pane;
     }
     if (GraphPaneKeys.Count == 0)
     {
         GraphPaneKeys.Add(graphPaneKey);
         pane = graphControl.GraphPane;
         ApplySettingsToGraphPane(pane);
         return pane;
     }
     int index = GraphPaneKeys.BinarySearch(graphPaneKey);
     int iInsert = ~index;
     var graphPane = InsertMsGraphPane(graphControl, iInsert);
     GraphPaneKeys.Insert(iInsert, graphPaneKey);
     using (var graphics = graphControl.CreateGraphics())
     {
         graphControl.MasterPane.SetLayout(graphics, PaneLayout.SingleColumn);
     }
     return graphPane;
 }
Exemplo n.º 6
0
 public MSGraphPane GetGraphPane(MSGraphControl graphControl, PaneKey graphPaneKey)
 {
     if (!AllowSplitPanes)
     {
         return graphControl.GraphPane;
     }
     int index = GraphPaneKeys.BinarySearch(graphPaneKey);
     if (index >= 0)
     {
         return (MSGraphPane) graphControl.MasterPane.PaneList[index];
     }
     return null;
 }
Exemplo n.º 7
0
 public static GraphHelper Attach(MSGraphControl msGraphControl)
 {
     GraphHelper graphHelper = new GraphHelper(msGraphControl);
     msGraphControl.MasterPane.Border.IsVisible = false;
     msGraphControl.GraphPane.Border.IsVisible = false;
     msGraphControl.GraphPane.AllowCurveOverlap = true;
     return graphHelper;
 }
Exemplo n.º 8
0
 public GraphHelper(MSGraphControl msGraphControl)
 {
     GraphControl = msGraphControl;
     _displayState = new ErrorDisplayState();
 }