private void processTrackerStateChange(Tracker tracker,OBlock block,int state){
  List<OBlock> oldRange=tracker.getRange();
switch (tracker.move(block,state)) {
case Tracker.NO_BLOCK:
    adjustBlockListeners(oldRange,tracker.getRange(),tracker);
  String msg=Bundle.getMessage("TrackerNoCurrentBlock",tracker.getTrainName(),block.getDisplayName()) + "\n" + Bundle.getMessage("TrackingStopped");
JOptionPane.showMessageDialog(this,msg,Bundle.getMessage("WarningTitle"),JOptionPane.WARNING_MESSAGE);
stopTrain(tracker);
setStatus(msg);
break;
case Tracker.ENTER_BLOCK:
block._entryTime=System.currentTimeMillis();
adjustBlockListeners(oldRange,tracker.getRange(),tracker);
setStatus(Bundle.getMessage("TrackerBlockEnter",tracker.getTrainName(),block.getDisplayName()));
break;
case Tracker.LEAVE_BLOCK:
adjustBlockListeners(oldRange,tracker.getRange(),tracker);
long et=(System.currentTimeMillis() - block._entryTime) / 1000;
setStatus(Bundle.getMessage("TrackerBlockLeave",tracker.getTrainName(),block.getDisplayName(),et / 60,et % 60));
break;
case Tracker.ERROR_BLOCK:
break;
}
}

private void processTrackerStateChange ( Tracker tracker , OBlock block , int state ) { List < OBlock > oldRange = tracker . getRange ( ) ; switch ( tracker . move ( block , state ) ) { case Tracker . NO_BLOCK : adjustBlockListeners ( oldRange , tracker . getRange ( ) , tracker ) ; String msg = Bundle . getMessage ( "TrackerNoCurrentBlock" , tracker . getTrainName ( ) , block . getDisplayName ( ) ) + "\n" + Bundle . getMessage ( "TrackingStopped" ) ; JOptionPane . showMessageDialog ( this , msg , Bundle . getMessage ( "WarningTitle" ) , JOptionPane . WARNING_MESSAGE ) ; stopTrain ( tracker ) ; setStatus ( msg ) ; break ; case Tracker . ENTER_BLOCK : block . _entryTime = System . currentTimeMillis ( ) ; adjustBlockListeners ( oldRange , tracker . getRange ( ) , tracker ) ; setStatus ( Bundle . getMessage ( "TrackerBlockEnter" , tracker . getTrainName ( ) , block . getDisplayName ( ) ) ) ; break ; case Tracker . LEAVE_BLOCK : adjustBlockListeners ( oldRange , tracker . getRange ( ) , tracker ) ; long et = ( System . currentTimeMillis ( ) - block . _entryTime ) / 1000 ; setStatus ( Bundle . getMessage ( "TrackerBlockLeave" , tracker . getTrainName ( ) , block . getDisplayName ( ) , et / 60 , et % 60 ) ) ; break ; case Tracker . ERROR_BLOCK : break ; } }
called when a state change has occurred for one the blocks listened to for this tracker . tracker . move makes the changes to oblocks to indicate the new occupancy positions of the train . upon return , update the listeners for the trains next move
