001: /*
002: * Copyright (C) 2004 NNL Technology AB
003: * Visit www.infonode.net for information about InfoNode(R)
004: * products and how to contact NNL Technology AB.
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
019: * MA 02111-1307, USA.
020: */
021:
022: // $Id: TabbedPanelContentPanelProperties.java,v 1.27 2005/02/16 11:28:15 jesper Exp $
023: package net.infonode.tabbedpanel;
024:
025: import net.infonode.gui.hover.HoverListener;
026: import net.infonode.properties.gui.util.ComponentProperties;
027: import net.infonode.properties.gui.util.ShapedPanelProperties;
028: import net.infonode.properties.propertymap.*;
029: import net.infonode.properties.types.HoverListenerProperty;
030:
031: /**
032: * TabbedPanelContentPanelProperties holds all properties for a
033: * {@link TabbedPanelContentPanel}. These properties affects the
034: * content area of a TabbedPanel. TabbedPanelProperties contains
035: * TabbedPanelContentPanelProperties.
036: *
037: * @author $Author: jesper $
038: * @version $Revision: 1.27 $
039: * @see TabbedPanel
040: * @see TabbedPanelProperties
041: */
042: public class TabbedPanelContentPanelProperties extends
043: PropertyMapContainer {
044: /**
045: * A property group for all properties in TabbedPanelContentPanelProperties
046: */
047: public static final PropertyMapGroup PROPERTIES = new PropertyMapGroup(
048: "Tab Content Panel Properties",
049: "Properties for the TabContentPanel class.");
050:
051: /**
052: * Properties for the component
053: *
054: * @see #getComponentProperties
055: */
056: public static final PropertyMapProperty COMPONENT_PROPERTIES = new PropertyMapProperty(
057: PROPERTIES, "Component Properties",
058: "Properties for the content area component.",
059: ComponentProperties.PROPERTIES);
060:
061: /**
062: * Properties for the shaped panel
063: *
064: * @see #getShapedPanelProperties
065: * @since ITP 1.2.0
066: */
067: public static final PropertyMapProperty SHAPED_PANEL_PROPERTIES = new PropertyMapProperty(
068: PROPERTIES, "Shaped Panel Properties",
069: "Properties for shaped tab area components area.",
070: ShapedPanelProperties.PROPERTIES);
071:
072: /**
073: * Hover listener property
074: *
075: * @see #setHoverListener
076: * @see #getHoverListener
077: * @since ITP 1.3.0
078: */
079: public static final HoverListenerProperty HOVER_LISTENER = new HoverListenerProperty(
080: PROPERTIES,
081: "Hover Listener",
082: "Hover Listener to be used for tracking mouse hovering over the content area.",
083: PropertyMapValueHandler.INSTANCE);
084:
085: /**
086: * Constructs an empty TabbedPanelContentPanelProperties object
087: */
088: public TabbedPanelContentPanelProperties() {
089: super (PropertyMapFactory.create(PROPERTIES));
090: }
091:
092: /**
093: * Constructs a TabbedPanelContentPanelProperties map with the given map
094: * as property storage
095: *
096: * @param map map to store properties in
097: */
098: public TabbedPanelContentPanelProperties(PropertyMap map) {
099: super (map);
100: }
101:
102: /**
103: * Constructs a TabbedPanelContentPanelProperties object that inherits its properties
104: * from the given TabbedPanelContentPanelProperties object
105: *
106: * @param inheritFrom TabbedPanelContentPanelProperties object to inherit properties
107: * from
108: */
109: public TabbedPanelContentPanelProperties(
110: TabbedPanelContentPanelProperties inheritFrom) {
111: super (PropertyMapFactory.create(inheritFrom.getMap()));
112: }
113:
114: /**
115: * Adds a super object from which property values are inherited.
116: *
117: * @param superObject the object from which to inherit property values
118: * @return this
119: */
120: public TabbedPanelContentPanelProperties addSuperObject(
121: TabbedPanelContentPanelProperties super Object) {
122: getMap().addSuperMap(super Object.getMap());
123: return this ;
124: }
125:
126: /**
127: * Removes the last added super object.
128: *
129: * @return this
130: */
131: public TabbedPanelContentPanelProperties removeSuperObject() {
132: getMap().removeSuperMap();
133: return this ;
134: }
135:
136: /**
137: * Removes the given super object.
138: *
139: * @param superObject super object to remove
140: * @return this
141: * @since ITP 1.3.0
142: */
143: public TabbedPanelContentPanelProperties removeSuperObject(
144: TabbedPanelContentPanelProperties super Object) {
145: getMap().removeSuperMap(super Object.getMap());
146: return this ;
147: }
148:
149: /**
150: * Gets the component properties
151: *
152: * @return component properties
153: */
154: public ComponentProperties getComponentProperties() {
155: return new ComponentProperties(COMPONENT_PROPERTIES
156: .get(getMap()));
157: }
158:
159: /**
160: * Gets the shaped panel properties
161: *
162: * @return shaped panel properties
163: * @since ITP 1.2.0
164: */
165: public ShapedPanelProperties getShapedPanelProperties() {
166: return new ShapedPanelProperties(SHAPED_PANEL_PROPERTIES
167: .get(getMap()));
168: }
169:
170: /**
171: * <p>Sets the hover listener that will be triggered when the content area is hoverd by the mouse.</p>
172: *
173: * <p>The tabbed panel that the hovered content area is part of will be the source of the hover event sent to the
174: * hover listener.</p>
175: *
176: * @param listener the hover listener
177: * @return this TabbedPanelContentPanelProperties
178: * @since ITP 1.3.0
179: */
180: public TabbedPanelContentPanelProperties setHoverListener(
181: HoverListener listener) {
182: HOVER_LISTENER.set(getMap(), listener);
183: return this ;
184: }
185:
186: /**
187: * <p>Gets the hover listener that will be triggered when the content area is hovered by the mouse.</p>
188: *
189: * <p>The tabbed panel that the hovered content area is part of will be the source of the hover event sent to the
190: * hover listener.</p>
191: *
192: * @return the hover listener
193: * @since ITP 1.3.0
194: */
195: public HoverListener getHoverListener() {
196: return HOVER_LISTENER.get(getMap());
197: }
198: }
|