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: TabbedPanelHoverPolicy.java,v 1.6 2005/12/04 13:46:05 jesper Exp $
23: package net.infonode.tabbedpanel;
24:
25: import net.infonode.util.Enum;
26:
27: /**
28: * TabbedPanelHoverPolicy defines the hover policy, i.e. when a tabbed panel should consider itself
29: * hovered by the mouse and the HoverListener should be called. This policy affects the tabbed panel,
30: * the tab area, the tab area components area and the content area (if the tabbed panel has a content
31: * area).
32: *
33: * @author johan
34: * @version $Revision: 1.6 $
35: * @see net.infonode.gui.hover.HoverListener
36: * @since ITP 1.3.0
37: */
38: public class TabbedPanelHoverPolicy extends Enum {
39:
40: private static final long serialVersionUID = 1;
41:
42: /**
43: * Never hover policy. This means that the tabbed panel will nerver be considered hovered
44: */
45: public static final TabbedPanelHoverPolicy NEVER = new TabbedPanelHoverPolicy(
46: 0, "Never Hover");
47:
48: /**
49: * Always hover policy. This means that the tabbed panel will always consider itself hovered
50: * when the mouse is over the tabbed panel.
51: */
52: public static final TabbedPanelHoverPolicy ALWAYS = new TabbedPanelHoverPolicy(
53: 1, "Always Hover");
54:
55: /**
56: * No hovered child hover policy. This means that the tabbed panel will consider itself hovered when
57: * the mouse is over the tabbed panel and the content area doesn't contain any hovered tabbed panel.
58: */
59: public static final TabbedPanelHoverPolicy NO_HOVERED_CHILD = new TabbedPanelHoverPolicy(
60: 2, "No Hovered Child Tabbed Panel");
61:
62: /**
63: * Only when deepest hover policy. This means that the tabbed panel will consider itself hovered when
64: * the mouse is over the tabbed panel and there is no other tabbed panel in the tabbed panel's content area.
65: */
66: public static final TabbedPanelHoverPolicy ONLY_WHEN_DEEPEST = new TabbedPanelHoverPolicy(
67: 3, "Only when Deepest Tabbed Panel");
68:
69: /**
70: * Always and exclude hover policy. This means that the tabbed panel will always consider itself hovered
71: * when the mouse is over the tabbed panel but it will be excluded by other tabbed panels when their hover policies
72: * are evaluated.
73: *
74: * @since ITP 1.4.0
75: */
76: public static final TabbedPanelHoverPolicy ALWAYS_AND_EXCLUDE = new TabbedPanelHoverPolicy(
77: 4, "Always Hover and be Excluded by Others");
78:
79: private TabbedPanelHoverPolicy(int value, String name) {
80: super (value, name);
81: }
82:
83: /**
84: * Gets the hover policies.
85: *
86: * @return the hover policies
87: */
88: public static TabbedPanelHoverPolicy[] getHoverPolicies() {
89: return new TabbedPanelHoverPolicy[] { NEVER, ALWAYS,
90: NO_HOVERED_CHILD, ONLY_WHEN_DEEPEST, ALWAYS_AND_EXCLUDE };
91: }
92: }
|