当前位置: 首页>>代码示例>>Java>>正文


Java RootPaneContainer.getGlassPane方法代码示例

本文整理汇总了Java中javax.swing.RootPaneContainer.getGlassPane方法的典型用法代码示例。如果您正苦于以下问题:Java RootPaneContainer.getGlassPane方法的具体用法?Java RootPaneContainer.getGlassPane怎么用?Java RootPaneContainer.getGlassPane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.RootPaneContainer的用法示例。


在下文中一共展示了RootPaneContainer.getGlassPane方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOrNull

import javax.swing.RootPaneContainer; //导入方法依赖的package包/类
public static final MetasfreshGlassPane getOrNull(final RootPaneContainer rootPaneContainer)
{
	if (rootPaneContainer == null)
	{
		return null;
	}

	final Component glassPaneComp = rootPaneContainer.getGlassPane();
	if (glassPaneComp instanceof MetasfreshGlassPane)
	{
		return (MetasfreshGlassPane)glassPaneComp;
	}
	else
	{
		return null;
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:18,代码来源:MetasfreshGlassPane.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: 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

示例4: 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


注:本文中的javax.swing.RootPaneContainer.getGlassPane方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。