本文整理匯總了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;
}
}
示例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();
}
示例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;
}
示例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
}