Esempio n. 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public TreeMap(System.Windows.Forms.Panel aPanel, GMSDocument aDoc, ParallelCoordinatesPlot aPcPlot)
        {
            iPanel              = aPanel;
            iPanel.SizeChanged += new EventHandler(SizeChanged);
            iPanel.Paint       += new System.Windows.Forms.PaintEventHandler(Paint);
            iToolTip            = new GavToolTip(iPanel);

            iPcPlot = aPcPlot;

            iToolTip.FadeEnable = true;
            iToolTip.FadeTime   = TOOLTIP_FADE_DELAY;
            iToolTip.Show(new Point(0, 0));
            iToolTip.Hide();

            iPanel.MouseLeave           += new EventHandler(MouseHoverControlHoverEnd);
            iMouseHoverControl           = new MouseHoverController(iPanel, 5, TIMER_DELAY);
            iMouseHoverControl.Hover    += new EventHandler(MouseHoverControlHover);
            iMouseHoverControl.HoverEnd += new EventHandler(MouseHoverControlHoverEnd);

            iDoc = aDoc;

            aDoc.ColorMapChanged += new EventHandler <EventArgs>(DocumentColorMapChanged);
            iDoc.Picked          += new EventHandler <IndexesPickedEventArgs>(DocumentPicked);

            iPanel.MouseDown += new MouseEventHandler(MouseDown);
            iSelectedIds      = new List <int>();


            iZoomIn = false;

            UpdateDrawingArea();
        }
Esempio n. 2
0
        public MapPlot(DataCube aDataCube, Panel aDestinationPanel, Renderer aRenderer,
                       ColorMap aColorMap, ParallelCoordinatesPlot aPcPlot, GMSDocument aDoc)
        {
            iDataCube = aDataCube;
            iPanel    = aDestinationPanel;
            renderer  = aRenderer;
            iColorMap = aColorMap;

            iPcPlot         = aPcPlot;
            iDoc            = aDoc;
            iLegendColorMap = iDoc.iFilteredSelectedColorMap;

            SetupMapLayers();

            //Get country names
            iCountryNames = iDoc.GetFilteredCountryNames();

            //Prepare tooltip
            iToolTip            = new GavToolTip(iPanel);
            iToolTip.FadeEnable = true;
            iToolTip.FadeTime   = TOOLTIP_FADE_DELAY;
            iToolTip.Show(new Point(0, 0));
            iToolTip.Hide();

            iMouseHoverControl           = new MouseHoverController(iPanel, TOOLTIP_SENSITIVITY, TIMER_DELAY);
            iMouseHoverControl.Hover    += new EventHandler(iMouseHoverControl_Hover);
            iMouseHoverControl.HoverEnd += new EventHandler(iMouseHoverControl_HoverEnd);

            iDoc.Picked          += new EventHandler <IndexesPickedEventArgs>(DocumentPicked);
            iDoc.ColorMapChanged += new EventHandler <EventArgs>(DocumentColorMapChanged);
        }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void iMouseHoverControl_HoverEnd(object sender, EventArgs e)
 {
     iToolTip.Hide();
 }
