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: TabLayoutPolicy.java,v 1.9 2004/09/28 15:07:29 jesper Exp $
23: package net.infonode.tabbedpanel;
24:
25: import net.infonode.util.Enum;
26:
27: /**
28: * TabLayoutPolicy defines how the tabs in a tabbed panel's tab area can be laid out.
29: *
30: * @author $Author: jesper $
31: * @version $Revision: 1.9 $
32: * @see TabbedPanel
33: * @see TabbedPanelProperties
34: */
35: public final class TabLayoutPolicy extends Enum {
36: private static final long serialVersionUID = -1345037155950998515L;
37:
38: /**
39: * Scrolling layout policy. This means that the tabs are laid out in a line. The
40: * line of tabs will be scrollable if not all tabs can fit into the visible part
41: * of the tabbed panel's tab area at the same time.
42: */
43: public static final TabLayoutPolicy SCROLLING = new TabLayoutPolicy(
44: 0, "Scrolling");
45:
46: /**
47: * Compression layout policy. This means that the tabs are laid out in a line. The
48: * tabs will be downsized (compressed) so that they fit into the visible part of the
49: * tab area.
50: */
51: public static final TabLayoutPolicy COMPRESSION = new TabLayoutPolicy(
52: 1, "Compression");
53:
54: /**
55: * Array with all available layout policies.
56: */
57: public static final TabLayoutPolicy[] LAYOUT_POLICIES = new TabLayoutPolicy[] {
58: SCROLLING, COMPRESSION };
59:
60: private TabLayoutPolicy(int value, String name) {
61: super (value, name);
62: }
63:
64: /**
65: * Gets the tab layout policies.
66: *
67: * @return the tab layout policies
68: * @since ITP 1.1.0
69: */
70: public static TabLayoutPolicy[] getLayoutPolicies() {
71: return (TabLayoutPolicy[]) LAYOUT_POLICIES.clone();
72: }
73: }
|