protected boolean remove(Object s){
  boolean found=false;
  for (int i=0; i < sensorImage.size(); i++) {
    if (s == sensorImage.get(i)) {
      sensorImage.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < sensorList.size(); i++) {
    if (s == sensorList.get(i)) {
      sensorList.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < backgroundImage.size(); i++) {
    if (s == backgroundImage.get(i)) {
      backgroundImage.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < memoryLabelList.size(); i++) {
    if (s == memoryLabelList.get(i)) {
      memoryLabelList.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < blockContentsLabelList.size(); i++) {
    if (s == blockContentsLabelList.get(i)) {
      blockContentsLabelList.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < signalList.size(); i++) {
    if (s == signalList.get(i)) {
      signalList.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < signalMastList.size(); i++) {
    if (s == signalMastList.get(i)) {
      if (removeSignalMast((SignalMastIcon)s)) {
        signalMastList.remove(i);
        found=true;
        break;
      }
 else {
        return false;
      }
    }
  }
  for (int i=0; i < multiSensors.size(); i++) {
    if (s == multiSensors.get(i)) {
      multiSensors.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < clocks.size(); i++) {
    if (s == clocks.get(i)) {
      clocks.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < signalHeadImage.size(); i++) {
    if (s == signalHeadImage.get(i)) {
      signalHeadImage.remove(i);
      found=true;
      break;
    }
  }
  for (int i=0; i < labelImage.size(); i++) {
    if (s == labelImage.get(i)) {
      labelImage.remove(i);
      found=true;
      break;
    }
  }
  super.removeFromContents((Positionable)s);
  if (found) {
    setDirty(true);
    repaint();
  }
  return found;
}

protected boolean remove ( Object s ) { boolean found = false ; for ( int i = 0 ; i < sensorImage . size ( ) ; i ++ ) { if ( s == sensorImage . get ( i ) ) { sensorImage . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < sensorList . size ( ) ; i ++ ) { if ( s == sensorList . get ( i ) ) { sensorList . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < backgroundImage . size ( ) ; i ++ ) { if ( s == backgroundImage . get ( i ) ) { backgroundImage . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < memoryLabelList . size ( ) ; i ++ ) { if ( s == memoryLabelList . get ( i ) ) { memoryLabelList . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < blockContentsLabelList . size ( ) ; i ++ ) { if ( s == blockContentsLabelList . get ( i ) ) { blockContentsLabelList . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < signalList . size ( ) ; i ++ ) { if ( s == signalList . get ( i ) ) { signalList . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < signalMastList . size ( ) ; i ++ ) { if ( s == signalMastList . get ( i ) ) { if ( removeSignalMast ( ( SignalMastIcon ) s ) ) { signalMastList . remove ( i ) ; found = true ; break ; } else { return false ; } } } for ( int i = 0 ; i < multiSensors . size ( ) ; i ++ ) { if ( s == multiSensors . get ( i ) ) { multiSensors . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < clocks . size ( ) ; i ++ ) { if ( s == clocks . get ( i ) ) { clocks . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < signalHeadImage . size ( ) ; i ++ ) { if ( s == signalHeadImage . get ( i ) ) { signalHeadImage . remove ( i ) ; found = true ; break ; } } for ( int i = 0 ; i < labelImage . size ( ) ; i ++ ) { if ( s == labelImage . get ( i ) ) { labelImage . remove ( i ) ; found = true ; break ; } } super . removeFromContents ( ( Positionable ) s ) ; if ( found ) { setDirty ( true ) ; repaint ( ) ; } return found ; }
remove object from all layout editor temmporary lists of items not part of track schematic
