home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
ScrollingTextBeanInfo.java
< prev
next >
Wrap
Text File
|
1998-08-21
|
14KB
|
384 lines
package symantec.itools.multimedia;
import java.beans.*;
import symantec.itools.beans.*;
import java.util.ResourceBundle;
// 08/19/98 LAB Moved to GroupAWTMultimedia folder.
/**
* BeanInfo for ScrollingText.
*
*/
public class ScrollingTextBeanInfo extends SimpleBeanInfo {
/**
* Constructs a ScrollingTextBeanInfo object.
*/
public ScrollingTextBeanInfo() {
}
/**
* 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("GroupAWTMultimedia");
SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
bd.setFolder(s);
bd.setToolbar(s);
bd.setWinHelp("0x12397");
ResourceBundle conn = ResourceBundle.getBundle("symantec.itools.resources.ConnBundle");
bd.addConnectionDescriptor(new ConnectionDescriptor("output", "int", "",
"%name%.SCROLL_LEFT",
conn.getString("SCROLL_LEFT")));
bd.addConnectionDescriptor(new ConnectionDescriptor("output", "int", "",
"%name%.SCROLL_RIGHT",
conn.getString("SCROLL_RIGHT")));
bd.addConnectionDescriptor(new ConnectionDescriptor("output", "String", "",
"symantec.itools.util.GeneralUtils.frameTarget_self",
conn.getString("_self")));
bd.addConnectionDescriptor(new ConnectionDescriptor("output", "String", "",
"symantec.itools.util.GeneralUtils.frameTarget_parent",
conn.getString("_parent")));
bd.addConnectionDescriptor(new ConnectionDescriptor("output", "String", "",
"symantec.itools.util.GeneralUtils.frameTarget_top",
conn.getString("_top")));
bd.addConnectionDescriptor(new ConnectionDescriptor("output", "String", "",
"symantec.itools.util.GeneralUtils.frameTarget_blank",
conn.getString("_blank")));
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("ScrollingTextC16.gif");
return img;
}
if (iconKind == BeanInfo.ICON_MONO_32x32 ||
iconKind == BeanInfo.ICON_COLOR_32x32) {
java.awt.Image img = loadImage("ScrollingTextC32.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 = new Class[1];
args[0] = java.lang.Integer.TYPE ;
MethodDescriptor setScrollInterval = new MethodDescriptor(beanClass.getMethod("setScrollInterval", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "int", "",
"%name%.setScrollInterval(%arg%);",
conn.getString("setScrollInterval"));
connections.addElement(connection);
setScrollInterval.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setScrollInterval);
} catch (Exception e) { throw new Error("setScrollInterval:: " + e.toString()); }
try{
args = null;
MethodDescriptor stopScrollingText = new MethodDescriptor(beanClass.getMethod("stopScrollingText", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "void", "",
"%name%.stopScrollingText();",
conn.getString("stopScrollingText"));
connections.addElement(connection);
stopScrollingText.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(stopScrollingText);
} catch (Exception e) { throw new Error("stopScrollingText:: " + e.toString()); }
try{
args = null;
MethodDescriptor show = new MethodDescriptor(beanClass.getMethod("show", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "void", "",
"%name%.show();",
conn.getString("show"));
connections.addElement(connection);
show.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(show);
} catch (Exception e) { throw new Error("show:: " + e.toString()); }
try{
args = null;
MethodDescriptor getHiliteColor = new MethodDescriptor(beanClass.getMethod("getHiliteColor", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "Color", "",
"%name%.getHiliteColor()",
conn.getString("getHiliteColor"));
connections.addElement(connection);
getHiliteColor.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(getHiliteColor);
} catch (Exception e) { throw new Error("getHiliteColor:: " + e.toString()); }
try{
args = null;
MethodDescriptor getScrollInterval = new MethodDescriptor(beanClass.getMethod("getScrollInterval", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "int", "",
"%name%.getScrollInterval()",
conn.getString("getScrollInterval"));
connections.addElement(connection);
getScrollInterval.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(getScrollInterval);
} catch (Exception e) { throw new Error("getScrollInterval:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.Integer.TYPE ;
MethodDescriptor setScrollDirection = new MethodDescriptor(beanClass.getMethod("setScrollDirection", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "int", "",
"%name%.setScrollDirection(%arg%);",
conn.getString("setScrollDirection"));
connections.addElement(connection);
setScrollDirection.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setScrollDirection);
} catch (Exception e) { throw new Error("setScrollDirection:: " + e.toString()); }
try{
args = null;
MethodDescriptor hide = new MethodDescriptor(beanClass.getMethod("hide", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "void", "",
"%name%.hide();",
conn.getString("hide"));
connections.addElement(connection);
hide.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(hide);
} catch (Exception e) { throw new Error("hide:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.Integer.TYPE ;
MethodDescriptor setScrollUnit = new MethodDescriptor(beanClass.getMethod("setScrollUnit", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "int", "",
"%name%.setScrollUnit(%arg%);",
conn.getString("setScrollUnit"));
connections.addElement(connection);
setScrollUnit.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setScrollUnit);
} catch (Exception e) { throw new Error("setScrollUnit:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.awt.Color.class ;
MethodDescriptor setHiliteColor = new MethodDescriptor(beanClass.getMethod("setHiliteColor", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "Color", "",
"%name%.setHiliteColor(%arg%);",
conn.getString("setHiliteColor"));
connections.addElement(connection);
setHiliteColor.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setHiliteColor);
} catch (Exception e) { throw new Error("setHiliteColor:: " + e.toString()); }
try{
args = null;
MethodDescriptor getScrollDirection = new MethodDescriptor(beanClass.getMethod("getScrollDirection", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "int", "",
"%name%.getScrollDirection()",
conn.getString("getScrollDirection"));
connections.addElement(connection);
getScrollDirection.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(getScrollDirection);
} catch (Exception e) { throw new Error("getScrollDirection:: " + e.toString()); }
try{
args = null;
MethodDescriptor startScrollingText = new MethodDescriptor(beanClass.getMethod("startScrollingText", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "void", "",
"%name%.startScrollingText();",
conn.getString("startScrollingText"));
connections.addElement(connection);
startScrollingText.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(startScrollingText);
} catch (Exception e) { throw new Error("startScrollingText:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.String.class ;
MethodDescriptor setFrame = new MethodDescriptor(beanClass.getMethod("setFrame", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "String", "",
"%name%.setFrame(%arg%);",
conn.getString("setFrameST"));
connections.addElement(connection);
setFrame.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setFrame);
} catch (Exception e) { throw new Error("setFrame:: " + e.toString()); }
try{
args = null;
MethodDescriptor getFrame = new MethodDescriptor(beanClass.getMethod("getFrame", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "String", "",
"%name%.getFrame()",
conn.getString("getFrameST"));
connections.addElement(connection);
getFrame.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(getFrame);
} catch (Exception e) { throw new Error("getFrame:: " + e.toString()); }
try{
args = null;
MethodDescriptor getScrollUnit = new MethodDescriptor(beanClass.getMethod("getScrollUnit", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "int", "",
"%name%.getScrollUnit()",
conn.getString("getScrollUnit"));
connections.addElement(connection);
getScrollUnit.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(getScrollUnit);
} catch (Exception e) { throw new Error("getScrollUnit:: " + 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 scrollInterval = new PropertyDescriptor("scrollInterval", beanClass);
scrollInterval.setBound(true);
scrollInterval.setConstrained(true);
scrollInterval.setDisplayName(prop.getString("scrollInterval"));
PropertyDescriptor scrollUnit = new PropertyDescriptor("scrollUnit", beanClass);
scrollUnit.setBound(true);
scrollUnit.setConstrained(true);
scrollUnit.setDisplayName(prop.getString("scrollUnit"));
PropertyDescriptor scrollDirection = new PropertyDescriptor("scrollDirection", beanClass);
scrollDirection.setBound(true);
scrollDirection.setConstrained(true);
scrollDirection.setDisplayName(prop.getString("scrollDirection"));
scrollDirection.setValue("ENUMERATION", "SCROLL_LEFT=0, SCROLL_RIGHT=1");
PropertyDescriptor hiliteColor = new PropertyDescriptor("hiliteColor", beanClass);
hiliteColor.setBound(true);
hiliteColor.setConstrained(true);
hiliteColor.setDisplayName(prop.getString("hiliteColor"));
PropertyDescriptor messageList = new PropertyDescriptor("messageList", beanClass);
messageList.setBound(true);
messageList.setConstrained(true);
messageList.setDisplayName(prop.getString("messageList"));
PropertyDescriptor linkToList = new PropertyDescriptor("linkToList", beanClass);
linkToList.setBound(true);
linkToList.setConstrained(true);
linkToList.setDisplayName(prop.getString("linkToList"));
linkToList.setValue("URLFILTER", prop.getString("webURLFILTER"));
PropertyDescriptor frame = new PropertyDescriptor("frame", beanClass);
frame.setBound(true);
frame.setConstrained(true);
frame.setDisplayName(prop.getString("frame"));
PropertyDescriptor[] rv = {
scrollInterval,
scrollUnit,
scrollDirection,
hiliteColor,
messageList,
linkToList,
frame};
return rv;
} catch (IntrospectionException e) { throw new Error(e.toString()); }
}
private final static Class beanClass = ScrollingText.class;
} // end of class ScrollingTextBeanInfo