protected void editControlAction(int row){
  lc=controlList.get(row);
  if (lc == null) {
    log.error("Invalid light control edit specified");
    return;
  }
  inEditControlMode=true;
  addEditControlWindow();
  int ctType=lc.getControlType();
switch (ctType) {
case Light.SENSOR_CONTROL:
    setUpControlType(sensorControl);
  typeBox.setSelectedIndex(sensorControlIndex);
field1a.setText(lc.getControlSensorName());
stateBox.setSelectedIndex(sensorActiveIndex);
if (lc.getControlSensorSense() == Sensor.INACTIVE) {
stateBox.setSelectedIndex(sensorInactiveIndex);
}
break;
case Light.FAST_CLOCK_CONTROL:
setUpControlType(fastClockControl);
typeBox.setSelectedIndex(fastClockControlIndex);
int onHour=lc.getFastClockOnHour();
int onMin=lc.getFastClockOnMin();
int offHour=lc.getFastClockOffHour();
int offMin=lc.getFastClockOffMin();
field1b.setText(formatTime(onHour,onMin));
field2a.setText(formatTime(offHour,offMin));
break;
case Light.TURNOUT_STATUS_CONTROL:
setUpControlType(turnoutStatusControl);
typeBox.setSelectedIndex(turnoutStatusControlIndex);
field1c.setText(lc.getControlTurnoutName());
stateBox.setSelectedIndex(turnoutClosedIndex);
if (lc.getControlTurnoutState() == Turnout.THROWN) {
stateBox.setSelectedIndex(turnoutThrownIndex);
}
break;
case Light.TIMED_ON_CONTROL:
setUpControlType(timedOnControl);
typeBox.setSelectedIndex(timedOnControlIndex);
int duration=lc.getTimedOnDuration();
field1d.setText(lc.getControlTimedOnSensorName());
field2b.setText(Integer.toString(duration));
break;
case Light.TWO_SENSOR_CONTROL:
setUpControlType(twoSensorControl);
typeBox.setSelectedIndex(twoSensorControlIndex);
field1a.setText(lc.getControlSensorName());
field1a2.setText(lc.getControlSensor2Name());
stateBox.setSelectedIndex(sensorActiveIndex);
if (lc.getControlSensorSense() == Sensor.INACTIVE) {
stateBox.setSelectedIndex(sensorInactiveIndex);
}
break;
case Light.NO_CONTROL:
setUpControlType(noControl);
typeBox.setSelectedIndex(noControlIndex);
field1a.setText("");
stateBox.setSelectedIndex(sensorActiveIndex);
break;
}
updateControl.setVisible(true);
createControl.setVisible(false);
addControlFrame.pack();
addControlFrame.setVisible(true);
}

protected void editControlAction ( int row ) { lc = controlList . get ( row ) ; if ( lc == null ) { log . error ( "Invalid light control edit specified" ) ; return ; } inEditControlMode = true ; addEditControlWindow ( ) ; int ctType = lc . getControlType ( ) ; switch ( ctType ) { case Light . SENSOR_CONTROL : setUpControlType ( sensorControl ) ; typeBox . setSelectedIndex ( sensorControlIndex ) ; field1a . setText ( lc . getControlSensorName ( ) ) ; stateBox . setSelectedIndex ( sensorActiveIndex ) ; if ( lc . getControlSensorSense ( ) == Sensor . INACTIVE ) { stateBox . setSelectedIndex ( sensorInactiveIndex ) ; } break ; case Light . FAST_CLOCK_CONTROL : setUpControlType ( fastClockControl ) ; typeBox . setSelectedIndex ( fastClockControlIndex ) ; int onHour = lc . getFastClockOnHour ( ) ; int onMin = lc . getFastClockOnMin ( ) ; int offHour = lc . getFastClockOffHour ( ) ; int offMin = lc . getFastClockOffMin ( ) ; field1b . setText ( formatTime ( onHour , onMin ) ) ; field2a . setText ( formatTime ( offHour , offMin ) ) ; break ; case Light . TURNOUT_STATUS_CONTROL : setUpControlType ( turnoutStatusControl ) ; typeBox . setSelectedIndex ( turnoutStatusControlIndex ) ; field1c . setText ( lc . getControlTurnoutName ( ) ) ; stateBox . setSelectedIndex ( turnoutClosedIndex ) ; if ( lc . getControlTurnoutState ( ) == Turnout . THROWN ) { stateBox . setSelectedIndex ( turnoutThrownIndex ) ; } break ; case Light . TIMED_ON_CONTROL : setUpControlType ( timedOnControl ) ; typeBox . setSelectedIndex ( timedOnControlIndex ) ; int duration = lc . getTimedOnDuration ( ) ; field1d . setText ( lc . getControlTimedOnSensorName ( ) ) ; field2b . setText ( Integer . toString ( duration ) ) ; break ; case Light . TWO_SENSOR_CONTROL : setUpControlType ( twoSensorControl ) ; typeBox . setSelectedIndex ( twoSensorControlIndex ) ; field1a . setText ( lc . getControlSensorName ( ) ) ; field1a2 . setText ( lc . getControlSensor2Name ( ) ) ; stateBox . setSelectedIndex ( sensorActiveIndex ) ; if ( lc . getControlSensorSense ( ) == Sensor . INACTIVE ) { stateBox . setSelectedIndex ( sensorInactiveIndex ) ; } break ; case Light . NO_CONTROL : setUpControlType ( noControl ) ; typeBox . setSelectedIndex ( noControlIndex ) ; field1a . setText ( "" ) ; stateBox . setSelectedIndex ( sensorActiveIndex ) ; break ; } updateControl . setVisible ( true ) ; createControl . setVisible ( false ) ; addControlFrame . pack ( ) ; addControlFrame . setVisible ( true ) ; }
responds to edit button on row in the light control table
