use of org.freeplane.core.ui.MouseInsideListener in project freeplane by freeplane.
the class NodeTooltipManager method showTipWindow.
private void showTipWindow() {
Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
if (insideComponent == null || !insideComponent.isShowing() || focusOwner == null)
return;
tip = insideComponent.createToolTip();
tip.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
final NodeTooltip component = (NodeTooltip) e.getComponent();
component.scrollUp();
component.removeComponentListener(this);
}
});
tip.setTipText(toolTipText);
final JComponent nearComponent = insideComponent;
focusOwnerRef = new WeakReference<Component>(focusOwner);
tipPopup = new JPopupMenu();
tipPopup.setLayout(new GridLayout(1, 1));
tipPopup.add(tip);
mouseInsideTooltipListener = new MouseInsideListener(tipPopup);
tipPopup.show(nearComponent, 0, nearComponent.getHeight());
focusOwner.requestFocusInWindow();
exitTimer.start();
}
Aggregations