微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javax.swing.Popup的实例源码

项目:incubator-netbeans    文件CustomPopupFactory.java   
@Override
public Popup getPopup(Component owner,Component contents,int x,int y) throws IllegalArgumentException {
    assert owner instanceof JComponent;
    Dimension d = contents.getPreferredSize();
    Container c = ((JComponent) owner).getTopLevelAncestor();
    if (c == null) {
        throw new IllegalArgumentException ("Not onscreen: " + owner);
    }
    Point p = new Point (x,y);
    SwingUtilities.convertPointFromScreen(p,c);
    Rectangle r = new Rectangle (p.x,p.y,d.width,d.height);
    if (c.getBounds().contains(r)) {
        //XXX need API to determine if editor area comp is heavyweight,//and if so,return a "medium weight" popup of a java.awt.Component
        //that embeds the passed contents component
        return new LWPopup (owner,contents,x,y);
    } else {
        return new HWPopup (owner,y);
    }
}
项目:rapidminer    文件RoundedRectanglePopup.java   
private void initPopup(Component owner,int y,Popup popup) {
    this.owner = owner;
    this.contents = contents;
    this.popup = popup;
    this.x = x;
    this.y = y;

    boolean mac = false;
    try {
        mac = System.getProperty("os.name").toLowerCase().startsWith("mac");
    } catch (SecurityException e) {
        // do nothing
    }
    if (mac) {
        ((JComponent) contents).setBorder(Borders.getPopupMenuBorder());
    } else if (((JComponent) contents).getBorder() instanceof DummyBorder) {
        if (!((owner instanceof JMenu) && ((JMenu) owner).isTopLevelMenu())
                && !((owner.getParent() != null) && (owner.getParent() instanceof javax.swing.JToolBar))
                && !((owner != null) && (owner instanceof javax.swing.JComboBox))) {
            ((JComponent) contents).setBorder(Borders.getShadowedPopupMenuBorder());
        } else {
            ((JComponent) contents).setBorder(Borders.getPopupBorder());
        }
    }
}
项目:rapidminer    文件PopupPanel.java   
/**
 * Checks if the focus is still on this component or its child components.
 */
private boolean isFocusInside(Object newFocusedComp) {
    if (newFocusedComp instanceof Popup) {
        return true;
    }
    if (newFocusedComp instanceof Component && !SwingUtilities.isDescendingFrom((Component) newFocusedComp,this)) {
        // Check if focus is on other window
        if (containingWindow == null) {
            return false;
        }

        Window focusedWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();

        // if focus is on other window return true
        if (containingWindow == focusedWindow) {
            return false;
        }
    }
    return true;
}
项目:Logisim    文件LayoutPopupManager.java   
private void showPopup(Set<AppearancePort> portObjects) {
    dragStart = null;
    CircuitState circuitState = canvas.getCircuitState();
    if (circuitState == null)
        return;
    ArrayList<Instance> ports = new ArrayList<Instance>(portObjects.size());
    for (AppearancePort portObject : portObjects) {
        ports.add(portObject.getPin());
    }

    hideCurrentPopup();
    LayoutThumbnail layout = new LayoutThumbnail();
    layout.setCircuit(circuitState,ports);
    JViewport owner = canvasPane.getViewport();
    Point ownerLoc = owner.getLocationOnScreen();
    Dimension ownerDim = owner.getSize();
    Dimension layoutDim = layout.getPreferredSize();
    int x = ownerLoc.x + Math.max(0,ownerDim.width - layoutDim.width - 5);
    int y = ownerLoc.y + Math.max(0,ownerDim.height - layoutDim.height - 5);
    PopupFactory factory = PopupFactory.getSharedInstance();
    Popup popup = factory.getPopup(canvasPane.getViewport(),layout,y);
    popup.show();
    curPopup = popup;
    curPopupTime = System.currentTimeMillis();
}
项目:pumpernickel    文件AppletPopupFactory.java   
@Override
public Popup getPopup(Component owner,int y)
        throws IllegalArgumentException {
    Component[] hierarchy = getHierarchy(owner);
    for(int a = hierarchy.length-1; a>=0; a--) {
        if(hierarchy[a] instanceof JApplet && 
                contents instanceof JComponent) {
            return new AppletPopup( (JApplet)hierarchy[a],owner,(JComponent)contents,y);

        /* Unfortunately we can't simply check against a java.awt.Frame,* because applets can be embedded in a 
         * sun.plugin2.main.client.PluginEmbeddedFrame.
         */
        //} else if(hierarchy[a] instanceof Frame) {
        } else if(hierarchy[a] instanceof JFrame) {
            return oldFactory.getPopup(owner,y);
        }
    }
    return oldFactory.getPopup(owner,y);
}
项目:rapidminer-studio    文件RoundedRectanglePopup.java   
private void initPopup(Component owner,Popup popup) {
    this.owner = owner;
    this.contents = contents;
    this.popup = popup;
    this.x = x;
    this.y = y;

    boolean mac = false;
    try {
        mac = System.getProperty("os.name").toLowerCase().startsWith("mac");
    } catch (SecurityException e) {
        // do nothing
    }
    if (mac) {
        ((JComponent) contents).setBorder(Borders.getPopupMenuBorder());
    } else if (((JComponent) contents).getBorder() instanceof DummyBorder) {
        if ((owner != null) //
                && (((owner instanceof JMenu) && ((JMenu) owner).isTopLevelMenu()) //
                || ((owner.getParent() != null) && (owner.getParent() instanceof javax.swing.JToolBar)) //
                || (owner instanceof javax.swing.JComboBox))) {
            ((JComponent) contents).setBorder(Borders.getPopupBorder());
        } else {
            ((JComponent) contents).setBorder(Borders.getShadowedPopupMenuBorder());
        }
    }
}
项目:rapidminer-studio    文件PopupPanel.java   
/**
 * Checks if the focus is still on this component or its child components.
 */
