home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 4.3 KB | 134 lines |
- /*
- * @(#)TextLayoutComponent.java 1.4 98/03/18
- *
- * Copyright 1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- /*
- * (C) Copyright Taligent, Inc. 1996 - 1997, All Rights Reserved
- * (C) Copyright IBM Corp. 1996 - 1998, All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by Taligent, Inc., a wholly-owned subsidiary
- * of IBM. These materials are provided under terms of a License
- * Agreement between Taligent and Sun. This technology is protected
- * by multiple US and International patents.
- *
- * This notice and attribution to Taligent may not be removed.
- * Taligent is a registered trademark of Taligent, Inc.
- *
- */
-
- package java.awt.font;
-
- import java.text.AttributedCharacterIterator;
- import java.awt.geom.Rectangle2D;
- import java.awt.Graphics2D;
-
- interface TextLayoutComponent {
-
- public abstract float getAdvance();
-
- public abstract float getAscent();
-
- public abstract float getDescent(float ascent);
-
- public abstract float getLeading();
-
- public abstract int getNumGlyphs();
-
- public abstract int getNumCharacters();
-
- public abstract byte getBaseline();
-
- public abstract float getXAdjust();
-
- public abstract float getGlyphXAdvance(int index);
-
- public abstract float getYAdjust();
-
- public abstract float getGlyphYAdvance(int index);
-
- public abstract float getGlyphAdvance(int index);
-
- public abstract int visualToLogicalIndex(int index);
-
- public abstract byte getLevel(int index);
-
- public abstract boolean isCompletelyLTR();
-
- public abstract TextLayoutComponent applyJustification(
- float[] deltas, int index, boolean[] flags);
-
- public abstract float getAdvanceBetween(int start, int limit);
-
- public abstract int getLineBreakIndex(int start, float hitAdvance);
-
- public abstract TextLayoutComponent subset(int start, int limit);
-
- public abstract TextLayoutComponent insertChar(
- AttributedCharacterIterator newText,
- int start, int limit,
- int insertPos,
- int[] order,
- byte[] levels);
-
- public abstract TextLayoutComponent deleteChar(
- AttributedCharacterIterator newText,
- int start, int limit,
- int deletePos,
- int[] order,
- byte[] levels);
-
- public abstract TextLayoutComponent reshape(
- AttributedCharacterIterator newText,
- int start, int limit,
- int changePos,
- int[] order,
- byte[] levels);
-
- public abstract void draw(Graphics2D graphics, float x, float y, TextLayout hostLayout);
-
- /**
- * Return the bounds containing all bits drawn by this TextLayoutComponent.
- */
- public abstract Rectangle2D getBounds(TextLayout hostLayout);
-
- public abstract TextLayoutComponent setDirection(boolean leftToRight);
-
- /**
- * Return GlyphMetrics for glyph at index.
- * Index is NOT a glyph code.
- */
- public abstract GlyphMetrics getGlyphMetrics(int index, TextLayout hostLayout);
-
- /**
- * Return whether glyph at index is a component. More convenient for GlyphIterator
- * to use and TextLayoutGraphic to implement.
- * Invariant: isComponent(x) == getGlypMetrics(x, layout).isComponent()
- * Index is NOT a glyph code.
- */
- public abstract boolean isComponent(int index);
-
- /**
- * Return GlyphJustificationInfo for glyph at index.
- * Index is NOT a glyph code.
- */
- public abstract GlyphJustificationInfo getGlyphJustificationInfo(int index);
-
- public abstract int hashCode();
-
- public abstract boolean equals(TextLayoutComponent set);
-
- public abstract float getItalicAngle();
- }
-
-