01: /*
02: * Copyright (C) 2004 NNL Technology AB
03: * Visit www.infonode.net for information about InfoNode(R)
04: * products and how to contact NNL Technology AB.
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19: * MA 02111-1307, USA.
20: */
21:
22: // $Id: TitledTabSizePolicy.java,v 1.6 2004/09/28 15:07:29 jesper Exp $
23: package net.infonode.tabbedpanel.titledtab;
24:
25: import net.infonode.util.Enum;
26:
27: /**
28: * TitledTabSizePolicy defines how TitledTab should calculate its size.
29: * If the different tab states results in different tab sizes, then TitledTab
30: * can calculate the maximum size for the states and use that size for all
31: * the states.
32: *
33: * @author $Author: jesper $
34: * @version $Revision: 1.6 $
35: */
36: public final class TitledTabSizePolicy extends Enum {
37: private static final long serialVersionUID = -7834501681762485226L;
38:
39: /**
40: * Equal size policy. This menas that if the different tab states results in
41: * different tab sizes, then titled tab will calculate the maximum size for the
42: * states and use that size for all the states.
43: */
44: public static final TitledTabSizePolicy EQUAL_SIZE = new TitledTabSizePolicy(
45: 0, "Equal Size");
46:
47: /**
48: * Individual size policy. This means that if the different tab states have
49: * different sizes then titled tab will have different size for the states.
50: */
51: public static final TitledTabSizePolicy INDIVIDUAL_SIZE = new TitledTabSizePolicy(
52: 1, "Individual Size");
53:
54: /**
55: * An array with all size policies.
56: */
57: public static final TitledTabSizePolicy[] SIZE_POLICIES = new TitledTabSizePolicy[] {
58: EQUAL_SIZE, INDIVIDUAL_SIZE };
59:
60: private TitledTabSizePolicy(int value, String name) {
61: super (value, name);
62: }
63:
64: /**
65: * Gets the size policies.
66: *
67: * @return the size policies
68: * @since ITP 1.1.0
69: */
70: public static TitledTabSizePolicy[] getSizePolicies() {
71: return (TitledTabSizePolicy[]) SIZE_POLICIES.clone();
72: }
73: }
|