/* DisplayAdjustmentEvent.java
 *
 * created: Tue Dec 15 1998
 *
 * This file is part of Artemis
 * 
 * Copyright (C) 1998,1999,2000  Genome Research Limited
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Header: /nfs/disk222/yeastpub/Repository/powmap/diana/components/DisplayAdjustmentEvent.java,v 1.7 2000/02/28 16:04:03 kmr Exp $
 **/

package diana.components;

import diana.ChangeEvent;

/**
 *  This event is sent when a FeatureDisplay is scrolled.
 *
 *  @author Kim Rutherford
 *  @version $Id: DisplayAdjustmentEvent.java,v 1.7 2000/02/28 16:04:03 kmr Exp $
 **/

public class DisplayAdjustmentEvent extends ChangeEvent {
  /**
   *  Create a new DisplayAdjustmentEvent.
   *  @param source The Object that generated the event - probably a component.
   *  @param start_base The new start base on the display.
   *  @param end_base The new end base on the display.
   *  @param width_in_bases The width of the drawing area in bases.  We need
   *    this because if the user scrolls to the end of the sequence, the last
   *    visible base (end_base) may not be at the right of the screen.  This
   *    might be greater than end_base - start_base.
   *  @param base_width The width in pixels of a base on screen.
   *  @param scale_factor This is the scale factor use by the FeatureDisplay
   *    component.  A factor of zero means the full translation will be
   *    visible.  At higher scale factors only stop codons are visible, and
   *    a bigger number will mean more bases are visible.
   **/
  public DisplayAdjustmentEvent (Object source,
                                 int start_base,
                                 int end_base,
                                 int width_in_bases,
                                 float base_width,
                                 int scale_factor) {
    super (source);
    this.start_base     = start_base;
    this.end_base       = end_base;
    this.width_in_bases = width_in_bases;
    this.base_width     = base_width;
    this.scale_factor   = scale_factor;
  }

  /**
   *  Return the new start base to display, as passed to the constructor.
   **/
  public int getStart () {
    return start_base;
  }

  /**
   *  Return the new end base to display, as passed to the constructor.
   **/
  public int getEnd () {
    return end_base;
  }

  /**
   *  Return the width in bases of the display, as passed to the constructor.
   **/
  public int getWidthInBases () {
    return width_in_bases;
  }

  /**
   *  Return the width of a base on the display, as passed to the constructor.
   **/
  public float getBaseWidth () {
    return base_width;
  }

  /**
   *  Return the scale factor that was passed to the constructor.
   **/
  public int getScaleFactor () {
    return scale_factor;
  }

  /**
   *  The new start base, as passed to the constructor.
   **/
  private int start_base;

  /**
   *  The new end base, as passed to the constructor.
   **/
  private int end_base;

  /**
   *  The width in bases of the display, as passed to the constructor.
   **/
  private int width_in_bases; 

  /**
   *  The width of each base on the display, as passed to the constructor.
   **/
  private float base_width; 

  /**
   *  The scale factor, as passed to the constructor.
   **/
  private int scale_factor;
}


