提交 af3df0c6 编写于 作者: A anthony

6802853: API: shaped & translucent windows

Summary: A public API for the feature forward-ported from 6u10.
Reviewed-by: yan
上级 1ae98474
...@@ -440,13 +440,14 @@ public abstract class GraphicsConfiguration { ...@@ -440,13 +440,14 @@ public abstract class GraphicsConfiguration {
* the {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT * the {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
* PERPIXEL_TRANSLUCENT} kind of translucency. * PERPIXEL_TRANSLUCENT} kind of translucency.
* *
* @param gc GraphicsConfiguration
* @throws NullPointerException if the gc argument is null
* @return whether the given GraphicsConfiguration supports * @return whether the given GraphicsConfiguration supports
* the translucency effects. * the translucency effects.
*
* @see Window#setBackground(Color) * @see Window#setBackground(Color)
*
* @since 1.7
*/ */
/*public */boolean isTranslucencyCapable() { public boolean isTranslucencyCapable() {
// Overridden in subclasses // Overridden in subclasses
return false; return false;
} }
......
...@@ -112,10 +112,14 @@ public abstract class GraphicsDevice { ...@@ -112,10 +112,14 @@ public abstract class GraphicsDevice {
*/ */
public final static int TYPE_IMAGE_BUFFER = 2; public final static int TYPE_IMAGE_BUFFER = 2;
/** Kinds of translucency supported by the underlying system. /**
* @see #isTranslucencySupported * Kinds of translucency supported by the underlying system.
*
* @see #isWindowTranslucencySupported
*
* @since 1.7
*/ */
/*public */static enum WindowTranslucency { public static enum WindowTranslucency {
/** /**
* Represents support in the underlying system for windows each pixel * Represents support in the underlying system for windows each pixel
* of which is guaranteed to be either completely opaque, with * of which is guaranteed to be either completely opaque, with
...@@ -246,38 +250,44 @@ public abstract class GraphicsDevice { ...@@ -246,38 +250,44 @@ public abstract class GraphicsDevice {
* full-screen window is not visible, this method will make it visible. * full-screen window is not visible, this method will make it visible.
* It will remain visible when returning to windowed mode. * It will remain visible when returning to windowed mode.
* <p> * <p>
* When returning to windowed mode from an exclusive full-screen window, any * When entering full-screen mode, all the translucency effects are reset for
* display changes made by calling <code>setDisplayMode</code> are * the window. Its shape is set to {@code null}, the opacity value is set to
* 1.0f, and the background color alpha is set to 255 (completely opaque).
* These values are not restored when returning to windowed mode.
* <p>
* When returning to windowed mode from an exclusive full-screen window,
* any display changes made by calling {@code setDisplayMode} are
* automatically restored to their original state. * automatically restored to their original state.
* *
* @param w a window to use as the full-screen window; <code>null</code> * @param w a window to use as the full-screen window; {@code null}
* if returning to windowed mode. Some platforms expect the * if returning to windowed mode. Some platforms expect the
* fullscreen window to be a top-level component (i.e., a Frame); * fullscreen window to be a top-level component (i.e., a Frame);
* therefore it is preferable to use a Frame here rather than a * therefore it is preferable to use a Frame here rather than a
* Window. * Window.
*
* @see #isFullScreenSupported * @see #isFullScreenSupported
* @see #getFullScreenWindow * @see #getFullScreenWindow
* @see #setDisplayMode * @see #setDisplayMode
* @see Component#enableInputMethods * @see Component#enableInputMethods
* @see Component#setVisible * @see Component#setVisible
*
* @since 1.4 * @since 1.4
*/ */
public void setFullScreenWindow(Window w) { public void setFullScreenWindow(Window w) {
if (w != null) { if (w != null) {
//XXX: The actions should be documented in some non-update release.
/*
if (w.getShape() != null) { if (w.getShape() != null) {
w.setShape(w, null); w.setShape(null);
}
if (!w.isOpaque()) {
w.setOpaque(false);
} }
if (w.getOpacity() < 1.0f) { if (w.getOpacity() < 1.0f) {
w.setOpacity(1.0f); w.setOpacity(1.0f);
} }
*/ Color bgColor = w.getBackground();
if (bgColor.getAlpha() < 255) {
bgColor = new Color(bgColor.getRed(), bgColor.getGreen(),
bgColor.getBlue(), 255);
w.setBackground(bgColor);
}
} }
if (fullScreenWindow != null && windowedModeBounds != null) { if (fullScreenWindow != null && windowedModeBounds != null) {
// if the window went into fs mode before it was realized it may // if the window went into fs mode before it was realized it may
// have (0,0) dimensions // have (0,0) dimensions
...@@ -469,13 +479,15 @@ public abstract class GraphicsDevice { ...@@ -469,13 +479,15 @@ public abstract class GraphicsDevice {
} }
/** /**
* Returns whether the given level of translucency is supported * Returns whether the given level of translucency is supported by
* this graphics device. * this graphics device.
* *
* @param translucencyKind a kind of translucency support * @param translucencyKind a kind of translucency support
* @return whether the given translucency kind is supported * @return whether the given translucency kind is supported
*
* @since 1.7
*/ */
/*public */boolean isWindowTranslucencySupported(WindowTranslucency translucencyKind) { public boolean isWindowTranslucencySupported(WindowTranslucency translucencyKind) {
switch (translucencyKind) { switch (translucencyKind) {
case PERPIXEL_TRANSPARENT: case PERPIXEL_TRANSPARENT:
return isWindowShapingSupported(); return isWindowShapingSupported();
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
package java.awt; package java.awt;
import java.awt.event.*; import java.awt.event.*;
import java.awt.geom.Path2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.awt.im.InputContext; import java.awt.im.InputContext;
import java.awt.image.BufferStrategy; import java.awt.image.BufferStrategy;
...@@ -297,6 +298,7 @@ public class Window extends Container implements Accessible { ...@@ -297,6 +298,7 @@ public class Window extends Container implements Accessible {
/* /*
* Opacity level of the window * Opacity level of the window
* *
* @serial
* @see #setOpacity(float) * @see #setOpacity(float)
* @see #getOpacity() * @see #getOpacity()
* @since 1.7 * @since 1.7
...@@ -307,6 +309,7 @@ public class Window extends Container implements Accessible { ...@@ -307,6 +309,7 @@ public class Window extends Container implements Accessible {
* The shape assigned to this window. This field is set to null if * The shape assigned to this window. This field is set to null if
* no shape is set (rectangular window). * no shape is set (rectangular window).
* *
* @serial
* @see #getShape() * @see #getShape()
* @see #setShape(Shape) * @see #setShape(Shape)
* @since 1.7 * @since 1.7
...@@ -3340,32 +3343,78 @@ public class Window extends Container implements Accessible { ...@@ -3340,32 +3343,78 @@ public class Window extends Container implements Accessible {
// ******************** SHAPES & TRANSPARENCY CODE ******************** // ******************** SHAPES & TRANSPARENCY CODE ********************
/** /**
* JavaDoc * Returns the opacity of the window.
*
* @return the opacity of the window
*
* @see Window#setOpacity
* @see GraphicsDevice.WindowTranslucency
*
* @since 1.7
*/ */
/*public */float getOpacity() { public float getOpacity() {
synchronized (getTreeLock()) { synchronized (getTreeLock()) {
return opacity; return opacity;
} }
} }
/** /**
* JavaDoc * Sets the opacity of the window.
* <p>
* The opacity value is in the range [0..1]. Note that setting the opacity
* level of 0 may or may not disable the mouse event handling on this
* window. This is a platform-dependent behavior.
* <p>
* In order for this method to enable the translucency effect, the {@link
* GraphicsDevice#isWindowTranslucencySupported()} method must indicate that
* the {@link GraphicsDevice.WindowTranslucency#TRANSLUCENT TRANSLUCENT}
* translucency is supported.
* <p>
* Also note that the window must not be in the full-screen mode when
* setting the opacity value &lt; 1.0f. Otherwise the {@code
* IllegalComponentStateException} is thrown.
* <p>
* The translucency levels of individual pixels may also be effected by the
* alpha component of their color (see {@link setBackground()}) and the
* current shape of this window (see {@link setShape()}).
*
* @param opacity the opacity level to set to the window
*
* @throws IllegalArgumentException if the opacity is out of the range
* [0..1]
* @throws IllegalComponentStateException if the window is in full screen
* mode, and the opacity is less than 1.0f
* @throws UnsupportedOperationException if the {@code
* GraphicsDevice.WindowTranslucency#TRANSLUCENT TRANSLUCENT}
* translucency kind is not supported and the opacity is less than 1.0f
*
* @see Window#getOpacity
* @see Window#setBackground()
* @see Window#setShape()
* @see GraphicsDevice.WindowTranslucency
* @see GraphicsDevice#isWindowTranslucencySupported()
*
* @since 1.7
*/ */
/*public */void setOpacity(float opacity) { public void setOpacity(float opacity) {
synchronized (getTreeLock()) { synchronized (getTreeLock()) {
if (opacity < 0.0f || opacity > 1.0f) { if (opacity < 0.0f || opacity > 1.0f) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"The value of opacity should be in the range [0.0f .. 1.0f]."); "The value of opacity should be in the range [0.0f .. 1.0f].");
} }
if (opacity < 1.0f) {
GraphicsConfiguration gc = getGraphicsConfiguration(); GraphicsConfiguration gc = getGraphicsConfiguration();
GraphicsDevice gd = gc.getDevice(); GraphicsDevice gd = gc.getDevice();
if (!gd.isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency.TRANSLUCENT)) { if (gc.getDevice().getFullScreenWindow() == this) {
throw new IllegalComponentStateException(
"Setting opacity for full-screen window is not supported.");
}
if (!gd.isWindowTranslucencySupported(
GraphicsDevice.WindowTranslucency.TRANSLUCENT))
{
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
"TRANSLUCENT translucency is not supported."); "TRANSLUCENT translucency is not supported.");
} }
if ((gc.getDevice().getFullScreenWindow() == this) && (opacity < 1.0f)) {
throw new IllegalArgumentException(
"Setting opacity for full-screen window is not supported.");
} }
this.opacity = opacity; this.opacity = opacity;
WindowPeer peer = (WindowPeer)getPeer(); WindowPeer peer = (WindowPeer)getPeer();
...@@ -3376,37 +3425,86 @@ public class Window extends Container implements Accessible { ...@@ -3376,37 +3425,86 @@ public class Window extends Container implements Accessible {
} }
/** /**
* JavaDoc * Returns the shape of the window.
*
* The value returned by this method may not be the same as
* previously set with {@code setShape(shape)}, but it is guaranteed
* to represent the same shape.
*
* @return the shape of the window or {@code null} if no
* shape is specified for the window
*
* @see Window#setShape
* @see GraphicsDevice.WindowTranslucency
*
* @since 1.7
*/ */
/*public */Shape getShape() { public Shape getShape() {
synchronized (getTreeLock()) { synchronized (getTreeLock()) {
return shape; return shape == null ? null : new Path2D.Float(shape);
} }
} }
/** /**
* JavaDoc * Sets the shape of the window.
* <p>
* Setting a shape enables cutting off some parts of the window, leaving
* visible and clickable only those parts belonging to the given shape
* (see {@link Shape}). If the shape argument is null, this methods
* restores the default shape (making the window rectangular on most
* platforms.)
* <p>
* The following conditions must be met in order to set a non-null shape:
* <ul>
* <li>The {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSPARENT
* PERPIXEL_TRANSPARENT} translucency kind must be supported by the
* underlying system (see {@link })
* <i>and</i>
* <li>The window must not be in the full-screen mode (see
* {@link GraphicsDevice#setFullScreenWindow()})
* </ul>
* If a certain condition is not met, either the {@code
* UnsupportedOperationException} or {@code IllegalComponentStateException}
* is thrown.
* <p>
* The tranlucency levels of individual pixels may also be effected by the
* alpha component of their color (see {@link setBackground()}) and the
* opacity value (see {@link setOpacity()}). See {@link
* GraphicsDevice#WindowTranslucency} for more details.
* *
* @param window the window to set the shape to
* @param shape the shape to set to the window * @param shape the shape to set to the window
* @throws IllegalArgumentException if the window is in full screen mode, *
* and the shape is not null * @throws IllegalComponentStateException if the shape is not {@code
* null} and the window is in full-screen mode
* @throws UnsupportedOperationException if the shape is not {@code
* null} and {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSPARENT
* PERPIXEL_TRANSPARENT} translucency is not supported
*
* @see Window#getShape()
* @see Window#setBackgound()
* @see Window#setOpacity()
* @see GraphicsDevice.WindowTranslucency
* @see GraphicsDevice#isWindowTranslucencySupported()
*
* @since 1.7
*/ */
/*public */void setShape(Shape shape) { public void setShape(Shape shape) {
synchronized (getTreeLock()) { synchronized (getTreeLock()) {
if (shape != null) {
GraphicsConfiguration gc = getGraphicsConfiguration(); GraphicsConfiguration gc = getGraphicsConfiguration();
GraphicsDevice gd = gc.getDevice(); GraphicsDevice gd = gc.getDevice();
if (gc.getDevice().getFullScreenWindow() == this) {
throw new IllegalComponentStateException(
"Setting shape for full-screen window is not supported.");
}
if (!gd.isWindowTranslucencySupported( if (!gd.isWindowTranslucencySupported(
GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT)) GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
{ {
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
"PERPIXEL_TRANSPARENT translucency is not supported."); "PERPIXEL_TRANSPARENT translucency is not supported.");
} }
if ((gc.getDevice().getFullScreenWindow() == this) && (shape != null)) {
throw new IllegalArgumentException(
"Setting shape for full-screen window is not supported.");
} }
this.shape = shape; this.shape = (shape == null) ? null : new Path2D.Float(shape);
WindowPeer peer = (WindowPeer)getPeer(); WindowPeer peer = (WindowPeer)getPeer();
if (peer != null) { if (peer != null) {
peer.applyShape(shape == null ? null : Region.getInstance(shape, null)); peer.applyShape(shape == null ? null : Region.getInstance(shape, null));
...@@ -3415,66 +3513,115 @@ public class Window extends Container implements Accessible { ...@@ -3415,66 +3513,115 @@ public class Window extends Container implements Accessible {
} }
/** /**
* JavaDoc * Gets the background color of this window.
* <p>
* Note that the alpha component of the returned color indicates whether
* the window is in the non-opaque (per-pixel translucent) mode.
*
* @return this component's background color
*
* @see Window#setBackground
* @see GraphicsDevice.WindowTranslucency
*/
@Override
public Color getBackground() {
return super.getBackground();
}
/**
* Sets the background color of this window.
* <p>
* If the windowing system supports the {@link
* GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT}
* tranclucency, the alpha component of the given background color
* may effect the mode of operation for this window: it indicates whether
* this window must be opaque (alpha == 1.0f) or per-pixel translucent
* (alpha &lt; 1.0f). All the following conditions must be met in order
* to be able to enable the per-pixel transparency mode for this window:
* <ul>
* <li>The {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
* PERPIXEL_TRANSLUCENT} translucency must be supported
* by the graphics device where this window is located <i>and</i>
* <li>The window must not be in the full-screen mode (see {@link
* GraphicsDevice#setFullScreenWindow()})
* </ul>
* If a certain condition is not met at the time of calling this method,
* the alpha component of the given background color will not effect the
* mode of operation for this window.
* <p>
* When the window is per-pixel translucent, the drawing sub-system
* respects the alpha value of each individual pixel. If a pixel gets
* painted with the alpha color component equal to zero, it becomes
* visually transparent, if the alpha of the pixel is equal to 1.0f, the
* pixel is fully opaque. Interim values of the alpha color component make
* the pixel semi-transparent. In this mode the background of the window
* gets painted with the alpha value of the given background color (meaning
* that it is not painted at all if the alpha value of the argument of this
* method is equal to zero.)
* <p>
* The actual level of translucency of a given pixel also depends on window
* opacity (see {@link setOpacity()}), as well as the current shape of
* this window (see {@link setShape()}).
* <p>
* Note that painting a pixel with the alpha value of 0 may or may not
* disable the mouse event handling on this pixel. This is a
* platform-dependent behavior. To make sure the mouse clicks do not get
* dispatched to a particular pixel, the pixel must be excluded from the
* shape of the window.
* <p>
* Enabling the per-pixel translucency mode may change the graphics
* configuration of this window due to the native platform requirements.
*
* @param bgColor the color to become this window's background color.
*
* @throws IllegalComponentStateException if the alpha value of the given
* background color is less than 1.0f and the window is in
* full-screen mode
* @throws UnsupportedOperationException if the alpha value of the given
* background color is less than 1.0f and
* {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
* PERPIXEL_TRANSLUCENT} translucency is not supported
*
* @see Window#getBackground
* @see Window#setOpacity()
* @see Window#setShape()
* @see GraphicsDevice.WindowTranslucency
* @see GraphicsDevice#isWindowTranslucencySupported()
* @see GraphicsConfiguration#isTranslucencyCapable()
*/ */
/*
@Override @Override
public void setBackground(Color bgColor) { public void setBackground(Color bgColor) {
Color oldBg = getBackground();
if (oldBg != null && oldBg.equals(bgColor)) {
return;
}
super.setBackground(bgColor);
int oldAlpha = oldBg != null ? oldBg.getAlpha() : 255;
int alpha = bgColor.getAlpha(); int alpha = bgColor.getAlpha();
if (alpha < 255) { // non-opaque window if ((oldAlpha == 255) && (alpha < 255)) { // non-opaque window
GraphicsConfiguration gc = getGraphicsConfiguration(); GraphicsConfiguration gc = getGraphicsConfiguration();
GraphicsDevice gd = gc.getDevice(); GraphicsDevice gd = gc.getDevice();
if (gc.getDevice().getFullScreenWindow() == this) { if (gc.getDevice().getFullScreenWindow() == this) {
throw new IllegalArgumentException( throw new IllegalComponentStateException(
"Making full-screen window non opaque is not supported."); "Making full-screen window non opaque is not supported.");
} }
if (!gc.isTranslucencyCapable()) { if (!gc.isTranslucencyCapable()) {
GraphicsConfiguration capableGC = gd.getTranslucencyCapableGC(); GraphicsConfiguration capableGC = gd.getTranslucencyCapableGC();
if (capableGC == null) { if (capableGC == null) {
throw new IllegalArgumentException( throw new UnsupportedOperationException(
"PERPIXEL_TRANSLUCENT translucency is not supported"); "PERPIXEL_TRANSLUCENT translucency is not supported");
} }
// TODO: change GC setGraphicsConfiguration(capableGC);
} }
setLayersOpaque(this, false); setLayersOpaque(this, false);
} else if ((oldAlpha < 255) && (alpha == 255)) {
setLayersOpaque(this, true);
} }
super.setBackground(bgColor);
WindowPeer peer = (WindowPeer)getPeer(); WindowPeer peer = (WindowPeer)getPeer();
if (peer != null) { if (peer != null) {
peer.setOpaque(alpha == 255); peer.setOpaque(alpha == 255);
} }
} }
*/
private transient boolean opaque = true;
void setOpaque(boolean opaque) {
synchronized (getTreeLock()) {
GraphicsConfiguration gc = getGraphicsConfiguration();
if (!opaque && !com.sun.awt.AWTUtilities.isTranslucencyCapable(gc)) {
throw new IllegalArgumentException(
"The window must use a translucency-compatible graphics configuration");
}
if (!com.sun.awt.AWTUtilities.isTranslucencySupported(
com.sun.awt.AWTUtilities.Translucency.PERPIXEL_TRANSLUCENT))
{
throw new UnsupportedOperationException(
"PERPIXEL_TRANSLUCENT translucency is not supported.");
}
if ((gc.getDevice().getFullScreenWindow() == this) && !opaque) {
throw new IllegalArgumentException(
"Making full-screen window non opaque is not supported.");
}
setLayersOpaque(this, opaque);
this.opaque = opaque;
WindowPeer peer = (WindowPeer)getPeer();
if (peer != null) {
peer.setOpaque(opaque);
}
}
}
private void updateWindow(BufferedImage backBuffer) { private void updateWindow(BufferedImage backBuffer) {
synchronized (getTreeLock()) { synchronized (getTreeLock()) {
...@@ -3505,10 +3652,10 @@ public class Window extends Container implements Accessible { ...@@ -3505,10 +3652,10 @@ public class Window extends Container implements Accessible {
} }
lp.setOpaque(isOpaque); lp.setOpaque(isOpaque);
root.setOpaque(isOpaque); root.setOpaque(isOpaque);
root.setDoubleBuffered(isOpaque); //XXX: the "white rect" workaround root.setDoubleBuffered(isOpaque);
if (content != null) { if (content != null) {
content.setOpaque(isOpaque); content.setOpaque(isOpaque);
content.setDoubleBuffered(isOpaque); //XXX: the "white rect" workaround content.setDoubleBuffered(isOpaque);
// Iterate down one level to see whether we have a JApplet // Iterate down one level to see whether we have a JApplet
// (which is also a RootPaneContainer) which requires processing // (which is also a RootPaneContainer) which requires processing
...@@ -3523,36 +3670,6 @@ public class Window extends Container implements Accessible { ...@@ -3523,36 +3670,6 @@ public class Window extends Container implements Accessible {
} }
} }
} }
Color bg = component.getBackground();
boolean hasTransparentBg = TRANSPARENT_BACKGROUND_COLOR.equals(bg);
Container container = null;
if (component instanceof Container) {
container = (Container) component;
}
if (isOpaque) {
if (hasTransparentBg) {
// Note: we use the SystemColor.window color as the default.
// This color is used in the WindowPeer implementations to
// initialize the background color of the window if it is null.
// (This might not be the right thing to do for other
// RootPaneContainers we might be invoked with)
Color newColor = null;
if (container != null && container.preserveBackgroundColor != null) {
newColor = container.preserveBackgroundColor;
} else {
newColor = SystemColor.window;
}
component.setBackground(newColor);
}
} else {
if (!hasTransparentBg && container != null) {
container.preserveBackgroundColor = bg;
}
component.setBackground(TRANSPARENT_BACKGROUND_COLOR);
}
} }
...@@ -3620,20 +3737,16 @@ public class Window extends Container implements Accessible { ...@@ -3620,20 +3737,16 @@ public class Window extends Container implements Accessible {
window.setShape(shape); window.setShape(shape);
} }
public boolean isOpaque(Window window) { public boolean isOpaque(Window window) {
/* Color bg = window.getBackground();
return window.getBackground().getAlpha() < 255; return (bg != null) ? bg.getAlpha() == 255 : true;
*/
synchronized (window.getTreeLock()) {
return window.opaque;
}
} }
public void setOpaque(Window window, boolean opaque) { public void setOpaque(Window window, boolean opaque) {
/*
Color bg = window.getBackground(); Color bg = window.getBackground();
if (bg == null) {
bg = new Color(0, 0, 0, 0);
}
window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(), window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(),
opaque ? 255 : 0)); opaque ? 255 : 0));
*/
window.setOpaque(opaque);
} }
public void updateWindow(Window window, BufferedImage backBuffer) { public void updateWindow(Window window, BufferedImage backBuffer) {
window.updateWindow(backBuffer); window.updateWindow(backBuffer);
......
...@@ -588,9 +588,11 @@ public abstract class EmbeddedFrame extends Frame ...@@ -588,9 +588,11 @@ public abstract class EmbeddedFrame extends Frame
public void setOpacity(float opacity) { public void setOpacity(float opacity) {
} }
public void setOpaque(boolean isOpaque) { public void setOpaque(boolean isOpaque) {
} }
public void updateWindow(BufferedImage backBuffer) {
public void updateWindow(BufferedImage bi) {
} }
public void repositionSecurityWarning() { public void repositionSecurityWarning() {
} }
......
...@@ -2038,37 +2038,34 @@ public abstract class SunToolkit extends Toolkit ...@@ -2038,37 +2038,34 @@ public abstract class SunToolkit extends Toolkit
/** /**
* Returns whether or not a containing top level window for the passed * Returns whether or not a containing top level window for the passed
* component is * component is
* {@link com.sun.awt.AWTUtilities.Translucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT}. * {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT}.
* *
* @param c a Component which toplevel's to check * @param c a Component which toplevel's to check
* @return {@code true} if the passed component is not null and has a * @return {@code true} if the passed component is not null and has a
* containing toplevel window which is opaque (so per-pixel translucency * containing toplevel window which is opaque (so per-pixel translucency
* is not enabled), {@code false} otherwise * is not enabled), {@code false} otherwise
* @see com.sun.awt.AWTUtilities.Translucency#PERPIXEL_TRANSLUCENT * @see GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
* @see com.sun.awt.AWTUtilities#isWindowOpaque(Window)
*/ */
public static boolean isContainingTopLevelOpaque(Component c) { public static boolean isContainingTopLevelOpaque(Component c) {
Window w = getContainingWindow(c); Window w = getContainingWindow(c);
// return w != null && (w).isOpaque(); return w != null && ((Window)w).getBackground() != null &&
return w != null && com.sun.awt.AWTUtilities.isWindowOpaque(w); ((Window)w).getBackground().getAlpha() == 255;
} }
/** /**
* Returns whether or not a containing top level window for the passed * Returns whether or not a containing top level window for the passed
* component is * component is
* {@link com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT TRANSLUCENT}. * {@link GraphicsDevice.WindowTranslucency#TRANSLUCENT TRANSLUCENT}.
* *
* @param c a Component which toplevel's to check * @param c a Component which toplevel's to check
* @return {@code true} if the passed component is not null and has a * @return {@code true} if the passed component is not null and has a
* containing toplevel window which has opacity less than * containing toplevel window which has opacity less than
* 1.0f (which means that it is translucent), {@code false} otherwise * 1.0f (which means that it is translucent), {@code false} otherwise
* @see com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT * @see GraphicsDevice.WindowTranslucency#TRANSLUCENT
* @see com.sun.awt.AWTUtilities#getWindowOpacity(Window)
*/ */
public static boolean isContainingTopLevelTranslucent(Component c) { public static boolean isContainingTopLevelTranslucent(Component c) {
Window w = getContainingWindow(c); Window w = getContainingWindow(c);
// return w != null && (w).getOpacity() < 1.0f; return w != null && ((Window)w).getOpacity() < 1.0f;
return w != null && com.sun.awt.AWTUtilities.getWindowOpacity((Window)w) < 1.0f;
} }
/** /**
......
...@@ -451,9 +451,7 @@ public class X11GraphicsConfig extends GraphicsConfiguration ...@@ -451,9 +451,7 @@ public class X11GraphicsConfig extends GraphicsConfiguration
} }
} }
/*
@Override @Override
*/
public boolean isTranslucencyCapable() { public boolean isTranslucencyCapable() {
return isTranslucencyCapable(getAData()); return isTranslucencyCapable(getAData());
} }
......
...@@ -332,9 +332,7 @@ public class Win32GraphicsConfig extends GraphicsConfiguration ...@@ -332,9 +332,7 @@ public class Win32GraphicsConfig extends GraphicsConfiguration
// the rest of the flip actions are not supported // the rest of the flip actions are not supported
} }
/*
@Override @Override
*/
public boolean isTranslucencyCapable() { public boolean isTranslucencyCapable() {
//XXX: worth checking if 8-bit? Anyway, it doesn't hurt. //XXX: worth checking if 8-bit? Anyway, it doesn't hurt.
return true; return true;
......
...@@ -970,11 +970,12 @@ public abstract class WComponentPeer extends WObjectPeer ...@@ -970,11 +970,12 @@ public abstract class WComponentPeer extends WObjectPeer
* *
* Conditions which could prevent hw acceleration include the toplevel * Conditions which could prevent hw acceleration include the toplevel
* window containing this component being * window containing this component being
* {@link com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT TRANSLUCENT}. * {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
* PERPIXEL_TRANSLUCENT}.
* *
* @return {@code true} if this component is capable of being hw * @return {@code true} if this component is capable of being hw
* accelerated, {@code false} otherwise * accelerated, {@code false} otherwise
* @see com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT * @see GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
*/ */
public boolean isAccelCapable() { public boolean isAccelCapable() {
boolean isTranslucent = boolean isTranslucent =
......
...@@ -335,16 +335,14 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, ...@@ -335,16 +335,14 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
} }
private void updateShape() { private void updateShape() {
// Shape shape = ((Window)target).getShape(); Shape shape = ((Window)target).getShape();
Shape shape = AWTAccessor.getWindowAccessor().getShape((Window)target);
if (shape != null) { if (shape != null) {
applyShape(Region.getInstance(shape, null)); applyShape(Region.getInstance(shape, null));
} }
} }
private void updateOpacity() { private void updateOpacity() {
// float opacity = ((Window)target).getOpacity(); float opacity = ((Window)target).getOpacity();
float opacity = AWTAccessor.getWindowAccessor().getOpacity((Window)target);
if (opacity < 1.0f) { if (opacity < 1.0f) {
setOpacity(opacity); setOpacity(opacity);
} }
...@@ -610,12 +608,14 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, ...@@ -610,12 +608,14 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
public void setOpaque(boolean isOpaque) { public void setOpaque(boolean isOpaque) {
Window target = (Window)getTarget(); Window target = (Window)getTarget();
if (!isOpaque) {
SunToolkit sunToolkit = (SunToolkit)target.getToolkit(); SunToolkit sunToolkit = (SunToolkit)target.getToolkit();
if (!sunToolkit.isWindowTranslucencySupported() || if (!sunToolkit.isWindowTranslucencySupported() ||
!sunToolkit.isTranslucencyCapable(target.getGraphicsConfiguration())) !sunToolkit.isTranslucencyCapable(target.getGraphicsConfiguration()))
{ {
return; return;
} }
}
boolean opaqueChanged = this.isOpaque != isOpaque; boolean opaqueChanged = this.isOpaque != isOpaque;
boolean isVistaOS = Win32GraphicsEnvironment.isVistaOS(); boolean isVistaOS = Win32GraphicsEnvironment.isVistaOS();
...@@ -648,9 +648,9 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, ...@@ -648,9 +648,9 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
// its shape only. To restore the correct visual appearance // its shape only. To restore the correct visual appearance
// of the window (i.e. w/ the correct shape) we have to reset // of the window (i.e. w/ the correct shape) we have to reset
// the shape. // the shape.
Shape shape = AWTAccessor.getWindowAccessor().getShape(target); Shape shape = ((Window)target).getShape();
if (shape != null) { if (shape != null) {
AWTAccessor.getWindowAccessor().setShape(target, shape); ((Window)target).setShape(shape);
} }
} }
...@@ -664,6 +664,11 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, ...@@ -664,6 +664,11 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
return; return;
} }
Component target = (Component)this.target;
if (target.getWidth() <= 0 || target.getHeight() <= 0) {
return;
}
TranslucentWindowPainter currentPainter = painter; TranslucentWindowPainter currentPainter = painter;
if (currentPainter != null) { if (currentPainter != null) {
currentPainter.updateWindow(backBuffer); currentPainter.updateWindow(backBuffer);
......
...@@ -56,7 +56,7 @@ public class TranslucentJAppletTest { ...@@ -56,7 +56,7 @@ public class TranslucentJAppletTest {
frame.add(applet); frame.add(applet);
frame.setBounds(100, 100, 200, 200); frame.setBounds(100, 100, 200, 200);
frame.setUndecorated(true); frame.setUndecorated(true);
com.sun.awt.AWTUtilities.setWindowOpaque(frame, false); frame.setBackground(new Color(0, 0, 0, 0));
frame.setVisible(true); frame.setVisible(true);
} }
......
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
* have any questions. * have any questions.
*/ */
import com.sun.awt.AWTUtilities;
import static com.sun.awt.AWTUtilities.Translucency.*;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.GraphicsConfiguration; import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsDevice.WindowTranslucency;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.awt.RenderingHints; import java.awt.RenderingHints;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
...@@ -93,8 +93,8 @@ public class TSFrame { ...@@ -93,8 +93,8 @@ public class TSFrame {
} }
} }
private static class NonOpaqueJFrame extends JFrame { private static class NonOpaqueJFrame extends JFrame {
NonOpaqueJFrame(GraphicsConfiguration gc) { NonOpaqueJFrame() {
super("NonOpaque Swing JFrame", gc); super("NonOpaque Swing JFrame");
JPanel p = new JPanel() { JPanel p = new JPanel() {
public void paintComponent(Graphics g) { public void paintComponent(Graphics g) {
super.paintComponent(g); super.paintComponent(g);
...@@ -111,8 +111,8 @@ public class TSFrame { ...@@ -111,8 +111,8 @@ public class TSFrame {
} }
private static class NonOpaqueJAppletFrame extends JFrame { private static class NonOpaqueJAppletFrame extends JFrame {
JPanel p; JPanel p;
NonOpaqueJAppletFrame(GraphicsConfiguration gc) { NonOpaqueJAppletFrame() {
super("NonOpaque Swing JAppletFrame", gc); super("NonOpaque Swing JAppletFrame");
JApplet ja = new JApplet() { JApplet ja = new JApplet() {
public void paint(Graphics g) { public void paint(Graphics g) {
super.paint(g); super.paint(g);
...@@ -135,8 +135,8 @@ public class TSFrame { ...@@ -135,8 +135,8 @@ public class TSFrame {
} }
} }
private static class NonOpaqueFrame extends Frame { private static class NonOpaqueFrame extends Frame {
NonOpaqueFrame(GraphicsConfiguration gc) { NonOpaqueFrame() {
super("NonOpaque AWT Frame", gc); super("NonOpaque AWT Frame");
// uncomment to test with hw child // uncomment to test with hw child
// setLayout(null); // setLayout(null);
// Component c = new Panel() { // Component c = new Panel() {
...@@ -166,7 +166,7 @@ public class TSFrame { ...@@ -166,7 +166,7 @@ public class TSFrame {
} }
} }
public static Frame createGui(GraphicsConfiguration gc, public static Frame createGui(
final boolean useSwing, final boolean useSwing,
final boolean useShape, final boolean useShape,
final boolean useTransl, final boolean useTransl,
...@@ -176,21 +176,16 @@ public class TSFrame { ...@@ -176,21 +176,16 @@ public class TSFrame {
Frame frame; Frame frame;
done = false; done = false;
if (gc == null) {
gc = GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration();
}
if (useNonOpaque) { if (useNonOpaque) {
if (useSwing) { if (useSwing) {
frame = new NonOpaqueJFrame(gc); frame = new NonOpaqueJFrame();
// frame = new NonOpaqueJAppletFrame(gc); // frame = new NonOpaqueJAppletFrame(gc);
} else { } else {
frame = new NonOpaqueFrame(gc); frame = new NonOpaqueFrame();
} }
animateComponent(frame); animateComponent(frame);
} else if (useSwing) { } else if (useSwing) {
frame = new JFrame("Swing Frame", gc); frame = new JFrame("Swing Frame");
JComponent p = new JButton("Swing!"); JComponent p = new JButton("Swing!");
p.setPreferredSize(new Dimension(200, 100)); p.setPreferredSize(new Dimension(200, 100));
frame.add("North", p); frame.add("North", p);
...@@ -198,7 +193,7 @@ public class TSFrame { ...@@ -198,7 +193,7 @@ public class TSFrame {
animateComponent(p); animateComponent(p);
frame.add("Center", p); frame.add("Center", p);
} else { } else {
frame = new Frame("AWT Frame", gc) { frame = new Frame("AWT Frame") {
public void paint(Graphics g) { public void paint(Graphics g) {
g.setColor(Color.red); g.setColor(Color.red);
g.fillRect(0, 0, 100, 100); g.fillRect(0, 0, 100, 100);
...@@ -239,11 +234,11 @@ public class TSFrame { ...@@ -239,11 +234,11 @@ public class TSFrame {
frame.setLocation(450, 10); frame.setLocation(450, 10);
frame.pack(); frame.pack();
GraphicsDevice gd = frame.getGraphicsConfiguration().getDevice();
if (useShape) { if (useShape) {
if (AWTUtilities.isTranslucencySupported(PERPIXEL_TRANSPARENT)) { if (gd.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSPARENT)) {
System.out.println("applying PERPIXEL_TRANSPARENT"); System.out.println("applying PERPIXEL_TRANSPARENT");
AWTUtilities.setWindowShape(frame, frame.setShape(new Ellipse2D.Double(0, 0, frame.getWidth(),
new Ellipse2D.Double(0, 0, frame.getWidth(),
frame.getHeight()/3)); frame.getHeight()/3));
frame.setTitle("PERPIXEL_TRANSPARENT"); frame.setTitle("PERPIXEL_TRANSPARENT");
} else { } else {
...@@ -251,20 +246,18 @@ public class TSFrame { ...@@ -251,20 +246,18 @@ public class TSFrame {
} }
} }
if (useTransl) { if (useTransl) {
if (AWTUtilities.isTranslucencySupported(TRANSLUCENT)) { if (gd.isWindowTranslucencySupported(WindowTranslucency.TRANSLUCENT)) {
System.out.println("applying TRANSLUCENT"); System.out.println("applying TRANSLUCENT");
AWTUtilities.setWindowOpacity(frame, factor); frame.setOpacity(factor);
frame.setTitle("TRANSLUCENT"); frame.setTitle("TRANSLUCENT");
} else { } else {
System.out.println("Passed: TRANSLUCENT unsupported"); System.out.println("Passed: TRANSLUCENT unsupported");
} }
} }
if (useNonOpaque) { if (useNonOpaque) {
if (AWTUtilities.isTranslucencySupported(PERPIXEL_TRANSLUCENT) && if (gd.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSLUCENT)) {
AWTUtilities.isTranslucencyCapable(gc))
{
System.out.println("applying PERPIXEL_TRANSLUCENT"); System.out.println("applying PERPIXEL_TRANSLUCENT");
AWTUtilities.setWindowOpaque(frame, false); frame.setBackground(new Color(0, 0, 0, 0));
frame.setTitle("PERPIXEL_TRANSLUCENT"); frame.setTitle("PERPIXEL_TRANSLUCENT");
} else { } else {
System.out.println("Passed: PERPIXEL_TRANSLUCENT unsupported"); System.out.println("Passed: PERPIXEL_TRANSLUCENT unsupported");
...@@ -295,7 +288,7 @@ public class TSFrame { ...@@ -295,7 +288,7 @@ public class TSFrame {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {
TSFrame.createGui(null, useSwing, TSFrame.createGui(useSwing,
useShape, useShape,
useTransl, useTransl,
useNonOpaque, useNonOpaque,
......
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
* @run main/manual/othervm -Dsun.java2d.noddraw=true TranslucentShapedFrameTest * @run main/manual/othervm -Dsun.java2d.noddraw=true TranslucentShapedFrameTest
* @run main/manual/othervm -Dsun.java2d.opengl=True TranslucentShapedFrameTest * @run main/manual/othervm -Dsun.java2d.opengl=True TranslucentShapedFrameTest
*/ */
import com.sun.awt.AWTUtilities; import java.awt.Color;
import static com.sun.awt.AWTUtilities.Translucency.*;
import java.awt.Frame; import java.awt.Frame;
import java.awt.GraphicsConfiguration; import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice; import java.awt.GraphicsDevice;
import java.awt.GraphicsDevice.WindowTranslucency;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.awt.Shape; import java.awt.Shape;
import java.awt.geom.Ellipse2D; import java.awt.geom.Ellipse2D;
...@@ -130,7 +130,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame { ...@@ -130,7 +130,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame {
jLabel2.setText("Instructions:"); jLabel2.setText("Instructions:");
passedBtn.setBackground(new java.awt.Color(129, 255, 100)); passedBtn.setBackground(new Color(129, 255, 100));
passedBtn.setText("Passed"); passedBtn.setText("Passed");
passedBtn.addActionListener(new java.awt.event.ActionListener() { passedBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { public void actionPerformed(java.awt.event.ActionEvent evt) {
...@@ -138,7 +138,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame { ...@@ -138,7 +138,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame {
} }
}); });
failedBtn.setBackground(java.awt.Color.red); failedBtn.setBackground(Color.red);
failedBtn.setText("Failed"); failedBtn.setText("Failed");
failedBtn.addActionListener(new java.awt.event.ActionListener() { failedBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { public void actionPerformed(java.awt.event.ActionEvent evt) {
...@@ -234,7 +234,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame { ...@@ -234,7 +234,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame {
private void nonOpaqueChbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nonOpaqueChbActionPerformed private void nonOpaqueChbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nonOpaqueChbActionPerformed
if (testFrame != null) { if (testFrame != null) {
// REMIND: this path in the test doesn't work well (test bug) // REMIND: this path in the test doesn't work well (test bug)
// AWTUtilities.setWindowOpaque(testFrame, !nonOpaqueChb.isSelected()); testFrame.setBackground(new Color(0, 0, 0, nonOpaqueChb.isSelected() ? 0 : 255));
} }
}//GEN-LAST:event_nonOpaqueChbActionPerformed }//GEN-LAST:event_nonOpaqueChbActionPerformed
...@@ -246,7 +246,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame { ...@@ -246,7 +246,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame {
testFrame.getWidth(), testFrame.getWidth(),
testFrame.getHeight()); testFrame.getHeight());
} }
AWTUtilities.setWindowShape(testFrame, s); testFrame.setShape(s);
} }
}//GEN-LAST:event_shapedCbActionPerformed }//GEN-LAST:event_shapedCbActionPerformed
...@@ -254,7 +254,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame { ...@@ -254,7 +254,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame {
JSlider source = (JSlider)evt.getSource(); JSlider source = (JSlider)evt.getSource();
int transl = transparencySld.getValue(); int transl = transparencySld.getValue();
if (testFrame != null) { if (testFrame != null) {
AWTUtilities.setWindowOpacity(testFrame, (float)transl/100f); testFrame.setOpacity((float)transl/100f);
} }
}//GEN-LAST:event_transparencySldStateChanged }//GEN-LAST:event_transparencySldStateChanged
...@@ -276,7 +276,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame { ...@@ -276,7 +276,7 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame {
private void createFrameBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createFrameBtnActionPerformed private void createFrameBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createFrameBtnActionPerformed
disposeFrameBtnActionPerformed(evt); disposeFrameBtnActionPerformed(evt);
int transl = transparencySld.getValue(); int transl = transparencySld.getValue();
testFrame = TSFrame.createGui(gcToUse, testFrame = TSFrame.createGui(
useSwingCb.isSelected(), shapedCb.isSelected(), useSwingCb.isSelected(), shapedCb.isSelected(),
(transl < 100), nonOpaqueChb.isSelected(), (transl < 100), nonOpaqueChb.isSelected(),
(float)transl/100f); (float)transl/100f);
...@@ -308,38 +308,18 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame { ...@@ -308,38 +308,18 @@ public class TranslucentShapedFrameTest extends javax.swing.JFrame {
} }
private void checkEffects() { private void checkEffects() {
if (!AWTUtilities.isTranslucencySupported(PERPIXEL_TRANSPARENT)) { GraphicsDevice gd = getGraphicsConfiguration().getDevice();
if (!gd.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSPARENT)) {
shapedCb.setEnabled(false); shapedCb.setEnabled(false);
} }
if (!gd.isWindowTranslucencySupported(WindowTranslucency.TRANSLUCENT)) {
if (!AWTUtilities.isTranslucencySupported(TRANSLUCENT)) {
transparencySld.setEnabled(false); transparencySld.setEnabled(false);
} }
if (!gd.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSLUCENT)) {
GraphicsConfiguration gc = null;
if (AWTUtilities.isTranslucencySupported(PERPIXEL_TRANSLUCENT)) {
gc = findGraphicsConfig();
if (gc == null) {
nonOpaqueChb.setEnabled(false); nonOpaqueChb.setEnabled(false);
} }
} }
gcToUse = gc;
}
private GraphicsConfiguration findGraphicsConfig() {
GraphicsDevice gd =
GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice();
GraphicsConfiguration gcs[] = gd.getConfigurations();
for (GraphicsConfiguration gc : gcs) {
if (AWTUtilities.isTranslucencyCapable(gc)) {
return gc;
}
}
return null;
}
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup createDisposeGrp; private javax.swing.ButtonGroup createDisposeGrp;
private javax.swing.JToggleButton createFrameBtn; private javax.swing.JToggleButton createFrameBtn;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册