home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / font / TextLayoutComponent.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  4.3 KB  |  134 lines

  1. /*
  2.  * @(#)TextLayoutComponent.java    1.4 98/03/18
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. /*
  16.  * (C) Copyright Taligent, Inc. 1996 - 1997, All Rights Reserved
  17.  * (C) Copyright IBM Corp. 1996 - 1998, All Rights Reserved
  18.  *
  19.  * The original version of this source code and documentation is
  20.  * copyrighted and owned by Taligent, Inc., a wholly-owned subsidiary
  21.  * of IBM. These materials are provided under terms of a License
  22.  * Agreement between Taligent and Sun. This technology is protected
  23.  * by multiple US and International patents.
  24.  *
  25.  * This notice and attribution to Taligent may not be removed.
  26.  * Taligent is a registered trademark of Taligent, Inc.
  27.  *
  28.  */
  29.  
  30. package java.awt.font;
  31.  
  32. import java.text.AttributedCharacterIterator;
  33. import java.awt.geom.Rectangle2D;
  34. import java.awt.Graphics2D;
  35.  
  36. interface TextLayoutComponent {
  37.  
  38.     public abstract float getAdvance();
  39.  
  40.     public abstract float getAscent();
  41.  
  42.     public abstract float getDescent(float ascent);
  43.  
  44.     public abstract float getLeading();
  45.  
  46.     public abstract int getNumGlyphs();
  47.  
  48.     public abstract int getNumCharacters();
  49.  
  50.     public abstract byte getBaseline();
  51.  
  52.     public abstract float getXAdjust();
  53.  
  54.     public abstract float getGlyphXAdvance(int index);
  55.  
  56.     public abstract float getYAdjust();
  57.  
  58.     public abstract float getGlyphYAdvance(int index);
  59.  
  60.     public abstract float getGlyphAdvance(int index);
  61.  
  62.     public abstract int visualToLogicalIndex(int index);
  63.  
  64.     public abstract byte getLevel(int index);
  65.  
  66.     public abstract boolean isCompletelyLTR();
  67.  
  68.     public abstract TextLayoutComponent applyJustification(
  69.                         float[] deltas, int index, boolean[] flags);
  70.  
  71.     public abstract float getAdvanceBetween(int start, int limit);
  72.  
  73.     public abstract int getLineBreakIndex(int start, float hitAdvance);
  74.  
  75.     public abstract TextLayoutComponent subset(int start, int limit);
  76.  
  77.     public abstract TextLayoutComponent insertChar(
  78.                                     AttributedCharacterIterator newText,
  79.                                     int start, int limit,
  80.                                     int insertPos,
  81.                                     int[] order,
  82.                                     byte[] levels);
  83.  
  84.     public abstract TextLayoutComponent deleteChar(
  85.                                     AttributedCharacterIterator newText,
  86.                                     int start, int limit,
  87.                                     int deletePos,
  88.                                     int[] order,
  89.                                     byte[] levels);
  90.  
  91.     public abstract TextLayoutComponent reshape(
  92.                                     AttributedCharacterIterator newText,
  93.                                     int start, int limit,
  94.                                     int changePos,
  95.                                     int[] order,
  96.                                     byte[] levels);
  97.  
  98.     public abstract void draw(Graphics2D graphics, float x, float y, TextLayout hostLayout);
  99.  
  100.     /**
  101.      * Return the bounds containing all bits drawn by this TextLayoutComponent.
  102.      */
  103.     public abstract Rectangle2D getBounds(TextLayout hostLayout);
  104.  
  105.     public abstract TextLayoutComponent setDirection(boolean leftToRight);
  106.  
  107.     /**
  108.      * Return GlyphMetrics for glyph at index.
  109.      * Index is NOT a glyph code.
  110.      */
  111.     public abstract GlyphMetrics getGlyphMetrics(int index, TextLayout hostLayout);
  112.  
  113.     /**
  114.      * Return whether glyph at index is a component.  More convenient for GlyphIterator
  115.      * to use and TextLayoutGraphic to implement.
  116.      * Invariant: isComponent(x) == getGlypMetrics(x, layout).isComponent()
  117.      * Index is NOT a glyph code.
  118.      */
  119.     public abstract boolean isComponent(int index);
  120.  
  121.     /**
  122.      * Return GlyphJustificationInfo for glyph at index.
  123.      * Index is NOT a glyph code.
  124.      */
  125.     public abstract GlyphJustificationInfo getGlyphJustificationInfo(int index);
  126.  
  127.     public abstract int hashCode();
  128.  
  129.     public abstract boolean equals(TextLayoutComponent set);
  130.  
  131.     public abstract float getItalicAngle();
  132. }
  133.  
  134.