KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > layoutmgr > inline > ScaledBaselineTable


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 /* $Id: ScaledBaselineTable.java 426576 2006-07-28 15:44:37Z jeremias $ */
19
20 package org.apache.fop.layoutmgr.inline;
21
22 import org.apache.fop.datatypes.Length;
23
24 /**
25  * The FOP specific incarnation of the XSL-FO scaled baseline table.
26  * All baseline tables are scaled to the font size of the font they
27  * apply to. This interface uses a coordinate system with its origin
28  * where the dominant baseline intersects the start edge of the box.
29  * All measurements are in mpt.
30  */

31 public interface ScaledBaselineTable {
32     
33     /**
34      * Return the dominant baseline identifer for this alignment context.
35      * @return the dominant baseline identifier
36      */

37     int getDominantBaselineIdentifier();
38     
39     /**
40      * Return the writing mode for this aligment context.
41      * @return the writing mode
42      */

43     int getWritingMode();
44
45     /**
46      * Return the offset measured from the dominant
47      * baseline for the given baseline identifier.
48      * @param baselineIdentifier the baseline identifier
49      * @return the baseline offset
50      */

51     int getBaseline(int baselineIdentifier);
52     
53     /**
54      * Sets the position of the before and after baselines.
55      * This is usually only done for line areas. For other
56      * areas the position of the before and after baselines
57      * are fixed when the table is constructed.
58      * @param beforeBaseline the offset of the before-edge baseline from the dominant baseline
59      * @param afterBaseline the offset of the after-edge baseline from the dominant baseline
60      */

61     void setBeforeAndAfterBaselines(int beforeBaseline, int afterBaseline);
62     
63     /**
64      * Return a new baseline table for the given baseline based
65      * on the current baseline table.
66      * @param baselineIdentifier the baseline identifer
67      * @return a new baseline with the new baseline
68      */

69     ScaledBaselineTable deriveScaledBaselineTable(int baselineIdentifier);
70
71 }
72
Popular Tags