|
|
|
@ -42,13 +42,19 @@ public class ComponentTree extends JTree {
|
|
|
|
|
this.setDropMode(DropMode.ON_OR_INSERT); |
|
|
|
|
this.setTransferHandler(new TreeTransferHandler()); |
|
|
|
|
this.refreshTreeRoot(); |
|
|
|
|
addTreeSelectionListener(designer); |
|
|
|
|
addMouseMotionListener(new ComponetTreeMouseListener(this)); |
|
|
|
|
initListeners(); |
|
|
|
|
setEditable(true); |
|
|
|
|
setUI(uiTreeUI); |
|
|
|
|
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() { |
|
|
|
|
return designer; |
|
|
|
|
} |
|
|
|
@ -276,6 +282,11 @@ public class ComponentTree extends JTree {
|
|
|
|
|
hidePreviewPane(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
hidePreviewPane(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private class PopupPreviewPane extends JPopupMenu { |
|
|
|
|