01: /*
02: * Copyright 2005 Paul Hinds
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.tp23.antinstaller.renderer.swing;
17:
18: import java.awt.Dimension;
19:
20: import javax.swing.Action;
21: import javax.swing.Icon;
22: import javax.swing.JRadioButton;
23:
24: /**
25: * A JRadioButton with altered prefered size to facilitate fixing the width
26: * but still using a GridBagLayout
27: * @author Paul Hinds
28: * @version $Id: AIRadioButton.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $
29: */
30: public class AIRadioButton extends JRadioButton {
31:
32: public AIRadioButton() {
33: super ();
34: }
35:
36: public AIRadioButton(String text) {
37: super (text);
38: }
39:
40: public AIRadioButton(String text, boolean selected) {
41: super (text, selected);
42: }
43:
44: public AIRadioButton(Action a) {
45: super (a);
46: }
47:
48: public AIRadioButton(Icon icon) {
49: super (icon);
50: }
51:
52: public AIRadioButton(Icon icon, boolean selected) {
53: super (icon, selected);
54: }
55:
56: public AIRadioButton(String text, Icon icon) {
57: super (text, icon);
58: }
59:
60: public AIRadioButton(String text, Icon icon, boolean selected) {
61: super (text, icon, selected);
62: }
63:
64: private Dimension prefSize = new Dimension(
65: SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT);
66:
67: public Dimension getMinimumSize() {
68: return prefSize;
69: }
70:
71: public Dimension getPreferredSize() {
72: return prefSize;
73: }
74:
75: public void setOverflow(Dimension prefSize) {
76: this .prefSize = prefSize;
77: }
78:
79: public Dimension getMaximumSize() {
80: return prefSize;
81: }
82:
83: public boolean isOpaque() {
84: return false;
85: }
86: }
|