home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 3.4 KB | 130 lines |
- /*---------------------------------------------------------------------------
-
- Written by the Personal Journal developers of Dow Jones & Company, Inc.
-
- Dow Jones makes no representations or warranties about
- the suitability of this software, either express or
- implied, including but not limited to the implied warranties
- of merchantability, fitness for a particular purpose,
- or non-infringement. Dow Jones will not be liable for
- any damages suffered by a user as a result of using,
- modifying or distributing this software or its derivatives.
-
-
- TabSpec.java
-
- A specification for a component of a TabBar.
-
-
- Authors:
-
- rphall Rick Hall
-
-
- Version Ident:
-
- $Header$
-
-
- History:
-
- 10-dec-1995 rphalll Initial Creation
-
-
- ---------------------------------------------------------------------------*/
-
- package pj.awt;
-
- import collections.Assertable;
- import collections.ImplementationCheckable;
- import collections.ImplementationError;
- import java.lang.Object;
- import java.lang.String;
-
- /**
- * A specification for a component of a TabBar.
- *
- * @see TabBar
- * @see Notebook
- * @see Divider
- * @version 0.00 03-Jan-96
- * @author Rick Hall
- */
- public abstract class TabSpec implements Assertable, ImplementationCheckable
- {
-
- // --- Instance variables
-
- /**
- * The internal id of a tab within a TabBar.
- */
- public String strTabName;
-
- /**
- * The pageName of the divider to which this tab refers.
- * @see Notebook
- * @see Divider
- */
- public String strPageName;
-
- /**
- * A specification for the visible presentation of this tab
- * within a TabBar, typically a String or an Image.
- */
- public Object objVisSpec;
-
- // --- Public constructors
-
- /**
- * This constructor sets the public attributes of TabSpec and then
- * invokes checkImplementation().
- * @param tabName The internal id of a tab within a TabBar.
- * @param pageName The pageName of the divider to which this tab refers.
- * @param spec A specification for the visible presentation of this tab
- * within a TabBar, typically a String or an Image.
- * @see checkImplementation
- */
- public TabSpec(
- String tabName,
- String pageName,
- Object spec)
- {
- strTabName = tabName;
- strPageName = pageName;
- objVisSpec = spec;
- checkImplementation();
- }
-
- // --- Public operations
-
- /**
- * Raise an exception if predicate is false.
- * @see collections.Assertable
- */
- public void assert(boolean predicate) throws ImplementationError
- {
- ImplementationError.assert(this, predicate);
- }
-
- /**
- * Check the internal validity of a TabSpec.
- * Subclasses should extend this operation to check the type of
- * objVisSpec. This operation is equivalent to:
- * <pre>
- * assert(strPageName!=null);
- * assert(strTabName!= null);
- * assert(objVisSpec!=null);
- * </pre>
- * @see collections.ImplementationCheckable
- * @exception ImplementationError Thrown if any public attribute
- * is null.
- */
- public void checkImplementation() throws ImplementationError
- {
- assert(strPageName!=null);
- assert(strTabName!= null);
- assert(objVisSpec!=null);
- }
-
- } // TabSpec
-