[14982] | 1 | /*
|
---|
| 2 | * Copyright 2005 Paul Hinds
|
---|
| 3 | *
|
---|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
| 5 | * you may not use this file except in compliance with the License.
|
---|
| 6 | * You may obtain a copy of the License at
|
---|
| 7 | *
|
---|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 9 | *
|
---|
| 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.JCheckBox;
|
---|
| 23 |
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * A JCheckBox with altered prefered size to facilitate fixing the width
|
---|
| 27 | * but still using a GridBagLayout
|
---|
| 28 | * @author Paul Hinds
|
---|
| 29 | * @version $Id: AICheckBox.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $
|
---|
| 30 | */
|
---|
| 31 | public class AICheckBox extends JCheckBox {
|
---|
| 32 |
|
---|
| 33 | public AICheckBox() {
|
---|
| 34 | super();
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | public AICheckBox(String text) {
|
---|
| 38 | super(text);
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | public AICheckBox(String text, boolean selected) {
|
---|
| 42 | super(text, selected);
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public AICheckBox(Action a) {
|
---|
| 46 | super(a);
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | public AICheckBox(Icon icon) {
|
---|
| 50 | super(icon);
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | public AICheckBox(Icon icon, boolean selected) {
|
---|
| 54 | super(icon, selected);
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | public AICheckBox(String text, Icon icon) {
|
---|
| 58 | super(text, icon);
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | public AICheckBox(String text, Icon icon, boolean selected) {
|
---|
| 62 | super(text, icon, selected);
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | private Dimension prefSize = new Dimension(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 | public void setOverflow(Dimension prefSize) {
|
---|
| 75 | this.prefSize = prefSize;
|
---|
| 76 | }
|
---|
| 77 |
|
---|
| 78 | public Dimension getMaximumSize() {
|
---|
| 79 | return prefSize;
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | }
|
---|