Esempio n. 4
0
        public void init()
        {
            //Manage the parallel coordinates plots
            _pcPlotVariables.Input = _mainWindow.DataHandler.MainDataCubeProvider;

            // mark the columns that can be interpolated
            IList <string> colHeaders    = _mainWindow.DataHandler.getColumnHeaders();
            List <string>  markedHeaders = new List <string>();

            for (int i = 0; i < colHeaders.Count; i++)
            {
                if (_mainWindow.DataHandler.InterpolationCols.Contains(i))
                {
                    markedHeaders.Add(String.Concat(colHeaders[i], _interpolationColMarker));
                }
                else
                {
                    markedHeaders.Add(colHeaders[i]);
                }
            }
            _pcPlotVariables.Headers = markedHeaders;

            _resetVarPCAxisColors();
            _pcPlotVariables.HeaderLayer.SelectedHeadersList.Add(MainWindow.PC_VAR_PLOT_INIT_VALUE);
            _pcPlotVariables.MarginRight = 35;

            _pcPlotYears.Input       = _mainWindow.DataHandler.YearDataCubeProvider;
            _pcPlotYears.Headers     = _mainWindow.DataHandler.getYearsAsList();
            _pcPlotYears.MarginRight = 35;
            _mainWindow.DataHandler.YearDataCubeProvider.VarIndex = MainWindow.PC_YEARS_PLOT_INIT_VALUE;
            SetMinMaxYearPC();

            _pcPlotVariables.ColorMap = _mainWindow.ColorMapHandler.MainColorMap;
            _pcPlotYears.ColorMap     = _mainWindow.ColorMapHandler.MainColorMap;

            _mainWindow.yearSlider.Minimum       = 0;
            _mainWindow.yearSlider.Maximum       = DataHandler.EndYear - DataHandler.StartYear;
            _mainWindow.yearSlider.TickFrequency = 1;
            _mainWindow.yearSlider.Value         = 0;

            UpdateVariablePCAxisList();

            // add to SAP manager
            _mainWindow.SaPManager.AddComponent(_pcPlotVariables);
            _mainWindow.SaPManager.AddComponent(_pcPlotYears);

            // add tooltip to pc plt
            _gavToolTip          = new Gav.Management.GavToolTip(_mainWindow);
            _gavToolTip.FadeTime = 150;

            // mouse controllers
            _hoverControllerVar  = new MouseHoverController(_mainWindow.getPCPanelVariables(), 1, 50);
            _hoverControllerYear = new MouseHoverController(_mainWindow.getPCPanelYears(), 1, 50);

            // dont know why I´m doing this but it makes the tooltip show at correct location the first time its called
            _gavToolTip.Show(new System.Drawing.Point(1, 1));
            _gavToolTip.Hide();

            // index visibility manager
            _pcPlotVariables.IndexVisibilityManager = _mainWindow.SharedVisibilityManager;
            _pcPlotYears.IndexVisibilityManager     = _mainWindow.SharedVisibilityManager;

            // selection color
            _pcPlotVariables.LineLayer.SelectedLineColor = _mainWindow.ColorMapHandler.SelectionColor;
            _pcPlotYears.LineLayer.SelectedLineColor     = _mainWindow.ColorMapHandler.SelectionColor;

            // listeners
            _pcPlotVariables.HeaderClicked      += new EventHandler <Gav.Event.IndexClickedEventArgs>(_pcPlotVariables_HeaderClicked);
            _pcPlotVariables.FilterChanged      += new EventHandler(_pcPlotVariables_FilterChanged);
            _pcPlotYears.FilterChanged          += new EventHandler(_pcPlotYears_FilterChanged);
            _pcPlotVariables.ComponentMouseUp   += new EventHandler <System.Windows.Forms.MouseEventArgs>(_pcPlotVariables_ComponentMouseUp);
            _pcPlotYears.ComponentMouseUp       += new EventHandler <System.Windows.Forms.MouseEventArgs>(_pcPlotYears_ComponentMouseUp);
            _mainWindow.yearSlider.ValueChanged += new EventHandler(yearSlider_ValueChanged);
            _hoverControllerVar.Hover           += new EventHandler(_hoverController_Hover_Var);
            _hoverControllerYear.Hover          += new EventHandler(_hoverController_Hover_Year);
            _hoverControllerVar.HoverEnd        += new EventHandler(_hoverController_HoverEnd_Var);
            _hoverControllerYear.HoverEnd       += new EventHandler(_hoverController_HoverEnd_Year);
            _pcPlotYears.Input.Changed          += new EventHandler(_pcPlotYears_Input_Changed);
            _pcPlotVariables.Input.Changed      += new EventHandler(_pcPlotVariables_Input_Changed);

            _mainWindow.varPCReset.Click  += new EventHandler(varPCReset_Click);
            _mainWindow.yearPCReset.Click += new EventHandler(yearPCReset_Click);

            _mainWindow.ShowClustersCheckbox.CheckedChanged += new System.EventHandler(checkBox2_CheckedChanged);
            _mainWindow.numberofClusters.ValueChanged       += new System.EventHandler(numberofClusters_ValueChanged);

            _mainWindow.varPCColZoomIn.Click    += new EventHandler(varPCZoomIn_Click);
            _mainWindow.varPCColResetZoom.Click += new EventHandler(varPCZoomOut_Click);


            // add to view manager
            _mainWindow.ViewManager.Add(_pcPlotVariables, _mainWindow.getPCPanelVariables());
            _mainWindow.ViewManager.Add(_pcPlotYears, _mainWindow.getPCPanelYears());
        }
Esempio n. 5
0
 void _hoverController_HoverEnd_Var(object sender, EventArgs e)
 {
     _gavToolTip.Hide();
 }
Esempio n. 6
0
 private void InitializeGavToolTip()
 {
     //throw new NotImplementedException();
     gavToolTip = new GavToolTip(this);
     gavToolTip.SetPosition(new Point(0,0));
     gavToolTip.ToolTipBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     gavToolTip.Show(new Point(0,0));
     gavToolTip.Hide();
 }
Esempio n. 7
0
 void _hoverController_HoverEnd(object sender, EventArgs e)
 {
     // hide tooltip
     _gavToolTip.Hide();
 }
Esempio n. 8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void MouseHoverControlHoverEnd(object sender, EventArgs e)
 {
     iToolTip.Hide();
     Invalidate();
 }
