/** * Constructor. * * @param root root node * @param w window reference */ public BaseXTree(final DefaultMutableTreeNode root, final Window w) { super(root); BaseXLayout.addInteraction(this, w); setLargeModel(true); addMouseListener( new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { if (!e.isShiftDown()) setSelectionRow(getClosestRowForLocation(e.getX(), e.getY())); } }); }
/** * Constructor. * * @param win parent window */ public BaseXPassword(final Window win) { BaseXLayout.setWidth(this, BaseXTextField.DWIDTH); BaseXLayout.addInteraction(this, win); if (!(win instanceof BaseXDialog)) return; addKeyListener(((BaseXDialog) win).keys); addMouseListener( new MouseAdapter() { @Override public void mouseEntered(final MouseEvent e) { BaseXLayout.focus(e.getComponent()); } }); }
/** * Constructor, setting default interactions. * * @param win parent reference, {@link BaseXDialog} or {@link GUI} instance */ protected BaseXPanel(final Window win) { gui = win instanceof GUI ? (GUI) win : ((BaseXDialog) win).gui; BaseXLayout.addInteraction(this, win); }