KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > FOPropertyMapping


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: FOPropertyMapping.java 488960 2006-12-20 08:34:28Z spepping $ */
19
20 package org.apache.fop.fo;
21
22 import java.util.HashMap JavaDoc;
23 import java.util.Map JavaDoc;
24
25 import org.apache.fop.apps.FOUserAgent;
26 import org.apache.fop.datatypes.LengthBase;
27 import org.apache.fop.fo.expr.PropertyException;
28 import org.apache.fop.fo.properties.BackgroundPositionShorthandParser;
29 import org.apache.fop.fo.properties.BorderSpacingShorthandParser;
30 import org.apache.fop.fo.properties.BorderWidthPropertyMaker;
31 import org.apache.fop.fo.properties.BoxPropShorthandParser;
32 import org.apache.fop.fo.properties.CharacterProperty;
33 import org.apache.fop.fo.properties.ColorProperty;
34 import org.apache.fop.fo.flow.TableFObj.ColumnNumberPropertyMaker;
35 import org.apache.fop.fo.properties.CondLengthProperty;
36 import org.apache.fop.fo.properties.CorrespondingPropertyMaker;
37 import org.apache.fop.fo.properties.DimensionPropertyMaker;
38 import org.apache.fop.fo.properties.EnumProperty;
39 import org.apache.fop.fo.properties.FontFamilyProperty;
40 import org.apache.fop.fo.properties.FontShorthandParser;
41 import org.apache.fop.fo.properties.FontShorthandProperty;
42 import org.apache.fop.fo.properties.FontSizePropertyMaker;
43 import org.apache.fop.fo.properties.FontStretchPropertyMaker;
44 import org.apache.fop.fo.properties.GenericShorthandParser;
45 import org.apache.fop.fo.properties.IndentPropertyMaker;
46 import org.apache.fop.fo.properties.KeepProperty;
47 import org.apache.fop.fo.properties.LengthPairProperty;
48 import org.apache.fop.fo.properties.LengthProperty;
49 import org.apache.fop.fo.properties.LengthRangeProperty;
50 import org.apache.fop.fo.properties.LineHeightPropertyMaker;
51 import org.apache.fop.fo.properties.ListProperty;
52 import org.apache.fop.fo.properties.NumberProperty;
53 import org.apache.fop.fo.properties.PageBreakShorthandParser;
54 import org.apache.fop.fo.properties.PageDimensionMaker;
55 import org.apache.fop.fo.properties.PositionShorthandParser;
56 import org.apache.fop.fo.properties.Property;
57 import org.apache.fop.fo.properties.PropertyMaker;
58 import org.apache.fop.fo.properties.ReferenceOrientationMaker;
59 import org.apache.fop.fo.properties.SpaceProperty;
60 import org.apache.fop.fo.properties.SpacePropertyMaker;
61 import org.apache.fop.fo.properties.SpacingPropertyMaker;
62 import org.apache.fop.fo.properties.StringProperty;
63 import org.apache.fop.fo.properties.TableBorderPrecedence;
64 import org.apache.fop.fo.properties.TextDecorationProperty;
65 import org.apache.fop.fo.properties.ToBeImplementedProperty;
66 import org.apache.fop.fo.properties.VerticalAlignShorthandParser;
67 import org.apache.fop.fo.properties.WhiteSpaceShorthandParser;
68
69 /**
70  * This class creates and returns an array of Property.Maker instances
71  * indexed by the PR_* propId from Constants.java.
72  *
73  * @todo Check multi-threading safety of the statics below
74  */

