Exemple #1
0
 /// <summary>
 /// Adds a specific interaction to the PlotSurface
 /// </summary>
 /// <param name="interaction">the interaction to add</param>
 public void AddInteraction(Interaction interaction)
 {
     interactions.Add (interaction);
 }
Exemple #2
0
 /// <summary>
 /// Remove a previously added interaction
 /// </summary>
 /// <param name="interaction">interaction to remove</param>
 public void RemoveInteraction(Interaction interaction)
 {
     interactions.Remove (interaction);
 }
Exemple #3
0
 public Sample(TreePosition category, string name, Interaction interaction)
 {
     Category = category;
     Name = name;
     Interaction = interaction;
 }
Exemple #4
0
        void HandleSamplesTreeSelectionChanged(object sender, EventArgs e)
        {
            if (samplesTree.SelectedRow != null) {

                // Remove currentInteraction if there is one
                if (currentInteraction != null) {
                    // must already have a valid plot sample with the interaction added to it
                    PlotSample ps = (PlotSample)currentWidget;
                    PlotCanvas pc = ps.PlotCanvas;
                    // Remove current interaction from PlotCanvas
                    pc.RemoveInteraction (currentInteraction);
                    currentInteraction = null;
                }

                // get newSample from selected row
                TreePosition viewRow = samplesTree.SelectedRow;
                TreeNavigator storeRow = store.GetNavigatorAt (viewRow);
                Sample newSample = storeRow.GetValue (sampleCol);

                TreePosition newCategory = newSample.Category;
                if (newCategory == interactionCategory) {
                    // only allow interaction if there is already a plotSample
                    if (currentCategory == plotCategory) {
                        PlotSample ps = (PlotSample)currentWidget;
                        PlotCanvas pc = ps.PlotCanvas;
                        // Add new interaction to existing PlotCanvas
                        currentInteraction = newSample.Interaction;
                        pc.AddInteraction (currentInteraction);
                    }

                } else {
                    // plotCategory or testCategory
                    currentCategory = newCategory;
                    if (currentWidget != null) {
                        sampleBox.Remove (currentWidget);
                    }
                    if (newSample.Type != null) {
                        currentWidget = (Widget)Activator.CreateInstance (newSample.Type);
                        sampleBox.PackStart (currentWidget, true);
                        Dump (currentWidget, 0);
                    }
                }
            }
        }
Exemple #5
0
        TreePosition AddInteraction(TreePosition category, string name, Interaction interaction)
        {
            Sample sample = new Sample (category, name, interaction);

            TreeNavigator node = store.AddNode (category);
            TreeNavigator nameNavigator = node.SetValue (nameCol, name);
            TreeNavigator iconNavigator = nameNavigator.SetValue (iconCol, icon);
            TreeNavigator sampleNavigator = iconNavigator.SetValue (sampleCol, sample);
            return sampleNavigator.CurrentPosition;
        }
Exemple #6
0
 /// <summary>
 /// Adds a specific interaction to the PlotSurface
 /// </summary>
 /// <param name="interaction">the interaction to add</param>
 public void AddInteraction(Interaction interaction)
 {
     interactions.Add(interaction);
 }
Exemple #7
0
 /// <summary>
 /// Remove a previously added interaction
 /// </summary>
 /// <param name="interaction">interaction to remove</param>
 public void RemoveInteraction(Interaction interaction)
 {
     interactions.Remove(interaction);
 }