private boolean isFocusInside(Object newFocusedComp) {
    if (newFocusedComp instanceof Popup) {
        return true;
    }
    if (newFocusedComp instanceof Component && !SwingUtilities.isDescendingFrom((Component) newFocusedComp,this)) {
        // Check if focus is on other window
        if (containingWindow == null) {
            return false;
        }

        Window focusedWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();

        // if focus is on other window return true
        if (containingWindow == focusedWindow) {
            return false;
        }
    }
    return true;
}
项目:sqlpower-library    文件PopupListenerHandler.java   
/**
* Creates a new {@link PopupListenerHandler} for the given {@link Popup},* glass pane and owning frame associated with the {@link Popup}. A
* {@link ComponentListener} and {@link MouseAdapter} is also created to be
* attached to the glass pane and owning frame to determine when to cleanup
* the {@link Popup}.
* 
* @param popup
*            The {@link Popup} this class handles.
* @param glasspane
*            The {@link JComponent} that mouse clicks should be listened
*            for to figure out when to close the {@link Popup}.
* @param owningFrame
*            The {@link Component} that the {@link Popup} belongs to.
*/
  public PopupListenerHandler(final Popup popup,final JComponent glasspane,final Component owningFrame) {
      this.popup = popup;
      this.glasspane = glasspane;
      this.owningFrame = owningFrame;

      clickListener = new MouseAdapter() {
          @Override
          public void mouseReleased(MouseEvent e) {
              super.mouseReleased(e);
              cleanup();
          }
      };

      resizeListener = new ComponentAdapter() {
          public void componentMoved(ComponentEvent e) {
              cleanup();
          }
      };

  }
