KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > area > inline > Character


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: Character.java 426576 2006-07-28 15:44:37Z jeremias $ */
19
20 package org.apache.fop.area.inline;
21
22 /**
23  * Single character inline area.
24  * This inline area holds a single character.
25  * @deprecated A TextArea with a single WordArea as its child should be used instead.
26  */

27 public class Character extends AbstractTextArea {
28     // use a String instead of a character because if this character
29
// ends a syllable the hyphenation character must be added
30
private String JavaDoc character;
31
32     /**
33      * Create a new character inline area with the given character.
34      *
35      * @param ch the character for this inline area
36      */

37     public Character(char ch) {
38         character = new String JavaDoc() + ch;
39     }
40
41     /**
42      * Get the character for this inline character area.
43      *
44      * @return the character
45      */

46     public String JavaDoc getChar() {
47         return character;
48     }
49
50     /**
51      * Add the hyphenation character and its length.
52      *
53      * @param hyphChar the hyphenation character
54      * @param hyphSize the size of the hyphenation character
55      */

56     public void addHyphen(char hyphChar, int hyphSize) {
57         character += hyphChar;
58         this.setIPD(this.getIPD() + hyphSize);
59     }
60
61 }
62
63
Popular Tags