- newCalculator(currentAlignFrame.getAlignViewport(),
- currentAlignFrame, counter);
+ Method newCalcMethod = null;
+ try
+ {
+ for (Method m : AlignmentAnnotationFactory.class.getMethods())
+ {
+ if (m.getName().equals("newCalculator"))
+ {
+ if (m.getParameterCount() == 3
+ && m.getParameterTypes()[2].isInstance(counter))
+ {
+ newCalcMethod = m;
+ break;
+ }
+ }
+ }
+ } catch (Exception q)
+ {
+ }
+ if (newCalcMethod == null)
+ {
+
+ System.err
+ .println("Couldn't find a newCalculator method for ColumnCounterI type "
+ + counter.getClass().getName());
+ }
+ try
+ {
+ newCalcMethod.invoke(null, currentAlignFrame.getAlignViewport(),
+ currentAlignFrame, counter);
+ } catch (Exception ie)
+ {
+ System.err
+ .println("Exception when reporting newCalculator method for ColumnCounterI type "
+ + counter.getClass().getName());
+ }