3 import java.lang.reflect.InvocationTargetException;
4 import java.lang.reflect.Method;
6 import javax.swing.JLabel;
14 private String text =
"";
17 private String methodName =
"";
24 this.methodName = methodName;
27 source.addListener(
this);
33 Class c = Indicators.class;
37 Method method = c.getMethod(methodName, GeomContainer.class);
40 result = (String) method.invoke(null, gObjects);
41 }
catch (IllegalAccessException | IllegalArgumentException
42 | InvocationTargetException e)
47 }
catch (NoSuchMethodException e)
49 Message.out(
"No method " + methodName
50 +
" in class Indicators!\nCheck the name.");
51 }
catch (SecurityException e)
53 Message.out(
"�ethod " + methodName
54 +
" in class Indicators is NOT public. �ake it public.");
57 this.setText(text +
": " + result);
IndicatorLabel(String text, String methodName, GeomContainer source)
Kласс для хранения графических объектов
Интерфейс слушателя контейнера. Функция вызывается при изменении контейнера
void onDataChanged(GeomContainer gObjects)