项目:WorldGrower    文件CustomPopupFactory.java   
public static void setPopupFactory() {
    PopupFactory.setSharedInstance(new PopupFactory() {

        @Override
        public Popup getPopup(Component owner,int y) throws IllegalArgumentException {
            if (contents instanceof JToolTip) {
                JToolTip toolTip = (JToolTip)contents;
                int width = (int) toolTip.getPreferredSize().getWidth();

                GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
                int screenWidth = gd.getdisplayMode().getWidth();

                // if there is enough room,move tooltip to the right to have enough room
                // for large tooltips.
                // this way they don't hinder mouse movement and make it possible to easily
                // view multiple tooltips of items.
                if (x + width + TOOLTIP_X_OFFSET < screenWidth) {
                    x += TOOLTIP_X_OFFSET;
                }
            }
            return super.getPopup(owner,y);
        }
    });
}
项目:javamelody    文件ShadowPopupFactory.java   
static Popup getInstance(Component owner,Popup delegate) {
    final ShadowPopup result;
    synchronized (ShadowPopup.class) {
        if (cache == null) {
            cache = new ArrayList<>(MAX_CACHE_SIZE);
        }
        if (!cache.isEmpty()) {
            result = cache.remove(0);
        } else {
            result = new ShadowPopup();
        }
    }
    result.reset(owner,y,delegate);
    return result;
}
项目:ireport-fork    文件ApplePopupFactory.java   
public Popup getPopup(Component owner,y);
    } else {
        return APPLE_HEAVYWEIGHT ? 
            (Popup) new HWPopup (owner,y) :
            (Popup) new NullPopup();
    }
}
项目:logisim-evolution    文件LayoutPopupManager.java   
private void showPopup(Set<AppearancePort> portObjects) {
    dragStart = null;
    CircuitState circuitState = canvas.getCircuitState();
    if (circuitState == null)
        return;
    ArrayList<Instance> ports = new ArrayList<Instance>(portObjects.size());
    for (AppearancePort portObject : portObjects) {
        ports.add(portObject.getPin());
    }

    hideCurrentPopup();
    LayoutThumbnail layout = new LayoutThumbnail();
    layout.setCircuit(circuitState,ownerDim.width - layoutDim.width - 5);
    int y = ownerLoc.y
            + Math.max(0,y);
    popup.show();
    curPopup = popup;
    curPopupTime = System.currentTimeMillis();
}
项目:ProyectoLogisim    文件LayoutPopupManager.java   
private void showPopup(Set<AppearancePort> portObjects) {
    dragStart = null;
    CircuitState circuitState = canvas.getCircuitState();
    if (circuitState == null) return;
    ArrayList<Instance> ports = new ArrayList<Instance>(portObjects.size());
    for (AppearancePort portObject : portObjects) {
        ports.add(portObject.getPin());
    }

    hideCurrentPopup();
    LayoutThumbnail layout = new LayoutThumbnail();
    layout.setCircuit(circuitState,y);
    popup.show();
    curPopup = popup;
    curPopupTime = System.currentTimeMillis();
}
项目:rapidminer-5    文件RoundedRectanglePopup.java   
private void initPopup(Component owner,Popup popup) {
    this.owner = owner;
    this.contents = contents;
    this.popup = popup;
    this.x = x;
    this.y = y;

    boolean mac = false;
    try {
        mac = System.getProperty("os.name").toLowerCase().startsWith("mac");
    } catch (SecurityException e) {
        // do nothing
    }
    if (mac) {
        ((JComponent) contents).setBorder(Borders.getPopupMenuBorder());
    } else if (((JComponent) contents).getBorder() instanceof DummyBorder) {
        if (!((owner instanceof JMenu) && ((JMenu) owner).isTopLevelMenu()) && !((owner.getParent() != null) && (owner.getParent() instanceof javax.swing.JToolBar)) && !((owner != null) && (owner instanceof javax.swing.JComboBox))) {
            ((JComponent) contents).setBorder(Borders.getShadowedPopupMenuBorder());
        } else {
            ((JComponent) contents).setBorder(Borders.getPopupBorder());
        }
    }
}
项目:rapidminer-5    文件PopupPanel.java   
/**
 * Checks if the focus is still on this component or its child components.
 */
