Пример #1
0
 public void AddGlowView(string identifier, GlowView glowView)
 {
     if (!glowList.ContainsKey(identifier))
     {
         glowList.Add(identifier, glowView);
     }
 }
Пример #2
0
        public void UpdateGlows(GlowView[] glowViews)
        {
            Dispatcher.Invoke(new Action(() =>
            {
                List<GlowView> tobeRemoved = new List<GlowView>();
                foreach (System.Windows.UIElement ele in this.Children)
                {
                    GlowView gv = ele as GlowView;
                    if (gv.GetRanking() == 0)
                    {
                        tobeRemoved.Add(gv);
                    }
                }
                foreach (GlowView gv in tobeRemoved)
                {
                    this.Children.Remove(gv);
                }
                foreach (GlowView glow in glowViews)
                {
                    if (glow.GetRanking() > 0)
                    {
                        if (!this.Children.Contains(glow))
                        {
                            this.Children.Add(glow);
                        }
                    }
                }

            }), System.Windows.Threading.DispatcherPriority.Render);
        }
Пример #3
0
 public void UpdateGlows(GlowView[] glowViews)
 {
     Dispatcher.Invoke(new Action(() =>
     {
         List <GlowView> tobeRemoved = new List <GlowView>();
         foreach (System.Windows.UIElement ele in this.Children)
         {
             GlowView gv = ele as GlowView;
             if (gv.GetRanking() == 0)
             {
                 tobeRemoved.Add(gv);
             }
         }
         foreach (GlowView gv in tobeRemoved)
         {
             this.Children.Remove(gv);
         }
         foreach (GlowView glow in glowViews)
         {
             if (glow.GetRanking() > 0)
             {
                 if (!this.Children.Contains(glow))
                 {
                     this.Children.Add(glow);
                 }
             }
         }
     }), System.Windows.Threading.DispatcherPriority.Render);
 }
Пример #4
0
 internal void Initialize()
 {
     Graph.Initialize(STATICS.FILE_LOC, STATICS.WORD_COUNT);
     nodeList = new NodeList();
     glowList = new GlowList();
     string[] wholeKeyword = Graph.GetAllKeywords();
     for (int i = 0; i < wholeKeyword.Length; i++)
     {
         NodeView node = new NodeView(wholeKeyword[i]);
         nodeList.AddNodeView(wholeKeyword[i], node);
         GlowView glow = new GlowView(wholeKeyword[i]);
         glowList.AddGlowView(wholeKeyword[i], glow);
     }
 }
Пример #5
0
 internal void Initialize()
 {
     Graph.Initialize(STATICS.FILE_LOC, STATICS.WORD_COUNT);
     nodeList = new NodeList();
     glowList = new GlowList();
     string[] wholeKeyword = Graph.GetAllKeywords();
     for (int i = 0; i < wholeKeyword.Length; i++)
     {
         NodeView node = new NodeView(wholeKeyword[i]);
         nodeList.AddNodeView(wholeKeyword[i], node);
         GlowView glow = new GlowView(wholeKeyword[i]);
         glowList.AddGlowView(wholeKeyword[i], glow);
     }
 }
Пример #6
0
 public void UpdateGlowList(string[] keywordList, Point[] points)
 {
     ClearUserFactor();
     if (keywordList != null && keywordList.Length > 0 && points != null && points.Length == keywordList.Length)
     {
         int index = 0;
         foreach (string key in keywordList)
         {
             GlowView gv = glowList[key];
             gv.MoveTo(points[index].X, points[index].Y);
             gv.Proportion(Graph.GetGlowSize(key, STATICS.MIN_GLOW_SIZE, STATICS.MAX_GLOW_SIZE), Graph.GetUserFactor(key));
             index++;
         }
     }
 }
Пример #7
0
 public void AddGlowView(string identifier, GlowView glowView)
 {
     if (!glowList.ContainsKey(identifier)) {
         glowList.Add(identifier, glowView);
     }
 }