2362N/A * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * (C) Copyright Taligent, Inc. 1996 - 1997, All Rights Reserved 0N/A * (C) Copyright IBM Corp. 1996 - 1998, All Rights Reserved 0N/A * The original version of this source code and documentation is 0N/A * copyrighted and owned by Taligent, Inc., a wholly-owned subsidiary 0N/A * of IBM. These materials are provided under terms of a License 0N/A * Agreement between Taligent and Sun. This technology is protected 0N/A * by multiple US and International patents. 0N/A * This notice and attribution to Taligent may not be removed. 0N/A * Taligent is a registered trademark of Taligent, Inc. 0N/A * This class is used with the CHAR_REPLACEMENT attribute. 0N/A * The <code>GraphicAttribute</code> class represents a graphic embedded 0N/A * in text. Clients subclass this class to implement their own char 0N/A * replacement graphics. Clients wishing to embed shapes and images in 0N/A * text need not subclass this class. Instead, clients can use the 0N/A * {@link ShapeGraphicAttribute} and {@link ImageGraphicAttribute} 0N/A * Subclasses must ensure that their objects are immutable once they 0N/A * are constructed. Mutating a <code>GraphicAttribute</code> that 0N/A * is used in a {@link TextLayout} results in undefined behavior from the 0N/A * <code>TextLayout</code>. 0N/A * Aligns top of graphic to top of line. 0N/A * Aligns bottom of graphic to bottom of line. 0N/A * Aligns origin of graphic to roman baseline of line. 0N/A * Aligns origin of graphic to center baseline of line. 0N/A * Aligns origin of graphic to hanging baseline of line. 0N/A * Constructs a <code>GraphicAttribute</code>. 0N/A * Subclasses use this to define the alignment of the graphic. 0N/A * @param alignment an int representing one of the 0N/A * <code>GraphicAttribute</code> alignment fields 0N/A * @throws IllegalArgumentException if alignment is not one of the 0N/A * five defined values. 0N/A * Returns the ascent of this <code>GraphicAttribute</code>. A 0N/A * graphic can be rendered above its ascent. 0N/A * @return the ascent of this <code>GraphicAttribute</code>. 0N/A * Returns the descent of this <code>GraphicAttribute</code>. A 0N/A * graphic can be rendered below its descent. 0N/A * @return the descent of this <code>GraphicAttribute</code>. 0N/A * Returns the advance of this <code>GraphicAttribute</code>. The 0N/A * <code>GraphicAttribute</code> object's advance is the distance 0N/A * from the point at which the graphic is rendered and the point where 0N/A * the next character or graphic is rendered. A graphic can be 0N/A * rendered beyond its advance 0N/A * @return the advance of this <code>GraphicAttribute</code>. 0N/A * Returns a {@link Rectangle2D} that encloses all of the 0N/A * bits drawn by this <code>GraphicAttribute</code> relative to the 0N/A * rendering position. 0N/A * A graphic may be rendered beyond its origin, ascent, descent, 0N/A * or advance; but if it is, this method's implementation must 0N/A * indicate where the graphic is rendered. 0N/A * Default bounds is the rectangle (0, -ascent, advance, ascent+descent). 0N/A * @return a <code>Rectangle2D</code> that encloses all of the bits 0N/A * rendered by this <code>GraphicAttribute</code>. 0N/A * Return a {@link java.awt.Shape} that represents the region that 0N/A * this <code>GraphicAttribute</code> renders. This is used when a 0N/A * {@link TextLayout} is requested to return the outline of the text. 0N/A * The (untransformed) shape must not extend outside the rectangular 0N/A * bounds returned by <code>getBounds</code>. 0N/A * The default implementation returns the rectangle returned by 0N/A * {@link #getBounds}, transformed by the provided {@link AffineTransform} 0N/A * @param tx an optional {@link AffineTransform} to apply to the 0N/A * outline of this <code>GraphicAttribute</code>. This can be null. 0N/A * @return a <code>Shape</code> representing this graphic attribute, 0N/A * suitable for stroking or filling. 0N/A * Renders this <code>GraphicAttribute</code> at the specified 0N/A * @param graphics the {@link Graphics2D} into which to render the 0N/A * @param x the user-space X coordinate where the graphic is rendered 0N/A * @param y the user-space Y coordinate where the graphic is rendered 0N/A * Returns the alignment of this <code>GraphicAttribute</code>. 0N/A * Alignment can be to a particular baseline, or to the absolute top 0N/A * or bottom of a line. 0N/A * @return the alignment of this <code>GraphicAttribute</code>. 0N/A * Returns the justification information for this 0N/A * <code>GraphicAttribute</code>. Subclasses 0N/A * can override this method to provide different justification 0N/A * @return a {@link GlyphJustificationInfo} object that contains the 0N/A * justification information for this <code>GraphicAttribute</code>. 0N/A // should we cache this? 0N/A false,
// growAbsorb 0N/A false,
// shrinkAbsorb 0N/A 1,
// shrinkPriority 0N/A 0,
// shrinkLeftLimit 0N/A 0);
// shrinkRightLimit