2362N/A * Copyright (c) 1997, 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 * A <code>LabelView</code> is a styled chunk of text 0N/A * that represents a view mapped over an element in the 0N/A * text model. It caches the character level attributes 0N/A * used for rendering. 0N/A * @author Timothy Prinzing 0N/A * Constructs a new view wrapped on an element. 0N/A * @param elem the element 0N/A * Synchronize the view's cached values with the model. 0N/A * This causes the font, metrics, color, etc to be 0N/A * re-cached if the cache has been invalidated. 0N/A * Sets whether or not the view is underlined. 0N/A * Note that this setter is protected and is really 0N/A * only meant if you need to update some additional 0N/A * @param u true if the view is underlined, otherwise 0N/A * Note that this setter is protected and is really 0N/A * only meant if you need to update some additional 0N/A * through it, otherwise false 0N/A * @see #isStrikeThrough 0N/A * Sets whether or not the view represents a 0N/A * Note that this setter is protected and is really 0N/A * only meant if you need to update some additional 0N/A * @param s true if the view represents a 0N/A * superscript, otherwise false 0N/A * @see #isSuperscript 0N/A * Sets whether or not the view represents a 0N/A * Note that this setter is protected and is really 0N/A * only meant if you need to update some additional 0N/A * @param s true if the view represents a 0N/A * subscript, otherwise false 0N/A * Sets the background color for the view. This method is typically 0N/A * invoked as part of configuring this <code>View</code>. If you need 0N/A * to customize the background color you should override 0N/A * <code>setPropertiesFromAttributes</code> and invoke this method. A 0N/A * value of null indicates no background should be rendered, so that the 0N/A * background of the parent <code>View</code> will show through. 0N/A * @param bg background color, or null 0N/A * @see #setPropertiesFromAttributes 0N/A * Sets the cached properties from the attributes. 0N/A * Fetches the <code>FontMetrics</code> used for this view. 0N/A * @deprecated FontMetrics are not used for glyph rendering 0N/A * when running in the JDK. 0N/A * Fetches the background color to use to render the glyphs. 0N/A * This is implemented to return a cached background color, 0N/A * which defaults to <code>null</code>. 0N/A * @return the cached background color 0N/A * Fetches the foreground color to use to render the glyphs. 0N/A * This is implemented to return a cached foreground color, 0N/A * which defaults to <code>null</code>. 0N/A * @return the cached foreground color 0N/A * Fetches the font that the glyphs should be based upon. 0N/A * This is implemented to return a cached font. 0N/A * @return the cached font 0N/A * Determines if the glyphs should be underlined. If true, 0N/A * an underline should be drawn through the baseline. This 0N/A * is implemented to return the cached underline property. 0N/A * <p>When you request this property, <code>LabelView</code> 0N/A * re-syncs its state with the properties of the 0N/A * <code>Element</code>'s <code>AttributeSet</code>. 0N/A * If <code>Element</code>'s <code>AttributeSet</code> 0N/A * does not have this property set, it will revert to false. 0N/A * @return the value of the cached 0N/A * <code>underline</code> property 0N/A * Determines if the glyphs should have a strikethrough 0N/A * line. If true, a line should be drawn through the center 0N/A * of the glyphs. This is implemented to return the 0N/A * cached <code>strikeThrough</code> property. 0N/A * <p>When you request this property, <code>LabelView</code> 0N/A * re-syncs its state with the properties of the 0N/A * <code>Element</code>'s <code>AttributeSet</code>. 0N/A * If <code>Element</code>'s <code>AttributeSet</code> 0N/A * does not have this property set, it will revert to false. 0N/A * @return the value of the cached 0N/A * <code>strikeThrough</code> property 0N/A * Determines if the glyphs should be rendered as superscript. 0N/A * @return the value of the cached subscript property 0N/A * <p>When you request this property, <code>LabelView</code> 0N/A * re-syncs its state with the properties of the 0N/A * <code>Element</code>'s <code>AttributeSet</code>. 0N/A * If <code>Element</code>'s <code>AttributeSet</code> 0N/A * does not have this property set, it will revert to false. 0N/A * @return the value of the cached 0N/A * <code>subscript</code> property 0N/A * Determines if the glyphs should be rendered as subscript. 0N/A * <p>When you request this property, <code>LabelView</code> 0N/A * re-syncs its state with the properties of the 0N/A * <code>Element</code>'s <code>AttributeSet</code>. 0N/A * If <code>Element</code>'s <code>AttributeSet</code> 0N/A * does not have this property set, it will revert to false. 0N/A * @return the value of the cached 0N/A * <code>superscript</code> property 0N/A // --- View methods --------------------------------------------- 0N/A * Gives notification from the document that attributes were changed 0N/A * in a location that this view is responsible for. 0N/A * @param e the change information from the associated document 0N/A * @param a the current allocation of the view 0N/A * @param f the factory to use to rebuild if the view has children 0N/A * @see View#changedUpdate 0N/A // --- variables ------------------------------------------------