@Override protected boolean parametersAreValid(){
  boolean allIsOk;
  allIsOk=true;
  String text;
  int junk;
  boolean temp;
  temp=intParameterIsValid(bootload,0,255);
  allIsOk&=temp;
  if (!temp) {
    log.info("Bootloader Version Number is not valid: " + bootload.getText());
  }
  temp=intParameterIsValid(mfg,0,255);
  allIsOk&=temp;
  if (!temp) {
    log.info("Manufacturer Number is not valid: " + mfg.getText());
  }
  temp=intParameterIsValid(developer,0,255);
  allIsOk&=temp;
  if (!temp) {
    log.info("Developer Number is not valid: " + bootload.getText());
  }
  temp=intParameterIsValid(product,0,65535);
  allIsOk&=temp;
  if (!temp) {
    log.info("Product Code is not valid: " + product.getText());
  }
  temp=intParameterIsValid(hardware,0,255);
  allIsOk&=temp;
  if (!temp) {
    log.info("Hardware Version Number is not valid: " + hardware.getText());
  }
  temp=intParameterIsValid(software,0,255);
  allIsOk&=temp;
  if (!temp) {
    log.info("Software Version Number is not valid: " + software.getText());
  }
  temp=intParameterIsValid(delay,Integer.parseInt(MIN_DELAY_VALUE),Integer.parseInt(MAX_DELAY_VALUE));
  allIsOk&=temp;
  if (!temp) {
    log.info("Delay is not valid: " + delay.getText());
  }
  temp=(hardgroup.getSelection() != null);
  allIsOk&=temp;
  if (!temp) {
    log.info("No harware version check radio button is selected.");
  }
  temp=(softgroup.getSelection() != null);
  allIsOk&=temp;
  if (!temp) {
    log.info("No software version check radio button is selected.");
  }
  temp=true;
  eestart.setForeground(Color.black);
  text=eestart.getText();
  if (text.equals("")) {
    eestart.setText("0");
    eestart.setForeground(Color.red);
    temp=false;
  }
 else {
    try {
      junk=Integer.parseInt(text,16);
    }
 catch (    NumberFormatException ex) {
      junk=-1;
    }
    if ((junk < Integer.parseInt(MIN_EESTART_VALUE,16)) || ((junk % 8) != 0) || (junk > Integer.parseInt(MAX_EESTART_VALUE,16))) {
      eestart.setForeground(Color.red);
      temp=false;
    }
 else {
      eestart.setForeground(Color.black);
      temp=true;
    }
  }
  eestart.updateUI();
  allIsOk&=temp;
  if (allIsOk == true) {
    log.debug("No problems found when checking parameter values.");
  }
  return allIsOk;
}

@ Override protected boolean parametersAreValid ( ) { boolean allIsOk ; allIsOk = true ; String text ; int junk ; boolean temp ; temp = intParameterIsValid ( bootload , 0 , 255 ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "Bootloader Version Number is not valid: " + bootload . getText ( ) ) ; } temp = intParameterIsValid ( mfg , 0 , 255 ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "Manufacturer Number is not valid: " + mfg . getText ( ) ) ; } temp = intParameterIsValid ( developer , 0 , 255 ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "Developer Number is not valid: " + bootload . getText ( ) ) ; } temp = intParameterIsValid ( product , 0 , 65535 ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "Product Code is not valid: " + product . getText ( ) ) ; } temp = intParameterIsValid ( hardware , 0 , 255 ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "Hardware Version Number is not valid: " + hardware . getText ( ) ) ; } temp = intParameterIsValid ( software , 0 , 255 ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "Software Version Number is not valid: " + software . getText ( ) ) ; } temp = intParameterIsValid ( delay , Integer . parseInt ( MIN_DELAY_VALUE ) , Integer . parseInt ( MAX_DELAY_VALUE ) ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "Delay is not valid: " + delay . getText ( ) ) ; } temp = ( hardgroup . getSelection ( ) != null ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "No harware version check radio button is selected." ) ; } temp = ( softgroup . getSelection ( ) != null ) ; allIsOk &= temp ; if ( ! temp ) { log . info ( "No software version check radio button is selected." ) ; } temp = true ; eestart . setForeground ( Color . black ) ; text = eestart . getText ( ) ; if ( text . equals ( "" ) ) { eestart . setText ( "0" ) ; eestart . setForeground ( Color . red ) ; temp = false ; } else { try { junk = Integer . parseInt ( text , 16 ) ; } catch ( NumberFormatException ex ) { junk = - 1 ; } if ( ( junk < Integer . parseInt ( MIN_EESTART_VALUE , 16 ) ) || ( ( junk % 8 ) != 0 ) || ( junk > Integer . parseInt ( MAX_EESTART_VALUE , 16 ) ) ) { eestart . setForeground ( Color . red ) ; temp = false ; } else { eestart . setForeground ( Color . black ) ; temp = true ; } } eestart . updateUI ( ) ; allIsOk &= temp ; if ( allIsOk == true ) { log . debug ( "No problems found when checking parameter values." ) ; } return allIsOk ; }
checks the values in the gui text boxes to determine if any are invalid . intended for use immediately after reading a firmware file for the purpose of validating any key / value pairs found in the file . also intended for use immediately before a " verify " or " download " operation to check that the user has not changed any of the gui text values to ones that are unsupported . note that this method cannot guarantee that the values are suitable for the hardware being updated and / or for the particular firmware information which was read from the firmware file .