private boolean isFocusInside(Object newFocusedComp) {
    if(newFocusedComp instanceof Popup) {
        return true;
    }
    if (newFocusedComp instanceof Component && !SwingUtilities.isDescendingFrom((Component)newFocusedComp,this)) {
        //Check if focus is on other window
        if (containingWindow == null) {
            return false;
        }

        Window focusedWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();

        // if focus is on other window return true
        if (containingWindow == focusedWindow) {
            return false;
        }
    }
    return true;
}
项目:incubator-netbeans    文件VisualDesignerPopupMenuUI.java   
@Override
public Popup getPopup(jpopupmenu popup,int y) {
    PopupFactory popupFactory = layer.hackedPopupFactory;
    if(popupFactory == null) {
        return super.getPopup(popup,y);
    }
    return popupFactory.getPopup(popup.getInvoker(),popup,y);
}
项目:incubator-netbeans    文件VisualDesignerPopupFactory.java   
@Override
public Popup getPopup(Component owner,int y) throws IllegalArgumentException {
    final JMenu menu = (JMenu) owner;
    JPanel cont = containerMap.get(menu);

    if (cont == null) {
        cont = new VisualDesignerJPanelContainer(menu,this);
        cont.setLayout(new BoxLayout(cont,BoxLayout.Y_AXIS));

        RADVisualContainer menuRAD = (RADVisualContainer) canvas.formDesigner.getMetaComponent(menu);
        for(RADComponent c : menuRAD.getSubBeans()) {
            JComponent comp = (JComponent) canvas.formDesigner.getComponent(c);
            cont.add(comp);
        }

        cont.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        containerMap.put(menu,cont);
        canvas.layers.add(cont,JlayeredPane.DEFAULT_LAYER);
    }

    cont.setSize(cont.getLayout().preferredLayoutSize(cont));
    canvas.validate();
    canvas.setVisible(true);
    final JPanel fcont = cont;
    SwingUtilities.invokelater(new Runnable() {
        @Override
        public void run() {
            setLocationFromMenu(menu,fcont);
        }
    });

    canvas.validate();
    canvas.repaint();
    VisualDesignerJPanelPopup popup = new VisualDesignerJPanelPopup(cont,menu,this);
    popupMap.put(menu,popup);
    return popup;
}
项目:incubator-netbeans    文件InnerPanelSupport.java   
@Override
public void mouseMoved(MouseEvent e) {
    Point p = e.getPoint();
    int col = listClasses.columnAtPoint(p);
    int row = listClasses.rowAtPoint(p);

    if (col < 0 || row < 0) {
        hidePopup();
        return;
    }
    if (col == currentCol && row == currentRow) {
        // the tooltip is (probably) shown,do not create again
        return;
    }
    Rectangle cellRect = listClasses.getCellRect(row,col,false);
    Point pt = cellRect.getLocation();
    SwingUtilities.convertPointToScreen(pt,listClasses);

    RenderedImage ri = new RenderedImage();
    if (!updatetooltipImage(ri,row,col)) {
        return;
    }
    ri.addMouseListener(this);

    Popup popup = PopupFactory.getSharedInstance().getPopup(listClasses,ri,pt.x,pt.y);
    popupContents = ri;
    currentPopup = popup;
    currentCol = col;
    currentRow = row;
    popup.show();
    System.err.println("Hello");
}
项目:rapidminer    文件RoundedRectanglePopup.java   
static Popup getInstance(Component owner,Popup delegate) {
    RoundedRectanglePopup popup;

    synchronized (RoundedRectanglePopup.class) {
        popup = new RoundedRectanglePopup();
    }

    popup.initPopup(owner,delegate);
    return popup;
}
项目:gate-core    文件LuceneDataStoreSearchGUI.java   
private void addStatistics(String kind,int count,int numRow,final MouseEvent e) {
  JLabel label = (JLabel)e.getComponent();
  if(!label.getToolTipText().contains(kind)) {
    // add the statistics to the tooltip
    String toolTip = label.getToolTipText();
    toolTip = toolTip.replaceAll("</?html>","");
    toolTip = kind + " = " + count + "<br>" + toolTip;
    toolTip = "<html>" + toolTip + "</html>";
    label.setToolTipText(toolTip);
  }
  if(bottomSplitPane.getDividerLocation()
          / bottomSplitPane.getSize().getWidth() < 0.90) {
    // select the row in the statistics table
    statisticsTabbedPane.setSelectedindex(1);
    oneRowStatisticsTable.setRowSelectionInterval(numRow,numRow);
    oneRowStatisticsTable.scrollRectToVisible(oneRowStatisticsTable
            .getCellRect(numRow,true));
  } else {
    // display a tooltip
    JToolTip tip = label.createtoolTip();
    tip.setTipText(kind + " = " + count);
    PopupFactory popupFactory = PopupFactory.getSharedInstance();
    final Popup tipwindow =
            popupFactory.getPopup(label,tip,e.getX()
                    + e.getComponent().getLocationOnScreen().x,e.getY()
                    + e.getComponent().getLocationOnScreen().y);
    tipwindow.show();
    Date timetoRun = new Date(System.currentTimeMillis() + 2000);
    Timer timer = new Timer("Annic statistics hide tooltip timer",true);
    timer.schedule(new TimerTask() {
      @Override
      public void run() {
        // hide the tooltip after 2 seconds
        tipwindow.hide();
      }
    },timetoRun);
  }
}
项目:Openjsharp    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(jpopupmenu a,int b,int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,c);
    }
    return returnValue;
}
项目:jdk8u-jdk    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,c);
    }
    return returnValue;
}
项目:openjdk-jdk10    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,c);
    }
    return returnValue;
}
项目:openjdk-jdk10    文件PopupMenuTest.java   
private void dispose() throws Exception {
    SwingUtilities.invokeAndWait(() -> {
        Popup popup = PopMenuUIExt.getPopup();
        if (popup != null) {
            popup.hide();
        }
        frame.dispose();
    });
}
项目:openjdk-jdk10    文件PopupMenuTest.java   
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
    Popup popup = ((PopMenuUIExt) jpopup.getUI()).getPopup();
    if (popup != null) {
        isLightWeight = !popup.getClass().toString().
                contains("HeavyWeightPopup");
    }
}
项目:Logisim    文件LayoutPopupManager.java   
public void hideCurrentPopup() {
    Popup cur = curPopup;
    if (cur != null) {
        curPopup = null;
        dragStart = null;
        cur.hide();
    }
}
项目:openjdk9    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,c);
    }
    return returnValue;
}
项目:Java8CN    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,c);
    }
    return returnValue;
}
项目:jdk8u_jdk    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,c);
    }
    return returnValue;
}
项目:jdk8u_jdk    文件Popup401.java   
private void run() {
    JPanel panel = new JPanel();

    int count = 0;
    long diffTime,initialDiffTime = 0;
    while (count < IteraTION_NUMBER) {
        robot.delay(ROBOT_DELAY);

        PopupFactory factory = PopupFactory.getSharedInstance();
        Popup popup = factory.getPopup(panel,textArea,editorPane.getLocation().x + 20,editorPane.getLocation().y + 20);

        long startTime = System.currentTimeMillis();
        popup.show();
        long endTime = System.currentTimeMillis();
        diffTime = endTime - startTime;

        if (count > 1) {
            if (diffTime * HANG_TIME_FACTOR < (endTime - startTime)) {
                throw new RuntimeException("The test is near to be hang: iteration count = " + count
                        + " initial time = " + initialDiffTime
                        + " current time = " + diffTime);
            }
        } else {
            initialDiffTime = diffTime;
        }
        count++;
        robot.delay(ROBOT_DELAY);

        popup.hide();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,c);
    }
    return returnValue;
}
项目:rapidminer-studio    文件RoundedRectanglePopup.java   
static Popup getInstance(Component owner,delegate);
    return popup;
}
项目:beautyeye    文件TranslucentPopupFactory.java   
@Override
public Popup getPopup(Component owner,int y)
        throws IllegalArgumentException
{
    // A more complete implementation would cache and reuse popups
    return new TranslucentPopup(owner,y);
}
项目:confluence.keygen    文件ShadowPopup.java   
private void reset(Component owner,Popup popup)
/* 111:    */   {
/* 112:208 */     this.owner = owner;
/* 113:209 */     this.contents = contents;
/* 114:210 */     this.popup = popup;
/* 115:211 */     this.x = x;
/* 116:212 */     this.y = y;
/* 117:213 */     if ((owner instanceof JComboBox)) {
/* 118:214 */       return;
/* 119:    */     }
/* 120:219 */     Dimension contentsPrefSize = contents.getPreferredSize();
/* 121:220 */     if ((contentsPrefSize.width <= 0) || (contentsPrefSize.height <= 0)) {
/* 122:221 */       return;
/* 123:    */     }
/* 124:223 */     for (Container p = contents.getParent(); p != null; p = p.getParent()) {
/* 125:224 */       if (((p instanceof JWindow)) || ((p instanceof Panel)))
/* 126:    */       {
/* 127:226 */         p.setBackground(contents.getBackground());
/* 128:227 */         this.heavyWeightContainer = p;
/* 129:228 */         break;
/* 130:    */       }
/* 131:    */     }
/* 132:231 */     JComponent parent = (JComponent)contents.getParent();
/* 133:232 */     this.oldOpaque = parent.isOpaque();
/* 134:233 */     this.oldBorder = parent.getBorder();
/* 135:234 */     parent.setopaque(false);
/* 136:235 */     parent.setBorder(SHADOW_BORDER);
/* 137:237 */     if (this.heavyWeightContainer != null) {
/* 138:238 */       this.heavyWeightContainer.setSize(this.heavyWeightContainer.getPreferredSize());
/* 139:    */     } else {
/* 140:241 */       parent.setSize(parent.getPreferredSize());
/* 141:    */     }
/* 142:    */   }
项目:stendhal    文件StyledPopupMenuUI.java   
@Override
public Popup getPopup(jpopupmenu menu,int y) {
    Popup popup = super.getPopup(menu,y);
    /*
     * The menu should Now have a parent,which is probably a JPanel,In
     * which case its borders need to be deleted.
     */
    Container parent = menu.getParent();
    if (parent instanceof JComponent) {
        ((JComponent) parent).setBorder(null);
    }

    return popup;
}
项目:Swing9patch    文件CoolPopupFactory.java   
@Override
public Popup getPopup(Component owner,y);
}
项目:javamelody    文件ShadowPopupFactory.java   
/**
 * Reinitializes this ShadowPopup using the given parameters.
 *
 * @param newOwner component mouse coordinates are relative to,may be null
 * @param newContents the contents of the popup
 * @param newX the desired x location of the popup
 * @param newY the desired y location of the popup
 * @param newPopup the popup to wrap
 */
