xref: /titanic_44/usr/src/cmd/krb5/kadmin/gui/visualrt/sunsoft/jws/visual/rt/shadow/java/awt/JAShadowAccess.java (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * ident	"%Z%%M%	%I%	%E% SMI"
24  *
25  * Copyright (c) 2000 by Sun Microsystems, Inc.
26  * All rights reserved.
27  */
28 
29 /*
30  *        Copyright (C) 1996  Active Software, Inc.
31  *                  All rights reserved.
32  *
33  * @(#) JAShadowAccess.java 1.2 - last change made 07/25/96
34  */
35 
36 package sunsoft.jws.visual.rt.shadow.java.awt;
37 
38 import sunsoft.jws.visual.rt.base.*;
39 
40 /**
41  * Accessor class for use only by graphical interface builders.  Gives
42  * a GUI builder access to methods in this package which are package
43  * private.  The methods in this class should not be used by any other
44  * application, they are for use by Visual Java only and are subject
45  * to change.
46  *
47  * @version 1.2, 07/25/96
48  */
49 public class JAShadowAccess {
50 
51     //
52     // These instantiate methods are needed so that the ComponentShadow
53     // and ContainerShadow classes can be instantiated when we are
54     // generating the list of attribute names.
55     //
56 
instantiate(String classname)57     public static AttributeManager instantiate(String classname) {
58 	Class c;
59 	try {
60 	    c = Class.forName(classname);
61 	}
62 	catch (Exception ex) {
63 	    System.out.println(ex.toString());
64 	    return null;
65 	}
66 	return instantiate(c);
67     }
68 
instantiate(Class c)69     public static AttributeManager instantiate(Class c) {
70 	Object obj;
71 	try {
72 	    obj = c.newInstance();
73 	}
74 	catch (Exception ex) {
75 	    System.out.println(ex.toString());
76 	    return null;
77 	}
78 
79 	if (obj instanceof AttributeManager)
80 	    return (AttributeManager)obj;
81 	else
82 	    return null;
83     }
84 
85     //
86     // Internal "FrameShadow" methods
87     //
88 
incrCursor(FrameShadow fs)89     public static int incrCursor(FrameShadow fs) {
90 	return fs.incrCursor();
91     }
92 
decrCursor(FrameShadow fs)93     public static int decrCursor(FrameShadow fs) {
94 	return fs.decrCursor();
95     }
96 
setPrevCursor(FrameShadow fs, int cursor)97     public static void setPrevCursor(FrameShadow fs, int cursor) {
98 	fs.setPrevCursor(cursor);
99     }
100 
getPrevCursor(FrameShadow fs)101     public static int getPrevCursor(FrameShadow fs) {
102 	return fs.getPrevCursor();
103     }
104 }
105