home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / jfc.bin / TabableView.java < prev    next >
Text File  |  1998-02-26  |  2KB  |  67 lines

  1. /*
  2.  * @(#)TabableView.java    1.1 98/01/13
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20. package com.sun.java.swing.text;
  21.  
  22.  
  23. /**
  24.  * Interface for View's that have size dependant
  25.  * upon tabs.  
  26.  * 
  27.  * @author  Timothy Prinzing
  28.  * @author  Scott Violet
  29.  * @version 1.1 01/13/98
  30.  * @see TabExpander
  31.  * @see LabelView
  32.  * @see ParagraphView
  33.  */
  34. public interface TabableView {
  35.  
  36.     /**
  37.      * Determines the desired span when using the given 
  38.      * tab expansion implementation.  If a container 
  39.      * calls this method, it will do so prior to the
  40.      * normal layout which would call getPreferredSpan.
  41.      * A view implementing this should give the same
  42.      * result in any subsequent calls to getPreferredSpan
  43.      * along the axis of tab expansion.
  44.      *
  45.      * @param x the position the view would be located
  46.      *  at for the purpose of tab expansion.
  47.      * @param e how to expand the tabs when encountered.
  48.      * @return the desired span
  49.      */
  50.     float getTabbedSpan(float x, TabExpander e);
  51.  
  52.     /**
  53.      * Determine the span along the same axis as tab 
  54.      * expansion for a portion of the view.  This is
  55.      * intended for use by the TabExpander for cases
  56.      * where the tab expansion involves aligning the
  57.      * portion of text that doesn't have whitespace 
  58.      * relative to the tab stop.  There is therefore
  59.      * an assumption that the range given does not
  60.      * contain tabs.
  61.      *
  62.      * @param p0 the starting location in the text document
  63.      * @param p1 the ending location in the text document
  64.      */
  65.     float getPartialSpan(int p0, int p1);
  66. }
  67.