Revision: 13002
http://sourceforge.net/p/foray/code/13002
Author: victormote
Date: 2023-01-02 14:48:23 +0000 (Mon, 02 Jan 2023)
Log Message:
-----------
Rename PropertyCollection to PvShorthandSubproperties, for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/package-info.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PvShorthandSubproperties.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtColor;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.value.AbsoluteCompass;
@@ -72,7 +72,7 @@
* @throws PropertyException For an invalid property value.
*/
private PropertyValue createPropertyValue(final String value) throws PropertyException {
- PropertyCollection collection = null;
+ PvShorthandSubproperties collection = null;
/*
* Must handle inherit specially, because it essentially propogates
* to style, width, and color.
@@ -81,7 +81,7 @@
final PdBorderStyle borderStyle = new PdBorderStyle("inherit");
final PdBorderWidth borderWidth = new PdBorderWidth("inherit");
final PdBorderColor borderColor = new PdBorderColor("inherit");
- collection = new PropertyCollection();
+ collection = new PvShorthandSubproperties();
collection.addItem(borderStyle);
collection.addItem(borderWidth);
collection.addItem(borderColor);
@@ -94,7 +94,7 @@
throw unexpectedValue(value);
}
if (collection == null) {
- collection = new PropertyCollection();
+ collection = new PvShorthandSubproperties();
}
collection.addItem(property);
}
@@ -146,10 +146,10 @@
* @return The border-style component of this compound property.
*/
public AbstractBorderStyle getBorderStyle() {
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return null;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
final Property property = collection.findProperty(
FoPropertyId.BORDER_STYLE);
if (property instanceof AbstractBorderStyle) {
@@ -163,10 +163,10 @@
* @return The border-width component of this compound property.
*/
public AbstractBorderWidth getBorderWidth() {
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return null;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
final Property property = collection.findProperty(
FoPropertyId.BORDER_WIDTH);
if (property instanceof AbstractBorderWidth) {
@@ -180,10 +180,10 @@
* @return The border-color component of this compound property.
*/
public AbstractBorderColor getBorderColor() {
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return null;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
final Property property = collection.findProperty(
FoPropertyId.BORDER_COLOR);
if (property instanceof AbstractBorderColor) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -34,8 +34,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtUri;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.fotree.FoContext;
@@ -108,7 +108,7 @@
if (st.countTokens() != 1 && st.countTokens() != 2) {
throw unexpectedValue(value);
}
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
while (st.hasMoreTokens()) {
final PropertyValue pv = createPropertyValue(st.nextToken());
final PdCue cueProperty = new PdCue(pv);
@@ -169,10 +169,10 @@
* @return The value of this property.
*/
public URL getShorthandValue(final FoContext context, final FoObj fobj, final FoPropertyId propertyType) {
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return null;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
int index = -1;
switch (propertyType) {
case CUE_BEFORE: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -36,8 +36,8 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtPercentage;
import org.foray.fotree.value.DtTime;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.fotree.FoContext;
@@ -111,7 +111,7 @@
if (pv != null) {
return pv;
}
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
final StringTokenizer st = new StringTokenizer(value);
if (st.countTokens() < 1 || st.countTokens() > 2) {
throw unexpectedValue(value);
@@ -219,10 +219,10 @@
}
}
}
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return 0;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
int index = -1;
switch (propertyType) {
case PAUSE_BEFORE: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -37,8 +37,8 @@
import org.foray.fotree.value.DtColor;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtPercentage;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import java.util.ArrayList;
import java.util.List;
@@ -79,7 +79,7 @@
*/
private PropertyValue createPropertyValue(final String propertyFullName, final String value)
throws PropertyException {
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
collection.addItem(new PdBackgroundColor(pv));
@@ -228,7 +228,7 @@
* @return The background-color component of this compound property.
*/
public PdBackgroundColor getColor() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundColor) collection.findProperty(
FoPropertyId.BACKGROUND_COLOR);
}
@@ -238,7 +238,7 @@
* @return The background-image component of this compound property.
*/
public PdBackgroundImage getImage() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundImage) collection.findProperty(
FoPropertyId.BACKGROUND_IMAGE);
}
@@ -248,7 +248,7 @@
* @return The background-repeat component of this compound property.
*/
public PdBackgroundRepeat getRepeat() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundRepeat) collection.findProperty(
FoPropertyId.BACKGROUND_REPEAT);
}
@@ -258,7 +258,7 @@
* @return The background-attachment component of this compound property.
*/
public PdBackgroundAttachment getAttachment() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundAttachment) collection.findProperty(
FoPropertyId.BACKGROUND_ATTACHMENT);
}
@@ -268,7 +268,7 @@
* @return The background-position component of this compound property.
*/
public PdBackgroundPosition getPosition() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundPosition) collection.findProperty(
FoPropertyId.BACKGROUND_POSITION);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -37,8 +37,8 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtPercentage;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
@@ -89,7 +89,7 @@
* @throws PropertyException For an invalid property value.
*/
private PropertyValue createShorthandValue(final String value) throws PropertyException {
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
final PdBackgroundPosition property =
@@ -249,7 +249,7 @@
public int getShorthandValue(final FoContext context, final FoObj fobj,
final AbsoluteAxis axis, final int paddingRectangleDimension,
final int backgroundImageDimension) {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
final PdBackgroundPosition bpProperty =
(PdBackgroundPosition) collection
.getItem(0);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -33,8 +33,8 @@
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.fotree.FoContext;
@@ -154,7 +154,7 @@
private Color getCollectionValue(final RelativeCompass direction,
final FoObj fobj, final FoContext context) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue insideProperty = collection.getItem(whichElement);
return insideProperty.evalColor();
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtBorderStyle;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.fotree.FoContext;
@@ -152,7 +152,7 @@
private org.axsl.value.BorderStyle getCollectionValue(
final FoContext context, final Compass direction, final FoObj fobj) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue insideValue = collection.getItem(whichElement);
final DtBorderStyle borderStyleProperty = (DtBorderStyle)
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -36,8 +36,8 @@
import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtBorderWidth;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.fotree.FoContext;
@@ -144,7 +144,7 @@
private int getCollectionValue(final FoContext context,
final RelativeCompass direction, final FoObj fobj) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue value = collection.getItem(whichElement);
if (value.canEvalLength()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtPercentage;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import java.util.ArrayList;
import java.util.List;
@@ -85,7 +85,7 @@
*/
private PropertyValue createPropertyValue(final String propertyFullName, final String value)
throws PropertyException {
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
collection.addItem(new PdFontStyle(pv));
@@ -250,7 +250,7 @@
* @return The "font-style" component from this compound property.
*/
public PdFontStyle getStyle() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontStyle) collection.findProperty(FoPropertyId.FONT_STYLE);
}
@@ -259,7 +259,7 @@
* @return The "font-variant" component from this compound property.
*/
public PdFontVariant getVariant() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontVariant) collection.findProperty(
FoPropertyId.FONT_VARIANT);
}
@@ -269,7 +269,7 @@
* @return The "font-weight" component from this compound property.
*/
public PdFontWeight getWeight() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontWeight) collection.findProperty(
FoPropertyId.FONT_WEIGHT);
}
@@ -279,7 +279,7 @@
* @return The "font-size" component from this compound property.
*/
public PdFontSize getSize() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontSize) collection.findProperty(FoPropertyId.FONT_SIZE);
}
@@ -288,7 +288,7 @@
* @return The "line-height" component from this compound property.
*/
public PdLineHeight getLineHeight() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdLineHeight) collection.findProperty(
FoPropertyId.LINE_HEIGHT);
}
@@ -298,7 +298,7 @@
* @return The "font-family" component from this compound property.
*/
public PdFontFamily getFamily() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontFamily) collection.findProperty(
FoPropertyId.FONT_FAMILY);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -34,8 +34,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.fo.obj.SimplePageMaster4a;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.constants.NumericConstants;
@@ -126,7 +126,7 @@
private int getCollectionValue(final FoContext context,
final AbsoluteCompass direction, final FoObj fobj) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue value = collection.getItem(whichElement);
if (value.canEvalPercentage()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -34,8 +34,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.fo.obj.SimplePageMaster4a;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.constants.NumericConstants;
@@ -126,7 +126,7 @@
private int getCollectionValue(final FoContext context,
final AbsoluteCompass direction, final FoObj fobj) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue value = collection.getItem(whichElement);
if (value.canEvalPercentage()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtLength;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
@@ -93,7 +93,7 @@
if (st.countTokens() < 1 || st.countTokens() > 2) {
throw unexpectedValue(value);
}
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
while (st.hasMoreTokens()) {
final String token = st.nextToken();
final DtLength length = DtLength.procureInstance(token);
@@ -115,9 +115,9 @@
*/
public int getValue(final FoContext context, final FoObj fobj,
final AbsoluteAxis axis) {
- if (value() instanceof PropertyCollection) {
- final PropertyCollection collection =
- (PropertyCollection) value();
+ if (value() instanceof PvShorthandSubproperties) {
+ final PvShorthandSubproperties collection =
+ (PvShorthandSubproperties) value();
if (collection.getCount() < 1) {
return getValueNoInstance(axis);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/package-info.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/package-info.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/package-info.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -27,10 +27,9 @@
*/
/**
- * <p>Classes representing XSL-FO properties (See Section 7 of the XSL-FO 1.0 Standard).</p>
- *
- * <p>The classes in this package that represent concrete FO properties are named with "Pd" at the beginning of the
- * class name, meaning "property description", to distinguish them from the property value enumerations in aXSL.</p>
+ * <p>Classes representing XSL-FO properties.</p>
+ * @see "XSL-FO Recommendation 1.0, Section 7."
+ * @see "XSL-FO Recommendation 1.1, Section 7."
*/
package org.foray.fotree.fo.prop;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -30,6 +30,17 @@
* <p>Classes for parsing and representing the XSL-FO document input objects and properties in the various
* namespaces.</p>
*
+ * <p>Abbreviations used in foray-fotree:</p>
+ * <ul>
+ * <li>Types whose names begin with "Dt" are XSL-FO data types.</li>
+ * <li>Types whose names begin with "Expr" are XSL-FO expressions.</li>
+ * <li>Types whose names begin with "Fn" are XSL-FO functions.</li>
+ * <li>Types whose names begin with "Pv" are property value types.</li>
+ * <li>Types whose names begin with "Pd" are property descriptor types. They serve as conceptual (but not actual)
+ * concrete implementations of property interfaces in aXSL, but are actually helper classes to the property/trait
+ * resolution process whose root is in {@link FoObj}.</li>
+ * </ul>
+ *
* <p>Design considerations:</p>
* <ul>
* <li>The FO Tree faces two directions. First, it faces the incoming document. The guiding document for this process
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -1,213 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.value;
-
-import org.foray.fotree.Property;
-import org.foray.fotree.fo.FoPropertyId;
-
-import org.axsl.value.AbsoluteCompass;
-import org.axsl.value.Compass;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This class is odd because it is a <em>PropertyValue</em> subclass that
- * encapsulates one or more <em>Property</em> instances. It is useful for
- * properties like "border-style" which can contain 1, 2, 3 or 4 values,
- * and which must be wrapped up and unwrapped in some orderly way.
- */
-public class PropertyCollection implements PropertyValue {
-
- /** Constant indicating that this collection contains one property. */
- private static final byte SIZE_1 = 1;
-
- /** Constant indicating that this collection contains two properties. */
- private static final byte SIZE_2 = 2;
-
- /** Constant indicating that this collection contains three properties. */
- private static final byte SIZE_3 = 3;
-
- /** Constant indicating that this collection contains four properties. */
- private static final byte SIZE_4 = 4;
-
- /** Constant indicating that the number of properties in this collection
- * does not allow conversion into a specific property value based on a
- * directional constant. */
- private static final byte INDEX_INVALID = -1;
-
- /** Constant indicating that the first (index 0) item in the collection is
- * the one requested. */
- private static final byte INDEX_0 = 0;
-
- /** Constant indicating that the second (index 1) item in the collection is
- * the one requested. */
- private static final byte INDEX_1 = 1;
-
- /** Constant indicating that the third (index 2) item in the collection is
- * the one requested. */
- private static final byte INDEX_2 = 2;
-
- /** Constant indicating that the fourth (index 3) item in the collection is
- * the one requested. */
- private static final byte INDEX_3 = 3;
-
- /**
- * Contains the collection of Properties that are stored in this
- * PropertyValue.
- */
- private List<Property> value = new ArrayList<Property>();
-
- /**
- * Constructor.
- */
- public PropertyCollection() {
- }
-
- /**
- * Add an item to the collection.
- * @param property The property to add to the collection.
- */
- public void addItem(final Property property) {
- this.value.add(property);
- }
-
- /**
- * Returns the list of properties in this collection.
- * @return The list of properties in this collection.
- */
- public List<Property> getValue() {
- return this.value;
- }
-
- /**
- * Returns the number of items in this collection.
- * @return The number of items in this collection.
- */
- public int getCount() {
- return this.value.size();
- }
-
- /**
- * Returns a specific property from the collection.
- * @param index The index to the property needed.
- * @return The property at index.
- */
- public Property getItem(final int index) {
- if (index < 0 || index >= this.value.size()) {
- return null;
- }
- final Object object = this.value.get(index);
- return (Property) object;
- }
-
- /**
- * Determines which of the elements in this PropertyCollection should be
- * used for the given direction that is supplied. From the XSL-FO Standard
- * 1.0, Section 7.29.11:
- *
- * <p>"If there is only one value, it applies to all sides. If there are
- * two values, the top and bottom borders are set to the first value and
- * the right and left are set to the second. If there are three values, the
- * top is set to the first value, the left and right are set to the second,
- * and the bottom is set to the third. If there are four values, they apply
- * to the top, right, bottom, and left, respectively."</p>
- *
- * @param direction One of the integral direction identifiers (e.g.
- * ABSOLUTE_DIR_LEFT).
- * @param size The number of elements that exist in the collection.
- * @return The index (starts at 0) to the appropriate element to use for
- * the direction given.
- */
- public static byte whichElementForDirectional(final Compass direction,
- final int size) {
- switch (size) {
- case PropertyCollection.SIZE_1: {
- return PropertyCollection.INDEX_0;
- }
- case PropertyCollection.SIZE_2: {
- if (direction == AbsoluteCompass.TOP
- || direction == AbsoluteCompass.BOTTOM) {
- return PropertyCollection.INDEX_0;
- }
- if (direction == AbsoluteCompass.LEFT
- || direction == AbsoluteCompass.RIGHT) {
- return PropertyCollection.INDEX_1;
- }
- return PropertyCollection.INDEX_INVALID;
- }
- case PropertyCollection.SIZE_3: {
- if (direction == AbsoluteCompass.TOP) {
- return PropertyCollection.INDEX_0;
- }
- if (direction == AbsoluteCompass.LEFT
- || direction == AbsoluteCompass.RIGHT) {
- return PropertyCollection.INDEX_1;
- }
- if (direction == AbsoluteCompass.BOTTOM) {
- return PropertyCollection.INDEX_2;
- }
- return PropertyCollection.INDEX_INVALID;
- }
- case PropertyCollection.SIZE_4: {
- if (direction == AbsoluteCompass.TOP) {
- return PropertyCollection.INDEX_0;
- }
- if (direction == AbsoluteCompass.RIGHT) {
- return PropertyCollection.INDEX_1;
- }
- if (direction == AbsoluteCompass.BOTTOM) {
- return PropertyCollection.INDEX_2;
- }
- if (direction == AbsoluteCompass.LEFT) {
- return PropertyCollection.INDEX_3;
- }
- return PropertyCollection.INDEX_INVALID;
- }
- }
- return PropertyCollection.INDEX_INVALID;
- }
-
- /**
- * Returns the first occurrence of a Property in the collection that is of
- * the type propertyType.
- * @param propertyType The propertyType which is being sought.
- * @return The first Property matching propertyType, or null if none is
- * found.
- */
- public Property findProperty(final FoPropertyId propertyType) {
- for (Property property : this.value) {
- if (property.getPropertyType() == propertyType) {
- return property;
- }
- }
- return null;
- }
-
-}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PvShorthandSubproperties.java (from rev 12987, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PvShorthandSubproperties.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PvShorthandSubproperties.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.value;
+
+import org.foray.fotree.Property;
+import org.foray.fotree.fo.FoPropertyId;
+
+import org.axsl.value.AbsoluteCompass;
+import org.axsl.value.Compass;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class is odd because it is a <em>PropertyValue</em> subclass that
+ * encapsulates one or more <em>Property</em> instances. It is useful for
+ * properties like "border-style" which can contain 1, 2, 3 or 4 values,
+ * and which must be wrapped up and unwrapped in some orderly way.
+ */
+public class PvShorthandSubproperties implements PropertyValue {
+
+ /** Constant indicating that this collection contains one property. */
+ private static final byte SIZE_1 = 1;
+
+ /** Constant indicating that this collection contains two properties. */
+ private static final byte SIZE_2 = 2;
+
+ /** Constant indicating that this collection contains three properties. */
+ private static final byte SIZE_3 = 3;
+
+ /** Constant indicating that this collection contains four properties. */
+ private static final byte SIZE_4 = 4;
+
+ /** Constant indicating that the number of properties in this collection
+ * does not allow conversion into a specific property value based on a
+ * directional constant. */
+ private static final byte INDEX_INVALID = -1;
+
+ /** Constant indicating that the first (index 0) item in the collection is
+ * the one requested. */
+ private static final byte INDEX_0 = 0;
+
+ /** Constant indicating that the second (index 1) item in the collection is
+ * the one requested. */
+ private static final byte INDEX_1 = 1;
+
+ /** Constant indicating that the third (index 2) item in the collection is
+ * the one requested. */
+ private static final byte INDEX_2 = 2;
+
+ /** Constant indicating that the fourth (index 3) item in the collection is
+ * the one requested. */
+ private static final byte INDEX_3 = 3;
+
+ /**
+ * Contains the collection of Properties that are stored in this
+ * PropertyValue.
+ */
+ private List<Property> value = new ArrayList<Property>();
+
+ /**
+ * Constructor.
+ */
+ public PvShorthandSubproperties() {
+ }
+
+ /**
+ * Add an item to the collection.
+ * @param property The property to add to the collection.
+ */
+ public void addItem(final Property property) {
+ this.value.add(property);
+ }
+
+ /**
+ * Returns the list of properties in this collection.
+ * @return The list of properties in this collection.
+ */
+ public List<Property> getValue() {
+ return this.value;
+ }
+
+ /**
+ * Returns the number of items in this collection.
+ * @return The number of items in this collection.
+ */
+ public int getCount() {
+ return this.value.size();
+ }
+
+ /**
+ * Returns a specific property from the collection.
+ * @param index The index to the property needed.
+ * @return The property at index.
+ */
+ public Property getItem(final int index) {
+ if (index < 0 || index >= this.value.size()) {
+ return null;
+ }
+ final Object object = this.value.get(index);
+ return (Property) object;
+ }
+
+ /**
+ * Determines which of the elements in this PropertyCollection should be
+ * used for the given direction that is supplied. From the XSL-FO Standard
+ * 1.0, Section 7.29.11:
+ *
+ * <p>"If there is only one value, it applies to all sides. If there are
+ * two values, the top and bottom borders are set to the first value and
+ * the right and left are set to the second. If there are three values, the
+ * top is set to the first value, the left and right are set to the second,
+ * and the bottom is set to the third. If there are four values, they apply
+ * to the top, right, bottom, and left, respectively."</p>
+ *
+ * @param direction One of the integral direction identifiers (e.g.
+ * ABSOLUTE_DIR_LEFT).
+ * @param size The number of elements that exist in the collection.
+ * @return The index (starts at 0) to the appropriate element to use for
+ * the direction given.
+ */
+ public static byte whichElementForDirectional(final Compass direction,
+ final int size) {
+ switch (size) {
+ case PvShorthandSubproperties.SIZE_1: {
+ return PvShorthandSubproperties.INDEX_0;
+ }
+ case PvShorthandSubproperties.SIZE_2: {
+ if (direction == AbsoluteCompass.TOP
+ || direction == AbsoluteCompass.BOTTOM) {
+ return PvShorthandSubproperties.INDEX_0;
+ }
+ if (direction == AbsoluteCompass.LEFT
+ || direction == AbsoluteCompass.RIGHT) {
+ return PvShorthandSubproperties.INDEX_1;
+ }
+ return PvShorthandSubproperties.INDEX_INVALID;
+ }
+ case PvShorthandSubproperties.SIZE_3: {
+ if (direction == AbsoluteCompass.TOP) {
+ return PvShorthandSubproperties.INDEX_0;
+ }
+ if (direction == AbsoluteCompass.LEFT
+ || direction == AbsoluteCompass.RIGHT) {
+ return PvShorthandSubproperties.INDEX_1;
+ }
+ if (direction == AbsoluteCompass.BOTTOM) {
+ return PvShorthandSubproperties.INDEX_2;
+ }
+ return PvShorthandSubproperties.INDEX_INVALID;
+ }
+ case PvShorthandSubproperties.SIZE_4: {
+ if (direction == AbsoluteCompass.TOP) {
+ return PvShorthandSubproperties.INDEX_0;
+ }
+ if (direction == AbsoluteCompass.RIGHT) {
+ return PvShorthandSubproperties.INDEX_1;
+ }
+ if (direction == AbsoluteCompass.BOTTOM) {
+ return PvShorthandSubproperties.INDEX_2;
+ }
+ if (direction == AbsoluteCompass.LEFT) {
+ return PvShorthandSubproperties.INDEX_3;
+ }
+ return PvShorthandSubproperties.INDEX_INVALID;
+ }
+ }
+ return PvShorthandSubproperties.INDEX_INVALID;
+ }
+
+ /**
+ * Returns the first occurrence of a Property in the collection that is of
+ * the type propertyType.
+ * @param propertyType The propertyType which is being sought.
+ * @return The first Property matching propertyType, or null if none is
+ * found.
+ */
+ public Property findProperty(final FoPropertyId propertyType) {
+ for (Property property : this.value) {
+ if (property.getPropertyType() == propertyType) {
+ return property;
+ }
+ }
+ return null;
+ }
+
+}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.prop.PdCountry;
import org.foray.fotree.fo.prop.PdLanguage;
import org.foray.fotree.fo.prop.PdScript;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.xml.AbstractXmlProperty;
import org.foray.fotree.xml.XmlPropertyId;
@@ -70,7 +70,7 @@
*/
private PropertyValue createPropertyValue(final String value)
throws PropertyException {
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
collection.addItem(new PdCountry(pv));
@@ -172,7 +172,7 @@
* embedded.
*/
public PdCountry getCountry() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdCountry) collection.findProperty(FoPropertyId.COUNTRY);
}
@@ -182,7 +182,7 @@
* embedded.
*/
public PdLanguage getLanguage() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdLanguage) collection.findProperty(FoPropertyId.LANGUAGE);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|