@Nullable private Rectangle getHintBounds() { LightweightHint hint = myHint; if (hint == null) { return null; } JComponent hintComponent = hint.getComponent(); if (!hintComponent.isShowing()) { return null; } return new Rectangle(hintComponent.getLocationOnScreen(), hintComponent.getSize()); }
/** * Show the window. * * @param container - Window of JFrame to show */ private void showPopup(Window container) { if (visibleComponent.isEnabled()) { Point pt = visibleComponent.getLocationOnScreen(); pt.translate(0, visibleComponent.getHeight()); container.setLocation(pt); container.toFront(); ApplicationManager.setCurrentlySelectedField(fieldName); if (container instanceof OntologySelector) { ((OntologySelector) container).makeVisible(); } else { container.setVisible(true); container.requestFocusInWindow(); } } }