public void notifyMovement(final ActiveEntity entity,final int oldX,final int oldY,final int newX,final int newY){
  Rectangle2D oeArea;
  Rectangle2D neArea;
  boolean oldIn;
  boolean newIn;
  oeArea=entity.getArea(oldX,oldY);
  neArea=entity.getArea(newX,newY);
  for (  final MovementListener l : movementListeners) {
    Rectangle2D area=l.getArea();
    oldIn=area.intersects(oeArea);
    newIn=area.intersects(neArea);
    if (!oldIn && newIn) {
      l.onEntered(entity,this,newX,newY);
    }
    if (oldIn && newIn) {
      l.onMoved(entity,this,oldX,oldY,newX,newY);
    }
    if (oldIn && !newIn) {
      l.onExited(entity,this,oldX,oldY);
    }
  }
}

public void notifyMovement ( final ActiveEntity entity , final int oldX , final int oldY , final int newX , final int newY ) { Rectangle2D oeArea ; Rectangle2D neArea ; boolean oldIn ; boolean newIn ; oeArea = entity . getArea ( oldX , oldY ) ; neArea = entity . getArea ( newX , newY ) ; for ( final MovementListener l : movementListeners ) { Rectangle2D area = l . getArea ( ) ; oldIn = area . intersects ( oeArea ) ; newIn = area . intersects ( neArea ) ; if ( ! oldIn && newIn ) { l . onEntered ( entity , this , newX , newY ) ; } if ( oldIn && newIn ) { l . onMoved ( entity , this , oldX , oldY , newX , newY ) ; } if ( oldIn && ! newIn ) { l . onExited ( entity , this , oldX , oldY ) ; } } }
notify anything interested that an entity moved .
