Thread: [FOray-commit] SF.net SVN: foray: [8229] trunk/foray (Page 3)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-09-26 00:31:38
|
Revision: 8229
http://svn.sourceforge.net/foray/?rev=8229&view=rev
Author: victormote
Date: 2006-09-25 17:31:17 -0700 (Mon, 25 Sep 2006)
Log Message:
-----------
Use the new common build script.
Modified Paths:
--------------
trunk/foray/foray-app/scripts/build.xml
trunk/foray/foray-areatree/scripts/build.xml
trunk/foray/foray-common/scripts/build.xml
trunk/foray/foray-core/scripts/build.xml
trunk/foray/foray-font/scripts/build.xml
trunk/foray/foray-fotree/scripts/build.xml
trunk/foray/foray-graphic/scripts/build.xml
trunk/foray/foray-hyphen-r/scripts/build.xml
trunk/foray/foray-layout/scripts/build.xml
trunk/foray/foray-mif/scripts/build.xml
trunk/foray/foray-output/scripts/build.xml
trunk/foray/foray-pdf/scripts/build.xml
trunk/foray/foray-pioneer/scripts/build.xml
trunk/foray/foray-pretty/scripts/build.xml
trunk/foray/foray-ps/scripts/build.xml
trunk/foray/foray-render/scripts/build.xml
trunk/foray/foray-text/scripts/build.xml
Modified: trunk/foray/foray-app/scripts/build.xml
===================================================================
--- trunk/foray/foray-app/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-app/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,32 +3,18 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="app"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
- <!-- Retrieve externally-configured properties. -->
- <property file="${foray.config}/foray-build.properties"/>
-
- <!-- Get a default for {foray.home}. -->
- <property name="foray.home" location="../.."/>
- <echo>foray.home: ${foray.home}</echo>
-
- <!-- Set up dependent properties. -->
- <property name="lib.dir" location="${foray.home}/lib"/>
- <property name="axsl.build" location="${lib.dir}"/>
-
<path id="libs-build-classpath">
<fileset dir="${axsl.build}">
<include name="**/axsl*.jar"/>
@@ -37,7 +23,7 @@
<include name="xml-apis*.jar"/>
<include name="servlet*.jar"/>
<include name="axsl*.jar"/>
- <include name="xercesImpl*.jar"/>
+ <include name="xercesImpl*.jar"/>
<include name="commons-logging.jar"/>
</fileset>
<fileset dir="${foray.home}/foray-common/build/ant">
@@ -80,26 +66,7 @@
<include name="*.jar"/>
</fileset>
</path>
- </target>
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init" depends="env">
- <tstamp/>
- <property name="name" value="foray"/>
- <property name="contact.info"
- value="The FOray project http://www.foray.org"/>
- <property name="module" value="app"/>
- <property name="module.dir" value="${foray.home}/foray-${module}"/>
- <property name="version" value="0.1"/>
- <property name="src.dir" value="${module.dir}/src"/>
- <property name="build.dir" value="${module.dir}/build/ant"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="off"/>
- <property name="source" value="1.4"/>
</target>
<!-- =================================================================== -->
Modified: trunk/foray/foray-areatree/scripts/build.xml
===================================================================
--- trunk/foray/foray-areatree/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-areatree/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,32 +3,18 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="areatree"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
- <!-- Retrieve externally-configured properties. -->
- <property file="${foray.config}/foray-build.properties"/>
-
- <!-- Get a default for {foray.home}. -->
- <property name="foray.home" location="../.."/>
- <echo>foray.home: ${foray.home}</echo>
-
- <!-- Set up dependent properties. -->
- <property name="lib.dir" location="${foray.home}/lib"/>
- <property name="axsl.build" location="${lib.dir}"/>
-
<path id="libs-build-classpath">
<fileset dir="${axsl.build}">
<include name="**/axsl*.jar"/>
@@ -43,26 +29,7 @@
<include name="*.jar"/>
</fileset>
</path>
- </target>
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init" depends="env">
- <tstamp/>
- <property name="name" value="foray"/>
- <property name="contact.info"
- value="The FOray project http://www.foray.org"/>
- <property name="module" value="areatree"/>
- <property name="module.dir" value="${foray.home}/foray-${module}"/>
- <property name="version" value="0.1"/>
- <property name="src.dir" value="${module.dir}/src"/>
- <property name="build.dir" value="${module.dir}/build/ant"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="off"/>
- <property name="source" value="1.4"/>
</target>
<!-- =================================================================== -->
Modified: trunk/foray/foray-common/scripts/build.xml
===================================================================
--- trunk/foray/foray-common/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-common/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,32 +3,18 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="common"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
- <!-- Retrieve externally-configured properties. -->
- <property file="${foray.config}/foray-build.properties"/>
-
- <!-- Get a default for {foray.home}. -->
- <property name="foray.home" location="../.."/>
- <echo>foray.home: ${foray.home}</echo>
-
- <!-- Set up dependent properties. -->
- <property name="lib.dir" location="${foray.home}/lib"/>
- <property name="axsl.build" location="${lib.dir}"/>
-
<path id="libs-build-classpath">
<fileset dir="${axsl.build}">
<include name="**/axsl*.jar"/>
@@ -43,28 +29,8 @@
<include name="icu*.jar"/>
</fileset>
</path>
- </target>
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init" depends="env">
- <tstamp/>
- <property name="name" value="foray"/>
- <property name="contact.info"
- value="The FOray project http://www.foray.org"/>
- <property name="module" value="common"/>
- <property name="module.dir" value="${foray.home}/foray-${module}"/>
- <property name="version" value="0.1"/>
- <property name="src.dir" value="${module.dir}/src"/>
- <echo>${src.dir}</echo>
- <property name="build.dir" value="${module.dir}/build/ant"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="off"/>
- <property name="source" value="1.4"/>
- </target>
+</target>
<!-- =================================================================== -->
<!-- Prepares the build directory -->
Modified: trunk/foray/foray-core/scripts/build.xml
===================================================================
--- trunk/foray/foray-core/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-core/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,32 +3,18 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="core"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
- <!-- Retrieve externally-configured properties. -->
- <property file="${foray.config}/foray-build.properties"/>
-
- <!-- Get a default for {foray.home}. -->
- <property name="foray.home" location="../.."/>
- <echo>foray.home: ${foray.home}</echo>
-
- <!-- Set up dependent properties. -->
- <property name="lib.dir" location="${foray.home}/lib"/>
- <property name="axsl.build" location="${lib.dir}"/>
-
<path id="libs-build-classpath">
<fileset dir="${axsl.build}">
<include name="**/axsl*.jar"/>
@@ -43,26 +29,7 @@
<include name="*.jar"/>
</fileset>
</path>
- </target>
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init" depends="env">
- <tstamp/>
- <property name="name" value="foray"/>
- <property name="contact.info"
- value="The FOray project http://www.foray.org"/>
- <property name="module" value="core"/>
- <property name="module.dir" value="${foray.home}/foray-${module}"/>
- <property name="version" value="0.1"/>
- <property name="src.dir" value="${module.dir}/src"/>
- <property name="build.dir" value="${module.dir}/build/ant"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="off"/>
- <property name="source" value="1.4"/>
</target>
<!-- =================================================================== -->
Modified: trunk/foray/foray-font/scripts/build.xml
===================================================================
--- trunk/foray/foray-font/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-font/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,32 +3,18 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="font"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
- <!-- Retrieve externally-configured properties. -->
- <property file="${foray.config}/foray-build.properties"/>
-
- <!-- Get a default for {foray.home}. -->
- <property name="foray.home" location="../.."/>
- <echo>foray.home: ${foray.home}</echo>
-
- <!-- Set up dependent properties. -->
- <property name="lib.dir" location="${foray.home}/lib"/>
- <property name="axsl.build" location="${lib.dir}"/>
-
<path id="libs-build-classpath">
<fileset dir="${axsl.build}">
<include name="**/axsl*.jar"/>
@@ -49,26 +35,7 @@
<include name="*.jar"/>
</fileset>
</path>
- </target>
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init" depends="env">
- <tstamp/>
- <property name="name" value="foray"/>
- <property name="contact.info"
- value="The FOray project http://www.foray.org"/>
- <property name="module" value="font"/>
- <property name="module.dir" value="${foray.home}/foray-${module}"/>
- <property name="version" value="0.1"/>
- <property name="src.dir" value="${module.dir}/src"/>
- <property name="build.dir" value="${module.dir}/build/ant"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="off"/>
- <property name="source" value="1.4"/>
</target>
<!-- =================================================================== -->
Modified: trunk/foray/foray-fotree/scripts/build.xml
===================================================================
--- trunk/foray/foray-fotree/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-fotree/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,32 +3,18 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="fotree"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
- <!-- Retrieve externally-configured properties. -->
- <property file="${foray.config}/foray-build.properties"/>
-
- <!-- Get a default for {foray.home}. -->
- <property name="foray.home" location="../.."/>
- <echo>foray.home: ${foray.home}</echo>
-
- <!-- Set up dependent properties. -->
- <property name="lib.dir" location="${foray.home}/lib"/>
- <property name="axsl.build" location="${lib.dir}"/>
-
<path id="libs-build-classpath">
<fileset dir="${axsl.build}">
<include name="**/axsl*.jar"/>
@@ -43,26 +29,7 @@
<include name="*.jar"/>
</fileset>
</path>
- </target>
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init" depends="env">
- <tstamp/>
- <property name="name" value="foray"/>
- <property name="contact.info"
- value="The FOray project http://www.foray.org"/>
- <property name="module" value="fotree"/>
- <property name="module.dir" value="${foray.home}/foray-${module}"/>
- <property name="version" value="0.1"/>
- <property name="src.dir" value="${module.dir}/src"/>
- <property name="build.dir" value="${module.dir}/build/ant"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="off"/>
- <property name="source" value="1.4"/>
</target>
<!-- =================================================================== -->
Modified: trunk/foray/foray-graphic/scripts/build.xml
===================================================================
--- trunk/foray/foray-graphic/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-graphic/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,42 +3,18 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="init-avail, common-init">
+ <property name="module" value="graphic"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
- <!-- Retrieve externally-configured properties. -->
- <property file="${foray.config}/foray-build.properties"/>
-
- <!-- Get a default for {foray.home}. -->
- <property name="foray.home" location="../.."/>
- <echo>foray.home: ${foray.home}</echo>
-
- <!-- Set up dependent properties. -->
- <property name="lib.dir" location="${foray.home}/lib"/>
- <property name="axsl.build" location="${lib.dir}"/>
-
- <!-- Set defaults for optional properties. -->
- <property name="jai.libs" location="${lib.dir}"/>
-
- <echo>JAI libs: ${jai.libs}</echo>
- <path id="jai-libs">
- <fileset dir="${jai.libs}">
- <include name="jai*.jar"/>
- </fileset>
- </path>
-
<path id="libs-build-classpath">
<fileset dir="${axsl.build}">
<include name="**/axsl*.jar"/>
@@ -56,26 +32,17 @@
<include name="*.jar"/>
</fileset>
</path>
- </target>
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init" depends="init-avail">
- <tstamp/>
- <property name="name" value="foray"/>
- <property name="contact.info"
- value="The FOray project http://www.foray.org"/>
- <property name="module" value="graphic"/>
- <property name="module.dir" value="${foray.home}/foray-${module}"/>
- <property name="version" value="0.1"/>
- <property name="src.dir" value="${module.dir}/src"/>
- <property name="build.dir" value="${module.dir}/build/ant"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="off"/>
- <property name="source" value="1.4"/>
+ <!-- Set defaults for optional properties. -->
+ <property name="jai.libs" location="${lib.dir}"/>
+
+ <echo>JAI libs: ${jai.libs}</echo>
+ <path id="jai-libs">
+ <fileset dir="${jai.libs}">
+ <include name="jai*.jar"/>
+ </fileset>
+ </path>
+
</target>
<target name="init-avail" depends="env">
Modified: trunk/foray/foray-hyphen-r/scripts/build.xml
===================================================================
--- trunk/foray/foray-hyphen-r/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-hyphen-r/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,32 +3,22 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="hyphen-r"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
+ <property name="resource.dir" value="${module.dir}/resource"/>
+ <property name="hyph.source" value="${resource.dir}/hyph-patterns"/>
+ <property name="hyph.build"
+ value="${build.dir}/resource/org/foray/hyphenR/resource/patterns"/>
- <!-- Retrieve externally-configured properties. -->
- <property file="${foray.config}/foray-build.properties"/>
-
- <!-- Get a default for {foray.home}. -->
- <property name="foray.home" location="../.."/>
- <echo>foray.home: ${foray.home}</echo>
-
- <!-- Set up dependent properties. -->
- <property name="lib.dir" location="${foray.home}/lib"/>
- <property name="axsl.build" location="${lib.dir}"/>
-
<path id="libs-build-classpath">
<fileset dir="${axsl.build}">
<include name="**/axsl*.jar"/>
@@ -44,29 +34,7 @@
<include name="*.jar"/>
</fileset>
</path>
- </target>
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init" depends="env">
- <tstamp/>
- <property name="name" value="foray"/>
- <property name="contact.info"
- value="The FOray project http://www.foray.org"/>
- <property name="module" value="hyphen-r"/>
- <property name="module.dir" value="${foray.home}/foray-${module}"/>
- <property name="version" value="0.1"/>
- <property name="src.dir" value="${module.dir}/src"/>
- <property name="build.dir" value="${module.dir}/build/ant"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="resource.dir" value="${module.dir}/resource"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="off"/>
- <property name="source" value="1.4"/>
- <property name="hyph.source" value="${resource.dir}/hyph-patterns"/>
- <property name="hyph.build" value="${build.dir}/resource/org/foray/hyphenR/resource/patterns"/>
</target>
<!-- =================================================================== -->
@@ -209,4 +177,4 @@
</project>
-<!-- Last Line of $RCSfile$ -->
+<!-- Last Line of File. -->
Modified: trunk/foray/foray-layout/scripts/build.xml
===================================================================
--- trunk/foray/foray-layout/scripts/build.xml 2006-09-25 23:59:28 UTC (rev 8228)
+++ trunk/foray/foray-layout/scripts/build.xml 2006-09-26 00:31:17 UTC (rev 8229)
@@ -3,32 +3,18 @@
<project default="package" basedir=".">
- <!-- Set up a prefix to designate environment variables. -->
- <property environment="env"/>
+ <import file="../../scripts/build-common.xml"/>
- <target name="env">
- <!-- If the environment variable FORAY_CONFIG is set, use it. -->
- <condition property="foray.config" value="${env.FORAY_CONFIG}">
- <and>
- <isset property="env.FORAY_CONFIG"/>
- <available file="${env.FORAY_CONFIG}"/>
- </and>
- </condition>
- <!-- Otherwise, set it to the FOray scripts directory. -->
- <property name="foray.config" location="../../scripts"/>
- <echo>foray.config: ${foray.config}</echo>
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="layout"/>
+ <property name="module.dir" value="${foray.home}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/c...
[truncated message content] |
|
From: <vic...@us...> - 2006-09-29 03:27:58
|
Revision: 8241
http://svn.sourceforge.net/foray/?rev=8241&view=rev
Author: victormote
Date: 2006-09-28 20:27:50 -0700 (Thu, 28 Sep 2006)
Log Message:
-----------
Remove the build of hyphenation patterns from the standard builds and from the combined jar file.
Modified Paths:
--------------
trunk/foray/foray-hyphen-r/scripts/build.xml
trunk/foray/scripts/build.xml
Modified: trunk/foray/foray-hyphen-r/scripts/build.xml
===================================================================
--- trunk/foray/foray-hyphen-r/scripts/build.xml 2006-09-29 03:04:33 UTC (rev 8240)
+++ trunk/foray/foray-hyphen-r/scripts/build.xml 2006-09-29 03:27:50 UTC (rev 8241)
@@ -54,10 +54,11 @@
<!--
==============================================================================
- Compile and serialize the hyphenation patterns
+ Parse and serialize the hyphenation patterns
==============================================================================
-->
- <target name="hyphenation" depends="compile" >
+ <target name="hyphenation" depends="compile"
+ description="Parse and serialize the hyphenation patterns">
<path id="hyph-classpath">
<path refid="libs-build-classpath"/>
<pathelement location="${classes.dir}"/>
Modified: trunk/foray/scripts/build.xml
===================================================================
--- trunk/foray/scripts/build.xml 2006-09-29 03:04:33 UTC (rev 8240)
+++ trunk/foray/scripts/build.xml 2006-09-29 03:27:50 UTC (rev 8241)
@@ -107,10 +107,6 @@
dir="${foray.home}/foray-hyphen-r/build/ant/classes">
<include name="**"/>
</fileset>
- <fileset id="foray-hyphen-resources"
- dir="${foray.home}/foray-hyphen-r/build/ant/resource">
- <include name="**"/>
- </fileset>
<fileset id="foray-text-classes"
dir="${foray.home}/foray-text/build/ant/classes">
<include name="**"/>
@@ -158,7 +154,6 @@
<fileset refid="foray-pdf-classes"/>
<fileset refid="foray-font-classes"/>
<fileset refid="foray-hyphen-classes"/>
- <fileset refid="foray-hyphen-resources"/>
<fileset refid="foray-text-classes"/>
<fileset refid="foray-fotree-classes"/>
<fileset refid="foray-areatree-classes"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-09-29 03:43:42
|
Revision: 8242
http://svn.sourceforge.net/foray/?rev=8242&view=rev
Author: victormote
Date: 2006-09-28 20:43:38 -0700 (Thu, 28 Sep 2006)
Log Message:
-----------
Clean up some minor build problems.
Modified Paths:
--------------
trunk/foray/foray-hyphen-r/scripts/build.xml
trunk/foray/foray-text/scripts/build.xml
Modified: trunk/foray/foray-hyphen-r/scripts/build.xml
===================================================================
--- trunk/foray/foray-hyphen-r/scripts/build.xml 2006-09-29 03:27:50 UTC (rev 8241)
+++ trunk/foray/foray-hyphen-r/scripts/build.xml 2006-09-29 03:43:38 UTC (rev 8242)
@@ -48,7 +48,6 @@
<echo message="Preparing the build directories"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
- <mkdir dir="${hyph.build}"/>
</target>
@@ -59,6 +58,7 @@
-->
<target name="hyphenation" depends="compile"
description="Parse and serialize the hyphenation patterns">
+ <mkdir dir="${hyph.build}"/>
<path id="hyph-classpath">
<path refid="libs-build-classpath"/>
<pathelement location="${classes.dir}"/>
@@ -111,7 +111,7 @@
<!-- =================================================================== -->
<!-- Creates the class package -->
<!-- =================================================================== -->
- <target name="package" depends="compile, hyphenation"
+ <target name="package" depends="compile"
description="Generates the jar files (default target)">
<echo message="Creating the jar file ${jar.file}"/>
Modified: trunk/foray/foray-text/scripts/build.xml
===================================================================
--- trunk/foray/foray-text/scripts/build.xml 2006-09-29 03:27:50 UTC (rev 8241)
+++ trunk/foray/foray-text/scripts/build.xml 2006-09-29 03:43:38 UTC (rev 8242)
@@ -43,7 +43,6 @@
<echo message="Preparing the build directories"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
- <mkdir dir="${hyph.build}"/>
</target>
@@ -79,13 +78,8 @@
dir="${foray.home}/foray-text/build/ant/classes">
<include name="**"/>
</fileset>
- <fileset id="foray-text-resources"
- dir="${foray.home}/foray-text/build/ant">
- <include name="hyph/**"/>
- </fileset>
<jar jarfile="${jar.file}">
<fileset refid="foray-text-classes"/>
- <fileset refid="foray-text-resources"/>
<manifest>
<attribute name="Implementation-Title" value="${name}-${module}"/>
<attribute name="Implementation-Version" value="${version}"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-09-30 22:08:06
|
Revision: 8264
http://svn.sourceforge.net/foray/?rev=8264&view=rev
Author: victormote
Date: 2006-09-30 15:08:01 -0700 (Sat, 30 Sep 2006)
Log Message:
-----------
Update the build and runtime version numbers.
Modified Paths:
--------------
trunk/foray/foray-core/src/java/org/foray/core/Application.java
trunk/foray/scripts/build-common.xml
Modified: trunk/foray/foray-core/src/java/org/foray/core/Application.java
===================================================================
--- trunk/foray/foray-core/src/java/org/foray/core/Application.java 2006-09-30 22:04:35 UTC (rev 8263)
+++ trunk/foray/foray-core/src/java/org/foray/core/Application.java 2006-09-30 22:08:01 UTC (rev 8264)
@@ -64,7 +64,7 @@
* @return The current version of the application.
*/
public static String getVersion() {
- return "0.2";
+ return "0.3-dev";
}
/**
Modified: trunk/foray/scripts/build-common.xml
===================================================================
--- trunk/foray/scripts/build-common.xml 2006-09-30 22:04:35 UTC (rev 8263)
+++ trunk/foray/scripts/build-common.xml 2006-09-30 22:08:01 UTC (rev 8264)
@@ -37,7 +37,7 @@
<property name="name.lowercase" value="foray"/>
<property name="contact.info"
value="The FOray project http://www.foray.org"/>
- <property name="version" value="0.2"/>
+ <property name="version" value="0.3-dev"/>
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="off"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-03 01:54:26
|
Revision: 8270
http://svn.sourceforge.net/foray/?rev=8270&view=rev
Author: victormote
Date: 2006-10-02 18:54:03 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
Modify a copy of the parameter, instead of the parameter itself.
Modified Paths:
--------------
trunk/foray/foray-ps/src/java/org/foray/ps/PSInteger.java
trunk/foray/foray-ps/src/java/org/foray/ps/PSInterpreter.java
trunk/foray/foray-ps/src/java/org/foray/ps/PSReal.java
trunk/foray/foray-ps/src/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/java/org/foray/ps/filter/ASCII85Filter.java
trunk/foray/foray-ps/src/java/org/foray/ps/filter/EncryptFilter.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/UserMessage.java
trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/ps/ASCII85OutputStream.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java
trunk/foray/foray-text/src/java/org/foray/text/line/LineBreaker.java
Modified: trunk/foray/foray-ps/src/java/org/foray/ps/PSInteger.java
===================================================================
--- trunk/foray/foray-ps/src/java/org/foray/ps/PSInteger.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-ps/src/java/org/foray/ps/PSInteger.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -203,24 +203,26 @@
* @return The base-10 integral value of this digit in this base, or a -1
* if the digit is not valid in this base.
*/
- private static byte getPlaceValue(final byte base, byte input) {
+ private static byte getPlaceValue(final byte base, final byte input) {
+ byte modifiedInput = input;
// Normalize the letters to be all caps
- if (input >= 'a' && input <= 'z') {
- input -= ' ';
+ if (modifiedInput >= 'a' && modifiedInput <= 'z') {
+ modifiedInput -= ' ';
}
byte placeValue = -1;
/*
* If it is an alphabetic character subtract an extra 7 for the ASCII
* characters between 9 and A.
*/
- if (input >= 'A' && input <= 'Z') {
- placeValue = (byte) (input - 'A' + WKConstants.RADIX_BASE_10);
+ if (modifiedInput >= 'A' && modifiedInput <= 'Z') {
+ placeValue = (byte) (modifiedInput - 'A'
+ + WKConstants.RADIX_BASE_10);
/*
* If a numeral, just subtract the 0x30 that is the difference between
* an ASCII 0 and a integer 0.
*/
- } else if (input >= '0' && input <= '9') {
- placeValue = (byte) (input - '0');
+ } else if (modifiedInput >= '0' && modifiedInput <= '9') {
+ placeValue = (byte) (modifiedInput - '0');
}
// If placeValue is not a valid number in this base, bail out
if (placeValue >= base) {
Modified: trunk/foray/foray-ps/src/java/org/foray/ps/PSInterpreter.java
===================================================================
--- trunk/foray/foray-ps/src/java/org/foray/ps/PSInterpreter.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-ps/src/java/org/foray/ps/PSInterpreter.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -242,7 +242,7 @@
* @throws PSException For invalid parameters.
*/
public PSInterpreter(final Log logger, final PSInput input,
- PSSystemDict systemDict) throws PSException {
+ final PSSystemDict systemDict) throws PSException {
if (input == null) {
logger.error("PostScript Error: No standard input.");
return;
@@ -253,32 +253,33 @@
// Place it on the execution stack.
this.executionStack.push(this.standardInput);
// Get the System Dictionary.
- if (systemDict == null) {
- systemDict = new ReadOnlySystemDict(this);
+ PSSystemDict systemDictToUse = systemDict;
+ if (systemDictToUse == null) {
+ systemDictToUse = new ReadOnlySystemDict(this);
}
// Register this as the parent of the System Dictionary
- systemDict.setPSInterpreter(this);
+ systemDictToUse.setPSInterpreter(this);
// Add the Standard Encoding to the System Dictionary.
PSName name = new PSName(this, "StandardEncoding", false, false);
EncodingVector encoding = EncodingVector.getPredefinedEncoding(
name.getValue());
PSArray array = new PSArray(this, encoding.getGlyphList(),
false);
- systemDict.addItem(name, array);
+ systemDictToUse.addItem(name, array);
// Add the ISO Latin 1 Encoding to the System Dictionary.
name = new PSName(this, "ISOLatin1Encoding", false, false);
encoding = EncodingVector.getPredefinedEncoding(name.getValue());
array = new PSArray(this, encoding.getGlyphList(), false);
- systemDict.addItem(name, array);
+ systemDictToUse.addItem(name, array);
// Add the System Dictionary to the dictionary stack.
- this.dictionaryStack.push(systemDict);
+ this.dictionaryStack.push(systemDictToUse);
/*
* Add "systemdict" as an entry in itself. See PLRM2, Section 8.2,
* "systemdict" entry. It is not an operator, but is an element in the
* systemdict dictionary.
*/
name = new PSName(this, "systemdict", false, false);
- systemDict.addItem(name, systemDict);
+ systemDictToUse.addItem(name, systemDictToUse);
// Create a Global Dictionary & push it on the dictionary Stack.
PSDictionary newDict = new PSDictionary(this, 0);
this.dictionaryStack.push(newDict);
@@ -288,7 +289,7 @@
* systemdict dictionary.
*/
name = new PSName(this, "globaldict", false, false);
- systemDict.addItem(name, newDict);
+ systemDictToUse.addItem(name, newDict);
// Create a User Dictionary & push it on the dictionary Stack.
newDict = new PSDictionary(this, 0);
this.dictionaryStack.push(newDict);
@@ -298,7 +299,7 @@
* systemdict dictionary.
*/
name = new PSName(this, "userdict", false, false);
- systemDict.addItem(name, newDict);
+ systemDictToUse.addItem(name, newDict);
/*
* Create an "internaldict".
* The need for this is inferred from the internaldict operator
Modified: trunk/foray/foray-ps/src/java/org/foray/ps/PSReal.java
===================================================================
--- trunk/foray/foray-ps/src/java/org/foray/ps/PSReal.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-ps/src/java/org/foray/ps/PSReal.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -207,20 +207,21 @@
* @param doubleValue The double primitive to format.
* @return The double primitive as PostScript output.
*/
- public static String doubleOut(double doubleValue) {
+ public static String doubleOut(final double doubleValue) {
final StringBuffer p = new StringBuffer();
- if (doubleValue < 0) {
- doubleValue = -doubleValue;
+ double modifiedDoubleValue = doubleValue;
+ if (modifiedDoubleValue < 0) {
+ modifiedDoubleValue = -modifiedDoubleValue;
p.append("-");
}
- final double trouble = doubleValue % 1;
+ final double trouble = modifiedDoubleValue % 1;
if (trouble > 0.950) {
- p.append((int) doubleValue + 1);
+ p.append((int) modifiedDoubleValue + 1);
} else if (trouble < 0.050) {
- p.append((int) doubleValue);
+ p.append((int) modifiedDoubleValue);
} else {
- final String doubleString = Double.toString(doubleValue);
+ final String doubleString = Double.toString(modifiedDoubleValue);
final int decimal = doubleString.indexOf(".");
if (decimal != -1) {
p.append(doubleString.substring(0, decimal));
@@ -245,20 +246,21 @@
* the value should be 8.
* @return The double primitive as PostScript output.
*/
- public static String doubleOut(double doubleValue, final int radix) {
+ public static String doubleOut(final double doubleValue, final int radix) {
final StringBuffer p = new StringBuffer();
- if (doubleValue < 0) {
- doubleValue = -doubleValue;
+ double modifiedDoubleValue = doubleValue;
+ if (modifiedDoubleValue < 0) {
+ modifiedDoubleValue = -modifiedDoubleValue;
p.append("-");
}
- final double trouble = doubleValue % 1;
+ final double trouble = modifiedDoubleValue % 1;
if (trouble > (1.0 - (5.0 / (Math.pow(10.0, radix))))) {
- p.append((int) doubleValue + 1);
+ p.append((int) modifiedDoubleValue + 1);
} else if (trouble < (5.0 / (Math.pow(10.0, radix)))) {
- p.append((int) doubleValue);
+ p.append((int) modifiedDoubleValue);
} else {
- final String doubleString = Double.toString(doubleValue);
+ final String doubleString = Double.toString(modifiedDoubleValue);
final int decimal = doubleString.indexOf(".");
if (decimal != -1) {
p.append(doubleString.substring(0, decimal));
Modified: trunk/foray/foray-ps/src/java/org/foray/ps/encode/EncodingParser.java
===================================================================
--- trunk/foray/foray-ps/src/java/org/foray/ps/encode/EncodingParser.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-ps/src/java/org/foray/ps/encode/EncodingParser.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -462,17 +462,18 @@
* @param minimumPad The minimum padding size that should be added.
* @return The padded String.
*/
- public static String padSpaces(String string, final int desiredColumn,
+ public static String padSpaces(final String string, final int desiredColumn,
final int minimumPad) {
/* The String length + 1 is the next column that will be written if
* no padding is added. */
int spacesToPad = desiredColumn - (string.length() + 1);
spacesToPad = Math.max(spacesToPad, minimumPad);
+ String modifiedString = string;
while (spacesToPad > 0) {
- string = string + " ";
+ modifiedString = modifiedString + " ";
spacesToPad--;
}
- return string;
+ return modifiedString;
}
/**
Modified: trunk/foray/foray-ps/src/java/org/foray/ps/filter/ASCII85Filter.java
===================================================================
--- trunk/foray/foray-ps/src/java/org/foray/ps/filter/ASCII85Filter.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-ps/src/java/org/foray/ps/filter/ASCII85Filter.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -139,28 +139,28 @@
* values of 0)
* @throws PSFilterException If an illegal character is found in the input.
*/
- private byte[] convertWord(long word) throws PSFilterException {
- word = word & 0xffffffff;
- if (word < 0) {
- word = -word;
+ private byte[] convertWord(final long word) throws PSFilterException {
+ long wordMasked = word & 0xffffffff;
+ if (wordMasked < 0) {
+ wordMasked = -wordMasked;
}
- if (word == 0) {
+ if (wordMasked == 0) {
final byte[] result = { (byte) ASCII85Filter.ASCII85_ZERO };
return result;
}
- final byte c5 = (byte) ((word % ASCII85Filter.BASE_85_4)
+ final byte c5 = (byte) ((wordMasked % ASCII85Filter.BASE_85_4)
+ ASCII85Filter.ASCII85_START);
- word = word / ASCII85Filter.BASE_85_4;
- final byte c4 = (byte) ((word % ASCII85Filter.BASE_85_4)
+ wordMasked = wordMasked / ASCII85Filter.BASE_85_4;
+ final byte c4 = (byte) ((wordMasked % ASCII85Filter.BASE_85_4)
+ ASCII85Filter.ASCII85_START);
- word = word / ASCII85Filter.BASE_85_4;
- final byte c3 = (byte) ((word % ASCII85Filter.BASE_85_4)
+ wordMasked = wordMasked / ASCII85Filter.BASE_85_4;
+ final byte c3 = (byte) ((wordMasked % ASCII85Filter.BASE_85_4)
+ ASCII85Filter.ASCII85_START);
- word = word / ASCII85Filter.BASE_85_4;
- final byte c2 = (byte) ((word % ASCII85Filter.BASE_85_4)
+ wordMasked = wordMasked / ASCII85Filter.BASE_85_4;
+ final byte c2 = (byte) ((wordMasked % ASCII85Filter.BASE_85_4)
+ ASCII85Filter.ASCII85_START);
- word = word / ASCII85Filter.BASE_85_4;
- final byte c1 = (byte) ((word % ASCII85Filter.BASE_85_4)
+ wordMasked = wordMasked / ASCII85Filter.BASE_85_4;
+ final byte c1 = (byte) ((wordMasked % ASCII85Filter.BASE_85_4)
+ ASCII85Filter.ASCII85_START);
final byte[] ret = { c1 , c2, c3, c4, c5 };
Modified: trunk/foray/foray-ps/src/java/org/foray/ps/filter/EncryptFilter.java
===================================================================
--- trunk/foray/foray-ps/src/java/org/foray/ps/filter/EncryptFilter.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-ps/src/java/org/foray/ps/filter/EncryptFilter.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -157,14 +157,12 @@
/**
* {@inheritDoc}
*/
- public byte[] decode(byte[] input) throws PSFilterException {
+ public byte[] decode(final byte[] input) throws PSFilterException {
if (! this.formatResolved) {
resolveFormat(input);
- /*
- * If the format is not yet resolved, it is because we don't have
- * all of the first 4 bytes are yet. Fill the input array with
- * spaces and return it.
- */
+ /* If the format is not yet resolved, it is because we don't have
+ * all of the first 4 bytes yet. Fill the input array with spaces
+ * and return it. */
if (! this.formatResolved) {
for (int i = 0; i < input.length; i++) {
input[i] = ' ';
@@ -172,16 +170,17 @@
return input;
}
}
+ byte[] output = input;
if (this.hexFormat) {
if (this.hexFilter == null) {
this.hexFilter = new ASCIIHexFilter();
}
- input = this.hexFilter.decode(input);
+ output = this.hexFilter.decode(input);
}
for (int i = 0; i < input.length; i++) {
- input[i] = decrypt(input[i]);
+ output[i] = decrypt(input[i]);
}
- return input;
+ return output;
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/UserMessage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/UserMessage.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/UserMessage.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -132,7 +132,7 @@
/**
* Ersetzt die eventuellen Platzhalter durch die übergebenen Parameter
*/
- String prepareMessage(String rawText, final String[] par) {
+ String prepareMessage(final String rawText, final String[] par) {
logger.info("prepareMessage(): " + rawText + ", parameter: "
+ par);
int index = rawText.indexOf(PARAMETER_TAG);
@@ -155,6 +155,7 @@
return rawText;
}
int tagCount = 0;
+ String modifiedText = rawText;
while (rawText.indexOf(PARAMETER_TAG) != -1) {
index = rawText.indexOf(PARAMETER_TAG);
try {
@@ -166,10 +167,10 @@
ex.printStackTrace();
return composedMess + rawText;
}
- rawText = rawText.substring(index + PARAMETER_TAG.length());
+ modifiedText = rawText.substring(index + PARAMETER_TAG.length());
tagCount++;
}
- composedMess += rawText;
+ composedMess += modifiedText;
if (tagCount != par.length) {
logger.info("Die zu der Meldung " + actMessId
+ " übergebenen Parameter sind mehr als die Meldung "
Modified: trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -162,24 +162,28 @@
/**
* {@inheritDoc}
*/
- protected void drawRectangle(final int x, final int y, int w, int h,
- final boolean stroke, final Color strokeColor,
+ protected void drawRectangle(final int x, final int y, final int w,
+ final int h, final boolean stroke, final Color strokeColor,
final boolean fill, final Color fillColor) {
- if ((h >= 0 && h < 720) || (h < 0 && h > -720) || w < 720) {
- if (w < 720) {
- w = 720;
+ int width = w;
+ int height = h;
+ if ((height >= 0 && height < 720)
+ || (height < 0 && height > -720)
+ || width < 720) {
+ if (width < 720) {
+ width = 720;
}
- if (h > 0 && h < 720) {
- h = 720;
- } else if (h < 0 && h > -720) {
- h = -720;
+ if (height > 0 && height < 720) {
+ height = 720;
+ } else if (height < 0 && height > -720) {
+ height = -720;
}
- addRect(x, y, w, h, strokeColor, strokeColor);
+ addRect(x, y, width, height, strokeColor, strokeColor);
} else {
- addRect(x, y, w, 720, strokeColor, strokeColor);
- addRect(x, y, 720, h, strokeColor, strokeColor);
- addRect(x + w - 720, y, 720, h, strokeColor, strokeColor);
- addRect(x, y - h + 720, w, 720, strokeColor, strokeColor);
+ addRect(x, y, width, 720, strokeColor, strokeColor);
+ addRect(x, y, 720, height, strokeColor, strokeColor);
+ addRect(x + width - 720, y, 720, height, strokeColor, strokeColor);
+ addRect(x, y - height + 720, width, 720, strokeColor, strokeColor);
}
}
@@ -193,15 +197,17 @@
* @param fill the fill color/gradient
* @param stroke the stroke color/gradient
*/
- protected void addRect(final int x, int y, final int w, int h,
+ protected void addRect(final int x, final int y, final int w, final int h,
final Color stroke, final Color fill) {
- if ((w == 0) || (h == 0)) {
+ int modifiedY = y;
+ int height = h;
+ if ((w == 0) || (height == 0)) {
return;
}
- if (h < 0) {
- h *= -1;
+ if (height < 0) {
+ height *= -1;
} else {
- y += h;
+ modifiedY += height;
}
final int lineshade = (int) (100 - ((0.3f * stroke.getRed()
@@ -218,19 +224,19 @@
}
currentStream.add("\033*v1O\033&a" + xpos + "h"
- + (pageHeight - (y / 100)) + "V" + "\033*c"
- + (w / 100) + "h" + (h / 100) + "V" + "\033*c"
+ + (pageHeight - (modifiedY / 100)) + "V" + "\033*c"
+ + (w / 100) + "h" + (height / 100) + "V" + "\033*c"
+ lineshade + "G" + "\033*c2P");
- if (fillshade != lineshade && (w >= 720 || h >= 720)) {
+ if (fillshade != lineshade && (w >= 720 || height >= 720)) {
xpos = xoffset + ((x + 240) / 100);
if (xpos < 0) {
xpos = 0;
getLogger().warn("Horizontal position out of bounds.");
}
currentStream.add("\033&a" + xpos + "h"
- + (pageHeight - ((y + 240)) / 100) + "V"
+ + (pageHeight - ((modifiedY + 240)) / 100) + "V"
+ "\033*c" + ((w - 480) / 100) + "h"
- + ((h - 480) / 100) + "V" + "\033*c"
+ + ((height - 480) / 100) + "V" + "\033*c"
+ fillshade + "G" + "\033*c2P");
}
// Reset pattern transparency mode.
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/ASCII85OutputStream.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/ASCII85OutputStream.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/ASCII85OutputStream.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -140,31 +140,33 @@
* @return 5 bytes (or a single byte of the 'z' character for word
* values of 0)
*/
- private byte[] convertWord(long word) throws IOException {
- word = word & 0xffffffff;
+ private byte[] convertWord(final long word) throws IOException {
+ long maskedWord = word & 0xffffffff;
- if (word == 0) {
+ if (maskedWord == 0) {
return ASCII85OutputStream.ZERO_ARRAY;
}
- if (word < 0) {
- word = -word;
+ if (maskedWord < 0) {
+ maskedWord = -maskedWord;
}
- final byte c1 = (byte) ((word / ASCII85OutputStream.BASE_85_1) & 0xFF);
- final byte c2 = (byte) (((word - (c1 * ASCII85OutputStream.BASE_85_1))
+ final byte c1 = (byte) ((maskedWord / ASCII85OutputStream.BASE_85_1)
+ & 0xFF);
+ final byte c2 = (byte) (((maskedWord - (
+ c1 * ASCII85OutputStream.BASE_85_1))
/ ASCII85OutputStream.BASE_85_2) & 0xFF);
final byte c3 =
- (byte) (((word - (c1 * ASCII85OutputStream.BASE_85_1)
+ (byte) (((maskedWord - (c1 * ASCII85OutputStream.BASE_85_1)
- (c2 * ASCII85OutputStream.BASE_85_2))
/ ASCII85OutputStream.BASE_85_3)
& 0xFF);
final byte c4 =
- (byte) (((word - (c1 * ASCII85OutputStream.BASE_85_1)
+ (byte) (((maskedWord - (c1 * ASCII85OutputStream.BASE_85_1)
- (c2 * ASCII85OutputStream.BASE_85_2)
- (c3 * ASCII85OutputStream.BASE_85_3))
/ ASCII85OutputStream.BASE_85_4)
& 0xFF);
final byte c5 =
- (byte) (((word - (c1 * ASCII85OutputStream.BASE_85_1)
+ (byte) (((maskedWord - (c1 * ASCII85OutputStream.BASE_85_1)
- (c2 * ASCII85OutputStream.BASE_85_2)
- (c3 * ASCII85OutputStream.BASE_85_3)
- (c4 * ASCII85OutputStream.BASE_85_4)))
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -413,14 +413,15 @@
}
protected void addFilledRect(final int x, final int y, final int w,
- int h, final Color col) {
+ final int h, final Color col) {
// XXX: cater for braindead, legacy -ve heights
- if (h < 0) {
- h = -h;
+ int height = h;
+ if (height < 0) {
+ height = -height;
}
write("newpath");
- write(x + " " + y + " " + w + " " + -h + " re");
+ write(x + " " + y + " " + w + " " + -height + " re");
/*
write(x + " " + y + " M");
write(w + " 0 rlineto");
Modified: trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2006-10-02 23:57:40 UTC (rev 8269)
+++ trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2006-10-03 01:54:03 UTC (rev 8270)
@@ -101,7 +101,8 @@
super(logger, renderConfig);
}
- void addStr(int row, int col, String str, final boolean ischar) {
+ void addStr(final int row, final int col, final String str,
+ final boolean ischar) {
if (this.debug) {
getLogger().info("TXTRenderer.addStr(" + row + ", " + col
+ ", \"" + str + "\", " + ischar + ")");
@@ -110,45 +111,50 @@
return;
}
StringBuffer sb;
+ int modifiedRow = row;
if (row < 0) {
- row = 0;
+ modifiedRow = 0;
}
if (ischar) {
- sb = this.charData[row];
+ sb = this.charData[modifiedRow];
} else {
- sb = this.decoData[row];
+ sb = this.decoData[modifiedRow];
}
if (sb == null) {
sb = new StringBuffer();
}
+ int modifiedColumn = col;
if ((col + str.length()) > this.maxX) {
- col = this.maxX - str.length();
+ modifiedColumn = this.maxX - str.length();
}
+ String modifiedString = str;
if (col < 0) {
- col = 0;
+ modifiedColumn = 0;
if (str.length() > this.maxX) {
- str = str.substring(0, this.maxX);
+ modifiedString = str.substring(0, this.maxX);
}
}
// Pad to col
- for (int countr = sb.length(); countr < col; countr++) {
+ for (int countr = sb.length(); countr < modifiedColumn; countr++) {
sb.append(' ');
}
getLogger().debug("TXTRenderer.addStr() sb.length()=" + sb.length());
- for (int countr = col; countr < (col + str.length()); countr++) {
+ for (int countr = modifiedColumn;
+ countr < (modifiedColumn + modifiedString.length()); countr++) {
if (countr >= sb.length()) {
- sb.append(str.charAt(countr - col));
+ sb.append(modifiedString.charAt(countr - modifiedColumn));
} else {
getLogger().debug("TXTRenderer.addStr() sb.length()="
+ sb.length() + " countr=" + countr);
- sb.setCharAt(countr, str.charAt(countr - col));
+ sb.setCharAt(countr, modifiedString.charAt(
+ countr - modifiedColumn));
}
}
if (ischar) {
- this.charData[row] = sb;
+ this.charData[modifiedRow] = sb;
} else {
- this.decoData[row] = sb;
+ this.decoData[modifiedRow] = sb;
}
}
@@ -196,25 +202,27 @@
* @param h the height in millipoints
* @param stroke the stroke color/gradient
*/
- protected void drawRectangle(final int x, final int y, int w, int h,
- final Color stroke) {
- if (h < 0) {
- h *= -1;
+ protected void drawRectangle(final int x, final int y, final int w,
+ final int h, final Color stroke) {
+ int width = w;
+ int height = h;
+ if (height < 0) {
+ height *= -1;
}
- if (h < 720 || w < 720) {
- if (w < 720) {
- w = 720;
+ if (height < 720 || width < 720) {
+ if (width < 720) {
+ width = 720;
}
- if (h < 720) {
- h = 720;
+ if (height < 720) {
+ height = 720;
}
- addRect(x, y, w, h, stroke, stroke);
+ addRect(x, y, width, height, stroke, stroke);
} else {
- addRect(x, y, w, 720, stroke, stroke);
- addRect(x, y, 720, h, stroke, stroke);
- addRect(x + w - 720, y, 720, h, stroke, stroke);
- addRect(x, y - h + 720, w, 720, stroke, stroke);
+ addRect(x, y, width, 720, stroke, stroke);
+ addRect(x, y, 720, height, stroke, stroke);
+ addRect(x + width - 720, y, 720, height, stroke, stroke);
+ addRect(x, y - height + 720, width, 720, stroke, stroke);
}
}
@@ -228,13 +236,14 @@
* @param fill the fill color/gradient
* @param stroke the stroke color/gradient
*/
- protected void addRect(final int x, final int y, final int w, int h,
+ protected void addRect(final int x, final int y, final int w, final int h,
final Color stroke, final Color fill) {
if ((w == 0) || (h == 0)) {
return;
}
- if (h < 0) {
- h *= -1;
+ int height = h;
+ if (height < 0) {
+ height *= -1;
}
final int row = (int) ((this.pageHeight - (y / 100)) * 100
@@ -247,8 +256,8 @@
final int fillshade = (int) (100 - ((0.3f * fill.getRed()
+ 0.59f * fill.getGreen() + 0.11f * fill.getBlue()) * 100f));
getLogger().debug("TXTRenderer.addRect(" + x + ", " + y + ", "
- + w + ", " + h + ", " + stroke + ", " + fill + ") fillshade="
- + fillshade);
+ + w + ", " + height + ", " + stroke + ", " + fill
+ + ") fillshade=" + fillshade);
char fillchar = ' ';
if (fillshade >= 75) {
fillchar = '#';
@@ -262,16 +271,16 @@
if (fillchar != ' ') {
final StringBuffer linefill = new StringBuffer();
final int sw = (int) (w * this.xFactor);
- final int sh = (int) (h * this.yFactor);
+ final int sh = (int) (height * this.yFactor);
if (sw == 0 || sh == 0) {
if (fillshade >= 50) {
- if (h > w) {
+ if (height > w) {
...
[truncated message content] |
|
From: <vic...@us...> - 2006-10-03 02:12:58
|
Revision: 8271
http://svn.sourceforge.net/foray/?rev=8271&view=rev
Author: victormote
Date: 2006-10-02 19:12:50 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
Modify a copy of the parameter, instead of the parameter itself.
Modified Paths:
--------------
trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java
Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
===================================================================
--- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-10-03 01:54:03 UTC (rev 8270)
+++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-10-03 02:12:50 UTC (rev 8271)
@@ -103,7 +103,7 @@
Region region, RegionArea area) throws AreaWException;
public void handleLineBreakText(final LineOutput lineOutput,
- LineText text, final int startOffset, final int sizeInChars,
+ final LineText text, final int startOffset, final int sizeInChars,
final int sizeInline, final boolean hasDiscretionaryHyphen,
final boolean hasFauxSmallCaps, final boolean isLastItemOnLine)
throws TextException {
@@ -111,13 +111,14 @@
final LineArea lineArea = (LineArea) lineOutput;
RetrieveMarker retrieveMarker = null;
- if (text instanceof org.axsl.foR.FOLineText) {
- final FOLineText foLineText = (FOLineText) text;
+ LineText textToUse = text;
+ if (textToUse instanceof org.axsl.foR.FOLineText) {
+ final FOLineText foLineText = (FOLineText) textToUse;
retrieveMarker = foLineText.getRetrieveMarker();
- text = foLineText.getWrapped();
+ textToUse = foLineText.getWrapped();
}
- if (text instanceof FOText) {
- final FOText foText = (FOText) text;
+ if (textToUse instanceof FOText) {
+ final FOText foText = (FOText) textToUse;
lineArea.makeTextArea(foText, sizeInline, startOffset, sizeInChars,
hasDiscretionaryHyphen, hasFauxSmallCaps, isLastItemOnLine,
retrieveMarker);
@@ -127,33 +128,36 @@
}
public void handleLineBreakNonText(final LineOutput lineOutput,
- LineNonText nonText, final int sizeInline)
+ final LineNonText nonText, final int sizeInline)
throws TextException {
checkLayoutTarget(lineOutput);
final LineArea lineArea = (LineArea) lineOutput;
RetrieveMarker retrieveMarker = null;
- if (nonText instanceof org.axsl.foR.FOLineNonText) {
- final FOLineNonText foLineNonText = (FOLineNonText) nonText;
+ LineNonText nonTextToUse = nonText;
+ if (nonTextToUse instanceof org.axsl.foR.FOLineNonText) {
+ final FOLineNonText foLineNonText = (FOLineNonText) nonTextToUse;
retrieveMarker = foLineNonText.getRetrieveMarker();
- nonText = foLineNonText.getWrapped();
+ nonTextToUse = foLineNonText.getWrapped();
}
- if (nonText instanceof InstreamForeignObject) {
- final InstreamForeignObject ifo = (InstreamForeignObject) nonText;
+ if (nonTextToUse instanceof InstreamForeignObject) {
+ final InstreamForeignObject ifo = (InstreamForeignObject)
+ nonTextToUse;
lineArea.makeForeignObjectArea(ifo, sizeInline, retrieveMarker);
- } else if (nonText instanceof ExternalGraphic) {
- final ExternalGraphic graphic = (ExternalGraphic) nonText;
+ } else if (nonTextToUse instanceof ExternalGraphic) {
+ final ExternalGraphic graphic = (ExternalGraphic) nonTextToUse;
lineArea.makeExternalGraphicArea(graphic, sizeInline,
retrieveMarker);
- } else if (nonText instanceof Leader) {
- final Leader leader = (Leader) nonText;
+ } else if (nonTextToUse instanceof Leader) {
+ final Leader leader = (Leader) nonTextToUse;
lineArea.makeLeaderArea(leader, sizeInline, retrieveMarker);
- } else if (nonText instanceof PageNumberCitation) {
- final PageNumberCitation citation = (PageNumberCitation) nonText;
+ } else if (nonTextToUse instanceof PageNumberCitation) {
+ final PageNumberCitation citation = (PageNumberCitation)
+ nonTextToUse;
lineArea.makePageNumberCitationArea(citation, sizeInline,
retrieveMarker);
- } else if (nonText instanceof PageNumber) {
- final PageNumber pageNumber = (PageNumber) nonText;
+ } else if (nonTextToUse instanceof PageNumber) {
+ final PageNumber pageNumber = (PageNumber) nonTextToUse;
lineArea.makePageNumberArea(pageNumber, sizeInline, retrieveMarker);
}
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2006-10-03 01:54:03 UTC (rev 8270)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2006-10-03 02:12:50 UTC (rev 8271)
@@ -274,14 +274,14 @@
}
}
- private byte [] encryptWithHash(final byte [] data, byte [] hash,
+ private byte [] encryptWithHash(final byte [] data, final byte [] hash,
final int size) {
- hash = digest.digest(hash);
+ final byte[] hashToUse = digest.digest(hash);
final byte [] key = new byte[size];
for (int i = 0; i < size; i++) {
- key[i] = hash[i];
+ key[i] = hashToUse[i];
}
return encryptWithKey(data, key);
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2006-10-03 01:54:03 UTC (rev 8270)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2006-10-03 02:12:50 UTC (rev 8271)
@@ -82,7 +82,8 @@
* @param buffer
* @param glyphIndex
*/
- private void addCharToBuffer(final StringBuffer buffer, int glyphIndex) {
+ private void addCharToBuffer(final StringBuffer buffer,
+ final int glyphIndex) {
final Font font = this.font.getFontUse().getFont();
if (font.getFontComplexity() == Font.FONT_COMPOSITE) {
buffer.append(PDFString.getUnicodeString(glyphIndex));
@@ -94,10 +95,11 @@
buffer.append(Integer.toOctalString(glyphIndex));
return;
}
- if (glyphIndex < 0) {
- glyphIndex = ' ';
+ int glyphIndexToUse = glyphIndex;
+ if (glyphIndexToUse < 0) {
+ glyphIndexToUse = ' ';
}
- final char c = (char) glyphIndex;
+ final char c = (char) glyphIndexToUse;
switch (c) {
case '(':
case ')':
@@ -154,15 +156,16 @@
* @param c character to be converted
* @return the string representation of the character
*/
- public static String getUnicodeString(int c) {
+ public static String getUnicodeString(final int c) {
StringBuffer buf = new StringBuffer(4);
byte[] uniBytes = null;
+ int codePoint = c;
/* TODO: Handle Unicode characters > 0xFFFF better. */
- if (c < Character.MIN_VALUE
- || c > Character.MAX_VALUE) {
- c = ' ';
+ if (codePoint < Character.MIN_VALUE
+ || codePoint > Character.MAX_VALUE) {
+ codePoint = ' ';
}
- final char[] a = {(char) c};
+ final char[] a = {(char) codePoint};
try {
uniBytes = new String(a).getBytes("UnicodeBigUnmarked");
} catch (final Exception e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-03 02:17:22
|
Revision: 8272
http://svn.sourceforge.net/foray/?rev=8272&view=rev
Author: victormote
Date: 2006-10-02 19:17:13 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
Modify a copy of the parameter, instead of the parameter itself.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java
trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java
trunk/foray/foray-core/src/java/org/foray/core/FOrayDocument.java
Modified: trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-10-03 02:12:50 UTC (rev 8271)
+++ trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-10-03 02:17:13 UTC (rev 8272)
@@ -162,7 +162,7 @@
- private SecureResourceBundle getResourceBundle(String path) {
+ private SecureResourceBundle getResourceBundle(final String path) {
InputStream in = null;
try {
@@ -171,11 +171,12 @@
/* The following code was added by Alex Alishevskikh
* [al...@op...] to fix for crashes on machines with
* unsupported user languages */
- if (url == null) {
+ String modifiedPath = path;
+ if (url == null) {
/* if the given resource file not found, the english resource
* uses as default */
- path = path.substring(0, path.lastIndexOf(".")) + ".en";
- url = getClass().getResource(path);
+ modifiedPath = path.substring(0, path.lastIndexOf(".")) + ".en";
+ url = getClass().getResource(modifiedPath);
}
in = url.openStream();
Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-10-03 02:12:50 UTC (rev 8271)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-10-03 02:17:13 UTC (rev 8272)
@@ -91,14 +91,15 @@
return frame;
}
- private SecureResourceBundle getResourceBundle(String path)
+ private SecureResourceBundle getResourceBundle(final String path)
throws IOException {
URL url = getClass().getResource(path);
+ String modifiedPath = path;
if (url == null) {
/* if the given resource file not found, the english resource uses
* as default */
- path = path.substring(0, path.lastIndexOf(".")) + ".en";
- url = getClass().getResource(path);
+ modifiedPath = path.substring(0, path.lastIndexOf(".")) + ".en";
+ url = getClass().getResource(modifiedPath);
}
return new SecureResourceBundle(url.openStream(), getLogger());
}
Modified: trunk/foray/foray-core/src/java/org/foray/core/FOrayDocument.java
===================================================================
--- trunk/foray/foray-core/src/java/org/foray/core/FOrayDocument.java 2006-10-03 02:12:50 UTC (rev 8271)
+++ trunk/foray/foray-core/src/java/org/foray/core/FOrayDocument.java 2006-10-03 02:17:13 UTC (rev 8272)
@@ -126,14 +126,14 @@
* creating one.
*/
public FOrayDocument(final FOraySession session,
- final InputSource inputSource, XMLReader parser)
+ final InputSource inputSource, final XMLReader parser)
throws FOrayException {
this(session);
this.inputSource = inputSource;
+ this.parser = parser;
if (parser == null) {
- parser = this.createParser();
+ this.parser = this.createParser();
}
- this.parser = parser;
this.parser.setContentHandler(treeBuilder);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-03 02:34:43
|
Revision: 8273
http://svn.sourceforge.net/foray/?rev=8273&view=rev
Author: victormote
Date: 2006-10-02 19:34:32 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
Modify a copy of the parameter, instead of the parameter itself.
Modified Paths:
--------------
trunk/foray/foray-common/src/java/org/foray/common/RandomReader.java
trunk/foray/foray-common/src/java/org/foray/common/RandomReaderArray.java
trunk/foray/foray-common/src/java/org/foray/common/url/URLFactory.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphenation.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/HyphenationTree.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/TernaryTree.java
Modified: trunk/foray/foray-common/src/java/org/foray/common/RandomReader.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/RandomReader.java 2006-10-03 02:17:13 UTC (rev 8272)
+++ trunk/foray/foray-common/src/java/org/foray/common/RandomReader.java 2006-10-03 02:34:32 UTC (rev 8273)
@@ -341,18 +341,18 @@
* @return The read String.
* @throws IOException For I/O error.
*/
- public String readString(final int stringSize, String charEncoding)
+ public String readString(final int stringSize, final String charEncoding)
throws IOException {
if ((stringSize + getFilePointer()) > length()) {
throw new EOFException("Reached EOF, file size="
+ length());
}
- charEncoding = stringEncodingToUse(charEncoding);
+ final String charEncodingToUse = stringEncodingToUse(charEncoding);
final byte[] tmp = new byte[stringSize];
for (int i = 0; i < stringSize; i++) {
tmp[i] = readByte();
}
- return new String(tmp, charEncoding);
+ return new String(tmp, charEncodingToUse);
}
/**
Modified: trunk/foray/foray-common/src/java/org/foray/common/RandomReaderArray.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/RandomReaderArray.java 2006-10-03 02:17:13 UTC (rev 8272)
+++ trunk/foray/foray-common/src/java/org/foray/common/RandomReaderArray.java 2006-10-03 02:34:32 UTC (rev 8273)
@@ -148,15 +148,16 @@
/**
* {@inheritDoc}
*/
- public final void readFully(final byte[] b, final int off, int len)
+ public final void readFully(final byte[] b, final int off, final int len)
throws IOException {
+ int lengthToUse = len;
boolean eofDetected = false;
- if (this.arrayIndex + len >= this.byteArray.length) {
+ if (this.arrayIndex + lengthToUse >= this.byteArray.length) {
eofDetected = true;
- len = this.byteArray.length - this.arrayIndex;
+ lengthToUse = this.byteArray.length - this.arrayIndex;
}
- System.arraycopy(this.byteArray, this.arrayIndex, b, off, len);
- this.arrayIndex += len;
+ System.arraycopy(this.byteArray, this.arrayIndex, b, off, lengthToUse);
+ this.arrayIndex += lengthToUse;
if (eofDetected) {
throw new EOFException();
}
Modified: trunk/foray/foray-common/src/java/org/foray/common/url/URLFactory.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/url/URLFactory.java 2006-10-03 02:17:13 UTC (rev 8272)
+++ trunk/foray/foray-common/src/java/org/foray/common/url/URLFactory.java 2006-10-03 02:34:32 UTC (rev 8273)
@@ -100,14 +100,15 @@
* java.net.URLStreamHandler) which this method mimics.
*/
public static URL createURL(final String protocol, final String host,
- final int port, final String file, URLStreamHandler handler)
+ final int port, final String file, final URLStreamHandler handler)
throws MalformedURLException {
- if (handler == null) {
+ URLStreamHandler handlerToUse = handler;
+ if (handlerToUse == null) {
/* Interposes to use the custom URLStreamHandler registration. */
- handler = getCustomURLStreamHandler(protocol);
+ handlerToUse = getCustomURLStreamHandler(protocol);
}
/* Now uses the regular URL constructor. */
- return new URL(protocol, host, port, file, handler);
+ return new URL(protocol, host, port, file, handlerToUse);
}
/**
@@ -151,14 +152,15 @@
* which this method mimics.
*/
public static URL createURL(final URL context, final String spec,
- URLStreamHandler handler) throws MalformedURLException {
- if (handler == null) {
+ final URLStreamHandler handler) throws MalformedURLException {
+ URLStreamHandler handlerToUse = handler;
+ if (handlerToUse == null) {
/* Interposes to use the custom URLStreamHandler registration. */
final String protocol = parseProtocol(spec);
- handler = getCustomURLStreamHandler(protocol);
+ handlerToUse = getCustomURLStreamHandler(protocol);
}
/* Now uses the regular URL constructor. */
- return new URL(context, spec, handler);
+ return new URL(context, spec, handlerToUse);
}
/**
Modified: trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphenation.java
===================================================================
--- trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphenation.java 2006-10-03 02:17:13 UTC (rev 8272)
+++ trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphenation.java 2006-10-03 02:34:32 UTC (rev 8273)
@@ -109,20 +109,21 @@
* handle any positive input).
* @return A value that reflects the numeric weight of the raw Liang value.
*/
- public static byte convertLiangToWeight(byte liangValue)
+ public static byte convertLiangToWeight(final byte liangValue)
throws HyphenationException {
if (liangValue < 0) {
throw new HyphenationException("Invalid Liang input: "
+ liangValue);
}
+ byte modifiedLiangValue = liangValue;
/* Save the low-order bit. */
- final boolean good = (liangValue & 1) == 1;
- liangValue ++;
- liangValue /= 2;
+ final boolean good = (modifiedLiangValue & 1) == 1;
+ modifiedLiangValue ++;
+ modifiedLiangValue /= 2;
if (! good) {
- liangValue *= -1;
+ modifiedLiangValue *= -1;
}
- return liangValue;
+ return modifiedLiangValue;
}
/**
Modified: trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/HyphenationTree.java
===================================================================
--- trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/HyphenationTree.java 2006-10-03 02:17:13 UTC (rev 8272)
+++ trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/HyphenationTree.java 2006-10-03 02:34:32 UTC (rev 8273)
@@ -115,9 +115,10 @@
return offset;
}
- protected String unpackValues(int k) {
+ protected String unpackValues(final int k) {
final StringBuffer buf = new StringBuffer();
- byte v = vspace.get(k++);
+ int kIndex = k;
+ byte v = vspace.get(kIndex++);
while (v != 0) {
char c = (char) ((v >>> 4) - 1 + '0');
buf.append(c);
@@ -127,7 +128,7 @@
}
c = (char) (c - 1 + '0');
buf.append(c);
- v = vspace.get(k++);
+ v = vspace.get(kIndex++);
}
return buf.toString();
}
@@ -164,21 +165,25 @@
* String compare, returns 0 if equal or
* t is a substring of s
*/
- protected int hstrcmp(final char[] s, int si, final char[] t, int ti) {
- for (; s[si] == t[ti]; si++, ti++) {
- if (s[si] == 0) {
+ protected int hstrcmp(final char[] s, final int si, final char[] t,
+ final int ti) {
+ int sIndex = si;
+ int tIndex = ti;
+ for (; s[sIndex] == t[tIndex]; sIndex++, tIndex++) {
+ if (s[sIndex] == 0) {
return 0;
}
}
- if (t[ti] == 0) {
+ if (t[tIndex] == 0) {
return 0;
}
- return s[si] - t[ti];
+ return s[sIndex] - t[tIndex];
}
- protected byte[] getValues(int k) {
+ protected byte[] getValues(final int k) {
final StringBuffer buf = new StringBuffer();
- byte v = vspace.get(k++);
+ int indexK = k;
+ byte v = vspace.get(indexK++);
while (v != 0) {
char c = (char) ((v >>> 4) - 1);
buf.append(c);
@@ -188,7 +193,7 @@
}
c = (char) (c - 1);
buf.append(c);
- v = vspace.get(k++);
+ v = vspace.get(indexK++);
}
final byte[] res = new byte[buf.length()];
for (int i = 0; i < res.length; i++) {
Modified: trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/TernaryTree.java
===================================================================
--- trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/TernaryTree.java 2006-10-03 02:17:13 UTC (rev 8272)
+++ trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/TernaryTree.java 2006-10-03 02:34:32 UTC (rev 8273)
@@ -178,37 +178,39 @@
/**
* The actual insertion function, recursive version.
*/
- private char insert(char p, final char[] key, final int start,
+ private char insert(final char p, final char[] key, final int start,
final char val) {
+ char pToUse = p;
final int len = strlen(key, start);
- if (p == 0) {
+ if (pToUse == 0) {
// this means there is no branch, this node will start a new branch.
// Instead of doing that, we store the key somewhere else and create
// only one node with a pointer to the key
- p = freenode++;
- eq[p] = val; // holds data
+ pToUse = freenode++;
+ eq[pToUse] = val; // holds data
length++;
- hi[p] = 0;
+ hi[pToUse] = 0;
if (len > 0) {
- sc[p] = Character.MAX_VALUE; // indicates branch is compressed
- lo[p] = (char) kv.alloc(len
+ /* Indicates branch is compressed */
+ sc[pToUse] = Character.MAX_VALUE;
+ lo[pToUse] = (char) kv.alloc(len
+ 1); // use 'lo' to hold pointer to key
- strcpy(kv.getArray(), lo[p], key, start);
+ strcpy(kv.getArray(), lo[pToUse], key, start);
} else {
- sc[p] = 0;
- lo[p] = 0;
+ sc[pToUse] = 0;
+ lo[pToUse] = 0;
}
- return p;
+ return pToUse;
}
- if (sc[p] == Character.MAX_VALUE) {
+ if (sc[pToUse] == Character.MAX_VALUE) {
final char pp = freenode++;
- lo[pp] = lo[p];
- eq[pp] = eq[p];
- lo[p] = 0;
+ lo[pp] = lo[pToUse];
+ eq[pp] = eq[pToUse];
+ lo[pToUse] = 0;
if (len > 0) {
- sc[p] = kv.get(lo[pp]);
- eq[p] = pp;
+ sc[pToUse] = kv.get(lo[pp]);
+ eq[pToUse] = pp;
lo[pp]++;
if (kv.get(lo[pp]) == 0) {
lo[pp] = 0;
@@ -219,41 +221,43 @@
}
} else {
sc[pp] = Character.MAX_VALUE;
- hi[p] = pp;
- sc[p] = 0;
- eq[p] = val;
+ hi[pToUse] = pp;
+ sc[pToUse] = 0;
+ eq[pToUse] = val;
length++;
- return p;
+ return pToUse;
}
}
final char s = key[start];
- if (s < sc[p]) {
- lo[p] = insert(lo[p], key, start, val);
- } else if (s == sc[p]) {
+ if (s < sc[pToUse]) {
+ lo[pToUse] = insert(lo[pToUse], key, start, val);
+ } else if (s == sc[pToUse]) {
if (s != 0) {
- eq[p] = insert(eq[p], key, start + 1, val);
+ eq[pToUse] = insert(eq[pToUse], key, start + 1, val);
} else {
// key already in tree, overwrite data
- eq[p] = val;
+ eq[pToUse] = val;
}
} else {
- hi[p] = insert(hi[p], key, start, val);
+ hi[pToUse] = insert(hi[pToUse], key, start, val);
}
- return p;
+ return pToUse;
}
/**
* Compares 2 null terminated char arrays
*/
- public static int strcmp(final char[] a, int startA, final char[] b,
- int startB) {
- for (; a[startA] == b[startB]; startA++, startB++) {
- if (a[startA] == 0) {
+ public static int strcmp(final char[] a, final int startA, final char[] b,
+ final int startB) {
+ int indexA = startA;
+ int indexB = startB;
+ for (; a[indexA] == b[indexB]; indexA++, indexB++) {
+ if (a[indexA] == 0) {
return 0;
}
}
- return a[startA] - b[startB];
+ return a[indexA] - b[indexB];
}
/**
@@ -280,12 +284,14 @@
}
- public static void strcpy(final char[] dst, int di, final char[] src,
- int si) {
- while (src[si] != 0) {
- dst[di++] = src[si++];
+ public static void strcpy(final char[] dst, final int di, final char[] src,
+ final int si) {
+ int dIndex = di;
+ int sIndex = si;
+ while (src[sIndex] != 0) {
+ dst[dIndex++] = src[sIndex++];
}
- dst[di] = 0;
+ dst[dIndex] = 0;
}
public static int strlen(final char[] a, final int start) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-03 02:48:51
|
Revision: 8274
http://svn.sourceforge.net/foray/?rev=8274&view=rev
Author: victormote
Date: 2006-10-02 19:48:40 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
Modify a copy of the parameter, instead of the parameter itself.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -524,21 +524,21 @@
/**
* Indicates whether this font description matches a given style.
- * @param desiredStyle The style to match.
+ * @param inputDesiredStyle The style to match.
* @param considerSimulated Indicates whether simulated features should be
* considered in the test.
* @return True iff the style of this font description matches the criteria.
*/
- public boolean styleMatches(int desiredStyle,
+ public boolean styleMatches(final int inputDesiredStyle,
final boolean considerSimulated) {
- if (desiredStyle == FOrayFont.FONT_STYLE_ANY) {
+ if (inputDesiredStyle == FOrayFont.FONT_STYLE_ANY) {
return true;
}
if (considerSimulated) {
if (this.simulateOblique != Float.NaN) {
/* If it can simulate oblique, it can be used for either
* oblique or italic or normal. */
- switch (desiredStyle) {
+ switch (inputDesiredStyle) {
case FOrayFont.FONT_STYLE_NORMAL:
case FOrayFont.FONT_STYLE_ITALIC:
case FOrayFont.FONT_STYLE_OBLIQUE: {
@@ -550,7 +550,7 @@
int actualStyle = getFontStyle();
/* Check the easy case first. */
- if (actualStyle == desiredStyle) {
+ if (actualStyle == inputDesiredStyle) {
return true;
}
/* If they are not equal, we need to treat "oblique" and "italic" as
@@ -558,7 +558,8 @@
if (actualStyle == FOrayFont.FONT_STYLE_OBLIQUE) {
actualStyle = FOrayFont.FONT_STYLE_ITALIC;
}
- if (desiredStyle == FOrayFont.FONT_STYLE_OBLIQUE) {
+ int desiredStyle = inputDesiredStyle;
+ if (inputDesiredStyle == FOrayFont.FONT_STYLE_OBLIQUE) {
desiredStyle = FOrayFont.FONT_STYLE_ITALIC;
}
/* Test it again. */
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -331,22 +331,22 @@
/**
* Converts a String representing a percentage to its decimal value.
- * @param input A String representing a percentage. It must end with the
- * "%" symbol.
+ * @param inputString A String representing a percentage. It must end with
+ * the "%" symbol.
* @return The converted percentage, or {@link Float#NaN} if the input is
* not valid. An input value of "98%" will return 98.0.
*/
- public static float convertPercent(String input) {
+ public static float convertPercent(final String inputString) {
float output = Float.NaN;
- if (input == null) {
+ if (inputString == null) {
return output;
}
// The percent sign is required
- final int index = input.indexOf('%');
+ final int index = inputString.indexOf('%');
if (index < 0) {
return output;
}
- input = input.substring(0, index);
+ final String input = inputString.substring(0, index);
output = Float.parseFloat(input);
return output;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -92,13 +92,14 @@
* created. Setting this value to the proper amount will improve
* performance.
*/
- public Kerning(int expectedPairs) {
- if (expectedPairs < 1) {
- expectedPairs = 1;
+ public Kerning(final int expectedPairs) {
+ int pairs = expectedPairs;
+ if (pairs < 1) {
+ pairs = 1;
}
- this.firstChars32 = new int[expectedPairs];
- this.secondChars32 = new int[expectedPairs];
- this.kernAmount32 = new short[expectedPairs];
+ this.firstChars32 = new int[pairs];
+ this.secondChars32 = new int[pairs];
+ this.kernAmount32 = new short[pairs];
}
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -849,12 +849,12 @@
* Compute the checksum for a portion of a given byte array.
* @param byteArray The byte array containing the content.
* @param start Index to the first byte to be considered in the computation.
- * @param size The number of bytes from the array to be considered in the
- * computation.
+ * @param inputSize The number of bytes from the array to be considered in
+ * the computation.
* @return The computed checksum.
*/
private long getCheckSum(final byte[] byteArray, final int start,
- int size) {
+ final int inputSize) {
// All the tables here are aligned on four byte boundaries
// Add remainder to size if it's not a multiple of 4
@@ -862,7 +862,7 @@
* to throw an exception if anything passed here is not on a 4-byte
* boundary.
*/
- size += getPadSize(size);
+ final int size = inputSize + getPadSize(inputSize);
long sum = 0;
@@ -884,10 +884,11 @@
/**
* Adjust the checksum to a maximum.
- * @param sum The tentative checksum.
+ * @param inputSum The tentative checksum.
* @return The adjusted checksum value.
*/
- private long correctCheckSumForMax(long sum) {
+ private long correctCheckSumForMax(final long inputSum) {
+ long sum = inputSum;
if (sum > 0xffffffff) {
sum = sum - 0xffffffff;
}
@@ -937,12 +938,12 @@
/**
* For a given array size, return an empty byte array for the content,
* adding any needed padding.
- * @param arraySize The size of the original table to be copied.
+ * @param inputArraySize The size of the original table to be copied.
* @return The empty but properly-sized byte array.
*/
- private byte[] createTableByteArray(int arraySize) {
+ private byte[] createTableByteArray(final int inputArraySize) {
/* Align on 4-byte boundary */
- arraySize += getPadSize(arraySize);
+ final int arraySize = inputArraySize + getPadSize(inputArraySize);
/*
* Byte arrays initialize at 0x00, which is what we want, as extra bytes
* in the 4-byte padding scheme should be zero.
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/BMPGraphic.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -139,11 +139,12 @@
* @param temp
* @param row
* @param column
- * @param byteInRow The current byteInRow value.
+ * @param inputByteInRow The current byteInRow value.
* @return The new byteInRow value.
*/
private int processRowColor(final int bytesPerRow, final byte[] temp,
- final int row, final int column, int byteInRow) {
+ final int row, final int column, final int inputByteInRow) {
+ int byteInRow = inputByteInRow;
int countr = 2;
while (countr >= 0) {
final int contentIndex = this.colorSpace.getNumComponents()
@@ -159,14 +160,17 @@
/**
* @param row
- * @param column
- * @param p
+ * @param inputColumn
+ * @param inputP
* @return The new column number.
*/
- private int processRowMonochrome(final int row, int column, byte p) {
+ private int processRowMonochrome(final int row, final int inputColumn,
+ final byte inputP) {
/* Each bit represents one column in the image.
* Iterate through each bit and set the content to either "black" or
* "white" for each of the color channels. */
+ int column = inputColumn;
+ byte p = inputP;
for (int countr = 0; countr < WKConstants.BITS_PER_BYTE
&& column < this.pixelWidth; countr++) {
byte color = 0;
@@ -187,12 +191,14 @@
/**
* @param palette
* @param row
- * @param column
- * @param p
+ * @param inputColumn
+ * @param inputP
* @return The new column number.
*/
- private int processRow4Bits(final byte[] palette, final int row, int column,
- byte p) {
+ private int processRow4Bits(final byte[] palette, final int row,
+ final int inputColumn, final byte inputP) {
+ int column = inputColumn;
+ byte p = inputP;
for (int countr = 0; countr < 2 && column < this.pixelWidth;
countr++) {
final int pal = ((p & BIT_8_MASK) >> BITS_PER_NIBBLE)
@@ -217,12 +223,15 @@
* @param bytesPerRow
* @param row
* @param column
- * @param byteInRow
- * @param p
+ * @param inputByteInRow
+ * @param inputP
* @return The new byteInRow value.
*/
private int processRowGrayscale(final byte[] palette, final int bytesPerRow,
- final int row, final int column, int byteInRow, byte p) {
+ final int row, final int column, final int inputByteInRow,
+ final byte inputP) {
+ int byteInRow = inputByteInRow;
+ byte p = inputP;
if (column < this.pixelWidth) {
p *= this.colorSpace.getNumComponents();
this.content[this.colorSpace.getNumComponents()
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/EPSGraphic.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -243,7 +243,8 @@
}
private int readBBoxString(final byte[] fileStart, final int bboxIndex,
- int idx) {
+ final int inputIdx) {
+ int idx = inputIdx;
while (idx < fileStart.length && (fileStart[idx] == ' ')) {
idx++;
}
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2006-10-03 02:34:32 UTC (rev 8273)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/JPEGGraphic.java 2006-10-03 02:48:40 UTC (rev 8274)
@@ -183,9 +183,9 @@
}
private void processRemainder(final ByteArrayOutputStream iccStream,
- int index) {
+ final int inputIndex) {
boolean cont = true;
- index += 2;
+ int index = inputIndex + 2;
while (index < this.content.length && cont) {
cont = processNextChunk(iccStream, index);
if (cont) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-03 03:16:11
|
Revision: 8276
http://svn.sourceforge.net/foray/?rev=8276&view=rev
Author: victormote
Date: 2006-10-02 20:15:58 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
Modify a copy of the parameter, instead of the parameter itself.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java
trunk/foray/scripts/checkstyle-config.xml
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-10-03 03:09:26 UTC (rev 8275)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-10-03 03:15:58 UTC (rev 8276)
@@ -142,13 +142,14 @@
/**
* Creates a new page area for the given parameters
- * @param isBlank True iff this page will be empty (e.g. forced even or
+ * @param inputIsBlank True iff this page will be empty (e.g. forced even or
* odd break, or forced page count).
* @return A Page layout object based on the page master selected from the
* params.
*/
public PageArea getNextPage(final boolean forceOdd, final boolean forceEven,
- boolean isBlank) throws AreaWException {
+ final boolean inputIsBlank) throws AreaWException {
+ boolean isBlank = inputIsBlank;
if (forceOdd && forceEven) {
throw new AreaWException("Cannot force a page to be both odd and "
+ "even.");
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-10-03 03:09:26 UTC (rev 8275)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-10-03 03:15:58 UTC (rev 8276)
@@ -63,12 +63,13 @@
* Computes the content-rectangle inline-progression-dimension of a
* cell.
* @param startingColumn The 1-based index to the column number.
- * @param numberColumns The number of columns to be computed (useful for
- * spanned columns).
+ * @param inputNumberColumns The number of columns to be computed (useful
+ * for spanned columns).
* @return The content-rectangle(??) inline-progression-dimension of the
* cell described.
*/
- public int ipdCell(final int startingColumn, int numberColumns) {
+ public int ipdCell(final int startingColumn, final int inputNumberColumns) {
+ int numberColumns = inputNumberColumns;
final Table table = (Table) this.traitGeneratedBy();
if (startingColumn + numberColumns - 1 > table.numberOfColumns()) {
numberColumns = table.numberOfColumns() - startingColumn + 1;
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2006-10-03 03:09:26 UTC (rev 8275)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2006-10-03 03:15:58 UTC (rev 8276)
@@ -99,7 +99,8 @@
* Return true if the passed area is on the left edge of its nearest
* absolute AreaContainer (generally a page column).
*/
- public boolean startsAC(Area area) {
+ public boolean startsAC(final Area inputArea) {
+ Area area = inputArea;
Area parent = null;
while ((parent = area.getWritableParentArea()) != null &&
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-10-03 03:09:26 UTC (rev 8275)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-10-03 03:15:58 UTC (rev 8276)
@@ -212,8 +212,10 @@
return status;
}
- protected int layoutInlineContent(final FObj node, LineArea lineArea,
+ protected int layoutInlineContent(final FObj node,
+ final LineArea inputLineArea,
final FOContext foContext) throws AreaWException {
+ LineArea lineArea = inputLineArea;
if (! (node instanceof FOLineNonText)) {
return Integer.MIN_VALUE;
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-10-03 03:09:26 UTC (rev 8275)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-10-03 03:15:58 UTC (rev 8276)
@@ -75,8 +75,9 @@
* then 6 should be returned.
*/
private int addText(final FOLineText lineText, final Area area,
- int start, final RetrieveMarker retrieveMarker)
+ final int inputStart, final RetrieveMarker retrieveMarker)
throws AreaWException {
+ int start = inputStart;
final int end = lineText.inlineText().length;
LineArea la = this.activeLineArea(area);
if (la == null) {
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java 2006-10-03 03:09:26 UTC (rev 8275)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java 2006-10-03 03:15:58 UTC (rev 8276)
@@ -56,7 +56,8 @@
}
}
- public ArrayList getProgressSnapshot(ArrayList snapshot) {
+ public ArrayList getProgressSnapshot(final ArrayList inputSnapshot) {
+ ArrayList snapshot = inputSnapshot;
snapshot = super.getProgressSnapshot(snapshot);
// terminate if no kids or child not yet accessed
if (this.progress < 0) {
Modified: trunk/foray/scripts/checkstyle-config.xml
===================================================================
--- trunk/foray/scripts/checkstyle-config.xml 2006-10-03 03:09:26 UTC (rev 8275)
+++ trunk/foray/scripts/checkstyle-config.xml 2006-10-03 03:15:58 UTC (rev 8276)
@@ -117,11 +117,8 @@
<module name="EmptyStatement"/>
<module name="FallThrough"/>
<module name="FinalClass"/>
+ <module name="FinalParameters"/>
- <!-- Leave this one off. We already have a test to make sure that it is
- final if it can be, but this forces it to be final. -->
- <!--<module name="FinalParameters"/>-->
-
<!-- Skip for now. The Ant build chokes on this. -->
<!--<module name="j2ee.FinalStatic"/>-->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-06 22:21:00
|
Revision: 8311
http://svn.sourceforge.net/foray/?rev=8311&view=rev
Author: victormote
Date: 2006-10-06 15:20:46 -0700 (Fri, 06 Oct 2006)
Log Message:
-----------
Rename three hyphenation classes to FOray-specific names to avoid confusion with the implemented interfaces.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/HyphenationTree.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/PatternConsumer.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/PatternParser.java
Added Paths:
-----------
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenBreak.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenation.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenationServer.java
Removed Paths:
-------------
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphen.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphenation.java
trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/HyphenationServer.java
Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2006-10-06 22:14:43 UTC (rev 8310)
+++ trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2006-10-06 22:20:46 UTC (rev 8311)
@@ -137,7 +137,8 @@
final SessionConfig configuration) {
final URL hyphenationDir =
configuration.optionHyphenationBaseDirectory();
- return new org.foray.hyphenR.HyphenationServer(logger, hyphenationDir);
+ return new org.foray.hyphenR.FOrayHyphenationServer(logger,
+ hyphenationDir);
}
public static GraphicServer makeGraphicServer(final Log logger)
Copied: trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenBreak.java (from rev 8310, trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphen.java)
===================================================================
--- trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenBreak.java (rev 0)
+++ trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenBreak.java 2006-10-06 22:20:46 UTC (rev 8311)
@@ -0,0 +1,135 @@
+/*
+ * 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$
+ */
+
+/*
+ * Known contributors:
+ * Carlos Villegas <ca...@un...> (Original author), who credited
+ * TeX for the basic scheme.
+ */
+
+package org.foray.hyphenR;
+
+import org.foray.common.WKConstants;
+
+import org.axsl.hyphenR.HyphenBreak;
+
+import java.io.Serializable;
+
+/**
+ * <p>Specialized information about a specific hyphenation break opportunity in
+ * a word.
+ * This handles "hard" hyphenation cases, such as those where the word changes
+ * spelling when it is hyphenated.
+ * See {@link org.axsl.hyphenR.HyphenBreak} for more information about the
+ * general use of this class.</p>
+ *
+ * <p>A 'full' hyphen is made of 3 parts:
+ * the pre-break text, post-break text and no-break. If no line-break
+ * is generated at this position, the no-break text is used, otherwise,
+ * pre-break and post-break are used. Typically, pre-break is equal to
+ * the hyphen character and the others are empty.</p>
+ */
+public class FOrayHyphenBreak implements Serializable, HyphenBreak {
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = 990405609314441965L;
+
+ private String preBreak;
+ private String noBreak;
+ private String postBreak;
+
+ FOrayHyphenBreak(final String pre, final String no, final String post) {
+ preBreak = pre;
+ noBreak = no;
+ postBreak = post;
+ }
+
+ FOrayHyphenBreak(final String pre) {
+ preBreak = pre;
+ noBreak = null;
+ postBreak = null;
+ }
+
+ public String toString() {
+ if (noBreak == null
+ && postBreak == null
+ && preBreak != null
+ && preBreak.equals("-")) {
+ return "-";
+ }
+ final StringBuffer res = new StringBuffer("{");
+ res.append(preBreak);
+ res.append("}{");
+ res.append(postBreak);
+ res.append("}{");
+ res.append(noBreak);
+ res.append('}');
+ return res.toString();
+ }
+
+ /**
+ * Returns the "no break" String.
+ * @return Returns the noBreak.
+ */
+ public String getNoBreak() {
+ return this.noBreak;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String preDelete() {
+ /* TODO: Implement this. */
+ return WKConstants.EMPTY_STRING;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String preInsert() {
+ /* TODO: Implement this. */
+ return WKConstants.EMPTY_STRING;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String postDelete() {
+ /* TODO: Implement this. */
+ return WKConstants.EMPTY_STRING;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String postInsert() {
+ /* TODO: Implement this. */
+ return WKConstants.EMPTY_STRING;
+ }
+
+}
Copied: trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenation.java (from rev 8273, trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphenation.java)
===================================================================
--- trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenation.java (rev 0)
+++ trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenation.java 2006-10-06 22:20:46 UTC (rev 8311)
@@ -0,0 +1,138 @@
+/*
+ * 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$
+ */
+
+/*
+ * Known contributors:
+ * Carlos Villegas <ca...@un...> (original author)
+ */
+
+package org.foray.hyphenR;
+
+import org.axsl.hyphenR.HyphenBreak;
+import org.axsl.hyphenR.HyphenationException;
+
+/**
+ * This class represents a hyphenated word.
+ */
+public class FOrayHyphenation implements org.axsl.hyphenR.Hyphenation {
+
+ private String word;
+
+ private int[] hyphenPoints;
+
+ /* Always store the weights using the Liang weights. */
+ private byte[] hyphenValues;
+
+ FOrayHyphenation(final String word, final int[] points,
+ final byte[] values) {
+ this.word = word;
+ this.hyphenPoints = points;
+ this.hyphenValues = values;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int[] getPoints() {
+ return this.hyphenPoints;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getLiangWeights() {
+ return this.hyphenValues;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getWeights() {
+ if (this.hyphenValues == null) {
+ return null;
+ }
+ final byte[] returnArray = new byte[this.hyphenValues.length];
+ for (int i = 0; i < this.hyphenValues.length; i++) {
+ final byte value = this.hyphenValues[i];
+ try {
+ returnArray[i] = convertLiangToWeight(value);
+ } catch (final HyphenationException e) {
+ /* TODO: This exception should be passed upstream further. */
+ returnArray[i] = Byte.MIN_VALUE;
+ }
+ }
+ return returnArray;
+ }
+
+ public String toString() {
+ final StringBuffer str = new StringBuffer();
+ int start = 0;
+ for (int i = 0; i < hyphenPoints.length; i++) {
+ str.append(word.substring(start, hyphenPoints[i]) + "-");
+ start = hyphenPoints[i];
+ }
+ str.append(word.substring(start));
+ return str.toString();
+ }
+
+ /**
+ * Converts the raw value from the Liang data to a weighted value.
+ * In the Liang system, 1) even values are negative, 2) odd values are
+ * positive, and the magnitude of the number conveys the magnitude of
+ * the direction.
+ * @param liangValue Any positive byte value that contains a Liang-style
+ * algorithm weight. (Liang input is only in the range 0 to 5, but we will
+ * handle any positive input).
+ * @return A value that reflects the numeric weight of the raw Liang value.
+ */
+ public static byte convertLiangToWeight(final byte liangValue)
+ throws HyphenationException {
+ if (liangValue < 0) {
+ throw new HyphenationException("Invalid Liang input: "
+ + liangValue);
+ }
+ byte modifiedLiangValue = liangValue;
+ /* Save the low-order bit. */
+ final boolean good = (modifiedLiangValue & 1) == 1;
+ modifiedLiangValue ++;
+ modifiedLiangValue /= 2;
+ if (! good) {
+ modifiedLiangValue *= -1;
+ }
+ return modifiedLiangValue;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public HyphenBreak getHyphenBreak(final int index) {
+ /* TODO: Consider implementing this. */
+ return null;
+ }
+
+}
Copied: trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenationServer.java (from rev 8306, trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/HyphenationServer.java)
===================================================================
--- trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenationServer.java (rev 0)
+++ trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/FOrayHyphenationServer.java 2006-10-06 22:20:46 UTC (rev 8311)
@@ -0,0 +1,439 @@
+/*
+ * 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$
+ */
+
+/*
+ * Known contributors:
+ * @author Carlos Villegas <ca...@un...> (original author)
+ */
+
+package org.foray.hyphenR;
+
+import org.foray.common.FOrayConstants;
+import org.foray.common.StringUtilPre5;
+
+import org.axsl.hyphenR.HyphenationException;
+
+import org.apache.commons.logging.Log;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ * This class is the main entry point to the hyphenation package.
+ */
+public class FOrayHyphenationServer
+ implements org.axsl.hyphenR.HyphenationServer {
+
+ public static final String PATTERN_RESOURCE_PATH =
+ "org/foray/hyphenR/resource/patterns";
+
+ private static final String PATTERN_MISSING_TEXT =
+ "Hyphenation pattern not found: ";
+
+ private Log logger;
+
+ /**
+ * Collection of HyphenationTree instances that have been successfully
+ * deserialized or parsed. The key is the language or language and country
+ * connected by an underscore (e.g. en_US).
+ */
+ private HashMap hyphenTrees = new HashMap();
+
+ /**
+ * Collection of language and language_country combinations for which we
+ * already know we can't instantiate a HyphenationTree. This is used to
+ * log only one error message per language.
+ */
+ private ArrayList hyphenTreesNotFound = new ArrayList();
+
+ private boolean errorDump = false;
+ private String hyphenationDir;
+
+ /**
+ * Constructor.
+ * @param logger The Log instance for user messages.
+ */
+ public FOrayHyphenationServer(final Log logger, final URL hyphenationDir) {
+ this.logger = logger;
+ // TODO: This is klunky. Use the URL.
+ this.hyphenationDir = hyphenationDir.getFile();
+ }
+
+ private HyphenationTree getHyphenationTree(final String languageKey,
+ final String country) {
+ /* TODO: This logic needs some work. We should look first for the
+ * countryKey in the cache, then resources, then filesystem. If it is
+ * not found, only then look for the languageKey. */
+
+ if (languageKey == null) {
+ return null;
+ }
+
+ /* Build the country key. */
+ String countryKey = null;
+ if (country != null
+ && ! country.equals("")
+ && ! country.equals("none")) {
+ countryKey = languageKey + "_" + country;
+ }
+
+ /* Try to find the country key in the cache. Look for it before the
+ * lanuguage key because the country key is more specific. */
+ if (countryKey != null
+ && hyphenTrees.containsKey(countryKey)) {
+ return (HyphenationTree) hyphenTrees.get(countryKey);
+ }
+
+ /* Try to find the language key in the cache. */
+ if (hyphenTrees.containsKey(languageKey)) {
+ return (HyphenationTree) hyphenTrees.get(languageKey);
+ }
+
+ /* See if we have already tried and failed. */
+ for (int i = 0; i < this.hyphenTreesNotFound.size(); i++) {
+ final String key = (String) this.hyphenTreesNotFound.get(i);
+ if (languageKey.equals(key)) {
+ return null;
+ }
+ if (countryKey != null
+ && countryKey.equals(key)) {
+ return null;
+ }
+ }
+
+ HyphenationTree hTree = null;
+ /* Look for it as a jar file resource. */
+ if (countryKey != null) {
+ hTree = getHyphenationTree(countryKey);
+ if (hTree != null) {
+ hyphenTrees.put(countryKey, hTree);
+ return hTree;
+ }
+ }
+
+ hTree = getHyphenationTree(languageKey);
+ if (hTree != null) {
+ hyphenTrees.put(languageKey, hTree);
+ return hTree;
+ }
+
+ /* Now look for it in the filesystem. */
+ if (countryKey != null) {
+ hTree = loadHyphenationTree(countryKey);
+ if (hTree != null) {
+ hyphenTrees.put(countryKey, hTree);
+ return hTree;
+ }
+ }
+
+ hTree = loadHyphenationTree(languageKey);
+ if (hTree != null) {
+ hyphenTrees.put(languageKey, hTree);
+ return hTree;
+ }
+
+ /* Log a warning and add it to the list of not found keys. */
+ if (countryKey != null) {
+ getLogger().warn(PATTERN_MISSING_TEXT + countryKey);
+ }
+ getLogger().warn(PATTERN_MISSING_TEXT + languageKey);
+ hyphenTreesNotFound.add(languageKey);
+ return hTree;
+ }
+
+ private InputStream getResourceStream(final String key) {
+ InputStream is = null;
+ // Try to use Context Class Loader to load the properties file.
+ try {
+ final Method getCCL =
+ Thread.class.getMethod("getContextClassLoader", new Class[0]);
+ if (getCCL != null) {
+ final ClassLoader contextClassLoader =
+ (ClassLoader) getCCL.invoke(Thread.currentThread(),
+ new Object[0]);
+ is = contextClassLoader.getResourceAsStream(
+ PATTERN_RESOURCE_PATH + "/" + key
+ + "." + FOrayConstants.BINARY_SERIALIZATION_EXTENSION);
+ }
+ } catch (final Exception e) { }
+
+ if (is == null) {
+ is = FOrayHyphenationServer.class.getResourceAsStream(
+ "/" + PATTERN_RESOURCE_PATH + "/" + key
+ + "." + FOrayConstants.BINARY_SERIALIZATION_EXTENSION);
+ }
+
+ return is;
+ }
+
+ private HyphenationTree getHyphenationTree(final String key) {
+ HyphenationTree hTree = null;
+ ObjectInputStream ois = null;
+ InputStream is = null;
+ try {
+ is = getResourceStream(key);
+ if (is == null) {
+ return null;
+ }
+ ois = new ObjectInputStream(is);
+ hTree = (HyphenationTree) ois.readObject();
+ } catch (final Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (ois != null) {
+ try {
+ ois.close();
+ } catch (final IOException e) {
+ getLogger().error("can't close hyphenation object stream");
+ }
+ }
+ }
+ return hTree;
+ }
+
+ /**
+ * Load a tree from serialized file or xml file using configuration
+ * settings.
+ */
+ private HyphenationTree loadHyphenationTree(final String key) {
+ if (this.hyphenationDir == null) {
+ return null;
+ }
+ HyphenationTree hTree = null;
+ // I use here the following convention. The file name specified in
+ // the configuration is taken as the base name. First we try
+ // name + the serialization extension, assuming a serialized
+ // yphenationTree. If that fails
+ // we try name + ".xml", assumming a raw hyphenation pattern file.
+
+ // first try serialized object
+ File hyphenFile = new File(this.hyphenationDir,
+ key + FOrayConstants.BINARY_SERIALIZATION_EXTENSION);
+ if (hyphenFile.exists()) {
+ ObjectInputStream ois = null;
+ try {
+ ois = new ObjectInputStream(new FileInputStream(hyphenFile));
+ hTree = (HyphenationTree) ois.readObject();
+ } catch (final Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (ois != null) {
+ try {
+ ois.close();
+ } catch (final IOException e) { }
+ }
+ }
+ return hTree;
+ }
+
+ // try the raw XML file
+ hyphenFile = new File(this.hyphenationDir, key + ".xml");
+ if (hyphenFile.exists()) {
+ hTree = new HyphenationTree();
+ if (errorDump) {
+ getLogger().error("reading " + this.hyphenationDir + key
+ + ".xml");
+ }
+ try {
+ hTree.loadPatterns(hyphenFile.getPath(), getLogger());
+ if (errorDump) {
+ getLogger().debug("Stats: ");
+ hTree.printStats(getLogger());
+ }
+ return hTree;
+ } catch (final HyphenationException ex) {
+ if (errorDump) {
+ getLogger().error("Can't load user patterns "
+ + "from xml file " + this.hyphenationDir
+ + key + ".xml");
+ }
+ return null;
+ }
+ }
+ if (errorDump) {
+ getLogger().error("Tried to load "
+ + hyphenFile.toString()
+ + "\nCannot find compiled nor xml file for "
+ + "hyphenation pattern" + key);
+ }
+ return null;
+ }
+
+ public org.axsl.hyphenR.Hyphenation hyphenate(final CharSequence word,
+ final int offset, final int len, final String language,
+ final String country, final int remainCount, final int pushCount,
+ final boolean includeInhibitors) {
+ return this.hyphenate(word.toString().toCharArray(), offset, len,
+ language, country, remainCount, pushCount, includeInhibitors);
+ }
+
+ public org.axsl.hyphenR.Hyphenation hyphenate(final char[] word,
+ final int offset, final int len, final String language,
+ final String country, final int remainCount,
+ final int pushCount, final boolean includeInhibitors) {
+ final HyphenationTree hTree = getHyphenationTree(language, country);
+ if (hTree == null) {
+ return null;
+ }
+ return hTree.hyphenate(word, offset, len, remainCount, pushCount,
+ includeInhibitors);
+ }
+
+ public org.axsl.hyphenR.Hyphenation hyphenate(final int[] word,
+ final int offset, final int len, final String language,
+ final String country, final int remainCount, final int pushCount,
+ final boolean includeInhibitors) {
+ /* Convert to a String using the 32-bit ICU4J method. */
+ /* TODO: After Java 5 is the minimum, use the standard String
+ * constructor instead. */
+ final String string = StringUtilPre5.newString(word, offset, len);
+ /* FIXME: The Hyphenation instance needs to know that it was created
+ * from an int[] instead of a char[], so that it can properly handle
+ * surrogate pairs (an int that would convert to 2 chars).*/
+ return this.hyphenate(string, offset, len,
+ language, country, remainCount, pushCount, includeInhibitors);
+ }
+
+ public Log getLogger() {
+ return this.logger;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int wordSize(final char[] characters, final int wordStart,
+ final String language, final String country) {
+ if (characters == null) {
+ return 0;
+ }
+ boolean wordendFound = false;
+ int counter = 0;
+ final int[] newWord = new int[characters.length]; // create a buffer
+ while ((!wordendFound)
+ && ((wordStart + counter) < characters.length)) {
+ final int tk = characters[wordStart + counter];
+ if (StringUtilPre5.isLetter(tk)) {
+ newWord[counter] = tk;
+ counter++;
+ } else {
+ wordendFound = true;
+ }
+ }
+ return counter;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int wordSize(final CharSequence characters, final int wordStart,
+ final String language, final String country) {
+ if (characters == null) {
+ return 0;
+ }
+ return wordSize(characters.toString().toCharArray(), wordStart,
+ language, country);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int wordSize(final int[] characters, final int wordStart,
+ final String language, final String country) {
+ if (characters == null) {
+ return 0;
+ }
+ /* Convert to a String using the 32-bit ICU4J method. */
+ /* TODO: After Java 5 is the minimum, use the standard String
+ * constructor instead. */
+ final String string = StringUtilPre5.newString(characters, wordStart,
+ characters.length - wordStart);
+ /* FIXME: Return value needs to be reduced by the number of surrogate
+ * pairs (an int that would convert to 2 chars) found.*/
+ return wordSize(string, wordStart, language, country);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int wordStarts(final char[] characters, final int startIndex,
+ final String language, final String country) {
+ if (characters == null) {
+ return -1;
+ }
+ /* TODO: We need to handle language and country here. */
+ for (int i = startIndex; i < characters.length; i++) {
+ final char c = characters[i];
+ switch(c) {
+ case '"':
+ case '\'': {
+
+ continue;
+ }
+ default: {
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int wordStarts(final CharSequence characters, final int startIndex,
+ final String language, final String country) {
+ if (characters == null) {
+ return -1;
+ }
+ return wordStarts(characters.toString().toCharArray(), startIndex,
+ language, country);
+ }
+
+ public int wordStarts(final int[] characters, final int startIndex,
+ final String language, final String country) {
+ if (characters == null) {
+ return -1;
+ }
+ /* Convert to a String using the 32-bit ICU4J method. */
+ /* TODO: After Java 5 is the minimum, use the standard String
+ * constructor instead. */
+ final String string = StringUtilPre5.newString(characters, startIndex,
+ characters.length - startIndex);
+ /* FIXME: Return value needs to be reduced by the number of surrogate
+ * pairs (an int that would convert to 2 chars) found.*/
+ return wordStarts(string, startIndex, language, country);
+ }
+
+}
Deleted: trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphen.java
===================================================================
--- trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphen.java 2006-10-06 22:14:43 UTC (rev 8310)
+++ trunk/foray/foray-hyphen-r/src/java/org/foray/hyphenR/Hyphen.java 2006-10-06 22:20:46 UTC (rev 8311)
@@ -1,135 +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$
- */
-
-/*
- * Known contributors:
- * Carlos Villegas <ca...@un...> (Original author), who credited
- * TeX for the basic scheme.
- */
-
-package org.foray.hyphenR;
-
-import org.foray.common.WKConstants;
-
-import org.axsl.hyphenR.HyphenBreak;
-
-import java.io.Serializable;
-
-/**
- * <p>Specialized information about a specific hyphenation break opportunity in
- * a word.
- * This handles "hard" hyphenation cases, such as those where the word changes
- * spelling when it is hyphenated.
- * See {@link org.axsl.hyphenR.HyphenBreak} for more information about the
- * general use of this class.</p>
- *
- * <p>A 'full' hyphen is made of 3 parts:
- * the pre-break text, post-break text and no-break. If no line-break
- * is generated at this position, the no-break text is used, otherwise,
- * pre-break and post-break are used. Typically, pre-break is equal to
- * the hyphen character and the others are empty.</p>
- */
-public class Hyphen implements Serializable, HyphenBreak {
-
- /** Constant needed for serialization. */
- private static final long serialVersionUID = 990405609314441965L;
-
- private String preBreak;
- private String noBreak;
- private String postBreak;
-
- Hyphen(final String pre, final String no, final String post) {
- preBreak = pre;
- noBreak = no;
- postBreak = post;
- }
-
- Hyphen(final String pre) {
- preBreak = pre;
- noBreak = null;
- postBreak = null;
- }
-
- public String toString() {
- if (noBreak == null
- && postBreak == null
- && preBreak != null
- && preBreak.equals("-")) {
- return "-";
- }
- final StringBuffer res = new StringBuffer("{");
- res.append(preBreak);
- res.append("}{");
- res.append(postBreak);
- res.append("}{");
- ...
[truncated message content] |
|
From: <vic...@us...> - 2006-10-07 15:11:15
|
Revision: 8319
http://svn.sourceforge.net/foray/?rev=8319&view=rev
Author: victormote
Date: 2006-10-07 08:11:06 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java
trunk/foray/foray-app/src/java/org/foray/demo/embed/EmbedDemo.java
trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java
trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoPrintServlet.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-10-06 23:59:59 UTC (rev 8318)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-10-07 15:11:06 UTC (rev 8319)
@@ -125,7 +125,7 @@
null);
//Setup renderer
- final AWTRenderer renderer = new AWTRenderer(this.logger, null);
+ final AWTRenderer renderer = new AWTRenderer(getLogger(), null);
//Setup FOrayTarget
new FOrayTarget(document, renderer, null, null);
Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/EmbedDemo.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/EmbedDemo.java 2006-10-06 23:59:59 UTC (rev 8318)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/EmbedDemo.java 2006-10-07 15:11:06 UTC (rev 8319)
@@ -37,7 +37,7 @@
*/
public abstract class EmbedDemo {
- Log logger;
+ private Log logger;
public EmbedDemo() {
this.logger = Logging.makeDefaultLogger();
Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-10-06 23:59:59 UTC (rev 8318)
+++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-10-07 15:11:06 UTC (rev 8319)
@@ -66,7 +66,7 @@
public static final String FO_REQUEST_PARAM = "fo";
public static final String XML_REQUEST_PARAM = "xml";
public static final String XSL_REQUEST_PARAM = "xsl";
- Log logger = null;
+ private Log logger = null;
public AbstractDemoServlet() {
logger = Logging.makeWarningLogger();
@@ -224,4 +224,11 @@
}
}
+ /**
+ * @return Returns the logger.
+ */
+ public Log getLogger() {
+ return this.logger;
+ }
+
}
Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoPrintServlet.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoPrintServlet.java 2006-10-06 23:59:59 UTC (rev 8318)
+++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoPrintServlet.java 2006-10-07 15:11:06 UTC (rev 8319)
@@ -121,7 +121,7 @@
// Setup the Renderer
final PrinterJob pj = PrinterJob.getPrinterJob();
pj.setCopies(1);
- final AWTPrintRenderer renderer = new AWTPrintRenderer(this.logger,
+ final AWTPrintRenderer renderer = new AWTPrintRenderer(getLogger(),
null, pj);
// Setup FOrayTarget
final FOrayTarget target = new FOrayTarget(document, renderer, null,
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-06 23:59:59 UTC (rev 8318)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:11:06 UTC (rev 8319)
@@ -48,8 +48,6 @@
<suppress checks="VisibilityModifier"
files="org.foray.app.*"/>
<suppress checks="VisibilityModifier"
- files="org.foray.demo.*"/>
- <suppress checks="VisibilityModifier"
files="org.foray.area.*"/>
<suppress checks="VisibilityModifier"
files="org.foray.core.*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-07 15:24:57
|
Revision: 8321
http://svn.sourceforge.net/foray/?rev=8321&view=rev
Author: victormote
Date: 2006-10-07 08:24:49 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java
trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java
trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java
trunk/foray/foray-app/src/java/org/foray/app/Options.java
trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java
trunk/foray/foray-app/src/java/org/foray/app/Starter.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-10-07 15:18:10 UTC (rev 8320)
+++ trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-10-07 15:24:49 UTC (rev 8321)
@@ -65,8 +65,8 @@
private static final String TRANSLATION_PATH =
"/org/foray/render/awt/viewer/resources/";
- PreviewDialog frame;
- AWTRenderer renderer;
+ private PreviewDialog frame;
+ private AWTRenderer renderer;
private FOrayDocument document;
private Translator resource;
@@ -88,7 +88,7 @@
e.printStackTrace();
}
- String language = commandLineOptions.getLanguage();
+ String language = getCommandLineOptions().getLanguage();
if (language == null) {
try {
language = System.getProperty("user.language");
@@ -102,14 +102,14 @@
+ "messages." + language));
resource.setMissingEmphasized(false);
- final SessionConfig configuration = this.options.getSessionConfig();
+ final SessionConfig configuration = getOptions().getSessionConfig();
final FOraySession session = FOraySpecific.makeFOraySession(
configuration);
- this.document = new FOrayDocument(session, inputSource, null);
+ this.document = new FOrayDocument(session, getInputSource(), null);
final OutputConfig renderOptions =
- commandLineOptions.getRendererOptions();
+ getCommandLineOptions().getRendererOptions();
this.renderer = new AWTRenderer(this.getLogger(), renderOptions);
frame = createPreviewDialog(renderer, resource);
renderer.setProgressListener(frame);
Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java 2006-10-07 15:18:10 UTC (rev 8320)
+++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineOptions.java 2006-10-07 15:24:49 UTC (rev 8321)
@@ -62,16 +62,16 @@
private static final int STANDARD_OPTIONS_QTY_ARGUMENTS = 3;
/** The user configuration file. */
- URL userConfig = null;
+ private URL userConfig = null;
/** The input XSL-FO. Should be null for XSLT input. */
- URL foInput = null;
+ private URL foInput = null;
/** The input XSLT. Should be null for XSL-FO input. */
- URL xsltInput = null;
+ private URL xsltInput = null;
/** The input XML file. Should be null for XSL-FO input. */
- URL xmlInput = null;
+ private URL xmlInput = null;
/** The output file. */
private File outfile = null;
Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-10-07 15:18:10 UTC (rev 8320)
+++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-10-07 15:24:49 UTC (rev 8321)
@@ -50,7 +50,7 @@
*/
public class CommandLineStarter extends Starter {
- CommandLineOptions commandLineOptions;
+ private CommandLineOptions commandLineOptions;
public CommandLineStarter(final Log logger,
final SessionConfig sessionConfig, final OutputConfig outputConfig,
@@ -58,7 +58,7 @@
throws FOrayException {
super(logger, sessionConfig, outputConfig);
this.commandLineOptions = commandLineOptions;
- options.setCommandLineOptions(commandLineOptions);
+ getOptions().setCommandLineOptions(commandLineOptions);
super.setInputSource(commandLineOptions.getInputSource());
}
@@ -74,7 +74,7 @@
*/
/* Instantiate the FOraySession. */
- final SessionConfig sessionConfig = this.options.getSessionConfig();
+ final SessionConfig sessionConfig = getOptions().getSessionConfig();
final FOraySession session = FOraySpecific.makeFOraySession(
sessionConfig);
@@ -89,7 +89,7 @@
FOrayDocument document = null;
if (this.commandLineOptions.getInputMode()
== CommandLineOptions.INPUT_FO) {
- document = new FOrayDocument(session, inputSource, null);
+ document = new FOrayDocument(session, getInputSource(), null);
} else {
document = new FOrayDocument(session,
commandLineOptions.getXMLFile(),
@@ -196,4 +196,11 @@
}
}
+ /**
+ * @return Returns the commandLineOptions.
+ */
+ public CommandLineOptions getCommandLineOptions() {
+ return this.commandLineOptions;
+ }
+
}
Modified: trunk/foray/foray-app/src/java/org/foray/app/Options.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-10-07 15:18:10 UTC (rev 8320)
+++ trunk/foray/foray-app/src/java/org/foray/app/Options.java 2006-10-07 15:24:49 UTC (rev 8321)
@@ -46,9 +46,10 @@
* additional setting of commandline options
*/
public class Options {
- SessionConfig sessionConfig;
- OutputConfig renderConfig;
+ private SessionConfig sessionConfig;
+ private OutputConfig renderConfig;
+
/** The logger that should be used. */
private Log logger;
Modified: trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java 2006-10-07 15:18:10 UTC (rev 8320)
+++ trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java 2006-10-07 15:24:49 UTC (rev 8321)
@@ -59,7 +59,7 @@
}
public void run() throws FOrayException {
- final SessionConfig configuration = this.options.getSessionConfig();
+ final SessionConfig configuration = getOptions().getSessionConfig();
final FOraySession session = FOraySpecific.makeFOraySession(
configuration);
Modified: trunk/foray/foray-app/src/java/org/foray/app/Starter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/Starter.java 2006-10-07 15:18:10 UTC (rev 8320)
+++ trunk/foray/foray-app/src/java/org/foray/app/Starter.java 2006-10-07 15:24:49 UTC (rev 8321)
@@ -43,8 +43,8 @@
*/
public abstract class Starter {
- Options options;
- InputSource inputSource;
+ private Options options;
+ private InputSource inputSource;
private Log logger;
private OutputConfig outputConfig;
@@ -72,4 +72,18 @@
return this.outputConfig;
}
+ /**
+ * @return Returns the options.
+ */
+ public Options getOptions() {
+ return this.options;
+ }
+
+ /**
+ * @return Returns the inputSource.
+ */
+ public InputSource getInputSource() {
+ return this.inputSource;
+ }
+
}
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:18:10 UTC (rev 8320)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:24:49 UTC (rev 8321)
@@ -46,8 +46,6 @@
files="org.foray.text.*"/>
<suppress checks="VisibilityModifier"
- files="org.foray.app.*"/>
- <suppress checks="VisibilityModifier"
files="org.foray.area.*"/>
<suppress checks="VisibilityModifier"
files="org.foray.core.*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-07 15:27:21
|
Revision: 8322
http://svn.sourceforge.net/foray/?rev=8322&view=rev
Author: victormote
Date: 2006-10-07 08:27:15 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-core/src/java/org/foray/core/SessionConfig.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-core/src/java/org/foray/core/SessionConfig.java
===================================================================
--- trunk/foray/foray-core/src/java/org/foray/core/SessionConfig.java 2006-10-07 15:24:49 UTC (rev 8321)
+++ trunk/foray/foray-core/src/java/org/foray/core/SessionConfig.java 2006-10-07 15:27:15 UTC (rev 8322)
@@ -43,7 +43,7 @@
/** This is not really a configuration option, but is a permanent record
* of the original fo or xml file that was passed on the command line,
* if any. */
- URL baseDocument = null;
+ private URL baseDocument = null;
public SessionConfig(final Log logger) {
super(logger);
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:24:49 UTC (rev 8321)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:27:15 UTC (rev 8322)
@@ -48,8 +48,6 @@
<suppress checks="VisibilityModifier"
files="org.foray.area.*"/>
<suppress checks="VisibilityModifier"
- files="org.foray.core.*"/>
- <suppress checks="VisibilityModifier"
files="org.foray.fotree.*"/>
<suppress checks="VisibilityModifier"
files="org.foray.layout.*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-07 15:30:53
|
Revision: 8323
http://svn.sourceforge.net/foray/?rev=8323&view=rev
Author: victormote
Date: 2006-10-07 08:30:47 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
===================================================================
--- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-10-07 15:27:15 UTC (rev 8322)
+++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-10-07 15:30:47 UTC (rev 8323)
@@ -60,12 +60,12 @@
*/
public abstract class LayoutStrategy implements LineBreakHandler, Layout {
- protected Log logger;
+ private Log logger;
/**
* The AreaTree instance that this layout system is processing.
*/
- protected AreaTree areaTree;
+ private AreaTree areaTree;
/**
* Constructor.
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:27:15 UTC (rev 8322)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:30:47 UTC (rev 8323)
@@ -50,8 +50,6 @@
<suppress checks="VisibilityModifier"
files="org.foray.fotree.*"/>
<suppress checks="VisibilityModifier"
- files="org.foray.layout.*"/>
- <suppress checks="VisibilityModifier"
files="org.foray.output.*"/>
<suppress checks="VisibilityModifier"
files="org.foray.pdf.*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-07 15:44:22
|
Revision: 8325
http://svn.sourceforge.net/foray/?rev=8325&view=rev
Author: victormote
Date: 2006-10-07 08:44:06 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RowSpanMgr.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -132,7 +132,7 @@
if (getProgress() == FONodePL.START) {
if (area instanceof NormalBlockArea) {
- layout.completeCurrentLineInBlock((NormalBlockArea) area);
+ getLayout().completeCurrentLineInBlock((NormalBlockArea) area);
}
if (rowSpanMgr == null) {
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -74,7 +74,8 @@
breakStatusBeforeChecked = true;
// no break if first in area tree, or leading in context
// area
- final int breakBeforeStatus = layout.checkBreakBefore(node, area);
+ final int breakBeforeStatus = getLayout().checkBreakBefore(node,
+ area);
if (breakBeforeStatus != Status.OK) {
return breakBeforeStatus;
}
@@ -100,7 +101,7 @@
noLayoutCount = 0;
if (area instanceof NormalBlockArea) {
- layout.completeCurrentLineInBlock((NormalBlockArea) area);
+ getLayout().completeCurrentLineInBlock((NormalBlockArea) area);
}
setProgress(0);
}
@@ -130,8 +131,8 @@
anythingLaidOut = true;
}
- layout.completeCurrentLineInBlock(blockArea);
- layout.setLineBreaker(null);
+ getLayout().completeCurrentLineInBlock(blockArea);
+ getLayout().setLineBreaker(null);
// no break if last in area tree, or trailing in context
// area
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -64,9 +64,9 @@
* for FObjs it is the child number
* for FOText it is the character number
*/
- protected int progress = START;
+ private int progress = START;
- protected PioneerLS layout;
+ private PioneerLS layout;
/** The real FONode which this proxy represents. */
private FONode realFONode;
@@ -275,4 +275,11 @@
return this.realFONode;
}
+ /**
+ * @return Returns the layout.
+ */
+ public PioneerLS getLayout() {
+ return this.layout;
+ }
+
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -86,7 +86,7 @@
final NormalBlockArea ba = la.ancestorWritableNormalBlockArea();
start = addTextItemToLine(la, lineText, start, end, retrieveMarker);
while (start != -1) {
- final BlockPL blockPL = this.layout.getBlockPL(ba);
+ final BlockPL blockPL = getLayout().getBlockPL(ba);
la = ba.createNextLineArea(false);
blockPL.setCurrentLineArea(la);
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -60,14 +60,14 @@
ArrayList snapshot = inputSnapshot;
snapshot = super.getProgressSnapshot(snapshot);
// terminate if no kids or child not yet accessed
- if (this.progress < 0) {
+ if (getProgress() < 0) {
return snapshot;
}
final List children = getChildren();
if (children.isEmpty()) {
return snapshot;
}
- final FONode node = (FONode) children.get(this.progress);
+ final FONode node = (FONode) children.get(getProgress());
final FONodePL proxy = getLayoutProxy(node);
return proxy.getProgressSnapshot(snapshot);
}
@@ -75,16 +75,16 @@
public void rollback(final ArrayList snapshot) {
super.rollback(snapshot);
final List children = getChildren();
- if ((this.progress == -1)
+ if ((getProgress() == -1)
|| children.isEmpty()
- || this.progress <= START) {
+ || getProgress() <= START) {
return;
}
- for (int i = this.progress + 1; i < children.size(); i++) {
+ for (int i = getProgress() + 1; i < children.size(); i++) {
final FONode fo = (FONode) children.get(i);
getLayoutProxy(fo).resetProgress();
}
- final FONode node = (FONode) children.get(this.progress);
+ final FONode node = (FONode) children.get(getProgress());
getLayoutProxy(node).rollback(snapshot);
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -57,7 +57,7 @@
listBlockPL.setProgress(0);
if (area instanceof NormalBlockArea) {
- layout.completeCurrentLineInBlock((NormalBlockArea) area);
+ getLayout().completeCurrentLineInBlock((NormalBlockArea) area);
}
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RowSpanMgr.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RowSpanMgr.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RowSpanMgr.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -40,20 +40,18 @@
* Inner class storing information for one span item.
*/
class SpanInfo {
- int cellHeight;
- int totalRowHeight;
- int rowsRemaining;
+ private int cellHeight;
+ private int totalRowHeight;
+ private int rowsRemaining;
// int numCols; // both V and H span
- TableCell cell;
- PioneerLS layout;
+ private TableCell cell;
SpanInfo(final TableCell cell, final int cellHeight,
- final int rowsSpanned, final PioneerLS layout) {
+ final int rowsSpanned) {
this.cell = cell;
this.cellHeight = cellHeight;
this.totalRowHeight = 0;
this.rowsRemaining = rowsSpanned;
- this.layout = layout;
}
/**
@@ -96,11 +94,10 @@
public void addRowSpan(final TableCell cell, final int firstCol,
final int numCols, final int cellHeight, final int rowsSpanned,
final PioneerLS layout) {
- spanInfo[firstCol - 1] = new SpanInfo(cell, cellHeight, rowsSpanned,
- layout);
+ spanInfo[firstCol - 1] = new SpanInfo(cell, cellHeight, rowsSpanned);
for (int i = 0; i < numCols - 1; i++) {
spanInfo[firstCol + i] = new SpanInfo(null, cellHeight,
- rowsSpanned, layout); // copy!
+ rowsSpanned); // copy!
}
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -56,8 +56,8 @@
if (Status.isIncomplete(status)) {
/* in fact all should be laid out and clip, error etc depending
* on 'overflow' */
- layout.getLogger().warn("Some static content could not fit in "
- + "the area.");
+ getLayout().getLogger().warn("Some static content could not "
+ + "fit in the area.");
setProgress(i);
if ((i != 0) && (status == Status.AREA_FULL_NONE)) {
status = Status.AREA_FULL_SOME;
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -67,11 +67,11 @@
if (getProgress() == FONodePL.START) {
if (node.traitTableLayout() == Constants.FOVAL_AUTO) {
- layout.getLogger().warn("table-layout=auto is not supported, "
- + "using fixed!");
+ getLayout().getLogger().warn("table-layout=auto is not "
+ + "supported, using fixed!");
}
if (area instanceof NormalBlockArea) {
- layout.completeCurrentLineInBlock((NormalBlockArea) area);
+ getLayout().completeCurrentLineInBlock((NormalBlockArea) area);
}
setProgress(0);
@@ -97,7 +97,7 @@
boolean addedFooter = false;
if (node.numberOfColumns() == 0) {
- layout.getLogger().warn("current implementation of tables "
+ getLayout().getLogger().warn("current implementation of tables "
+ "requires a table-column for each column, "
+ "indicating column-width");
}
@@ -220,8 +220,8 @@
// from the last table body and place it on the
// next page so that it can have a footer at
// the end of the table.
- layout.getLogger().warn("footer could not fit on page, moving "
- + "last body row to next page");
+ getLayout().getLogger().warn("footer could not fit on page, "
+ + "moving last body row to next page");
area.incrementProgressionDimension(areaContainer.crBPD());
final TableFooterPL tableFooterPL
= (TableFooterPL) this.getLayoutProxy(tf);
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -95,7 +95,7 @@
cellColNum = colNum;
} else if (cellColNum > columns.length) {
// Explicit colomn number specification out of range, skip it.
- layout.getLogger().error("Cell (#" + i + ") explicitly "
+ getLayout().getLogger().error("Cell (#" + i + ") explicitly "
+ "positioned beyond number of columns, dropped:\n"
+ cell.getContextMessage());
continue;
@@ -103,15 +103,15 @@
// see if it fits and doesn't overwrite anything
if (cellColNum + numCols - 1 > columns.length) {
// Too many columns spanned.
- layout.getLogger().error("Cell (#" + i + ") spans columns "
+ getLayout().getLogger().error("Cell (#" + i + ") spans columns "
+ "beyond available number, clipped:\n"
+ cell.getContextMessage());
numCols = columns.length - cellColNum + 1;
}
// Check for overwriting other cells (returns false)
if (cellArray.storeCell(cell, cellColNum, numCols) == false) {
- layout.getLogger().error("Cell (#" + i + ") overwrites other "
- + "cells:\n"
+ getLayout().getLogger().error("Cell (#" + i + ") overwrites "
+ + "other cells:\n"
+ cell.getContextMessage());
}
if (cellColNum > colNum) {
@@ -120,7 +120,7 @@
} else if (cellColNum < colNum) {
// Cells out of order
colNum = cellColNum; // CR "to the letter"!
- layout.getLogger().debug("Cell positioned out of order:\n"
+ getLayout().getLogger().debug("Cell positioned out of order:\n"
+ cell.getContextMessage());
}
colNum += numCols; // next cell in this column
@@ -150,7 +150,7 @@
// laid out yet (with an id created already)
}
setProgress(0);
- final int breakStatus = layout.checkBreakBefore(node, area);
+ final int breakStatus = getLayout().checkBreakBefore(node, area);
if (breakStatus != Status.OK) {
return breakStatus;
}
@@ -230,7 +230,8 @@
final int h = cellPL.getHeight(area);
if (rowSpan > 1) { // pass cell fo or area???
rowSpanMgr.addRowSpan(cell, iColIndex,
- cell.traitNumberColumnsSpanned(), h, rowSpan, layout);
+ cell.traitNumberColumnsSpanned(), h, rowSpan,
+ getLayout());
} else if (h > largestCellHeight) {
largestCellHeight = h;
}
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:44:06 UTC (rev 8325)
@@ -52,8 +52,6 @@
<suppress checks="VisibilityModifier"
files="org.foray.pdf.*"/>
<suppress checks="VisibilityModifier"
- files="org.foray.pioneer.*"/>
- <suppress checks="VisibilityModifier"
files="org.foray.render.*"/>
<!-- Semi-permanent exemptions. -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-07 16:09:29
|
Revision: 8327
http://svn.sourceforge.net/foray/?rev=8327&view=rev
Author: victormote
Date: 2006-10-07 09:09:12 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java
trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/Command.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/LoadableProperties.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessageException.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -112,7 +112,6 @@
getCommandLineOptions().getRendererOptions();
this.renderer = new AWTRenderer(this.getLogger(), renderOptions);
frame = createPreviewDialog(renderer, resource);
- renderer.setProgressListener(frame);
renderer.setComponent(frame);
frame.progress(resource.getString("Init parser") + " ...");
}
Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -132,7 +132,6 @@
//Create preview dialog (target for the AWTRenderer)
final PreviewDialog frame = createPreviewDialog(renderer, translator);
- renderer.setProgressListener(frame);
renderer.setComponent(frame);
// TODO: This is probably not right. Needs to run session.process().
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -100,7 +100,7 @@
/** */
public static final int MAXIMUM_INTEGRAL_COLOR_VALUE = 255;
- AreaTree areaTree;
+ private AreaTree areaTree;
/**
* Constructor.
Modified: trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -41,25 +41,22 @@
*/
public class TempImage implements Graphic {
- int height;
- int width;
- int bitsPerPixel;
- ColorSpace colorSpace;
- int bitmapSiye;
- byte[] bitmaps;
- byte[] mask;
- Color transparent = new Color(255, 255, 255);
- URL url;
+ private int height;
+ private int width;
+ private int bitsPerPixel;
+ private ColorSpace colorSpace;
+ private byte[] bitmaps;
+ private Color transparent = new Color(255, 255, 255);
+ private URL url;
public TempImage(final URL url, final int width, final int height,
- final byte[] result, final byte[] mask) throws GraphicException {
+ final byte[] result) throws GraphicException {
this.url = url;
this.height = height;
this.width = width;
this.bitsPerPixel = 8;
this.colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
this.bitmaps = result;
- this.mask = mask;
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -98,8 +98,8 @@
}
public void renderPage(final PageArea page) {
- pageWidth = (int) (page.getWidth() / 1000f);
- pageHeight = (int) (page.getHeight() / 1000f);
+ setPageWidth((int) (page.getWidth() / 1000f));
+ setPageHeight((int) (page.getHeight() / 1000f));
super.renderPage(page);
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -31,7 +31,6 @@
import org.foray.common.url.URLFactory;
import org.foray.output.OutputConfig;
import org.foray.render.Renderer;
-import org.foray.render.awt.viewer.ProgressListener;
import org.axsl.areaR.Area;
import org.axsl.areaR.BasicLinkArea;
@@ -83,8 +82,6 @@
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
import java.util.Vector;
import javax.swing.ImageIcon;
@@ -102,16 +99,13 @@
*/
public class AWTRenderer extends Renderer implements Printable, Pageable {
- protected int pageWidth = 0;
- protected int pageHeight = 0;
- protected double scaleFactor = 100.0;
- protected int pageNumber = 0;
- protected Vector pageList = new Vector();
- protected ProgressListener progressListener = null;
+ private int pageWidth = 0;
+ private int pageHeight = 0;
+ private double scaleFactor = 100.0;
+ private int pageNumber = 0;
+ private Vector pageList = new Vector();
- protected Map fontNames = new HashMap();
- protected Map fontStyles = new HashMap();
- protected Color saveColor = null;
+ private Color saveColor = null;
/**
* Image Object and Graphics Object. The Graphics Object is the Graphics
@@ -817,10 +811,6 @@
return this;
}
- public void setProgressListener(final ProgressListener l) {
- progressListener = l;
- }
-
/**
* Draws an image.
* TODO: protect other image formats (JIMI)
@@ -889,4 +879,18 @@
return false;
}
+ /**
+ * @param pageWidth The pageWidth to set.
+ */
+ public void setPageWidth(final int pageWidth) {
+ this.pageWidth = pageWidth;
+ }
+
+ /**
+ * @param pageHeight The pageHeight to set.
+ */
+ public void setPageHeight(final int pageHeight) {
+ this.pageHeight = pageHeight;
+ }
+
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/Command.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/Command.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/Command.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -59,7 +59,7 @@
private static final String IMAGE_DIR =
"/org/foray/render/awt/viewer/images/";
- PreviewDialog parent;
+ private PreviewDialog parent;
public Command(final PreviewDialog dialog, final String name) {
this(dialog, name, (ImageIcon) null);
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/LoadableProperties.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/LoadableProperties.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/LoadableProperties.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -49,7 +49,7 @@
public class LoadableProperties extends Hashtable {
static final long serialVersionUID = 733955308698967466L;
- SecureResourceBundle parent;
+ private SecureResourceBundle parent;
public LoadableProperties(final SecureResourceBundle bundle) {
super();
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessageException.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessageException.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessageException.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -47,17 +47,17 @@
* Angabe der auslösenden Exception, wie z.B. NullPointerException.
* Dieses Feld ist optional.
*/
- protected Exception exception;
+ private Exception exception;
/**
* ID der Meldung, die für diese Exception ausgegeben werden soll
*/
- protected String messageId;
+ private String messageId;
/**
* Parameterliste zur Meldung
*/
- protected String[] parameterList;
+ private String[] parameterList;
// Konstruktoren
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -50,30 +50,31 @@
* @version 1.0 09.06.99
*/
public class MessagesDialog extends JOptionPane {
- static final long serialVersionUID = 868171457144669142L;
- static Translator res;
+ private static final long serialVersionUID = 868171457144669142L;
- static String detailOption;
- static String yesString;
- static String noString;
- static String cancelString;
- static String okString;
+ private static Translator res;
- static String[] defaultDetailOption;
- static String[] yesNoDetailOption;
- static String[] yesNoCancelDetailOption;
- static String[] okCancelDetailOption;
+ private static String detailOption;
+ private static String yesString;
+ private static String noString;
+ private static String cancelString;
+ private static String okString;
- static String[] defaultOption;
- static String[] yesNoOption;
- static String[] yesNoCancelOption;
- static String[] okCancelOption;
+ private static String[] defaultDetailOption;
+ private static String[] yesNoDetailOption;
+ private static String[] yesNoCancelDetailOption;
+ private static String[] okCancelDetailOption;
- protected String detailInformation = null;
- protected JDialog dialog = null;
- protected boolean showsDetails = false;
+ private static String[] defaultOption;
+ private static String[] yesNoOption;
+ private static String[] yesNoCancelOption;
+ private static String[] okCancelOption;
+ private String detailInformation = null;
+ private JDialog dialog = null;
+ private boolean showsDetails = false;
+
public MessagesDialog(final Object message, final int messageType,
final int optionType, final Icon icon, final Object[] options,
final Object initialValue) {
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -73,44 +73,45 @@
* Frame and User Interface for Preview
*/
public class PreviewDialog extends JFrame implements ProgressListener {
- static final long serialVersionUID = 487134473378298400L;
- protected Translator res;
+ private static final long serialVersionUID = 487134473378298400L;
- protected int currentPage = 0;
- protected int pageCount = 0;
+ private Translator res;
- protected AWTRenderer renderer;
+ private int currentPage = 0;
+ private int pageCount = 0;
- protected IconToolBar toolBar = new IconToolBar();
+ private AWTRenderer renderer;
- protected Command printAction;
- protected Command firstPageAction;
- protected Command previousPageAction;
- protected Command nextPageAction;
- protected Command lastPageAction;
- protected Command reloadAction;
- protected Reloader reloader;
+ private IconToolBar toolBar = new IconToolBar();
- protected JLabel zoomLabel =
+ private Command printAction;
+ private Command firstPageAction;
+ private Command previousPageAction;
+ private Command nextPageAction;
+ private Command lastPageAction;
+ private Command reloadAction;
+ private Reloader reloader;
+
+ private JLabel zoomLabel =
new JLabel(); // {public float getAlignmentY() { return 0.0f; }};
- protected JComboBox scale = new JComboBox() {
- static final long serialVersionUID = 76538924635317660L;
+ private JComboBox scale = new JComboBox() {
+ private static final long serialVersionUID = 76538924635317660L;
public float getAlignmentY() {
return 0.5f;
}
};
- protected JScrollPane previewArea = new JScrollPane();
+ private JScrollPane previewArea = new JScrollPane();
// protected JLabel statusBar = new JLabel();
- protected JPanel statusBar = new JPanel();
- protected GridBagLayout statusBarLayout = new GridBagLayout();
+ private JPanel statusBar = new JPanel();
+ private GridBagLayout statusBarLayout = new GridBagLayout();
- protected JLabel statisticsStatus = new JLabel();
- protected JLabel processStatus = new JLabel();
- protected JLabel infoStatus = new JLabel();
- protected JLabel previewImageLabel = new JLabel();
+ private JLabel statisticsStatus = new JLabel();
+ private JLabel processStatus = new JLabel();
+ private JLabel infoStatus = new JLabel();
+ private JLabel previewImageLabel = new JLabel();
private Log logger;
@@ -592,13 +593,13 @@
/**
* The message to display
*/
- Object message;
+ private Object message;
/**
* Is this an errorMessage, i.e. should it be shown in
* an JOptionPane or in the status bar.
*/
- boolean isErrorMessage = false;
+ private boolean isErrorMessage = false;
/**
* Constructs showProgress thread
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -47,7 +47,6 @@
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
-import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
@@ -60,27 +59,22 @@
public class PreviewDialogAboutBox extends Dialog implements ActionListener {
static final long serialVersionUID = 235027317547788598L;
- JPanel panel1 = new JPanel();
- JPanel panel2 = new JPanel();
- JPanel insetsPanel1 = new JPanel();
- JPanel insetsPanel2 = new JPanel();
- JPanel insetsPanel3 = new JPanel();
- JButton button1 = new JButton();
- JLabel imageControl1 = new JLabel();
- ImageIcon imageIcon;
- JLabel label1 = new JLabel();
- JLabel label2 = new JLabel();
- JLabel label3 = new JLabel();
- JLabel label4 = new JLabel();
- BorderLayout borderLayout1 = new BorderLayout();
- BorderLayout borderLayout2 = new BorderLayout();
- FlowLayout flowLayout1 = new FlowLayout();
- FlowLayout flowLayout2 = new FlowLayout();
- GridLayout gridLayout1 = new GridLayout();
- String product;
- String version;
- String copyright;
- String comments = ""; // "Print Preview";
+ private JPanel panel1 = new JPanel();
+ private JPanel panel2 = new JPanel();
+ private JPanel insetsPanel1 = new JPanel();
+ private JPanel insetsPanel2 = new JPanel();
+ private JPanel insetsPanel3 = new JPanel();
+ private JButton button1 = new JButton();
+ private JLabel imageControl1 = new JLabel();
+ private JLabel label1 = new JLabel();
+ private JLabel label2 = new JLabel();
+ private JLabel label3 = new JLabel();
+ private JLabel label4 = new JLabel();
+ private BorderLayout borderLayout1 = new BorderLayout();
+ private BorderLayout borderLayout2 = new BorderLayout();
+ private FlowLayout flowLayout1 = new FlowLayout();
+ private GridLayout gridLayout1 = new GridLayout();
+ private String comments = ""; // "Print Preview";
public PreviewDialogAboutBox(final PreviewDialog parent) {
super(parent);
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java 2006-10-07 16:09:12 UTC (rev 8327)
@@ -182,7 +182,6 @@
g.dispose();
final byte[] result = new byte[buf.getWidth() * buf.getHeight() * 3];
- final byte[] mask = new byte[buf.getWidth() * buf.getHeight()];
final Raster raster = buf.getData();
final DataBuffer bd = raster.getDataBuffer();
@@ -212,8 +211,7 @@
}
try {
- final Graphic graphic = new TempImage(null, width, height, result,
- mask);
+ final Graphic graphic = new TempImage(null, width, height, result);
final AffineTransform at = getTransform();
final double[] matrix = new double[6];
at.getMatrix(matrix);
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:49:54 UTC (rev 8326)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 16:09:12 UTC (rev 8327)
@@ -51,8 +51,6 @@
files="org.foray.fotree.*"/>
<suppress checks="VisibilityModifier"
files="org.foray.pdf.*"/>
- <suppress checks="VisibilityModifier"
- files="org.foray.render.*"/>
<!-- Semi-permanent exemptions. -->
<suppress checks="MagicNumber"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-07 17:04:34
|
Revision: 8330
http://svn.sourceforge.net/foray/?rev=8330&view=rev
Author: victormote
Date: 2006-10-07 10:04:14 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFAnnotList.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFAnnotation.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFArray.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFont.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFontDescriptor.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDSystemInfo.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCMap.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCharProcs.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFColor.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDate.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncoding.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFExplicitDestination.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFileSpec.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontDescriptor.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontFileStream.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontType0.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFunction.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFGoTo.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFGoToRemote.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFObject.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFStream.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFToUnicodeCMap.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFAnnotList.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFAnnotList.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFAnnotList.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -36,7 +36,7 @@
public class PDFAnnotList extends PDFObject {
/** Collection of PDFAnnotation objects */
- protected ArrayList annotations = new ArrayList();
+ private ArrayList annotations = new ArrayList();
/**
* Create a PDFAnnotList object.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFAnnotation.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFAnnotation.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFAnnotation.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -35,8 +35,7 @@
*/
public abstract class PDFAnnotation extends PDFObject {
- protected PDFPage page;
- protected Rectangle2D.Float rectangle;
+ private Rectangle2D.Float rectangle;
/**
* create objects associated with a link annotation (GoToR)
@@ -44,11 +43,16 @@
* @param doc {@inheritDoc}
* @param r The rectangle which outlines the link.
*/
- public PDFAnnotation(final PDFDocument doc, final PDFPage page,
- final Rectangle2D.Float r) {
+ public PDFAnnotation(final PDFDocument doc, final Rectangle2D.Float r) {
super(doc);
- this.page = page;
this.rectangle = r;
}
+ /**
+ * @return Returns the rectangle.
+ */
+ public Rectangle2D.Float getRectangle() {
+ return this.rectangle;
+ }
+
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFArray.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFArray.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFArray.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -35,7 +35,7 @@
*/
public class PDFArray extends PDFObject {
- Object arrayContents;
+ private Object arrayContents;
/**
* Create the array object.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFont.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFont.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFont.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -61,11 +61,11 @@
};
// protected PDFWArray w;
- protected int[] dw2;
- protected PDFWArray w2;
- protected PDFCIDSystemInfo systemInfo;
- protected PDFCIDFontDescriptor descriptor;
- protected FontUse fsFont;
+ private int[] dw2;
+ private PDFWArray w2;
+ private PDFCIDSystemInfo systemInfo;
+ private PDFCIDFontDescriptor descriptor;
+ private FontUse fsFont;
/**
* /CIDToGIDMap (only for CIDFontType2, see PDF Reference, Second Edition,
@@ -73,7 +73,7 @@
* in CID Fonts".)
* Can be either "Identity" (when null, the default) or a PDFStream.
*/
- protected PDFStream cidMap;
+ private PDFStream cidMap;
/**
* Constructor.
@@ -256,4 +256,11 @@
return returnValue;
}
+ /**
+ * @return Returns the systemInfo.
+ */
+ public PDFCIDSystemInfo getSystemInfo() {
+ return this.systemInfo;
+ }
+
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFontDescriptor.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFontDescriptor.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDFontDescriptor.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -38,8 +38,8 @@
*/
public class PDFCIDFontDescriptor extends PDFFontDescriptor {
- protected String lang;
- protected PDFStream cidSet;
+ private String lang;
+ private PDFStream cidSet;
/**
* Create the /FontDescriptor object for a CID font.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDSystemInfo.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDSystemInfo.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCIDSystemInfo.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -37,9 +37,9 @@
*/
public class PDFCIDSystemInfo extends PDFObject {
private static final StringBuffer BUFFER = new StringBuffer();
- protected String registry;
- protected String ordering;
- protected int supplement;
+ private String registry;
+ private String ordering;
+ private int supplement;
public PDFCIDSystemInfo(final String registry, final String ordering,
final int supplement) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCMap.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCMap.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCMap.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -120,65 +120,18 @@
/**
* /CMapName attribute, one of the predefined constants
*/
- protected String name;
+ private String name;
/**
- * /CIDSystemInfo attribute
- */
- protected PDFCIDSystemInfo sysInfo;
-
- /**
- * font's writing direction
- */
- protected byte wMode = WMODE_HORIZONTAL;
-
- /**
- * base CMap (String or PDFStream)
- */
- protected Object base;
-
- /**
* create the /CMap object
*
* @param name one the registered names (see Table 7.20 on p 215)
- * @param sysInfo the attributes of the character collection of the CIDFont
*/
- public PDFCMap(final PDFDocument doc, final String name,
- final PDFCIDSystemInfo sysInfo) {
+ public PDFCMap(final PDFDocument doc, final String name) {
super(doc);
this.name = name;
- this.sysInfo = sysInfo;
- this.base = null;
}
- /**
- * set the writing direction
- *
- * @param mode is either <code>WMODE_HORIZONTAL</code>
- * or <code>WMODE_VERTICAL</code>
- */
- public void setWMode(final byte mode) {
- this.wMode = mode;
- }
-
- /**
- * set the base CMap
- *
- * @param base the name of the base CMap (see Table 7.20)
- */
- public void setUseCMap(final String base) {
- this.base = base;
- }
-
- /**
- * set the base CMap
- *
- * @param base the stream to be used as base CMap
- */
- public void setUseCMap(final PDFStream base) {
- this.base = base;
- }
-
protected int output(final OutputStream stream) throws IOException {
fillInPDF(new StringBuffer());
return super.output(stream);
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCharProcs.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCharProcs.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFCharProcs.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -44,7 +44,7 @@
/**
* the (character name, drawing stream) pairs for a Type3 font
*/
- protected HashMap keys;
+ private HashMap keys;
public PDFCharProcs() {
keys = new HashMap();
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFColor.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFColor.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFColor.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -38,7 +38,7 @@
*/
public class PDFColor extends PDFPathPaint implements org.axsl.pdfW.PDFColor {
- protected Color color;
+ private Color color;
public PDFColor(final Color theColor) {
this.color = theColor;
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -64,9 +64,9 @@
implements org.axsl.pdfW.PDFContentStream {
/** The page this content stream is attached to. */
- PDFPage page;
+ private PDFPage page;
- boolean textObjectOpen = false;
+ private boolean textObjectOpen = false;
/**
* Create a PDFContentStream.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDate.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDate.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDate.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -44,7 +44,7 @@
public class PDFDate extends PDFObject {
/** The encapsulated Date instance. */
- Date date;
+ private Date date;
/**
* Create a PDFDate instance.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncoding.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncoding.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncoding.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -39,7 +39,7 @@
public class PDFEncoding extends PDFObject {
/** The actual Encoding instance for which this object is a wrapper. */
- protected Encoding encoding;
+ private Encoding encoding;
/**
* Constructor. Creates the /Encoding object.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -52,7 +52,7 @@
* Private inner class for the encryption filter.
*/
private class EncryptionFilter extends PSFilter {
- PDFEncryption encryption;
+ private PDFEncryption encryption;
/** The constructor for the internal PDFEncryption filter
* @param encryption The encryption object to use
@@ -116,20 +116,20 @@
/** Value of PRINT permission
*/
// Encryption tools
- MessageDigest digest = null;
- Cipher cipher = null;
- Random random = new Random();
+ private MessageDigest digest = null;
+ private Cipher cipher = null;
+ private Random random = new Random();
// Control attributes
- String userPassword = "";
- String ownerPassword = "";
- boolean allowPrint = true;
- boolean allowCopyContent = true;
- boolean allowEditContent = true;
- boolean allowEditAnnotations = true;
+ private String userPassword = "";
+ private String ownerPassword = "";
+ private boolean allowPrint = true;
+ private boolean allowCopyContent = true;
+ private boolean allowEditContent = true;
+ private boolean allowEditAnnotations = true;
// Output attributes
- byte [] fileID = null;
- byte [] encryptionKey = null;
- String dictionary = null;
+ private byte [] fileID = null;
+ private byte [] encryptionKey = null;
+ private String dictionary = null;
/**
* Create a /Filter /Standard object.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFExplicitDestination.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFExplicitDestination.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFExplicitDestination.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -44,9 +44,9 @@
implements org.axsl.pdfW.PDFExplicitDestination {
/** The page to which this Destination goes. */
- protected PDFPage page;
- protected float leftPosition = 0;
- protected float topPosition = 0;
+ private PDFPage page;
+ private float leftPosition = 0;
+ private float topPosition = 0;
public PDFExplicitDestination(final PDFDocument doc, final PDFPage page,
final float xPosition, final float yPosition) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFileSpec.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFileSpec.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFileSpec.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -37,7 +37,7 @@
/**
* the filename
*/
- protected String filename;
+ private String filename;
/**
* Create a /FileSpec object.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -65,7 +65,7 @@
/* The order is important here. */
new String[] {"Type0", "Type1", "MMType1", "Type3", "TrueType" };
- protected FontUse fsFont;
+ private FontUse fsFont;
private byte fontSubType = -1;
@@ -144,7 +144,7 @@
public String getBaseFont() {
if (fsFont.getFont().isSubsettable()) {
- return document.getNextFontSubsetTag() + "+"
+ return getPDFDocument().getNextFontSubsetTag() + "+"
+ fsFont.getFont().getPostscriptName();
}
return fsFont.getFont().getPostscriptName();
@@ -219,7 +219,7 @@
if (isStandardFont()) {
return;
}
- final PDFArray widthArray = new PDFArray(this.document,
+ final PDFArray widthArray = new PDFArray(getPDFDocument(),
getFontOutput().getWidths());
buffer.append("/Widths ");
buffer.append(widthArray.pdfReference());
@@ -271,7 +271,7 @@
}
/* TODO: This is all bogus and is really just a placeholder for future
* implementation. */
- final PDFArray fontMatrix = new PDFArray(this.document, new int[0]);
+ final PDFArray fontMatrix = new PDFArray(getPDFDocument(), new int[0]);
if (fontMatrix != null) {
buffer.append("/FontMatrix ");
buffer.append(fontMatrix.toPDF());
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontDescriptor.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontDescriptor.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontDescriptor.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -39,19 +39,19 @@
*/
public class PDFFontDescriptor extends PDFObject {
- protected PDFFont font;
+ private PDFFont font;
// Optional fields
- protected int stemH = 0;
- protected int xHeight = 0;
- protected int leading = 0;
- protected int avgWidth = 0;
- protected int maxWidth = 0;
- protected int missingWidth = 0;
- protected PDFStream fontfile;
+ private int stemH = 0;
+ private int xHeight = 0;
+ private int leading = 0;
+ private int avgWidth = 0;
+ private int maxWidth = 0;
+ private int missingWidth = 0;
+ private PDFStream fontfile;
// protected String charSet = null;
- protected byte subtype;
+ private byte subtype;
/**
* Constructor for the /FontDescriptor object.
@@ -114,8 +114,8 @@
* @return the PDF
*/
public String toPDF() {
- final Font font = this.font.fsFont.getFont();
- final FontPDF fontPDF = (FontPDF) this.font.fsFont.getFontOutput(
+ final Font font = this.font.getFontUse().getFont();
+ final FontPDF fontPDF = (FontPDF) this.font.getFontUse().getFontOutput(
"application/pdf");
final StringBuffer p = new StringBuffer();
p.append(this.pdfID() + EOL);
@@ -194,12 +194,12 @@
protected void fillInPDF(final StringBuffer begin) { }
protected void embedFont() {
- if (! font.fsFont.getFont().isEmbeddable()) {
+ if (! font.getFontUse().getFont().isEmbeddable()) {
return;
}
PDFFontFileStream stream = null;
try {
- stream = new PDFFontFileStream(document, font.fsFont);
+ stream = new PDFFontFileStream(getPDFDocument(), font.getFontUse());
} catch (final PDFException e) {
stream = null;
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontFileStream.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontFileStream.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontFileStream.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -57,7 +57,7 @@
try {
setData(fontFileStream);
} catch (final IOException ioe) {
- document.getLogger().error("Failed to embed font "
+ getPDFDocument().getLogger().error("Failed to embed font "
+ font.getFont().getPostscriptName() + ": "
+ ioe.getMessage());
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontType0.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontType0.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFontType0.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -41,7 +41,7 @@
* The descendant fonts are actually an array of CIDFonts, but only the
* first one is used.
*/
- protected PDFCIDFont descendantFonts;
+ private PDFCIDFont descendantFonts;
/**
* Constructor.
@@ -57,8 +57,8 @@
}
protected PDFToUnicodeCMap getToUnicodeCMAP() {
- return new PDFToUnicodeCMap(this.document, "Identity-H",
- this.descendantFonts.systemInfo, fsFont);
+ return new PDFToUnicodeCMap(getPDFDocument(), "Identity-H",
+ this.descendantFonts.getSystemInfo(), getFontUse());
}
protected PDFCIDFont getDescendantFonts() {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFunction.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFunction.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFunction.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -49,19 +49,19 @@
/**
* Required: The Type of function (0,2,3,4) default is 0.
*/
- protected int functionType = 0; // Default
+ private int functionType = 0; // Default
/**
* Required: 2 * m Array of Double numbers which are possible inputs to the
* function
*/
- protected List domain = null;
+ private List domain = null;
/**
* Required: 2 * n Array of Double numbers which are possible outputs to
* the function
*/
- protected List range = null;
+ private List range = null;
/* ********************TYPE 0***************************** */
// FunctionType 0 specific function guts
@@ -73,19 +73,19 @@
* sizeRange, but since they're expressed as an array in PDF, my
* implementation reflects that.
*/
- protected List size = null;
+ private List size = null;
/**
* Required for Type 0: Number of Bits used to represent each sample value.
* Limited to 1,2,4,8,12,16,24, or 32.
*/
- protected int bitsPerSample = 1;
+ private int bitsPerSample = 1;
/**
* Optional for Type 0: order of interpolation between samples. Limited to
* linear (1) or cubic (3). Default is 1.
*/
- protected int order = 1;
+ private int order = 1;
/**
* Optional for Type 0: A 2 * m array of Doubles which provides a linear
@@ -97,13 +97,13 @@
* Should be two values per function, usually (0,1), as in [0 1 0 1] for 2
* functions.
*/
- protected List encode = null;
+ private List encode = null;
/**
* Optinoal for Type 0: A 2 * n array of Doubles which provides a linear
* mapping of sample values to the range. Defaults to Range.
*/
- protected List decode = null;
+ private List decode = null;
/**
* Optional For Type 0: A stream of sample values
@@ -113,34 +113,34 @@
* Required For Type 4: Postscript Calculator function composed of
* arithmetic, boolean, and stack operators + boolean constants.
*/
- protected StringBuffer functionDataStream = null;
+ private StringBuffer functionDataStream = null;
/**
* Required (?) For Type 0: A List of Strings for the various filters to be
* used to decode the stream.
* These are how the string is compressed. Flate, LZW, etc.
*/
- protected List filter = null;
+ private List filter = null;
/* *************************TYPE 2************************** */
/**
* Required For Type 2: An Array of n Doubles defining the function result
* when x=0. Default is [0].
*/
- protected List cZero = null;
+ private List cZero = null;
/**
* Required For Type 2: An Array of n Doubles defining the function result
* when x=1. Default is [1].
*/
- protected List cOne = null;
+ private List cOne = null;
/**
* Required for Type 2: The interpolation exponent.
* Each value x will return n results.
* Must be greater than 0.
*/
- protected double interpolationExponentN = 1;
+ private double interpolationExponentN = 1;
/* *************************TYPE 3************************** */
@@ -148,7 +148,7 @@
* Required for Type 3: A List of PDFFunctions which form an array of k
* single input functions making up the stitching function.
*/
- protected List functions = null;
+ private List functions = null;
/**
* Optional for Type 3: An array of (k-1) Doubles that, in combination with
@@ -161,7 +161,7 @@
* stitching function.
* It makes the gradient even.
*/
- protected List bounds = null;
+ private List bounds = null;
// See encode above, as it's also part of Type 3 Functions.
/* *************************TYPE 4************************** */
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFGoTo.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFGoTo.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFGoTo.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -34,7 +34,7 @@
*/
public class PDFGoTo extends PDFAction {
- protected PDFDestination destination;
+ private PDFDestination destination;
/**
* Create a /GoTo object.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFGoToRemote.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFGoToRemote.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFGoToRemote.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -36,9 +36,9 @@
/**
* the file specification
*/
- protected PDFFileSpec pdfFileSpec;
- protected int pageReference = 0;
- protected String destination = null;
+ private PDFFileSpec pdfFileSpec;
+ private int pageReference = 0;
+ private String destination = null;
/**
* create an GoToR object.
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -36,13 +36,13 @@
public class PDFLink extends PDFAnnotation implements org.axsl.pdfW.PDFLink {
/** Should be null if either destination or action is not. */
- PDFTextString destinationName;
+ private PDFTextString destinationName;
/** Should be null if either destinationName or action is not. */
- PDFDestination destination;
+ private PDFDestination destination;
/** Should be null if either destination or destinationName is not. */
- PDFAction action;
+ private PDFAction action;
private PDFColor color = null;
@@ -54,7 +54,7 @@
*/
private PDFLink(final PDFDocument doc, final PDFPage page,
final Rectangle2D.Float rect) {
- super(doc, page, rect);
+ super(doc, rect);
}
public PDFLink(final PDFDocument doc, final PDFPage page,
@@ -99,9 +99,9 @@
buffer.append("<< /Type /Annot" + EOL);
buffer.append("/Subtype /Link" + EOL);
buffer.append("/Rect ["
- + rectangle.x + " " + rectangle.y + " "
- + (rectangle.x + rectangle.width) + " "
- + (rectangle.y - rectangle.height) + "]" + EOL);
+ + getRectangle().x + " " + getRectangle().y + " "
+ + (getRectangle().x + getRectangle().width) + " "
+ + (getRectangle().y - getRectangle().height) + "]" + EOL);
buffer.append("/BS " + this.getPDFDocument().getDefaultBorderStyle()
.pdfReference() + EOL);
if (this.color != null && ! this.color.isBlack()) {
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFObject.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFObject.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFObject.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -70,7 +70,7 @@
/**
* The parent PDFDocument.
*/
- protected PDFDocument document;
+ private PDFDocument document;
/**
* the object's number
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFStream.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFStream.java 2006-10-07 16:43:15 UTC (rev 8329)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFStream.java 2006-10-07 17:04:14 UTC (rev 8330)
@@ -142,10 +142,10 @@
* this.document can be null for temporary streams, and those should
* not have any default filters applied anyway.
*/
- if (document == null) {
+ if (getPDFDocument() == null) {
return;
}
- final List filters = document.getDefaultFilters();
+ final List filters = getPDFDocument().getDefaultFilters();
for (int i = 0; i < filters.size(); i++) {
final String filterToAdd = (String) filters.get(i);
addFilter(filterToAdd);
Modified: trunk/foray/foray-pdf/s...
[truncated message content] |
|
From: <vic...@us...> - 2006-10-07 19:07:09
|
Revision: 8338
http://svn.sourceforge.net/foray/?rev=8338&view=rev
Author: victormote
Date: 2006-10-07 12:07:03 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-10-07 18:54:19 UTC (rev 8337)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-10-07 19:07:03 UTC (rev 8338)
@@ -52,7 +52,7 @@
public abstract class AreaNode extends OrderedTreeNode
implements org.axsl.areaR.AreaNode, org.axsl.areaW.AreaNode {
- protected ArrayList children = new ArrayList();
+ private ArrayList children = new ArrayList();
/** The "generated-by" trait, as defined in Section 6.1.1. */
private FOLinkage generatedBy;
@@ -506,4 +506,11 @@
this.generatedBy = newLinkage;
}
+ /**
+ * Removes the references to the child nodes from this Area.
+ */
+ protected void resetChildren() {
+ this.children = null;
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-10-07 18:54:19 UTC (rev 8337)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-10-07 19:07:03 UTC (rev 8338)
@@ -106,8 +106,8 @@
}
this.optimized = true;
// Resolve the page-number-citations.
- for (int i = 0; i < children.size(); i++) {
- final Object o = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object o = getChildren().get(i);
if (o instanceof PageNumberCitationArea) {
final PageNumberCitationArea pia = (PageNumberCitationArea) o;
pia.resolve();
@@ -157,8 +157,8 @@
if (leaderSpaceAvailable == 0) {
return;
}
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof LeaderArea) {
final LeaderArea leader = (LeaderArea) object;
boolean prorating = false;
@@ -182,8 +182,8 @@
private int computeLeaderCapacity(final int unusedSpace) {
// First, compute how much capacity the leaders have.
int leaderSpaceAvailable = 0;
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof LeaderArea) {
final LeaderArea leader = (LeaderArea) object;
if (unusedSpace > 0) {
@@ -239,8 +239,8 @@
if (wordSpacingCapacity == 0) {
return;
}
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
boolean prorating = false;
@@ -261,8 +261,8 @@
*/
private int computeWordSpacingCapacity(final int unusedSpace) {
int wordSpacingCapacity = 0;
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
if (unusedSpace > 0) {
@@ -310,8 +310,8 @@
if (letterSpacingCapacity == 0) {
return;
}
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
boolean prorating = false;
@@ -332,8 +332,8 @@
*/
private int computeLetterSpacingCapacity(final int unusedSpace) {
int letterSpacingCapacity = 0;
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
if (unusedSpace > 0) {
@@ -385,8 +385,8 @@
* absorb a relatively larger share of the change in word-space.
*/
int totalDenominator = 0;
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
final int denominator = text.countSpaces()
@@ -397,8 +397,8 @@
if (totalDenominator == 0) {
return;
}
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
final int numSpaces = text.countSpaces();
@@ -419,8 +419,8 @@
*/
public void verticalAlign() {
int maxHeight = this.getProgressionDimension();
- for (int i = 0; i < children.size(); i++) {
- final Object o = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object o = getChildren().get(i);
if (o instanceof AbstractInlineArea) {
final AbstractInlineArea ia = (AbstractInlineArea) o;
if (ia.crBPD() > maxHeight) {
@@ -434,7 +434,7 @@
}
public boolean isEmpty() {
- return !(children.size() > 0);
+ return !(getChildren().size() > 0);
}
/**
@@ -669,7 +669,7 @@
* dependencies between nodes in the tree.
*/
public void cleanup() {
- this.children = null;
+ resetChildren();
setProgressionDimension(0);
this.getAreaNodeParent().removeChild(this);
}
@@ -789,7 +789,7 @@
}
public boolean hasAnyContent() {
- return this.children.size() > 0;
+ return getChildren().size() > 0;
}
public static org.axsl.areaW.ForeignObjectArea makeForeignObjectArea(
@@ -897,7 +897,7 @@
/* If the final text will be empty, don't create the TextArea. */
final char[] rawText = foText.getAreaTreeText(context);
- final boolean isFirstItemOnline = parentArea.children.size() == 0;
+ final boolean isFirstItemOnline = parentArea.getChildren().size() == 0;
final int ignoreAtStart = TextArea.ignoreAtStart(rawText, startOffset,
sizeInChars, isFirstItemOnline,
parentArea.traitWhiteSpaceTreatment());
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-10-07 18:54:19 UTC (rev 8337)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-10-07 19:07:03 UTC (rev 8338)
@@ -163,14 +163,14 @@
}
public LineArea getPreviousLineArea(final LineArea lineArea) {
- if (this.children == null) {
+ if (this.getChildren() == null) {
return null;
}
- final int index = children.indexOf(lineArea);
+ final int index = getChildren().indexOf(lineArea);
if (index <= 0) {
return null;
}
- final Object previousObject = children.get(index - 1);
+ final Object previousObject = getChildren().get(index - 1);
if (previousObject instanceof LineArea) {
return (LineArea) previousObject;
}
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 18:54:19 UTC (rev 8337)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 19:07:03 UTC (rev 8338)
@@ -46,8 +46,6 @@
files="org.foray.text.*"/>
<suppress checks="VisibilityModifier"
- files="org.foray.area.*"/>
- <suppress checks="VisibilityModifier"
files="org.foray.fotree.*"/>
<!-- Semi-permanent exemptions. -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-07 22:19:32
|
Revision: 8345
http://svn.sourceforge.net/foray/?rev=8345&view=rev
Author: victormote
Date: 2006-10-07 15:19:20 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Character.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Cue.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Keep.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Name.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pause.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -67,7 +67,7 @@
* convert names in its namespace to a propertyType and back again.
* @see Namespace#enumerateAttribute(String)
*/
- protected short propertyType;
+ private short propertyType;
/** The PropertyValue instance that contains this property's value */
private PropertyValue value;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -178,7 +178,8 @@
* Adds a property to this PropertyList.
*/
public void addProperty(final Property property) {
- final Property existingProperty = getProperty(property.propertyType);
+ final Property existingProperty = getProperty(
+ property.getPropertyType());
/*
* Check to see if a property of this type is already in the collection.
* If so, and if they are the same object, then all that has happened
@@ -187,7 +188,7 @@
*/
if (existingProperty != null && property != existingProperty) {
fobj.getLogger().error("Property "
- + fobj.getPropertyName(property.propertyType)
+ + fobj.getPropertyName(property.getPropertyType())
+ " already exists.\n" + fobj.getContextMessage());
}
this.properties.add(property);
@@ -206,7 +207,7 @@
public Property getProperty(final short propertyType) {
for (int i = 0; i < properties.size(); i++) {
final Property property = (Property) properties.get(i);
- if (property.propertyType == propertyType) {
+ if (property.getPropertyType() == propertyType) {
return property;
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -83,7 +83,7 @@
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
- return getValueNoInstance(context, fobj, propertyType);
+ return getValueNoInstance(context, fobj, getPropertyType());
}
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -69,7 +69,7 @@
final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
- if (propertyType == Constants.FOPROP_BACKGROUND_POSITION) {
+ if (getPropertyType() == Constants.FOPROP_BACKGROUND_POSITION) {
setValue(createShorthandValue(propertyList, attributeValue));
} else {
setValue(createPropertyValue(propertyList, attributeValue));
@@ -105,7 +105,7 @@
PropertyValue pv = checkKeywords(value);
if (pv != null) {
final BackgroundPosition property = new BackgroundPosition(
- propertyList, propertyType, pv);
+ propertyList, getPropertyType(), pv);
collection.addItem(property);
return collection;
}
@@ -135,7 +135,7 @@
}
if (pv != null) {
final BackgroundPosition property = new BackgroundPosition(
- propertyList, propertyType, pv);
+ propertyList, getPropertyType(), pv);
collection.addItem(property);
} else {
throw unexpectedValue(value, propertyList);
@@ -323,7 +323,7 @@
}
protected short[] getValidKeywords() {
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_BACKGROUND_POSITION_HORIZONTAL: {
return VALID_KEYWORDS_HORIZONTAL;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -75,7 +75,7 @@
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
- return getValueNoInstance(context, fobj, propertyType);
+ return getValueNoInstance(context, fobj, getPropertyType());
}
case Constants.FOVAL_TRUE: {
return true;
@@ -129,7 +129,7 @@
}
protected short[] getValidKeywords() {
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_HYPHENATE:
case Constants.FOPROP_PRECEDENCE:
case Constants.FOPROP_SCORE_SPACES:
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Character.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Character.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Character.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -78,7 +78,7 @@
/* For "hyphenation-character", which can be inherited. */
public int getValue(final FOContext context, final FObj fobj) {
if (value() instanceof PropertyKeyword) {
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_HYPHENATION_CHARACTER: {
return getValueNoInstance(
context, Constants.FOPROP_HYPHENATION_CHARACTER, fobj);
@@ -136,7 +136,7 @@
}
protected short[] getValidKeywords() {
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_HYPHENATION_CHARACTER: {
return VALID_KEYWORDS_WITH_INHERIT;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Cue.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Cue.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Cue.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -162,7 +162,7 @@
}
protected short[] getValidKeywords() {
- if (propertyType == Constants.FOPROP_CUE) {
+ if (getPropertyType() == Constants.FOPROP_CUE) {
final short[] shorthandKeywords = {
Constants.FOVAL_INHERIT
};
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -74,11 +74,11 @@
if (parent != null) {
return getInheritedValue(context, parent);
}
- return getValueNoInstance(context, propertyType, fobj);
+ return getValueNoInstance(context, getPropertyType(), fobj);
}
return keyword;
}
- return getValueNoInstance(context, propertyType, fobj);
+ return getValueNoInstance(context, getPropertyType(), fobj);
}
/**
@@ -90,7 +90,7 @@
final short keyword = ((PropertyKeyword) value()).getValue();
return keyword;
}
- return getValueNoInstance(propertyType);
+ return getValueNoInstance(getPropertyType());
}
public static short getValueNoInstance(final FOContext context,
@@ -347,7 +347,7 @@
* @return The value for this property for fobj.
*/
private short getInheritedValue(final FOContext context, final FObj fobj) {
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_ABSOLUTE_POSITION: {
return fobj.traitAbsolutePosition(context);
}
@@ -488,7 +488,7 @@
}
protected short[] getValidKeywords() {
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_ABSOLUTE_POSITION: {
return keywordsAbsolutePosition();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -131,7 +131,7 @@
}
protected short[] getValidKeywords() {
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_GLYPH_ORIENTATION_VERTICAL: {
return VALID_KEYWORDS_HORIZONTAL;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Keep.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Keep.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Keep.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -110,7 +110,7 @@
final short keyword = ((PropertyKeyword) value()).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
- return getValueInherited(context, this.propertyType,
+ return getValueInherited(context, getPropertyType(),
subProperty, fobj);
}
case Constants.FOVAL_AUTO: {
@@ -136,7 +136,7 @@
}
}
// This is an error that should already have been caught.
- return getValueNoInstance(context, this.propertyType, subProperty,
+ return getValueNoInstance(context, getPropertyType(), subProperty,
fobj);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Name.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Name.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Name.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -80,7 +80,7 @@
if (parent == null) {
return getValueNoInstance();
}
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_COLOR_PROFILE_NAME: {
return parent.traitColorProfileName(context);
}
@@ -107,7 +107,7 @@
}
protected short[] getValidKeywords() {
- switch (propertyType) {
+ switch (getPropertyType()) {
case Constants.FOPROP_COLOR_PROFILE_NAME: {
return VALID_KEYWORDS;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pause.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pause.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pause.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -107,7 +107,8 @@
if (insideValue == null) {
throw unexpectedValue(value, propertyList);
}
- insideProperty = new Pause(propertyList, propertyType, insideValue);
+ insideProperty = new Pause(propertyList, getPropertyType(),
+ insideValue);
collection.addItem(insideProperty);
}
throw unexpectedValue(value, propertyList);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java 2006-10-07 22:19:20 UTC (rev 8345)
@@ -84,7 +84,7 @@
if (length == null) {
throw unexpectedValue(value, propertyList);
}
- final Size insideSize = new Size(propertyList, propertyType,
+ final Size insideSize = new Size(propertyList, getPropertyType(),
length);
collection.addItem(insideSize);
}
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 22:09:49 UTC (rev 8344)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 22:19:20 UTC (rev 8345)
@@ -45,9 +45,6 @@
<suppress checks="Javadoc[MVS].*"
files="org.foray.text.*"/>
- <suppress checks="VisibilityModifier"
- files="org.foray.fotree.*"/>
-
<!-- Semi-permanent exemptions. -->
<suppress checks="MagicNumber"
files="org.foray.ps.filter.ASCII85Filter.java"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-10 03:15:08
|
Revision: 8358
http://svn.sourceforge.net/foray/?rev=8358&view=rev
Author: victormote
Date: 2006-10-09 20:14:57 -0700 (Mon, 09 Oct 2006)
Log Message:
-----------
Add and use static methods to remove some magic numbers.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXPostScript.java
trunk/foray/foray-ps/src/java/org/foray/ps/FOrayBoundingBox.java
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXPostScript.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXPostScript.java 2006-10-10 02:57:54 UTC (rev 8357)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFXPostScript.java 2006-10-10 03:14:57 UTC (rev 8358)
@@ -28,6 +28,8 @@
package org.foray.pdf.object;
+import org.foray.ps.FOrayBoundingBox;
+
import org.axsl.graphicR.EPSGraphic;
import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
@@ -70,8 +72,8 @@
public byte[] epsToPDFXObject(final EPSGraphic eps)
throws GraphicException {
final int[] bbox = eps.getBBox();
- final int bboxw = bbox[2] - bbox[0];
- final int bboxh = bbox[3] - bbox[1];
+ final int bboxw = FOrayBoundingBox.width(bbox);
+ final int bboxh = FOrayBoundingBox.height(bbox);
final StringBuffer preamble = new StringBuffer();
preamble.append("%%BeginDocument: " + eps.getName()
Modified: trunk/foray/foray-ps/src/java/org/foray/ps/FOrayBoundingBox.java
===================================================================
--- trunk/foray/foray-ps/src/java/org/foray/ps/FOrayBoundingBox.java 2006-10-10 02:57:54 UTC (rev 8357)
+++ trunk/foray/foray-ps/src/java/org/foray/ps/FOrayBoundingBox.java 2006-10-10 03:14:57 UTC (rev 8358)
@@ -33,6 +33,33 @@
/**
* A PostScript bounding box.
*/
-public class FOrayBoundingBox implements BoundingBox {
+public final class FOrayBoundingBox implements BoundingBox {
+ /** Private constructor. This class is currently strictly a utility class
+ * and should not be instantiated. */
+ private FOrayBoundingBox() { }
+
+ /**
+ * Computes the width of an int bounding box.
+ * @param boundingBoxArray An array describing a regular PostScript bounding
+ * box.
+ * @return The width of the bounding box.
+ */
+ public static int width(final int[] boundingBoxArray) {
+ return boundingBoxArray[BBOX_UPPER_RIGHT_X_INDEX]
+ - boundingBoxArray[BBOX_LOWER_LEFT_X_INDEX];
+
+ }
+
+ /**
+ * Computes the height of an int bounding box.
+ * @param boundingBoxArray An array describing a regular PostScript bounding
+ * box.
+ * @return The height of the bounding box.
+ */
+ public static int height(final int[] boundingBoxArray) {
+ return boundingBoxArray[BBOX_UPPER_RIGHT_Y_INDEX]
+ - boundingBoxArray[BBOX_LOWER_LEFT_Y_INDEX];
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-10 03:31:27
|
Revision: 8359
http://svn.sourceforge.net/foray/?rev=8359&view=rev
Author: victormote
Date: 2006-10-09 20:31:19 -0700 (Mon, 09 Oct 2006)
Log Message:
-----------
Remove some magic numbers.
Modified Paths:
--------------
trunk/foray/foray-common/src/java/org/foray/common/WKConstants.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java
Modified: trunk/foray/foray-common/src/java/org/foray/common/WKConstants.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/WKConstants.java 2006-10-10 03:14:57 UTC (rev 8358)
+++ trunk/foray/foray-common/src/java/org/foray/common/WKConstants.java 2006-10-10 03:31:19 UTC (rev 8359)
@@ -54,6 +54,10 @@
* 256. */
public static final short MAX_8_BIT_UNSIGNED_VALUES = 256;
+ /** The maximum number of values that can be stored in 7 bits, that is,
+ * 128. */
+ public static final short MAX_7_BIT_UNSIGNED_VALUES = 128;
+
/** The maximum number of values that can be stored in 16 bits, that is,
* 65,536. */
public static final int MAX_16_BIT_UNSIGNED_VALUES = 65536;
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2006-10-10 03:14:57 UTC (rev 8358)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2006-10-10 03:31:19 UTC (rev 8359)
@@ -29,6 +29,7 @@
package org.foray.pdf.object;
import org.foray.common.StringUtilPre5;
+import org.foray.common.WKConstants;
import org.axsl.fontR.Font;
import org.axsl.fontR.FontUse;
@@ -43,6 +44,7 @@
*/
public class PDFString extends PDFObject {
+ private static final int UNICODE_STRING_SIZE = 4;
/** The encapsulated String. */
private String theString;
/** The Font that should be used to render this String */
@@ -90,7 +92,7 @@
return;
}
/* Font is a simple font. */
- if (glyphIndex > 127) {
+ if (glyphIndex > WKConstants.MAX_7_BIT_UNSIGNED_VALUES - 1) {
buffer.append("\\");
buffer.append(Integer.toOctalString(glyphIndex));
return;
@@ -157,7 +159,7 @@
* @return the string representation of the character
*/
public static String getUnicodeString(final int c) {
- StringBuffer buf = new StringBuffer(4);
+ StringBuffer buf = new StringBuffer(UNICODE_STRING_SIZE);
byte[] uniBytes = null;
int codePoint = c;
/* TODO: Handle Unicode characters > 0xFFFF better. */
@@ -173,8 +175,10 @@
}
for (int i = 0; i < uniBytes.length; i++) {
- final int b = (uniBytes[i] < 0) ? (int) (256 + uniBytes[i])
- : (int) uniBytes[i];
+ int b = uniBytes[i];
+ if (uniBytes[i] < 0) {
+ b += WKConstants.MAX_8_BIT_UNSIGNED_VALUES;
+ }
final String hexString = Integer.toHexString(b);
if (hexString.length() == 1) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-21 01:24:32
|
Revision: 8396
http://svn.sourceforge.net/foray/?rev=8396&view=rev
Author: victormote
Date: 2006-10-20 18:24:21 -0700 (Fri, 20 Oct 2006)
Log Message:
-----------
Add checkstyle DTDs to repository.
Added Paths:
-----------
trunk/foray/lib-build/
trunk/foray/lib-build/checkstyle/
trunk/foray/lib-build/checkstyle/configuration_1_1.dtd
trunk/foray/lib-build/checkstyle/suppressions_1_0.dtd
Added: trunk/foray/lib-build/checkstyle/configuration_1_1.dtd
===================================================================
--- trunk/foray/lib-build/checkstyle/configuration_1_1.dtd (rev 0)
+++ trunk/foray/lib-build/checkstyle/configuration_1_1.dtd 2006-10-21 01:24:21 UTC (rev 8396)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Add the following to any file that is to be validated against this DTD:
+
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+-->
+
+<!ELEMENT module (module|property|metadata)*>
+<!ATTLIST module name NMTOKEN #REQUIRED>
+
+<!ELEMENT property EMPTY>
+<!ATTLIST property
+ name NMTOKEN #REQUIRED
+ value CDATA #REQUIRED
+>
+
+<!--
+
+ Used to store metadata in the Checkstyle configuration file. This
+ information is ignored by Checkstyle. This may be useful if you want to
+ store plug-in specific information.
+
+ To avoid name clashes between different tools/plug-ins you are *strongly*
+ encouraged to prefix all names with your domain name. For example, use the
+ name "com.mycompany.parameter" instead of "parameter".
+
+ The prefix "com.puppycrawl." is reserved for Checkstyle.
+
+-->
+
+<!ELEMENT metadata EMPTY>
+<!ATTLIST metadata
+ name NMTOKEN #REQUIRED
+ value CDATA #REQUIRED
+>
Property changes on: trunk/foray/lib-build/checkstyle/configuration_1_1.dtd
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Added: trunk/foray/lib-build/checkstyle/suppressions_1_0.dtd
===================================================================
--- trunk/foray/lib-build/checkstyle/suppressions_1_0.dtd (rev 0)
+++ trunk/foray/lib-build/checkstyle/suppressions_1_0.dtd 2006-10-21 01:24:21 UTC (rev 8396)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Add the following to any file that is to be validated against this DTD:
+
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.0//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+-->
+
+<!ELEMENT suppressions (suppress*)>
+
+<!ELEMENT suppress EMPTY>
+<!ATTLIST suppress files CDATA #REQUIRED
+ checks CDATA #REQUIRED
+ lines CDATA #IMPLIED
+ columns CDATA #IMPLIED>
Property changes on: trunk/foray/lib-build/checkstyle/suppressions_1_0.dtd
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-21 15:17:19
|
Revision: 8400
http://svn.sourceforge.net/foray/?rev=8400&view=rev
Author: victormote
Date: 2006-10-21 08:16:47 -0700 (Sat, 21 Oct 2006)
Log Message:
-----------
Add some basic testing classes and the infrastructure to use them.
Modified Paths:
--------------
trunk/foray/foray-app/.classpath
trunk/foray/foray-fotree/.classpath
trunk/foray/scripts/checkstyle-suppressions.xml
Added Paths:
-----------
trunk/foray/foray-app/src/javatest/
trunk/foray/foray-app/src/javatest/org/
trunk/foray/foray-app/src/javatest/org/foray/
trunk/foray/foray-app/src/javatest/org/foray/app/
trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java
trunk/foray/foray-fotree/src/javatest/
trunk/foray/foray-fotree/src/javatest/org/
trunk/foray/foray-fotree/src/javatest/org/foray/
trunk/foray/foray-fotree/src/javatest/org/foray/fotree/
trunk/foray/foray-fotree/src/javatest/org/foray/fotree/TestFOrayFOTree.java
trunk/foray/foray-fotree/src/javatest/org/foray/fotree/value/
trunk/foray/foray-fotree/src/javatest/org/foray/fotree/value/TestDtLength.java
Modified: trunk/foray/foray-app/.classpath
===================================================================
--- trunk/foray/foray-app/.classpath 2006-10-21 15:06:05 UTC (rev 8399)
+++ trunk/foray/foray-app/.classpath 2006-10-21 15:16:47 UTC (rev 8400)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding=".#*" kind="src" path="src/java"/>
+ <classpathentry kind="src" path="src/javatest"/>
<classpathentry kind="src" path="scripts"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/FOrayCommon"/>
@@ -37,5 +38,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/axslHyphen-R"/>
<classpathentry combineaccessrules="false" kind="src" path="/FOrayHyphen-R"/>
<classpathentry kind="var" path="FORAY_LIB_ROOT/foray-hyphen-r-0.3-rsrc.jar"/>
+ <classpathentry kind="lib" path="/FOrayLibsBuild/junit/junit.jar"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Added: trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java
===================================================================
--- trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java (rev 0)
+++ trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java 2006-10-21 15:16:47 UTC (rev 8400)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006 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.app;
+
+import org.foray.fotree.TestFOrayFOTree;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Master Test harness for all FOray modules.
+ */
+public class TestFOrayAll extends TestCase {
+
+ /**
+ * Builds a test suite for modules in FOray.
+ * @return The built test suite.
+ */
+ public static Test suite() {
+ final TestSuite testSuite = new TestSuite();
+ testSuite.addTestSuite(TestFOrayFOTree.class);
+ return testSuite;
+ }
+
+}
Property changes on: trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Modified: trunk/foray/foray-fotree/.classpath
===================================================================
--- trunk/foray/foray-fotree/.classpath 2006-10-21 15:06:05 UTC (rev 8399)
+++ trunk/foray/foray-fotree/.classpath 2006-10-21 15:16:47 UTC (rev 8400)
@@ -3,6 +3,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/FOrayCommon"/>
<classpathentry excluding=".#*" kind="src" path="src/java"/>
+ <classpathentry kind="src" path="src/javatest"/>
<classpathentry kind="src" path="scripts"/>
<classpathentry kind="src" path="/axslFont-R"/>
<classpathentry kind="src" path="/axslGraphic-R"/>
@@ -11,5 +12,6 @@
<classpathentry kind="src" path="/axslText"/>
<classpathentry kind="var" path="FORAY_LIB_ROOT/batik.jar"/>
<classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/>
+ <classpathentry kind="lib" path="/FOrayLibsBuild/junit/junit.jar"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Added: trunk/foray/foray-fotree/src/javatest/org/foray/fotree/TestFOrayFOTree.java
===================================================================
--- trunk/foray/foray-fotree/src/javatest/org/foray/fotree/TestFOrayFOTree.java (rev 0)
+++ trunk/foray/foray-fotree/src/javatest/org/foray/fotree/TestFOrayFOTree.java 2006-10-21 15:16:47 UTC (rev 8400)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006 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;
+
+import org.foray.fotree.value.TestDtLength;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Handles testing for the FOrayFOTree module.
+ */
+public class TestFOrayFOTree extends TestCase {
+
+ /**
+ * Builds a test suite for all classes in this module.
+ * @return The built test suite.
+ */
+ public static Test suite() {
+ final TestSuite testSuite = new TestSuite();
+ testSuite.addTestSuite(TestDtLength.class);
+ return testSuite;
+ }
+
+}
Property changes on: trunk/foray/foray-fotree/src/javatest/org/foray/fotree/TestFOrayFOTree.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Added: trunk/foray/foray-fotree/src/javatest/org/foray/fotree/value/TestDtLength.java
===================================================================
--- trunk/foray/foray-fotree/src/javatest/org/foray/fotree/value/TestDtLength.java (rev 0)
+++ trunk/foray/foray-fotree/src/javatest/org/foray/fotree/value/TestDtLength.java 2006-10-21 15:16:47 UTC (rev 8400)
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2006 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 junit.framework.TestCase;
+
+/**
+ * JUnit test class for the class {@link DtLength}.
+ */
+public class TestDtLength extends TestCase {
+
+/**
+ * Unit test for a centimeter length.
+ */
+public void testCentimeters() {
+}
+
+}
Property changes on: trunk/foray/foray-fotree/src/javatest/org/foray/fotree/value/TestDtLength.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-21 15:06:05 UTC (rev 8399)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-21 15:16:47 UTC (rev 8400)
@@ -47,4 +47,8 @@
<suppress checks="MagicNumber"
files="org.foray.ps.PSReal.java"/>
+ <!-- Suppress Javadoc package documentation for test directories. -->
+ <suppress checks="PackageHtml"
+ files="src.javatest.*"/>
+
</suppressions>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2006-10-24 01:37:35
|
Revision: 8427
http://svn.sourceforge.net/foray/?rev=8427&view=rev
Author: victormote
Date: 2006-10-23 18:37:22 -0700 (Mon, 23 Oct 2006)
Log Message:
-----------
Clean up some style complaints.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LeaderLength.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2006-10-23 14:16:47 UTC (rev 8426)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2006-10-24 01:37:22 UTC (rev 8427)
@@ -134,7 +134,7 @@
* Just return the main-reference-area. The span can't be created
* until we return back down to the first block-level area.
*/
- return (MainRA) getParentArea().getOverflowArea(this);
+ return getParentArea().getOverflowArea(this);
}
public int traitColumnCount() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LeaderLength.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LeaderLength.java 2006-10-23 14:16:47 UTC (rev 8426)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LeaderLength.java 2006-10-24 01:37:22 UTC (rev 8427)
@@ -85,7 +85,7 @@
return new DtLengthRange(length, length, length);
}
if (pv instanceof DtPercentage) {
- return (DtPercentage) pv;
+ return pv;
}
throw unexpectedValue(value, propertyList);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|