Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string dir         = Directory.GetCurrentDirectory();
            string iDataPath   = "\\..\\..\\..\\data\\";
            string iDBFileName = "dbEurope.bin";

            renderer = new Renderer(this);
            doc      = new GMSDocument();
            doc.ReadDB(dir + iDataPath + iDBFileName);
            doc.SetupFilteredData("countries_acronyms_europe.txt");
            doc.SetupSortedData();

            pcCountries = new ParallelPlotCountries(doc.GetFilteredDataCube()
                                                    , doc.GetFilteredCountryNames()
                                                    , panel1
                                                    , renderer
                                                    , doc.iFilteredColorMap
                                                    , doc
                                                    , GetGroupBox()
                                                    );

            mapPlot = new MapPlot(doc.GetFilteredDataCube()
                                  , PCMapSplitContainer.Panel1
                                  , renderer
                                  , doc.iFilteredColorMap
                                  , pcCountries.iPcPlot
                                  , doc
                                  );


            // Initialize Tree Map
            iTreeMap = new TreeMap(mainSplitContainer.Panel2, doc, pcCountries.iPcPlot);

            int quantitativeDataIndex, ordinalDataIndex, idIndex, leafNodeIndex;
            List <GMSToolTipComponent> toolTipComponents = new List <GMSToolTipComponent>();

            // Build the TreeMap Data << Countries releases per Styles >>
            object[, ,] data = doc.BuildStylesAreasTree(out quantitativeDataIndex,
                                                        out ordinalDataIndex, out idIndex, out leafNodeIndex, toolTipComponents);

            iTreeMap.SetData(data, quantitativeDataIndex, ordinalDataIndex, idIndex,
                             leafNodeIndex, toolTipComponents);

            iTreeMap.UpdateScale();
            iTreeMap.ColorMap = doc.iFilteredColorMap;
            pcCountries.iPcPlot.FilterChanged += new EventHandler(pcPlot_FilterChanged);

            this.glyphPanel.Show();
            this.ShowInformationBox();
        }