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