Esempio n. 9
0
        public void init()
        {
            //add controller for tooltips
            _gavToolTip          = new Gav.Management.GavToolTip(_mainWindow);
            _gavToolTip.FadeTime = 150;
            //create mouse hover controllers
            _hoverController          = new Gav.Graphics.MouseHoverController(_mainWindow.getScatterPanel(), 2, 50);
            _hoverControllerTableLens = new MouseHoverController(_mainWindow.getTableLensPanel(), 2, 50);
            //listeners FOR HOVER controller
            _hoverController.Hover             += new EventHandler(_hoverController_Hover);
            _hoverController.HoverEnd          += new EventHandler(_hoverController_HoverEnd);
            _hoverControllerTableLens.Hover    += new EventHandler(_hoverControllerTableLens_Hover);
            _hoverControllerTableLens.HoverEnd += new EventHandler(_hoverControllerTableLens_HoverEnd);
            // dont know why I´m doing this but it makes the tooltip show at correct location the first time its called
            _gavToolTip.Show(new System.Drawing.Point(1, 1));
            _gavToolTip.Hide();

            //Manage the 2D scatter plot
            _scatterplot.Name         = "ScatterPLot2D";
            _scatterplot.Input        = _mainWindow.DataHandler.MainDataCubeProvider;
            _scatterplot.Enabled      = true;
            _scatterplot.ColorMap     = _mainWindow.ColorMapHandler.MainColorMap;
            _scatterplot.GlyphMinSize = 0.025f;
            _scatterplot.GlyphSize    = 0.025f;

            //init the drop down combo boxes, ie set the possible variables to the list
            _mainWindow.ScatterXaxisValuesSelector.Items.AddRange(_mainWindow.DataHandler.getColumnHeaders().ToArray());
            _mainWindow.ScatterYaxisValuesSelector.Items.AddRange(_mainWindow.DataHandler.getColumnHeaders().ToArray());
            _mainWindow.ScatterSizeSelector.Items.AddRange(_mainWindow.DataHandler.getColumnHeaders().ToArray());

            //init scatterplot labels
            int initX = MainWindow.SCATTER_PLOT_X_INIT_VALUE;
            int initY = MainWindow.SCATTER_PLOT_Y_INIT_VALUE;

            _scatterplot.AxisYText  = "."; //fulis för att få den att inte synas
            _scatterplot.AxisIndexY = initY;
            _mainWindow.ScatterXaxisValuesSelector.SelectedIndex = initX;
            _mainWindow.yAxisLabel.Text    = _mainWindow.ScatterYaxisValuesSelector.Items[initY].ToString();
            _scatterplot.AxisXText         = "."; //fulis för att få den att inte synas
            _scatterplot.AxisIndexX        = initX;
            _scatterplot.ShowGrid          = true;
            _scatterplot.ShowAxisValues    = false;
            _scatterplot.NumberOfGridLines = 8;
            _scatterplot.AxisTextFont      = new System.Drawing.Font(_scatterplot.AxisTextFont.Name, 7.0f);
            _scatterplot.PaddingBottom     = 60;
            _scatterplot.PaddingTop        = 25;
            _mainWindow.ScatterYaxisValuesSelector.SelectedIndex = initY;
            _mainWindow.xAxisLabel.Text = _mainWindow.ScatterYaxisValuesSelector.Items[initX].ToString();


            // init table lens
            _tableLens.Input       = _mainWindow.DataHandler.MainDataCubeProvider;
            _tableLens.HeadersList = _mainWindow.DataHandler.getColumnHeaders();
            _tableLens.ColorMap    = _mainWindow.ColorMapHandler.MainColorMap;
            _tableLens.Enabled     = true;
            _tableLens.HeaderFont  = new System.Drawing.Font(_tableLens.HeaderFont.Name, 7.0f);


            _rowSorter       = new TableLensRowSorter();
            _rowSorter.Input = _mainWindow.DataHandler.MainDataCubeProvider;
            _rowSorter.IndexVisibilityManager = _mainWindow.SharedVisibilityManager;

            // index visibility manager
            _scatterplot.IndexVisibilityManager = _mainWindow.SharedVisibilityManager;
            _tableLens.IndexVisibilityManager   = _mainWindow.SharedVisibilityManager;

            // selection colors
            _scatterplot.SelectedGlyphColor = _mainWindow.ColorMapHandler.SelectionColor;

            // event listeners
            _mainWindow.SaPManager.AddComponent(_tableLens);
            _mainWindow.SaPManager.AddComponent(_scatterplot);
            _mainWindow.ScatterXaxisValuesSelector.SelectedIndexChanged += new EventHandler(ScatterXaxisValuesSelector_SelectedIndexChanged);
            _mainWindow.ScatterYaxisValuesSelector.SelectedIndexChanged += new EventHandler(ScatterYaxisValuesSelector_SelectedIndexChanged);
            _mainWindow.ScatterSizeSelector.SelectedIndexChanged        += new EventHandler(ScatterSizeSelector_SelectedIndexChanged);
            _tableLens.HeaderClicked += new EventHandler(_tableLens_HeaderClicked);

            // add to viewmanager
            _mainWindow.ViewManager.Add(_scatterplot, _mainWindow.getScatterPanel());
            _mainWindow.ViewManager.Add(_tableLens, _mainWindow.getTableLensPanel());
        }