Package javax.swing

Examples of javax.swing.PopupFactory$LWPopup


      // the Apple LAF delegates to the Swing Popup factory but then
      // tries to set a 90% alpha on the underlying Cocoa window, which
      // will always be null if you're using JGoodies L&F
      // see http://www.caimito.net/pebble/2005/07/26/1122392314480.html#comment1127522262179
      // This has no effect on Linux/Windows
      PopupFactory.setSharedInstance(new PopupFactory());

      UIManager.setLookAndFeel(lafClassName);
    }
    catch (Exception ex)
    {
View Full Code Here


            location.x = sBounds.x;
        } else if (location.x - sBounds.x + size.width > sBounds.width) {
            location.x = sBounds.x + Math.max(0, sBounds.width - size.width);
        }

        PopupFactory popupFactory = PopupFactory.getSharedInstance();
        tipWindow = popupFactory.getPopup(component, tip, location.x, location.y);
        tipWindow.show();
        tipShowing = true;
    }
View Full Code Here

      // have to display once to get the correct size
      int width = findBox.getWidth();
      boolean needsRelocate = (width <= 0);
      int x = loggerOrigin.x + dim.width - width;
      int y = loggerOrigin.y + dim.height - findBox.getHeight();
      PopupFactory popupFactory = PopupFactory.getSharedInstance();
      // TODO(jat): need to track window resize?
      findPopup = popupFactory.getPopup(SwingLoggerPanel.this, findBox, x, y);
      findPopup.show();
      if (needsRelocate) {
        x = loggerOrigin.x + dim.width - findBox.getWidth();
        y = loggerOrigin.y + dim.height - findBox.getHeight();
        findPopup.hide();
        findPopup = popupFactory.getPopup(SwingLoggerPanel.this, findBox, x, y);
        findPopup.show();
      }
      searchField.requestFocusInWindow();
    }
View Full Code Here

      // have to display once to get the correct size
      int width = findBox.getWidth();
      boolean needsRelocate = (width <= 0);
      int x = loggerOrigin.x + dim.width - width;
      int y = loggerOrigin.y + dim.height - findBox.getHeight();
      PopupFactory popupFactory = PopupFactory.getSharedInstance();
      // TODO(jat): need to track window resize?
      findPopup = popupFactory.getPopup(SwingLoggerPanel.this, findBox, x, y);
      findPopup.show();
      if (needsRelocate) {
        x = loggerOrigin.x + dim.width - findBox.getWidth();
        y = loggerOrigin.y + dim.height - findBox.getHeight();
        findPopup.hide();
        findPopup = popupFactory.getPopup(SwingLoggerPanel.this, findBox, x, y);
        findPopup.show();
      }
      searchField.requestFocusInWindow();
    }
View Full Code Here

    return progressMonitor.isCanceled();
  }

  public void showProgressBar(SwingWorker task) {
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    PopupFactory factory = PopupFactory.getSharedInstance();
    progressBar.setValue(0);
    popup = factory.getPopup(frame.xtabbedEditorPanel, progressBar, 0, 0);
    popup.show();
    popup.hide();
    Rectangle frameRect = frame.xtabbedEditorPanel.getBounds();
    Rectangle barRect = progressBar.getBounds();
    int x = frameRect.x + (frameRect.width - barRect.width) / 2;
    int y = frameRect.y + (frameRect.height - barRect.height) / 2;
    frame.xtabbedEditorPanel.setEnabled(false);
    if (frame.xtabbedToolPanel != null) {
      frame.xtabbedToolPanel.setEnabled(false);
    }
    popup = factory.getPopup(frame.xtabbedEditorPanel, progressBar, x, y);
    popup.show();
    task.addPropertyChangeListener(this);
    task.execute();
  }
View Full Code Here

     * @param y     Screen y location Popup is to be shown at.
     * @return Popup that will show the JPopupMenu
     * @since 1.4
     */
    public Popup getPopup(JPopupMenu popup, int x, int y) {
        PopupFactory popupFactory = PopupFactory.getSharedInstance();

        return popupFactory.getPopup(popup.getInvoker(), popup, x, y);
    }
