]> _ Git - cubeextranet.git/blob
07b81a0dccf55659072a3d6508eb612974f72ebd
[cubeextranet.git] /
1 /*\r
2  * Licensed to the Apache Software Foundation (ASF) under one or more\r
3  * contributor license agreements.  See the NOTICE file distributed with\r
4  * this work for additional information regarding copyright ownership.\r
5  * The ASF licenses this file to You under the Apache License, Version 2.0\r
6  * (the "License"); you may not use this file except in compliance with\r
7  * the License.  You may obtain a copy of the License at\r
8  *\r
9  *      http://www.apache.org/licenses/LICENSE-2.0\r
10  *\r
11  * Unless required by applicable law or agreed to in writing, software\r
12  * distributed under the License is distributed on an "AS IS" BASIS,\r
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14  * See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  */\r
17 package org.apache.pdfbox.pdmodel.documentinterchange.taggedpdf;\r
18 \r
19 import org.apache.pdfbox.cos.COSArray;\r
20 import org.apache.pdfbox.cos.COSBase;\r
21 import org.apache.pdfbox.cos.COSDictionary;\r
22 import org.apache.pdfbox.pdmodel.common.PDRectangle;\r
23 import org.apache.pdfbox.pdmodel.graphics.color.PDGamma;\r
24 \r
25 /**\r
26  * A Layout attribute object.\r
27  * \r
28  * @author <a href="mailto:Johannes%20Koch%20%3Ckoch@apache.org%3E">Johannes Koch</a>\r
29  * @version $Revision: $\r
30  */\r
31 public class PDLayoutAttributeObject extends PDStandardAttributeObject\r
32 {\r
33 \r
34     /**\r
35      * standard attribute owner: Layout\r
36      */\r
37     public static final String OWNER_LAYOUT = "Layout";\r
38 \r
39     private static final String PLACEMENT                    = "Placement";\r
40     private static final String WRITING_MODE                 = "WritingMode";\r
41     private static final String BACKGROUND_COLOR             = "BackgroundColor";\r
42     private static final String BORDER_COLOR                 = "BorderColor";\r
43     private static final String BORDER_STYLE                 = "BorderStyle";\r
44     private static final String BORDER_THICKNESS             = "BorderThickness";\r
45     private static final String PADDING                      = "Padding";\r
46     private static final String COLOR                        = "Color";\r
47     private static final String SPACE_BEFORE                 = "SpaceBefore";\r
48     private static final String SPACE_AFTER                  = "SpaceAfter";\r
49     private static final String START_INDENT                 = "StartIndent";\r
50     private static final String END_INDENT                   = "EndIndent";\r
51     private static final String TEXT_INDENT                  = "TextIndent";\r
52     private static final String TEXT_ALIGN                   = "TextAlign";\r
53     private static final String BBOX                         = "BBox";\r
54     private static final String WIDTH                        = "Width";\r
55     private static final String HEIGHT                       = "Height";\r
56     private static final String BLOCK_ALIGN                  = "BlockAlign";\r
57     private static final String INLINE_ALIGN                 = "InlineAlign";\r
58     private static final String T_BORDER_STYLE               = "TBorderStyle";\r
59     private static final String T_PADDING                    = "TPadding";\r
60     private static final String BASELINE_SHIFT               = "BaselineShift";\r
61     private static final String LINE_HEIGHT                  = "LineHeight";\r
62     private static final String TEXT_DECORATION_COLOR        = "TextDecorationColor";\r
63     private static final String TEXT_DECORATION_THICKNESS    = "TextDecorationThickness";\r
64     private static final String TEXT_DECORATION_TYPE         = "TextDecorationType";\r
65     private static final String RUBY_ALIGN                   = "RubyAlign";\r
66     private static final String RUBY_POSITION                = "RubyPosition";\r
67     private static final String GLYPH_ORIENTATION_VERTICAL   = "GlyphOrientationVertical";\r
68     private static final String COLUMN_COUNT                 = "ColumnCount";\r
69     private static final String COLUMN_GAP                   = "ColumnGap";\r
70     private static final String COLUMN_WIDTHS                = "ColumnWidths";\r
71 \r
72     /**\r
73      * Placement: Block: Stacked in the block-progression direction within an\r
74      * enclosing reference area or parent BLSE.\r
75      */\r
76     public static final String PLACEMENT_BLOCK                 = "Block";\r
77     /**\r
78      * Placement: Inline: Packed in the inline-progression direction within an\r
79      * enclosing BLSE.\r
80      */\r
81     public static final String PLACEMENT_INLINE                = "Inline";\r
82     /**\r
83      * Placement: Before: Placed so that the before edge of the element’s\r
84      * allocation rectangle coincides with that of the nearest enclosing\r
85      * reference area. The element may float, if necessary, to achieve the\r
86      * specified placement. The element shall be treated as a block occupying\r
87      * the full extent of the enclosing reference area in the inline direction.\r
88      * Other content shall be stacked so as to begin at the after edge of the\r
89      * element’s allocation rectangle.\r
90      */\r
91     public static final String PLACEMENT_BEFORE                = "Before";\r
92     /**\r
93      * Placement: Start: Placed so that the start edge of the element’s\r
94      * allocation rectangle coincides with that of the nearest enclosing\r
95      * reference area. The element may float, if necessary, to achieve the\r
96      * specified placement. Other content that would intrude into the element’s\r
97      * allocation rectangle shall be laid out as a runaround.\r
98      */\r
99     public static final String PLACEMENT_START                 = "Start";\r
100     /**\r
101      * Placement: End: Placed so that the end edge of the element’s allocation\r
102      * rectangle coincides with that of the nearest enclosing reference area.\r
103      * The element may float, if necessary, to achieve the specified placement.\r
104      * Other content that would intrude into the element’s allocation rectangle\r
105      * shall be laid out as a runaround.\r
106      */\r
107     public static final String PLACEMENT_END                   = "End";\r
108     /**\r
109      * WritingMode: LrTb: Inline progression from left to right; block\r
110      * progression from top to bottom. This is the typical writing mode for\r
111      * Western writing systems.\r
112      */\r
113     public static final String WRITING_MODE_LRTB               = "LrTb";\r
114     /**\r
115      * WritingMode: RlTb: Inline progression from right to left; block\r
116      * progression from top to bottom. This is the typical writing mode for\r
117      * Arabic and Hebrew writing systems.\r
118      */\r
119     public static final String WRITING_MODE_RLTB               = "RlTb";\r
120     /**\r
121      * WritingMode: TbRl: Inline progression from top to bottom; block\r
122      * progression from right to left. This is the typical writing mode for\r
123      * Chinese and Japanese writing systems.\r
124      */\r
125     public static final String WRITING_MODE_TBRL               = "TbRl";\r
126     /**\r
127      * BorderStyle: None: No border. Forces the computed value of\r
128      * BorderThickness to be 0.\r
129      */\r
130     public static final String BORDER_STYLE_NONE               = "None";\r
131     /**\r
132      * BorderStyle: Hidden: Same as {@link #BORDER_STYLE_NONE}, except in terms\r
133      * of border conflict resolution for table elements.\r
134      */\r
135     public static final String BORDER_STYLE_HIDDEN             = "Hidden";\r
136     /**\r
137      * BorderStyle: Dotted: The border is a series of dots.\r
138      */\r
139     public static final String BORDER_STYLE_DOTTED             = "Dotted";\r
140     /**\r
141      * BorderStyle: Dashed: The border is a series of short line segments.\r
142      */\r
143     public static final String BORDER_STYLE_DASHED             = "Dashed";\r
144     /**\r
145      * BorderStyle: Solid: The border is a single line segment.\r
146      */\r
147     public static final String BORDER_STYLE_SOLID              = "Solid";\r
148     /**\r
149      * BorderStyle: Double: The border is two solid lines. The sum of the two\r
150      * lines and the space between them equals the value of BorderThickness.\r
151      */\r
152     public static final String BORDER_STYLE_DOUBLE             = "Double";\r
153     /**\r
154      * BorderStyle: Groove: The border looks as though it were carved into the\r
155      * canvas.\r
156      */\r
157     public static final String BORDER_STYLE_GROOVE             = "Groove";\r
158     /**\r
159      * BorderStyle: Ridge: The border looks as though it were coming out of the\r
160      * canvas (the opposite of {@link #BORDER_STYLE_GROOVE}).\r
161      */\r
162     public static final String BORDER_STYLE_RIDGE              = "Ridge";\r
163     /**\r
164      * BorderStyle: Inset: The border makes the entire box look as though it\r
165      * were embedded in the canvas.\r
166      */\r
167     public static final String BORDER_STYLE_INSET              = "Inset";\r
168     /**\r
169      * BorderStyle: Outset: The border makes the entire box look as though it\r
170      * were coming out of the canvas (the opposite of {@link #BORDER_STYLE_INSET}.\r
171      */\r
172     public static final String BORDER_STYLE_OUTSET             = "Outset";\r
173     /**\r
174      * TextAlign: Start: Aligned with the start edge.\r
175      */\r
176     public static final String TEXT_ALIGN_START                = "Start";\r
177     /**\r
178      * TextAlign: Center: Centered between the start and end edges.\r
179      */\r
180     public static final String TEXT_ALIGN_CENTER               = "Center";\r
181     /**\r
182      * TextAlign: End: Aligned with the end edge.\r
183      */\r
184     public static final String TEXT_ALIGN_END                  = "End";\r
185     /**\r
186      * TextAlign: Justify: Aligned with both the start and end edges, with\r
187      * internal spacing within each line expanded, if necessary, to achieve such\r
188      * alignment. The last (or only) line shall be aligned with the start edge\r
189      * only.\r
190      */\r
191     public static final String TEXT_ALIGN_JUSTIFY              = "Justify";\r
192     /**\r
193      * Width: Auto\r
194      */\r
195     public static final String WIDTH_AUTO                      = "Auto";\r
196     /**\r
197      * Height: Auto\r
198      */\r
199     public static final String HEIGHT_AUTO                     = "Auto";\r
200     /**\r
201      * BlockAlign: Before: Before edge of the first child’s allocation rectangle\r
202      * aligned with that of the table cell’s content rectangle.\r
203      */\r
204     public static final String BLOCK_ALIGN_BEFORE              = "Before";\r
205     /**\r
206      * BlockAlign: Middle: Children centered within the table cell. The distance\r
207      * between the before edge of the first child’s allocation rectangle and\r
208      * that of the table cell’s content rectangle shall be the same as the\r
209      * distance between the after edge of the last child’s allocation rectangle\r
210      * and that of the table cell’s content rectangle.\r
211      */\r
212     public static final String BLOCK_ALIGN_MIDDLE              = "Middle";\r
213     /**\r
214      * BlockAlign: After: After edge of the last child’s allocation rectangle\r
215      * aligned with that of the table cell’s content rectangle.\r
216      */\r
217     public static final String BLOCK_ALIGN_AFTER               = "After";\r
218     /**\r
219      * BlockAlign: Justify: Children aligned with both the before and after\r
220      * edges of the table cell’s content rectangle. The first child shall be\r
221      * placed as described for {@link #BLOCK_ALIGN_BEFORE} and the last child as\r
222      * described for {@link #BLOCK_ALIGN_AFTER}, with equal spacing between the\r
223      * children. If there is only one child, it shall be aligned with the before\r
224      * edge only, as for {@link #BLOCK_ALIGN_BEFORE}.\r
225      */\r
226     public static final String BLOCK_ALIGN_JUSTIFY             = "Justify";\r
227     /**\r
228      * InlineAlign: Start: Start edge of each child’s allocation rectangle\r
229      * aligned with that of the table cell’s content rectangle.\r
230      */\r
231     public static final String INLINE_ALIGN_START              = "Start";\r
232     /**\r
233      * InlineAlign: Center: Each child centered within the table cell. The\r
234      * distance between the start edges of the child’s allocation rectangle and\r
235      * the table cell’s content rectangle shall be the same as the distance\r
236      * between their end edges.\r
237      */\r
238     public static final String INLINE_ALIGN_CENTER             = "Center";\r
239     /**\r
240      * InlineAlign: End: End edge of each child’s allocation rectangle aligned\r
241      * with that of the table cell’s content rectangle.\r
242      */\r
243     public static final String INLINE_ALIGN_END                = "End";\r
244     /**\r
245      * LineHeight: NormalAdjust the line height to include any nonzero value\r
246      * specified for BaselineShift.\r
247      */\r
248     public static final String LINE_HEIGHT_NORMAL              = "Normal";\r
249     /**\r
250      * LineHeight: Auto: Adjustment for the value of BaselineShift shall not be\r
251      * made.\r
252      */\r
253     public static final String LINE_HEIGHT_AUTO                = "Auto";\r
254     /**\r
255      * TextDecorationType: None: No text decoration\r
256      */\r
257     public static final String TEXT_DECORATION_TYPE_NONE       = "None";\r
258     /**\r
259      * TextDecorationType: Underline: A line below the text\r
260      */\r
261     public static final String TEXT_DECORATION_TYPE_UNDERLINE  = "Underline";\r
262     /**\r
263      * TextDecorationType: Overline: A line above the text\r
264      */\r
265     public static final String TEXT_DECORATION_TYPE_OVERLINE   = "Overline";\r
266     /**\r
267      * TextDecorationType: LineThrough: A line through the middle of the text\r
268      */\r
269     public static final String TEXT_DECORATION_TYPE_LINE_THROUGH = "LineThrough";\r
270     /**\r
271      * RubyAlign: Start: The content shall be aligned on the start edge in the\r
272      * inline-progression direction.\r
273      */\r
274     public static final String RUBY_ALIGN_START                = "Start";\r
275     /**\r
276      * RubyAlign: Center: The content shall be centered in the\r
277      * inline-progression direction.\r
278      */\r
279     public static final String RUBY_ALIGN_CENTER               = "Center";\r
280     /**\r
281      * RubyAlign: End: The content shall be aligned on the end edge in the\r
282      * inline-progression direction.\r
283      */\r
284     public static final String RUBY_ALIGN_END                  = "End";\r
285     /**\r
286      * RubyAlign: Justify:  The content shall be expanded to fill the available\r
287      * width in the inline-progression direction.\r
288      */\r
289     public static final String RUBY_ALIGN_JUSTIFY              = "Justify";\r
290     /**\r
291      * RubyAlign: Distribute: The content shall be expanded to fill the\r
292      * available width in the inline-progression direction. However, space shall\r
293      * also be inserted at the start edge and end edge of the text. The spacing\r
294      * shall be distributed using a 1:2:1 (start:infix:end) ratio. It shall be\r
295      * changed to a 0:1:1 ratio if the ruby appears at the start of a text line\r
296      * or to a 1:1:0 ratio if the ruby appears at the end of the text line.\r
297      */\r
298     public static final String RUBY_ALIGN_DISTRIBUTE           = "Distribute";\r
299     /**\r
300      * RubyPosition: Before: The RT content shall be aligned along the before\r
301      * edge of the element.\r
302      */\r
303     public static final String RUBY_POSITION_BEFORE            = "Before";\r
304     /**\r
305      * RubyPosition: After: The RT content shall be aligned along the after edge\r
306      * of the element.\r
307      */\r
308     public static final String RUBY_POSITION_AFTER             = "After";\r
309     /**\r
310      * RubyPosition: Warichu: The RT and associated RP elements shall be\r
311      * formatted as a warichu, following the RB element.\r
312      */\r
313     public static final String RUBY_POSITION_WARICHU           = "Warichu";\r
314     /**\r
315      * RubyPosition: Inline: The RT and associated RP elements shall be\r
316      * formatted as a parenthesis comment, following the RB element.\r
317      */\r
318     public static final String RUBY_POSITION_INLINE            = "Inline";\r
319     /**\r
320      * GlyphOrientationVertical: Auto\r
321      */\r
322     public static final String GLYPH_ORIENTATION_VERTICAL_AUTO = "Auto";\r
323     /**\r
324      * GlyphOrientationVertical: -180°\r
325      */\r
326     public static final String GLYPH_ORIENTATION_VERTICAL_MINUS_180_DEGREES = "-180";\r
327     /**\r
328      * GlyphOrientationVertical: -90°\r
329      */\r
330     public static final String GLYPH_ORIENTATION_VERTICAL_MINUS_90_DEGREES = "-90";\r
331     /**\r
332      * GlyphOrientationVertical: 0°\r
333      */\r
334     public static final String GLYPH_ORIENTATION_VERTICAL_ZERO_DEGREES = "0";\r
335     /**\r
336      * GlyphOrientationVertical: 90°\r
337      */\r
338     public static final String GLYPH_ORIENTATION_VERTICAL_90_DEGREES = "90";\r
339     /**\r
340      * GlyphOrientationVertical: 180°\r
341      */\r
342     public static final String GLYPH_ORIENTATION_VERTICAL_180_DEGREES = "180";\r
343     /**\r
344      * GlyphOrientationVertical: 270°\r
345      */\r
346     public static final String GLYPH_ORIENTATION_VERTICAL_270_DEGREES = "270";\r
347     /**\r
348      * GlyphOrientationVertical: 360°\r
349      */\r
350     public static final String GLYPH_ORIENTATION_VERTICAL_360_DEGREES = "360";\r
351 \r
352 \r
353     /**\r
354      * Default constructor.\r
355      */\r
356     public PDLayoutAttributeObject()\r
357     {\r
358         this.setOwner(OWNER_LAYOUT);\r
359     }\r
360 \r
361     /**\r
362      * Creates a new Layout attribute object with a given dictionary.\r
363      * \r
364      * @param dictionary the dictionary\r
365      */\r
366     public PDLayoutAttributeObject(COSDictionary dictionary)\r
367     {\r
368         super(dictionary);\r
369     }\r
370 \r
371 \r
372     /**\r
373      * Gets the positioning of the element with respect to the enclosing\r
374      * reference area and other content (Placement). The default value is\r
375      * {@link #PLACEMENT_INLINE}.\r
376      * \r
377      * @return the placement\r
378      */\r
379     public String getPlacement()\r
380     {\r
381         return this.getName(PLACEMENT, PLACEMENT_INLINE);\r
382     }\r
383 \r
384     /**\r
385      * Sets the positioning of the element with respect to the enclosing\r
386      * reference area and other content (Placement). The value should be one of:\r
387      * <ul>\r
388      *   <li>{@link #PLACEMENT_BLOCK},</li>\r
389      *   <li>{@link #PLACEMENT_INLINE},</li>\r
390      *   <li>{@link #PLACEMENT_BEFORE},</li>\r
391      *   <li>{@link #PLACEMENT_START},</li>\r
392      *   <li>{@link #PLACEMENT_END}.</li>\r
393      * <ul>\r
394      * \r
395      * @param placement the placement\r
396      */\r
397     public void setPlacement(String placement)\r
398     {\r
399         this.setName(PLACEMENT, placement);\r
400     }\r
401 \r
402     /**\r
403      * Gets the writing mode (WritingMode). The default value is\r
404      * {@link #WRITING_MODE_LRTB}.\r
405      * \r
406      * @return the writing mode\r
407      */\r
408     public String getWritingMode()\r
409     {\r
410         return this.getName(WRITING_MODE, WRITING_MODE_LRTB);\r
411     }\r
412 \r
413     /**\r
414      * Sets the writing mode (WritingMode). The value should be one of:\r
415      * <ul>\r
416      *   <li>{@link #WRITING_MODE_LRTB},</li>\r
417      *   <li>{@link #WRITING_MODE_RLTB},</li>\r
418      *   <li>{@link #WRITING_MODE_TBRL}.</li>\r
419      * </ul>\r
420      * \r
421      * @param writingMode the writing mode\r
422      */\r
423     public void setWritingMode(String writingMode)\r
424     {\r
425         this.setName(WRITING_MODE, writingMode);\r
426     }\r
427 \r
428     /**\r
429      * Gets the background colour (BackgroundColor).\r
430      * \r
431      * @return the background colour\r
432      */\r
433     public PDGamma getBackgroundColor()\r
434     {\r
435         return this.getColor(BACKGROUND_COLOR);\r
436     }\r
437 \r
438     /**\r
439      * Sets the background colour (BackgroundColor).\r
440      * \r
441      * @param backgroundColor the background colour\r
442      */\r
443     public void setBackgroundColor(PDGamma backgroundColor)\r
444     {\r
445         this.setColor(BACKGROUND_COLOR, backgroundColor);\r
446     }\r
447 \r
448     /**\r
449      * Gets the border colour (BorderColor).\r
450      * \r
451      * @return a single border colour ({@link PDGamma}) or four border colours\r
452      *  ({@link PDFourColours})\r
453      */\r
454     public Object getBorderColors()\r
455     {\r
456         return this.getColorOrFourColors(BORDER_COLOR);\r
457     }\r
458 \r
459     /**\r
460      * Sets the same border colour for all four sides (BorderColor).\r
461      * \r
462      * @param borderColor the border colour\r
463      */\r
464     public void setAllBorderColors(PDGamma borderColor)\r
465     {\r
466         this.setColor(BORDER_COLOR, borderColor);\r
467     }\r
468 \r
469     /**\r
470      * Sets the border colours for four sides separately (BorderColor).\r
471      * \r
472      * @param borderColors the border colours\r
473      */\r
474     public void setBorderColors(PDFourColours borderColors)\r
475     {\r
476         this.setFourColors(BORDER_COLOR, borderColors);\r
477     }\r
478 \r
479     /**\r
480      * Gets the border style (BorderStyle). The default value is\r
481      * {@link #BORDER_STYLE_NONE}.\r
482      * \r
483      * @return the border styles (a String or an array of four Strings)\r
484      */\r
485     public Object getBorderStyle()\r
486     {\r
487         return this.getNameOrArrayOfName(BORDER_STYLE, BORDER_STYLE_NONE);\r
488     }\r
489 \r
490     /**\r
491      * Sets the same border style for all four sides (BorderStyle). The value\r
492      * should be one of:\r
493      * <ul>\r
494      *   <li>{@link #BORDER_STYLE_NONE},</li>\r
495      *   <li>{@link #BORDER_STYLE_HIDDEN},</li>\r
496      *   <li>{@link #BORDER_STYLE_DOTTED},</li>\r
497      *   <li>{@link #BORDER_STYLE_DASHED},</li>\r
498      *   <li>{@link #BORDER_STYLE_SOLID},</li>\r
499      *   <li>{@link #BORDER_STYLE_DOUBLE},</li>\r
500      *   <li>{@link #BORDER_STYLE_GROOVE},</li>\r
501      *   <li>{@link #BORDER_STYLE_RIDGE},</li>\r
502      *   <li>{@link #BORDER_STYLE_INSET},</li>\r
503      *   <li>{@link #BORDER_STYLE_OUTSET}.</li>\r
504      * </ul>\r
505      * \r
506      * @param borderStyle the border style\r
507      */\r
508     public void setAllBorderStyles(String borderStyle)\r
509     {\r
510         this.setName(BORDER_STYLE, borderStyle);\r
511     }\r
512 \r
513     /**\r
514      * Sets the border styles for four sides separately (BorderStyle). The\r
515      * values should be of:\r
516      * <ul>\r
517      *   <li>{@link #BORDER_STYLE_NONE},</li>\r
518      *   <li>{@link #BORDER_STYLE_HIDDEN},</li>\r
519      *   <li>{@link #BORDER_STYLE_DOTTED},</li>\r
520      *   <li>{@link #BORDER_STYLE_DASHED},</li>\r
521      *   <li>{@link #BORDER_STYLE_SOLID},</li>\r
522      *   <li>{@link #BORDER_STYLE_DOUBLE},</li>\r
523      *   <li>{@link #BORDER_STYLE_GROOVE},</li>\r
524      *   <li>{@link #BORDER_STYLE_RIDGE},</li>\r
525      *   <li>{@link #BORDER_STYLE_INSET},</li>\r
526      *   <li>{@link #BORDER_STYLE_OUTSET}.</li>\r
527      * </ul>\r
528      * \r
529      * @param borderStyles the border styles (an array of four Strings)\r
530      */\r
531     public void setBorderStyles(String[] borderStyles)\r
532     {\r
533         this.setArrayOfName(BORDER_STYLE, borderStyles);\r
534     }\r
535 \r
536     /**\r
537      * Gets the border thickness (BorderThickness).\r
538      * \r
539      * @return the border thickness (a Float or an array of four floats)\r
540      */\r
541     public Object getBorderThickness()\r
542     {\r
543         return this.getNumberOrArrayOfNumber(BORDER_THICKNESS, UNSPECIFIED);\r
544     }\r
545 \r
546     /**\r
547      * Sets the same border thickness for all four sides (BorderThickness).\r
548      * \r
549      * @param borderThickness the border thickness\r
550      */\r
551     public void setAllBorderThicknesses(float borderThickness)\r
552     {\r
553         this.setNumber(BORDER_THICKNESS, borderThickness);\r
554     }\r
555 \r
556     /**\r
557      * Sets the same border thickness for all four sides (BorderThickness).\r
558      * \r
559      * @param borderThickness the border thickness\r
560      */\r
561     public void setAllBorderThicknesses(int borderThickness)\r
562     {\r
563         this.setNumber(BORDER_THICKNESS, borderThickness);\r
564     }\r
565 \r
566     /**\r
567      * Sets the border thicknesses for four sides separately (BorderThickness).\r
568      * \r
569      * @param borderThicknesses the border thickness (an array of four floats)\r
570      */\r
571     public void setBorderThicknesses(float[] borderThicknesses)\r
572     {\r
573         this.setArrayOfNumber(BORDER_THICKNESS, borderThicknesses);\r
574     }\r
575 \r
576     /**\r
577      * Gets the padding (Padding). The default value is 0.\r
578      * \r
579      * @return the padding (a Float or an array of float)\r
580      */\r
581     public Object getPadding()\r
582     {\r
583         return this.getNumberOrArrayOfNumber(PADDING, 0.f);\r
584     }\r
585 \r
586     /**\r
587      * Sets the same padding for all four sides (Padding).\r
588      * \r
589      * @param padding the padding\r
590      */\r
591     public void setAllPaddings(float padding)\r
592     {\r
593         this.setNumber(PADDING, padding);\r
594     }\r
595 \r
596     /**\r
597      * Sets the same padding for all four sides (Padding).\r
598      * \r
599      * @param padding the padding\r
600      */\r
601     public void setAllPaddings(int padding)\r
602     {\r
603         this.setNumber(PADDING, padding);\r
604     }\r
605 \r
606     /**\r
607      * Sets the paddings for four sides separately (Padding).\r
608      * \r
609      * @param paddings the paddings (an array of four floats)\r
610      */\r
611     public void setPaddings(float[] paddings)\r
612     {\r
613         this.setArrayOfNumber(PADDING, paddings);\r
614     }\r
615 \r
616     /**\r
617      * Gets the color to be used for drawing text and the default value for the\r
618      * colour of table borders and text decorations (Color).\r
619      * \r
620      * @return the colour\r
621      */\r
622     public PDGamma getColor()\r
623     {\r
624         return this.getColor(COLOR);\r
625     }\r
626 \r
627     /**\r
628      * Sets the color to be used for drawing text and the default value for the\r
629      * colour of table borders and text decorations (Color).\r
630      * \r
631      * @param color the colour\r
632      */\r
633     public void setColor(PDGamma color)\r
634     {\r
635         this.setColor(COLOR, color);\r
636     }\r
637 \r
638     /**\r
639      * Gets the amount of extra space preceding the before edge of the BLSE in\r
640      * the block-progression direction (SpaceBefore). The default value is 0.\r
641      * \r
642      * @return the space before\r
643      */\r
644     public float getSpaceBefore()\r
645     {\r
646         return this.getNumber(SPACE_BEFORE, 0.f);\r
647     }\r
648 \r
649     /**\r
650      * Sets the amount of extra space preceding the before edge of the BLSE in\r
651      * the block-progression direction (SpaceBefore).\r
652      * \r
653      * @param spaceBefore the space before\r
654      */\r
655     public void setSpaceBefore(float spaceBefore)\r
656     {\r
657         this.setNumber(SPACE_BEFORE, spaceBefore);\r
658     }\r
659 \r
660     /**\r
661      * Sets the amount of extra space preceding the before edge of the BLSE in\r
662      * the block-progression direction (SpaceBefore).\r
663      * \r
664      * @param spaceBefore the space before\r
665      */\r
666     public void setSpaceBefore(int spaceBefore)\r
667     {\r
668         this.setNumber(SPACE_BEFORE, spaceBefore);\r
669     }\r
670 \r
671     /**\r
672      * Gets the amount of extra space following the after edge of the BLSE in\r
673      * the block-progression direction (SpaceAfter). The default value is 0.\r
674      * \r
675      * @return the space after\r
676      */\r
677     public float getSpaceAfter()\r
678     {\r
679         return this.getNumber(SPACE_AFTER, 0.f);\r
680     }\r
681 \r
682     /**\r
683      * Sets the amount of extra space following the after edge of the BLSE in\r
684      * the block-progression direction (SpaceAfter).\r
685      * \r
686      * @param spaceAfter the space after\r
687      */\r
688     public void setSpaceAfter(float spaceAfter)\r
689     {\r
690         this.setNumber(SPACE_AFTER, spaceAfter);\r
691     }\r
692 \r
693     /**\r
694      * Sets the amount of extra space following the after edge of the BLSE in\r
695      * the block-progression direction (SpaceAfter).\r
696      * \r
697      * @param spaceAfter the space after\r
698      */\r
699     public void setSpaceAfter(int spaceAfter)\r
700     {\r
701         this.setNumber(SPACE_AFTER, spaceAfter);\r
702     }\r
703 \r
704     /**\r
705      * Gets the distance from the start edge of the reference area to that of\r
706      * the BLSE in the inline-progression direction (StartIndent). The default value is 0.\r
707      * \r
708      * @return the start indent\r
709      */\r
710     public float getStartIndent()\r
711     {\r
712         return this.getNumber(START_INDENT, 0.f);\r
713     }\r
714 \r
715     /**\r
716      * Sets the distance from the start edge of the reference area to that of\r
717      * the BLSE in the inline-progression direction (StartIndent).\r
718      * \r
719      * @param startIndent the start indent\r
720      */\r
721     public void setStartIndent(float startIndent)\r
722     {\r
723         this.setNumber(START_INDENT, startIndent);\r
724     }\r
725 \r
726     /**\r
727      * Sets the distance from the start edge of the reference area to that of\r
728      * the BLSE in the inline-progression direction (StartIndent).\r
729      * \r
730      * @param startIndent the start indent\r
731      */\r
732     public void setStartIndent(int startIndent)\r
733     {\r
734         this.setNumber(START_INDENT, startIndent);\r
735     }\r
736 \r
737     /**\r
738      * Gets the distance from the end edge of the BLSE to that of the reference\r
739      * area in the inline-progression direction (EndIndent). The default value\r
740      * is 0.\r
741      * \r
742      * @return the end indent\r
743      */\r
744     public float getEndIndent()\r
745     {\r
746         return this.getNumber(END_INDENT, 0.f);\r
747     }\r
748 \r
749     /**\r
750      * Sets the distance from the end edge of the BLSE to that of the reference\r
751      * area in the inline-progression direction (EndIndent).\r
752      * \r
753      * @param endIndent the end indent\r
754      */\r
755     public void setEndIndent(float endIndent)\r
756     {\r
757         this.setNumber(END_INDENT, endIndent);\r
758     }\r
759 \r
760     /**\r
761      * Sets the distance from the end edge of the BLSE to that of the reference\r
762      * area in the inline-progression direction (EndIndent).\r
763      * \r
764      * @param endIndent the end indent\r
765      */\r
766     public void setEndIndent(int endIndent)\r
767     {\r
768         this.setNumber(END_INDENT, endIndent);\r
769     }\r
770 \r
771     /**\r
772      * Gets the additional distance in the inline-progression direction from the\r
773      * start edge of the BLSE, as specified by StartIndent, to that of the first\r
774      * line of text (TextIndent). The default value is 0.\r
775      * \r
776      * @return the text indent\r
777      */\r
778     public float getTextIndent()\r
779     {\r
780         return this.getNumber(TEXT_INDENT, 0.f);\r
781     }\r
782 \r
783     /**\r
784      * Sets the additional distance in the inline-progression direction from the\r
785      * start edge of the BLSE, as specified by StartIndent, to that of the first\r
786      * line of text (TextIndent).\r
787      * \r
788      * @param textIndent the text indent\r
789      */\r
790     public void setTextIndent(float textIndent)\r
791     {\r
792         this.setNumber(TEXT_INDENT, textIndent);\r
793     }\r
794 \r
795     /**\r
796      * Sets the additional distance in the inline-progression direction from the\r
797      * start edge of the BLSE, as specified by StartIndent, to that of the first\r
798      * line of text (TextIndent).\r
799      * \r
800      * @param textIndent the text indent\r
801      */\r
802     public void setTextIndent(int textIndent)\r
803     {\r
804         this.setNumber(TEXT_INDENT, textIndent);\r
805     }\r
806 \r
807     /**\r
808      * Gets the alignment, in the inline-progression direction, of text and\r
809      * other content within lines of the BLSE (TextAlign). The default value is\r
810      * {@link #TEXT_ALIGN_START}.\r
811      * \r
812      * @return the text alignment\r
813      */\r
814     public String getTextAlign()\r
815     {\r
816         return this.getName(TEXT_ALIGN, TEXT_ALIGN_START);\r
817     }\r
818 \r
819     /**\r
820      * Sets the alignment, in the inline-progression direction, of text and\r
821      * other content within lines of the BLSE (TextAlign). The value should be\r
822      * one of:\r
823      * <ul>\r
824      *   <li>{@link #TEXT_ALIGN_START},</li>\r
825      *   <li>{@link #TEXT_ALIGN_CENTER},</li>\r
826      *   <li>{@link #TEXT_ALIGN_END},</li>\r
827      *   <li>{@link #TEXT_ALIGN_JUSTIFY}.</li>\r
828      * </ul>\r
829      * \r
830      * @param textIndent the text alignment\r
831      */\r
832     public void setTextAlign(String textIndent)\r
833     {\r
834         this.setName(TEXT_ALIGN, textIndent);\r
835     }\r
836 \r
837     /**\r
838      * Gets the bounding box.\r
839      * \r
840      * @return the bounding box.\r
841      */\r
842     public PDRectangle getBBox()\r
843     {\r
844         COSArray array =\r
845             (COSArray) this.getCOSDictionary().getDictionaryObject(BBOX);\r
846         if (array != null)\r
847         {\r
848             return new PDRectangle(array);\r
849         }\r
850         return null;\r
851     }\r
852 \r
853     /**\r
854      * Sets the bounding box.\r
855      * \r
856      * @param bbox the bounding box\r
857      */\r
858     public void setBBox(PDRectangle bbox)\r
859     {\r
860         String name = BBOX;\r
861         COSBase oldValue = this.getCOSDictionary().getDictionaryObject(name);\r
862         this.getCOSDictionary().setItem(name, bbox);\r
863         COSBase newValue = bbox == null ? null : bbox.getCOSObject();\r
864         this.potentiallyNotifyChanged(oldValue, newValue);\r
865     }\r
866 \r
867     /**\r
868      * Gets the width of the element’s content rectangle in the\r
869      * inline-progression direction (Width). The default value is\r
870      * {@link #WIDTH_AUTO}.\r
871      * \r
872      * @return the width (a Float or a String)\r
873      */\r
874     public Object getWidth()\r
875     {\r
876         return this.getNumberOrName(WIDTH, WIDTH_AUTO);\r
877     }\r
878 \r
879     /**\r
880      * Sets the width of the element’s content rectangle in the\r
881      * inline-progression direction (Width) to {@link #WIDTH_AUTO}.\r
882      */\r
883     public void setWidthAuto()\r
884     {\r
885         this.setName(WIDTH, WIDTH_AUTO);\r
886     }\r
887 \r
888     /**\r
889      * Sets the width of the element’s content rectangle in the\r
890      * inline-progression direction (Width).\r
891      * \r
892      * @param width the width\r
893      */\r
894     public void setWidth(float width)\r
895     {\r
896         this.setNumber(WIDTH, width);\r
897     }\r
898 \r
899     /**\r
900      * Sets the width of the element’s content rectangle in the\r
901      * inline-progression direction (Width).\r
902      * \r
903      * @param width the width\r
904      */\r
905     public void setWidth(int width)\r
906     {\r
907         this.setNumber(WIDTH, width);\r
908     }\r
909 \r
910     /**\r
911      * Gets the height of the element’s content rectangle in the\r
912      * block-progression direction (Height). The default value is\r
913      * {@link #HEIGHT_AUTO}.\r
914      * \r
915      * @return the height (a Float or a String)\r
916      */\r
917     public Object getHeight()\r
918     {\r
919         return this.getNumberOrName(HEIGHT, HEIGHT_AUTO);\r
920     }\r
921 \r
922     /**\r
923      * Sets the height of the element’s content rectangle in the\r
924      * block-progression direction (Height) to {@link #HEIGHT_AUTO}.\r
925      */\r
926     public void setHeightAuto()\r
927     {\r
928         this.setName(HEIGHT, HEIGHT_AUTO);\r
929     }\r
930 \r
931     /**\r
932      * Sets the height of the element’s content rectangle in the\r
933      * block-progression direction (Height).\r
934      * \r
935      * @param height the height\r
936      */\r
937     public void setHeight(float height)\r
938     {\r
939         this.setNumber(HEIGHT, height);\r
940     }\r
941 \r
942     /**\r
943      * Sets the height of the element’s content rectangle in the\r
944      * block-progression direction (Height).\r
945      * \r
946      * @param height the height\r
947      */\r
948     public void setHeight(int height)\r
949     {\r
950         this.setNumber(HEIGHT, height);\r
951     }\r
952 \r
953     /**\r
954      * Gets the alignment, in the block-progression direction, of content within\r
955      * the table cell (BlockAlign). The default value is\r
956      * {@link #BLOCK_ALIGN_BEFORE}.\r
957      * \r
958      * @return the block alignment\r
959      */\r
960     public String getBlockAlign()\r
961     {\r
962         return this.getName(BLOCK_ALIGN, BLOCK_ALIGN_BEFORE);\r
963     }\r
964 \r
965     /**\r
966      * Sets the alignment, in the block-progression direction, of content within\r
967      * the table cell (BlockAlign). The value should be one of:\r
968      * <ul>\r
969      *   <li>{@link #BLOCK_ALIGN_BEFORE},</li>\r
970      *   <li>{@link #BLOCK_ALIGN_MIDDLE},</li>\r
971      *   <li>{@link #BLOCK_ALIGN_AFTER},</li>\r
972      *   <li>{@link #BLOCK_ALIGN_JUSTIFY}.</li>\r
973      * </ul>\r
974      * \r
975      * @param blockAlign the block alignment\r
976      */\r
977     public void setBlockAlign(String blockAlign)\r
978     {\r
979         this.setName(BLOCK_ALIGN, blockAlign);\r
980     }\r
981 \r
982     /**\r
983      * Gets the alignment, in the inline-progression direction, of content\r
984      * within the table cell (InlineAlign). The default value is\r
985      * {@link #INLINE_ALIGN_START}.\r
986      * \r
987      * @return the inline alignment\r
988      */\r
989     public String getInlineAlign()\r
990     {\r
991         return this.getName(INLINE_ALIGN, INLINE_ALIGN_START);\r
992     }\r
993 \r
994     /**\r
995      * Sets the alignment, in the inline-progression direction, of content\r
996      * within the table cell (InlineAlign). The value should be one of\r
997      * <ul>\r
998      *   <li>{@link #INLINE_ALIGN_START},</li>\r
999      *   <li>{@link #INLINE_ALIGN_CENTER},</li>\r
1000      *   <li>{@link #INLINE_ALIGN_END}.</li>\r
1001      * </ul>\r
1002      * \r
1003      * @param inlineAlign the inline alignment\r
1004      */\r
1005     public void setInlineAlign(String inlineAlign)\r
1006     {\r
1007         this.setName(INLINE_ALIGN, inlineAlign);\r
1008     }\r
1009 \r
1010     /**\r
1011      * Gets the style of the border drawn on each edge of a table cell\r
1012      * (TBorderStyle).\r
1013      * \r
1014      * @return\r
1015      */\r
1016     public Object getTBorderStyle()\r
1017     {\r
1018         return this.getNameOrArrayOfName(T_BORDER_STYLE, BORDER_STYLE_NONE);\r
1019     }\r
1020 \r
1021     /**\r
1022      * Sets the same table border style for all four sides (TBorderStyle). The\r
1023      * value should be one of:\r
1024      * <ul>\r
1025      *   <li>{@link #BORDER_STYLE_NONE},</li>\r
1026      *   <li>{@link #BORDER_STYLE_HIDDEN},</li>\r
1027      *   <li>{@link #BORDER_STYLE_DOTTED},</li>\r
1028      *   <li>{@link #BORDER_STYLE_DASHED},</li>\r
1029      *   <li>{@link #BORDER_STYLE_SOLID},</li>\r
1030      *   <li>{@link #BORDER_STYLE_DOUBLE},</li>\r
1031      *   <li>{@link #BORDER_STYLE_GROOVE},</li>\r
1032      *   <li>{@link #BORDER_STYLE_RIDGE},</li>\r
1033      *   <li>{@link #BORDER_STYLE_INSET},</li>\r
1034      *   <li>{@link #BORDER_STYLE_OUTSET}.</li>\r
1035      * </ul>\r
1036      * \r
1037      * @param tBorderStyle the table border style\r
1038      */\r
1039     public void setAllTBorderStyles(String tBorderStyle)\r
1040     {\r
1041         this.setName(T_BORDER_STYLE, tBorderStyle);\r
1042     }\r
1043 \r
1044     /**\r
1045      * Sets the style of the border drawn on each edge of a table cell\r
1046      * (TBorderStyle). The values should be of:\r
1047      * <ul>\r
1048      *   <li>{@link #BORDER_STYLE_NONE},</li>\r
1049      *   <li>{@link #BORDER_STYLE_HIDDEN},</li>\r
1050      *   <li>{@link #BORDER_STYLE_DOTTED},</li>\r
1051      *   <li>{@link #BORDER_STYLE_DASHED},</li>\r
1052      *   <li>{@link #BORDER_STYLE_SOLID},</li>\r
1053      *   <li>{@link #BORDER_STYLE_DOUBLE},</li>\r
1054      *   <li>{@link #BORDER_STYLE_GROOVE},</li>\r
1055      *   <li>{@link #BORDER_STYLE_RIDGE},</li>\r
1056      *   <li>{@link #BORDER_STYLE_INSET},</li>\r
1057      *   <li>{@link #BORDER_STYLE_OUTSET}.</li>\r
1058      * </ul>\r
1059      * \r
1060      * @param tBorderStyles\r
1061      */\r
1062     public void setTBorderStyles(String[] tBorderStyles)\r
1063     {\r
1064         this.setArrayOfName(T_BORDER_STYLE, tBorderStyles);\r
1065     }\r
1066 \r
1067     /**\r
1068      * Gets the offset to account for the separation between the table cell’s\r
1069      * content rectangle and the surrounding border (TPadding). The default\r
1070      * value is 0.\r
1071      * \r
1072      * @return the table padding (a Float or an array of float)\r
1073      */\r
1074     public Object getTPadding()\r
1075     {\r
1076         return this.getNumberOrArrayOfNumber(T_PADDING, 0.f);\r
1077     }\r
1078 \r
1079     /**\r
1080      * Sets the same table padding for all four sides (TPadding).\r
1081      * \r
1082      * @param tPadding the table padding\r
1083      */\r
1084     public void setAllTPaddings(float tPadding)\r
1085     {\r
1086         this.setNumber(T_PADDING, tPadding);\r
1087     }\r
1088 \r
1089     /**\r
1090      * Sets the same table padding for all four sides (TPadding).\r
1091      * \r
1092      * @param tPadding the table padding\r
1093      */\r
1094     public void setAllTPaddings(int tPadding)\r
1095     {\r
1096         this.setNumber(T_PADDING, tPadding);\r
1097     }\r
1098 \r
1099     /**\r
1100      * Sets the table paddings for four sides separately (TPadding).\r
1101      * \r
1102      * @param tPaddings the table paddings (an array of four floats)\r
1103      */\r
1104     public void setTPaddings(float[] tPaddings)\r
1105     {\r
1106         this.setArrayOfNumber(T_PADDING, tPaddings);\r
1107     }\r
1108 \r
1109     /**\r
1110      * Gets the distance by which the element’s baseline shall be shifted\r
1111      * relative to that of its parent element (BaselineShift). The default value\r
1112      * is 0.\r
1113      * \r
1114      * @return the baseline shift\r
1115      */\r
1116     public float getBaselineShift()\r
1117     {\r
1118         return this.getNumber(BASELINE_SHIFT, 0.f);\r
1119     }\r
1120 \r
1121     /**\r
1122      * Sets the distance by which the element’s baseline shall be shifted\r
1123      * relative to that of its parent element (BaselineShift).\r
1124      * \r
1125      * @param baselineShift the baseline shift\r
1126      */\r
1127     public void setBaselineShift(float baselineShift)\r
1128     {\r
1129         this.setNumber(BASELINE_SHIFT, baselineShift);\r
1130     }\r
1131 \r
1132     /**\r
1133      * Sets the distance by which the element’s baseline shall be shifted\r
1134      * relative to that of its parent element (BaselineShift).\r
1135      * \r
1136      * @param baselineShift the baseline shift\r
1137      */\r
1138     public void setBaselineShift(int baselineShift)\r
1139     {\r
1140         this.setNumber(BASELINE_SHIFT, baselineShift);\r
1141     }\r
1142 \r
1143     /**\r
1144      * Gets the element’s preferred height in the block-progression direction\r
1145      * (LineHeight). The default value is {@link #LINE_HEIGHT_NORMAL}.\r
1146      * \r
1147      * @return the line height (a Float or a String)\r
1148      */\r
1149     public Object getLineHeight()\r
1150     {\r
1151         return this.getNumberOrName(LINE_HEIGHT, LINE_HEIGHT_NORMAL);\r
1152     }\r
1153 \r
1154     /**\r
1155      * Sets the element’s preferred height in the block-progression direction\r
1156      * (LineHeight) to {@link #LINE_HEIGHT_NORMAL}.\r
1157      */\r
1158     public void setLineHeightNormal()\r
1159     {\r
1160         this.setName(LINE_HEIGHT, LINE_HEIGHT_NORMAL);\r
1161     }\r
1162 \r
1163     /**\r
1164      * Sets the element’s preferred height in the block-progression direction\r
1165      * (LineHeight) to {@link #LINE_HEIGHT_AUTO}.\r
1166      */\r
1167     public void setLineHeightAuto()\r
1168     {\r
1169         this.setName(LINE_HEIGHT, LINE_HEIGHT_AUTO);\r
1170     }\r
1171 \r
1172     /**\r
1173      * Sets the element’s preferred height in the block-progression direction\r
1174      * (LineHeight).\r
1175      * \r
1176      * @param lineHeight the line height\r
1177      */\r
1178     public void setLineHeight(float lineHeight)\r
1179     {\r
1180         this.setNumber(LINE_HEIGHT, lineHeight);\r
1181     }\r
1182 \r
1183     /**\r
1184      * Sets the element’s preferred height in the block-progression direction\r
1185      * (LineHeight).\r
1186      * \r
1187      * @param lineHeight the line height\r
1188      */\r
1189     public void setLineHeight(int lineHeight)\r
1190     {\r
1191         this.setNumber(LINE_HEIGHT, lineHeight);\r
1192     }\r
1193 \r
1194     /**\r
1195      * Gets the colour to be used for drawing text decorations\r
1196      * (TextDecorationColor).\r
1197      * \r
1198      * @return the text decoration colour\r
1199      */\r
1200     public PDGamma getTextDecorationColor()\r
1201     {\r
1202         return this.getColor(TEXT_DECORATION_COLOR);\r
1203     }\r
1204 \r
1205     /**\r
1206      * Sets the colour to be used for drawing text decorations\r
1207      * (TextDecorationColor).\r
1208      * \r
1209      * @param textDecorationColor the text decoration colour\r
1210      */\r
1211     public void setTextDecorationColor(PDGamma textDecorationColor)\r
1212     {\r
1213         this.setColor(TEXT_DECORATION_COLOR, textDecorationColor);\r
1214     }\r
1215 \r
1216     /**\r
1217      * Gets the thickness of each line drawn as part of the text decoration\r
1218      * (TextDecorationThickness).\r
1219      * \r
1220      * @return the text decoration thickness\r
1221      */\r
1222     public float getTextDecorationThickness()\r
1223     {\r
1224         return this.getNumber(TEXT_DECORATION_THICKNESS);\r
1225     }\r
1226 \r
1227     /**\r
1228      * Sets the thickness of each line drawn as part of the text decoration\r
1229      * (TextDecorationThickness).\r
1230      * \r
1231      * @param textDecorationThickness the text decoration thickness\r
1232      */\r
1233     public void setTextDecorationThickness(float textDecorationThickness)\r
1234     {\r
1235         this.setNumber(TEXT_DECORATION_THICKNESS, textDecorationThickness);\r
1236     }\r
1237 \r
1238     /**\r
1239      * Sets the thickness of each line drawn as part of the text decoration\r
1240      * (TextDecorationThickness).\r
1241      * \r
1242      * @param textDecorationThickness the text decoration thickness\r
1243      */\r
1244     public void setTextDecorationThickness(int textDecorationThickness)\r
1245     {\r
1246         this.setNumber(TEXT_DECORATION_THICKNESS, textDecorationThickness);\r
1247     }\r
1248 \r
1249     /**\r
1250      * Gets the type of text decoration (TextDecorationType). The default value\r
1251      * is {@link #TEXT_DECORATION_TYPE_NONE}.\r
1252      * \r
1253      * @return the type of text decoration\r
1254      */\r
1255     public String getTextDecorationType()\r
1256     {\r
1257         return this.getName(TEXT_DECORATION_TYPE, TEXT_DECORATION_TYPE_NONE);\r
1258     }\r
1259 \r
1260     /**\r
1261      * Sets the type of text decoration (TextDecorationType). The value should\r
1262      * be one of:\r
1263      * <ul>\r
1264      *   <li>{@link #TEXT_DECORATION_TYPE_NONE},</li>\r
1265      *   <li>{@link #TEXT_DECORATION_TYPE_UNDERLINE},</li>\r
1266      *   <li>{@link #TEXT_DECORATION_TYPE_OVERLINE},</li>\r
1267      *   <li>{@link #TEXT_DECORATION_TYPE_LINE_THROUGH}.</li>\r
1268      * </ul>\r
1269      * \r
1270      * @param textDecorationType the type of text decoration\r
1271      */\r
1272     public void setTextDecorationType(String textDecorationType)\r
1273     {\r
1274         this.setName(TEXT_DECORATION_TYPE, textDecorationType);\r
1275     }\r
1276 \r
1277     /**\r
1278      * Gets the justification of the lines within a ruby assembly (RubyAlign).\r
1279      * The default value is {@link #RUBY_ALIGN_DISTRIBUTE}.\r
1280      * \r
1281      * @return the ruby alignment\r
1282      */\r
1283     public String getRubyAlign()\r
1284     {\r
1285         return this.getName(RUBY_ALIGN, RUBY_ALIGN_DISTRIBUTE);\r
1286     }\r
1287 \r
1288     /**\r
1289      * Sets the justification of the lines within a ruby assembly (RubyAlign).\r
1290      * The value should be one of:\r
1291      * <ul>\r
1292      *   <li>{@link #RUBY_ALIGN_START},</li>\r
1293      *   <li>{@link #RUBY_ALIGN_CENTER},</li>\r
1294      *   <li>{@link #RUBY_ALIGN_END},</li>\r
1295      *   <li>{@link #RUBY_ALIGN_JUSTIFY},</li>\r
1296      *   <li>{@link #RUBY_ALIGN_DISTRIBUTE},</li>\r
1297      * </ul>\r
1298      * \r
1299      * @param rubyAlign the ruby alignment\r
1300      */\r
1301     public void setRubyAlign(String rubyAlign)\r
1302     {\r
1303         this.setName(RUBY_ALIGN, rubyAlign);\r
1304     }\r
1305 \r
1306     /**\r
1307      * Gets the placement of the RT structure element relative to the RB element\r
1308      * in a ruby assembly (RubyPosition). The default value is\r
1309      * {@link #RUBY_POSITION_BEFORE}.\r
1310      * \r
1311      * @return the ruby position\r
1312      */\r
1313     public String getRubyPosition()\r
1314     {\r
1315         return this.getName(RUBY_POSITION, RUBY_POSITION_BEFORE);\r
1316     }\r
1317 \r
1318     /**\r
1319      * Sets the placement of the RT structure element relative to the RB element\r
1320      * in a ruby assembly (RubyPosition). The value should be one of:\r
1321      * <ul>\r
1322      *   <li>{@link #RUBY_POSITION_BEFORE},</li>\r
1323      *   <li>{@link #RUBY_POSITION_AFTER},</li>\r
1324      *   <li>{@link #RUBY_POSITION_WARICHU},</li>\r
1325      *   <li>{@link #RUBY_POSITION_INLINE}.</li>\r
1326      * </ul>\r
1327      * \r
1328      * @param rubyPosition the ruby position\r
1329      */\r
1330     public void setRubyPosition(String rubyPosition)\r
1331     {\r
1332         this.setName(RUBY_POSITION, rubyPosition);\r
1333     }\r
1334 \r
1335     /**\r
1336      * Gets the orientation of glyphs when the inline-progression direction is\r
1337      * top to bottom or bottom to top (GlyphOrientationVertical). The default\r
1338      * value is {@link #GLYPH_ORIENTATION_VERTICAL_AUTO}.\r
1339      * \r
1340      * @return the vertical glyph orientation\r
1341      */\r
1342     public String getGlyphOrientationVertical()\r
1343     {\r
1344         return this.getName(GLYPH_ORIENTATION_VERTICAL,\r
1345             GLYPH_ORIENTATION_VERTICAL_AUTO);\r
1346     }\r
1347 \r
1348     /**\r
1349      * Sets the orientation of glyphs when the inline-progression direction is\r
1350      * top to bottom or bottom to top (GlyphOrientationVertical). The value\r
1351      * should be one of:\r
1352      * <ul>\r
1353      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_AUTO},</li>\r
1354      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_MINUS_180_DEGREES},</li>\r
1355      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_MINUS_90_DEGREES},</li>\r
1356      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_ZERO_DEGREES},</li>\r
1357      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_90_DEGREES},</li>\r
1358      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_180_DEGREES},</li>\r
1359      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_270_DEGREES},</li>\r
1360      *   <li>{@link #GLYPH_ORIENTATION_VERTICAL_360_DEGREES}.</li>\r
1361      * </ul>\r
1362      * \r
1363      * @param glyphOrientationVertical the vertical glyph orientation\r
1364      */\r
1365     public void setGlyphOrientationVertical(String glyphOrientationVertical)\r
1366     {\r
1367         this.setName(GLYPH_ORIENTATION_VERTICAL, glyphOrientationVertical);\r
1368     }\r
1369 \r
1370     /**\r
1371      * Gets the number of columns in the content of the grouping element\r
1372      * (ColumnCount). The default value is 1.\r
1373      * \r
1374      * @return the column count\r
1375      */\r
1376     public int getColumnCount()\r
1377     {\r
1378         return this.getInteger(COLUMN_COUNT, 1);\r
1379     }\r
1380 \r
1381     /**\r
1382      * Sets the number of columns in the content of the grouping element\r
1383      * (ColumnCount).\r
1384      * \r
1385      * @param columnCount the column count\r
1386      */\r
1387     public void setColumnCount(int columnCount)\r
1388     {\r
1389         this.setInteger(COLUMN_COUNT, columnCount);\r
1390     }\r
1391 \r
1392     /**\r
1393      * Gets the desired space between adjacent columns in the inline-progression\r
1394      * direction (ColumnGap).\r
1395      * \r
1396      * @return the column gap (FLoat or array of floats)\r
1397      */\r
1398     public Object getColumnGap()\r
1399     {\r
1400         return this.getNumberOrArrayOfNumber(COLUMN_GAP, UNSPECIFIED);\r
1401     }\r
1402 \r
1403     /**\r
1404      * Sets the desired space between all columns in the inline-progression\r
1405      * direction (ColumnGap).\r
1406      * \r
1407      * @param columnGap the column gap\r
1408      */\r
1409     public void setColumnGap(float columnGap)\r
1410     {\r
1411         this.setNumber(COLUMN_GAP, columnGap);\r
1412     }\r
1413 \r
1414     /**\r
1415      * Sets the desired space between all columns in the inline-progression\r
1416      * direction (ColumnGap).\r
1417      * \r
1418      * @param columnGap the column gap\r
1419      */\r
1420     public void setColumnGap(int columnGap)\r
1421     {\r
1422         this.setNumber(COLUMN_GAP, columnGap);\r
1423     }\r
1424 \r
1425     /**\r
1426      * Sets the desired space between adjacent columns in the inline-progression\r
1427      * direction (ColumnGap), the first element specifying the space between the\r
1428      * first and second columns, the second specifying the space between the\r
1429      * second and third columns, and so on.\r
1430      * \r
1431      * @param columnGaps the column gaps\r
1432      */\r
1433     public void setColumnGaps(float[] columnGaps)\r
1434     {\r
1435         this.setArrayOfNumber(COLUMN_GAP, columnGaps);\r
1436     }\r
1437 \r
1438     /**\r
1439      * Gets the desired width of the columns, measured in default user space\r
1440      * units in the inline-progression direction (ColumnWidths).\r
1441      * \r
1442      * @return the column widths (Float or array of floats)\r
1443      */\r
1444     public Object getColumnWidths()\r
1445     {\r
1446         return this.getNumberOrArrayOfNumber(COLUMN_WIDTHS, UNSPECIFIED);\r
1447     }\r
1448 \r
1449     /**\r
1450      * Sets the same column width for all columns (ColumnWidths).\r
1451      * \r
1452      * @param columnWidth the column width\r
1453      */\r
1454     public void setAllColumnWidths(float columnWidth)\r
1455     {\r
1456         this.setNumber(COLUMN_WIDTHS, columnWidth);\r
1457     }\r
1458 \r
1459     /**\r
1460      * Sets the same column width for all columns (ColumnWidths).\r
1461      * \r
1462      * @param columnWidth the column width\r
1463      */\r
1464     public void setAllColumnWidths(int columnWidth)\r
1465     {\r
1466         this.setNumber(COLUMN_WIDTHS, columnWidth);\r
1467     }\r
1468 \r
1469     /**\r
1470      * Sets the column widths for the columns separately (ColumnWidths).\r
1471      * \r
1472      * @param columnWidths the column widths\r
1473      */\r
1474     public void setColumnWidths(float[] columnWidths)\r
1475     {\r
1476         this.setArrayOfNumber(COLUMN_WIDTHS, columnWidths);\r
1477     }\r
1478 \r
1479     @Override\r
1480     public String toString()\r
1481     {\r
1482         StringBuilder sb = new StringBuilder().append(super.toString());\r
1483         if (this.isSpecified(PLACEMENT))\r
1484         {\r
1485             sb.append(", Placement=").append(this.getPlacement());\r
1486         }\r
1487         if (this.isSpecified(WRITING_MODE))\r
1488         {\r
1489             sb.append(", WritingMode=").append(this.getWritingMode());\r
1490         }\r
1491         if (this.isSpecified(BACKGROUND_COLOR))\r
1492         {\r
1493             sb.append(", BackgroundColor=").append(this.getBackgroundColor());\r
1494         }\r
1495         if (this.isSpecified(BORDER_COLOR))\r
1496         {\r
1497             sb.append(", BorderColor=").append(this.getBorderColors());\r
1498         }\r
1499         if (this.isSpecified(BORDER_STYLE))\r
1500         {\r
1501             Object borderStyle = this.getBorderStyle();\r
1502             sb.append(", BorderStyle=");\r
1503             if (borderStyle instanceof String[])\r
1504             {\r
1505                 sb.append(arrayToString((String[]) borderStyle));\r
1506             }\r
1507             else\r
1508             {\r
1509                 sb.append(borderStyle);\r
1510             }\r
1511         }\r
1512         if (this.isSpecified(BORDER_THICKNESS))\r
1513         {\r
1514             Object borderThickness = this.getBorderThickness();\r
1515             sb.append(", BorderThickness=");\r
1516             if (borderThickness instanceof float[])\r
1517             {\r
1518                 sb.append(arrayToString((float[]) borderThickness));\r
1519             }\r
1520             else\r
1521             {\r
1522                 sb.append(String.valueOf((Float) borderThickness));\r
1523             }\r
1524         }\r
1525         if (this.isSpecified(PADDING))\r
1526         {\r
1527             Object padding = this.getPadding();\r
1528             sb.append(", Padding=");\r
1529             if (padding instanceof float[])\r
1530             {\r
1531                 sb.append(arrayToString((float[]) padding));\r
1532             }\r
1533             else\r
1534             {\r
1535                 sb.append(String.valueOf((Float) padding));\r
1536             }\r
1537         }\r
1538         if (this.isSpecified(COLOR))\r
1539         {\r
1540             sb.append(", Color=").append(this.getColor());\r
1541         }\r
1542         if (this.isSpecified(SPACE_BEFORE))\r
1543         {\r
1544             sb.append(", SpaceBefore=")\r
1545                 .append(String.valueOf(this.getSpaceBefore()));\r
1546         }\r
1547         if (this.isSpecified(SPACE_AFTER))\r
1548         {\r
1549             sb.append(", SpaceAfter=")\r
1550                 .append(String.valueOf(this.getSpaceAfter()));\r
1551         }\r
1552         if (this.isSpecified(START_INDENT))\r
1553         {\r
1554             sb.append(", StartIndent=")\r
1555                 .append(String.valueOf(this.getStartIndent()));\r
1556         }\r
1557         if (this.isSpecified(END_INDENT))\r
1558         {\r
1559             sb.append(", EndIndent=")\r
1560                 .append(String.valueOf(this.getEndIndent()));\r
1561         }\r
1562         if (this.isSpecified(TEXT_INDENT))\r
1563         {\r
1564             sb.append(", TextIndent=")\r
1565                 .append(String.valueOf(this.getTextIndent()));\r
1566         }\r
1567         if (this.isSpecified(TEXT_ALIGN))\r
1568         {\r
1569             sb.append(", TextAlign=").append(this.getTextAlign());\r
1570         }\r
1571         if (this.isSpecified(BBOX))\r
1572         {\r
1573             sb.append(", BBox=").append(this.getBBox());\r
1574         }\r
1575         if (this.isSpecified(WIDTH))\r
1576         {\r
1577             Object width = this.getWidth();\r
1578             sb.append(", Width=");\r
1579             if (width instanceof Float)\r
1580             {\r
1581                 sb.append(String.valueOf((Float) width));\r
1582             }\r
1583             else\r
1584             {\r
1585                 sb.append(width);\r
1586             }\r
1587         }\r
1588         if (this.isSpecified(HEIGHT))\r
1589         {\r
1590             Object height = this.getHeight();\r
1591             sb.append(", Height=");\r
1592             if (height instanceof Float)\r
1593             {\r
1594                 sb.append(String.valueOf((Float) height));\r
1595             }\r
1596             else\r
1597             {\r
1598                 sb.append(height);\r
1599             }\r
1600         }\r
1601         if (this.isSpecified(BLOCK_ALIGN))\r
1602         {\r
1603             sb.append(", BlockAlign=").append(this.getBlockAlign());\r
1604         }\r
1605         if (this.isSpecified(INLINE_ALIGN))\r
1606         {\r
1607             sb.append(", InlineAlign=").append(this.getInlineAlign());\r
1608         }\r
1609         if (this.isSpecified(T_BORDER_STYLE))\r
1610         {\r
1611             Object tBorderStyle = this.getTBorderStyle();\r
1612             sb.append(", TBorderStyle=");\r
1613             if (tBorderStyle instanceof String[])\r
1614             {\r
1615                 sb.append(arrayToString((String[]) tBorderStyle));\r
1616             }\r
1617             else\r
1618             {\r
1619                 sb.append(tBorderStyle);\r
1620             }\r
1621         }\r
1622         if (this.isSpecified(T_PADDING))\r
1623         {\r
1624             Object tPadding = this.getTPadding();\r
1625             sb.append(", TPadding=");\r
1626             if (tPadding instanceof float[])\r
1627             {\r
1628                 sb.append(arrayToString((float[]) tPadding));\r
1629             }\r
1630             else\r
1631             {\r
1632                 sb.append(String.valueOf((Float) tPadding));\r
1633             }\r
1634         }\r
1635         if (this.isSpecified(BASELINE_SHIFT))\r
1636         {\r
1637             sb.append(", BaselineShift=")\r
1638                 .append(String.valueOf(this.getBaselineShift()));\r
1639         }\r
1640         if (this.isSpecified(LINE_HEIGHT))\r
1641         {\r
1642             Object lineHeight = this.getLineHeight();\r
1643             sb.append(", LineHeight=");\r
1644             if (lineHeight instanceof Float)\r
1645             {\r
1646                 sb.append(String.valueOf((Float) lineHeight));\r
1647             }\r
1648             else\r
1649             {\r
1650                 sb.append(lineHeight);\r
1651             }\r
1652         }\r
1653         if (this.isSpecified(TEXT_DECORATION_COLOR))\r
1654         {\r
1655             sb.append(", TextDecorationColor=")\r
1656                 .append(this.getTextDecorationColor());\r
1657         }\r
1658         if (this.isSpecified(TEXT_DECORATION_THICKNESS))\r
1659         {\r
1660             sb.append(", TextDecorationThickness=")\r
1661                 .append(String.valueOf(this.getTextDecorationThickness()));\r
1662         }\r
1663         if (this.isSpecified(TEXT_DECORATION_TYPE))\r
1664         {\r
1665             sb.append(", TextDecorationType=")\r
1666                 .append(this.getTextDecorationType());\r
1667         }\r
1668         if (this.isSpecified(RUBY_ALIGN))\r
1669         {\r
1670             sb.append(", RubyAlign=").append(this.getRubyAlign());\r
1671         }\r
1672         if (this.isSpecified(RUBY_POSITION))\r
1673         {\r
1674             sb.append(", RubyPosition=").append(this.getRubyPosition());\r
1675         }\r
1676         if (this.isSpecified(GLYPH_ORIENTATION_VERTICAL))\r
1677         {\r
1678             sb.append(", GlyphOrientationVertical=")\r
1679                 .append(this.getGlyphOrientationVertical());\r
1680         }\r
1681         if (this.isSpecified(COLUMN_COUNT))\r
1682         {\r
1683             sb.append(", ColumnCount=")\r
1684                 .append(String.valueOf(this.getColumnCount()));\r
1685         }\r
1686         if (this.isSpecified(COLUMN_GAP))\r
1687         {\r
1688             Object columnGap = this.getColumnGap();\r
1689             sb.append(", ColumnGap=");\r
1690             if (columnGap instanceof float[])\r
1691             {\r
1692                 sb.append(arrayToString((float[]) columnGap));\r
1693             }\r
1694             else\r
1695             {\r
1696                 sb.append(String.valueOf((Float) columnGap));\r
1697             }\r
1698         }\r
1699         if (this.isSpecified(COLUMN_WIDTHS))\r
1700         {\r
1701             Object columnWidth = this.getColumnWidths();\r
1702             sb.append(", ColumnWidths=");\r
1703             if (columnWidth instanceof float[])\r
1704             {\r
1705                 sb.append(arrayToString((float[]) columnWidth));\r
1706             }\r
1707             else\r
1708             {\r
1709                 sb.append(String.valueOf((Float) columnWidth));\r
1710             }\r
1711         }\r
1712         return sb.toString();\r
1713     }\r
1714 \r
1715 }\r