Exemplo n.º 1
0
        private void OnDimensionContentSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            EventDimensionSelector affectedDimensionSelector = GetDimensionSelectorByListBox(sender as ListBox);

            //update internal event selection model
            updateInternalEventSelectionModel(affectedDimensionSelector.Axis, affectedDimensionSelector.ShowedDimension, affectedDimensionSelector.GetSelectedLevelDepth(), affectedDimensionSelector.GetSelectedAggregationDepth(), affectedDimensionSelector.GetSelectedDimensionContent());
        }
Exemplo n.º 2
0
        private void OnQuickSearchTextChanged(object sender, TextChangedEventArgs e)
        {
            EventDimensionSelector affectedDimensionSelector = GetDimensionSelectorByTextBox(sender as TextBox);

            affectedDimensionSelector.UpdateByQuickSearchChanged();

            //update internal event selection model
            updateInternalEventSelectionModel(affectedDimensionSelector.Axis, affectedDimensionSelector.ShowedDimension, affectedDimensionSelector.GetSelectedLevelDepth(), affectedDimensionSelector.GetSelectedAggregationDepth(), affectedDimensionSelector.GetSelectedDimensionContent());
        }
Exemplo n.º 3
0
 /// <summary>
 /// Looks if the given dimension is also selected by another selector as the given one.
 /// <param name="showingDimensionSelector">Selector which currently show the dimension.</param>
 /// <param name="dimension">Dimension to look for.</param>
 /// </summary>
 private bool IsAlreadySelected(EventDimensionSelector showingDimensionSelector, Dimension dimension)
 {
     foreach (EventDimensionSelector dimSelector in _listOfDimensionSelectors)
     {
         if (dimSelector.DimensionComboBox.SelectedItem == dimension && dimSelector != showingDimensionSelector)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Builds an EventDimensionSelector for each event dimension.
        /// </summary>
        private void BuildEventDimensionsSelectors()
        {
            //reset gui
            EventDimensionList.Children.Clear();

            //clear the the internal representation of the selected dimensions
            EventSelectionModel.GetInstance().Clear();

            _listOfDimensionSelectors = new List <EventDimensionSelector>();

            if (DBWorker.MetaData == null || DBWorker.MetaData.ListOfEventDimensions == null || DBWorker.MetaData.ListOfEventDimensions.Count == 0)
            {
                TextBlock textBlock = new TextBlock {
                    Text = "No events available."
                };
                EventDimensionList.Children.Add(textBlock);
                return;
            }

            //build EventDimensionSelector for each event dimension
            for (int i = 0; i < DBWorker.MetaData.ListOfEventDimensions.Count; i++)
            {
                //skip empty dimension
                if (DBWorker.MetaData.ListOfEventDimensions[i].IsEmptyDimension)
                {
                    continue;
                }

                //create EventDimensionSelector for dimension
                int axis = i + 1;
                EventDimensionSelector dimSelector = new EventDimensionSelector(axis);
                dimSelector.Init(DBWorker.MetaData.ListOfEventDimensions, DBWorker.MetaData.ListOfEventDimensions[i]);
                _listOfDimensionSelectors.Add(dimSelector);

                //add selector to panel
                EventDimensionList.Children.Add(dimSelector.DimensionSelectorGrid);
            }

            //build internal representation of the selected dimensions
            foreach (EventDimensionSelector dimSelector in _listOfDimensionSelectors)
            {
                int       axis                     = dimSelector.Axis;
                Dimension dim                      = dimSelector.ShowedDimension;
                int       levelDepth               = dimSelector.GetSelectedLevelDepth();
                int       aggregationDepth         = dimSelector.GetSelectedAggregationDepth();
                List <DimensionContent> dimContent = dimSelector.GetSelectedDimensionContent();
                EventSelectionModel.GetInstance().AddSelectedDimension(new SelectedDimension(axis, dim, levelDepth, aggregationDepth - 1, true, dimContent, true));
            }

            InitEventListener();
        }
Exemplo n.º 5
0
        private void OnDimensionSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // EventDimensionSelector which changed its dimension
            EventDimensionSelector affectedDimensionSelector = GetDimensionSelectorByComboBox(sender as ComboBox);

            // previously selected dimension
            Dimension previouslySelectedDimension = affectedDimensionSelector.ShowedDimension;

            //new selected dimension
            ComboBox comboBox = sender as ComboBox;

            if (comboBox != null)
            {
                Dimension newSelectedDimension = (Dimension)comboBox.SelectedItem;

                //update the affected DimensionSelector
                affectedDimensionSelector.UpdateByDimensionChange(newSelectedDimension);

                //look if the new selected dimension is also
                //showed by another DimensionSelector
                if (IsAlreadySelected(affectedDimensionSelector, newSelectedDimension))
                {
                    // get all EventDimensionSelectors which showing the new selected dimension
                    List <EventDimensionSelector> showingSelectors = GetShowingDimensionSelectors(newSelectedDimension);

                    foreach (EventDimensionSelector dimSelector in showingSelectors)
                    {
                        //find the DimensionSelector which shows the new selected dimension and is
                        //not the showingDimensionSelector
                        if (dimSelector != affectedDimensionSelector)
                        {
                            //set dimension to the previously selected dimension of the affected DimensionSelector
                            dimSelector.DimensionComboBox.SelectedItem = previouslySelectedDimension;
                            updateInternalEventSelectionModel(dimSelector.Axis, dimSelector.ShowedDimension, dimSelector.GetSelectedLevelDepth(), dimSelector.GetSelectedAggregationDepth(), dimSelector.GetSelectedDimensionContent());
                        }
                    }
                }
            }

            //update internal event selection model
            updateInternalEventSelectionModel(affectedDimensionSelector.Axis, affectedDimensionSelector.ShowedDimension, affectedDimensionSelector.GetSelectedLevelDepth(), affectedDimensionSelector.GetSelectedAggregationDepth(), affectedDimensionSelector.GetSelectedDimensionContent());
        }
Exemplo n.º 6
0
        private void OnSelectNone(object sender, RoutedEventArgs e)
        {
            EventDimensionSelector affectedDimensionSelector = GetDimensionSelectorByButton(sender as Button);

            affectedDimensionSelector.DimensionContentFilter.UnselectAll();
        }