|
|
@ -42,13 +42,19 @@ public class ComponentTree extends JTree { |
|
|
|
this.setDropMode(DropMode.ON_OR_INSERT); |
|
|
|
this.setDropMode(DropMode.ON_OR_INSERT); |
|
|
|
this.setTransferHandler(new TreeTransferHandler()); |
|
|
|
this.setTransferHandler(new TreeTransferHandler()); |
|
|
|
this.refreshTreeRoot(); |
|
|
|
this.refreshTreeRoot(); |
|
|
|
addTreeSelectionListener(designer); |
|
|
|
initListeners(); |
|
|
|
addMouseMotionListener(new ComponetTreeMouseListener(this)); |
|
|
|
|
|
|
|
setEditable(true); |
|
|
|
setEditable(true); |
|
|
|
setUI(uiTreeUI); |
|
|
|
setUI(uiTreeUI); |
|
|
|
setBorder(BorderFactory.createEmptyBorder(PADDING_TOP, PADDING_LEFT, 0, 0)); |
|
|
|
setBorder(BorderFactory.createEmptyBorder(PADDING_TOP, PADDING_LEFT, 0, 0)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initListeners() { |
|
|
|
|
|
|
|
this.addTreeSelectionListener(designer); |
|
|
|
|
|
|
|
ComponetTreeMouseListener componetTreeMouseListener = new ComponetTreeMouseListener(this); |
|
|
|
|
|
|
|
this.addMouseMotionListener(componetTreeMouseListener); |
|
|
|
|
|
|
|
this.addMouseListener(componetTreeMouseListener); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FormDesigner getDesigner() { |
|
|
|
public FormDesigner getDesigner() { |
|
|
|
return designer; |
|
|
|
return designer; |
|
|
|
} |
|
|
|
} |
|
|
@ -276,6 +282,11 @@ public class ComponentTree extends JTree { |
|
|
|
hidePreviewPane(); |
|
|
|
hidePreviewPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
|
|
|
hidePreviewPane(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private class PopupPreviewPane extends JPopupMenu { |
|
|
|
private class PopupPreviewPane extends JPopupMenu { |
|
|
|