public void Routed_workspaceContainerSVI_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
 {
     ScatterViewItem current = (ScatterViewItem)sender;
     if (e.ManipulationOrigin.Y > 20)
     {
         current.Center = new Point(512, current.Center.Y);
     }
     _workspaceCenter = current.Center;
 }
예제 #2
0
        private void ScatterViewItem_ScatterManipulationDelta
            (object sender, ScatterManipulationDeltaEventArgs e)
        {
            // Get a reference to the ScatterViewItem item.
            ScatterViewItem item = (ScatterViewItem)e.Source;

            //Console.WriteLine("width: " + item.ActualWidth);
            //Console.WriteLine("heigth: " + item.ActualHeight);

            if (item.ActualWidth <= 100)
            {
                Control_Minimized(this, new MinimizeEventArgs(((DeviceControl)item.Content).device, MinimizeEventType.Minimized, item.Center));
                Logger.Log("minimize", "size reduce");
                item.Width  = 156;
                item.Height = 309;
                e.Handled   = true;
                return;
            }

            if (item.ActualWidth >= 600)
            {
                Maximize(item);
            }

            int dist = 10;
            int minX = 0 + dist;
            int minY = 0 + dist;
            int maxX = 1024 - dist;
            int maxY = 768 - dist;

            if (item.Center.X < minX || item.Center.X > maxX || item.Center.Y < minY || item.Center.Y > maxY)
            {
                Control_Minimized(this, new MinimizeEventArgs(((DeviceControl)item.Content).device, MinimizeEventType.Minimized, CalculateEdgePosition(item.Center)));
                Logger.Log("minimize", "off edge");
                e.Handled = true;
                return;
            }
            e.Handled = true;
        }
     /// <summary>
     /// Makes the Results move with their genome. 
     /// 
     /// </summary>
     /// <param name="sender"></param>
     /// <param name="e"></param>
     private void chromosomeManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
     {
         ScatterViewItem senderSVI = (ScatterViewItem)sender;
         ProBlastResultUC chromosome = (ProBlastResultUC)senderSVI.Content;
         
         
         foreach(ResultSVI result in chromosome.results){
             if (result != null)
             {
                 ScatterViewItem resultSVI = (ScatterViewItem)blastScatterView.ContainerFromElement(result);
                 resultSVI.Center = new Point(senderSVI.Center.X + result.displaceX, senderSVI.Center.Y + result.displaceY);
             }
             }
 }
        /// <summary>
        /// Adjusts the look of the RIGHT highlighted field as the users moves it back and forth. Also updates the
        /// tests so that the empty box appears except for temperature, which it calculates. Also gives live 
        /// display of Gibbs Free Energy, length, and temperature. 
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void rightHighlight_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
        {
            double deltaX = e.HorizontalChange;
            double deltaY = e.VerticalChange;
            ScatterViewItem highlighter = (ScatterViewItem)sender;

            double newWidth = highlighter.Width - deltaX;
            if (newWidth <= 400 && newWidth > 100)
            {
                highlighter.Center = new Point(highlighter.Center.X - deltaX / 2, highlighter.Center.Y - deltaY);
                highlighter.Width -= deltaX;
            }
            else
            {
                highlighter.Center = new Point(highlighter.Center.X - deltaX, highlighter.Center.Y - deltaY);
            }

            //resets label to empty box
            rightBlastResult.Content = "x";
            rightHairpinResult.Content = "x";
            rightSelfDimerResult.Content = "x";
            rightHeteroDimerResult.Content = "x";

            //calculates temperature and updates display
            _rightTemp = rightCalculateTemp(rightSequence.Text, (int)(newWidth / 10));
            temp.Content = _rightTemp;

            //updates _rightPrimer 
            _rightPrimer = rightGetPrimer((int)newWidth / 10, rightSequence.Text);

            // keeps highlighter above 10bp
            if (newWidth / 10 < 10)
                newWidth = 100;
            rightLength.Content = (int)(newWidth / 10); //length

            //calculates Gibbs Free and updates display
            _rightGibbsFree = calcDeltaG(_rightPrimer);
            rightGibbsFree.Content = _rightGibbsFree;
        }
        //backup baloon animation

        //void resultSVI_PreviewContactDown(object sender, ContactEventArgs e)
        //{
        //    ScatterViewItem senderSVI = (ScatterViewItem)sender;
        //    ResultSVI resultSVI = (ResultSVI)senderSVI.Content;
        //    if (!resultSVI._balloon) //if a balloon doesn't already exist
        //    {
        //        resultSVI._balloon = true;

        //        //outlines selected svi
        //        resultSVI.BorderBrush = Brushes.SeaShell;
        //        resultSVI.BorderThickness = new Thickness(3);

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

        //        Grid infoGrid = new Grid();
        //        infoGrid.VerticalAlignment = VerticalAlignment.Top;
        //        infoGrid.HorizontalAlignment = HorizontalAlignment.Left;

        //        //create rows and single column
        //        RowDefinition row1 = new RowDefinition();
        //        RowDefinition row2 = new RowDefinition();
        //        RowDefinition row3 = new RowDefinition();
        //        RowDefinition row4 = new RowDefinition();
        //        RowDefinition row5 = new RowDefinition();
        //        ColumnDefinition col1 = new ColumnDefinition();

        //        //edit heights of information to be displayed
        //        row1.Height = new GridLength(35);
        //        row2.Height = new GridLength(15);
        //        row3.Height = new GridLength(15);
        //        row4.Height = new GridLength(15);
        //        row5.Height = new GridLength(15);

        //        // add rows and column to the infoGrid contained in the SVI
        //        infoGrid.RowDefinitions.Add(row1);
        //        infoGrid.RowDefinitions.Add(row2);
        //        infoGrid.RowDefinitions.Add(row3);
        //        infoGrid.RowDefinitions.Add(row4);
        //        infoGrid.RowDefinitions.Add(row5);
        //        infoGrid.ColumnDefinitions.Add(col1);

        //        //get sender, ResultSVI
        //        ScatterViewItem resultSVIWrapper = (ScatterViewItem)sender;
        //        ResultSVI result = (ResultSVI)resultSVIWrapper.Content;

        //        //text for notecard
        //        TextBlock headerText = new TextBlock();
        //        headerText.Text = " Detailed BLAST Result";
        //        headerText.TextWrapping = TextWrapping.Wrap;
        //        headerText.FontSize = 12;
        //        headerText.TextAlignment = TextAlignment.Center;
        //        headerText.FontWeight = FontWeights.Bold;
        //        Grid.SetColumnSpan(headerText, 1);
        //        Grid.SetRow(headerText, 0);
        //        infoGrid.Children.Add(headerText);

        //        TextBlock startText = new TextBlock();
        //        startText.Text = " Start: " + result.GetHitStart();
        //        startText.FontSize = 12;
        //        startText.TextAlignment = TextAlignment.Left;
        //        Grid.SetColumnSpan(startText, 1);
        //        Grid.SetRow(startText, 1);
        //        infoGrid.Children.Add(startText);

        //        TextBlock lengthText = new TextBlock();
        //        double length = result.GetHitStop() - result.GetHitStart();
        //        lengthText.Text = " Length: " + length;
        //        lengthText.FontSize = 12;
        //        lengthText.TextAlignment = TextAlignment.Left;
        //        Grid.SetColumnSpan(lengthText, 1);
        //        Grid.SetRow(lengthText, 2);
        //        infoGrid.Children.Add(lengthText);

        //        TextBlock eValText = new TextBlock();
        //        eValText.Text = " E-Val " + result.GetEvalue();
        //        eValText.FontSize = 12;
        //        eValText.TextAlignment = TextAlignment.Left;
        //        Grid.SetColumnSpan(eValText, 1);
        //        Grid.SetRow(eValText, 3);
        //        infoGrid.Children.Add(eValText);

        //        TextBlock scoreText = new TextBlock();
        //        scoreText.Text = " Score " + result.GetScore();
        //        scoreText.FontSize = 12;
        //        scoreText.TextAlignment = TextAlignment.Left;
        //        Grid.SetColumnSpan(scoreText, 1);
        //        Grid.SetRow(scoreText, 4);
        //        infoGrid.Children.Add(scoreText);

        //        double start = resultSVI.GetHitStart();
        //        double score = resultSVI.GetScore();

        //        svi.Content = infoGrid;
        //        svi.Center = senderSVI.Center;

        //        ScatterViewItem child = (ScatterViewItem)sender;
        //        ScatterView temp = (ScatterView)child.Parent;
        //        temp.Items.Add(svi);



        //        // Animation for making notecard appear
        //        //EasingFunction Code 
        //        Duration duration = new Duration(TimeSpan.FromSeconds(1.0));

        //        //Make width animation and height animation
        //        DoubleAnimation widthAnimation = new DoubleAnimation();
        //        widthAnimation.Duration = duration;
        //        DoubleAnimation heightAnimation = new DoubleAnimation();
        //        heightAnimation.Duration = duration;

        //        // give starting and stopping x and y values for animation
        //        widthAnimation.To = 100;
        //        widthAnimation.From = 100;
        //        heightAnimation.To = 100;
        //        heightAnimation.From = 50;

        //        // Tell storyboards which animation is happening to which item
        //        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));

        //        // add and begin animations
        //        storyBoard1 = new Storyboard();
        //        storyBoard1.Children.Add(heightAnimation);
        //        storyBoard1.Children.Add(widthAnimation);
        //        storyBoard1.Begin();
        //    }//closes if
        //}backup animation


        /// <summary>
        /// Adjusts the look of the LEFT highlighted field as the users moves it back and forth. Also updates the
        /// tests so that the empty box appears except for temperature, which it calculates. Also gives live 
        /// display of Gibbs Free Energy, length, and temperature. 
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void leftHighlight_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
        {
            //tracks changes occuring with the highlighter
            double deltaX = e.HorizontalChange;
            double deltaY = e.VerticalChange;
            ScatterViewItem highlighter = (ScatterViewItem)sender;
            double newWidth = highlighter.Width + deltaX;
            if (newWidth <= 400 && newWidth > 100)
            {
                highlighter.Center = new Point(highlighter.Center.X - deltaX / 2, highlighter.Center.Y - deltaY);
                highlighter.Width = newWidth;
            }
            else
            {
                highlighter.Center = new Point(highlighter.Center.X - deltaX, highlighter.Center.Y - deltaY);
            }

            // reset labels to empty box
            leftBlastResult.Content = "x";
            leftHairpinResult.Content = "x";
            leftSelfDimerResult.Content = "x";
            leftHeteroDimerResult.Content = "x";

            // keep primer above 10bp
            if (newWidth / 10 < 10)
                newWidth = 100;
            leftLength.Content = (int)(newWidth / 10);

            //calculate left temp, display results
            _leftTemp = leftCalculateTemp(leftSequence.Text, (int)(newWidth / 10));
            leftTemp.Content = _leftTemp;

            // set _leftPrimer instance variable
            _leftPrimer = leftGetPrimer((int)newWidth / 10, leftSequence.Text);

            //calculate Gibbs Free energy, display results
            _leftGibbsFree = calcDeltaG(_leftPrimer);
            leftGibbsFree.Content = _leftGibbsFree;
        }
        private void ScatterViewItem_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
        {
            List<ClientIdentity> CurrentHoveringClients = UIHelper.StreamingClientsOverUIElement(MyElip);
            List<ClientIdentity> ToBeAdded = new List<ClientIdentity>();
            List<ClientIdentity> ToBeRemoved = new List<ClientIdentity>();
            // for each!
            // If I don't know them, add them
            foreach (ClientIdentity id in CurrentHoveringClients)
            {
                // Those I don't know - handle them as if I got HoverOver event
                if (!_HoveringClientIdentities.ContainsKey(id))
                    ToBeAdded.Add(id);
            }

            // Those I know but aren't there handle them as if I got HoverOut event.
            foreach (ClientIdentity id in _HoveringClientIdentities.Keys)
            {
                // Those I know, but isn't above anymore, remove!
                if (!CurrentHoveringClients.Contains(id))
                    ToBeRemoved.Add(id);
            }
            foreach (ClientIdentity id in ToBeAdded)
            {
                AddIdentityHovering(id);
            }

            foreach (ClientIdentity id in ToBeRemoved)
            {
                RemoveIdentityHovering(id);
            }
        }
        private void searchShelfContainerSVI_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
        {

            ScatterViewItem item = (ScatterViewItem)sender;
            SearchShelfViewModel vm = (SearchShelfViewModel)item.DataContext;
            double y = item.Center.Y;
            y = Math.Max(y, vm.RetractedCenter.Y);
            y = Math.Min(y, _searchShelfMaxY);
            item.Center = new Point(CenterX, y);

            HideGeneInfoMenu();
        }
 private void workspaceContainerSVI_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
 {
     _myViewModel.ExtendedDesktopViewModel.Routed_workspaceContainerSVI_ScatterManipulationDelta(sender, e);
 }
        /// <summary>
        /// Handles the ScatterManipulationDelta event of the ScatterViewItem control. If the SVI is scaled down, restore the content to its original scale.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Microsoft.Surface.Presentation.Controls.ScatterManipulationDeltaEventArgs"/> instance containing the event data.</param>
        private void ScatterViewItem_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
        {
            if (e == null || _springScaleX == null || _springScaleY == null || _springTranslateX == null || _springTranslateY == null)
            {
                return;
            }

            if (e.ScaleFactor < 1 && _overridingScatterViewItem)
            {
                // If the SVI is scaled down and this control is stealing contacts, restore the size of the content and stop taking over.
                _springScaleX.To = _springScaleY.To = 1;
                _springTranslateX.To = _springTranslateY.To = 0;
                _spring.Begin(this, true);
                _overridingScatterViewItem = false;
            }
        }
        /// <summary>
        /// AUTHORS: Kelsey Tempel, Consuelo Valdes
        /// 
        /// Adds bar showing results match on thing being blasted against.
        /// Adds a connecting bar betweent the match and the result. 
        /// 
        /// Make as touched so we don't have useless memory waste.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void blastResultSVI_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
        {
            RealBlastPrimerResult child = (RealBlastPrimerResult)sender;            
 
        }
 void svi_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
 {
     //throw new NotImplementedException(); 
    // Console.WriteLine("I moved");
 }
예제 #12
0
 private void bill_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
 {
     MyPrivateIdentifiedViewPort.Moved();
 }
 private void ScatterViewItem_ScatterManipulationDelta(object sender, ScatterManipulationDeltaEventArgs e)
 {
     MyIdentifiedViewPort.Moved();
 }