home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 November
/
Chip_1998-11_cd.bin
/
tema
/
Cafe
/
Source.bin
/
HorizontalSliderBeanInfo.java
< prev
next >
Wrap
Text File
|
1998-03-18
|
4KB
|
135 lines
package symantec.itools.awt;
import java.beans.*;
import symantec.itools.beans.*;
import java.util.ResourceBundle;
// 07/17/97 LAB Moved connection for setTickStyle property back into base class,
// since that's where it is now.
// 09/07/97 LAB Fixed misspelling of descriptions.
/**
* BeanInfo for HorizontalSlider.
*
*/
public class HorizontalSliderBeanInfo extends SimpleBeanInfo {
/**
* Constructs a HorizontalSliderBeanInfo object.
*/
public HorizontalSliderBeanInfo() {
}
/**
* 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");
ResourceBundle conn = ResourceBundle.getBundle("symantec.itools.resources.ConnBundle");
String s=group.getString("GroupAdditional");
SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
bd.setFolder(s);
bd.setToolbar(s);
bd.setWinHelp("0x123AA");
bd.addConnectionDescriptor(new ConnectionDescriptor("output", "int", "",
"%name%.TICK_TOP",
conn.getString("TICK_TOP")));
bd.addConnectionDescriptor(new ConnectionDescriptor("output", "int", "",
"%name%.TICK_BOTTOM",
conn.getString("TICK_BOTTOM")));
bd.addAdditionalConnections(getAdditionalBeanInfo());
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("HorizontalSliderC16.gif");
return img;
}
if (iconKind == BeanInfo.ICON_MONO_32x32 ||
iconKind == BeanInfo.ICON_COLOR_32x32) {
java.awt.Image img = loadImage("HorizontalSliderC32.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();
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");
String s;
try{
PropertyDescriptor tickStyle = new PropertyDescriptor("tickStyle", beanClass);
tickStyle.setBound(true);
tickStyle.setConstrained(true);
tickStyle.setDisplayName(prop.getString("tickStyle"));
tickStyle.setValue("ENUMERATION", "TICK_BOTTOM=0, TICK_TOP=1, TICK_BOTH=2, TICK_NONE=3");
PropertyDescriptor[] rv = {
tickStyle};
return rv;
} catch (IntrospectionException e) { throw new Error(e.toString()); }
}
private final static Class beanClass = HorizontalSlider.class;
} // end of class HorizontalSliderBeanInfo