例: メソッドの定義と呼び出し
メソッドの定義
サンプルクラス LabelFunctions が以下のように Java ディレクトリに指定されています。
// LabelFunctions.java
// A class that provides static methods that
// can be used by the Java label function.
import rsdesigner.component.*;
import rsdesigner.design.*;
import java.util.*;
public class LabelFunctions
{
public static String test_shape_label(Shape rsd_shape, String data)
{
return "Shape" + data;
}
public static String test_sheet_label(Sheet rsd_sheet, String data)
{
return "Sheet" + data;
}
}
メソッドの呼び出し
形状ラベルに対して LabelFunctions.test_shape_label(data1) を使用して test_shape_label メソッドを呼び出すと、値 Shape_data1 が返されます。
形状ラベルに対して LabelFunctions.test_shape_label(data2) を使用して test_shape_label メソッドを呼び出すと、値 Shape_data2 が返されます。