當前位置: 首頁>>代碼示例>>Java>>正文


Java RootPaneContainer.setGlassPane方法代碼示例

本文整理匯總了Java中javax.swing.RootPaneContainer.setGlassPane方法的典型用法代碼示例。如果您正苦於以下問題:Java RootPaneContainer.setGlassPane方法的具體用法?Java RootPaneContainer.setGlassPane怎麽用?Java RootPaneContainer.setGlassPane使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.RootPaneContainer的用法示例。


在下文中一共展示了RootPaneContainer.setGlassPane方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showSpyDialog

import javax.swing.RootPaneContainer; //導入方法依賴的package包/類
/**
 * Shows spy dialog or reload existing one.
 *
 * @param rootComponent root component
 * @param component current component
 */
public void showSpyDialog(final Component rootComponent, final Component component) {
	if (spyDialog != null) {
		spyDialog.setVisible(true);
		spyGlass.setVisible(true);
		spyPanel.reload(rootComponent, component);
		return;
	}
	if (rootComponent instanceof RootPaneContainer) {
		RootPaneContainer rootPane = (RootPaneContainer) rootComponent;
		spyGlass = new SwingSpyGlassPane(rootPane);
		rootPane.setGlassPane(spyGlass);
		rootPane.getGlassPane().setVisible(true);
		Toolkit.getDefaultToolkit().addAWTEventListener(spyGlass, AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
	}

	SwingUtilities.invokeLater(new Runnable() {
		public void run() {
			initSpyDialog(rootComponent, component);
		}
	});
}
 
開發者ID:igr,項目名稱:swingspy,代碼行數:28,代碼來源:SwingSpy.java

示例2: actionPerformed

import javax.swing.RootPaneContainer; //導入方法依賴的package包/類
public final void actionPerformed(ActionEvent e) {
    RootPaneContainer r = (RootPaneContainer)ResourceEditorApp.getApplication().getMainFrame();
    glassPane = r.getGlassPane();
    final ImageIcon progress = new ImageIcon(getClass().getResource("/progress.gif"));
    final JComponent c = new JLabel(progress);
    c.addMouseListener(new MouseAdapter() {});
    c.addKeyListener(new KeyAdapter() {});
    r.setGlassPane(c);
    c.setVisible(true);
    t = new Timer(100, new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            rotation += 10;
            if(rotation > 359) {
                rotation = 0;
            }
            c.repaint();
        }
    });
    t.setRepeats(true);
    t.start();
    start();
    new Thread(this).start();
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:24,代碼來源:BlockingAction.java

示例3: run

import javax.swing.RootPaneContainer; //導入方法依賴的package包/類
public final void run() {
    try {
        exectute();
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                afterComplete();
            }
        });
    } catch(Exception err) {
        err.printStackTrace();
    } finally {
        t.stop();
        RootPaneContainer r = (RootPaneContainer)ResourceEditorApp.getApplication().getMainFrame();
        r.setGlassPane(glassPane);
    }
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:17,代碼來源:BlockingAction.java

示例4: setOverrideMode

import javax.swing.RootPaneContainer; //導入方法依賴的package包/類
public synchronized void setOverrideMode(boolean overrideMode, java.awt.Component c) {
    RootPaneContainer r = (RootPaneContainer)SwingUtilities.windowForComponent(c);
    if(overrideMode) {
        if(overrideImage == null) {
            overrideImage = new ImageIcon(getClass().getResource("/override_stamp.png"));
        }
        PainterGlasspane pg = new PainterGlasspane();
        MattePainter matte = new MattePainter(new Color(0xcc,0xcc, 0xcc, 120)) {
            protected  void doPaint(java.awt.Graphics2D g, java.lang.Object component, int width, int height) {
                super.doPaint(g, component, width, height);
                overrideImage.paintIcon(BaseForm.this, g, 0, 0);
                //g.drawImage(overrideImage.getImage(), width / 2 - overrideImage.getIconWidth() / 2, 0, BaseForm.this);
            }
        };
        pg.setPainter(matte);
        pg.addTarget(this);
        r.setGlassPane(pg);
        pg.setBounds(0, 0, r.getContentPane().getWidth(), r.getContentPane().getHeight());
        pg.setVisible(true);
    } else {
        r.setGlassPane(new JLabel());
    }
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:24,代碼來源:BaseForm.java

示例5: mount

import javax.swing.RootPaneContainer; //導入方法依賴的package包/類
public synchronized static <T extends Component> T mount(Component startComponent, boolean stopClosing,
	boolean alwaysRecreateGlasspane, Class<T> paneClass, GlassPaneCallback<T> callback)
{
	RootPaneContainer rootpane = getRootContainer(startComponent);
	if( rootpane != null )
	{
		Component gp = rootpane.getGlassPane();
		if( !alwaysRecreateGlasspane )
		{
			if( paneClass.isAssignableFrom(gp.getClass()) )
			{
				if( !gp.isVisible() )
				{
					T ogp = paneClass.cast(gp);
					callback.processExisting(ogp);
					return ogp;
				}
				else
				{
					return null;
				}
			}
		}

		T ngp = callback.construct();
		rootpane.setGlassPane(ngp);
		return ngp;
	}
	return null;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:31,代碼來源:GlassPaneUtils.java

示例6: FreeMindTask

import javax.swing.RootPaneContainer; //導入方法依賴的package包/類
public FreeMindTask(RootPaneContainer pRootPaneContainer, int pAmountOfSteps, String pName) {
	super(pName);
	mFrame = pRootPaneContainer;
	mAmountOfSteps = pAmountOfSteps;
	mProgressMonitor = new FreeMindProgressMonitor(getName());
	mGlass = new JPanel(new GridLayout(0, 1));
	JLabel padding = new JLabel();
	mGlass.setOpaque(false);
	mGlass.add(padding);

	// trap both mouse and key events. Could provide a smarter
	// key handler if you wanted to allow things like a keystroke
	// that would cancel the long-running operation.
	mGlass.addMouseListener(new MouseAdapter() {
	});
	mGlass.addMouseMotionListener(new MouseMotionAdapter() {
	});
	mGlass.addKeyListener(new KeyAdapter() {
	});

	// make sure the focus won't leave the glass pane
	mGlass.setFocusCycleRoot(true); // 1.4
	mOldGlassPane = pRootPaneContainer.getGlassPane();
	pRootPaneContainer.setGlassPane(mGlass);
	mGlass.setVisible(true);
	padding.requestFocus();  // required to trap key events
}
 
開發者ID:iwabuchiken,項目名稱:freemind_1.0.0_20140624_214725,代碼行數:28,代碼來源:FreeMindTask.java

示例7: BaseForm

import javax.swing.RootPaneContainer; //導入方法依賴的package包/類
public BaseForm() {
    RootPaneContainer r = (RootPaneContainer)ResourceEditorApp.getApplication().getMainFrame();
    r.setGlassPane(new JLabel());
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:5,代碼來源:BaseForm.java


注:本文中的javax.swing.RootPaneContainer.setGlassPane方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。