/** * Returns whether or not the given component is a managed window. * * @param aComponent * the component to test, can be <code>null</code>. * @return <code>false</code> if the given component is not a managed window * (or <code>null</code>), <code>true</code> if it is. */ private boolean isManagedWindow( final Window aComponent ) { if ( aComponent == null ) { return false; } return ( ( aComponent instanceof JFrame ) && !( ( JFrame )aComponent ).isUndecorated() ) || ( ( aComponent instanceof JDialog ) && !( ( JDialog )aComponent ).isUndecorated() ); }
/** * @see javax.swing.plaf.ComponentUI#update(java.awt.Graphics, javax.swing.JComponent) */ public void update(Graphics g, JComponent c) { SeaGlassContext context = getContext(c); SeaGlassLookAndFeel.update(context, g); if (((JRootPane) c).getWindowDecorationStyle() != JRootPane.NONE) { context.getPainter().paintRootPaneBackground(context, g, 0, 0, c.getWidth(), c.getHeight()); } else if (PlatformUtils.isMac()) { // We may need to paint the rootpane on a Mac if the window is // decorated. boolean shouldPaint = false; Container toplevelContainer = c.getParent(); if (toplevelContainer instanceof JFrame) { shouldPaint = !((JFrame) toplevelContainer).isUndecorated(); } if (shouldPaint) { if (!paintTextured) { g.setColor(c.getBackground()); g.fillRect(0, 0, c.getWidth(), c.getHeight()); } else if (isWindowFocused.isInState(c)) { contentActive.paint((Graphics2D) g, c, c.getWidth(), c.getHeight()); } else { contentInactive.paint((Graphics2D) g, c, c.getWidth(), c.getHeight()); } } } paint(context, g); context.dispose(); }
frame.setResizable(resizable); frame.setUndecorated(undecorated); if (frame.isUndecorated()) { frame.setOpacity(opacity);
mainWindow.mediaPlayer.stop(); if (!mainWindow.isUndecorated()) { mainWindow.dispose(); mainWindow.setAlwaysOnTop(true);