Source Code Cross Referenced for LineMetrics.java in  » 6.0-JDK-Core » AWT » java » awt » font » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt.font 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1998-2003 Sun Microsystems, Inc.  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.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025        /*
026         * @(#)LineMetrics.java	1.4 98/09/21
027         */
028
029        package java.awt.font;
030
031        /**
032         * The <code>LineMetrics</code> class allows access to the
033         * metrics needed to layout characters along a line
034         * and to layout of a set of lines.  A <code>LineMetrics</code>
035         * object encapsulates the measurement information associated
036         * with a run of text.
037         * <p>
038         * Fonts can have different metrics for different ranges of
039         * characters.  The <code>getLineMetrics</code> methods of
040         * {@link java.awt.Font Font} take some text as an argument
041         * and return a <code>LineMetrics</code> object describing the
042         * metrics of the initial number of characters in that text, as
043         * returned by {@link #getNumChars}.
044         */
045
046        public abstract class LineMetrics {
047
048            /**
049             * Returns the number of characters (<code>char</code> values) in the text whose
050             * metrics are encapsulated by this <code>LineMetrics</code>
051             * object.
052             * @return the number of characters (<code>char</code> values) in the text with which
053             *         this <code>LineMetrics</code> was created.
054             */
055            public abstract int getNumChars();
056
057            /**
058             * Returns the ascent of the text.  The ascent
059             * is the distance from the baseline
060             * to the ascender line.  The ascent usually represents the
061             * the height of the capital letters of the text.  Some characters
062             * can extend above the ascender line.
063             * @return the ascent of the text.
064             */
065            public abstract float getAscent();
066
067            /**
068             * Returns the descent of the text.  The descent
069             * is the distance from the baseline 
070             * to the descender line.  The descent usually represents
071             * the distance to the bottom of lower case letters like
072             * 'p'.  Some characters can extend below the descender
073             * line. 
074             * @return the descent of the text.
075             */
076            public abstract float getDescent();
077
078            /**
079             * Returns the leading of the text. The
080             * leading is the recommended 
081             * distance from the bottom of the descender line to the
082             * top of the next line.
083             * @return the leading of the text.
084             */
085            public abstract float getLeading();
086
087            /**
088             * Returns the height of the text.  The
089             * height is equal to the sum of the ascent, the
090             * descent and the leading.
091             * @return the height of the text.
092             */
093            public abstract float getHeight();
094
095            /**
096             * Returns the baseline index of the text.
097             * The index is one of 
098             * {@link java.awt.Font#ROMAN_BASELINE ROMAN_BASELINE},
099             * {@link java.awt.Font#CENTER_BASELINE CENTER_BASELINE}, 
100             * {@link java.awt.Font#HANGING_BASELINE HANGING_BASELINE}.
101             * @return the baseline of the text.
102             */
103            public abstract int getBaselineIndex();
104
105            /**
106             * Returns the baseline offsets of the text, 
107             * relative to the baseline of the text.  The
108             * offsets are indexed by baseline index.  For 
109             * example, if the baseline index is 
110             * <code>CENTER_BASELINE</code> then 
111             * <code>offsets[HANGING_BASELINE]</code> is usually
112             * negative, <code>offsets[CENTER_BASELINE]</code> 
113             * is zero, and <code>offsets[ROMAN_BASELINE]</code> 
114             * is usually positive.
115             * @return the baseline offsets of the text.
116             */
117            public abstract float[] getBaselineOffsets();
118
119            /**
120             * Returns the position of the strike-through line 
121             * relative to the baseline.
122             * @return the position of the strike-through line.
123             */
124            public abstract float getStrikethroughOffset();
125
126            /**
127             * Returns the thickness of the strike-through line.
128             * @return the thickness of the strike-through line.         
129             */
130            public abstract float getStrikethroughThickness();
131
132            /**
133             * Returns the position of the underline relative to
134             * the baseline.   
135             * @return the position of the underline.
136             */
137            public abstract float getUnderlineOffset();
138
139            /**
140             * Returns the thickness of the underline.
141             * @return the thickness of the underline.
142             */
143            public abstract float getUnderlineThickness();
144        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.