Пример #1
0
        private void ScatterViewItem_ScatterManipulationCompleted
            (object sender, ScatterManipulationCompletedEventArgs e)
        {
            //Console.WriteLine("logging test: ");
            //Console.WriteLine("rotation: " + e.RotationalChange);
            //Console.WriteLine("horizontal: " + e.HorizontalChange + ", h: " + h);
            //Console.WriteLine("vertical: " + e.VerticalChange + ", v: " + v);
            //Console.WriteLine("scale: " + e.ScaleFactor);

            if (e.HorizontalChange > 30 || e.VerticalChange > 30)
            {
                string h = e.HorizontalChange.ToString().Remove(e.HorizontalChange.ToString().IndexOf("."));
                string v = e.VerticalChange.ToString().Remove(e.VerticalChange.ToString().IndexOf("."));
                Logger.Log("drag", String.Concat("gesture h:", h, " v:", v));
            }
            if (e.RotationalChange > 3)
            {
                string r = e.RotationalChange.ToString().Remove(e.RotationalChange.ToString().IndexOf("."));
                Logger.Log("rotate", String.Concat("gesture r:", r));
            }
            if (e.ScaleFactor != 1)
            {
                string scale = e.ScaleFactor.ToString().Length > 5 ? e.ScaleFactor.ToString().Remove(5) : e.ScaleFactor.ToString();
                Logger.Log("resize", String.Concat("gesture ", scale));
            }
        }
 public void Routed_SendToWorkspace_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     if ((((ScatterViewItem)sender).Center.Y > 650)&&!(WorkspaceCollection.Contains(sender)))
     {
         Console.WriteLine("SEND ME TO THE EXTENDED DESKTOP!!!");
         WorkspaceCollection.Add(((ScatterViewItem)sender).DataContext);
         _mainVM.AllObjectsCollection.Remove(((ScatterViewItem)sender).DataContext);
     }
 }
 public void Routed_SendToMain_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     if (((ScatterViewItem)sender).Center.Y < 150)
     {
         Console.WriteLine("SEND ME TO THE MAIN!!!");
         _mainVM.AllObjectsCollection.Add(((ScatterViewItem)sender).DataContext);
         
         _workspaceCollection.Remove(((ScatterViewItem)sender).DataContext);
     }
 }
 /// <summary>
 /// Once the user finishes moving the LEFT highlighter, the temperature of both primers is checked and the display
 /// for both Primers is updated. Variables updated appropriately. 
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void leftHighlight_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     ScatterViewItem highlighter = (ScatterViewItem)sender;
     int width = (int)highlighter.Width;
     width -= width % 10;
     highlighter.Width = width;
     highlighter.Center = new Point(50 + width / 2, highlighter.Center.Y);
     leftLength.Content = (int)(width / 10);
     leftTemp.Content = leftCalculateTemp(leftSequence.Text, (int)(width / 10));
     leftTempResult.Content = updateTempResults(Convert.ToInt16(temp.Content), Convert.ToInt16(leftTemp.Content));
     rightTempResult.Content = leftTempResult.Content;
     //Console.WriteLine(leftGetPrimer(width/10, leftSequence.Text)); 
 }
 /// <summary>
 /// Once the user finishes moving the RIGHT highlighter, the temperature of both primers is checked and the display
 /// for both Primers is updated. Variables updated appropriately. 
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void rightHighlight_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     ScatterViewItem highlighter = (ScatterViewItem)sender;
     int width = (int)highlighter.Width;
     width -= width % 10;
     highlighter.Width = width;
     highlighter.Center = new Point((1024 - 50) - width / 2, highlighter.Center.Y);
     _rightTemp = rightCalculateTemp(rightSequence.Text, (int)(width / 10));
     temp.Content = _rightTemp;
     rightLength.Content = (int)(width / 10); //length
     rightTempResult.Content = updateTempResults(_rightTemp, _leftTemp);
     leftTempResult.Content = rightTempResult.Content;
 }
 private void SendToMain_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     ((ExtendedDesktopViewModel)this.DataContext).Routed_SendToMain_ScatterManipulationCompleted(sender, e);
     workspaceBlockerSVI.Focus();
 }
