do not recreate tree model every time

This commit is contained in:
honfika@gmail.com
2015-03-07 14:38:26 +01:00
parent 99ec0a592c
commit 3c995f42e3
21 changed files with 625 additions and 145 deletions

View File

@@ -90,6 +90,11 @@ public class DumpTree extends JTree implements ActionListener {
setCellRenderer(new DumpTreeCellRenderer());
setRootVisible(false);
setBackground(Color.white);
setUI(new BasicTreeUI() {
{
setHashColor(Color.gray);
}
});
}
public void createContextMenu() {
@@ -281,16 +286,15 @@ public class DumpTree extends JTree implements ActionListener {
}
}
@Override
public DumpTreeModel getModel() {
return (DumpTreeModel) super.getModel();
}
@Override
public void setModel(TreeModel tm) {
super.setModel(tm);
setUI(new BasicTreeUI() {
{
setHashColor(Color.gray);
}
});
if (tm != null) {
int rowCount = tm.getChildCount(tm.getRoot());
for (int i = rowCount - 1; i >= 0; i--) {