// Copyright 1996, Marimba Inc. All Rights Reserved.


// Confidential and Proprietary Information of Marimba, Inc.


// @(#)Line.java, 1.6, 12/15/96





package marimba.text;





import java.awt.*;





/**


 * This is a formatted line in a view of a Text object.


 *


 * @author	Jonathan Payne


 * @version 1.6, 12/15/96


 */


class Line implements Cloneable {


    /** X location of start of line. */


    int x;





    /** Y location. */


    int y;





    /** Starting position in buffer. */


    int pos = -1;





    /** End position of characters consumed in this line. */


    int pos1;





    /** End position of visible characters in this line. */


    int posV;





    /**


     * End position of all characters examined in determining the


     * extent of this line, even ones which end up being on the next


     * line.


     */


    int posE;





    /** Whether or not the content of this line has changed. */


    boolean modified;





    /** Whether or not y position this line has changed. */


    boolean ymodified;





    /** The height of the line. */


    short height;





    /** The ascent of the line. */


    short ascent;





    /** Index of style in effect at this beginning of this line.  This


      is just a cache, to speed up common operations such as mouse


      location and cursor positioning. */


    int styleIndex;





    /** Amount to add to width of spaces, for full justification. */


    float spaceShim;





    /** Number of tabs on the line, used to help in justification of


      lines which have tabs on them.  Only text after the last tab on


      the line is subject to full justification.  */


    int tabCount;





    public String toString() {


	return "Line[pos0=" + pos + ", y = " + y + ", style = " + styleIndex


	    + ", pos1=" + pos1 + ", mod = "


	    + modified + ", height = " + height + "]";


    }





    void copy(Line other) {


	x = other.x;


	y = other.y;


	pos = other.pos;


	pos1 = other.pos1;


	posE = other.posE;


	posV = other.posV;


	modified = other.modified;


	ymodified = other.ymodified;


	height = other.height;


	ascent = other.ascent;


	styleIndex = other.styleIndex;


	spaceShim = other.spaceShim;


	tabCount = other.tabCount;


    }


}


