2013-06-28 107 views
1

我在eclipse中構建了一個編輯器部件來可視化Zest圖形。我的問題:如果我試圖關閉一個包含大圖(〜6000個節點,9000個邊)的編輯器部件,eclipse無法處理關閉操作並掛起。無法關閉大熱門圖形的編輯器部分

任何想法來解決問題或調試它?

我認爲問題在於配置圖形對象,但我還沒有想法解決它。

在此先感謝!

回答

0

問題是方法「org.eclipse.gef4.zest.layouts.algorithms.TreeLayoutObserver.TreeNode .isAncestorO f(TreeNode後代)「。我爲我解決了這個問題,並且會報告一個錯誤(在註釋中顯示錯誤代碼)。如果有人需要一個快速的bug修復:

舊版本:

public boolean isAncestorOf(TreeNode descendant) { 
     while (descendant.depth > this.depth) { 
      descendant = descendant.parent; 
     } 
     return descendant == this; 
    } 

新版本:

public boolean isAncestorOf(TreeNode descendant) { 
     while (descendant.depth > this.depth) { 
      if (descendant == descendant.parent) { 
       return false; 
      } else { 
       descendant = descendant.parent; 
      } 
     } 
     return descendant == this; 
    } 
+0

https://bugs.eclipse.org/bugs/show_bug.cgi?id=412446 – Yannic

0

爲了調試它,我試着查看Eclipse日誌文件(workspace/.metadata/.log)以獲取發生的事情的線索。這可能是一些記憶問題。如果聽起來像那樣構成日誌文件,則可以嘗試更改eclipse.ini配置,特別是-XX:MaxPermSize,-Xms-Xmx值(請參閱http://wiki.eclipse.org/Eclipse.ini)。

如果問題與合理的內存值仍然存在,這將是巨大的,如果你能提交錯誤:https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GEF&component=Zest

+0

有沒有記錄我的問題的信息,我不認爲這是一個記憶的問題,因爲在這種情況下,我應該得到一些例外? – Yannic

+0

@Yannic我仍然嘗試設置一些更大的內存設置,看看會發生什麼。您也可以嘗試一個乾淨的Eclipse設置,例如只是SDK + Zest。如果它仍然掛斷,我會很高興與一個SSCCE的錯誤報告:http://sscce.org/ –

+0

我做了一些簡單的例子7000節點和10000邊緣。我的結果:用7000個節點和10,000個邊關閉一個圖形是沒有問題的。用10個子圖關閉Graph對象是​​個問題。您能否解釋當用戶關閉包含Graph對象的編輯器時調用哪些方法?我試圖構建一個擴展Graph類的新類「ExtendedGraph」,並重寫dispose方法以記錄此方法的調用。但沒有電話... – Yannic