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 je...@apache.org on 2008/07/25 14:46:22 UTC
svn commit: r679781 [11/34] - in
/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign: ./
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ ...
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/CondLengthProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/CondLengthProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/CondLengthProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -31,14 +31,14 @@
* Superclass for properties that have conditional lengths
*/
public class CondLengthProperty extends Property implements CompoundDatatype {
-
+
/** cache holding canonical instances (for absolute conditional lengths) */
private static final PropertyCache cache = new PropertyCache(CondLengthProperty.class);
-
+
/** components */
private Property length;
private EnumProperty conditionality;
-
+
private boolean isCached = false;
private int hash = -1;
@@ -56,7 +56,7 @@
/**
* Create a new empty instance of CondLengthProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new CondLengthProperty();
@@ -64,7 +64,7 @@
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof KeepProperty) {
@@ -75,7 +75,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -83,7 +83,7 @@
throw new IllegalStateException(
"CondLengthProperty.setComponent() called on a cached value!");
}
-
+
if (cmpId == CP_LENGTH) {
length = cmpnValue;
} else if (cmpId == CP_CONDITIONALITY) {
@@ -147,11 +147,11 @@
/** {@inheritDoc} */
public String toString() {
- return "CondLength[" + length.getObject().toString()
- + ", " + (isDiscard()
- ? conditionality.toString().toLowerCase()
+ return "CondLength[" + length.getObject().toString()
+ + ", " + (isDiscard()
+ ? conditionality.toString().toLowerCase()
: conditionality.toString()) + "]";
- }
+ }
/**
* @return this.condLength
@@ -188,7 +188,7 @@
if (this == obj) {
return true;
}
-
+
if (obj instanceof CondLengthProperty) {
CondLengthProperty clp = (CondLengthProperty)obj;
return (this.length == clp.length
@@ -196,7 +196,7 @@
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == -1) {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -33,19 +33,19 @@
protected int tb_rl;
protected boolean useParent;
private boolean relative;
-
+
public CorrespondingPropertyMaker(PropertyMaker baseMaker) {
this.baseMaker = baseMaker;
baseMaker.setCorresponding(this);
}
-
-
+
+
public void setCorresponding(int lr_tb, int rl_tb, int tb_rl) {
this.lr_tb = lr_tb;
this.rl_tb = rl_tb;
this.tb_rl = tb_rl;
}
-
+
/**
* Controls whether the PropertyMaker accesses the parent property list or the current
* property list for determining the writing mode.
@@ -58,7 +58,7 @@
public void setRelative(boolean relative) {
this.relative = relative;
}
-
+
/**
* For properties that operate on a relative direction (before, after,
* start, end) instead of an absolute direction (top, bottom, left,
@@ -80,18 +80,18 @@
if (!relative) {
return false;
}
-
+
PropertyList pList = getWMPropertyList(propertyList);
if (pList != null) {
int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
-
+
if (pList.getExplicit(correspondingId) != null) {
return true;
}
- }
+ }
return false;
}
-
+
/**
* Return a Property object representing the value of this property,
* based on other property values for this FO.
@@ -108,7 +108,7 @@
return null;
}
int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
-
+
Property p = propertyList.getExplicitOrShorthand(correspondingId);
if (p != null) {
FObj parentFO = propertyList.getParentFObj();
@@ -116,7 +116,7 @@
}
return p;
}
-
+
/**
* Return the property list to use for fetching writing mode depending property
* ids.
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -35,7 +35,7 @@
public DimensionPropertyMaker(PropertyMaker baseMaker) {
super(baseMaker);
}
-
+
public void setExtraCorresponding(int[][] extraCorresponding) {
this.extraCorresponding = extraCorresponding;
}
@@ -47,7 +47,7 @@
int wmcorr = extraCorresponding[i][0]; //propertyList.getWritingMode()];
if (propertyList.getExplicit(wmcorr) != null)
return true;
- }
+ }
return false;
}
@@ -59,8 +59,8 @@
}
// Based on min-[width|height]
- int wmcorr = propertyList.getWritingMode(extraCorresponding[0][0],
- extraCorresponding[0][1],
+ int wmcorr = propertyList.getWritingMode(extraCorresponding[0][0],
+ extraCorresponding[0][1],
extraCorresponding[0][2]);
Property subprop = propertyList.getExplicitOrShorthand(wmcorr);
if (subprop != null) {
@@ -68,8 +68,8 @@
}
// Based on max-[width|height]
- wmcorr = propertyList.getWritingMode(extraCorresponding[1][0],
- extraCorresponding[1][1],
+ wmcorr = propertyList.getWritingMode(extraCorresponding[1][0],
+ extraCorresponding[1][1],
extraCorresponding[1][2]);
subprop = propertyList.getExplicitOrShorthand(wmcorr);
// TODO: Don't set when NONE.
@@ -78,5 +78,5 @@
}
return p;
- }
+ }
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumLength.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumLength.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumLength.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumLength.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.properties;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -26,7 +26,7 @@
*/
public class EnumLength extends LengthProperty {
private Property enumProperty;
-
+
public EnumLength(Property enumProperty) {
this.enumProperty = enumProperty;
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumNumber.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumNumber.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumNumber.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumNumber.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.properties;
import org.apache.fop.datatypes.Numeric;
@@ -32,7 +32,7 @@
private static final PropertyCache cache = new PropertyCache(EnumNumber.class);
private final EnumProperty enumProperty;
-
+
/**
* Constructor
* @param enumProperty the base EnumProperty
@@ -44,7 +44,7 @@
/**
* Returns the canonical EnumNumber instance corresponding
* to the given Property
- *
+ *
* @param enumProperty the base EnumProperty
* @return the canonical instance
*/
@@ -87,16 +87,16 @@
return 0;
}
- /**
+ /**
* {@inheritDoc}
* Always <code>true</code> for instances of this type
*/
public boolean isAbsolute() {
return true;
}
-
- /**
- * {@inheritDoc}
+
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public double getNumericValue(PercentBaseContext context) throws PropertyException {
@@ -104,8 +104,8 @@
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public int getValue(PercentBaseContext context) {
@@ -113,8 +113,8 @@
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public int getValue() {
@@ -122,8 +122,8 @@
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public double getNumericValue() {
@@ -131,7 +131,7 @@
return 0;
}
- /**
+ /**
* {@inheritDoc}
*/
public Numeric getNumeric() {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/EnumProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -27,7 +27,7 @@
* Superclass for properties that wrap an enumeration value
*/
public final class EnumProperty extends Property {
-
+
/** cache holding all canonical EnumProperty instances */
private static final PropertyCache cache = new PropertyCache(EnumProperty.class);
@@ -102,7 +102,7 @@
public boolean equals(Object obj) {
if (obj instanceof EnumProperty) {
EnumProperty ep = (EnumProperty)obj;
- return (ep.value == this.value)
+ return (ep.value == this.value)
&& ((ep.text == this.text)
|| (ep.text != null
&& ep.text.equals(this.text)));
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FixedLength.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FixedLength.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FixedLength.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FixedLength.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -25,7 +25,7 @@
* An absolute length quantity in XSL
*/
public final class FixedLength extends LengthProperty {
-
+
/** Describes the unit pica. */
public static final String PICA = "pc";
@@ -46,16 +46,16 @@
/** cache holding all canonical FixedLength instances */
private static final PropertyCache cache = new PropertyCache(FixedLength.class);
-
+
/** canonical zero-length instance */
public static final FixedLength ZERO_FIXED_LENGTH = new FixedLength(0, FixedLength.MPT, 1.0f);
-
+
private int millipoints;
/**
* Set the length given a number of units, a unit name and
* an assumed resolution (used in case the units are pixels)
- *
+ *
* @param numUnits quantity of input units
* @param units input unit specifier
* @param res input/source resolution
@@ -63,11 +63,11 @@
private FixedLength(double numUnits, String units, float res) {
this.millipoints = convert(numUnits, units, res);
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value in base-units (millipoints).
- *
+ *
* @param numUnits quantity of input units
* @param units input unit specifier
* @param sourceResolution input/source resolution (= ratio of pixels per pt)
@@ -75,7 +75,7 @@
* to the given number of units and unit specifier
* in the given resolution
*/
- public static FixedLength getInstance(double numUnits,
+ public static FixedLength getInstance(double numUnits,
String units,
float sourceResolution) {
if (numUnits == 0.0) {
@@ -84,44 +84,44 @@
return (FixedLength)cache.fetch(
new FixedLength(numUnits, units, sourceResolution));
}
-
+
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value
* This method assumes a source-resolution of 1 (1px = 1pt)
- *
+ *
* @param numUnits input units
* @param units unit specifier
* @return the canonical FixedLength instance corresponding
* to the given number of units and unit specifier
*/
- public static FixedLength getInstance(double numUnits,
+ public static FixedLength getInstance(double numUnits,
String units) {
return getInstance(numUnits, units, 1.0f);
-
+
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value.
- * This method assumes 'millipoints' (non-standard) as units,
+ * This method assumes 'millipoints' (non-standard) as units,
* and an implied source-resolution of 1 (1px = 1pt).
- *
+ *
* @param numUnits input units
* @return the canonical FixedLength instance corresponding
* to the given number of units and unit specifier
*/
public static FixedLength getInstance(double numUnits) {
return getInstance(numUnits, FixedLength.MPT, 1.0f);
-
+
}
-
+
/**
* Convert the given length to a dimensionless integer representing
* a whole number of base units (milli-points).
- *
+ *
* @param dvalue quantity of input units
* @param unit input unit specifier (in, cm, etc.)
* @param res the input/source resolution (in case the unit spec is "px")
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -32,9 +32,9 @@
/** cache holding all canonical FontFamilyProperty instances */
private static final PropertyCache cache = new PropertyCache(FontFamilyProperty.class);
-
+
private int hash = 0;
-
+
/**
* Inner class for creating instances of ListProperty
*/
@@ -126,7 +126,7 @@
private FontFamilyProperty() {
super();
}
-
+
/**
* Add a new property to the list
* @param prop Property to be added to the list
@@ -154,7 +154,7 @@
if (this == o) {
return true;
}
-
+
if (o instanceof FontFamilyProperty) {
FontFamilyProperty ffp = (FontFamilyProperty) o;
return (this.list != null
@@ -162,7 +162,7 @@
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == 0) {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontShorthandParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontShorthandParser.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontShorthandParser.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontShorthandParser.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -29,14 +29,14 @@
public class FontShorthandParser extends GenericShorthandParser {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
PropertyMaker maker,
PropertyList propertyList)
throws PropertyException {
-
+
int index = -1;
Property newProp;
switch (propId) {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -39,24 +39,24 @@
Constants.PR_LINE_HEIGHT, Constants.PR_FONT_STYLE,
Constants.PR_FONT_VARIANT, Constants.PR_FONT_WEIGHT
};
-
+
/**
* @param propId ID of the property for which Maker should be created
*/
public Maker(int propId) {
super(propId);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
- public Property make(PropertyList propertyList,
+ public Property make(PropertyList propertyList,
String value, FObj fo) throws PropertyException {
-
+
try {
FontShorthandProperty newProp = new FontShorthandProperty();
newProp.setSpecifiedValue(value);
-
+
String specVal = value;
Property prop = null;
if ("inherit".equals(specVal)) {
@@ -80,14 +80,14 @@
int spaceIndex = value.indexOf(' ');
int quoteIndex = (value.indexOf('\'') == -1)
? value.indexOf('\"') : value.indexOf('\'');
- if (spaceIndex == -1
+ if (spaceIndex == -1
|| (quoteIndex != -1 && spaceIndex > quoteIndex)) {
/* no spaces or first space appears after the first
* single/double quote, so malformed value string
*/
throw new PropertyException("Invalid property value: "
- + "font=\"" + value + "\"");
- }
+ + "font=\"" + value + "\"");
+ }
PropertyMaker m = null;
int fromIndex = spaceIndex + 1;
int toIndex = specVal.length();
@@ -97,11 +97,11 @@
boolean fontFamilyParsed = false;
int commaIndex = value.indexOf(',');
while (!fontFamilyParsed) {
- /* value contains a (list of) possibly quoted
- * font-family name(s)
+ /* value contains a (list of) possibly quoted
+ * font-family name(s)
*/
if (commaIndex == -1) {
- /* no list, just a single name
+ /* no list, just a single name
* (or first name in the list)
*/
if (quoteIndex != -1) {
@@ -112,7 +112,7 @@
m = FObj.getPropertyMakerFor(PROP_IDS[1]);
prop = m.make(propertyList, specVal.substring(fromIndex), fo);
newProp.addProperty(prop, 1);
- fontFamilyParsed = true;
+ fontFamilyParsed = true;
} else {
if (quoteIndex != -1 && quoteIndex < commaIndex) {
/* a quoted font-family name as first name
@@ -131,7 +131,7 @@
fromIndex = value.lastIndexOf(' ', toIndex - 1) + 1;
value = specVal.substring(fromIndex, toIndex);
int slashIndex = value.indexOf('/');
- String fontSize = value.substring(0,
+ String fontSize = value.substring(0,
(slashIndex == -1) ? value.length() : slashIndex);
m = FObj.getPropertyMakerFor(PROP_IDS[0]);
prop = m.make(propertyList, fontSize, fo);
@@ -190,7 +190,7 @@
}
}
}
-
+
private void addProperty(Property prop, int pos) {
while (list.size() < (pos + 1)) {
list.add(null);
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -24,30 +24,30 @@
import org.apache.fop.fo.expr.PropertyException;
/**
- * This subclass of LengthProperty.Maker handles the special treatment of
+ * This subclass of LengthProperty.Maker handles the special treatment of
* relative font sizes described in 7.8.4.
*/
-public class FontSizePropertyMaker
+public class FontSizePropertyMaker
extends LengthProperty.Maker implements Constants {
/** The default normal font size in mpt */
private static final int FONT_SIZE_NORMAL = 12000;
/** The factor to be applied when stepping font sizes upwards */
private static final double FONT_SIZE_GROWTH_FACTOR = 1.2;
-
+
/**
- * Create a length property which can handle relative font sizes
+ * Create a length property which can handle relative font sizes
* @param propId the font size property id.
*/
public FontSizePropertyMaker(int propId) {
super(propId);
}
-
-
+
+
/**
* {@inheritDoc}
* Contrary to basic lengths, percentages for font-size can be resolved
- * here already: if the property evaluates to a {@link PercentLength},
+ * here already: if the property evaluates to a {@link PercentLength},
* it is immediately replaced by the resolved {@link FixedLength}.
*/
public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException {
@@ -82,7 +82,7 @@
}
return super.convertProperty(p, propertyList, fo);
}
-
+
/**
* Calculates the nearest absolute font size to the given
* font size.
@@ -107,7 +107,7 @@
}
// baseFontSize is between last and next step font size
// Return the step value closer to the baseFontSize
- if (Math.abs(lastStepFontSize - baseFontSize)
+ if (Math.abs(lastStepFontSize - baseFontSize)
<= Math.abs(baseFontSize - nextStepFontSize)) {
return lastStepFontSize;
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -24,24 +24,24 @@
import org.apache.fop.fo.expr.PropertyException;
/**
- * This subclass of EnumProperty.Maker handles the special treatment of
+ * This subclass of EnumProperty.Maker handles the special treatment of
* relative font stretch values described in 7.8.5.
*/
-public class FontStretchPropertyMaker
+public class FontStretchPropertyMaker
extends EnumProperty.Maker implements Constants {
-
+
/* Ordered list of absolute font stretch properties so we can easily find the next /
* previous one */
private Property[] orderedFontStretchValues = null;
-
+
/**
- * Create an enum property which can handle relative font stretches
+ * Create an enum property which can handle relative font stretches
* @param propId the font size property id.
*/
public FontStretchPropertyMaker(int propId) {
super(propId);
}
-
+
/**
* {@inheritDoc}
* Implements the parts of 7.8.5 relevant to relative font stretches
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java Fri Jul 25 05:44:20 2008
@@ -26,7 +26,7 @@
import org.apache.fop.fo.expr.PropertyParser;
public class FontWeightPropertyMaker extends EnumProperty.Maker {
-
+
/**
* Main constructor
* @param propId the property id
@@ -34,11 +34,11 @@
public FontWeightPropertyMaker(int propId) {
super(propId);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
- public Property make(PropertyList pList, String value, FObj fo)
+ public Property make(PropertyList pList, String value, FObj fo)
throws PropertyException {
if ("inherit".equals(value)) {
return super.make(pList, value, fo);
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -30,7 +30,7 @@
public class GenericShorthandParser implements ShorthandParser {
/**
- * Constructor.
+ * Constructor.
*/
public GenericShorthandParser() {
}
@@ -47,9 +47,9 @@
return null;
}
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -33,15 +33,15 @@
*/
public class IndentPropertyMaker extends CorrespondingPropertyMaker {
/**
- * The corresponding padding-* propIds
+ * The corresponding padding-* propIds
*/
- private int[] paddingCorresponding = null;
+ private int[] paddingCorresponding = null;
/**
- * The corresponding border-*-width propIds
+ * The corresponding border-*-width propIds
*/
private int[] borderWidthCorresponding = null;
-
+
/**
* Create a start-indent or end-indent property maker.
* @param baseMaker the property maker to use
@@ -57,7 +57,7 @@
public void setPaddingCorresponding(int[] paddingCorresponding) {
this.paddingCorresponding = paddingCorresponding;
}
-
+
/**
* Set the corresponding values for the border-*-width properties.
* @param borderWidthCorresponding the corresping propids.
@@ -65,9 +65,9 @@
public void setBorderWidthCorresponding(int[] borderWidthCorresponding) {
this.borderWidthCorresponding = borderWidthCorresponding;
}
-
+
/**
- * Calculate the corresponding value for start-indent and end-indent.
+ * Calculate the corresponding value for start-indent and end-indent.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property compute(PropertyList propertyList) throws PropertyException {
@@ -78,9 +78,9 @@
return computeConforming(propertyList);
}
}
-
+
/**
- * Calculate the corresponding value for start-indent and end-indent.
+ * Calculate the corresponding value for start-indent and end-indent.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property computeConforming(PropertyList propertyList) throws PropertyException {
@@ -92,7 +92,7 @@
Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();
-
+
int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
// Calculate the absolute margin.
if (propertyList.getExplicitOrShorthand(marginProp) == null) {
@@ -107,7 +107,7 @@
} else {
//Margin is used
Numeric margin = propertyList.get(marginProp).getNumeric();
-
+
Numeric v = FixedLength.ZERO_FIXED_LENGTH;
if (!propertyList.getFObj().generatesReferenceAreas()) {
// The inherited_value_of([start|end]-indent)
@@ -119,23 +119,23 @@
v = NumericOp.addition(v, border);
return (Property) v;
}
-
+
}
-
+
private boolean isInherited(PropertyList pList) {
if (pList.getFObj().getUserAgent().isBreakIndentInheritanceOnReferenceAreaBoundary()) {
- FONode nd = pList.getFObj().getParent();
+ FONode nd = pList.getFObj().getParent();
return !((nd instanceof FObj) && ((FObj)nd).generatesReferenceAreas());
} else {
return true;
}
}
-
+
/**
* Calculate the corresponding value for start-indent and end-indent.
* This method calculates indent following an alternative rule set that
* tries to mimic many commercial solutions that chose to violate the
- * XSL specification.
+ * XSL specification.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property computeAlternativeRuleset(PropertyList propertyList) throws PropertyException {
@@ -148,10 +148,10 @@
Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();
-
+
int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
- //Determine whether the nearest anscestor indent was specified through
+ //Determine whether the nearest anscestor indent was specified through
//start-indent|end-indent or through a margin property.
boolean marginNearest = false;
PropertyList pl = propertyList.getParentPropertyList();
@@ -164,7 +164,7 @@
}
pl = pl.getParentPropertyList();
}
-
+
// Calculate the absolute margin.
if (propertyList.getExplicitOrShorthand(marginProp) == null) {
Property indent = propertyList.getExplicit(baseMaker.propId);
@@ -181,7 +181,7 @@
} else {
//Margin is used
Numeric margin = propertyList.get(marginProp).getNumeric();
-
+
Numeric v = FixedLength.ZERO_FIXED_LENGTH;
if (isInherited(propertyList)) {
// The inherited_value_of([start|end]-indent)
@@ -194,7 +194,7 @@
return (Property) v;
}
}
-
+
private Property getCorresponding(int[] corresponding, PropertyList propertyList)
throws PropertyException {
PropertyList pList = getWMPropertyList(propertyList);
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/KeepProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/KeepProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/KeepProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/KeepProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -28,10 +28,10 @@
* Class for properties that wrap Keep values
*/
public final class KeepProperty extends Property implements CompoundDatatype {
-
+
/** class holding all canonical KeepProperty instances*/
private static final PropertyCache cache = new PropertyCache(KeepProperty.class);
-
+
private boolean isCachedValue = false;
private Property withinLine;
private Property withinColumn;
@@ -51,7 +51,7 @@
/**
* Create a new empty instance of KeepProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new KeepProperty();
@@ -59,7 +59,7 @@
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException
{
@@ -71,7 +71,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -154,9 +154,9 @@
* @return String representation
*/
public String toString() {
- return "Keep[" +
- "withinLine:" + getWithinLine().getObject() +
- ", withinColumn:" + getWithinColumn().getObject() +
+ return "Keep[" +
+ "withinLine:" + getWithinLine().getObject() +
+ ", withinColumn:" + getWithinColumn().getObject() +
", withinPage:" + getWithinPage().getObject() + "]";
}
@@ -183,7 +183,7 @@
if (this == o) {
return true;
}
-
+
if (o instanceof KeepProperty) {
KeepProperty keep = (KeepProperty) o;
return (keep.withinColumn == this.withinColumn)
@@ -192,7 +192,7 @@
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
int hash = 17;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthPairProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthPairProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthPairProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthPairProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -45,7 +45,7 @@
/**
* Create a new empty instance of LengthPairProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new LengthPairProperty();
@@ -53,7 +53,7 @@
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof LengthPairProperty) {
@@ -69,7 +69,7 @@
public LengthPairProperty() {
super();
}
-
+
/**
* Creates a new LengthPairProperty.
* @param ipd inline-progression-dimension
@@ -80,7 +80,7 @@
this.ipd = ipd;
this.bpd = bpd;
}
-
+
/**
* Creates a new LengthPairProperty which sets both bpd and ipd to the
* same value.
@@ -89,9 +89,9 @@
public LengthPairProperty(Property len) {
this(len, len);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -131,8 +131,8 @@
/** {@inheritDoc} */
public String toString() {
- return "LengthPair["
- + "ipd:" + getIPD().getObject()
+ return "LengthPair["
+ + "ipd:" + getIPD().getObject()
+ ", bpd:" + getBPD().getObject() + "]";
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -28,9 +28,9 @@
/**
* Superclass for properties wrapping a Length value.
*/
-public abstract class LengthProperty extends Property
+public abstract class LengthProperty extends Property
implements Length, Numeric {
-
+
/**
* Inner class for making instances of LengthProperty
*/
@@ -38,7 +38,7 @@
/**
* Constructor
- *
+ *
* @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -53,7 +53,7 @@
/**
* Create a new empty instance of LengthRangeProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new LengthRangeProperty();
@@ -64,16 +64,16 @@
&& ((PercentLength) len).getPercentage() < 0)
|| (len.isAbsolute() && len.getValue() < 0));
}
-
- /** {@inheritDoc} */
- public Property convertProperty(Property p,
+
+ /** {@inheritDoc} */
+ public Property convertProperty(Property p,
PropertyList propertyList, FObj fo)
throws PropertyException {
-
+
if (p instanceof LengthRangeProperty) {
return p;
}
-
+
if (this.propId == PR_BLOCK_PROGRESSION_DIMENSION
|| this.propId == PR_INLINE_PROGRESSION_DIMENSION) {
Length len = p.getLength();
@@ -86,13 +86,13 @@
}
}
}
-
+
return super.convertProperty(p, propertyList, fo);
}
-
-
+
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected Property setSubprop(Property baseProperty, int subpropertyId,
Property subproperty) {
@@ -119,7 +119,7 @@
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -191,7 +191,7 @@
}
consistent = false;
}
-
+
// Minimum is prioritaire, if explicit
private void checkConsistency(PercentBaseContext context) {
if (consistent) {
@@ -203,7 +203,7 @@
// Make sure max >= min
// Must also control if have any allowed enum values!
- if (!minimum.isAuto() && !maximum.isAuto()
+ if (!minimum.isAuto() && !maximum.isAuto()
&& minimum.getLength().getValue(context) > maximum.getLength().getValue(context)) {
if ((bfSet & MINSET) != 0) {
// if minimum is explicit, force max to min
@@ -217,7 +217,7 @@
}
}
// Now make sure opt <= max and opt >= min
- if (!optimum.isAuto() && !maximum.isAuto()
+ if (!optimum.isAuto() && !maximum.isAuto()
&& optimum.getLength().getValue(context) > maximum.getLength().getValue(context)) {
if ((bfSet & OPTSET) != 0) {
if ((bfSet & MAXSET) != 0) {
@@ -231,8 +231,8 @@
// opt is default and max is explicit or default
optimum = maximum;
}
- } else if (!optimum.isAuto() && !minimum.isAuto()
- && optimum.getLength().getValue(context)
+ } else if (!optimum.isAuto() && !minimum.isAuto()
+ && optimum.getLength().getValue(context)
< minimum.getLength().getValue(context)) {
if ((bfSet & MINSET) != 0) {
// if minimum is explicit, force opt to min
@@ -244,7 +244,7 @@
minimum = optimum; // minimum was default value
}
}
-
+
consistent = true;
}
@@ -278,8 +278,8 @@
/** {@inheritDoc} */
public String toString() {
return "LengthRange["
- + "min:" + getMinimum(null).getObject()
- + ", max:" + getMaximum(null).getObject()
+ + "min:" + getMinimum(null).getObject()
+ + ", max:" + getMaximum(null).getObject()
+ ", opt:" + getOptimum(null).getObject() + "]";
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -33,7 +33,7 @@
* value, instead of the computed value.
* So when a line-height is create based on an attribute, the specified value
* is stored in the property and in compute() the stored specified value of
- * the nearest specified is used to recalculate the line-height.
+ * the nearest specified is used to recalculate the line-height.
*/
public class LineHeightPropertyMaker extends SpaceProperty.Maker {
@@ -48,9 +48,9 @@
/**
* {@inheritDoc}
*/
- public Property make(PropertyList propertyList, String value, FObj fo)
+ public Property make(PropertyList propertyList, String value, FObj fo)
throws PropertyException {
- /* if value was specified as a number/length/percentage then
+ /* if value was specified as a number/length/percentage then
* conditionality and precedence components are overridden
*/
Property p = super.make(propertyList, value, fo);
@@ -60,7 +60,7 @@
EnumProperty.getInstance(Constants.EN_FORCE, "FORCE"), true);
return p;
}
-
+
/**
* Recalculate the line-height value based on the nearest specified
* value.
@@ -80,7 +80,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property convertProperty(Property p,
PropertyList propertyList,
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/ListProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/ListProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/ListProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/ListProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -64,7 +64,7 @@
protected ListProperty() {
//nop
}
-
+
/**
* @param prop the first Property to be added to the list
*/
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/NumberProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/NumberProperty.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/NumberProperty.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/NumberProperty.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -51,7 +51,7 @@
* {@inheritDoc}
*/
public Property convertProperty(Property p,
- PropertyList propertyList, FObj fo)
+ PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof NumberProperty) {
return p;
@@ -79,12 +79,12 @@
}
/**
- * If the value is not positive, return a property with value 1
- *
+ * If the value is not positive, return a property with value 1
+ *
* {@inheritDoc}
*/
- public Property convertProperty(Property p,
- PropertyList propertyList, FObj fo)
+ public Property convertProperty(Property p,
+ PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof EnumProperty) {
return EnumNumber.getInstance(p);
@@ -101,10 +101,10 @@
}
}
-
+
/** cache holding all canonical NumberProperty instances */
private static final PropertyCache cache = new PropertyCache(NumberProperty.class);
-
+
private final Number number;
/**
@@ -132,7 +132,7 @@
private NumberProperty(int num) {
this.number = new Integer(num);
}
-
+
/**
* Returns the canonical NumberProperty instance
* corresponding to the given Number
@@ -143,7 +143,7 @@
return (NumberProperty)cache.fetch(
new NumberProperty(num.doubleValue()));
}
-
+
/**
* Returns the canonical NumberProperty instance
* corresponding to the given Integer
@@ -176,7 +176,7 @@
return (NumberProperty)cache.fetch(
new NumberProperty(num));
}
-
+
/**
* Plain number always has a dimension of 0.
* @return a dimension of 0.
@@ -254,7 +254,7 @@
/**
* Convert NumberProperty to a Color. Not sure why this is needed.
- * @param foUserAgent FOUserAgent
+ * @param foUserAgent FOUserAgent
* @return Color that corresponds to black
*/
public Color getColor(FOUserAgent foUserAgent) {
@@ -268,7 +268,7 @@
public int hashCode() {
return number.hashCode();
}
-
+
/** {@inheritDoc} */
public boolean equals(Object o) {
if (o == this) {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -28,9 +28,9 @@
* Used to set the corresponding keep-* and break-* properties.
*/
public class PageBreakShorthandParser implements ShorthandParser {
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
@@ -38,11 +38,11 @@
PropertyList propertyList)
throws PropertyException {
- if (propId == Constants.PR_KEEP_WITH_PREVIOUS
+ if (propId == Constants.PR_KEEP_WITH_PREVIOUS
|| propId == Constants.PR_KEEP_WITH_NEXT
|| propId == Constants.PR_KEEP_TOGETHER) {
if (property.getEnum() == Constants.EN_AVOID) {
- return maker.make(null, Constants.CP_WITHIN_PAGE,
+ return maker.make(null, Constants.CP_WITHIN_PAGE,
propertyList, "always", propertyList.getFObj());
}
} else if (propId == Constants.PR_BREAK_BEFORE
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -26,38 +26,38 @@
/**
* Custom Maker for page-height / page-width
- *
+ *
*/
public class PageDimensionMaker extends LengthProperty.Maker {
-
+
/**
* Constructor
- *
+ *
* @param propId the property Id
*/
public PageDimensionMaker(int propId) {
super(propId);
}
-
+
/**
- * Check the value of the page-width / page-height property.
+ * Check the value of the page-width / page-height property.
* Return the default or user-defined fallback in case the value
* was specified as "auto"
- *
+ *
* @see PropertyMaker#get(int, PropertyList, boolean, boolean)
*/
public Property get(int subpropId, PropertyList propertyList,
- boolean tryInherit, boolean tryDefault)
+ boolean tryInherit, boolean tryDefault)
throws PropertyException {
-
- Property p = super.get(0, propertyList, tryInherit, tryDefault);
+
+ Property p = super.get(0, propertyList, tryInherit, tryDefault);
FObj fo = propertyList.getFObj();
String fallbackValue = (propId == Constants.PR_PAGE_HEIGHT)
? fo.getUserAgent().getPageHeight()
: fo.getUserAgent().getPageWidth();
-
+
if (p.getEnum() == Constants.EN_INDEFINITE) {
- int otherId = (propId == Constants.PR_PAGE_HEIGHT)
+ int otherId = (propId == Constants.PR_PAGE_HEIGHT)
? Constants.PR_PAGE_WIDTH : Constants.PR_PAGE_HEIGHT;
int writingMode = propertyList.get(Constants.PR_WRITING_MODE).getEnum();
int refOrientation = propertyList.get(Constants.PR_REFERENCE_ORIENTATION)
@@ -66,10 +66,10 @@
&& propertyList.getExplicit(otherId).getEnum() == Constants.EN_INDEFINITE) {
//both set to "indefinite":
//determine which one of the two defines the dimension
- //in block-progression-direction, and set the other to
+ //in block-progression-direction, and set the other to
//"auto"
if ((writingMode != Constants.EN_TB_RL
- && (refOrientation == 0
+ && (refOrientation == 0
|| refOrientation == 180
|| refOrientation == -180))
|| (writingMode == Constants.EN_TB_RL
@@ -94,7 +94,7 @@
} else if (p.isAuto()) {
return make(propertyList, fallbackValue, fo);
}
-
+
return p;
- }
+ }
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PercentLength.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PercentLength.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PercentLength.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PercentLength.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -27,7 +27,7 @@
* a percent specified length quantity in XSL
*/
public class PercentLength extends LengthProperty {
-
+
/**
* The percentage itself, expressed as a decimal value, e.g. for 95%, set
* the value to .95
@@ -39,7 +39,7 @@
* {@link #factor} should be applied to compute the actual length
*/
private PercentBase lbase = null;
-
+
private double resolvedValue;
/**
@@ -63,9 +63,9 @@
}
/**
- * Used during property resolution to check for
+ * Used during property resolution to check for
* negative percentages
- *
+ *
* @return the percentage value
*/
protected double getPercentage() {
@@ -95,7 +95,7 @@
return 0;
}
}
-
+
/** {@inheritDoc} */
public String getString() {
return (factor * 100.0) + "%";
@@ -103,7 +103,7 @@
/**
* Return the length of this PercentLength.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int getValue() {
return (int) getNumericValue();
@@ -113,12 +113,12 @@
public int getValue(PercentBaseContext context) {
return (int) getNumericValue(context);
}
-
+
/**
* @return the String equivalent of this
*/
public String toString() {
- StringBuffer sb =
+ StringBuffer sb =
new StringBuffer(PercentLength.class.getName())
.append("[factor=").append(factor)
.append(",lbase=").append(lbase).append("]");
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -27,15 +27,15 @@
* values for absolute-position and relative-position.
*/
public class PositionShorthandParser implements ShorthandParser {
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
PropertyMaker maker,
PropertyList propertyList) {
-
+
int propVal = property.getEnum();
if (propId == Constants.PR_ABSOLUTE_POSITION) {
switch (propVal) {
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/Property.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/Property.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/Property.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/Property.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -34,7 +34,7 @@
* Base class for all property objects
*/
public class Property {
-
+
/** Logger for all property classes */
protected static Log log = LogFactory.getLog(PropertyMaker.class);
@@ -134,7 +134,7 @@
public boolean isAuto() {
return (getEnum() == Constants.EN_AUTO);
}
-
+
/**
* This method expects to be overridden by subclasses
* @return char property value
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PropertyCache.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PropertyCache.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PropertyCache.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/properties/PropertyCache.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -28,35 +28,35 @@
* The public access points are overloaded <code>fetch()</code> methods
* that each correspond to a cached type.
* It is designed especially to be used concurrently by multiple threads,
- * drawing heavily upon the principles behind Java 1.5's
- * <code>ConcurrentHashMap</code>.
+ * drawing heavily upon the principles behind Java 1.5's
+ * <code>ConcurrentHashMap</code>.
*/
public final class PropertyCache {
- /** bitmask to apply to the hash to get to the
+ /** bitmask to apply to the hash to get to the
* corresponding cache segment */
private static final int SEGMENT_MASK = 0x1F;
- /**
+ /**
* Indicates whether the cache should be used at all
* Can be controlled by the system property:
* org.apache.fop.fo.properties.use-cache
*/
private final boolean useCache;
-
+
/** the segments array (length = 32) */
private CacheSegment[] segments = new CacheSegment[SEGMENT_MASK + 1];
/** the table of hash-buckets */
private CacheEntry[] table = new CacheEntry[8];
-
+
private Class runtimeType;
-
+
final boolean[] votesForRehash = new boolean[SEGMENT_MASK + 1];
-
+
/* same hash function as used by java.util.HashMap */
private static int hash(Object x) {
return hash(x.hashCode());
}
-
+
private static int hash(int hashCode) {
int h = hashCode;
h += ~(h << 9);
@@ -65,32 +65,32 @@
h ^= (h >>> 10);
return h;
}
-
+
/* shortcut function */
private static boolean eq(Object p, Object q) {
return (p == q || (p != null && p.equals(q)));
}
-
+
/* Class modeling a cached entry */
private final class CacheEntry extends WeakReference {
volatile CacheEntry nextEntry;
final int hash;
-
+
/* main constructor */
public CacheEntry(Object p, CacheEntry nextEntry, ReferenceQueue refQueue) {
super(p, refQueue);
this.nextEntry = nextEntry;
this.hash = p.hashCode();
}
-
+
}
-
+
/* Wrapper objects to synchronize on */
private final class CacheSegment {
private int count = 0;
private volatile ReferenceQueue staleEntries = new ReferenceQueue();
- }
-
+ }
+
private void cleanSegment(int segmentIndex) {
CacheEntry entry;
CacheSegment segment = segments[segmentIndex];
@@ -145,7 +145,7 @@
}
}
}
-
+
/*
* Puts a new instance in the cache.
* If the total number of entries for the corresponding
@@ -154,14 +154,14 @@
* entries.
*/
private void put(Object o) {
-
+
int hash = hash(o);
CacheSegment segment = segments[hash & SEGMENT_MASK];
-
+
synchronized (segment) {
int index = hash & (table.length - 1);
CacheEntry entry = table[index];
-
+
if (entry == null) {
entry = new CacheEntry(o, null, segment.staleEntries);
table[index] = entry;
@@ -176,23 +176,23 @@
segment.count++;
}
}
-
+
if (segment.count > (2 * table.length)) {
cleanSegment(hash & SEGMENT_MASK);
}
}
}
-
+
/* Gets a cached instance. Returns null if not found */
private Object get(Object o) {
-
+
int hash = hash(o);
int index = hash & (table.length - 1);
-
+
CacheEntry entry = table[index];
Object q;
-
+
/* try non-synched first */
for (CacheEntry e = entry; e != null; e = e.nextEntry) {
if (e.hash == o.hashCode()
@@ -201,7 +201,7 @@
return q;
}
}
-
+
/* retry synched, only if the above attempt did not succeed,
* as another thread may, in the meantime, have added a
* corresponding entry */
@@ -218,14 +218,14 @@
}
return null;
}
-
+
/*
* Recursively acquires locks on all 32 segments,
* extends the cache and redistributes the entries.
- *
+ *
*/
private void rehash(int index) {
-
+
CacheSegment seg = segments[index];
synchronized (seg) {
if (index > 0) {
@@ -239,9 +239,9 @@
for (int i = segments.length; --i >= 0;) {
segments[i].count = 0;
}
-
+
CacheEntry[] newTable = new CacheEntry[newLength];
-
+
int hash, idx;
Object o;
newLength--;
@@ -250,7 +250,7 @@
if ((o = c.get()) != null) {
hash = c.hash;
idx = hash & newLength;
- newTable[idx] = new CacheEntry(o, newTable[idx],
+ newTable[idx] = new CacheEntry(o, newTable[idx],
segments[hash & SEGMENT_MASK].staleEntries);
segments[hash & SEGMENT_MASK].count++;
}
@@ -261,10 +261,10 @@
}
}
}
-
+
/**
* Default constructor.
- *
+ *
* @param c Runtime type of the objects that will be stored in the cache
*/
public PropertyCache(Class c) {
@@ -278,13 +278,13 @@
}
this.runtimeType = c;
}
-
+
/**
* Generic fetch() method.
- * Checks if the given <code>Object</code> is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given <code>Object</code> is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param obj the Object to check for
* @return the cached instance
*/
@@ -292,81 +292,81 @@
if (!this.useCache) {
return obj;
}
-
+
if (obj == null) {
return null;
}
Object cacheEntry = get(obj);
if (cacheEntry != null) {
- return cacheEntry;
+ return cacheEntry;
}
put(obj);
return obj;
}
-
+
/**
- * Checks if the given {@link Property} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link Property} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param prop the Property instance to check for
* @return the cached instance
*/
public final Property fetch(Property prop) {
-
+
return (Property) fetch((Object) prop);
}
-
+
/**
- * Checks if the given {@link CommonHyphenation} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonHyphenation} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param chy the CommonHyphenation instance to check for
* @return the cached instance
*/
public final CommonHyphenation fetch(CommonHyphenation chy) {
-
+
return (CommonHyphenation) fetch((Object) chy);
}
-
+
/**
- * Checks if the given {@link CommonFont} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonFont} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param cf the CommonFont instance to check for
* @return the cached instance
*/
public final CommonFont fetch(CommonFont cf) {
-
+
return (CommonFont) fetch((Object) cf);
}
/**
- * Checks if the given {@link CommonBorderPaddingBackground} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonBorderPaddingBackground} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param cbpb the CommonBorderPaddingBackground instance to check for
* @return the cached instance
*/
public final CommonBorderPaddingBackground fetch(CommonBorderPaddingBackground cbpb) {
-
+
return (CommonBorderPaddingBackground) fetch((Object) cbpb);
}
/**
- * Checks if the given {@link CommonBorderPaddingBackground.BorderInfo} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonBorderPaddingBackground.BorderInfo} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param bi the BorderInfo instance to check for
* @return the cached instance
*/
public final CommonBorderPaddingBackground.BorderInfo fetch(CommonBorderPaddingBackground.BorderInfo bi) {
-
+
return (CommonBorderPaddingBackground.BorderInfo) fetch((Object) bi);
}
@@ -374,6 +374,6 @@
public String toString() {
return super.toString() + "[runtimeType=" + this.runtimeType + "]";
}
-
-
+
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org