Spec-Zone .ru
спецификации, руководства, описания, API
001/*
002 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation.  Oracle designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Oracle in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
022 * or visit www.oracle.com if you need additional information or have any
023 * questions.
024 */
025
026package javafx.scene.text;
027
028/**
029 * Specifies the behaviour of bounds reporting by {@code Text} nodes.
030 * The setting affects {@code layoutBounds}, {@code boundsInLocal} and
031 * {@code boundsInParent}
032 *
033 * The geometry of text can be measured either in terms of the bounds of
034 * the particular text to be rendered - visual bounds, or as properties
035 * of the font and the characters to be rendered - logical bounds.
036 * Visual bounds are more useful for positioning text as graphics, and
037 * for obtaining tight enclosing bounds around the text.
038 * <p>
039 * Logical bounds are important for laying out text relative to other
040 * text and other components, particularly those which also contain text.
041 * The bounds isn't specific to the text being rendered, and so will
042 * report heights which account for the potential ascent and descent of
043 * text using the font at its specified size. Also leading and trailing
044 * spaces are part of the logical advance width of the text.
045 * <p>
046 *
047 * @since JavaFX 1.3
048 */
049public enum TextBoundsType {
050
051    /**
052     * Use logical bounds as the basis for calculating the bounds.
053     * <p>
054     * The logical bounds are based on font metrics information. The width is
055     * based on the glyph advances and the height on the ascent, descent, and 
056     * line gap. Except for the last line which does not include the line gap.
057     * <p>
058     * Note: This is usually the fastest option.
059     */    
060    LOGICAL,
061
062    /**
063     * Use visual bounds as the basis for calculating the bounds.
064     * <p>
065     * Note: This is likely to be slower than using logical bounds.
066     */    
067    VISUAL,
068
069    /**
070     * Use logical vertical centered bounds as the basis for calculating the bounds.
071     * <p>
072     * This bounds type is typically used to center {@code Text} nodes vertically
073     * within the bounds of its parent.
074     */
075    LOGICAL_VERTICAL_CENTER
076
077}