private void reset(Component newOwner,Component newContents,int newX,int newY,Popup newPopup) {
    this.owner = newOwner;
    this.contents = newContents;
    this.popup = newPopup;
    this.x = newX;
    this.y = newY;
    if (newOwner instanceof JComboBox) {
        return;
    }
    // Do not install the shadow border when the contents
    // has a preferred size less than or equal to 0.
    // We can't use the size,because it is(0,0) for new popups.
    final Dimension contentsPrefSize = newContents.getPreferredSize();
    if (contentsPrefSize.width <= 0 || contentsPrefSize.height <= 0) {
        return;
    }
    for (Container p = newContents.getParent(); p != null; p = p.getParent()) {
        if (p instanceof JWindow || p instanceof Panel) {
            // Workaround for the gray rect problem.
            p.setBackground(newContents.getBackground());
            heavyWeightContainer = p;
            break;
        }
    }
    final JComponent parent = (JComponent) newContents.getParent();
    oldOpaque = parent.isOpaque();
    oldBorder = parent.getBorder();
    parent.setopaque(false);
    parent.setBorder(SHADOW_BORDER);
    // Pack it because we have changed the border.
    if (heavyWeightContainer != null) {
        heavyWeightContainer.setSize(heavyWeightContainer.getPreferredSize());
    } else {
        parent.setSize(parent.getPreferredSize());
    }
}
项目:infobip-open-jdk-8    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,c);
    }
    return returnValue;
}
项目:jdk8u-dev-jdk    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,c);
    }
    return returnValue;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。