コード例 #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
ファイル: Controler.cs プロジェクト: nius1989/CardDataSorting
 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
ファイル: GlowList.cs プロジェクト: nius1989/CardDataSorting
 public void AddGlowView(string identifier, GlowView glowView)
 {
     if (!glowList.ContainsKey(identifier)) {
         glowList.Add(identifier, glowView);
     }
 }