Examples of JPopupPanel


Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

        // We are interested in MouseEvents only
        return;
      }
      MouseEvent me = (MouseEvent) ev;
      final Component src = me.getComponent();
      JPopupPanel popupPanelParent = (JPopupPanel) SwingUtilities
          .getAncestorOfClass(JPopupPanel.class, src);
      switch (me.getID()) {
      case MouseEvent.MOUSE_PRESSED:
        boolean wasCommandButtonPopupShowing = false;
        if (src instanceof JCommandButton) {
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

    // do not show tooltips on components in popup panels that are not
    // in the last shown one
    List<PopupPanelManager.PopupInfo> popups = PopupPanelManager
        .defaultManager().getShownPath();
    if (popups.size() > 0) {
      JPopupPanel popupPanel = popups.get(popups.size() - 1)
          .getPopupPanel();
      boolean ignore = true;
      Component c = component;
      while (c != null) {
        if (c == popupPanel) {
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

                // System.out.println(prefHeight
                // + ":"
                // + bandScrollablePanel.getView()
                // .getComponentCount());

                JPopupPanel popupPanel = new BandHostPopupPanel(
                    bandScrollablePanel, new Dimension(
                        ribbon.getWidth(), prefHeight));

                int x = ribbon.getLocationOnScreen().x;
                int y = ribbon.getLocationOnScreen().y
                    + ribbon.getHeight();

                // make sure that the popup stays in
                // bounds
                Rectangle scrBounds = ribbon
                    .getGraphicsConfiguration().getBounds();
                int pw = popupPanel.getPreferredSize().width;
                if ((x + pw) > (scrBounds.x + scrBounds.width)) {
                  x = scrBounds.x + scrBounds.width - pw;
                }
                int ph = popupPanel.getPreferredSize().height;
                if ((y + ph) > (scrBounds.y + scrBounds.height)) {
                  y = scrBounds.y + scrBounds.height - ph;
                }

                // 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() {
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

        // We are interested in MouseEvents only
        return;
      }
      MouseEvent me = (MouseEvent) ev;
      final Component src = me.getComponent();
      JPopupPanel popupPanelParent = (JPopupPanel) SwingUtilities
          .getAncestorOfClass(JPopupPanel.class, src);
      switch (me.getID()) {
      case MouseEvent.MOUSE_PRESSED:
        boolean wasCommandButtonPopupShowing = false;
        if (src instanceof JCommandButton) {
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

                // System.out.println(prefHeight
                // + ":"
                // + bandScrollablePanel.getView()
                // .getComponentCount());

                JPopupPanel popupPanel = new BandHostPopupPanel(
                    bandScrollablePanel, new Dimension(
                        ribbon.getWidth(), prefHeight));

                int x = ribbon.getLocationOnScreen().x;
                int y = ribbon.getLocationOnScreen().y
                    + ribbon.getHeight();

                                // make sure that the popup stays in bounds

                                // first, get the graphics config of where the mouse pointer curently is at
                                PointerInfo pi = MouseInfo.getPointerInfo();
                                GraphicsDevice gd = pi.getDevice();
                                GraphicsConfiguration mgc = null;
                                for (GraphicsConfiguration gc : gd.getConfigurations()) {
                                    if (gc.getBounds().contains(pi.getLocation())) {
                                        mgc = gc;
                                        break;
                                    }
                                }
                                if (mgc == null) {
                                    mgc = ribbon.getGraphicsConfiguration();
                                }
                                Rectangle scrBounds = mgc.getBounds();
                int pw = popupPanel.getPreferredSize().width;

                                // falling off the left?  trim and shift
                                if (x < scrBounds.x) {
                                    pw = pw - scrBounds.x + x;
                                    x = scrBounds.x;
                                }

                                // falling off the right?  trim it's width
                if ((x + pw) > (scrBounds.x + scrBounds.width)) {
                                    pw = scrBounds.width + scrBounds.x - x;
                }

                                // falling off the bottom?  flip it above the tabs
                int ph = popupPanel.getPreferredSize().height;
                if ((y + ph) > (scrBounds.y + scrBounds.height)) {
                                    y = ribbon.getLocationOnScreen().y - prefHeight;
                }

                // get the popup and show it
                popupPanel.setPreferredSize(new Dimension(
                                        pw, prefHeight));
                Popup popup = PopupFactory.getSharedInstance()
                    .getPopup(taskToggleButton, popupPanel,
                        x, y);
                PopupPanelManager.PopupListener tracker = new PopupPanelManager.PopupListener() {
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

          List<PopupInfo> popups = PopupPanelManager.defaultManager()
              .getShownPath();
          if (popups.size() > 0) {
            PopupInfo last = popups.get(popups.size() - 1);
            if (last.getPopupOriginator() == appMenuButton) {
              JPopupPanel popupPanel = last.getPopupPanel();
              KeyTipChain chain = new KeyTipChain(popupPanel);
              chain.parent = appMenuButtonLink.traversal;
              populateChain(last.getPopupPanel(), chain);
              // popupPanel.putClientProperty(KEYTIP_MANAGER,
              // KeyTipManager.this);
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

            // popup panel
            List<PopupInfo> popups = PopupPanelManager
                .defaultManager().getShownPath();
            if (popups.size() > 0) {
              PopupInfo last = popups.get(popups.size() - 1);
              JPopupPanel popupPanel = last.getPopupPanel();
              KeyTipChain chain = new KeyTipChain(popupPanel);
              populateChain(last.getPopupPanel(), chain);
              chain.parent = link.traversal;
              return chain;
            }
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

          List<PopupInfo> popups = PopupPanelManager.defaultManager()
              .getShownPath();
          if (popups.size() > 0) {
            PopupInfo last = popups.get(popups.size() - 1);
            // if (last.getPopupOriginator() == cb) {
            JPopupPanel popupPanel = last.getPopupPanel();
            // special case - application menu
            if (popupPanel instanceof JRibbonApplicationMenuPopupPanel) {
              JRibbonApplicationMenuPopupPanel appMenuPopupPanel = (JRibbonApplicationMenuPopupPanel) popupPanel;
              // check whether there are entries at level 2
              JPanel level1 = appMenuPopupPanel.getPanelLevel1();
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

      window.repaint();
    }
    List<PopupInfo> popups = PopupPanelManager.defaultManager()
        .getShownPath();
    for (PopupPanelManager.PopupInfo popup : popups) {
      JPopupPanel popupPanel = popup.getPopupPanel();
      popupPanel.paintImmediately(new Rectangle(0, 0, popupPanel
          .getWidth(), popupPanel.getHeight()));
    }
  }
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.JPopupPanel

    // do not show tooltips on components in popup panels that are not
    // in the last shown one
    List<PopupPanelManager.PopupInfo> popups = PopupPanelManager
        .defaultManager().getShownPath();
    if (popups.size() > 0) {
      JPopupPanel popupPanel = popups.get(popups.size() - 1)
          .getPopupPanel();
      boolean ignore = true;
      Component c = component;
      while (c != null) {
        if (c == popupPanel) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.