Esempio n. 1
0
 /**
  * @param ai
  * @param instance
  * @param field
  * @param parameter
  * @throws IllegalAccessException
  */
 private void initClassFieldDigitParameter(
     final Class<? extends AI> ai,
     final AI instance,
     final Field field,
     final AIDigitParameters parameter)
     throws IllegalAccessException {
   AIJComponent uiComponent = null;
   if (field.getType().equals(int.class)) {
     uiComponent =
         new AIDigitParameterJComponent<Integer>(
             (int) parameter.value(),
             (int) parameter.min(),
             (int) parameter.max(),
             ai,
             instance,
             field);
     field.setInt(instance, (int) parameter.value());
   } else if (field.getType().equals(double.class)) {
     uiComponent =
         new AIDigitParameterJComponent<Double>(
             parameter.value(), parameter.min(), parameter.max(), ai, instance, field);
     field.setDouble(instance, parameter.value());
   }
   if (uiComponent != null) {
     uiComponent.addComponents(instance.component());
   }
 }
Esempio n. 2
0
 /**
  * @param ai
  * @param instance
  * @param field
  * @param annotation
  */
 private void initClassFieldBooleanParameter(
     final Class<? extends AI> ai,
     final AI instance,
     final Field field,
     final AIBooleanParameter annotation)
     throws IllegalAccessException {
   AIJComponent uiComponent =
       new AIBooleanParameterJComponent(annotation.value(), ai, instance, field);
   field.setBoolean(instance, annotation.value());
   uiComponent.addComponents(instance.component());
 }