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>. | 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 !(Component.this instanceof Applet)) 4054 { 4055 throw new ClassCastException( 4056 "Component must be a Canvas or Window or Applet"); 4057 } 4058 this.numBuffers = numBuffers; 4059 this.caps = caps; 4060 createBuffers(numBuffers, caps); 4061 } 4062 4063 /** 4064 * Creates one or more complex, flipping buffers with the given 4065 * capabilities. 4066 * @param numBuffers number of buffers to create; must be greater than 4067 * one 4068 * @param caps the capabilities of the buffers. 4069 * <code>BufferCapabilities.isPageFlipping</code> must be 4070 * <code>true</code>. 4071 * @exception AWTException if the capabilities supplied could not be 4072 * supported or met 4073 * @exception IllegalStateException if the component has no peer 4074 * @exception IllegalArgumentException if numBuffers is less than two, 4075 * or if <code>BufferCapabilities.isPageFlipping</code> is not 4076 * <code>true</code>. |