Package javax.swing

Examples of javax.swing.Popup


        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, x, y);
        popup.show();
        curPopup = popup;
        curPopupTime = System.currentTimeMillis();
    }
View Full Code Here


     *
     * @see Options#isPopupDropShadowActive()
     */
    public Popup getPopup(Component owner, Component contents, int x, int y)
            throws IllegalArgumentException {
        Popup popup = super.getPopup(owner, contents, x, y);
        return Options.isPopupDropShadowActive()
            ? ShadowPopup.getInstance(owner, contents, x, y, popup)
            : popup;
    }
View Full Code Here

   */
  public void hideLastPopup() {
    if (shownPath.size() == 0)
      return;
    PopupInfo last = shownPath.removeLast();
    Popup popup = popupPanels.get(last.popupPanel);
    popup.hide();
    popupPanels.remove(last.popupPanel);
    if (last.popupOriginator instanceof JCommandButton) {
      ((JCommandButton) last.popupOriginator).getPopupModel()
          .setPopupShowing(false);
    }
View Full Code Here

          // from the found popup panel
          while (shownPath.size() > 0) {
            if (shownPath.getLast().popupPanel == c)
              return;
            PopupInfo last = shownPath.removeLast();
            Popup popup = popupPanels.get(last.popupPanel);
            popup.hide();
            if (last.popupOriginator instanceof JCommandButton) {
              ((JCommandButton) last.popupOriginator)
                  .getPopupModel().setPopupShowing(false);
            }
            this.firePopupHidden(last.popupPanel,
                last.popupOriginator);
            popupPanels.remove(last.popupPanel);
          }
        }
        c = c.getParent();
      }
    }
    if (!foundAndDismissed || (comp == null)) {
      while (shownPath.size() > 0) {
        PopupInfo last = shownPath.removeLast();
        Popup popup = popupPanels.get(last.popupPanel);
        popup.hide();
        if (last.popupOriginator instanceof JCommandButton) {
          ((JCommandButton) last.popupOriginator).getPopupModel()
              .setPopupShowing(false);
        }
        this.firePopupHidden(last.popupPanel, last.popupOriginator);
View Full Code Here

                }

                // get the popup and show it
                popupPanel.setPreferredSize(new Dimension(
                    ribbon.getWidth(), prefHeight));
                Popup popup = PopupFactory.getSharedInstance()
                    .getPopup(taskToggleButton, popupPanel,
                        x, y);
                PopupPanelManager.PopupListener tracker = new PopupPanelManager.PopupListener() {
                  @Override
                  public void popupShown(PopupEvent event) {
View Full Code Here

                : (owner.isShowing()
                   ? owner.getLocationOnScreen() : owner.getLocation());
        final Window parent = owner != null
            ? SwingUtilities.getWindowAncestor(owner) : null;
        origin.translate(x, y);
        return new Popup() {
            private BubbleWindow w;
            public void show() {
                w = new BubbleWindow(parent, content);
                w.pack();
                Point where = new Point(origin);
View Full Code Here

         */
        private void popupHidePopup() {
            popupLabels = null;
            if(popup == null)
                return;
            final Popup staticPopup = popup;
            popup = null;
            EventQueue.invokeLater(new Runnable(){
               @Override
               public void run() {
                    staticPopup.hide();
                }});
        }
View Full Code Here

         * If an old popup exists, it will be automatically hidden
         * @param newPopup popup to show
         * @param lbls lables to show (see {@link #popupLabels})
         */
        private void popupShowPopup(Popup newPopup, List<JLabel> lbls) {
            final Popup staticPopup = newPopup;
            if(this.popup != null) {
                // If an old popup exists, remove it when the new popup has been
                // drawn to keep flickering to a minimum
                final Popup staticOldPopup = this.popup;
                EventQueue.invokeLater(new Runnable(){
                    @Override public void run() {
                        staticPopup.show();
                        staticOldPopup.hide();
                    }
                });
            } else {
                // There is no old popup
                EventQueue.invokeLater(new Runnable(){
View Full Code Here

    final Integer timerDuration =
      duration != null ? duration : 10000;
    origin.translate(x, y);
    vpos = VPOS_BELOW;
    hpos = HPOS_LEFT;
    return new Popup () {
      private BalloonTip bt = null;
      final ComponentEar componentEar = new ComponentEar();
      final MouseEar mouseEar = new MouseEar();
      final FocusEar focusEar = new FocusEar();
     
View Full Code Here

TOP

Related Classes of javax.swing.Popup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.