01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Alexey A. Petrenko
19: * @version $Revision$
20: */package java.awt;
21:
22: /**
23: * BufferCapabilities
24: *
25: */
26: public class BufferCapabilities implements Cloneable {
27: private final ImageCapabilities frontBufferCapabilities;
28: private final ImageCapabilities backBufferCapabilities;
29: private final FlipContents flipContents;
30:
31: public BufferCapabilities(
32: ImageCapabilities frontBufferCapabilities,
33: ImageCapabilities backBufferCapabilities,
34: FlipContents flipContents) {
35: if (frontBufferCapabilities == null
36: || backBufferCapabilities == null) {
37: throw new IllegalArgumentException();
38: }
39:
40: this .frontBufferCapabilities = frontBufferCapabilities;
41: this .backBufferCapabilities = backBufferCapabilities;
42: this .flipContents = flipContents;
43: }
44:
45: @Override
46: public Object clone() {
47: return new BufferCapabilities(frontBufferCapabilities,
48: backBufferCapabilities, flipContents);
49: }
50:
51: public ImageCapabilities getFrontBufferCapabilities() {
52: return frontBufferCapabilities;
53: }
54:
55: public ImageCapabilities getBackBufferCapabilities() {
56: return backBufferCapabilities;
57: }
58:
59: public FlipContents getFlipContents() {
60: return flipContents;
61: }
62:
63: public boolean isPageFlipping() {
64: return flipContents != null;
65: }
66:
67: public boolean isFullScreenRequired() {
68: return false;
69: }
70:
71: public boolean isMultiBufferAvailable() {
72: return false;
73: }
74:
75: public static final class FlipContents {
76: public static final FlipContents BACKGROUND = new FlipContents();
77: public static final FlipContents COPIED = new FlipContents();
78: public static final FlipContents PRIOR = new FlipContents();
79: public static final FlipContents UNDEFINED = new FlipContents();
80:
81: private FlipContents() {
82:
83: }
84:
85: @Override
86: public int hashCode() {
87: return super .hashCode();
88: }
89:
90: @Override
91: public String toString() {
92: return super.toString();
93: }
94: }
95: }
|