/** * Creates a dialog that will display itself in the layered pane of * the frame that contains the supplied component. */ public JInternalDialog (JComponent friend) { this(JLayeredPane.getLayeredPaneAbove(friend)); }
JLayeredPane lPane = JLayeredPane.getLayeredPaneAbove(comboBar); if (lPane == null) {
currentPane = JLayeredPane.getLayeredPaneAbove( owner );
/** * Renders all components in all {@link JLayeredPane} layers that intersect the supplied * bounds. */ protected void renderLayers (Graphics2D g, Component pcomp, Rectangle bounds, boolean[] clipped, Rectangle dirty) { JLayeredPane lpane = JLayeredPane.getLayeredPaneAbove(pcomp); if (lpane != null) { renderLayer(g, bounds, lpane, clipped, JLayeredPane.PALETTE_LAYER); renderLayer(g, bounds, lpane, clipped, JLayeredPane.MODAL_LAYER); renderLayer(g, bounds, lpane, clipped, JLayeredPane.POPUP_LAYER); renderLayer(g, bounds, lpane, clipped, JLayeredPane.DRAG_LAYER); } // if we have a MediaOverlay, let it know that any sprites in this region need to be // repainted as the components beneath them have just been redrawn if (_overlay != null) { _overlay.addDirtyRegion(dirty); } }
/** * Updates size and visibility of this panel according to model content */ public void updatePopup () { int modelSize = rModel.getSize(); // plug this popup into layered pane if needed JLayeredPane lPane = JLayeredPane.getLayeredPaneAbove(comboBar); // lPane can be null when the corresponding dialog is closed already // for example, when the user didn't want to wait until the search finishes if (!isDisplayable() && (lPane != null)) { lPane.add(this, new Integer(JLayeredPane.POPUP_LAYER + 1) ); } boolean statusVisible = updateStatusPanel(); if(lPane != null) { computePopupBounds(popupBounds, lPane, modelSize); setBounds(popupBounds); } // popup visibility constraints if ((modelSize > 0 || statusVisible) && comboBar.isTextFieldFocusOwner()) { if (jList1.getSelectedIndex() >= modelSize) { jList1.setSelectedIndex(modelSize - 1); } setVisible(true); } else { setVisible(false); } // needed on JDK 1.5.x to repaint correctly revalidate(); }
/** * Renders all components in all {@link JLayeredPane} layers that intersect the supplied * bounds. */ protected void renderLayers (Graphics2D g, Component pcomp, Rectangle bounds, boolean[] clipped, Rectangle dirty) { JLayeredPane lpane = JLayeredPane.getLayeredPaneAbove(pcomp); if (lpane != null) { renderLayer(g, bounds, lpane, clipped, JLayeredPane.PALETTE_LAYER); renderLayer(g, bounds, lpane, clipped, JLayeredPane.MODAL_LAYER); renderLayer(g, bounds, lpane, clipped, JLayeredPane.POPUP_LAYER); renderLayer(g, bounds, lpane, clipped, JLayeredPane.DRAG_LAYER); } // if we have a MediaOverlay, let it know that any sprites in this region need to be // repainted as the components beneath them have just been redrawn if (_overlay != null) { _overlay.addDirtyRegion(dirty); } }