Browse Source

REPORT-4634 组件叠加体验优化=>2=>修复点击控件树的npe问题

master
plough 7 years ago
parent
commit
1d1c48a68e
  1. 9
      designer_form/src/com/fr/design/mainframe/ComponentTree.java

9
designer_form/src/com/fr/design/mainframe/ComponentTree.java

@ -18,6 +18,7 @@ public class ComponentTree extends JTree {
private FormDesigner designer; private FormDesigner designer;
private ComponentTreeModel model; private ComponentTreeModel model;
private UITreeUI uiTreeUI = new UITreeUI();
private static final int PADDING_LEFT = 10; private static final int PADDING_LEFT = 10;
private static final int PADDING_TOP = 8; private static final int PADDING_TOP = 8;
@ -33,7 +34,7 @@ public class ComponentTree extends JTree {
this.refreshTreeRoot(); this.refreshTreeRoot();
addTreeSelectionListener(designer); addTreeSelectionListener(designer);
setEditable(true); setEditable(true);
setUI(new UITreeUI()); setUI(uiTreeUI);
setBorder(BorderFactory.createEmptyBorder(PADDING_TOP, PADDING_LEFT, 0, 0)); setBorder(BorderFactory.createEmptyBorder(PADDING_TOP, PADDING_LEFT, 0, 0));
} }
@ -101,12 +102,10 @@ public class ComponentTree extends JTree {
*/ */
public void refreshUI() { public void refreshUI() {
updateUI(); updateUI();
setUI(uiTreeUI);
} }
public TreePath[] getSelectedTreePath() { public TreePath[] getSelectedTreePath() {
XCreator[] creators = designer.getSelectionModel().getSelection().getSelectedCreators(); XCreator[] creators = designer.getSelectionModel().getSelection().getSelectedCreators();
TreePath[] paths = new TreePath[creators.length]; TreePath[] paths = new TreePath[creators.length];
@ -117,8 +116,6 @@ public class ComponentTree extends JTree {
} }
/** /**
*搜索指定名称的路径 *搜索指定名称的路径
* *

Loading…
Cancel
Save