View Full Code Here

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

     * @param y     Screen y location Popup is to be shown at.
     * @return Popup that will show the JPopupMenu
     * @since 1.4
     */
    public Popup getPopup(JPopupMenu popup, int x, int y) {
        PopupFactory popupFactory = PopupFactory.getSharedInstance();

        return popupFactory.getPopup(popup.getInvoker(), popup, x, y);
    }
View Full Code Here

                if(tip != null) {
                    tip.hide();
                    tip = null;
                }
                if(text != null) {
                    PopupFactory popupFactory = PopupFactory.getSharedInstance();
                    JTextArea textContent = new JTextArea(text);
                    textContent.setFont(UIManager.getFont("ToolTip.font"));
                    textContent.setBackground(UIManager.getColor("ToolTip.background"));
                    textContent.setForeground(UIManager.getColor("ToolTip.foreground"));
                    textContent.setBorder(UIManager.getBorder("ToolTip.border"));
                    Point location = new Point(point);
                    SwingUtilities.convertPointToScreen(location, table.getParent());
                    GraphicsConfiguration gc = table.getGraphicsConfiguration();
                    Rectangle sBounds = gc.getBounds();
                    Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
                    sBounds.x += screenInsets.left;
                    sBounds.y += screenInsets.top;
                    sBounds.width -= screenInsets.left + screenInsets.right;
                    sBounds.height -= screenInsets.top + screenInsets.bottom;
                    Dimension tipSize = textContent.getPreferredSize();
//                  tipSize.height = Math.min(tipSize.height, 500);
                    textContent.setPreferredSize(tipSize);
                    location.x += 20;
                    location.x = Math.min(location.x, sBounds.x + sBounds.width - tipSize.width);
                    if(location.y + tipSize.height > sBounds.y + sBounds.height && location.y - 40 - tipSize.height >= sBounds.y) {
                        location.y -= 40 + tipSize.height;
                    }
                    location.y += 20;
                    tip = popupFactory.getPopup(null, textContent, location.x, location.y);
                    tip.show();
                }
            }
            @Override
            public void tableChanged(TableModelEvent e) {
View Full Code Here

                if(tip != null) {
                    tip.hide();
                    tip = null;
                }
                if(text != null) {
                    PopupFactory popupFactory = PopupFactory.getSharedInstance();
                    JTextArea textContent = new JTextArea(text);
                    textContent.setFont(UIManager.getFont("ToolTip.font"));
                    textContent.setBackground(UIManager.getColor("ToolTip.background"));
                    textContent.setForeground(UIManager.getColor("ToolTip.foreground"));
                    textContent.setBorder(UIManager.getBorder("ToolTip.border"));
                    Point location = new Point(point);
                    SwingUtilities.convertPointToScreen(location, table.getParent());
                    GraphicsConfiguration gc = table.getGraphicsConfiguration();
                    Rectangle sBounds = gc.getBounds();
                    Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
                    sBounds.x += screenInsets.left;
                    sBounds.y += screenInsets.top;
                    sBounds.width -= screenInsets.left + screenInsets.right;
                    sBounds.height -= screenInsets.top + screenInsets.bottom;
                    Dimension tipSize = textContent.getPreferredSize();
//                  tipSize.height = Math.min(tipSize.height, 500);
                    textContent.setPreferredSize(tipSize);
                    location.x += 20;
                    location.x = Math.min(location.x, sBounds.x + sBounds.width - tipSize.width);
                    if(location.y + tipSize.height > sBounds.y + sBounds.height && location.y - 40 - tipSize.height >= sBounds.y) {
                        location.y -= 40 + tipSize.height;
                    }
                    location.y += 20;
                    tip = popupFactory.getPopup(null, textContent, location.x, location.y);
                    tip.show();
                }
            }
View Full Code Here

TOP

Related Classes of javax.swing.PopupFactory$LWPopup

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.