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: WindowTabProperties.java,v 1.21 2005/12/04 13:46:04 jesper Exp $
023: package net.infonode.docking.properties;
024:
025: import net.infonode.properties.propertymap.*;
026: import net.infonode.tabbedpanel.titledtab.TitledTabProperties;
027: import net.infonode.tabbedpanel.titledtab.TitledTabStateProperties;
028:
029: /**
030: * Properties and property values for window tabs.
031: *
032: * @author $Author: jesper $
033: * @version $Revision: 1.21 $
034: */
035: public class WindowTabProperties extends PropertyMapContainer {
036: /**
037: * Property group containing all window tab properties.
038: */
039: public static final PropertyMapGroup PROPERTIES = new PropertyMapGroup(
040: "Tab Properties", "");
041:
042: /**
043: * Property values for the titled tab used in the tab.
044: */
045: public static final PropertyMapProperty TITLED_TAB_PROPERTIES = new PropertyMapProperty(
046: PROPERTIES,
047: "Titled Tab Properties",
048: "Property values for the TitledTab used in the window tab.",
049: TitledTabProperties.PROPERTIES);
050:
051: /**
052: * Property values for the titled tab when it is focused or a component in the tab's content component has focus.
053: */
054: public static final PropertyMapProperty FOCUSED_PROPERTIES = new PropertyMapProperty(
055: PROPERTIES,
056: "Focused Properties",
057: "Property values for the TitledTab when the window is focused or a component in the tab's content component has focus.\n"
058: + "The "
059: + TITLED_TAB_PROPERTIES
060: + '.'
061: + TitledTabProperties.HIGHLIGHTED_PROPERTIES
062: + " property values are inherited from.",
063: TitledTabStateProperties.PROPERTIES);
064:
065: /**
066: * Property values for the tab buttons when the tab is in the normal state.
067: */
068: public static final PropertyMapProperty NORMAL_BUTTON_PROPERTIES = new PropertyMapProperty(
069: PROPERTIES,
070: "Normal Button Properties",
071: "Property values for the tab buttons when the tab is in the normal state.",
072: WindowTabStateProperties.PROPERTIES);
073:
074: /**
075: * Property values for the tab buttons when the tab is highlighted.
076: */
077: public static final PropertyMapProperty HIGHLIGHTED_BUTTON_PROPERTIES = new PropertyMapProperty(
078: PROPERTIES,
079: "Highlighted Button Properties",
080: "Property values for the tab buttons when the tab is highlighted.",
081: WindowTabStateProperties.PROPERTIES);
082:
083: /**
084: * Property values for the tab buttons when the tab is focused or a component in the tab's content component has focus.
085: */
086: public static final PropertyMapProperty FOCUSED_BUTTON_PROPERTIES = new PropertyMapProperty(
087: PROPERTIES,
088: "Focused Button Properties",
089: "Property values for the tab buttons when the tab is focused or a component in the tab's content component has focus.",
090: WindowTabStateProperties.PROPERTIES);
091:
092: /**
093: * Creates an empty property object.
094: */
095: public WindowTabProperties() {
096: super (PropertyMapFactory.create(PROPERTIES));
097: }
098:
099: /**
100: * Creates a property object containing the map.
101: *
102: * @param map the property map
103: */
104: public WindowTabProperties(PropertyMap map) {
105: super (map);
106: }
107:
108: /**
109: * Creates a property object that inherit values from another property object.
110: *
111: * @param inheritFrom the object from which to inherit property values
112: */
113: public WindowTabProperties(WindowTabProperties inheritFrom) {
114: super (PropertyMapFactory.create(inheritFrom.getMap()));
115: }
116:
117: /**
118: * Adds a super object from which property values are inherited.
119: *
120: * @param properties the object from which to inherit property values
121: * @return this
122: */
123: public WindowTabProperties addSuperObject(
124: WindowTabProperties properties) {
125: getMap().addSuperMap(properties.getMap());
126: return this ;
127: }
128:
129: /**
130: * Removes the last added super object.
131: *
132: * @return this
133: * @since IDW 1.1.0
134: * @deprecated Use {@link #removeSuperObject(WindowTabProperties)} instead.
135: */
136: public WindowTabProperties removeSuperObject() {
137: getMap().removeSuperMap();
138: return this ;
139: }
140:
141: /**
142: * Removes a super object.
143: *
144: * @param superObject the super object to remove
145: * @return this
146: * @since IDW 1.3.0
147: */
148: public WindowTabProperties removeSuperObject(
149: WindowTabProperties super Object) {
150: getMap().removeSuperMap(super Object.getMap());
151: return this ;
152: }
153:
154: /**
155: * Returns the property values for the titled tab used in the tab.
156: *
157: * @return the property values for the titled tab used in the tab
158: */
159: public TitledTabProperties getTitledTabProperties() {
160: return new TitledTabProperties(TITLED_TAB_PROPERTIES
161: .get(getMap()));
162: }
163:
164: /**
165: * Returns the property values for the titled tab when it is focused or a component in the tab's content component has focus.
166: *
167: * @return the property values for the titled tab when it is focused or a component in the tab's content component has focus
168: */
169: public TitledTabStateProperties getFocusedProperties() {
170: return new TitledTabStateProperties(FOCUSED_PROPERTIES
171: .get(getMap()));
172: }
173:
174: /**
175: * Returns the property values for the tab buttons when the tab is in the normal state.
176: *
177: * @return the property values for the tab buttons when the tab is in the normal state
178: */
179: public WindowTabStateProperties getNormalButtonProperties() {
180: return new WindowTabStateProperties(NORMAL_BUTTON_PROPERTIES
181: .get(getMap()));
182: }
183:
184: /**
185: * Returns the property values for the tab buttons when the tab is highlighted.
186: *
187: * @return the property values for the tab buttons when the tab is highlighted
188: */
189: public WindowTabStateProperties getHighlightedButtonProperties() {
190: return new WindowTabStateProperties(
191: HIGHLIGHTED_BUTTON_PROPERTIES.get(getMap()));
192: }
193:
194: /**
195: * Returns the property values for the tab buttons when the tab is focused or a component in the tab's content
196: * component has focus.
197: *
198: * @return the property values for the tab buttons when the tab is focused or a component in the tab's content
199: * component has focus
200: */
201: public WindowTabStateProperties getFocusedButtonProperties() {
202: return new WindowTabStateProperties(FOCUSED_BUTTON_PROPERTIES
203: .get(getMap()));
204: }
205:
206: }
|