use of javax.swing.RootPaneContainer in project com.revolsys.open by revolsys.
the class AbstractRunnable method run.
@Override
public final void run() {
try {
if (isShowWaitCursor() && isEventDispatchThread()) {
final Window activeWindow = getActiveWindow();
if (activeWindow == null) {
runDo();
} else {
Component component;
Component glassPane = null;
if (activeWindow instanceof RootPaneContainer) {
final RootPaneContainer container = (RootPaneContainer) activeWindow;
glassPane = container.getGlassPane();
glassPane.setVisible(true);
component = glassPane;
} else {
component = activeWindow;
}
final Cursor cursor = activeWindow.getCursor();
try {
component.setCursor(WAIT_CURSOR);
runDo();
} finally {
if (glassPane != null) {
glassPane.setVisible(false);
}
component.setCursor(cursor);
}
}
} else {
runDo();
}
} catch (final Throwable t) {
Logs.error(this, t);
}
}
use of javax.swing.RootPaneContainer in project com.revolsys.open by revolsys.
the class AbstractSwingWorker method done.
@Override
protected final void done() {
final Window activeWindow = SwingUtil.getActiveWindow();
if (isShowBusyCursor() && activeWindow != null) {
Component component;
Component glassPane = null;
if (activeWindow instanceof RootPaneContainer) {
final RootPaneContainer container = (RootPaneContainer) activeWindow;
glassPane = container.getGlassPane();
SwingUtil.setVisible(glassPane, true);
component = glassPane;
} else {
component = activeWindow;
}
final Cursor cursor = activeWindow.getCursor();
try {
component.setCursor(WAIT_CURSOR);
doDoneTask();
} finally {
if (glassPane != null) {
SwingUtil.setVisible(glassPane, false);
}
component.setCursor(cursor);
}
} else {
doDoneTask();
}
}
use of javax.swing.RootPaneContainer in project CodenameOne by codenameone.
the class BlockingAction method run.
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);
}
}
use of javax.swing.RootPaneContainer in project CodenameOne by codenameone.
the class BaseForm method setOverrideMode.
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());
}
}
use of javax.swing.RootPaneContainer in project vcell by virtualcell.
the class ClientMDIManager method blockWindow.
public static Window blockWindow(Component component) {
Window window = (Window) BeanUtils.findTypeParentOfComponent(component, Window.class);
if (window instanceof RootPaneContainer) {
GlassPane glass = new GlassPane(true);
((RootPaneContainer) window).setGlassPane(glass);
glass.setVisible(true);
}
return window;
}
Aggregations