home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 16.9 KB | 444 lines |
- package symantec.itools.awt;
-
- import java.beans.*;
- import symantec.itools.beans.*;
- import java.util.ResourceBundle;
-
- // 08/04/97 LAB Removed the component from the toolbar since it is being deprecated.
- // 09/07/97 LAB Fixed misspelling of descriptions. Removed from ToolBar.
- // 09/19/97 RKM Removed it from toolbar again - please do not readd it
-
- /**
- * BeanInfo for ScrollingPanel.
- *
- */
- public class ScrollingPanelBeanInfo extends SimpleBeanInfo {
-
- /**
- * Constructs a ScrollingPanelBeanInfo object.
- */
- public ScrollingPanelBeanInfo() {
- }
-
- /**
- * Gets a BeanInfo for the superclass of this bean.
- * @return BeanInfo[] containing this bean's superclass BeanInfo
- */
- public BeanInfo[] getAdditionalBeanInfo() {
- try {
- BeanInfo[] bi = new BeanInfo[1];
- bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass());
- return bi;
- }
- catch (IntrospectionException e) { throw new Error(e.toString());}
- }
-
- /**
- * Gets the SymantecBeanDescriptor for this bean.
- * @return an object of type SymantecBeanDescriptor
- * @see symantec.itools.beans.SymantecBeanDescriptor
- */
- public BeanDescriptor getBeanDescriptor() {
- ResourceBundle group = ResourceBundle.getBundle("symantec.itools.resources.GroupBundle");
- String s=group.getString("GroupPanel");
-
- SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
- bd.setFolder(s);
- if(System.getProperty("os.name").startsWith("Windows") == true)
- bd.setToolbar(s);
- bd.setWinHelp("0x123B7");
-
- return (BeanDescriptor) bd;
- }
-
- /**
- * Gets an image that may be used to visually represent this bean
- * (in the toolbar, on a form, etc).
- * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
- * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
- * @return an image for this bean, always color even if requested monochrome
- * @see BeanInfo#ICON_MONO_16x16
- * @see BeanInfo#ICON_COLOR_16x16
- * @see BeanInfo#ICON_MONO_32x32
- * @see BeanInfo#ICON_COLOR_32x32
- */
- public java.awt.Image getIcon(int iconKind) {
- if (iconKind == BeanInfo.ICON_MONO_16x16 ||
- iconKind == BeanInfo.ICON_COLOR_16x16) {
- java.awt.Image img = loadImage("ScrollingPanelC16.gif");
- return img;
- }
-
- if (iconKind == BeanInfo.ICON_MONO_32x32 ||
- iconKind == BeanInfo.ICON_COLOR_32x32) {
- java.awt.Image img = loadImage("ScrollingPanelC32.gif");
- return img;
- }
-
- return null;
- }
-
- /**
- * Gets an array of descriptions of the methods used for "connections" by
- * Visual CafΘ's Interaction Wizard.
- * Included in each method description is a CONNECTIONS ConnectionDescriptor.
- * @return method descriptions for this bean
- * @see symantec.itools.beans.ConnectionDescriptor#CONNECTIONS
- */
- public MethodDescriptor[] getMethodDescriptors() {
- Class[] args;
- ConnectionDescriptor connection;
- java.util.Vector connections;
- java.util.Vector md = new java.util.Vector();
- ResourceBundle conn = ResourceBundle.getBundle("symantec.itools.resources.ConnBundle");
-
- try{
- args = null;
- MethodDescriptor scrollLeft = new MethodDescriptor(beanClass.getMethod("scrollLeft", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "void", "",
- "%name%.scrollLeft();",
- conn.getString("scrollLeft"));
- connections.addElement(connection);
-
- scrollLeft.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollLeft);
- } catch (Exception e) { throw new Error("scrollLeft:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor getShowVerticalScroll = new MethodDescriptor(beanClass.getMethod("getShowVerticalScroll", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("output", "boolean", "",
- "%name%.getShowVerticalScroll()",
- conn.getString("getShowVerticalScrollVisible"));
- connections.addElement(connection);
-
- connection = new ConnectionDescriptor("output", "boolean", "",
- "!%name%.getShowVerticalScroll()",
- conn.getString("getShowVerticalScrollHidden"));
- connections.addElement(connection);
-
- getShowVerticalScroll.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(getShowVerticalScroll);
- } catch (Exception e) { throw new Error("getShowVerticalScroll:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor getMinimumHeight = new MethodDescriptor(beanClass.getMethod("getMinimumHeight", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("output", "int", "",
- "%name%.getMinimumHeight()",
- conn.getString("getMinimumHeight"));
- connections.addElement(connection);
-
- getMinimumHeight.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(getMinimumHeight);
- } catch (Exception e) { throw new Error("getMinimumHeight:: " + e.toString()); }
-
- try{
- args = new Class[1];
- args[0] = java.lang.Integer.TYPE ;
- MethodDescriptor setScrollLineIncrement = new MethodDescriptor(beanClass.getMethod("setScrollLineIncrement", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "int", "",
- "%name%.setScrollLineIncrement(%arg%);",
- conn.getString("setScrollLineIncrement"));
- connections.addElement(connection);
-
- setScrollLineIncrement.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(setScrollLineIncrement);
- } catch (Exception e) { throw new Error("setScrollLineIncrement:: " + e.toString()); }
-
- try{
- args = new Class[1];
- args[0] = java.lang.Integer.TYPE ;
- MethodDescriptor setMinimumWidth = new MethodDescriptor(beanClass.getMethod("setMinimumWidth", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "int", "",
- "%name%.setMinimumWidth(%arg%);",
- conn.getString("setMinimumWidth"));
- connections.addElement(connection);
-
- setMinimumWidth.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(setMinimumWidth);
- } catch (Exception e) { throw new Error("setMinimumWidth:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor scrollPageRight = new MethodDescriptor(beanClass.getMethod("scrollPageRight", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "void", "",
- "%name%.scrollPageRight();",
- conn.getString("scrollPageRight"));
- connections.addElement(connection);
-
- scrollPageRight.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollPageRight);
- } catch (Exception e) { throw new Error("scrollPageRight:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor scrollPageDown = new MethodDescriptor(beanClass.getMethod("scrollPageDown", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "void", "",
- "%name%.scrollPageDown();",
- conn.getString("scrollPageDown"));
- connections.addElement(connection);
-
- scrollPageDown.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollPageDown);
- } catch (Exception e) { throw new Error("scrollPageDown:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor scrollDown = new MethodDescriptor(beanClass.getMethod("scrollDown", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "void", "",
- "%name%.scrollDown();",
- conn.getString("scrollDown"));
- connections.addElement(connection);
-
- scrollDown.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollDown);
- } catch (Exception e) { throw new Error("scrollDown:: " + e.toString()); }
-
- try{
- args = new Class[1];
- args[0] = java.lang.Integer.TYPE ;
- MethodDescriptor setMinimumHeight = new MethodDescriptor(beanClass.getMethod("setMinimumHeight", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "int", "",
- "%name%.setMinimumHeight(%arg%);",
- conn.getString("setMinimumHeight"));
- connections.addElement(connection);
-
- setMinimumHeight.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(setMinimumHeight);
- } catch (Exception e) { throw new Error("setMinimumHeight:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor getScrollLineIncrement = new MethodDescriptor(beanClass.getMethod("getScrollLineIncrement", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("output", "int", "",
- "%name%.getScrollLineIncrement()",
- conn.getString("getScrollLineIncrement"));
- connections.addElement(connection);
-
- getScrollLineIncrement.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(getScrollLineIncrement);
- } catch (Exception e) { throw new Error("getScrollLineIncrement:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor getShowHorizontalScroll = new MethodDescriptor(beanClass.getMethod("getShowHorizontalScroll", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("output", "boolean", "",
- "%name%.getShowHorizontalScroll()",
- conn.getString("getShowHorizontalScrollVisible"));
- connections.addElement(connection);
-
- connection = new ConnectionDescriptor("output", "boolean", "",
- "!%name%.getShowHorizontalScroll()",
- conn.getString("getShowHorizontalScrollHidden"));
- connections.addElement(connection);
-
- getShowHorizontalScroll.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(getShowHorizontalScroll);
- } catch (Exception e) { throw new Error("getShowHorizontalScroll:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor scrollUp = new MethodDescriptor(beanClass.getMethod("scrollUp", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "void", "",
- "%name%.scrollUp();",
- conn.getString("scrollUp"));
- connections.addElement(connection);
-
- scrollUp.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollUp);
- } catch (Exception e) { throw new Error("scrollUp:: " + e.toString()); }
-
- try{
- args = new Class[1];
- args[0] = java.lang.Integer.TYPE ;
- MethodDescriptor scrollHorizontalAbsolute = new MethodDescriptor(beanClass.getMethod("scrollHorizontalAbsolute", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "int", "",
- "%name%.scrollHorizontalAbsolute(%arg%);",
- conn.getString("scrollHorizontalAbsolute"));
- connections.addElement(connection);
-
- scrollHorizontalAbsolute.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollHorizontalAbsolute);
- } catch (Exception e) { throw new Error("scrollHorizontalAbsolute:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor getMinimumWidth = new MethodDescriptor(beanClass.getMethod("getMinimumWidth", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("output", "int", "",
- "%name%.getMinimumWidth()",
- conn.getString("getMinimumWidth"));
- connections.addElement(connection);
-
- getMinimumWidth.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(getMinimumWidth);
- } catch (Exception e) { throw new Error("getMinimumWidth:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor scrollPageUp = new MethodDescriptor(beanClass.getMethod("scrollPageUp", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "void", "",
- "%name%.scrollPageUp();",
- conn.getString("scrollPageUp"));
- connections.addElement(connection);
-
- scrollPageUp.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollPageUp);
- } catch (Exception e) { throw new Error("scrollPageUp:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor getVerticalGap = new MethodDescriptor(beanClass.getMethod("getVerticalGap", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("output", "int", "",
- "%name%.getVerticalGap()",
- conn.getString("getVerticalGap"));
- connections.addElement(connection);
-
- getVerticalGap.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(getVerticalGap);
- } catch (Exception e) { throw new Error("getVerticalGap:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor scrollRight = new MethodDescriptor(beanClass.getMethod("scrollRight", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "void", "",
- "%name%.scrollRight();",
- conn.getString("scrollRight"));
- connections.addElement(connection);
-
- scrollRight.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollRight);
- } catch (Exception e) { throw new Error("scrollRight:: " + e.toString()); }
-
- try{
- args = new Class[1];
- args[0] = java.lang.Integer.TYPE ;
- MethodDescriptor scrollVerticalAbsolute = new MethodDescriptor(beanClass.getMethod("scrollVerticalAbsolute", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "int", "",
- "%name%.scrollVerticalAbsolute(%arg%);",
- conn.getString("scrollVerticalAbsolute"));
- connections.addElement(connection);
-
- scrollVerticalAbsolute.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollVerticalAbsolute);
- } catch (Exception e) { throw new Error("scrollVerticalAbsolute:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor getHorizontalGap = new MethodDescriptor(beanClass.getMethod("getHorizontalGap", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("output", "int", "",
- "%name%.getHorizontalGap()",
- conn.getString("getHorizontalGap"));
- connections.addElement(connection);
-
- getHorizontalGap.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(getHorizontalGap);
- } catch (Exception e) { throw new Error("getHorizontalGap:: " + e.toString()); }
-
- try{
- args = null;
- MethodDescriptor scrollPageLeft = new MethodDescriptor(beanClass.getMethod("scrollPageLeft", args));
-
- connections = new java.util.Vector();
- connection = new ConnectionDescriptor("input", "void", "",
- "%name%.scrollPageLeft();",
- conn.getString("scrollPageLeft"));
- connections.addElement(connection);
-
- scrollPageLeft.setValue(ConnectionDescriptor.CONNECTIONS, connections);
- md.addElement(scrollPageLeft);
- } catch (Exception e) { throw new Error("scrollPageLeft:: " + e.toString()); }
-
- MethodDescriptor[] rv = new MethodDescriptor[md.size()];
- md.copyInto(rv);
-
- return rv;
- }
-
- /**
- * Returns descriptions of this bean's properties.
- */
- public PropertyDescriptor[] getPropertyDescriptors() {
- ResourceBundle prop = ResourceBundle.getBundle("symantec.itools.resources.PropBundle");
-
- try{
- PropertyDescriptor minimumWidth = new PropertyDescriptor("minimumWidth", beanClass);
- minimumWidth.setBound(true);
- minimumWidth.setConstrained(false);
- minimumWidth.setDisplayName(prop.getString("minimumWidth"));
-
- PropertyDescriptor minimumHeight = new PropertyDescriptor("minimumHeight", beanClass);
- minimumHeight.setBound(true);
- minimumHeight.setConstrained(false);
- minimumHeight.setDisplayName(prop.getString("minimumHeight"));
-
- PropertyDescriptor scrollLineIncrement = new PropertyDescriptor("scrollLineIncrement", beanClass);
- scrollLineIncrement.setBound(true);
- scrollLineIncrement.setConstrained(false);
- scrollLineIncrement.setDisplayName(prop.getString("scrollLineIncrement"));
-
- PropertyDescriptor scrollbarHeight = new PropertyDescriptor("HScrollbarHeight", beanClass, "getHScrollbarHeight", null);
- scrollbarHeight.setHidden(true);
-
- PropertyDescriptor scrollbarWidth = new PropertyDescriptor("VScrollbarWidth", beanClass, "getVScrollbarWidth", null);
- scrollbarWidth.setHidden(true);
-
- PropertyDescriptor scrollbarPolicy = new PropertyDescriptor("scrollbarDisplayPolicy", beanClass, "getScrollbarDisplayPolicy", null);
- scrollbarPolicy.setHidden(true);
-
- PropertyDescriptor layout = new PropertyDescriptor("layout", beanClass);
- layout.setHidden(true);
-
- PropertyDescriptor[] rv = {
- minimumWidth,
- minimumHeight,
- scrollLineIncrement,
- scrollbarHeight,
- scrollbarWidth,
- scrollbarPolicy,
- layout};
- return rv;
- } catch (IntrospectionException e) { throw new Error(e.toString()); }
- }
-
- private final static Class beanClass = ScrollingPanel.class;
-
- } // end of class ScrollingPanelBeanInfo