KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > layoutmgr > KnuthBox


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: KnuthBox.java 426576 2006-07-28 15:44:37Z jeremias $ */
19
20 package org.apache.fop.layoutmgr;
21
22 /**
23  * An instance of this class represents an unbreakable piece of content with
24  * fixed width: for example an image, a syllable (but only if letter spacing
25  * is constant), ...
26  *
27  * A KnuthBox is never a feasible breaking point.
28  *
29  * The represented piece of content is never suppressed.
30  *
31  * Besides the inherited methods and attributes, this class has some more
32  * attributes to store information about the content height and its vertical
33  * positioning, and the methods used to get them.
34  */

35 public class KnuthBox extends KnuthElement {
36
37     /**
38      * Create a new KnuthBox.
39      *
40      * @param w the width of this box
41      * @param pos the Position stored in this box
42      * @param bAux is this box auxiliary?
43      */

44     public KnuthBox(int w, Position pos, boolean bAux) {
45         super(w, pos, bAux);
46     }
47
48     /** @see org.apache.fop.layoutmgr.KnuthElement#isBox() */
49     public boolean isBox() {
50         return true;
51     }
52
53     /** @see java.lang.Object#toString() */
54     public String JavaDoc toString() {
55         StringBuffer JavaDoc sb = new StringBuffer JavaDoc(64);
56         if (isAuxiliary()) {
57             sb.append("aux. ");
58         }
59         sb.append("box");
60         sb.append(" w=");
61         sb.append(getW());
62         return sb.toString();
63     }
64     
65 }
66
Popular Tags