|
|
@ -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 { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
*搜索指定名称的路径 |
|
|
|
*搜索指定名称的路径 |
|
|
|
* |
|
|
|
* |
|
|
|