75 public final class FOPropertyMapping implements Constants {
76     private static Map JavaDoc s_htPropNames = new HashMap JavaDoc();
77     private static Map JavaDoc s_htSubPropNames = new HashMap JavaDoc();
78     private static Map JavaDoc s_htPropIds = new HashMap JavaDoc();
79
80     private static PropertyMaker[] s_generics = null;
81
82     // The rest is only used during the building of the s_generics array.
83
private Property[] enums = null;
84
85     private PropertyMaker genericColor = null;
86     private PropertyMaker genericBoolean = null;
87     private PropertyMaker genericKeep = null;
88     private PropertyMaker genericCondLength = null;
89     private PropertyMaker genericCondPadding = null;
90     private PropertyMaker genericPadding = null;
91     private PropertyMaker genericCondBorderWidth = null;
92     private PropertyMaker genericBorderWidth = null;
93     private PropertyMaker genericBorderStyle = null;
94     private PropertyMaker genericBreak = null;
95     private PropertyMaker genericSpace = null;
96
97     /**
98      * Create the generic property maker templates. These templates
99      * are used be the actual makers as a parameter to .useGeneric(...).
100      */

101     private void createGenerics() {
102         
103         PropertyMaker sub;
104
105         genericColor = new ColorProperty.Maker(0);
106
107         // GenericBoolean
108
genericBoolean = new EnumProperty.Maker(0);
109         genericBoolean.addEnum("true", getEnumProperty(EN_TRUE, "TRUE"));
110         genericBoolean.addEnum("false", getEnumProperty(EN_FALSE, "FALSE"));
111
112         // GenericKeep
113
genericKeep = new KeepProperty.Maker(0);
114         sub = new NumberProperty.Maker(CP_WITHIN_PAGE);
115         sub.setByShorthand(true);
116         sub.setDefault("auto");
117         sub.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
118         sub.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
119         genericKeep.addSubpropMaker(sub);
120         sub = new NumberProperty.Maker(CP_WITHIN_LINE);
121         sub.setByShorthand(true);
122         sub.setDefault("auto");
123         sub.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
124         sub.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
125         genericKeep.addSubpropMaker(sub);
126         sub = new NumberProperty.Maker(CP_WITHIN_COLUMN);
127         sub.setByShorthand(true);
128         sub.setDefault("auto");
129         sub.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
130         sub.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
131         genericKeep.addSubpropMaker(sub);
132
133         // GenericCondLength
134
genericCondLength = new CondLengthProperty.Maker(0);
135         sub = new LengthProperty.Maker(CP_LENGTH);
136         sub.setByShorthand(true);
137         genericCondLength.addSubpropMaker(sub);
138         sub = new EnumProperty.Maker(CP_CONDITIONALITY);
139         sub.addEnum("discard", getEnumProperty(EN_DISCARD, "DISCARD"));
140         sub.addEnum("retain", getEnumProperty(EN_RETAIN, "RETAIN"));
141         genericCondLength.addSubpropMaker(sub);
142
143         // GenericCondPadding
144
genericCondPadding = new CondLengthProperty.Maker(0);
145         genericCondPadding.useGeneric(genericCondLength);
146         genericCondPadding.setInherited(false);
147         genericCondPadding.getSubpropMaker(CP_LENGTH).setDefault("0pt");
148         genericCondPadding.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
149
150         // GenericPadding
151
genericPadding = new LengthProperty.Maker(0);
152         genericPadding.setInherited(false);
153         genericPadding.setDefault("0pt");
154         genericPadding.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
155         genericPadding.addShorthand(s_generics[PR_PADDING]);
156
157         // GenericCondBorderWidth
158
genericCondBorderWidth = new CondLengthProperty.Maker(0);
159         genericCondBorderWidth.setInherited(false);
160         genericCondBorderWidth.addKeyword("thin", "0.5pt");
161         genericCondBorderWidth.addKeyword("medium", "1pt");
162         genericCondBorderWidth.addKeyword("thick", "2pt");
163         sub = new LengthProperty.Maker(CP_LENGTH);
164         sub.setByShorthand(true);
165         sub.addKeyword("thin", "0.5pt");
166         sub.addKeyword("medium", "1pt");
167         sub.addKeyword("thick", "2pt");
168         sub.setDefault("medium");
169         genericCondBorderWidth.addSubpropMaker(sub);
170         sub = new EnumProperty.Maker(CP_CONDITIONALITY);
171         sub.addEnum("discard", getEnumProperty(EN_DISCARD, "DISCARD"));
172         sub.addEnum("retain", getEnumProperty(EN_RETAIN, "RETAIN"));
173         genericCondBorderWidth.addSubpropMaker(sub);
174
175         // GenericBorderWidth
176
genericBorderWidth = new LengthProperty.Maker(0);
177         genericBorderWidth.setInherited(false);
178         genericBorderWidth.addKeyword("thin", "0.5pt");
179         genericBorderWidth.addKeyword("medium", "1pt");
180         genericBorderWidth.addKeyword("thick", "2pt");
181         genericBorderWidth.setDefault("medium");
182
183         // GenericBorderStyle
184
genericBorderStyle = new EnumProperty.Maker(0);
185         genericBorderStyle.setInherited(false);
186         genericBorderStyle.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
187         genericBorderStyle.addEnum("hidden", getEnumProperty(EN_HIDDEN, "HIDDEN"));
188         genericBorderStyle.addEnum("dotted", getEnumProperty(EN_DOTTED, "DOTTED"));
189         genericBorderStyle.addEnum("dashed", getEnumProperty(EN_DASHED, "DASHED"));
190         genericBorderStyle.addEnum("solid", getEnumProperty(EN_SOLID, "SOLID"));
191         genericBorderStyle.addEnum("double", getEnumProperty(EN_DOUBLE, "DOUBLE"));
192         genericBorderStyle.addEnum("groove", getEnumProperty(EN_GROOVE, "GROOVE"));
193         genericBorderStyle.addEnum("ridge", getEnumProperty(EN_RIDGE, "RIDGE"));
194         genericBorderStyle.addEnum("inset", getEnumProperty(EN_INSET, "INSET"));
195         genericBorderStyle.addEnum("outset", getEnumProperty(EN_OUTSET, "OUTSET"));
196         genericBorderStyle.setDefault("none");
197
198         // GenericBreak
199
genericBreak = new EnumProperty.Maker(0);
200         genericBreak.setInherited(false);
201         genericBreak.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
202         genericBreak.addEnum("column", getEnumProperty(EN_COLUMN, "COLUMN"));
203         genericBreak.addEnum("page", getEnumProperty(EN_PAGE, "PAGE"));
204         genericBreak.addEnum("even-page", getEnumProperty(EN_EVEN_PAGE, "EVEN_PAGE"));
205         genericBreak.addEnum("odd-page", getEnumProperty(EN_ODD_PAGE, "ODD_PAGE"));
206         genericBreak.setDefault("auto");
207
208         // GenericSpace
209
genericSpace = new SpaceProperty.Maker(0);
210         genericSpace.setInherited(false);
211         sub = new LengthProperty.Maker(CP_MINIMUM);
212         sub.setDefault("0pt");
213         sub.setByShorthand(true);
214         genericSpace.addSubpropMaker(sub);
215         sub = new LengthProperty.Maker(CP_OPTIMUM);
216         sub.setDefault("0pt");
217         sub.setByShorthand(true);
218         genericSpace.addSubpropMaker(sub);
219         sub = new LengthProperty.Maker(CP_MAXIMUM);
220         sub.setDefault("0pt");
221         sub.setByShorthand(true);
222         genericSpace.addSubpropMaker(sub);
223         sub = new NumberProperty.Maker(CP_PRECEDENCE);
224         sub.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
225         sub.setDefault("0");
226         genericSpace.addSubpropMaker(sub);
227         sub = new EnumProperty.Maker(CP_CONDITIONALITY);
228         sub.addEnum("discard", getEnumProperty(EN_DISCARD, "DISCARD"));
229         sub.addEnum("retain", getEnumProperty(EN_RETAIN, "RETAIN"));
230         sub.setDefault("discard");
231         genericSpace.addSubpropMaker(sub);
232     }
233
234     /**
235      * Add a property maker to the generics array.
236      * Also creates the name <-> id mapping in s_htPropNames and s_htPropIds.
237      *
238      * @param name the name of the property maker.
239      * @param maker the maker.
240      */

241     private static void addPropertyMaker(String JavaDoc name, PropertyMaker maker) {
242         s_generics[maker.getPropId()] = maker;
243         s_htPropNames.put(name, new Integer JavaDoc(maker.getPropId()));
244         s_htPropIds.put(new Integer JavaDoc(maker.getPropId()), name);
245     }
246
247     /**
248      * Create the name<->id mapping for the subproperty names.
249      * @param name name of the subproperty.
250      * @param id Id for the subproperty from CP_* in Constants.java.
251      */

252     private static void addSubpropMakerName(String JavaDoc name, int id) {
253         s_htSubPropNames.put(name, new Integer JavaDoc(id));
254         s_htPropIds.put(new Integer JavaDoc(id), name);
255     }
256
257     /**
258      * Return a (possibly cached) enum property based in the enum value.
259      * @param enum A enum value from Constants.java.
260      * @param text the text value by which this enum property is known
261      * @return An EnumProperty instance.
262      */

263     private Property getEnumProperty(int enumValue, String JavaDoc text) {
264         if (enums == null) {
265             enums = new Property[ENUM_COUNT + 1];
266         }
267         if (enums[enumValue] == null) {
268             enums[enumValue] = EnumProperty.getInstance(enumValue, text);
269         }
270         return enums[enumValue];
271     }
272
273     /**
274      * Return the array of Makers.
275      * @return the maker array.
276      */

277     public static PropertyMaker[] getGenericMappings() {
278         
279         if (s_generics == null) {
280             /* this method was never called before */
281             s_generics = new PropertyMaker[PROPERTY_COUNT + 1];
282             FOPropertyMapping gp = new FOPropertyMapping();
283             
284             /* Create the shorthand first. They are
285              * referenced by the real properties.
286              */

287             gp.createShorthandProperties();
288             gp.createGenerics();
289             gp.createAccessibilityProperties();
290             gp.createAbsolutePositionProperties();
291             gp.createAuralProperties();
292             gp.createBorderPaddingBackgroundProperties();
293             gp.createFontProperties();
294             gp.createHyphenationProperties();
295             gp.createMarginBlockProperties();
296             gp.createMarginInlineProperties();
297             gp.createRelativePosProperties();
298             gp.createAreaAlignmentProperties();
299             gp.createAreaDimensionProperties();
300             gp.createBlockAndLineProperties();
301             gp.createCharacterProperties();
302             gp.createColorProperties();
303             gp.createFloatProperties();
304             gp.createKeepsAndBreaksProperties();
305             gp.createLayoutProperties();
306             gp.createLeaderAndRuleProperties();
307             gp.createDynamicProperties();
308             gp.createMarkersProperties();
309             gp.createNumberToStringProperties();
310             gp.createPaginationAndLayoutProperties();
311             gp.createTableProperties();
312             gp.createWritingModeProperties();
313             gp.createMiscProperties();
314     
315             // Hardcode the subproperties.
316
addSubpropMakerName("length", CP_LENGTH);
317             addSubpropMakerName("conditionality", CP_CONDITIONALITY);
318             addSubpropMakerName("block-progression-direction", CP_BLOCK_PROGRESSION_DIRECTION);
319             addSubpropMakerName("inline-progression-direction", CP_INLINE_PROGRESSION_DIRECTION);
320             addSubpropMakerName("within-line", CP_WITHIN_LINE);
321             addSubpropMakerName("within-column", CP_WITHIN_COLUMN);
322             addSubpropMakerName("within-page", CP_WITHIN_PAGE);
323             addSubpropMakerName("minimum", CP_MINIMUM);
324             addSubpropMakerName("maximum", CP_MAXIMUM);
325             addSubpropMakerName("optimum", CP_OPTIMUM);
326             addSubpropMakerName("precedence", CP_PRECEDENCE);
327         }
328
329         return s_generics;
330     }
331
332     /**
333      * Return the propId for a property name.
334      * @param name the property name
335      * @return a propId that matches the property name.
336      */

337     public static int getPropertyId(String JavaDoc name) {
338         if (name != null) {
339             Integer JavaDoc i = (Integer JavaDoc) s_htPropNames.get(name);
340             if (i != null) {
341                 return i.intValue();
342             }
343         }
344         return -1;
345     }
346
347     /**
348      * Return the subpropId for a subproperty name.
349      * @param name the subproperty name.
350      * @return a subpropId that matches the subproperty name.
351      */

352     public static int getSubPropertyId(String JavaDoc name) {
353         if (name != null) {
354             Integer JavaDoc i = (Integer JavaDoc) s_htSubPropNames.get(name);
355             if (i != null) {
356                 return i.intValue();
357             }
358         }
359         return -1;
360     }
361
362     /**
363      * Returns the property name corresponding to the PR_* id
364      * @param id the property id in Constants
365      * @return the property name
366      */

367     public static String JavaDoc getPropertyName(int id) {
368         if (((id & Constants.COMPOUND_MASK) == 0)
369                 || ((id & Constants.PROPERTY_MASK) == 0)) {
370             return (String JavaDoc) s_htPropIds.get(new Integer JavaDoc(id));
371         } else {
372             return (String JavaDoc) s_htPropIds.get(new Integer JavaDoc(
373                     id & Constants.PROPERTY_MASK)) + "." + s_htPropIds.get(
374                             new Integer JavaDoc(id & Constants.COMPOUND_MASK));
375         }
376     }
377
378     private void createAccessibilityProperties() {
379         PropertyMaker m;
380
381         // source-document
382
m = new StringProperty.Maker(PR_SOURCE_DOCUMENT);
383         m.setInherited(false);
384         m.setDefault("none");
385         addPropertyMaker("source-document", m);
386
387         // role
388
m = new StringProperty.Maker(PR_ROLE);
389         m.setInherited(false);
390         m.setDefault("none");
391         addPropertyMaker("role", m);
392     }
393
394     private void createAbsolutePositionProperties() {
395         PropertyMaker m;
396         LengthProperty.Maker l;
397
398         // absolute-position
399
m = new EnumProperty.Maker(PR_ABSOLUTE_POSITION);
400         m.setInherited(false);
401         m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
402         m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED"));
403         m.addEnum("absolute", getEnumProperty(EN_ABSOLUTE, "ABSOLUTE"));
404         m.setDefault("auto");
405         m.addShorthand(s_generics[PR_POSITION]);
406         addPropertyMaker("absolute-position", m);
407
408         // top
409
l = new LengthProperty.Maker(PR_TOP);
410         l.setInherited(false);
411         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
412         l.setDefault("auto");
413         addPropertyMaker("top", l);
414
415         // right
416
l = new LengthProperty.Maker(PR_RIGHT);
417         l.setInherited(false);
418         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
419         l.setDefault("auto");
420         addPropertyMaker("right", l);
421
422         // bottom
423
l = new LengthProperty.Maker(PR_BOTTOM);
424         l.setInherited(false);
425         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
426         l.setDefault("auto");
427         addPropertyMaker("bottom", l);
428
429         // left
430
l = new LengthProperty.Maker(PR_LEFT);
431         l.setInherited(false);
432         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
433         l.setDefault("auto");
434         addPropertyMaker("left", l);
435     }
436
437     private void createAuralProperties() {
438         PropertyMaker m;
439
440         // azimuth
441
m = new ToBeImplementedProperty.Maker(PR_AZIMUTH);
442         m.setInherited(true);
443         m.setDefault("center");
444         addPropertyMaker("azimuth", m);
445
446         // cue-after
447
m = new ToBeImplementedProperty.Maker(PR_CUE_AFTER);
448         m.setInherited(false);
449         m.setDefault("none");
450         addPropertyMaker("cue-after", m);
451
452         // cue-before
453
m = new ToBeImplementedProperty.Maker(PR_CUE_BEFORE);
454         m.setInherited(false);
455         m.setDefault("none");
456         addPropertyMaker("cue-before", m);
457
458         // elevation
459
m = new ToBeImplementedProperty.Maker(PR_ELEVATION);
460         m.setInherited(true);
461         m.setDefault("level");
462         addPropertyMaker("elevation", m);
463
464         // pause-after
465
m = new ToBeImplementedProperty.Maker(PR_PAUSE_AFTER);
466         m.setInherited(false);
467         m.setDefault("");
468         addPropertyMaker("pause-after", m);
469
470         // pause-before
471
m = new ToBeImplementedProperty.Maker(PR_PAUSE_BEFORE);
472         m.setInherited(false);
473         m.setDefault("");
474         addPropertyMaker("pause-before", m);
475
476         // pitch
477
m = new ToBeImplementedProperty.Maker(PR_PITCH);
478         m.setInherited(true);
479         m.setDefault("medium");
480         addPropertyMaker("pitch", m);
481
482         // pitch-range
483
m = new ToBeImplementedProperty.Maker(PR_PITCH_RANGE);
484         m.setInherited(true);
485         m.setDefault("50");
486         addPropertyMaker("pitch-range", m);
487
488         // play-during
489
m = new ToBeImplementedProperty.Maker(PR_PLAY_DURING);
490         m.setInherited(false);
491         m.setDefault("auto");
492         addPropertyMaker("play-during", m);
493
494         // richness
495
m = new ToBeImplementedProperty.Maker(PR_RICHNESS);
496         m.setInherited(true);
497         m.setDefault("50");
498         addPropertyMaker("richness", m);
499
500         // speak
501
m = new ToBeImplementedProperty.Maker(PR_SPEAK);
502         m.setInherited(true);
503         m.setDefault("normal");
504         addPropertyMaker("speak", m);
505
506         // speak-header
507
m = new ToBeImplementedProperty.Maker(PR_SPEAK_HEADER);
508         m.setInherited(true);
509         m.setDefault("once");
510         addPropertyMaker("speak-header", m);
511
512         // speak-numeral
513
m = new ToBeImplementedProperty.Maker(PR_SPEAK_NUMERAL);
514         m.setInherited(true);
515         m.setDefault("continuous");
516         addPropertyMaker("speak-numeral", m);
517
518         // speak-punctuation
519
m = new ToBeImplementedProperty.Maker(PR_SPEAK_PUNCTUATION);
520         m.setInherited(true);
521         m.setDefault("none");
522         addPropertyMaker("speak-punctuation", m);
523
524         // speech-rate
525
m = new ToBeImplementedProperty.Maker(PR_SPEECH_RATE);
526         m.setInherited(true);
527         m.setDefault("medium");
528         addPropertyMaker("speech-rate", m);
529
530         // stress
531
m = new ToBeImplementedProperty.Maker(PR_STRESS);
532         m.setInherited(true);
533         m.setDefault("50");
534         addPropertyMaker("stress", m);
535
536         // voice-family
537
m = new ToBeImplementedProperty.Maker(PR_VOICE_FAMILY);
538         m.setInherited(true);
539         m.setDefault("");
540         addPropertyMaker("voice-family", m);
541
542         // volume
543
m = new ToBeImplementedProperty.Maker(PR_VOLUME);
544         m.setInherited(true);
545         m.setDefault("medium");
546         addPropertyMaker("volume", m);
547     }
548
549     private void createBorderPaddingBackgroundProperties() {
550         PropertyMaker m;
551         BorderWidthPropertyMaker bwm;
552         CorrespondingPropertyMaker corr;
553
554         // background-attachment
555
m = new EnumProperty.Maker(PR_BACKGROUND_ATTACHMENT);
556         m.setInherited(false);
557         m.addEnum("scroll", getEnumProperty(EN_SCROLL, "SCROLL"));
558         m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED"));
559         m.setDefault("scroll");
560         addPropertyMaker("background-attachment", m);
561
562         // background-color
563
m = new ColorProperty.Maker(PR_BACKGROUND_COLOR) {
564             protected Property convertPropertyDatatype(
565                     Property p, PropertyList propertyList, FObj fo) throws PropertyException {
566                 String JavaDoc nameval = p.getNCname();
567                 if (nameval != null) {
568                     FObj fobj = (fo == null ? propertyList.getFObj() : fo);
569                     FOUserAgent ua = (fobj == null ? null : fobj.getUserAgent());
570                     return new ColorProperty(ua, nameval);
571                 }
572                 return super.convertPropertyDatatype(p, propertyList, fo);
573             }
574         };
575         m.useGeneric(genericColor);
576         m.setInherited(false);
577         m.setDefault("transparent");
578         addPropertyMaker("background-color", m);
579
580         // background-image
581
m = new StringProperty.Maker(PR_BACKGROUND_IMAGE);
582         m.setInherited(false);
583         m.setDefault("none");
584         addPropertyMaker("background-image", m);
585
586         // background-repeat
587
m = new EnumProperty.Maker(PR_BACKGROUND_REPEAT);
588         m.setInherited(false);
589         m.addEnum("repeat", getEnumProperty(EN_REPEAT, "REPEAT"));
590         m.addEnum("repeat-x", getEnumProperty(EN_REPEATX, "REPEATX"));
591         m.addEnum("repeat-y", getEnumProperty(EN_REPEATY, "REPEATY"));
592         m.addEnum("no-repeat", getEnumProperty(EN_NOREPEAT, "NOREPEAT"));
593         m.setDefault("repeat");
594         addPropertyMaker("background-repeat", m);
595
596         // background-position-horizontal
597
m = new LengthProperty.Maker(PR_BACKGROUND_POSITION_HORIZONTAL);
598         m.setInherited(false);
599         m.setDefault("0%");
600         m.addKeyword("left", "0%");
601         m.addKeyword("center", "50%");
602         m.addKeyword("right", "100%");
603         m.setPercentBase(LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL);
604         m.addShorthand(s_generics[PR_BACKGROUND_POSITION]);
605         addPropertyMaker("background-position-horizontal", m);
606
607         // background-position-vertical
608
m = new LengthProperty.Maker(PR_BACKGROUND_POSITION_VERTICAL);
609         m.setInherited(false);
610         m.setDefault("0%");
611         m.addKeyword("top", "0%");
612         m.addKeyword("center", "50%");
613         m.addKeyword("bottom", "100%");
614         m.setPercentBase(LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL);
615         m.addShorthand(s_generics[PR_BACKGROUND_POSITION]);
616         addPropertyMaker("background-position-vertical", m);
617
618         // border-before-color
619
m = new ColorProperty.Maker(PR_BORDER_BEFORE_COLOR);
620         m.useGeneric(genericColor);
621         m.setInherited(false);
622         m.setDefault("black");
623         corr = new CorrespondingPropertyMaker(m);
624         corr.setCorresponding(PR_BORDER_TOP_COLOR, PR_BORDER_TOP_COLOR,
625                 PR_BORDER_RIGHT_COLOR);
626         corr.setRelative(true);
627         addPropertyMaker("border-before-color", m);
628
629         // border-before-style
630
m = new EnumProperty.Maker(PR_BORDER_BEFORE_STYLE);
631         m.useGeneric(genericBorderStyle);
632         corr = new CorrespondingPropertyMaker(m);
633         corr.setCorresponding(PR_BORDER_TOP_STYLE, PR_BORDER_TOP_STYLE,
634                 PR_BORDER_RIGHT_STYLE);
635         corr.setRelative(true);
636         addPropertyMaker("border-before-style", m);
637
638         // border-before-width
639
m = new CondLengthProperty.Maker(PR_BORDER_BEFORE_WIDTH);
640         m.useGeneric(genericCondBorderWidth);
641         m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
642         corr = new CorrespondingPropertyMaker(m);
643         corr.setCorresponding(PR_BORDER_TOP_WIDTH, PR_BORDER_TOP_WIDTH,
644                 PR_BORDER_RIGHT_WIDTH);
645         corr.setRelative(true);
646         addPropertyMaker("border-before-width", m);
647
648         // border-after-color
649
m = new ColorProperty.Maker(PR_BORDER_AFTER_COLOR);
650         m.useGeneric(genericColor);
651         m.setInherited(false);
652         m.setDefault("black");
653         corr = new CorrespondingPropertyMaker(m);
654         corr.setCorresponding(PR_BORDER_BOTTOM_COLOR, PR_BORDER_BOTTOM_COLOR,
655                 PR_BORDER_LEFT_COLOR);
656         corr.setRelative(true);
657         addPropertyMaker("border-after-color", m);
658
659         // border-after-style
660
m = new EnumProperty.Maker(PR_BORDER_AFTER_STYLE);
661         m.useGeneric(genericBorderStyle);
662         corr = new CorrespondingPropertyMaker(m);
663         corr.setCorresponding(PR_BORDER_BOTTOM_STYLE, PR_BORDER_BOTTOM_STYLE,
664                 PR_BORDER_LEFT_STYLE);
665         corr.setRelative(true);
666         addPropertyMaker("border-after-style", m);
667
668         // border-after-width
669
m = new CondLengthProperty.Maker(PR_BORDER_AFTER_WIDTH);
670         m.useGeneric(genericCondBorderWidth);
671         m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
672         corr = new CorrespondingPropertyMaker(m);
673         corr.setCorresponding(PR_BORDER_BOTTOM_WIDTH, PR_BORDER_BOTTOM_WIDTH,
674                 PR_BORDER_LEFT_WIDTH);
675         corr.setRelative(true);
676         addPropertyMaker("border-after-width", m);
677
678         // border-start-color
679
m = new ColorProperty.Maker(PR_BORDER_START_COLOR);
680         m.useGeneric(genericColor);
681         m.setInherited(false);
682         m.setDefault("black");
683         corr = new CorrespondingPropertyMaker(m);
684         corr.setCorresponding(PR_BORDER_LEFT_COLOR, PR_BORDER_RIGHT_COLOR,
685                 PR_BORDER_TOP_COLOR);
686         corr.setRelative(true);
687         addPropertyMaker("border-start-color", m);
688
689         // border-start-style
690
m = new EnumProperty.Maker(PR_BORDER_START_STYLE);
691         m.useGeneric(genericBorderStyle);
692         corr = new CorrespondingPropertyMaker(m);
693         corr.setCorresponding(PR_BORDER_LEFT_STYLE, PR_BORDER_RIGHT_STYLE,
694                 PR_BORDER_TOP_STYLE);
695         corr.setRelative(true);
696         addPropertyMaker("border-start-style", m);
697
698         // border-start-width
699
m = new CondLengthProperty.Maker(PR_BORDER_START_WIDTH);
700         m.useGeneric(genericCondBorderWidth);
701         m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
702         corr = new CorrespondingPropertyMaker(m);
703         corr.setCorresponding(PR_BORDER_LEFT_WIDTH, PR_BORDER_RIGHT_WIDTH,
704                 PR_BORDER_TOP_WIDTH);
705         corr.setRelative(true);
706         addPropertyMaker("border-start-width", m);
707
708         // border-end-color
709
m = new ColorProperty.Maker(PR_BORDER_END_COLOR);
710         m.useGeneric(genericColor);
711         m.setInherited(false);
712         m.setDefault("black");
713         corr = new CorrespondingPropertyMaker(m);
714         corr.setCorresponding(PR_BORDER_RIGHT_COLOR, PR_BORDER_LEFT_COLOR,
715                 PR_BORDER_BOTTOM_COLOR);
716         corr.setRelative(true);
717         addPropertyMaker("border-end-color", m);
718
719         // border-end-style
720
m = new EnumProperty.Maker(PR_BORDER_END_STYLE);
721         m.useGeneric(genericBorderStyle);
722         corr = new CorrespondingPropertyMaker(m);
723         corr.setCorresponding(PR_BORDER_RIGHT_STYLE, PR_BORDER_LEFT_STYLE,
724                 PR_BORDER_BOTTOM_STYLE);
725         corr.setRelative(true);
726         addPropertyMaker("border-end-style", m);
727
728         // border-end-width
729
m = new CondLengthProperty.Maker(PR_BORDER_END_WIDTH);
730         m.useGeneric(genericCondBorderWidth);
731         m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
732         corr = new CorrespondingPropertyMaker(m);
733         corr.setCorresponding(PR_BORDER_RIGHT_WIDTH, PR_BORDER_LEFT_WIDTH,
734                 PR_BORDER_BOTTOM_WIDTH);
735         corr.setRelative(true);
736         addPropertyMaker("border-end-width", m);
737
738         // border-top-color
739
m = new ColorProperty.Maker(PR_BORDER_TOP_COLOR);
740         m.useGeneric(genericColor);
741         m.setInherited(false);
742         m.setDefault("black");
743         m.addShorthand(s_generics[PR_BORDER_TOP]);
744         m.addShorthand(s_generics[PR_BORDER_COLOR]);
745         m.addShorthand(s_generics[PR_BORDER]);
746         corr = new CorrespondingPropertyMaker(m);
747         corr.setCorresponding(PR_BORDER_BEFORE_COLOR, PR_BORDER_BEFORE_COLOR,
748                 PR_BORDER_START_COLOR);
749         addPropertyMaker("border-top-color", m);
750
751         // border-top-style
752
m = new EnumProperty.Maker(PR_BORDER_TOP_STYLE);
753         m.useGeneric(genericBorderStyle);
754         m.addShorthand(s_generics[PR_BORDER_TOP]);
755         m.addShorthand(s_generics[PR_BORDER_STYLE]);
756         m.addShorthand(s_generics[PR_BORDER]);
757         corr = new CorrespondingPropertyMaker(m);
758         corr.setCorresponding(PR_BORDER_BEFORE_STYLE, PR_BORDER_BEFORE_STYLE,
759                 PR_BORDER_START_STYLE);
760         addPropertyMaker("border-top-style", m);
761
762         // border-top-width
763
bwm = new BorderWidthPropertyMaker(PR_BORDER_TOP_WIDTH);
764         bwm.useGeneric(genericBorderWidth);
765         bwm.setBorderStyleId(PR_BORDER_TOP_STYLE);
766         bwm.addShorthand(s_generics[PR_BORDER_TOP]);
767         bwm.addShorthand(s_generics[PR_BORDER_WIDTH]);
768         bwm.addShorthand(s_generics[PR_BORDER]);
769         corr = new CorrespondingPropertyMaker(bwm);
770         corr.setCorresponding(PR_BORDER_BEFORE_WIDTH, PR_BORDER_BEFORE_WIDTH,
771                 PR_BORDER_START_WIDTH);
772         addPropertyMaker("border-top-width", bwm);
773
774         // border-bottom-color
775
m = new ColorProperty.Maker(PR_BORDER_BOTTOM_COLOR);
776         m.useGeneric(genericColor);
777         m.setInherited(false);
778         m.setDefault("black");
779         m.addShorthand(s_generics[PR_BORDER_BOTTOM]);
780         m.addShorthand(s_generics[PR_BORDER_COLOR]);
781         m.addShorthand(s_generics[PR_BORDER]);
782         corr = new CorrespondingPropertyMaker(m);
783         corr.setCorresponding(PR_BORDER_AFTER_COLOR, PR_BORDER_AFTER_COLOR,
784                 PR_BORDER_END_COLOR);
785         addPropertyMaker("border-bottom-color", m);
786
787         // border-bottom-style
788
m = new EnumProperty.Maker(PR_BORDER_BOTTOM_STYLE);
789         m.useGeneric(genericBorderStyle);
790         m.addShorthand(s_generics[PR_BORDER_BOTTOM]);
791         m.addShorthand(s_generics[PR_BORDER_STYLE]);
792         m.addShorthand(s_generics[PR_BORDER]);
793         corr = new CorrespondingPropertyMaker(m);
794         corr.setCorresponding(PR_BORDER_AFTER_STYLE, PR_BORDER_AFTER_STYLE,
795                 PR_BORDER_END_STYLE);
796         addPropertyMaker("border-bottom-style", m);
797
798         // border-bottom-width
799
bwm = new BorderWidthPropertyMaker(PR_BORDER_BOTTOM_WIDTH);
800         bwm.useGeneric(genericBorderWidth);
801         bwm.setBorderStyleId(PR_BORDER_BOTTOM_STYLE);
802         bwm.addShorthand(s_generics[PR_BORDER_BOTTOM]);
803         bwm.addShorthand(s_generics[PR_BORDER_WIDTH]);
804         bwm.addShorthand(s_generics[PR_BORDER]);
805         corr = new CorrespondingPropertyMaker(bwm);
806         corr.setCorresponding(PR_BORDER_AFTER_WIDTH, PR_BORDER_AFTER_WIDTH,
807                 PR_BORDER_END_WIDTH);
808         addPropertyMaker("border-bottom-width", bwm);
809
810         // border-left-color
811
m = new ColorProperty.Maker(PR_BORDER_LEFT_COLOR);
812         m.useGeneric(genericColor);
813         m.setInherited(false);
814         m.setDefault("black");
815         m.addShorthand(s_generics[PR_BORDER_LEFT]);
816         m.addShorthand(s_generics[PR_BORDER_COLOR]);
817         m.addShorthand(s_generics[PR_BORDER]);
818         corr = new CorrespondingPropertyMaker(m);
819         corr.setCorresponding(PR_BORDER_START_COLOR, PR_BORDER_END_COLOR,
820                 PR_BORDER_AFTER_COLOR);
821         addPropertyMaker("border-left-color", m);
822
823         // border-left-style
824
m = new EnumProperty.Maker(PR_BORDER_LEFT_STYLE);
825         m.useGeneric(genericBorderStyle);
826         m.addShorthand(s_generics[PR_BORDER_LEFT]);
827         m.addShorthand(s_generics[PR_BORDER_STYLE]);
828         m.addShorthand(s_generics[PR_BORDER]);
829         corr = new CorrespondingPropertyMaker(m);
830         corr.setCorresponding(PR_BORDER_START_STYLE, PR_BORDER_END_STYLE,
831                 PR_BORDER_AFTER_STYLE);
832         addPropertyMaker("border-left-style", m);
833
834         // border-left-width
835
bwm = new BorderWidthPropertyMaker(PR_BORDER_LEFT_WIDTH);
836         bwm.useGeneric(genericBorderWidth);
837         bwm.setBorderStyleId(PR_BORDER_LEFT_STYLE);
838         bwm.addShorthand(s_generics[PR_BORDER_LEFT]);
839         bwm.addShorthand(s_generics[PR_BORDER_WIDTH]);
840         bwm.addShorthand(s_generics[PR_BORDER]);
841         corr = new CorrespondingPropertyMaker(bwm);
842         corr.setCorresponding(PR_BORDER_START_WIDTH, PR_BORDER_END_WIDTH,
843                 PR_BORDER_AFTER_WIDTH);
844         addPropertyMaker("border-left-width", bwm);
845
846         // border-right-color
847
m = new ColorProperty.Maker(PR_BORDER_RIGHT_COLOR);
848         m.useGeneric(genericColor);
849         m.setInherited(false);
850         m.setDefault("black");
851         m.addShorthand(s_generics[PR_BORDER_RIGHT]);
852         m.addShorthand(s_generics[PR_BORDER_COLOR]);
853         m.addShorthand(s_generics[PR_BORDER]);
854         corr = new CorrespondingPropertyMaker(m);
855         corr.setCorresponding(PR_BORDER_END_COLOR, PR_BORDER_START_COLOR,
856                 PR_BORDER_BEFORE_COLOR);
857         addPropertyMaker("border-right-color", m);
858
859         // border-right-style
860
m = new EnumProperty.Maker(PR_BORDER_RIGHT_STYLE);
861         m.useGeneric(genericBorderStyle);
862         m.addShorthand(s_generics[PR_BORDER_RIGHT]);
863         m.addShorthand(s_generics[PR_BORDER_STYLE]);
864         m.addShorthand(s_generics[PR_BORDER]);
865         corr = new CorrespondingPropertyMaker(m);
866         corr.setCorresponding(PR_BORDER_END_STYLE, PR_BORDER_START_STYLE,
867                 PR_BORDER_BEFORE_STYLE);
868         addPropertyMaker("border-right-style", m);
869
870         // border-right-width
871
bwm = new BorderWidthPropertyMaker(PR_BORDER_RIGHT_WIDTH);
872         bwm.useGeneric(genericBorderWidth);
873         bwm.setBorderStyleId(PR_BORDER_RIGHT_STYLE);
874         bwm.addShorthand(s_generics[PR_BORDER_RIGHT]);
875         bwm.addShorthand(s_generics[PR_BORDER_WIDTH]);
876         bwm.addShorthand(s_generics[PR_BORDER]);
877         corr = new CorrespondingPropertyMaker(bwm);
878         corr.setCorresponding(PR_BORDER_END_WIDTH, PR_BORDER_START_WIDTH,
879                 PR_BORDER_BEFORE_WIDTH);
880         addPropertyMaker("border-right-width", bwm);
881
882         // padding-before
883
m = new CondLengthProperty.Maker(PR_PADDING_BEFORE);
884         m.useGeneric(genericCondPadding);
885         m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
886         corr = new CorrespondingPropertyMaker(m);
887         corr.setCorresponding(PR_PADDING_TOP, PR_PADDING_TOP,
888                 PR_PADDING_RIGHT);
889         corr.setRelative(true);
890         addPropertyMaker("padding-before", m);
891
892         // padding-after
893
m = new CondLengthProperty.Maker(PR_PADDING_AFTER);
894         m.useGeneric(genericCondPadding);
895         m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
896         corr = new CorrespondingPropertyMaker(m);
897         corr.setCorresponding(PR_PADDING_BOTTOM, PR_PADDING_BOTTOM,
898                 PR_PADDING_LEFT);
899         corr.setRelative(true);
900         addPropertyMaker("padding-after", m);
901
902         // padding-start
903
m = new CondLengthProperty.Maker(PR_PADDING_START);
904         m.useGeneric(genericCondPadding);
905         m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
906         corr = new CorrespondingPropertyMaker(m);
907         corr.setCorresponding(PR_PADDING_LEFT, PR_PADDING_RIGHT,
908                 PR_PADDING_TOP);
909         corr.setRelative(true);
910         addPropertyMaker("padding-start", m);
911
912         // padding-end
913
m = new CondLengthProperty.Maker(PR_PADDING_END);
914         m.useGeneric(genericCondPadding);
915         m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
916         corr = new CorrespondingPropertyMaker(m);
917         corr.setCorresponding(PR_PADDING_RIGHT, PR_PADDING_LEFT,
918                 PR_PADDING_BOTTOM);
919         corr.setRelative(true);
920         addPropertyMaker("padding-end", m);
921
922         // padding-top
923
m = new LengthProperty.Maker(PR_PADDING_TOP);
924         m.useGeneric(genericPadding);
925         corr = new CorrespondingPropertyMaker(m);
926         corr.setCorresponding(PR_PADDING_BEFORE, PR_PADDING_BEFORE,
927                 PR_PADDING_START);
928         addPropertyMaker("padding-top", m);
929
930         // padding-bottom
931
m = new LengthProperty.Maker(PR_PADDING_BOTTOM);
932         m.useGeneric(genericPadding);
933         corr = new CorrespondingPropertyMaker(m);
934         corr.setCorresponding(PR_PADDING_AFTER, PR_PADDING_AFTER,
935                 PR_PADDING_END);
936         addPropertyMaker("padding-bottom", m);
937
938         // padding-left
939
m = new LengthProperty.Maker(PR_PADDING_LEFT);
940         m.useGeneric(genericPadding);
941         corr = new CorrespondingPropertyMaker(m);
942         corr.setCorresponding(PR_PADDING_START, PR_PADDING_END,
943                 PR_PADDING_AFTER);
944         addPropertyMaker("padding-left", m);
945
946         // padding-right
947
m = new LengthProperty.Maker(PR_PADDING_RIGHT);
948         m.useGeneric(genericPadding);
949         corr = new CorrespondingPropertyMaker(m);
950         corr.setCorresponding(PR_PADDING_END, PR_PADDING_START,
951                 PR_PADDING_BEFORE);
952         addPropertyMaker("padding-right", m);
953     }
954
955     private void createFontProperties() {
956         PropertyMaker m;
957
958         // font-family
959
m = new FontFamilyProperty.Maker(PR_FONT_FAMILY);
960         m.setInherited(true);
961         m.setDefault("sans-serif");
962         m.addShorthand(s_generics[PR_FONT]);
963         addPropertyMaker("font-family", m);
964
965         // font-selection-strategy
966
m = new EnumProperty.Maker(PR_FONT_SELECTION_STRATEGY);
967         m.setInherited(true);
968         m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
969         m.addEnum("character-by-character", getEnumProperty(
970                 EN_CHARACTER_BY_CHARACTER, "CHARACTER_BY_CHARACTER"));
971         m.setDefault("auto");
972         addPropertyMaker("font-selection-strategy", m);
973
974         // font-size
975
m = new FontSizePropertyMaker(PR_FONT_SIZE);
976         m.setInherited(true);
977         m.setDefault("12pt");
978         m.addKeyword("xx-small", "6.944pt");
979         m.addKeyword("x-small", "8.333pt");
980         m.addKeyword("small", "10pt");
981         m.addKeyword("medium", "12pt");
982         m.addKeyword("large", "14.4pt");
983         m.addKeyword("x-large", "17.28pt");
984         m.addKeyword("xx-large", "20.736pt");
985         m.addEnum("larger", getEnumProperty(EN_LARGER, "LARGER"));
986         m.addEnum("smaller", getEnumProperty(EN_SMALLER, "SMALLER"));
987         m.setPercentBase(LengthBase.INH_FONTSIZE);
988         m.addShorthand(s_generics[PR_FONT]);
989         addPropertyMaker("font-size", m);
990
991         // font-stretch
992
m = new FontStretchPropertyMaker(PR_FONT_STRETCH);
993         m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
994         m.addEnum("wider", getEnumProperty(EN_WIDER, "WIDER"));
995         m.addEnum("narrower", getEnumProperty(EN_NARROWER, "NARROWER"));
996         m.addEnum("ultra-condensed", getEnumProperty(EN_ULTRA_CONDENSED, "ULTRA_CONDENSED"));
997         m.addEnum("extra-condensed", getEnumProperty(EN_EXTRA_CONDENSED, "EXTRA_CONDENSED"));
998         m.addEnum("condensed", getEnumProperty(EN_CONDENSED, "CONDENSED"));
999         m.addEnum("semi-condensed", getEnumProperty(EN_SEMI_CONDENSED, "SEMI_CONDENSED"));
1000        m.addEnum("semi-expanded", getEnumProperty(EN_SEMI_EXPANDED, "SEMI_EXPANDED"));
1001        m.addEnum("expanded", getEnumProperty(EN_EXPANDED, "EXPANDED"));
1002        m.addEnum("extra-expanded", getEnumProperty(EN_EXTRA_EXPANDED, "EXTRA_EXPANDED"));
1003        m.addEnum("ultra-expanded", getEnumProperty(EN_ULTRA_EXPANDED, "ULTRA_EXPANDED"));
1004        m.setDefault("normal");
1005        addPropertyMaker("font-stretch", m);
1006
1007        // font-size-adjust
1008
m = new NumberProperty.Maker(PR_FONT_SIZE_ADJUST);
1009        m.setInherited(true);
1010        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1011        m.setDefault("none");
1012        addPropertyMaker("font-size-adjust", m);
1013
1014        // font-style
1015
m = new EnumProperty.Maker(PR_FONT_STYLE);
1016        m.setInherited(true);
1017        m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
1018        m.addEnum("italic", getEnumProperty(EN_ITALIC, "ITALIC"));
1019        m.addEnum("oblique", getEnumProperty(EN_OBLIQUE, "OBLIQUE"));
1020        m.addEnum("backslant", getEnumProperty(EN_BACKSLANT, "BACKSLANT"));
1021        m.setDefault("normal");
1022        m.addShorthand(s_generics[PR_FONT]);
1023        addPropertyMaker("font-style", m);
1024
1025        // font-variant
1026
m = new EnumProperty.Maker(PR_FONT_VARIANT);
1027        m.setInherited(true);
1028        m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
1029        m.addEnum("small-caps", getEnumProperty(EN_SMALL_CAPS, "SMALL_CAPS"));
1030        m.setDefault("normal");
1031        m.addShorthand(s_generics[PR_FONT]);
1032        addPropertyMaker("font-variant", m);
1033
1034        // font-weight
1035
m = new EnumProperty.Maker(PR_FONT_WEIGHT);
1036        m.setInherited(true);
1037        m.addKeyword("normal", "400");
1038        m.addKeyword("bold", "700");
1039        m.addEnum("bolder", getEnumProperty(EN_BOLDER, "BOLDER"));
1040        m.addEnum("lighter", getEnumProperty(EN_LIGHTER, "LIGHTER"));
1041        m.addEnum("100", getEnumProperty(EN_100, "100"));
1042        m.addEnum("200", getEnumProperty(EN_200, "200"));
1043        m.addEnum("300", getEnumProperty(EN_300, "300"));
1044        m.addEnum("400", getEnumProperty(EN_400, "400"));
1045        m.addEnum("500", getEnumProperty(EN_500, "500"));
1046        m.addEnum("600", getEnumProperty(EN_600, "600"));
1047        m.addEnum("700", getEnumProperty(EN_700, "700"));
1048        m.addEnum("800", getEnumProperty(EN_800, "800"));
1049        m.addEnum("900", getEnumProperty(EN_900, "900"));
1050        m.setDefault("400");
1051        m.addShorthand(s_generics[PR_FONT]);
1052        addPropertyMaker("font-weight", m);
1053    }
1054
1055    private void createHyphenationProperties() {
1056        PropertyMaker m;
1057
1058        // country
1059
m = new StringProperty.Maker(PR_COUNTRY);
1060        m.setInherited(true);
1061        m.setDefault("none");
1062        addPropertyMaker("country", m);
1063
1064        // language
1065
m = new StringProperty.Maker(PR_LANGUAGE);
1066        m.setInherited(true);
1067        m.setDefault("none");
1068        addPropertyMaker("language", m);
1069
1070        // script
1071
m = new StringProperty.Maker(PR_SCRIPT);
1072        m.setInherited(true);
1073        m.setDefault("auto");
1074        addPropertyMaker("script", m);
1075
1076        // hyphenate
1077
m = new EnumProperty.Maker(PR_HYPHENATE);
1078        m.setInherited(true);
1079        m.addEnum("true", getEnumProperty(EN_TRUE, "TRUE"));
1080        m.addEnum("false", getEnumProperty(EN_FALSE, "FALSE"));
1081        m.setDefault("false");
1082        addPropertyMaker("hyphenate", m);
1083
1084        // hyphenation-character
1085
m = new CharacterProperty.Maker(PR_HYPHENATION_CHARACTER);
1086        m.setInherited(true);
1087        m.setDefault("-");
1088        addPropertyMaker("hyphenation-character", m);
1089
1090        // hyphenation-push-character-count
1091
m = new NumberProperty.Maker(PR_HYPHENATION_PUSH_CHARACTER_COUNT);
1092        m.setInherited(true);
1093        m.setDefault("2");
1094        addPropertyMaker("hyphenation-push-character-count", m);
1095
1096        // hyphenation-remain-character-count
1097
m = new NumberProperty.Maker(PR_HYPHENATION_REMAIN_CHARACTER_COUNT);
1098        m.setInherited(true);
1099        m.setDefault("2");
1100        addPropertyMaker("hyphenation-remain-character-count", m);
1101    }
1102
1103    private void createMarginBlockProperties() {
1104        PropertyMaker m;
1105        CorrespondingPropertyMaker corr;
1106
1107        // margin-top
1108
m = new LengthProperty.Maker(PR_MARGIN_TOP);
1109        m.setInherited(false);
1110        m.setDefault("0pt");
1111        m.addShorthand(s_generics[PR_MARGIN]);
1112        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1113        addPropertyMaker("margin-top", m);
1114
1115        // margin-bottom
1116
m = new LengthProperty.Maker(PR_MARGIN_BOTTOM);
1117        m.setInherited(false);
1118        m.setDefault("0pt");
1119        m.addShorthand(s_generics[PR_MARGIN]);
1120        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1121        addPropertyMaker("margin-bottom", m);
1122
1123        // margin-left
1124
m = new LengthProperty.Maker(PR_MARGIN_LEFT);
1125        m.setInherited(false);
1126        m.setDefault("0pt");
1127        m.addShorthand(s_generics[PR_MARGIN]);
1128        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1129        addPropertyMaker("margin-left", m);
1130
1131        // margin-right
1132
m = new LengthProperty.Maker(PR_MARGIN_RIGHT);
1133        m.setInherited(false);
1134        m.setDefault("0pt");
1135        m.addShorthand(s_generics[PR_MARGIN]);
1136        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1137        addPropertyMaker("margin-right", m);
1138
1139        // space-before
1140
m = new SpaceProperty.Maker(PR_SPACE_BEFORE);
1141        m.useGeneric(genericSpace);
1142        corr = new SpacePropertyMaker(m);
1143        corr.setCorresponding(PR_MARGIN_TOP, PR_MARGIN_TOP, PR_MARGIN_RIGHT);
1144        corr.setUseParent(true);
1145        corr.setRelative(true);
1146        addPropertyMaker("space-before", m);
1147
1148        // space-after
1149
m = new SpaceProperty.Maker(PR_SPACE_AFTER);
1150        m.useGeneric(genericSpace);
1151        corr = new SpacePropertyMaker(m);
1152        corr.setCorresponding(PR_MARGIN_BOTTOM, PR_MARGIN_BOTTOM, PR_MARGIN_LEFT);
1153        corr.setUseParent(true);
1154        corr.setRelative(true);
1155        addPropertyMaker("space-after", m);
1156
1157        // start-indent
1158
m = new LengthProperty.Maker(PR_START_INDENT);
1159        m.setInherited(true);
1160        m.setDefault("0pt");
1161        IndentPropertyMaker sCorr = new IndentPropertyMaker(m);
1162        sCorr.setCorresponding(PR_MARGIN_LEFT, PR_MARGIN_RIGHT, PR_MARGIN_TOP);
1163        sCorr.setUseParent(true);
1164        sCorr.setRelative(true);
1165        sCorr.setPaddingCorresponding(new int[] {
1166             PR_PADDING_LEFT, PR_PADDING_RIGHT, PR_PADDING_TOP
1167        });
1168        sCorr.setBorderWidthCorresponding(new int[] {
1169            PR_BORDER_LEFT_WIDTH, PR_BORDER_RIGHT_WIDTH, PR_BORDER_TOP_WIDTH
1170        });
1171        addPropertyMaker("start-indent", m);
1172
1173        // end-indent
1174
m = new LengthProperty.Maker(PR_END_INDENT);
1175        m.setInherited(true);
1176        m.setDefault("0pt");
1177        IndentPropertyMaker eCorr = new IndentPropertyMaker(m);
1178        eCorr.setCorresponding(PR_MARGIN_RIGHT, PR_MARGIN_LEFT, PR_MARGIN_BOTTOM);
1179        eCorr.setUseParent(true);
1180        eCorr.setRelative(true);
1181        eCorr.setPaddingCorresponding(new int[] {
1182            PR_PADDING_RIGHT, PR_PADDING_LEFT, PR_PADDING_BOTTOM
1183        });
1184        eCorr.setBorderWidthCorresponding(new int[] {
1185            PR_BORDER_RIGHT_WIDTH, PR_BORDER_LEFT_WIDTH, PR_BORDER_BOTTOM_WIDTH
1186        });
1187        addPropertyMaker("end-indent", m);
1188    }
1189
1190    private void createMarginInlineProperties() {
1191        PropertyMaker m;
1192
1193        // space-end
1194
m = new SpaceProperty.Maker(PR_SPACE_END);
1195        m.useGeneric(genericSpace);
1196        addPropertyMaker("space-end", m);
1197
1198        // space-start
1199
m = new SpaceProperty.Maker(PR_SPACE_START);
1200        m.useGeneric(genericSpace);
1201        addPropertyMaker("space-start", m);
1202    }
1203
1204    private void createRelativePosProperties() {
1205        PropertyMaker m;
1206
1207        // relative-position
1208
m = new EnumProperty.Maker(PR_RELATIVE_POSITION);
1209        m.setInherited(false);
1210        m.addEnum("static", getEnumProperty(EN_STATIC, "STATIC"));
1211        m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE"));
1212        m.setDefault("static");
1213        m.addShorthand(s_generics[PR_POSITION]);
1214        addPropertyMaker("relative-position", m);
1215    }
1216
1217    private void createAreaAlignmentProperties() {
1218        PropertyMaker m;
1219
1220        // alignment-adjust
1221
m = new LengthProperty.Maker(PR_ALIGNMENT_ADJUST);
1222        m.setInherited(false);
1223        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1224        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
1225        m.addEnum("before-edge", getEnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE"));
1226        m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
1227        m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
1228        m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
1229        m.addEnum("after-edge", getEnumProperty(EN_AFTER_EDGE, "AFTER_EDGE"));
1230        m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
1231        m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
1232        m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
1233        m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
1234        m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
1235        m.setDefault("auto");
1236        m.setPercentBase(LengthBase.ALIGNMENT_ADJUST);
1237        m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
1238        addPropertyMaker("alignment-adjust", m);
1239
1240        // alignment-baseline
1241
m = new EnumProperty.Maker(PR_ALIGNMENT_BASELINE);
1242        m.setInherited(false);
1243        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1244        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
1245        m.addEnum("before-edge", getEnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE"));
1246        m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
1247        m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
1248        m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
1249        m.addEnum("after-edge", getEnumProperty(EN_AFTER_EDGE, "AFTER_EDGE"));
1250        m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
1251        m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
1252        m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
1253        m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
1254        m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
1255        m.setDefault("auto");
1256        m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
1257        addPropertyMaker("alignment-baseline", m);
1258
1259        // baseline-shift
1260
m = new LengthProperty.Maker(PR_BASELINE_SHIFT);
1261        m.setInherited(false);
1262        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
1263        m.addEnum("sub", getEnumProperty(EN_SUB, "SUB"));
1264        m.addEnum("super", getEnumProperty(EN_SUPER, "SUPER"));
1265        m.setDefault("baseline");
1266        m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
1267        m.setPercentBase(LengthBase.CUSTOM_BASE);
1268        addPropertyMaker("baseline-shift", m);
1269
1270        // display-align
1271
m = new EnumProperty.Maker(PR_DISPLAY_ALIGN);
1272        m.setInherited(true);
1273        m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
1274        m.addEnum("after", getEnumProperty(EN_AFTER, "AFTER"));
1275        m.addEnum("center", getEnumProperty(EN_CENTER, "CENTER"));
1276        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1277/*LF*/ m.addEnum("distribute", getEnumProperty(EN_X_DISTRIBUTE, "DISTRIBUTE"));
1278/*LF*/ m.addEnum("fill", getEnumProperty(EN_X_FILL, "FILL"));
1279        m.setDefault("auto");
1280        addPropertyMaker("display-align", m);
1281
1282        // dominant-baseline
1283
m = new EnumProperty.Maker(PR_DOMINANT_BASELINE);
1284        m.setInherited(false);
1285        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1286        m.addEnum("use-script", getEnumProperty(EN_USE_SCRIPT, "USE_SCRIPT"));
1287        m.addEnum("no-change", getEnumProperty(EN_NO_CHANGE, "NO_CHANGE"));
1288        m.addEnum("reset-size", getEnumProperty(EN_RESET_SIZE, "RESET_SIZE"));
1289        m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
1290        m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
1291        m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
1292        m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
1293        m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
1294        m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
1295        m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
1296        m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
1297        m.setDefault("auto");
1298        m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
1299        addPropertyMaker("dominant-baseline", m);
1300
1301        // relative-align
1302
m = new EnumProperty.Maker(PR_RELATIVE_ALIGN);
1303        m.setInherited(true);
1304        m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
1305        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
1306        m.setDefault("before");
1307        addPropertyMaker("relative-align", m);
1308    }
1309
1310    private void createAreaDimensionProperties() {
1311        PropertyMaker m;
1312        LengthProperty.Maker l;
1313        DimensionPropertyMaker pdim;
1314
1315        // block-progression-dimension
1316
m = new LengthRangeProperty.Maker(PR_BLOCK_PROGRESSION_DIMENSION);
1317        m.setInherited(false);
1318        m.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
1319
1320        l = new LengthProperty.Maker(CP_MINIMUM);
1321        l.setDefault("auto");
1322        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1323        l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
1324        l.setByShorthand(true);
1325        m.addSubpropMaker(l);
1326
1327        l = new LengthProperty.Maker(CP_OPTIMUM);
1328        l.setDefault("auto");
1329        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1330        l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
1331        l.setByShorthand(true);
1332        m.addSubpropMaker(l);
1333
1334        l = new LengthProperty.Maker(CP_MAXIMUM);
1335        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1336        l.setDefault("auto");
1337        l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
1338        l.setByShorthand(true);
1339        m.addSubpropMaker(l);
1340
1341        pdim = new DimensionPropertyMaker(m);
1342        pdim.setCorresponding(PR_HEIGHT, PR_HEIGHT, PR_WIDTH);
1343        pdim.setExtraCorresponding(new int[][] {
1344             {PR_MIN_HEIGHT, PR_MIN_HEIGHT, PR_MIN_WIDTH, },
1345             {PR_MAX_HEIGHT, PR_MAX_HEIGHT, PR_MAX_WIDTH, }
1346        });
1347        pdim.setRelative(true);
1348        m.setCorresponding(pdim);
1349        addPropertyMaker("block-progression-dimension", m);
1350
1351        // content-height
1352
l = new LengthProperty.Maker(PR_CONTENT_HEIGHT);
1353        l.setInherited(false);
1354        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1355        l.addEnum("scale-to-fit", getEnumProperty(EN_SCALE_TO_FIT, "SCALE_TO_FIT"));
1356        l.setDefault("auto");
1357        l.setPercentBase(LengthBase.IMAGE_INTRINSIC_HEIGHT);
1358        addPropertyMaker("content-height", l);
1359
1360        // content-width
1361
l = new LengthProperty.Maker(PR_CONTENT_WIDTH);
1362        l.setInherited(false);
1363        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1364        l.addEnum("scale-to-fit", getEnumProperty(EN_SCALE_TO_FIT, "SCALE_TO_FIT"));
1365        l.setDefault("auto");
1366        l.setPercentBase(LengthBase.IMAGE_INTRINSIC_WIDTH);
1367        addPropertyMaker("content-width", l);
1368
1369        // height
1370
l = new LengthProperty.Maker(PR_HEIGHT);
1371        l.setInherited(false);
1372        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1373        l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
1374        l.setDefault("auto");
1375        addPropertyMaker("height", l);
1376
1377        // inline-progression-dimension
1378
m = new LengthRangeProperty.Maker(PR_INLINE_PROGRESSION_DIMENSION);
1379        m.setInherited(false);
1380        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1381
1382        l = new LengthProperty.Maker(CP_MINIMUM);
1383        l.setDefault("auto");
1384        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1385        l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1386        l.setByShorthand(true);
1387        m.addSubpropMaker(l);
1388
1389        l = new LengthProperty.Maker(CP_OPTIMUM);
1390        l.setDefault("auto");
1391        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1392        l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1393        l.setByShorthand(true);
1394        m.addSubpropMaker(l);
1395
1396        l = new LengthProperty.Maker(CP_MAXIMUM);
1397        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1398        l.setDefault("auto");
1399        l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1400        l.setByShorthand(true);
1401        m.addSubpropMaker(l);
1402
1403        pdim = new DimensionPropertyMaker(m);
1404        pdim.setRelative(true);
1405        pdim.setCorresponding(PR_WIDTH, PR_WIDTH, PR_HEIGHT);
1406        pdim.setExtraCorresponding(new int[][] {
1407            {PR_MIN_WIDTH, PR_MIN_WIDTH, PR_MIN_HEIGHT, },
1408            {PR_MAX_WIDTH, PR_MAX_WIDTH, PR_MAX_HEIGHT, }
1409        });
1410        m.setCorresponding(pdim);
1411        addPropertyMaker("inline-progression-dimension", m);
1412
1413        // max-height
1414
m = new ToBeImplementedProperty.Maker(PR_MAX_HEIGHT);
1415        m.setInherited(false);
1416        m.setDefault("0pt");
1417        addPropertyMaker("max-height", m);
1418
1419        // max-width
1420
m = new ToBeImplementedProperty.Maker(PR_MAX_WIDTH);
1421        m.setInherited(false);
1422        m.setDefault("none");
1423        addPropertyMaker("max-width", m);
1424
1425        // min-height
1426
m = new ToBeImplementedProperty.Maker(PR_MIN_HEIGHT);
1427        m.setInherited(false);
1428        m.setDefault("0pt");
1429        addPropertyMaker("min-height", m);
1430
1431        // min-width
1432
m = new ToBeImplementedProperty.Maker(PR_MIN_WIDTH);
1433        m.setInherited(false);
1434        m.setDefault("");
1435        addPropertyMaker("min-width", m);
1436
1437        // scaling
1438
m = new EnumProperty.Maker(PR_SCALING);
1439        m.setInherited(true);
1440        m.addEnum("uniform", getEnumProperty(EN_UNIFORM, "UNIFORM"));
1441        m.addEnum("non-uniform", getEnumProperty(EN_NON_UNIFORM, "NON_UNIFORM"));
1442        m.setDefault("uniform");
1443        addPropertyMaker("scaling", m);
1444
1445        // scaling-method
1446
m = new EnumProperty.Maker(PR_SCALING_METHOD);
1447        m.setInherited(false);
1448        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1449        m.addEnum("integer-pixels", getEnumProperty(EN_INTEGER_PIXELS, "INTEGER_PIXELS"));
1450        m.addEnum("resample-any-method", getEnumProperty(EN_RESAMPLE_ANY_METHOD, "RESAMPLE_ANY_METHOD"));
1451        m.setDefault("auto");
1452        addPropertyMaker("scaling-method", m);
1453
1454        // width
1455
l = new LengthProperty.Maker(PR_WIDTH);
1456        l.setInherited(false);
1457        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1458        l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1459        l.setDefault("auto");
1460        addPropertyMaker("width", l);
1461
1462        // fox:block-progression-unit (**CUSTOM EXTENSION**)
1463
l = new LengthProperty.Maker(PR_X_BLOCK_PROGRESSION_UNIT);
1464        l.setInherited(false);
1465        l.setDefault("0pt");
1466        addPropertyMaker("fox:block-progression-unit", l);
1467    }
1468
1469    private void createBlockAndLineProperties() {
1470        PropertyMaker m;
1471
1472        // hyphenation-keep
1473
m = new EnumProperty.Maker(PR_HYPHENATION_KEEP);
1474        m.setInherited(true);
1475        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1476        m.addEnum("column", getEnumProperty(EN_COLUMN, "COLUMN"));
1477        m.addEnum("page", getEnumProperty(EN_PAGE, "PAGE"));
1478        m.setDefault("auto");
1479        addPropertyMaker("hyphenation-keep", m);
1480
1481        // hyphenation-ladder-count
1482
m = new NumberProperty.Maker(PR_HYPHENATION_LADDER_COUNT);
1483        m.setInherited(true);
1484        m.addEnum("no-limit", getEnumProperty(EN_NO_LIMIT, "NO_LIMIT"));
1485        m.setDefault("no-limit");
1486        addPropertyMaker("hyphenation-ladder-count", m);
1487
1488        // last-line-end-indent
1489
m = new LengthProperty.Maker(PR_LAST_LINE_END_INDENT);
1490        m.setInherited(true);
1491        m.setDefault("0pt");
1492        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1493        addPropertyMaker("last-line-end-indent", m);
1494
1495        // line-height
1496
m = new LineHeightPropertyMaker(PR_LINE_HEIGHT);
1497        m.useGeneric(genericSpace);
1498        m.setInherited(true);
1499        m.addKeyword("normal", "1.2");
1500        m.setPercentBase(LengthBase.FONTSIZE);
1501        m.setDefault("normal", true);
1502        m.addShorthand(s_generics[PR_FONT]);
1503        addPropertyMaker("line-height", m);
1504
1505        // line-height-shift-adjustment
1506
m = new EnumProperty.Maker(PR_LINE_HEIGHT_SHIFT_ADJUSTMENT);
1507        m.setInherited(true);
1508        m.addEnum("consider-shifts", getEnumProperty(EN_CONSIDER_SHIFTS, "CONSIDER_SHIFTS"));
1509        m.addEnum("disregard-shifts", getEnumProperty(EN_DISREGARD_SHIFTS, "DISREGARD_SHIFTS"));
1510        m.setDefault("consider-shifts");
1511        addPropertyMaker("line-height-shift-adjustment", m);
1512
1513        // line-stacking-strategy
1514
m = new EnumProperty.Maker(PR_LINE_STACKING_STRATEGY);
1515        m.setInherited(true);
1516        m.addEnum("line-height", getEnumProperty(EN_LINE_HEIGHT, "LINE_HEIGHT"));
1517        m.addEnum("font-height", getEnumProperty(EN_FONT_HEIGHT, "FONT_HEIGHT"));
1518        m.addEnum("max-height", getEnumProperty(EN_MAX_HEIGHT, "MAX_HEIGHT"));
1519        m.setDefault("max-height");
1520        addPropertyMaker("line-stacking-strategy", m);
1521
1522        // linefeed-treatment
1523
m = new EnumProperty.Maker(PR_LINEFEED_TREATMENT);
1524        m.setInherited(true);
1525        m.addEnum("ignore", getEnumProperty(EN_IGNORE, "IGNORE"));
1526        m.addEnum("preserve", getEnumProperty(EN_PRESERVE, "PRESERVE"));
1527        m.addEnum("treat-as-space", getEnumProperty(EN_TREAT_AS_SPACE, "TREAT_AS_SPACE"));
1528        m.addEnum("treat-as-zero-width-space", getEnumProperty(EN_TREAT_AS_ZERO_WIDTH_SPACE, "TREAT_AS_ZERO_WIDTH_SPACE"));
1529        m.setDefault("treat-as-space");
1530        m.addShorthand(s_generics[PR_WHITE_SPACE]);
1531        addPropertyMaker("linefeed-treatment", m);
1532
1533        // white-space-treatment
1534
m = new EnumProperty.Maker(PR_WHITE_SPACE_TREATMENT);
1535        m.setInherited(true);
1536        m.addEnum("ignore", getEnumProperty(EN_IGNORE, "IGNORE"));
1537        m.addEnum("preserve", getEnumProperty(EN_PRESERVE, "PRESERVE"));
1538        m.addEnum("ignore-if-before-linefeed", getEnumProperty(EN_IGNORE_IF_BEFORE_LINEFEED, "IGNORE_IF_BEFORE_LINEFEED"));
1539        m.addEnum("ignore-if-after-linefeed", getEnumProperty(EN_IGNORE_IF_AFTER_LINEFEED, "IGNORE_IF_AFTER_LINEFEED"));
1540        m.addEnum("ignore-if-surrounding-linefeed", getEnumProperty(EN_IGNORE_IF_SURROUNDING_LINEFEED, "IGNORE_IF_SURROUNDING_LINEFEED"));
1541        m.setDefault("ignore-if-surrounding-linefeed");
1542        m.addShorthand(s_generics[PR_WHITE_SPACE]);
1543        addPropertyMaker("white-space-treatment", m);
1544
1545        // text-align TODO: make it a StringProperty with enums.
1546
m = new EnumProperty.Maker(PR_TEXT_ALIGN);
1547        m.setInherited(true);
1548        // Note: both 'end', 'right' and 'outside' are mapped to END
1549
// both 'start', 'left' and 'inside' are mapped to START
1550
m.addEnum("center", getEnumProperty(EN_CENTER, "CENTER"));
1551        m.addEnum("end", getEnumProperty(EN_END, "END"));
1552        m.addEnum("right", getEnumProperty(EN_END, "END"));
1553        m.addEnum("start", getEnumProperty(EN_START, "START"));
1554        m.addEnum("left", getEnumProperty(EN_START, "START"));
1555        m.addEnum("justify", getEnumProperty(EN_JUSTIFY, "JUSTIFY"));
1556        m.addEnum("inside", getEnumProperty(EN_START, "START"));
1557        m.addEnum("outside", getEnumProperty(EN_END, "END"));
1558        m.setDefault("start");
1559        addPropertyMaker("text-align", m);
1560
1561        // text-align-last
1562
m = new EnumProperty.Maker(PR_TEXT_ALIGN_LAST) {
1563            public Property get(int subpropId, PropertyList propertyList,
1564                    boolean bTryInherit, boolean bTryDefault) throws PropertyException {
1565                Property p = super.get(subpropId, propertyList, bTryInherit, bTryDefault);
1566                if (p != null && p.getEnum() == EN_RELATIVE) {
1567                    //The default may have been returned, so check inherited value
1568
p = propertyList.getNearestSpecified(PR_TEXT_ALIGN_LAST);
1569                    if (p.getEnum() == EN_RELATIVE) {
1570                        return calcRelative(propertyList);
1571                    }
1572                }
1573                return p;
1574            }
1575
1576            private Property calcRelative(PropertyList propertyList) throws PropertyException {
1577                Property corresponding = propertyList.get(PR_TEXT_ALIGN);
1578                if (corresponding == null) {
1579                    return null;
1580                }
1581                int correspondingValue = corresponding.getEnum();
1582                if (correspondingValue == EN_JUSTIFY) {
1583                    return getEnumProperty(EN_START, "START");
1584                } else if (correspondingValue == EN_END) {
1585                    return getEnumProperty(EN_END, "END");
1586                } else if (correspondingValue == EN_START) {
1587                    return getEnumProperty(EN_START, "START");
1588                } else if (correspondingValue == EN_CENTER) {
1589                    return getEnumProperty(EN_CENTER, "CENTER");
1590                } else {
1591                    return null;
1592                }
1593            }
1594        };
1595        m.setInherited(false); //Actually it's "true" but the special PropertyMaker compensates
1596
// Note: both 'end', 'right' and 'outside' are mapped to END
1597
// both 'start', 'left' and 'inside' are mapped to START
1598
m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE"));
1599        m.addEnum("center", getEnumProperty(EN_CENTER, "CENTER"));
1600        m.addEnum("end", getEnumProperty(EN_END, "END"));
1601        m.addEnum("right", getEnumProperty(EN_END, "END"));
1602        m.addEnum("start", getEnumProperty(EN_START, "START"));
1603        m.addEnum("left", getEnumProperty(EN_START, "START"));
1604        m.addEnum("justify", getEnumProperty(EN_JUSTIFY, "JUSTIFY"));
1605        m.addEnum("inside", getEnumProperty(EN_START, "START"));
1606        m.addEnum("outside", getEnumProperty(EN_END, "END"));
1607        m.setDefault("relative", true);
1608        addPropertyMaker("text-align-last", m);
1609
1610        // text-indent
1611
m = new LengthProperty.Maker(PR_TEXT_INDENT);
1612        m.setInherited(true);
1613        m.setDefault("0pt");
1614        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1615        addPropertyMaker("text-indent", m);
1616
1617        // white-space-collapse
1618
m = new EnumProperty.Maker(PR_WHITE_SPACE_COLLAPSE);
1619        m.useGeneric(genericBoolean);
1620        m.setInherited(true);
1621        m.setDefault("true");
1622        m.addShorthand(s_generics[PR_WHITE_SPACE]);
1623        addPropertyMaker("white-space-collapse", m);
1624
1625        // wrap-option
1626
m = new EnumProperty.Maker(PR_WRAP_OPTION);
1627        m.setInherited(true);
1628        m.addEnum("wrap", getEnumProperty(EN_WRAP, "WRAP"));
1629        m.addEnum("no-wrap", getEnumProperty(EN_NO_WRAP, "NO_WRAP"));
1630        m.setDefault("wrap");
1631        m.addShorthand(s_generics[PR_WHITE_SPACE]);
1632        addPropertyMaker("wrap-option", m);
1633    }
1634
1635    private void createCharacterProperties() {
1636        PropertyMaker m;
1637
1638        // character
1639
m = new CharacterProperty.Maker(PR_CHARACTER);
1640        m.setInherited(false);
1641        m.setDefault("none");
1642        addPropertyMaker("character", m);
1643
1644        // letter-spacing
1645
m = new SpacingPropertyMaker(PR_LETTER_SPACING);
1646        m.useGeneric(genericSpace);
1647        m.setInherited(true);
1648        m.getSubpropMaker(CP_PRECEDENCE).setDefault("force");
1649        m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
1650        m.setDefault("normal");
1651        m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
1652        addPropertyMaker("letter-spacing", m);
1653
1654        // suppress-at-line-break
1655
m = new EnumProperty.Maker(PR_SUPPRESS_AT_LINE_BREAK);
1656        m.setInherited(false);
1657        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1658        m.addEnum("suppress", getEnumProperty(EN_SUPPRESS, "SUPPRESS"));
1659        m.addEnum("retain", getEnumProperty(EN_RETAIN, "RETAIN"));
1660        m.setDefault("auto");
1661        addPropertyMaker("suppress-at-line-break", m);
1662
1663        // text-decoration
1664
//m = new EnumProperty.Maker(PR_TEXT_DECORATION);
1665
m = new TextDecorationProperty.Maker(PR_TEXT_DECORATION);
1666        m.setInherited(false);
1667        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1668        m.addEnum("underline", getEnumProperty(EN_UNDERLINE, "UNDERLINE"));
1669        m.addEnum("overline", getEnumProperty(EN_OVERLINE, "OVERLINE"));
1670        m.addEnum("line-through", getEnumProperty(EN_LINE_THROUGH, "LINE_THROUGH"));
1671        m.addEnum("blink", getEnumProperty(EN_BLINK, "BLINK"));
1672        m.addEnum("no-underline", getEnumProperty(EN_NO_UNDERLINE, "NO_UNDERLINE"));
1673        m.addEnum("no-overline", getEnumProperty(EN_NO_OVERLINE, "NO_OVERLINE"));
1674        m.addEnum("no-line-through", getEnumProperty(EN_NO_LINE_THROUGH, "NO_LINE_THROUGH"));
1675        m.addEnum("no-blink", getEnumProperty(EN_NO_BLINK, "NO_BLINK"));
1676        m.setDefault("none");
1677        addPropertyMaker("text-decoration", m);
1678
1679        // text-shadow
1680
m = new ToBeImplementedProperty.Maker(PR_TEXT_SHADOW);
1681        m.setInherited(false);
1682        m.setDefault("none");
1683        addPropertyMaker("text-shadow", m);
1684
1685        // text-transform
1686
m = new EnumProperty.Maker(PR_TEXT_TRANSFORM);
1687        m.setInherited(true);
1688        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1689        m.addEnum("capitalize", getEnumProperty(EN_CAPITALIZE, "CAPITALIZE"));
1690        m.addEnum("uppercase", getEnumProperty(EN_UPPERCASE, "UPPERCASE"));
1691        m.addEnum("lowercase", getEnumProperty(EN_LOWERCASE, "LOWERCASE"));
1692        m.setDefault("none");
1693        addPropertyMaker("text-transform", m);
1694
1695        // treat-as-word-space
1696
m = new EnumProperty.Maker(PR_TREAT_AS_WORD_SPACE);
1697        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1698        m.addEnum("true", getEnumProperty(EN_TRUE, "TRUE"));
1699        m.addEnum("false", getEnumProperty(EN_FALSE, "FALSE"));
1700        m.setInherited(false);
1701        m.setDefault("auto");
1702        addPropertyMaker("treat-as-word-space", m);
1703
1704        // word-spacing
1705
m = new SpacingPropertyMaker(PR_WORD_SPACING);
1706        m.useGeneric(genericSpace);
1707        m.setInherited(true);
1708        m.getSubpropMaker(CP_PRECEDENCE).setDefault("force");
1709        m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
1710        m.setDefault("normal");
1711        m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
1712        addPropertyMaker("word-spacing", m);
1713    }
1714
1715    private void createColorProperties() {
1716        PropertyMaker m;
1717
1718        // color
1719
m = new ColorProperty.Maker(PR_COLOR);
1720        m.useGeneric(genericColor);
1721        m.setInherited(true);
1722        m.setDefault("black");
1723        addPropertyMaker("color", m);
1724
1725        // color-profile-name
1726
m = new StringProperty.Maker(PR_COLOR_PROFILE_NAME);
1727        m.setInherited(false);
1728        m.setDefault("");
1729        addPropertyMaker("color-profile-name", m);
1730
1731        // rendering-intent
1732
m = new EnumProperty.Maker(PR_RENDERING_INTENT);
1733        m.setInherited(false);
1734        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1735        m.addEnum("perceptual", getEnumProperty(EN_PERCEPTUAL, "PERCEPTUAL"));
1736        m.addEnum("relative-colorimetric", getEnumProperty(EN_RELATIVE_COLOMETRIC, "RELATIVE_COLOMETRIC"));
1737        m.addEnum("saturation", getEnumProperty(EN_SATURATION, "SATURATION"));
1738        m.addEnum("absolute-colorimetric", getEnumProperty(EN_ABSOLUTE_COLORMETRIC, "ABSOLUTE_COLORMETRIC"));
1739        m.setDefault("auto");
1740        addPropertyMaker("rendering-intent", m);
1741    }
1742
1743    private void createFloatProperties() {
1744        PropertyMaker m;
1745
1746        // clear
1747
m = new EnumProperty.Maker(PR_CLEAR);
1748        m.setInherited(false);
1749        // Note that left -> start and right -> end.
1750
m.addEnum("start", getEnumProperty(EN_START, "START"));
1751        m.addEnum("end", getEnumProperty(EN_END, "END"));
1752        m.addEnum("left", getEnumProperty(EN_START, "START"));
1753        m.addEnum("right", getEnumProperty(EN_END, "END"));
1754        m.addEnum("both", getEnumProperty(EN_BOTH, "BOTH"));
1755        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1756        m.setDefault("none");
1757        addPropertyMaker("clear", m);
1758
1759        // float
1760
m = new EnumProperty.Maker(PR_FLOAT);
1761        m.setInherited(false);
1762        // Note that left -> start and right -> end.
1763
m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
1764        m.addEnum("start", getEnumProperty(EN_START, "START"));
1765        m.addEnum("end", getEnumProperty(EN_END, "END"));
1766        m.addEnum("left", getEnumProperty(EN_START, "START"));
1767        m.addEnum("right", getEnumProperty(EN_END, "END"));
1768        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1769        m.setDefault("none");
1770        addPropertyMaker("float", m);
1771
1772        // intrusion-displace
1773
m = new EnumProperty.Maker(PR_INTRUSION_DISPLACE);
1774        m.setInherited(false);
1775        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1776        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1777        m.addEnum("line", getEnumProperty(EN_LINE, "LINE"));
1778        m.addEnum("indent", getEnumProperty(EN_INDENT, "INDENT"));
1779        m.addEnum("block", getEnumProperty(EN_BLOCK, "BLOCK"));
1780        m.setDefault("none");
1781        addPropertyMaker("intrusion-displace", m);
1782    }
1783
1784    private void createKeepsAndBreaksProperties() {
1785        PropertyMaker m;
1786
1787        // break-after
1788
m = new EnumProperty.Maker(PR_BREAK_AFTER);
1789        m.useGeneric(genericBreak);
1790        m.addShorthand(s_generics[PR_PAGE_BREAK_AFTER]);
1791        addPropertyMaker("break-after", m);
1792
1793        // break-before
1794
m = new EnumProperty.Maker(PR_BREAK_BEFORE);
1795        m.useGeneric(genericBreak);
1796        m.addShorthand(s_generics[PR_PAGE_BREAK_BEFORE]);
1797        addPropertyMaker("break-before", m);
1798
1799        // keep-together
1800
m = new KeepProperty.Maker(PR_KEEP_TOGETHER);
1801        m.useGeneric(genericKeep);
1802        m.setInherited(false);
1803        m.setDefault("auto");
1804        m.addShorthand(s_generics[PR_PAGE_BREAK_INSIDE]);
1805        addPropertyMaker("keep-together", m);
1806
1807        // keep-with-next
1808
m = new KeepProperty.Maker(PR_KEEP_WITH_NEXT);
1809        m.useGeneric(genericKeep);
1810        m.setInherited(false);
1811        m.setDefault("auto");
1812        m.addShorthand(s_generics[PR_PAGE_BREAK_AFTER]);
1813        addPropertyMaker("keep-with-next", m);
1814
1815        // keep-with-previous
1816
m = new KeepProperty.Maker(PR_KEEP_WITH_PREVIOUS);
1817        m.useGeneric(genericKeep);
1818        m.setInherited(false);
1819        m.setDefault("auto");
1820        m.addShorthand(s_generics[PR_PAGE_BREAK_BEFORE]);
1821        addPropertyMaker("keep-with-previous", m);
1822
1823        // orphans
1824
m = new NumberProperty.Maker(PR_ORPHANS);
1825        m.setInherited(true);
1826        m.setDefault("2");
1827        addPropertyMaker("orphans", m);
1828
1829        // widows
1830
m = new NumberProperty.Maker(PR_WIDOWS);
1831        m.setInherited(true);
1832        m.setDefault("2");
1833        addPropertyMaker("widows", m);
1834        
1835        // fox:widow-content-limit
1836
m = new LengthProperty.Maker(PR_X_WIDOW_CONTENT_LIMIT);
1837        m.setInherited(true);
1838        m.setDefault("0pt");
1839        addPropertyMaker("fox:widow-content-limit", m);
1840
1841        // fox:orphan-content-limit
1842
m = new LengthProperty.Maker(PR_X_ORPHAN_CONTENT_LIMIT);
1843        m.setInherited(true);
1844        m.setDefault("0pt");
1845        addPropertyMaker("fox:orphan-content-limit", m);
1846    }
1847
1848    private void createLayoutProperties() {
1849        PropertyMaker m;
1850
1851        // clip
1852
m = new ToBeImplementedProperty.Maker(PR_CLIP);
1853        m.setInherited(false);
1854        m.setDefault("auto");
1855        addPropertyMaker("clip", m);
1856
1857        // overflow
1858
m = new EnumProperty.Maker(PR_OVERFLOW);
1859        m.setInherited(false);
1860        m.addEnum("visible", getEnumProperty(EN_VISIBLE, "VISIBLE"));
1861        m.addEnum("hidden", getEnumProperty(EN_HIDDEN, "HIDDEN"));
1862        m.addEnum("scroll", getEnumProperty(EN_SCROLL, "SCROLL"));
1863        m.addEnum("error-if-overflow", getEnumProperty(EN_ERROR_IF_OVERFLOW, "ERROR_IF_OVERFLOW"));
1864        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
1865        m.setDefault("auto");
1866        addPropertyMaker("overflow", m);
1867
1868        // reference-orientation
1869
m = new ReferenceOrientationMaker(PR_REFERENCE_ORIENTATION);
1870        m.setInherited(true);
1871        m.setDefault("0");
1872        addPropertyMaker("reference-orientation", m);
1873
1874        // span
1875
m = new EnumProperty.Maker(PR_SPAN);
1876        m.setInherited(false);
1877        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1878        m.addEnum("all", getEnumProperty(EN_ALL, "ALL"));
1879        m.setDefault("none");
1880        addPropertyMaker("span", m);
1881    }
1882
1883    private void createLeaderAndRuleProperties() {
1884        PropertyMaker m;
1885        PropertyMaker sub;
1886
1887        // leader-alignment
1888
m = new EnumProperty.Maker(PR_LEADER_ALIGNMENT);
1889        m.setInherited(true);
1890        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1891        m.addEnum("reference-area", getEnumProperty(EN_REFERENCE_AREA, "REFERENCE_AREA"));
1892        m.addEnum("page", getEnumProperty(EN_PAGE, "PAGE"));
1893        m.setDefault("none");
1894        addPropertyMaker("leader-alignment", m);
1895
1896        // leader-pattern
1897
m = new EnumProperty.Maker(PR_LEADER_PATTERN);
1898        m.setInherited(true);
1899        m.addEnum("space", getEnumProperty(EN_SPACE, "SPACE"));
1900        m.addEnum("rule", getEnumProperty(EN_RULE, "RULE"));
1901        m.addEnum("dots", getEnumProperty(EN_DOTS, "DOTS"));
1902        m.addEnum("use-content", getEnumProperty(EN_USECONTENT, "USECONTENT"));
1903        m.setDefault("space");
1904        addPropertyMaker("leader-pattern", m);
1905
1906        // leader-pattern-width
1907
m = new LengthProperty.Maker(PR_LEADER_PATTERN_WIDTH);
1908        m.setInherited(true);
1909        m.setDefault("use-font-metrics", true);
1910        m.addKeyword("use-font-metrics", "0pt");
1911        m.setPercentBase(LengthBase.PARENT_AREA_WIDTH);
1912        addPropertyMaker("leader-pattern-width", m);
1913
1914        // leader-length
1915
m = new LengthRangeProperty.Maker(PR_LEADER_LENGTH);
1916        m.setInherited(true);
1917        m.setPercentBase(LengthBase.PARENT_AREA_WIDTH);
1918
1919        sub = new LengthProperty.Maker(CP_MINIMUM);
1920        sub.setDefault("0pt");
1921        sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1922        sub.setByShorthand(true);
1923        m.addSubpropMaker(sub);
1924
1925        sub = new LengthProperty.Maker(CP_OPTIMUM);
1926        sub.setDefault("12.0pt");
1927        sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1928        sub.setByShorthand(true);
1929        m.addSubpropMaker(sub);
1930
1931        sub = new LengthProperty.Maker(CP_MAXIMUM);
1932        sub.setDefault("100%", true);
1933        sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
1934        sub.setByShorthand(true);
1935        m.addSubpropMaker(sub);
1936        addPropertyMaker("leader-length", m);
1937
1938        // rule-style
1939
m = new EnumProperty.Maker(PR_RULE_STYLE);
1940        m.setInherited(true);
1941        m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
1942        m.addEnum("dotted", getEnumProperty(EN_DOTTED, "DOTTED"));
1943        m.addEnum("dashed", getEnumProperty(EN_DASHED, "DASHED"));
1944        m.addEnum("solid", getEnumProperty(EN_SOLID, "SOLID"));
1945        m.addEnum("double", getEnumProperty(EN_DOUBLE, "DOUBLE"));
1946        m.addEnum("groove", getEnumProperty(EN_GROOVE, "GROOVE"));
1947        m.addEnum("ridge", getEnumProperty(EN_RIDGE, "RIDGE"));
1948        m.setDefault("solid");
1949        addPropertyMaker("rule-style", m);
1950
1951        // rule-thickness
1952
m = new LengthProperty.Maker(PR_RULE_THICKNESS);
1953        m.setInherited(true);
1954        m.setDefault("1.0pt");
1955        addPropertyMaker("rule-thickness", m);
1956    }
1957
1958    private void createDynamicProperties() {
1959        PropertyMaker m;
1960
1961        // active-state
1962
m = new ToBeImplementedProperty.Maker(PR_ACTIVE_STATE);
1963        m.setInherited(false);
1964        m.setDefault("");
1965        addPropertyMaker("active-state", m);
1966
1967        // auto-restore
1968
m = new ToBeImplementedProperty.Maker(PR_AUTO_RESTORE);
1969        m.setInherited(true);
1970        m.setDefault("false");
1971        addPropertyMaker("auto-restore", m);
1972
1973        // case-name
1974
m = new ToBeImplementedProperty.Maker(PR_CASE_NAME);
1975        m.setInherited(false);
1976        m.setDefault("");
1977        addPropertyMaker("case-name", m);
1978
1979        // case-title
1980
m = new ToBeImplementedProperty.Maker(PR_CASE_TITLE);
1981        m.setInherited(false);
1982        m.setDefault("");
1983        addPropertyMaker("case-title", m);
1984
1985        // destination-placement-offset
1986
m = new ToBeImplementedProperty.Maker(PR_DESTINATION_PLACEMENT_OFFSET);
1987        m.setInherited(false);
1988        m.setDefault("0pt");
1989        addPropertyMaker("destination-placement-offset", m);
1990
1991        // external-destination
1992
m = new StringProperty.Maker(PR_EXTERNAL_DESTINATION);
1993        m.setInherited(false);
1994        m.setDefault("");
1995        addPropertyMaker("external-destination", m);
1996
1997        // indicate-destination
1998
m = new ToBeImplementedProperty.Maker(PR_INDICATE_DESTINATION);
1999        m.setInherited(false);
2000        m.setDefault("false");
2001        addPropertyMaker("indicate-destination", m);
2002
2003        // internal-destination
2004
m = new StringProperty.Maker(PR_INTERNAL_DESTINATION);
2005        m.setInherited(false);
2006        m.setDefault("");
2007        addPropertyMaker("internal-destination", m);
2008
2009        // show-destination
2010
m = new ToBeImplementedProperty.Maker(PR_SHOW_DESTINATION);
2011        m.setInherited(false);
2012        m.setDefault("replace");
2013        addPropertyMaker("show-destination", m);
2014
2015        // starting-state
2016
m = new EnumProperty.Maker(PR_STARTING_STATE);
2017        m.setInherited(false);
2018        m.addEnum("show", getEnumProperty(EN_SHOW, "SHOW"));
2019        m.addEnum("hide", getEnumProperty(EN_HIDE, "HIDE"));
2020        m.setDefault("show");
2021        addPropertyMaker("starting-state", m);
2022
2023        // switch-to
2024
m = new ToBeImplementedProperty.Maker(PR_SWITCH_TO);
2025        m.setInherited(false);
2026        m.setDefault("xsl-any");
2027        addPropertyMaker("switch-to", m);
2028
2029        // target-presentation-context
2030
m = new ToBeImplementedProperty.Maker(PR_TARGET_PRESENTATION_CONTEXT);
2031        m.setInherited(false);
2032        m.setDefault("use-target-processing-context");
2033        addPropertyMaker("target-presentation-context", m);
2034
2035        // target-processing-context
2036
m = new ToBeImplementedProperty.Maker(PR_TARGET_PROCESSING_CONTEXT);
2037        m.setInherited(false);
2038        m.setDefault("document-root");
2039        addPropertyMaker("target-processing-context", m);
2040
2041        // target-stylesheet
2042
m = new ToBeImplementedProperty.Maker(PR_TARGET_STYLESHEET);
2043        m.setInherited(false);
2044        m.setDefault("use-normal-stylesheet");
2045        addPropertyMaker("target-stylesheet", m);
2046    }
2047
2048    private void createMarkersProperties() {
2049        PropertyMaker m;
2050
2051        // marker-class-name
2052
m = new StringProperty.Maker(PR_MARKER_CLASS_NAME);
2053        m.setInherited(false);
2054        m.setDefault("");
2055        addPropertyMaker("marker-class-name", m);
2056
2057        // retrieve-class-name
2058
m = new StringProperty.Maker(PR_RETRIEVE_CLASS_NAME);
2059        m.setInherited(false);
2060        m.setDefault("");
2061        addPropertyMaker("retrieve-class-name", m);
2062
2063        // retrieve-position
2064
m = new EnumProperty.Maker(PR_RETRIEVE_POSITION);
2065        m.setInherited(false);
2066        m.addEnum("first-starting-within-page", getEnumProperty(EN_FSWP, "FSWP"));
2067        m.addEnum("first-including-carryover", getEnumProperty(EN_FIC, "FIC"));
2068        m.addEnum("last-starting-within-page", getEnumProperty(EN_LSWP, "LSWP"));
2069        m.addEnum("last-ending-within-page", getEnumProperty(EN_LEWP, "LEWP"));
2070        m.setDefault("first-starting-within-page");
2071        addPropertyMaker("retrieve-position", m);
2072
2073        // retrieve-boundary
2074
m = new EnumProperty.Maker(PR_RETRIEVE_BOUNDARY);
2075        m.setInherited(false);
2076        m.addEnum("page", getEnumProperty(EN_PAGE, "PAGE"));
2077        m.addEnum("page-sequence", getEnumProperty(EN_PAGE_SEQUENCE, "PAGE_SEQUENCE"));
2078        m.addEnum("document", getEnumProperty(EN_DOCUMENT, "DOCUMENT"));
2079        m.setDefault("page-sequence");
2080        addPropertyMaker("retrieve-boundary", m);
2081    }
2082
2083    private void createNumberToStringProperties() {
2084        PropertyMaker m;
2085
2086        // format
2087
m = new StringProperty.Maker(PR_FORMAT);
2088        m.setInherited(false);
2089        m.setDefault("1");
2090        addPropertyMaker("format", m);
2091
2092        // grouping-separator
2093
m = new CharacterProperty.Maker(PR_GROUPING_SEPARATOR);
2094        m.setInherited(false);
2095        m.setDefault("none");
2096        addPropertyMaker("grouping-separator", m);
2097
2098        // grouping-size
2099
m = new NumberProperty.Maker(PR_GROUPING_SIZE);
2100        m.setInherited(false);
2101        m.setDefault("0");
2102        addPropertyMaker("grouping-size", m);
2103
2104        // letter-value
2105
m = new EnumProperty.Maker(PR_LETTER_VALUE);
2106        m.setInherited(false);
2107        m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
2108        m.addEnum("traditional", getEnumProperty(EN_TRADITIONAL, "TRADITIONAL"));
2109        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2110        m.setDefault("auto");
2111        addPropertyMaker("letter-value", m);
2112    }
2113
2114    private void createPaginationAndLayoutProperties() {
2115        PropertyMaker m;
2116        LengthProperty.Maker l;
2117
2118        // blank-or-not-blank
2119
m = new EnumProperty.Maker(PR_BLANK_OR_NOT_BLANK);
2120        m.setInherited(false);
2121        m.addEnum("blank", getEnumProperty(EN_BLANK, "BLANK"));
2122        m.addEnum("not-blank", getEnumProperty(EN_NOT_BLANK, "NOT_BLANK"));
2123        m.addEnum("any", getEnumProperty(EN_ANY, "ANY"));
2124        m.setDefault("any");
2125        addPropertyMaker("blank-or-not-blank", m);
2126
2127        // column-count
2128
m = new NumberProperty.Maker(PR_COLUMN_COUNT);
2129        m.setInherited(false);
2130        m.setDefault("1");
2131        addPropertyMaker("column-count", m);
2132
2133        // column-gap
2134
l = new LengthProperty.Maker(PR_COLUMN_GAP);
2135        l.setInherited(false);
2136        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2137        l.setDefault("0.25in");
2138        addPropertyMaker("column-gap", l);
2139
2140        // extent
2141
m = new LengthProperty.Maker(PR_EXTENT);
2142        m.setInherited(true);
2143        m.setDefault("0pt");
2144        m.setPercentBase(LengthBase.CUSTOM_BASE);
2145        addPropertyMaker("extent", m);
2146
2147        // flow-name
2148
m = new StringProperty.Maker(PR_FLOW_NAME);
2149        m.setInherited(false);
2150        m.setDefault("");
2151        addPropertyMaker("flow-name", m);
2152
2153        // force-page-count
2154
m = new EnumProperty.Maker(PR_FORCE_PAGE_COUNT);
2155        m.setInherited(false);
2156        m.addEnum("even", getEnumProperty(EN_EVEN, "EVEN"));
2157        m.addEnum("odd", getEnumProperty(EN_ODD, "ODD"));
2158        m.addEnum("end-on-even", getEnumProperty(EN_END_ON_EVEN, "END_ON_EVEN"));
2159        m.addEnum("end-on-odd", getEnumProperty(EN_END_ON_ODD, "END_ON_ODD"));
2160        m.addEnum("no-force", getEnumProperty(EN_NO_FORCE, "NO_FORCE"));
2161        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2162        m.setDefault("auto");
2163        addPropertyMaker("force-page-count", m);
2164
2165        // initial-page-number
2166
m = new NumberProperty.Maker(PR_INITIAL_PAGE_NUMBER);
2167        m.setInherited(false);
2168        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2169        m.addEnum("auto-odd", getEnumProperty(EN_AUTO_ODD, "AUTO_ODD"));
2170        m.addEnum("auto-even", getEnumProperty(EN_AUTO_EVEN, "AUTO_EVEN"));
2171        m.setDefault("auto");
2172        addPropertyMaker("initial-page-number", m);
2173
2174        // master-name
2175
m = new StringProperty.Maker(PR_MASTER_NAME);
2176        m.setInherited(false);
2177        m.setDefault("");
2178        addPropertyMaker("master-name", m);
2179
2180        // master-reference
2181
m = new StringProperty.Maker(PR_MASTER_REFERENCE);
2182        m.setInherited(false);
2183        m.setDefault("");
2184        addPropertyMaker("master-reference", m);
2185
2186        // maximum-repeats
2187
m = new NumberProperty.Maker(PR_MAXIMUM_REPEATS);
2188        m.setInherited(false);
2189        m.addEnum("no-limit", getEnumProperty(EN_NO_LIMIT, "NO_LIMIT"));
2190        m.setDefault("no-limit");
2191        addPropertyMaker("maximum-repeats", m);
2192
2193        // media-usage
2194
m = new EnumProperty.Maker(PR_MEDIA_USAGE);
2195        m.setInherited(false);
2196        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2197        m.addEnum("paginate", getEnumProperty(EN_PAGINATE, "PAGINATE"));
2198        m.addEnum("bounded-in-one-dimension", getEnumProperty(EN_BOUNDED_IN_ONE_DIMENSION, "BOUNDED_IN_ONE_DIMENSION"));
2199        m.addEnum("unbounded", getEnumProperty(EN_UNBOUNDED, "UNBOUNDED"));
2200        m.setDefault("auto");
2201        addPropertyMaker("media-usage", m);
2202
2203        // odd-or-even
2204
m = new EnumProperty.Maker(PR_ODD_OR_EVEN);
2205        m.setInherited(false);
2206        m.addEnum("odd", getEnumProperty(EN_ODD, "ODD"));
2207        m.addEnum("even", getEnumProperty(EN_EVEN, "EVEN"));
2208        m.addEnum("any", getEnumProperty(EN_ANY, "ANY"));
2209        m.setDefault("any");
2210        addPropertyMaker("odd-or-even", m);
2211
2212        // page-height
2213
l = new PageDimensionMaker(PR_PAGE_HEIGHT);
2214        l.setInherited(false);
2215        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2216        l.addEnum("indefinite", getEnumProperty(EN_INDEFINITE, "INDEFINITE"));
2217        l.setDefault("auto");
2218        addPropertyMaker("page-height", l);
2219
2220        // page-position
2221
m = new EnumProperty.Maker(PR_PAGE_POSITION);
2222        m.setInherited(false);
2223        m.addEnum("first", getEnumProperty(EN_FIRST, "FIRST"));
2224        m.addEnum("last", getEnumProperty(EN_LAST, "LAST"));
2225        m.addEnum("rest", getEnumProperty(EN_REST, "REST"));
2226        m.addEnum("any", getEnumProperty(EN_ANY, "ANY"));
2227        m.setDefault("any");
2228        addPropertyMaker("page-position", m);
2229
2230        // page-width
2231
l = new PageDimensionMaker(PR_PAGE_WIDTH);
2232        l.setInherited(false);
2233        l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2234        l.addEnum("indefinite", getEnumProperty(EN_INDEFINITE, "INDEFINITE"));
2235        l.setDefault("auto");
2236        addPropertyMaker("page-width", l);
2237
2238        // precedence
2239
m = new EnumProperty.Maker(PR_PRECEDENCE);
2240        m.setInherited(false);
2241        m.addEnum("true", getEnumProperty(EN_TRUE, "TRUE"));
2242        m.addEnum("false", getEnumProperty(EN_FALSE, "FALSE"));
2243        m.setDefault("false");
2244        addPropertyMaker("precedence", m);
2245
2246        // region-name
2247
m = new StringProperty.Maker(PR_REGION_NAME);
2248        m.setInherited(false);
2249        m.setDefault("");
2250        addPropertyMaker("region-name", m);
2251    }
2252
2253    private void createTableProperties() {
2254        PropertyMaker m;
2255        PropertyMaker sub;
2256
2257        // border-after-precedence
2258
m = new TableBorderPrecedence(PR_BORDER_AFTER_PRECEDENCE);
2259        m.setInherited(false);
2260        m.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
2261        addPropertyMaker("border-after-precedence", m);
2262
2263        // border-before-precedence
2264
m = new TableBorderPrecedence(PR_BORDER_BEFORE_PRECEDENCE);
2265        m.setInherited(false);
2266        m.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
2267        addPropertyMaker("border-before-precedence", m);
2268
2269        // border-collapse
2270
m = new EnumProperty.Maker(PR_BORDER_COLLAPSE);
2271        m.setInherited(true);
2272        m.setDefault("collapse");
2273        m.addEnum("separate", getEnumProperty(EN_SEPARATE, "SEPARATE"));
2274        m.addEnum("collapse-with-precedence", getEnumProperty(
2275                EN_COLLAPSE_WITH_PRECEDENCE, "COLLAPSE_WITH_PRECEDENCE"));
2276        m.addEnum("collapse", getEnumProperty(EN_COLLAPSE, "COLLAPSE"));
2277        addPropertyMaker("border-collapse", m);
2278
2279        // border-end-precedence
2280
m = new TableBorderPrecedence(PR_BORDER_END_PRECEDENCE);
2281        m.setInherited(false);
2282        m.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
2283        addPropertyMaker("border-end-precedence", m);
2284
2285        // border-separation
2286
m = new LengthPairProperty.Maker(PR_BORDER_SEPARATION);
2287        m.setInherited(true);
2288        m.addShorthand(s_generics[PR_BORDER_SPACING]);
2289
2290        sub = new LengthProperty.Maker(CP_BLOCK_PROGRESSION_DIRECTION);
2291        sub.setDefault("0pt");
2292        sub.setByShorthand(true);
2293        m.addSubpropMaker(sub);
2294
2295        sub = new LengthProperty.Maker(CP_INLINE_PROGRESSION_DIRECTION);
2296        sub.setDefault("0pt");
2297        sub.setByShorthand(true);
2298        m.addSubpropMaker(sub);
2299        addPropertyMaker("border-separation", m);
2300
2301        // border-start-precedence
2302
m = new TableBorderPrecedence(PR_BORDER_START_PRECEDENCE);
2303        m.setInherited(false);
2304        m.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
2305        addPropertyMaker("border-start-precedence", m);
2306
2307        // caption-side
2308
m = new EnumProperty.Maker(PR_CAPTION_SIDE);
2309        m.setInherited(true);
2310        m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
2311        m.addEnum("after", getEnumProperty(EN_AFTER, "AFTER"));
2312        m.addEnum("start", getEnumProperty(EN_START, "START"));
2313        m.addEnum("end", getEnumProperty(EN_END, "END"));
2314        m.addEnum("top", getEnumProperty(EN_TOP, "TOP"));
2315        m.addEnum("bottom", getEnumProperty(EN_BOTTOM, "BOTTOM"));
2316        m.addEnum("left", getEnumProperty(EN_LEFT, "LEFT"));
2317        m.addEnum("right", getEnumProperty(EN_RIGHT, "RIGHT"));
2318        m.setDefault("before");
2319        addPropertyMaker("caption-side", m);
2320
2321        // column-number
2322
m = new ColumnNumberPropertyMaker(PR_COLUMN_NUMBER);
2323        m.setInherited(false);
2324        addPropertyMaker("column-number", m);
2325
2326        // column-width
2327
m = new LengthProperty.Maker(PR_COLUMN_WIDTH);
2328        m.setInherited(false);
2329        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2330        m.setDefault("auto");
2331        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
2332        addPropertyMaker("column-width", m);
2333
2334        // empty-cells
2335
m = new EnumProperty.Maker(PR_EMPTY_CELLS);
2336        m.setInherited(true);
2337        m.addEnum("show", getEnumProperty(EN_SHOW, "SHOW"));
2338        m.addEnum("hide", getEnumProperty(EN_HIDE, "HIDE"));
2339        m.setDefault("show");
2340        addPropertyMaker("empty-cells", m);
2341
2342        // ends-row
2343
m = new EnumProperty.Maker(PR_ENDS_ROW);
2344        m.setInherited(false);
2345        m.useGeneric(genericBoolean);
2346        m.setDefault("false");
2347        addPropertyMaker("ends-row", m);
2348
2349        // number-columns-repeated
2350
m = new NumberProperty.Maker(PR_NUMBER_COLUMNS_REPEATED);
2351        m.setInherited(false);
2352        m.setDefault("1");
2353        addPropertyMaker("number-columns-repeated", m);
2354
2355        // number-columns-spanned
2356
m = new NumberProperty.Maker(PR_NUMBER_COLUMNS_SPANNED);
2357        m.setInherited(false);
2358        m.setDefault("1");
2359        addPropertyMaker("number-columns-spanned", m);
2360
2361        // number-rows-spanned
2362
m = new NumberProperty.Maker(PR_NUMBER_ROWS_SPANNED);
2363        m.setInherited(false);
2364        m.setDefault("1");
2365        addPropertyMaker("number-rows-spanned", m);
2366
2367        // starts-row
2368
m = new EnumProperty.Maker(PR_STARTS_ROW);
2369        m.useGeneric(genericBoolean);
2370        m.setInherited(false);
2371        m.setDefault("false");
2372        addPropertyMaker("starts-row", m);
2373
2374        // table-layout
2375
m = new EnumProperty.Maker(PR_TABLE_LAYOUT);
2376        m.setInherited(false);
2377        m.setDefault("auto");
2378        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2379        m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED"));
2380        addPropertyMaker("table-layout", m);
2381
2382        // table-omit-footer-at-break
2383
m = new EnumProperty.Maker(PR_TABLE_OMIT_FOOTER_AT_BREAK);
2384        m.useGeneric(genericBoolean);
2385        m.setInherited(false);
2386        m.setDefault("false");
2387        addPropertyMaker("table-omit-footer-at-break", m);
2388
2389        // table-omit-header-at-break
2390
m = new EnumProperty.Maker(PR_TABLE_OMIT_HEADER_AT_BREAK);
2391        m.useGeneric(genericBoolean);
2392        m.setInherited(false);
2393        m.setDefault("false");
2394        addPropertyMaker("table-omit-header-at-break", m);
2395    }
2396
2397    private void createWritingModeProperties() {
2398        PropertyMaker m;
2399
2400        // direction
2401
m = new EnumProperty.Maker(PR_DIRECTION);
2402        m.setInherited(true);
2403        m.addEnum("ltr", getEnumProperty(EN_LTR, "LTR"));
2404        m.addEnum("rtl", getEnumProperty(EN_RTL, "RTL"));
2405        m.setDefault("ltr");
2406        addPropertyMaker("direction", m);
2407
2408        // glyph-orientation-horizontal
2409
m = new ToBeImplementedProperty.Maker(PR_GLYPH_ORIENTATION_HORIZONTAL);
2410        m.setInherited(true);
2411        m.setDefault("0deg");
2412        addPropertyMaker("glyph-orientation-horizontal", m);
2413
2414        // glyph-orientation-vertical
2415
m = new ToBeImplementedProperty.Maker(PR_GLYPH_ORIENTATION_VERTICAL);
2416        m.setInherited(true);
2417        m.setDefault("auto");
2418        addPropertyMaker("glyph-orientation-vertical", m);
2419
2420        // text-altitude
2421
m = new LengthProperty.Maker(PR_TEXT_ALTITUDE);
2422        m.setInherited(false);
2423        m.addEnum("use-font-metrics", getEnumProperty(EN_USE_FONT_METRICS, "USE_FONT_METRICS"));
2424        m.setDefault("use-font-metrics");
2425        m.setPercentBase(LengthBase.FONTSIZE);
2426        addPropertyMaker("text-altitude", m);
2427
2428        // text-depth
2429
m = new LengthProperty.Maker(PR_TEXT_DEPTH);
2430        m.setInherited(false);
2431        m.addEnum("use-font-metrics", getEnumProperty(EN_USE_FONT_METRICS, "USE_FONT_METRICS"));
2432        m.setDefault("use-font-metrics");
2433        m.setPercentBase(LengthBase.FONTSIZE);
2434        addPropertyMaker("text-depth", m);
2435
2436        // unicode-bidi
2437
m = new EnumProperty.Maker(PR_UNICODE_BIDI);
2438        m.setInherited(false);
2439        m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
2440        m.addEnum("embed", getEnumProperty(EN_EMBED, "EMBED"));
2441        m.addEnum("bidi-override", getEnumProperty(EN_BIDI_OVERRIDE, "BIDI_OVERRIDE"));
2442        m.setDefault("normal");
2443        addPropertyMaker("unicode-bidi", m);
2444
2445        // writing-mode
2446
m = new EnumProperty.Maker(PR_WRITING_MODE);
2447        m.setInherited(true);
2448        m.setDefault("lr-tb");
2449        m.addEnum("lr-tb", getEnumProperty(EN_LR_TB, "LR_TB"));
2450        m.addEnum("rl-tb", getEnumProperty(EN_RL_TB, "RL_TB"));
2451        m.addEnum("tb-rl", getEnumProperty(EN_TB_RL, "TB_RL"));
2452        m.addKeyword("lr", "lr-tb");
2453        m.addKeyword("rl", "rl-tb");
2454        m.addKeyword("tb", "tb-rl");
2455        addPropertyMaker("writing-mode", m);
2456    }
2457
2458    private void createMiscProperties() {
2459        PropertyMaker m;
2460
2461        // content-type
2462
m = new StringProperty.Maker(PR_CONTENT_TYPE);
2463        m.setInherited(false);
2464        m.setDefault("auto");
2465        addPropertyMaker("content-type", m);
2466
2467        // id
2468
m = new StringProperty.Maker(PR_ID);
2469        m.setInherited(false);
2470        m.setDefault("");
2471        addPropertyMaker("id", m);
2472
2473        // provisional-label-separation
2474
m = new LengthProperty.Maker(PR_PROVISIONAL_LABEL_SEPARATION);
2475        m.setInherited(true);
2476        m.setDefault("6pt");
2477        addPropertyMaker("provisional-label-separation", m);
2478
2479        // provisional-distance-between-starts
2480
m = new LengthProperty.Maker(PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS);
2481        m.setInherited(true);
2482        m.setDefault("24pt");
2483        addPropertyMaker("provisional-distance-between-starts", m);
2484
2485        // ref-id
2486
m = new StringProperty.Maker(PR_REF_ID);
2487        m.setInherited(false);
2488        m.setDefault("");
2489        addPropertyMaker("ref-id", m);
2490
2491        // score-spaces
2492
m = new EnumProperty.Maker(PR_SCORE_SPACES);
2493        m.useGeneric(genericBoolean);
2494        m.setInherited(true);
2495        m.setDefault("true");
2496        addPropertyMaker("score-spaces", m);
2497
2498        // src
2499
m = new StringProperty.Maker(PR_SRC);
2500        m.setInherited(false);
2501        m.setDefault("");
2502        addPropertyMaker("src", m);
2503
2504        // visibility
2505
m = new EnumProperty.Maker(PR_VISIBILITY);
2506        m.setInherited(false);
2507        m.addEnum("visible", getEnumProperty(EN_VISIBLE, "VISIBLE"));
2508        m.addEnum("hidden", getEnumProperty(EN_HIDDEN, "HIDDEN"));
2509        m.addEnum("collapse", getEnumProperty(EN_COLLAPSE, "COLLAPSE"));
2510        m.setDefault("visible");
2511        addPropertyMaker("visibility", m);
2512
2513        // z-index
2514
m = new NumberProperty.Maker(PR_Z_INDEX);
2515        m.setInherited(false);
2516        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2517        m.setDefault("auto");
2518        addPropertyMaker("z-index", m);
2519    }
2520
2521    private void createShorthandProperties() {
2522        PropertyMaker m;
2523
2524        // background
2525
m = new ToBeImplementedProperty.Maker(PR_BACKGROUND);
2526        m.setInherited(false);
2527        m.setDefault("none");
2528        addPropertyMaker("background", m);
2529
2530        // background-position
2531
m = new ListProperty.Maker(PR_BACKGROUND_POSITION);
2532        m.setInherited(false);
2533        m.addKeyword("left", "0% 50%");
2534        m.addKeyword("right", "100% 50%");
2535        m.addKeyword("center", "50% 50%");
2536        m.addKeyword("top", "50% 0%");
2537        m.addKeyword("bottom", "50% 100%");
2538        m.setDefault("0% 0%");
2539        m.setDatatypeParser(new BackgroundPositionShorthandParser());
2540        addPropertyMaker("background-position", m);
2541
2542        // border
2543
m = new ListProperty.Maker(PR_BORDER);
2544        m.setInherited(false);
2545        m.setDefault("");
2546        m.setDatatypeParser(new GenericShorthandParser());
2547        addPropertyMaker("border", m);
2548
2549        // border-bottom
2550
m = new ListProperty.Maker(PR_BORDER_BOTTOM);
2551        m.setInherited(false);
2552        m.setDefault("");
2553        m.setDatatypeParser(new GenericShorthandParser());
2554        addPropertyMaker("border-bottom", m);
2555
2556        // border-color
2557
m = new ListProperty.Maker(PR_BORDER_COLOR);
2558        m.setInherited(false);
2559        m.setDefault("");
2560        m.setDatatypeParser(new BoxPropShorthandParser());
2561        addPropertyMaker("border-color", m);
2562
2563        // border-left
2564
m = new ListProperty.Maker(PR_BORDER_LEFT);
2565        m.setInherited(false);
2566        m.setDefault("");
2567        m.setDatatypeParser(new GenericShorthandParser());
2568        addPropertyMaker("border-left", m);
2569
2570        // border-right
2571
m = new ListProperty.Maker(PR_BORDER_RIGHT);
2572        m.setInherited(false);
2573        m.setDefault("");
2574        m.setDatatypeParser(new GenericShorthandParser());
2575        addPropertyMaker("border-right", m);
2576
2577        // border-style
2578
m = new ListProperty.Maker(PR_BORDER_STYLE);
2579        m.setInherited(false);
2580        m.setDefault("");
2581        m.setDatatypeParser(new BoxPropShorthandParser());
2582        addPropertyMaker("border-style", m);
2583
2584        // border-spacing
2585
m = new ListProperty.Maker(PR_BORDER_SPACING);
2586        m.setInherited(true);
2587        m.setDefault("0pt");
2588        m.setDatatypeParser(new BorderSpacingShorthandParser());
2589        addPropertyMaker("border-spacing", m);
2590
2591        // border-top
2592
m = new ListProperty.Maker(PR_BORDER_TOP);
2593        m.setInherited(false);
2594        m.setDefault("");
2595        m.setDatatypeParser(new GenericShorthandParser());
2596        addPropertyMaker("border-top", m);
2597
2598        // border-width
2599
m = new ListProperty.Maker(PR_BORDER_WIDTH);
2600        m.setInherited(false);
2601        m.setDefault("");
2602        m.setDatatypeParser(new BoxPropShorthandParser());
2603        addPropertyMaker("border-width", m);
2604
2605        // cue
2606
m = new ToBeImplementedProperty.Maker(PR_CUE);
2607        m.setInherited(false);
2608        m.setDefault("");
2609        addPropertyMaker("cue", m);
2610
2611        // font
2612
m = new FontShorthandProperty.Maker(PR_FONT);
2613        m.setInherited(true);
2614        m.addEnum("caption", getEnumProperty(EN_CAPTION, "CAPTION"));
2615        m.addEnum("icon", getEnumProperty(EN_ICON, "ICON"));
2616        m.addEnum("message-box", getEnumProperty(EN_MESSAGE_BOX, "MESSAGE_BOX"));
2617        m.addEnum("menu", getEnumProperty(EN_MENU, "MENU"));
2618        m.addEnum("small-caption", getEnumProperty(EN_SMALL_CAPTION, "SMALL_CAPTION"));
2619        m.addEnum("status-bar", getEnumProperty(EN_STATUS_BAR, "STATUS_BAR"));
2620        m.setDefault("");
2621        m.setDatatypeParser(new FontShorthandParser());
2622        addPropertyMaker("font", m);
2623
2624        // margin
2625
m = new ListProperty.Maker(PR_MARGIN);
2626        m.setInherited(false);
2627        m.setDefault("");
2628        m.setDatatypeParser(new BoxPropShorthandParser());
2629        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
2630        addPropertyMaker("margin", m);
2631
2632        // padding
2633
m = new ListProperty.Maker(PR_PADDING);
2634        m.setInherited(false);
2635        m.setDatatypeParser(new BoxPropShorthandParser());
2636        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
2637        addPropertyMaker("padding", m);
2638
2639        // page-break-after
2640
m = new EnumProperty.Maker(PR_PAGE_BREAK_AFTER);
2641        m.setInherited(false);
2642        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2643        m.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
2644        m.addEnum("avoid", getEnumProperty(EN_AVOID, "AVOID"));
2645        m.addEnum("left", getEnumProperty(EN_LEFT, "LEFT"));
2646        m.addEnum("right", getEnumProperty(EN_RIGHT, "RIGHT"));
2647        m.setDefault("auto");
2648        m.setDatatypeParser(new PageBreakShorthandParser());
2649        addPropertyMaker("page-break-after", m);
2650
2651        // page-break-before
2652
m = new EnumProperty.Maker(PR_PAGE_BREAK_BEFORE);
2653        m.setInherited(false);
2654        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2655        m.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
2656        m.addEnum("avoid", getEnumProperty(EN_AVOID, "AVOID"));
2657        m.addEnum("left", getEnumProperty(EN_LEFT, "LEFT"));
2658        m.addEnum("right", getEnumProperty(EN_RIGHT, "RIGHT"));
2659        m.setDefault("auto");
2660        m.setDatatypeParser(new PageBreakShorthandParser());
2661        addPropertyMaker("page-break-before", m);
2662
2663        // page-break-inside
2664
m = new EnumProperty.Maker(PR_PAGE_BREAK_INSIDE);
2665        m.setInherited(true);
2666        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
2667        m.addEnum("avoid", getEnumProperty(EN_AVOID, "AVOID"));
2668        m.setDefault("auto");
2669        m.setDatatypeParser(new PageBreakShorthandParser());
2670        addPropertyMaker("page-break-inside", m);
2671
2672        // pause
2673
m = new ToBeImplementedProperty.Maker(PR_PAUSE);
2674        m.setInherited(false);
2675        m.setDefault("");
2676        addPropertyMaker("pause", m);
2677
2678        // position
2679
m = new EnumProperty.Maker(PR_POSITION);
2680        m.setInherited(false);
2681        m.addEnum("static", getEnumProperty(EN_STATIC, "STATIC"));
2682        m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE"));
2683        m.addEnum("absolute", getEnumProperty(EN_ABSOLUTE, "ABSOLUTE"));
2684        m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED"));
2685        m.setDefault("static");
2686        m.setDatatypeParser(new PositionShorthandParser());
2687        addPropertyMaker("position", m);
2688
2689        // size
2690
m = new ToBeImplementedProperty.Maker(PR_SIZE);
2691        m.setInherited(false);
2692        m.setDefault("auto");
2693        addPropertyMaker("size", m);
2694
2695        // vertical-align
2696
m = new LengthProperty.Maker(PR_VERTICAL_ALIGN);
2697        m.setInherited(false);
2698        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
2699        m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
2700        m.addEnum("sub", getEnumProperty(EN_SUB, "SUB"));
2701        m.addEnum("super", getEnumProperty(EN_SUPER, "SUPER"));
2702        m.addEnum("text-top", getEnumProperty(EN_TEXT_TOP, "TEXT_TOP"));
2703        m.addEnum("text-bottom", getEnumProperty(EN_TEXT_BOTTOM, "TEXT_BOTTOM"));
2704        m.addEnum("top", getEnumProperty(EN_TOP, "TOP"));
2705        m.addEnum("bottom", getEnumProperty(EN_BOTTOM, "BOTTOM"));
2706        m.setDatatypeParser(new VerticalAlignShorthandParser());
2707        m.setDefault("baseline");
2708        m.setPercentBase(LengthBase.ALIGNMENT_ADJUST);
2709        addPropertyMaker("vertical-align", m);
2710
2711        // white-space
2712
m = new EnumProperty.Maker(PR_WHITE_SPACE);
2713        m.setInherited(true);
2714        m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
2715        m.addEnum("pre", getEnumProperty(EN_PRE, "PRE"));
2716        m.addEnum("nowrap", getEnumProperty(EN_NO_WRAP, "NO_WRAP"));
2717        m.setDefault("normal");
2718        m.setDatatypeParser(new WhiteSpaceShorthandParser());
2719        addPropertyMaker("white-space", m);
2720        
2721        // xml:lang
2722
m = new ToBeImplementedProperty.Maker(PR_XML_LANG);
2723        m.setInherited(true);
2724        m.setDefault("");
2725        addPropertyMaker("xml:lang", m);
2726
2727       }
2728
2729}
2730
Popular Tags