Listing of Source ../source/GOF/GofMainAreaIdentifier.java
package se.entra.phantom.server;

import java.util.Vector;

/**
 * Since this class represents everything that is left after all the other areas have been 
 * identified, it does not have any logic to identify itself. Therefore it should work 
 * without problem for any host application.
 * <p>
 * This class just takes all the GofHostFields that have not been assigned to any other area, 
 * and assigns them to this area.
 * @author J. Bergström
 */
public class GofMainAreaIdentifier extends GofHostAreaIdentifierAdapter
{
  // ----------------
  // INSTANCE METHODS
  // ----------------

  /**
   * A method that identifies which of the Gui-on-the-fly host fields that belong to the area.
   * @param gofHostFields A <code>Vector</code> containing all the GofHostFields in the part of the 
   *                      screen area to be analyzed.
   * @param x             The start column of the area to be analyzed.
   * @param y             The start line of the area to be analyzed.
   * @param w             The width of the area to be analyzed.
   * @param h             The height of the area to be analyzed.
   * @return A <code>Vector</code> containing all the unused Gui-on-the-fly host fields.
   */
  @Override
  public Vector<GofHostField> identifyArea( Vector<GofHostField> gofHostFields, int x, int y, int w, int h )
  {
    areaGofHostFields = new Vector<GofHostField>( );
    phantomControls = new Vector<PhantomControl>( );
    Vector<GofHostField> unusedGofHostFields = new Vector<GofHostField>( );

    for( int i = 0, s = gofHostFields.size( ); i < s; i++ )
    {
      GofHostField ghf = gofHostFields.elementAt( i );
      areaGofHostFields.addElement( ghf );
    }

    return unusedGofHostFields;
  }
}