home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1998 February
/
VPR9802A.ISO
/
APP_DEMO
/
VC
/
SOURCE.BIN
/
StatusScrollerBeanInfo.java
< prev
next >
Wrap
Text File
|
1997-10-27
|
14KB
|
392 lines
package symantec.itools.awt.util;
import java.beans.*;
import symantec.itools.beans.*;
/**
* BeanInfo for StatusScroller.
*
*/
public class StatusScrollerBeanInfo extends SimpleBeanInfo {
/**
* Constructs a StatusScrollerBeanInfo object.
*/
public StatusScrollerBeanInfo() {
}
/**
* 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() {
SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
bd.setFolder("ユーティリティ");
bd.setToolbar("ユーティリティ");
// bd.setFolder("Utility");
// bd.setToolbar("Utility");
bd.setWinHelp("0x12396");
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("StatusScrollerC16.gif");
return img;
}
if (iconKind == BeanInfo.ICON_MONO_32x32 ||
iconKind == BeanInfo.ICON_COLOR_32x32) {
java.awt.Image img = loadImage("StatusScrollerC32.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();
try{
args = null;
MethodDescriptor isScrollClean = new MethodDescriptor(beanClass.getMethod("isScrollClean", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "boolean", "",
"%name%.isScrollClean()",
"クリーンスクロールの方法を取得する");
// "Get Scroll Clean mode");
connections.addElement(connection);
isScrollClean.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(isScrollClean);
} catch (Exception e) { throw new Error("isScrollClean:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.Boolean.TYPE ;
MethodDescriptor setScrollClean = new MethodDescriptor(beanClass.getMethod("setScrollClean", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "boolean", "",
"%name%.setScrollClean(%arg%);",
"クリーンスクロールの方法を設定する");
// "Set Scroll Clean mode");
connections.addElement(connection);
setScrollClean.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setScrollClean);
} catch (Exception e) { throw new Error("setScrollClean:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.String.class ;
MethodDescriptor setString = new MethodDescriptor(beanClass.getMethod("setString", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "String", "",
"%name%.setString(%arg%);",
"スクロール文字列を設定する");
// "Set the Scrolling String");
connections.addElement(connection);
setString.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setString);
} catch (Exception e) { throw new Error("setString:: " + e.toString()); }
try{
args = null;
MethodDescriptor isRightToLeft = new MethodDescriptor(beanClass.getMethod("isRightToLeft", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "boolean", "",
"%name%.isRightToLeft()",
"スクロール方向(右から左)を取得する");
// "Get Right To Left mode");
connections.addElement(connection);
isRightToLeft.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(isRightToLeft);
} catch (Exception e) { throw new Error("isRightToLeft:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.Boolean.TYPE ;
MethodDescriptor setRightToLeft = new MethodDescriptor(beanClass.getMethod("setRightToLeft", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "void", "",
"%name%.setRightToLeft(%name%.getRightToLeft());",
"スクロール方向を逆転する");
// "Reverse direction");
connections.addElement(connection);
connection = new ConnectionDescriptor("input", "boolean", "",
"%name%.setRightToLeft(%arg%);",
"スクロール方向(右から左)を設定する");
// "Set Right To Left mode");
connections.addElement(connection);
setRightToLeft.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setRightToLeft);
} catch (Exception e) { throw new Error("setRightToLeft:: " + e.toString()); }
try{
args = null;
MethodDescriptor isAutoStart = new MethodDescriptor(beanClass.getMethod("isAutoStart", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "boolean", "",
"%name%.isAutoStart()",
"自動実行の方法を取得する");
// "Get Auto Start mode");
connections.addElement(connection);
isAutoStart.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(isAutoStart);
} catch (Exception e) { throw new Error("isAutoStart:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.Integer.TYPE ;
MethodDescriptor setDelay = new MethodDescriptor(beanClass.getMethod("setDelay", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "int", "",
"%name%.setDelay(%arg%);",
"遅延時間を設定する");
// "Set the delay amount");
connections.addElement(connection);
setDelay.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setDelay);
} catch (Exception e) { throw new Error("setDelay:: " + e.toString()); }
try{
args = null;
MethodDescriptor stop = new MethodDescriptor(beanClass.getMethod("stop", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "void", "",
"%name%.stop();",
"スクロールを中止する");
// "Stop scrolling");
connections.addElement(connection);
stop.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(stop);
} catch (Exception e) { throw new Error("stop:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.Boolean.TYPE ;
MethodDescriptor setRepeat = new MethodDescriptor(beanClass.getMethod("setRepeat", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "boolean", "",
"%name%.setRepeat(%arg%);",
"繰り返し状態を設定する");
// "Set Repeat mode");
connections.addElement(connection);
setRepeat.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setRepeat);
} catch (Exception e) { throw new Error("setRepeat:: " + e.toString()); }
try{
args = null;
MethodDescriptor isRepeat = new MethodDescriptor(beanClass.getMethod("isRepeat", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "boolean", "",
"%name%.isRepeat()",
"繰り返し状態を取得する");
// "Get Repeat mode");
connections.addElement(connection);
isRepeat.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(isRepeat);
} catch (Exception e) { throw new Error("isRepeat:: " + e.toString()); }
try{
args = null;
MethodDescriptor getString = new MethodDescriptor(beanClass.getMethod("getString", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "String", "",
"%name%.getString()",
"スクロール文字列を取得する");
// "Get the Scrolling String");
connections.addElement(connection);
getString.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(getString);
} catch (Exception e) { throw new Error("getString:: " + e.toString()); }
try{
args = null;
MethodDescriptor getDelay = new MethodDescriptor(beanClass.getMethod("getDelay", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "int", "",
"%name%.getDelay()",
"遅延時間を取得する");
// "Get the delay amount");
connections.addElement(connection);
getDelay.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(getDelay);
} catch (Exception e) { throw new Error("getDelay:: " + e.toString()); }
try{
args = null;
MethodDescriptor clear = new MethodDescriptor(beanClass.getMethod("clear", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "void", "",
"%name%.clear();",
"ステータスエリアをクリアする");
// "Clear the Status Area");
connections.addElement(connection);
clear.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(clear);
} catch (Exception e) { throw new Error("clear:: " + e.toString()); }
try{
args = null;
MethodDescriptor start = new MethodDescriptor(beanClass.getMethod("start", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "void", "",
"%name%.start();",
"スクロールを開始する");
// "Start scrolling");
connections.addElement(connection);
start.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(start);
} catch (Exception e) { throw new Error("start:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.Boolean.TYPE ;
MethodDescriptor setAutoStart = new MethodDescriptor(beanClass.getMethod("setAutoStart", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "boolean", "",
"%name%.setAutoStart(%arg%);",
"自動実行の方法を設定する");
// "Set Auto Start mode");
connections.addElement(connection);
setAutoStart.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setAutoStart);
} catch (Exception e) { throw new Error("setAutoStart:: " + e.toString()); }
MethodDescriptor[] rv = new MethodDescriptor[md.size()];
md.copyInto(rv);
return rv;
}
/**
* Returns descriptions of this bean's properties.
*/
public PropertyDescriptor[] getPropertyDescriptors() {
try{
PropertyDescriptor defProperty = new PropertyDescriptor("string", beanClass);
defProperty.setBound(true);
defProperty.setConstrained(true);
defProperty.setDisplayName("文字列");
// defProperty.setDisplayName("String");
PropertyDescriptor delay = new PropertyDescriptor("delay", beanClass);
delay.setBound(true);
delay.setConstrained(true);
delay.setDisplayName("遅延時間");
// delay.setDisplayName("Delay");
PropertyDescriptor repeat = new PropertyDescriptor("repeat", beanClass);
repeat.setBound(true);
repeat.setConstrained(true);
repeat.setDisplayName("繰り返し");
// repeat.setDisplayName("Repeat");
PropertyDescriptor rightToLeft = new PropertyDescriptor("rightToLeft", beanClass);
rightToLeft.setBound(true);
rightToLeft.setConstrained(true);
rightToLeft.setDisplayName("スクロール方向(右から左)");
// rightToLeft.setDisplayName("Right To Left");
PropertyDescriptor scrollClean = new PropertyDescriptor("scrollClean", beanClass);
scrollClean.setBound(true);
scrollClean.setConstrained(true);
scrollClean.setDisplayName("クリーンスクロール");
// scrollClean.setDisplayName("Scroll Clean");
PropertyDescriptor autoStart = new PropertyDescriptor("autoStart", beanClass);
autoStart.setBound(true);
autoStart.setConstrained(true);
autoStart.setDisplayName("自動実行");
// autoStart.setDisplayName("Auto Start");
PropertyDescriptor[] rv = {
defProperty,
delay,
repeat,
rightToLeft,
scrollClean,
autoStart};
return rv;
} catch (IntrospectionException e) { throw new Error(e.toString()); }
}
/**
* Returns the index of the property expected to be changed most often by the designer.
*/
public int getDefaultPropertyIndex() {
return 0; // the index for our default property is always 0
}
private final static Class beanClass = StatusScroller.class;
} // end of class StatusScrollerBeanInfo