4013 /** 4014 * Size of the back buffers. (Note: these fields were added in 6.0 4015 * but kept package-private to avoid exposing them in the spec. 4016 * None of these fields/methods really should have been marked 4017 * protected when they were introduced in 1.4, but now we just have 4018 * to live with that decision.) 4019 */ 4020 4021 /** 4022 * The width of the back buffers 4023 */ 4024 int width; 4025 4026 /** 4027 * The height of the back buffers 4028 */ 4029 int height; 4030 4031 /** 4032 * Creates a new flipping buffer strategy for this component. 4033 * The component must be a <code>Canvas</code> or <code>Window</code>. 4034 * @see Canvas 4035 * @see Window 4036 * @param numBuffers the number of buffers 4037 * @param caps the capabilities of the buffers 4038 * @exception AWTException if the capabilities supplied could not be 4039 * supported or met 4040 * @exception ClassCastException if the component is not a canvas or 4041 * window. 4042 * @exception IllegalStateException if the component has no peer 4043 * @exception IllegalArgumentException if {@code numBuffers} is less than two, 4044 * or if {@code BufferCapabilities.isPageFlipping} is not 4045 * {@code true}. 4046 * @see #createBuffers(int, BufferCapabilities) 4047 */ 4048 protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps) 4049 throws AWTException 4050 { 4051 if (!(Component.this instanceof Window) && 4052 !(Component.this instanceof Canvas)) 4053 { 4054 throw new ClassCastException( 4055 "Component must be a Canvas or Window"); 4056 } 4057 this.numBuffers = numBuffers; 4058 this.caps = caps; 4059 createBuffers(numBuffers, caps); 4060 } 4061 4062 /** 4063 * Creates one or more complex, flipping buffers with the given 4064 * capabilities. 4065 * @param numBuffers number of buffers to create; must be greater than 4066 * one 4067 * @param caps the capabilities of the buffers. 4068 * <code>BufferCapabilities.isPageFlipping</code> must be 4069 * <code>true</code>. 4070 * @exception AWTException if the capabilities supplied could not be 4071 * supported or met 4072 * @exception IllegalStateException if the component has no peer 4073 * @exception IllegalArgumentException if numBuffers is less than two, 4074 * or if <code>BufferCapabilities.isPageFlipping</code> is not 4075 * <code>true</code>. | 4013 /** 4014 * Size of the back buffers. (Note: these fields were added in 6.0 4015 * but kept package-private to avoid exposing them in the spec. 4016 * None of these fields/methods really should have been marked 4017 * protected when they were introduced in 1.4, but now we just have 4018 * to live with that decision.) 4019 */ 4020 4021 /** 4022 * The width of the back buffers 4023 */ 4024 int width; 4025 4026 /** 4027 * The height of the back buffers 4028 */ 4029 int height; 4030 4031 /** 4032 * Creates a new flipping buffer strategy for this component. 4033 * The component must be a <code>Canvas</code> or <code>Window</code> or 4034 * <code>Applet</code>. 4035 * @see Canvas 4036 * @see Window 4037 * @see Applet 4038 * @param numBuffers the number of buffers 4039 * @param caps the capabilities of the buffers 4040 * @exception AWTException if the capabilities supplied could not be 4041 * supported or met 4042 * @exception ClassCastException if the component is not a canvas or 4043 * window. 4044 * @exception IllegalStateException if the component has no peer 4045 * @exception IllegalArgumentException if {@code numBuffers} is less than two, 4046 * or if {@code BufferCapabilities.isPageFlipping} is not 4047 * {@code true}. 4048 * @see #createBuffers(int, BufferCapabilities) 4049 */ 4050 protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps) 4051 throws AWTException 4052 { 4053 if (!(Component.this instanceof Window) && 4054 !(Component.this instanceof Canvas) && 4055 !(Component.this instanceof Applet)) 4056 { 4057 throw new ClassCastException( 4058 "Component must be a Canvas or Window or Applet"); 4059 } 4060 this.numBuffers = numBuffers; 4061 this.caps = caps; 4062 createBuffers(numBuffers, caps); 4063 } 4064 4065 /** 4066 * Creates one or more complex, flipping buffers with the given 4067 * capabilities. 4068 * @param numBuffers number of buffers to create; must be greater than 4069 * one 4070 * @param caps the capabilities of the buffers. 4071 * <code>BufferCapabilities.isPageFlipping</code> must be 4072 * <code>true</code>. 4073 * @exception AWTException if the capabilities supplied could not be 4074 * supported or met 4075 * @exception IllegalStateException if the component has no peer 4076 * @exception IllegalArgumentException if numBuffers is less than two, 4077 * or if <code>BufferCapabilities.isPageFlipping</code> is not 4078 * <code>true</code>. |