setContentPane(_resizablePanel); addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) {
public Component getRoutingComponent() { return getOwner(); }
return; if (_window.isVisible()) { needFireEvents = false; _window.applyComponentOrientation(getComponentOrientation()); _window.setFocusableWindowState(false); if (!_window.isVisible()) { _window.pack(); _window.setVisible(true); Window owner = _window.getOwner(); if (owner == null || owner.getClass().getName().contains("LightweightFrame")) { // workaround for a JavaFX limitation when SwingNode is used, there is no way to set the JavaFX main window as the owner _window.setAlwaysOnTop(true); _window.setFocusable(true); if (getDefaultFocusComponent() != null) { Runnable runnable = new Runnable() {
_window.removeWindowListener(_windowListener); _windowListener = null; _window.removeComponentListener(_componentListener); _componentListener = null; _window.getContentPane().remove(this); if (cancelled) { _previousSize = _window.getSize(); _window.setVisible(false); _window.removeAll(); _window.dispose(); _window = null; firePropertyChange("visible", Boolean.TRUE, Boolean.FALSE);
Component topLevelAncestor = getTopLevelAncestor(owner); if (topLevelAncestor instanceof Frame) { container = new ResizableWindow((Frame) topLevelAncestor); container = new ResizableWindow((Window) topLevelAncestor); container = new ResizableWindow(frame); container.setName("JidePopup"); container.getContentPane().add(this);
registerKeyboardAction(_escapeActionListener, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); if (_popupType == HEAVY_WEIGHT_POPUP) { _window.addComponentListener(_componentListener); _windowListener = new WindowAdapter() { @Override _window.addWindowListener(_windowListener);
public Rectangle getPopupBounds() { if (_popupType == LIGHT_WEIGHT_POPUP) { return isPopupVisible() ? _panel.getBounds() : null; } else if (_popupType == HEAVY_WEIGHT_POPUP) { return isPopupVisible() ? _window.getBounds() : null; } return null; }
@Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { boolean processed = super.processKeyBinding(ks, e, condition, pressed); if (processed || e.isConsumed() || !isRoutingKeyStrokes()) return processed; Component routingParent = getRoutingComponent(); if (routingParent == null) { return false;
protected void movePopup() { if (isPopupVisible()) { if (!isDetached() && _actualOwner != null) { if (_insets != null) { showPopup(_insets, _actualOwner); } else if (_actualOwnerLocation != null) { Point newLocation = _actualOwner.getLocationOnScreen(); Point p = null; if (_popupType == LIGHT_WEIGHT_POPUP) { p = _panel.getLocationOnScreen(); } else if (_popupType == HEAVY_WEIGHT_POPUP) { p = _window.getLocationOnScreen(); // light weight popup followed already but heavy weight popup didn't if (p != null) { p.x += newLocation.x - _actualOwnerLocation.x; p.y += newLocation.y - _actualOwnerLocation.y; } } if (p != null) { showPopup(p.x, p.y, _actualOwner); } } } } }