Пример #7
0
 void svi_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     ScatterViewItem s = (ScatterViewItem)sender;
     int i = -1;
     foreach (ScatterViewItem svi in MyScatterView.Items)
     {
         i = i + 1;
         if (svi == s) continue;
         Boolean k = ScatterViewItemsIntersect(s, svi);
         if (k == true)
         {
             if (svi.Tag.Equals(s.Tag))
             {
                 s.Background = Brushes.LightGreen;
                 svi.Background = Brushes.LightGreen;
                 s.CanMove = false;
                 svi.CanMove = false;
             }
         }
     }
 }
 private void Erase_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     double xPosition = e.ManipulationOrigin.X;
     if (xPosition < _eraseMargin || xPosition > (Width - _eraseMargin)) // check if svi is outside erase margin
     {
         FrameworkElement element = (FrameworkElement) sender;
         _myViewModel.EraseItem(element.DataContext);
     }
 }
 private void searchShelfContainerSVI_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     const int snapMargin = 60; // The distance from the shelf's retracted center that will cause the shelf
                                // to snap into place
     ScatterViewItem item = (ScatterViewItem)sender;
     double y = item.Center.Y;
     SearchShelfViewModel vm = (SearchShelfViewModel)item.DataContext;
     if (y < vm.RetractedCenter.Y + snapMargin)
     {
         vm.RetractShelf();
     }
 }
 private void SendToWorkspace_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     _myViewModel.ExtendedDesktopViewModel.Routed_SendToWorkspace_ScatterManipulationCompleted(sender, e);
 }
 private void workspaceContainerSVI_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     _myViewModel.ExtendedDesktopViewModel.Routed_workspaceContainerSVI_ScatterManipulationCompleted(sender, e);
 }
 public void Routed_workspaceContainerSVI_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
 {
     ScatterViewItem current = (ScatterViewItem)sender;
     if (current.Center.Y < 400)
         current.Center = new Point(512, 380);
     if (current.Center.Y > 1000)
         current.Center = new Point(512, 1115);
 }
        /// <summary>
        /// Authors: Consuelo Valdes and Kelsey Tempel
        /// 
        /// When user has finished moving the orignal BlastResult over, show an expanded information view and animate :)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void BlastPR_ScatterManipulationCompleted(object sender, ScatterManipulationCompletedEventArgs e)
        {
            Console.WriteLine(sender.GetType());
            RealBlastPrimerResult senderSVI = (RealBlastPrimerResult)sender;

            if (!_balloon)
            {
                _balloon = true;

                //outlines selected svi
                this.BorderBrush = Brushes.SeaShell;
                this.BorderThickness = new Thickness(4);

                //creates the info box
                ScatterViewItem svi = new ScatterViewItem();
                svi.Background = Brushes.OliveDrab;
                svi.Opacity = .75;
                svi.Orientation = 0;

                /////////////////////////////////////////////////////////////////////////////////////////
              
                SurfaceTextBox surfaceTextBox = new SurfaceTextBox();
                surfaceTextBox.FontFamily = new FontFamily("Courier New");
                surfaceTextBox.AppendText(senderSVI.toString());
                surfaceTextBox.TextWrapping = TextWrapping.Wrap;
                surfaceTextBox.IsReadOnly = true;
                surfaceTextBox.Width = 250;//Sets the size of the text box so that it wraps

                Grid textGrid = new Grid();
                textGrid.Background = Brushes.White;
                textGrid.Margin = new Thickness(3);
               

                textGrid.Children.Add(surfaceTextBox);


                //set row content for mainWrapperGrid and add all objects appropriately
                

                svi.Content = textGrid;
                ///////////////////////////////////////////////////////////////////////////
                //Grid infoGrid = new Grid();
                //infoGrid.VerticalAlignment = VerticalAlignment.Top;
                //infoGrid.HorizontalAlignment = HorizontalAlignment.Left;
                ////infoGrid.ShowGridLines = true;

                //RowDefinition row1 = new RowDefinition();
                //RowDefinition row2 = new RowDefinition();
                //RowDefinition row3 = new RowDefinition();
                //RowDefinition row4 = new RowDefinition();
                //ColumnDefinition col1 = new ColumnDefinition();

                //row1.Height = new GridLength(35);
                //row2.Height = new GridLength(20);
                //row3.Height = new GridLength(20);
                //row4.Height = new GridLength(20);

                //infoGrid.RowDefinitions.Add(row1);
                //infoGrid.RowDefinitions.Add(row2);
                //infoGrid.RowDefinitions.Add(row3);
                //infoGrid.RowDefinitions.Add(row4);
                //infoGrid.ColumnDefinitions.Add(col1);
                
                //TextBlock headerText = new TextBlock();
                ////headerText.Text = "This is the detailed view for a BLAST result";
                //headerText.Text = "Restriction Enzyme Cut Sites";
                //headerText.TextWrapping = TextWrapping.Wrap; 
                //headerText.FontSize = 12;
                //headerText.TextAlignment = TextAlignment.Center;
                //headerText.FontWeight = FontWeights.Bold; 
                //Grid.SetColumnSpan(headerText, 1);
                //Grid.SetRow(headerText, 0);

                //TextBlock scoreText = new TextBlock();
                ////scoreText.Text = "Score: " + _score;
                //if (Math.Abs(_score) == 92)
                //{
                //    scoreText.Text = "SpeI:";
                //}
                //else if (Math.Abs(_score) == 93)
                //{
                //    scoreText.Text = "XbaI:"; 
                //}
                //else
                //{
                //    scoreText.Text = "EcoRI:";
                //}
                //scoreText.FontSize = 12;
                //Grid.SetColumnSpan(scoreText, 1);
                //Grid.SetRow(scoreText, 1);

                //TextBlock startText = new TextBlock();
                ////startText.Text = "Start: " + _start;
                //if (Math.Abs(_score) == 92)
                //{
                //    startText.Text = " 5'  A | CTAGT  3'";
                //}
                //else if (Math.Abs(_score) == 93)
                //{
                //    startText.Text = " 5'  T | CTAGA  3'";
                //}
                //else
                //{
                //    startText.Text = " 5'  G | AATTC  3'";
                //}
                //startText.FontSize = 12;
                
                //Grid.SetColumnSpan(startText, 1);
                //Grid.SetRow(startText, 2);

                //TextBlock stopText = new TextBlock();
                ////stopText.Text = "Stop: " + _stop;
                //if (Math.Abs(_score) == 92)
                //{
                //    stopText.Text = " 3'  TBATC | A  5'";
                //}
                //else if (Math.Abs(_score) == 93)
                //{
                //    stopText.Text = " 3'  AGATC | T  5'";
                //}
                //else
                //{
                //    stopText.Text = " 3'  CTTAA | G  5'";
                //}
                //stopText.FontSize = 12;
                //Grid.SetColumnSpan(stopText, 1);
                //Grid.SetRow(stopText, 3);

                ScatterViewItem child = (ScatterViewItem)sender;

                svi.Center = child.Center;
                svi.ScatterManipulationDelta += new ScatterManipulationDeltaEventHandler(svi_ScatterManipulationDelta);

               
                ScatterView temp = (ScatterView)child.Parent;
                svi.CanScale = true;
                temp.Items.Add(svi);
                
                //EasingFunction Code 
                Duration duration = new Duration(TimeSpan.FromSeconds(1.0));

                // DoubleAnimation scale x/y
                DoubleAnimation widthAnimation = new DoubleAnimation();
                widthAnimation.Duration = duration;
                DoubleAnimation heightAnimation = new DoubleAnimation();
                heightAnimation.Duration = duration;

                widthAnimation.To = 250;
                widthAnimation.From = 50;
                heightAnimation.To = 150;
                heightAnimation.From = 50;

                Storyboard.SetTargetName(widthAnimation, svi.Name);
                Storyboard.SetTarget(widthAnimation, svi);
                Storyboard.SetTargetProperty(widthAnimation, new PropertyPath(ScatterViewItem.WidthProperty));

                Storyboard.SetTargetName(heightAnimation, svi.Name);
                Storyboard.SetTarget(heightAnimation, svi);
                Storyboard.SetTargetProperty(heightAnimation, new PropertyPath(ScatterViewItem.HeightProperty));

                storyBoard1.Children.Add(heightAnimation);
                storyBoard1.Children.Add(widthAnimation);
                storyBoard1.Begin();
            } // closes  if (!_balloon)

        }