You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2004/05/30 08:20:44 UTC
cvs commit: xml-fop/src/java/org/apache/fop/fo/properties Language.java Country.java
pbwest 2004/05/29 23:20:44
Modified: src/java/org/apache/fop/fo/properties Tag:
FOP_0-20-0_Alt-Design Language.java Country.java
Log:
Added getInitialValue() and constructor with initial value
Revision Changes Path
No revision
No revision
1.1.2.4 +24 -2 xml-fop/src/java/org/apache/fop/fo/properties/Attic/Language.java
Index: Language.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/Attic/Language.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- Language.java 19 Feb 2004 03:11:40 -0000 1.1.2.3
+++ Language.java 30 May 2004 06:20:44 -0000 1.1.2.4
@@ -20,6 +20,13 @@
*/
package org.apache.fop.fo.properties;
+import java.util.Locale;
+
+import org.apache.fop.datatypes.LanguageType;
+import org.apache.fop.datatypes.PropertyValue;
+import org.apache.fop.fo.PropNames;
+import org.apache.fop.fo.expr.PropertyException;
+
public class Language extends Property {
public static final int dataTypes = LANGUAGE_T | NONE | INHERIT;
@@ -34,7 +41,7 @@
return traitMapping;
}
- public static final int initialValueType = NONE_IT;
+ public static final int initialValueType = LANGUAGE_IT;
public int getInitialValueType() {
return initialValueType;
@@ -44,6 +51,21 @@
public int getInherited() {
return inherited;
+ }
+ private LanguageType initialValue;
+
+ public PropertyValue getInitialValue(int propindex)
+ throws PropertyException {
+ if (propindex != PropNames.COUNTRY) {
+ throw new PropertyException(
+ "Called in Language with property other than 'language'");
+ }
+ return initialValue;
+ }
+
+ public Language() throws PropertyException {
+ initialValue = new LanguageType(
+ PropNames.COUNTRY, Locale.getDefault().getLanguage());
}
}
1.1.2.4 +24 -2 xml-fop/src/java/org/apache/fop/fo/properties/Attic/Country.java
Index: Country.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/Attic/Country.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- Country.java 19 Feb 2004 03:11:40 -0000 1.1.2.3
+++ Country.java 30 May 2004 06:20:44 -0000 1.1.2.4
@@ -20,6 +20,13 @@
*/
package org.apache.fop.fo.properties;
+import java.util.Locale;
+
+import org.apache.fop.datatypes.CountryType;
+import org.apache.fop.datatypes.PropertyValue;
+import org.apache.fop.fo.PropNames;
+import org.apache.fop.fo.expr.PropertyException;
+
public class Country extends Property {
public static final int dataTypes = COUNTRY_T | NONE | INHERIT;
@@ -34,7 +41,7 @@
return traitMapping;
}
- public static final int initialValueType = NONE_IT;
+ public static final int initialValueType = COUNTRY_IT;
public int getInitialValueType() {
return initialValueType;
@@ -46,5 +53,20 @@
return inherited;
}
+ private CountryType initialValue;
+
+ public PropertyValue getInitialValue(int propindex)
+ throws PropertyException {
+ if (propindex != PropNames.COUNTRY) {
+ throw new PropertyException(
+ "Called in Country with property other than 'country'");
+ }
+ return initialValue;
+ }
+
+ public Country() throws PropertyException {
+ initialValue = new CountryType(
+ PropNames.COUNTRY, Locale.getDefault().getCountry());
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org