Ejemplo n.º 1
0
        private Dictionary<String, int> TermFreq; // Frecuencia de los términos en todo el corpus de tweets. Se carga desde la base de datos al inicializar y se va actualizando al aparecer tweets nuevos.

        #endregion Fields

        #region Constructors

        public TweetAnalyzer(IObjectContainer database, Core core)
        {
            this.Core = core;
            this.db = database;
            cantTweets = 0;
            TermFreq = new Dictionary<String, int>();
            Initialize();
        }
Ejemplo n.º 2
0
        public FormMainWindow()
        {
            InitializeComponent();

            #region CLOUD CONTROL
            try
            {
                cloud = new CloudControl();
                this.cloud.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                            | System.Windows.Forms.AnchorStyles.Left)
                            | System.Windows.Forms.AnchorStyles.Right)));
                this.cloud.BorderStyle = System.Windows.Forms.BorderStyle.None;
                this.cloud.Font = new System.Drawing.Font("Verdana", 8, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.cloud.LayoutType = Gma.CodeCloud.Controls.LayoutType.Spiral;
                this.cloud.Location = new System.Drawing.Point(16, 16);
                this.cloud.BackColor = Color.Beige;
                this.cloud.MaxFontSize = 24;
                this.cloud.MinFontSize = 8;
                this.cloud.Name = "cloudControl";
                this.cloud.Palette = new System.Drawing.Color[] {  System.Drawing.Color.LightGray};
                this.cloud.Size = new System.Drawing.Size(484, 500);
                this.cloud.TabIndex = 6;
                this.cloud.WeightedWords = null;
                this.cloud.Click += this.CloudControlClick;
                this.cloud.Enabled = false;

                // this.cloud.Click += new System.EventHandler();

                this.Controls.Add(cloud);
            }
            catch (Exception e)
            {
                Console.Out.WriteLine(e.Message);
            }
            #endregion
            buildingCloud = false;

            core = new Core();
            core.InitListen();

            Type tp = tableLayoutPanel1.GetType().BaseType;
            System.Reflection.PropertyInfo pi =
                tp.GetProperty("DoubleBuffered",
                System.Reflection.BindingFlags.Instance
                | System.Reflection.BindingFlags.NonPublic);
            pi.SetValue(tableLayoutPanel1, true, null);

            // Map
            mapInit = false;
            Argentina = new PointLatLng(-40.4, -63.6);
            InitMap();

            cloudWorker = new BackgroundWorker();

            worker = new BackgroundWorker();
            worker.DoWork += new DoWorkEventHandler(core.StartStream);
            worker.RunWorkerCompleted += workCompleted;
            worker.RunWorkerAsync();

            ifaceTimer = new System.Timers.Timer();
            ifaceTimer.Interval = core.TS_quick.TotalMilliseconds;
            ifaceTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnIFaceTimer);
            ifaceTimer.SynchronizingObject = this;
            ifaceTimer.Start();

            this.comboBoxTime.SelectedIndex = 0;
        }