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: /**
19: * @author Sergey Burlak
20: * @version $Revision$
21: */package javax.swing.plaf.basic;
22:
23: import javax.swing.JComponent;
24: import javax.swing.LookAndFeel;
25: import javax.swing.plaf.ComponentUI;
26: import javax.swing.plaf.ViewportUI;
27:
28: public class BasicViewportUI extends ViewportUI {
29:
30: private static BasicViewportUI basicViewportUI;
31:
32: public BasicViewportUI() {
33: }
34:
35: public void uninstallUI(final JComponent c) {
36: uninstallDefaults(c);
37: }
38:
39: protected void uninstallDefaults(final JComponent c) {
40: }
41:
42: public void installUI(final JComponent c) {
43: installDefaults(c);
44: }
45:
46: protected void installDefaults(final JComponent c) {
47: LookAndFeel.installColorsAndFont(c, "Viewport.background",
48: "Viewport.foreground", "Viewport.font");
49: LookAndFeel.installProperty(c, "opaque", Boolean.TRUE);
50: }
51:
52: public static ComponentUI createUI(final JComponent c) {
53: if (basicViewportUI == null) {
54: basicViewportUI = new BasicViewportUI();
55: }
56:
57: return basicViewportUI;
58: }
59:
60: }
|