foray-commit Mailing List for FOray (Page 289)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(4) |
Dec
(23) |
| 2026 |
Jan
(119) |
Feb
(335) |
Mar
(103) |
Apr
(43) |
May
(154) |
Jun
(107) |
Jul
(187) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <vic...@us...> - 2006-06-24 20:50:17
|
Revision: 7740 Author: victormote Date: 2006-06-24 13:50:06 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7740&view=rev Log Message: ----------- 1. Move hyphenation dtd to aXSL. 2. Add more formal DTD declaration to the pattern files, allowing the DTD to come from the web or a catalog. Modified Paths: -------------- trunk/foray/foray-hyphen-r/resource/hyph-patterns/en.xml trunk/foray/foray-hyphen-r/resource/hyph-patterns/es.xml trunk/foray/foray-hyphen-r/resource/hyph-patterns/fi.xml trunk/foray/foray-hyphen-r/resource/hyph-patterns/hu.xml trunk/foray/foray-hyphen-r/resource/hyph-patterns/it.xml trunk/foray/foray-hyphen-r/resource/hyph-patterns/pl.xml trunk/foray/foray-hyphen-r/resource/hyph-patterns/pt.xml trunk/foray/foray-hyphen-r/resource/hyph-patterns/ru.xml Removed Paths: ------------- trunk/foray/foray-hyphen-r/resource/hyph-patterns/hyphenation.dtd Modified: trunk/foray/foray-hyphen-r/resource/hyph-patterns/en.xml =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/en.xml 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/en.xml 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,5 +1,8 @@ <?xml version="1.0" encoding="US-ASCII"?> -<!DOCTYPE hyphenation-info SYSTEM "hyphenation.dtd"> +<!DOCTYPE hyphenation-info + PUBLIC "-//aXSL//DTD Hyphenation V0.1//EN" + "http://www.axsl.org/dtds/0.1/en/axsl-hyphenation.dtd"> + <!-- % % Created by Jeff Kingston, 16 November 1996, from a TeX Modified: trunk/foray/foray-hyphen-r/resource/hyph-patterns/es.xml =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/es.xml 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/es.xml 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE hyphenation-info SYSTEM "hyphenation.dtd"> +<!DOCTYPE hyphenation-info + PUBLIC "-//aXSL//DTD Hyphenation V0.1//EN" + "http://www.axsl.org/dtds/0.1/en/axsl-hyphenation.dtd"> <!-- Adapted by Carlos Villegas from Lout's spanish.lh. Spanish is probably the easiest language to hyphenate! Modified: trunk/foray/foray-hyphen-r/resource/hyph-patterns/fi.xml =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/fi.xml 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/fi.xml 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,5 +1,8 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE hyphenation-info SYSTEM "hyphenation.dtd"> +<!DOCTYPE hyphenation-info + PUBLIC "-//aXSL//DTD Hyphenation V0.1//EN" + "http://www.axsl.org/dtds/0.1/en/axsl-hyphenation.dtd"> + <!-- Constructed by Jarno Elovirta from fi8hyph.tex file: % fi8hyph.tex, based on fihyph.tex Modified: trunk/foray/foray-hyphen-r/resource/hyph-patterns/hu.xml =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/hu.xml 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/hu.xml 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,5 +1,8 @@ <?xml version="1.0" encoding="iso-8859-2"?> -<!DOCTYPE hyphenation-info SYSTEM "hyphenation.dtd"> +<!DOCTYPE hyphenation-info + PUBLIC "-//aXSL//DTD Hyphenation V0.1//EN" + "http://www.axsl.org/dtds/0.1/en/axsl-hyphenation.dtd"> + <!-- created from huhyp.tex by sn...@ma... and converted to Latin-2 --> <hyphenation-info> Deleted: trunk/foray/foray-hyphen-r/resource/hyph-patterns/hyphenation.dtd =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/hyphenation.dtd 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/hyphenation.dtd 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="US-ASCII"?> - -<!ELEMENT hyphenation-info (hyphen-char?, hyphen-min?, - classes, exceptions?, patterns)> - -<!-- Hyphen character to be used in the exception list as shortcut for - <hyphen pre-break="-"/>. Defaults to '-' ---> -<!ELEMENT hyphen-char EMPTY> -<!ATTLIST hyphen-char value CDATA #REQUIRED> - -<!-- Default minimun length in characters of hyphenated word fragments - before and after the line break. For some languages this is not - only for aesthetic purposes, wrong hyphens may be generated if this - is not accounted for. ---> -<!ELEMENT hyphen-min EMPTY> -<!ATTLIST hyphen-min before CDATA #REQUIRED> -<!ATTLIST hyphen-min after CDATA #REQUIRED> - -<!-- Character equivalent classes: space separated list of character groups, all - characters in a group are to be treated equivalent as far as - the hyphenation algorithm is concerned. The first character in a group - is the group's equivalent character. Patterns should only contain - first characters. It also defines word characters, i.e. a word that - contains characters not present in any of the classes is not hyphenated. ---> -<!ELEMENT classes (#PCDATA)> - -<!-- Hyphenation exceptions: space separated list of hyphenated words. - A hyphen is indicated by the hyphen tag, but you can use the - hyphen-char defined previously as shortcut. This is in cases - when the algorithm procedure finds wrong hyphens or you want - to provide your own hyphenation for some words. ---> -<!ELEMENT exceptions (#PCDATA|hyphen)* > - -<!-- The hyphenation patterns, space separated. A pattern is made of 'equivalent' - characters as described before, between any two word characters a digit - in the range 0 to 9 may be specified. The absence of a digit is equivalent - to zero. The '.' character is reserved to indicate begining or ending - of words. --> -<!ELEMENT patterns (#PCDATA)> - -<!-- A "full hyphen" equivalent to TeX's \discretionary - with pre-break, post-break and no-break attributes. - To be used in the exceptions list, the hyphen character is not - automatically added --> -<!ELEMENT hyphen EMPTY> -<!ATTLIST hyphen pre CDATA #IMPLIED> -<!ATTLIST hyphen no CDATA #IMPLIED> -<!ATTLIST hyphen post CDATA #IMPLIED> Modified: trunk/foray/foray-hyphen-r/resource/hyph-patterns/it.xml =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/it.xml 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/it.xml 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE hyphenation-info SYSTEM "hyphenation.dtd"> +<!DOCTYPE hyphenation-info + PUBLIC "-//aXSL//DTD Hyphenation V0.1//EN" + "http://www.axsl.org/dtds/0.1/en/axsl-hyphenation.dtd"> <!-- Created by St\xE9phane Bline - Peregrine Systems - sb...@ap... Conversion of the original TEX italian hyphenation patterns written by Modified: trunk/foray/foray-hyphen-r/resource/hyph-patterns/pl.xml =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/pl.xml 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/pl.xml 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE hyphenation-info SYSTEM "hyphenation.dtd"> +<!DOCTYPE hyphenation-info + PUBLIC "-//aXSL//DTD Hyphenation V0.1//EN" + "http://www.axsl.org/dtds/0.1/en/axsl-hyphenation.dtd"> <!-- Hyphenation patterns for Polish. Modified: trunk/foray/foray-hyphen-r/resource/hyph-patterns/pt.xml =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/pt.xml 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/pt.xml 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,26 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE hyphenation-info SYSTEM "hyphenation.dtd"> -<!-- - * 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 - * +<!DOCTYPE hyphenation-info + PUBLIC "-//aXSL//DTD Hyphenation V0.1//EN" + "http://www.axsl.org/dtds/0.1/en/axsl-hyphenation.dtd"> +<!-- This file was originally created by Marcelo Jaccoud Amaral <ja...@pe...>. Modified: trunk/foray/foray-hyphen-r/resource/hyph-patterns/ru.xml =================================================================== --- trunk/foray/foray-hyphen-r/resource/hyph-patterns/ru.xml 2006-06-24 16:29:22 UTC (rev 7739) +++ trunk/foray/foray-hyphen-r/resource/hyph-patterns/ru.xml 2006-06-24 20:50:06 UTC (rev 7740) @@ -1,25 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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 - * ---> <!-- Origin of this file: @@ -61,7 +40,11 @@ - Conversion of BRHYPHEN.TEX to ru.xml and legal clarifications by Jeremias Maerki <jer...@ap...> --> -<!DOCTYPE hyphenation-info SYSTEM "hyphenation.dtd"> + +<!DOCTYPE hyphenation-info + PUBLIC "-//aXSL//DTD Hyphenation V0.1//EN" + "http://www.axsl.org/dtds/0.1/en/axsl-hyphenation.dtd"> + <hyphenation-info> <classes> аА This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-24 16:29:25
|
Revision: 7739 Author: victormote Date: 2006-06-24 09:29:22 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7739&view=rev Log Message: ----------- Simplify logic a bit. Modified Paths: -------------- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java Modified: trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 16:25:17 UTC (rev 7738) +++ trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 16:29:22 UTC (rev 7739) @@ -65,13 +65,9 @@ } public URLStreamHandler createURLStreamHandler(String protocol) { - Object object = this.protocols.get(protocol); - if (object == null) { - /* If we don't know how to instantiate it, return null. Java will - * then look through the more normal places instead. */ - return null; - } - return (URLStreamHandler) object; + /* If we don't know about it, null will be returned, and Java will + * then look through the more normal places instead. */ + return (URLStreamHandler) this.protocols.get(protocol); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-24 16:25:20
|
Revision: 7738 Author: victormote Date: 2006-06-24 09:25:17 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7738&view=rev Log Message: ----------- Revert to throwing an exception, but make it an unchecked exception, as per Vincent Hennebert's suggestion. Modified Paths: -------------- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java Modified: trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 16:11:37 UTC (rev 7737) +++ trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 16:25:17 UTC (rev 7738) @@ -87,10 +87,12 @@ public void registerProtocol(String protocol, URLStreamHandler handler) throws IOException { if (protocol == null) { - return; + throw new IllegalArgumentException("Cannot register a null " + + "protocol."); } if (handler == null) { - return; + throw new IllegalArgumentException("Cannot register a null " + + "URLStreamHandler."); } if (this.protocols.containsKey(protocol)) { throw new IOException("Protocol \n" + protocol This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-24 16:11:40
|
Revision: 7737 Author: victormote Date: 2006-06-24 09:11:37 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7737&view=rev Log Message: ----------- Return null instead of throwing a checked exception for invalid input. Modified Paths: -------------- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java Modified: trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 15:56:43 UTC (rev 7736) +++ trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 16:11:37 UTC (rev 7737) @@ -77,24 +77,20 @@ /** * Registers a new {@link URLStreamHandler} for use with a protocol. * @param protocol The protocol to be registered. + * The registration will fail silently if this parameter is null. * @param handler The {@link URLStreamHandler} instance which should be * used for URLs whose protocol is <code>protocol</code>. - * @throws IOException For any of the following reasons: - * <ul> - * <li>If <code>protocol</code> or <code>handlerClass</code> are - * null.</li> - * <li>If <code>protocol</code> has already been registered</li> - * </ul> + * The registration will fail silently if this parameter is null. + * @throws IOException If <code>protocol</code> has already been + * registered. */ public void registerProtocol(String protocol, URLStreamHandler handler) throws IOException { if (protocol == null) { - throw new IOException("Cannot register a null " - + "protocol."); + return; } if (handler == null) { - throw new IOException("Cannot register a null " - + "URLStreamHandler."); + return; } if (this.protocols.containsKey(protocol)) { throw new IOException("Protocol \n" + protocol This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-24 15:56:48
|
Revision: 7736 Author: victormote Date: 2006-06-24 08:56:43 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7736&view=rev Log Message: ----------- Extract method for registration with the Java environment to make it easier to reuse and reference. Modified Paths: -------------- trunk/foray/foray-common/src/java/org/foray/common/url/AbstractURLStreamHandler.java Modified: trunk/foray/foray-common/src/java/org/foray/common/url/AbstractURLStreamHandler.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/url/AbstractURLStreamHandler.java 2006-06-24 15:55:16 UTC (rev 7735) +++ trunk/foray/foray-common/src/java/org/foray/common/url/AbstractURLStreamHandler.java 2006-06-24 15:56:43 UTC (rev 7736) @@ -42,7 +42,10 @@ /** * Register an instance of this class with the custom * URLStreamHandlerFactory so that this handler will be used for URLs of - * protocol "classpath". + * a specific type. + * @param protocol The name of the protocol to register. + * @param handler The handler that should be registered to handle URLs of + * type <code>protocol</code>. */ protected static void register(String protocol, URLStreamHandler handler) { /* Validate the input. */ @@ -57,6 +60,15 @@ FOrayURLStreamHandlerFactory factory = FOrayURLStreamHandlerFactory.getURLStreamHandlerFactory(); + if (factory == null) { + /* If factory is null, it is because something got registered in + * URL.setURLStreamHandlerFactory(URLStreamHandlerFactory) + * before our FOrayURLStreamHandlerFactory could register. + * Therefore, the best we can do is register ours with the Java + * environment "java.protocol.handler.pkgs". */ + registerInEnvironment(protocol, handler); + } + /* See if this protocol is already registered with the factory. */ URLStreamHandler registeredHandler = factory.createURLStreamHandler( protocol); @@ -77,7 +89,17 @@ * about it either. */ return; } + } + /** + * Registers a specific protocol handler by making it available to the + * Java property "java.protocol.handler.pkgs". + * @param protocol The name of the protocol to register. + * @param handler An instance of the class that should be registered to + * handle URLs of type <code>protocol</code>. + */ + private static void registerInEnvironment(String protocol, + URLStreamHandler handler) { /* The FOray Factory will not be able to register itself with Java in a * case where other software running has already registered another * URLStreamHandlerFactory first. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-24 15:55:19
|
Revision: 7735 Author: victormote Date: 2006-06-24 08:55:16 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7735&view=rev Log Message: ----------- Catch the Error thrown if a factory has already been registered with URL. Modified Paths: -------------- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java Modified: trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 15:07:24 UTC (rev 7734) +++ trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 15:55:16 UTC (rev 7735) @@ -45,6 +45,8 @@ /** The singleton instance of this class. */ private static FOrayURLStreamHandlerFactory urlSHFactory; + private static boolean registrationAttempted = false; + /** * Map of the protocols. * The key is a String containing the protocol name. @@ -108,13 +110,36 @@ */ public static synchronized FOrayURLStreamHandlerFactory getURLStreamHandlerFactory() { - if (FOrayURLStreamHandlerFactory.urlSHFactory == null) { - FOrayURLStreamHandlerFactory.urlSHFactory - = new FOrayURLStreamHandlerFactory(); + createFactory(); + return FOrayURLStreamHandlerFactory.urlSHFactory; + } + + /** + * Creates the Singleton instance of this class if it has not already + * been created, and if it can be created. + */ + private static void createFactory() { + if (FOrayURLStreamHandlerFactory.urlSHFactory != null) { + /* Factory is already created. */ + return; + } + if (FOrayURLStreamHandlerFactory.registrationAttempted) { + /* Registration has already tried and failed. Don't try again. */ + return; + } + FOrayURLStreamHandlerFactory.urlSHFactory + = new FOrayURLStreamHandlerFactory(); + try { URL.setURLStreamHandlerFactory( FOrayURLStreamHandlerFactory.urlSHFactory); + } catch (Error e) { + /* If an error is thrown, someone has already registered a + * URLStreamHandlerFactory, and we cannot register ours. All we + * can do is record the fact. */ + FOrayURLStreamHandlerFactory.urlSHFactory = null; + } finally { + FOrayURLStreamHandlerFactory.registrationAttempted = true; } - return FOrayURLStreamHandlerFactory.urlSHFactory; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-24 15:07:35
|
Revision: 7734 Author: victormote Date: 2006-06-24 08:07:24 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7734&view=rev Log Message: ----------- Move URL protocol-related classes to the common.url package. Suggested by Vincent Hennebert. Modified Paths: -------------- trunk/foray/foray-common/src/java/org/foray/common/url/classpath/Handler.java Added Paths: ----------- trunk/foray/foray-common/src/java/org/foray/common/url/AbstractURLStreamHandler.java trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java Removed Paths: ------------- trunk/foray/foray-common/src/java/org/foray/common/AbstractURLStreamHandler.java trunk/foray/foray-common/src/java/org/foray/common/FOrayURLStreamHandlerFactory.java Deleted: trunk/foray/foray-common/src/java/org/foray/common/AbstractURLStreamHandler.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/AbstractURLStreamHandler.java 2006-06-20 04:41:42 UTC (rev 7733) +++ trunk/foray/foray-common/src/java/org/foray/common/AbstractURLStreamHandler.java 2006-06-24 15:07:24 UTC (rev 7734) @@ -1,138 +0,0 @@ -/* - * 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 - * - */ - -/* $Id$ */ - -/* Known contributors: - * Vincent Hennebert (original author) - */ - -package org.foray.common; - -import java.io.IOException; -import java.net.URLStreamHandler; -import java.util.StringTokenizer; - -/** - * Abstract superclass for all URLStreamHandlers using the FOray scheme for - * custom URLStreamHandler registration. - */ -public abstract class AbstractURLStreamHandler extends URLStreamHandler { - - /** - * Register an instance of this class with the custom - * URLStreamHandlerFactory so that this handler will be used for URLs of - * protocol "classpath". - */ - protected static void register(String protocol, URLStreamHandler handler) { - /* Validate the input. */ - if (protocol == null) { - return; - } - if (handler == null) { - return; - } - - /* Get the Factory instance. */ - FOrayURLStreamHandlerFactory factory = - FOrayURLStreamHandlerFactory.getURLStreamHandlerFactory(); - - /* See if this protocol is already registered with the factory. */ - URLStreamHandler registeredHandler = factory.createURLStreamHandler( - protocol); - if (registeredHandler != null) { - /* If already registed, that one is the one being used, and there - * is no way to change it. */ - return; - } - - /* Register the protocol with the Factory. */ - try { - factory.registerProtocol(protocol, handler); - } catch (IOException e) { - /* This should never happen. We have already checked whether the - * protocol is previously registered, and we know that neither the - * protocol or handler are null. The only thing we could do is - * pass the exception upstream, but there is nothing they can do - * about it either. */ - return; - } - - /* The FOray Factory will not be able to register itself with Java in a - * case where other software running has already registered another - * URLStreamHandlerFactory first. - * Therefore, we will give Java another opportunity to find our custom - * handler by placing its location in the Java environment. - */ - - /* Parse the path. */ - Class theClass = handler.getClass(); - String classPath = theClass.getName(); - int lastTokenDelimiter = classPath.lastIndexOf('.'); - String className = classPath.substring(lastTokenDelimiter + 1, - classPath.length()); - - /* Validate the class name. */ - if (! className.equals("Handler")) { - return; - } - - Package thePackage = theClass.getPackage(); - String packageName = thePackage.getName(); - lastTokenDelimiter = packageName.lastIndexOf('.'); - String lastSubPackage = packageName.substring(lastTokenDelimiter + 1, - packageName.length()); - /* The last sub-package must be equal to the name of the protocol, or - * Java won't find it. */ - if (! lastSubPackage.equals(protocol)) { - return; - } - - /* Add the packagePrefix to the Java search path. */ - String packagePrefix = packageName.substring(0, lastTokenDelimiter); - String javaProperty = "java.protocol.handler.pkgs"; - String searchPath = System.getProperty(javaProperty); - - /* The search path doesn't exist. Create it. */ - if (searchPath == null) { - System.setProperty(javaProperty, packagePrefix); - return; - } - - /* The search path does exist. See if the package prefix is already - * registered. */ - StringTokenizer packagePrefixIter = new StringTokenizer( - searchPath, "|"); - while (packagePrefixIter.hasMoreTokens()) { - String token = packagePrefixIter.nextToken(); - if (token.equals(packagePrefix)) { - /* It is already registered. No need to do it again. */ - return; - } - } - - /* It is not registered, so we need to add it. */ - searchPath += "|" + packagePrefix; - System.setProperty(javaProperty, searchPath); - } - -} Deleted: trunk/foray/foray-common/src/java/org/foray/common/FOrayURLStreamHandlerFactory.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/FOrayURLStreamHandlerFactory.java 2006-06-20 04:41:42 UTC (rev 7733) +++ trunk/foray/foray-common/src/java/org/foray/common/FOrayURLStreamHandlerFactory.java 2006-06-24 15:07:24 UTC (rev 7734) @@ -1,120 +0,0 @@ -/* - * 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 - * - */ - -/* -$Id$ - */ - -/* Known contributors: - * Vincent Hennebert (original author) - */ - -package org.foray.common; - -import java.io.IOException; -import java.net.URL; -import java.net.URLStreamHandler; -import java.net.URLStreamHandlerFactory; -import java.util.HashMap; - -/** - * URLStreamHandlerFactory implementation that allows custom protocols to be - * registered and accessed. - */ -public class FOrayURLStreamHandlerFactory implements URLStreamHandlerFactory { - - /** The singleton instance of this class. */ - private static FOrayURLStreamHandlerFactory urlSHFactory; - - /** - * Map of the protocols. - * The key is a String containing the protocol name. - * The value is the {@link URLStreamHandler} which should be used for that - * protocol. - */ - private HashMap protocols = new HashMap(); - - /** - * Private constructor. - * This is a singleton, and there should only be one instance per session. - * To get that instance, use - * {@link FOrayURLStreamHandlerFactory#getURLStreamHandlerFactory()}. - */ - private FOrayURLStreamHandlerFactory() { - } - - public URLStreamHandler createURLStreamHandler(String protocol) { - Object object = this.protocols.get(protocol); - if (object == null) { - /* If we don't know how to instantiate it, return null. Java will - * then look through the more normal places instead. */ - return null; - } - return (URLStreamHandler) object; - } - - /** - * Registers a new {@link URLStreamHandler} for use with a protocol. - * @param protocol The protocol to be registered. - * @param handler The {@link URLStreamHandler} instance which should be - * used for URLs whose protocol is <code>protocol</code>. - * @throws IOException For any of the following reasons: - * <ul> - * <li>If <code>protocol</code> or <code>handlerClass</code> are - * null.</li> - * <li>If <code>protocol</code> has already been registered</li> - * </ul> - */ - public void registerProtocol(String protocol, URLStreamHandler handler) - throws IOException { - if (protocol == null) { - throw new IOException("Cannot register a null " - + "protocol."); - } - if (handler == null) { - throw new IOException("Cannot register a null " - + "URLStreamHandler."); - } - if (this.protocols.containsKey(protocol)) { - throw new IOException("Protocol \n" + protocol - + "\" has already been registered."); - } - this.protocols.put(protocol, handler); - } - - /** - * Provides access to a custom URLStreamHandlerFactory instance, creating - * it and registering it with Java if needed. - * @return The custom URLStreamHandlerFactory instance for this session. - */ - public static synchronized FOrayURLStreamHandlerFactory - getURLStreamHandlerFactory() { - if (FOrayURLStreamHandlerFactory.urlSHFactory == null) { - FOrayURLStreamHandlerFactory.urlSHFactory - = new FOrayURLStreamHandlerFactory(); - URL.setURLStreamHandlerFactory( - FOrayURLStreamHandlerFactory.urlSHFactory); - } - return FOrayURLStreamHandlerFactory.urlSHFactory; - } - -} Copied: trunk/foray/foray-common/src/java/org/foray/common/url/AbstractURLStreamHandler.java (from rev 7706, trunk/foray/foray-common/src/java/org/foray/common/AbstractURLStreamHandler.java) =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/url/AbstractURLStreamHandler.java (rev 0) +++ trunk/foray/foray-common/src/java/org/foray/common/url/AbstractURLStreamHandler.java 2006-06-24 15:07:24 UTC (rev 7734) @@ -0,0 +1,139 @@ +/* + * 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 + * + */ + +/* $Id$ */ + +/* Known contributors: + * Vincent Hennebert (original author) + */ + +package org.foray.common.url; + + +import java.io.IOException; +import java.net.URLStreamHandler; +import java.util.StringTokenizer; + +/** + * Abstract superclass for all URLStreamHandlers using the FOray scheme for + * custom URLStreamHandler registration. + */ +public abstract class AbstractURLStreamHandler extends URLStreamHandler { + + /** + * Register an instance of this class with the custom + * URLStreamHandlerFactory so that this handler will be used for URLs of + * protocol "classpath". + */ + protected static void register(String protocol, URLStreamHandler handler) { + /* Validate the input. */ + if (protocol == null) { + return; + } + if (handler == null) { + return; + } + + /* Get the Factory instance. */ + FOrayURLStreamHandlerFactory factory = + FOrayURLStreamHandlerFactory.getURLStreamHandlerFactory(); + + /* See if this protocol is already registered with the factory. */ + URLStreamHandler registeredHandler = factory.createURLStreamHandler( + protocol); + if (registeredHandler != null) { + /* If already registed, that one is the one being used, and there + * is no way to change it. */ + return; + } + + /* Register the protocol with the Factory. */ + try { + factory.registerProtocol(protocol, handler); + } catch (IOException e) { + /* This should never happen. We have already checked whether the + * protocol is previously registered, and we know that neither the + * protocol or handler are null. The only thing we could do is + * pass the exception upstream, but there is nothing they can do + * about it either. */ + return; + } + + /* The FOray Factory will not be able to register itself with Java in a + * case where other software running has already registered another + * URLStreamHandlerFactory first. + * Therefore, we will give Java another opportunity to find our custom + * handler by placing its location in the Java environment. + */ + + /* Parse the path. */ + Class theClass = handler.getClass(); + String classPath = theClass.getName(); + int lastTokenDelimiter = classPath.lastIndexOf('.'); + String className = classPath.substring(lastTokenDelimiter + 1, + classPath.length()); + + /* Validate the class name. */ + if (! className.equals("Handler")) { + return; + } + + Package thePackage = theClass.getPackage(); + String packageName = thePackage.getName(); + lastTokenDelimiter = packageName.lastIndexOf('.'); + String lastSubPackage = packageName.substring(lastTokenDelimiter + 1, + packageName.length()); + /* The last sub-package must be equal to the name of the protocol, or + * Java won't find it. */ + if (! lastSubPackage.equals(protocol)) { + return; + } + + /* Add the packagePrefix to the Java search path. */ + String packagePrefix = packageName.substring(0, lastTokenDelimiter); + String javaProperty = "java.protocol.handler.pkgs"; + String searchPath = System.getProperty(javaProperty); + + /* The search path doesn't exist. Create it. */ + if (searchPath == null) { + System.setProperty(javaProperty, packagePrefix); + return; + } + + /* The search path does exist. See if the package prefix is already + * registered. */ + StringTokenizer packagePrefixIter = new StringTokenizer( + searchPath, "|"); + while (packagePrefixIter.hasMoreTokens()) { + String token = packagePrefixIter.nextToken(); + if (token.equals(packagePrefix)) { + /* It is already registered. No need to do it again. */ + return; + } + } + + /* It is not registered, so we need to add it. */ + searchPath += "|" + packagePrefix; + System.setProperty(javaProperty, searchPath); + } + +} Copied: trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java (from rev 7703, trunk/foray/foray-common/src/java/org/foray/common/FOrayURLStreamHandlerFactory.java) =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java (rev 0) +++ trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 15:07:24 UTC (rev 7734) @@ -0,0 +1,120 @@ +/* + * 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 + * + */ + +/* +$Id$ + */ + +/* Known contributors: + * Vincent Hennebert (original author) + */ + +package org.foray.common.url; + +import java.io.IOException; +import java.net.URL; +import java.net.URLStreamHandler; +import java.net.URLStreamHandlerFactory; +import java.util.HashMap; + +/** + * URLStreamHandlerFactory implementation that allows custom protocols to be + * registered and accessed. + */ +public class FOrayURLStreamHandlerFactory implements URLStreamHandlerFactory { + + /** The singleton instance of this class. */ + private static FOrayURLStreamHandlerFactory urlSHFactory; + + /** + * Map of the protocols. + * The key is a String containing the protocol name. + * The value is the {@link URLStreamHandler} which should be used for that + * protocol. + */ + private HashMap protocols = new HashMap(); + + /** + * Private constructor. + * This is a singleton, and there should only be one instance per session. + * To get that instance, use + * {@link FOrayURLStreamHandlerFactory#getURLStreamHandlerFactory()}. + */ + private FOrayURLStreamHandlerFactory() { + } + + public URLStreamHandler createURLStreamHandler(String protocol) { + Object object = this.protocols.get(protocol); + if (object == null) { + /* If we don't know how to instantiate it, return null. Java will + * then look through the more normal places instead. */ + return null; + } + return (URLStreamHandler) object; + } + + /** + * Registers a new {@link URLStreamHandler} for use with a protocol. + * @param protocol The protocol to be registered. + * @param handler The {@link URLStreamHandler} instance which should be + * used for URLs whose protocol is <code>protocol</code>. + * @throws IOException For any of the following reasons: + * <ul> + * <li>If <code>protocol</code> or <code>handlerClass</code> are + * null.</li> + * <li>If <code>protocol</code> has already been registered</li> + * </ul> + */ + public void registerProtocol(String protocol, URLStreamHandler handler) + throws IOException { + if (protocol == null) { + throw new IOException("Cannot register a null " + + "protocol."); + } + if (handler == null) { + throw new IOException("Cannot register a null " + + "URLStreamHandler."); + } + if (this.protocols.containsKey(protocol)) { + throw new IOException("Protocol \n" + protocol + + "\" has already been registered."); + } + this.protocols.put(protocol, handler); + } + + /** + * Provides access to a custom URLStreamHandlerFactory instance, creating + * it and registering it with Java if needed. + * @return The custom URLStreamHandlerFactory instance for this session. + */ + public static synchronized FOrayURLStreamHandlerFactory + getURLStreamHandlerFactory() { + if (FOrayURLStreamHandlerFactory.urlSHFactory == null) { + FOrayURLStreamHandlerFactory.urlSHFactory + = new FOrayURLStreamHandlerFactory(); + URL.setURLStreamHandlerFactory( + FOrayURLStreamHandlerFactory.urlSHFactory); + } + return FOrayURLStreamHandlerFactory.urlSHFactory; + } + +} Modified: trunk/foray/foray-common/src/java/org/foray/common/url/classpath/Handler.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/url/classpath/Handler.java 2006-06-20 04:41:42 UTC (rev 7733) +++ trunk/foray/foray-common/src/java/org/foray/common/url/classpath/Handler.java 2006-06-24 15:07:24 UTC (rev 7734) @@ -28,7 +28,7 @@ package org.foray.common.url.classpath; -import org.foray.common.AbstractURLStreamHandler; +import org.foray.common.url.AbstractURLStreamHandler; import java.io.IOException; import java.io.InputStream; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 04:42:08
|
Revision: 7733 Author: victormote Date: 2006-06-19 21:41:42 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7733&view=rev Log Message: ----------- Split progression-dimension methods up so that they are easier to override. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -131,13 +131,6 @@ } /** - * {@inheritDoc} - */ - public int getProgressionDimension() { - return this.progressionDimension; - } - - /** * See {@link #getProgressionDimension()} for a description of * "progression dimension". * @param progressionDimension The progressionDimension to set. Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -63,4 +63,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -101,4 +101,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -90,4 +90,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -94,4 +94,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -102,4 +102,11 @@ return this.traitBackgroundImage(); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -308,4 +308,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -996,4 +996,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -65,4 +65,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -55,4 +55,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -127,7 +127,7 @@ if (getAreaNodeParent().traitGeneratedBy() instanceof ListItem) { return listItemPD(); } - return super.getProgressionDimension(); + return this.progressionDimension; } /** Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -117,4 +117,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -72,4 +72,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -86,4 +86,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -74,4 +74,11 @@ return this.traitBackgroundImage(); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -299,4 +299,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -78,4 +78,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -78,4 +78,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -78,4 +78,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -312,4 +312,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -91,4 +91,11 @@ return this.progressionDimension; } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2006-06-20 02:57:29 UTC (rev 7732) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2006-06-20 04:41:42 UTC (rev 7733) @@ -568,4 +568,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int getProgressionDimension() { + return this.progressionDimension; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 02:57:33
|
Revision: 7732 Author: victormote Date: 2006-06-19 19:57:29 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7732&view=rev Log Message: ----------- Table cell should get its BPD from the parent row. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2006-06-20 02:02:39 UTC (rev 7731) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2006-06-20 02:57:29 UTC (rev 7732) @@ -181,7 +181,12 @@ * {@inheritDoc} */ public int crBPD() { - return this.progressionDimension; + return this.getTableRow().getProgressionDimension(); } + public TableRowContainer getTableRow() { + /* Cast validated at construction. */ + return (TableRowContainer) this.getParent(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 02:02:55
|
Revision: 7731 Author: victormote Date: 2006-06-19 19:02:39 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7731&view=rev Log Message: ----------- Split content-rectangle methods up so that they are easier to override. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -101,4 +101,18 @@ return traitGeneratedBy().traitBaselineShift(this); } + /** + * {@inheritDoc} + */ + public int crIPD() { + return this.progressionDimension; + } + + /** + * {@inheritDoc} + */ + public int crBPD() { + return crBPDInline(); + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -202,33 +202,27 @@ } /** - * {@inheritDoc} + * @return The IPD for a block area. */ - public int crIPD() { - if (isBlockArea()) { - int actual = 0; - int computed = this.traitIPDimensionOpt(); - if (computed < 0) { - actual = getParentArea().crIPD() - - traitBorderStartWidth() - - traitBorderEndWidth() - - traitPaddingStart() - - traitPaddingEnd(); - } else { - actual = computed; - } - return actual; + protected int crIPDBlockArea() { + int actual = 0; + int computed = this.traitIPDimensionOpt(); + if (computed < 0) { + actual = getParentArea().crIPD() + - traitBorderStartWidth() + - traitBorderEndWidth() + - traitPaddingStart() + - traitPaddingEnd(); + } else { + actual = computed; } - return this.progressionDimension; + return actual; } /** - * {@inheritDoc} + * @return The BPD for an inline area. */ - public int crBPD() { - if (isBlockArea()) { - return this.progressionDimension; - } + protected int crBPDInline() { int actual = 0; int computed = this.traitBPDimensionOpt(); if (computed < 0) { Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -87,4 +87,18 @@ return this.traitBackgroundImage(); } + /** + * {@inheritDoc} + */ + public int crIPD() { + return crIPDBlockArea(); + } + + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -989,4 +989,11 @@ this.verticalAlign(); } + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -58,4 +58,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -48,4 +48,11 @@ return null; } + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -187,4 +187,11 @@ return this.traitBackgroundImage(); } + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -36,7 +36,8 @@ * An SVGArea represents the <em>reference </em> area that contains the * content that is in a {@link ForeignObjectArea} <em>viewport </em> area. */ -public class SVGArea extends AreaFlexible implements org.axsl.areaR.SVGArea { +public class SVGArea extends AbstractInlineArea + implements org.axsl.areaR.SVGArea { /** * Construct an SVG area. Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -285,4 +285,18 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int crIPD() { + return crIPDBlockArea(); + } + + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -64,4 +64,18 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int crIPD() { + return crIPDBlockArea(); + } + + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -170,4 +170,18 @@ return this.traitBackgroundImage(); } + /** + * {@inheritDoc} + */ + public int crIPD() { + return crIPDBlockArea(); + } + + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -64,4 +64,18 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int crIPD() { + return crIPDBlockArea(); + } + + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -64,4 +64,18 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int crIPD() { + return crIPDBlockArea(); + } + + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -305,4 +305,11 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2006-06-20 00:37:56 UTC (rev 7730) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2006-06-20 02:02:39 UTC (rev 7731) @@ -77,4 +77,18 @@ visitor.render(this); } + /** + * {@inheritDoc} + */ + public int crIPD() { + return crIPDBlockArea(); + } + + /** + * {@inheritDoc} + */ + public int crBPD() { + return this.progressionDimension; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 00:37:59
|
Revision: 7730 Author: victormote Date: 2006-06-19 17:37:56 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7730&view=rev Log Message: ----------- Turn table background processing back on. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-20 00:37:00 UTC (rev 7729) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-20 00:37:56 UTC (rev 7730) @@ -433,8 +433,8 @@ BackgroundArea[] backgroundAreas = area.getBackgroundAreas(); if (backgroundAreas != null) { for (int i = 0; i < backgroundAreas.length; i++) { -// BackgroundArea bga = backgroundAreas[i]; -// markBackground(bga); + BackgroundArea bga = backgroundAreas[i]; + markBackground(bga); } } /* TODO: Add logic that tries to paint the borders as efficiently This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 00:37:12
|
Revision: 7729 Author: victormote Date: 2006-06-19 17:37:00 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7729&view=rev Log Message: ----------- Use new cleaned up graphic rendering to allow background images to be processed cleanly (without other Area information). Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-20 00:28:29 UTC (rev 7728) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-20 00:37:00 UTC (rev 7729) @@ -47,6 +47,7 @@ import org.axsl.areaR.FootnoteArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaR.GraphicArea; import org.axsl.areaR.InlineArea; import org.axsl.areaR.LeaderArea; import org.axsl.areaR.LineArea; @@ -111,7 +112,7 @@ * Renders an area's background. * @param area The area whose background should be rendered. */ - protected void markBackground(Area area) { + protected void markBackground(BackgroundArea area) { markBackgroundColor(area); markBackgroundImage(area); } @@ -119,7 +120,7 @@ /** * @param area */ - private void markBackgroundColor(Area area) { + private void markBackgroundColor(BackgroundArea area) { /* * Per XSL-FO Spec 1.0, Section 4.9.4, the background is rendered * inside the padding-rectangle. @@ -142,7 +143,7 @@ /** * @param area */ - private void markBackgroundImage(Area area) { + private void markBackgroundImage(BackgroundArea area) { Graphic backgroundImage = area.traitBackgroundImage(); if (backgroundImage == null) { return; @@ -293,7 +294,7 @@ * @param clipRectangle The rectangle to which the content should be clipped * after any scaling. */ - protected void drawGraphic(Area area, Graphic graphic, + protected void drawGraphic(GraphicArea area, Graphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) { if (graphic instanceof SVGGraphic) { SVGGraphic svg = (SVGGraphic) graphic; @@ -304,17 +305,17 @@ } /** - * The same as {@link #drawGraphic(Area, Graphic, Rectangle, Rectangle)}, - * except for the specific case of bitmapped images. + * The same as {@link #drawGraphic(GraphicArea, Graphic, Rectangle, + * Rectangle)}, except for the specific case of bitmapped images. */ - protected abstract void drawImage(Area area, Graphic image, + protected abstract void drawImage(GraphicArea area, Graphic image, Rectangle contentRectangle, Rectangle clipRectangle); /** - * The same as {@link #drawGraphic(Area, Graphic, Rectangle, Rectangle)}, - * except for the specific case of SVG graphics. + * The same as {@link #drawGraphic(GraphicArea, Graphic, Rectangle, + * Rectangle)}, except for the specific case of SVG graphics. */ - protected abstract void drawSVG(Area area, SVGGraphic graphic, + protected abstract void drawSVG(GraphicArea area, SVGGraphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) ; public void render(AreaNode node) { 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-06-20 00:28:29 UTC (rev 7728) +++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2006-06-20 00:37:00 UTC (rev 7729) @@ -34,6 +34,7 @@ import org.axsl.areaR.ExternalGraphicArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaR.GraphicArea; import org.axsl.areaR.LeaderArea; import org.axsl.areaR.PageArea; import org.axsl.areaR.SVGArea; @@ -474,7 +475,7 @@ /** * {@inheritDoc} */ - protected void drawImage(Area area, Graphic image, + protected void drawImage(GraphicArea area, Graphic image, Rectangle contentRectangle, Rectangle clipRectangle) { // TODO: implement this } @@ -482,7 +483,7 @@ /** * {@inheritDoc} */ - protected void drawSVG(Area area, SVGGraphic graphic, + protected void drawSVG(GraphicArea area, SVGGraphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) { /* TODO: Implement this. */ } 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-06-20 00:28:29 UTC (rev 7728) +++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2006-06-20 00:37:00 UTC (rev 7729) @@ -35,12 +35,12 @@ import org.foray.output.OutputConfig; import org.foray.render.PrintRenderer; -import org.axsl.areaR.Area; import org.axsl.areaR.BasicLinkArea; import org.axsl.areaR.BookmarkTreeArea; import org.axsl.areaR.ExternalGraphicArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaR.GraphicArea; import org.axsl.areaR.PageArea; import org.axsl.areaR.SVGArea; import org.axsl.common.Constants; @@ -236,7 +236,7 @@ /** * {@inheritDoc} */ - protected void drawImage(Area area, Graphic image, + protected void drawImage(GraphicArea area, Graphic image, Rectangle contentRectangle, Rectangle clipRectangle) { // TODO: implement this } @@ -244,7 +244,7 @@ /** * {@inheritDoc} */ - protected void drawSVG(Area area, SVGGraphic graphic, + protected void drawSVG(GraphicArea area, SVGGraphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) { /* TODO: Implement this. */ } Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-20 00:28:29 UTC (rev 7728) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-20 00:37:00 UTC (rev 7729) @@ -41,6 +41,7 @@ import org.axsl.areaR.BookmarkTreeArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaR.GraphicArea; import org.axsl.areaR.LeaderArea; import org.axsl.areaR.PageArea; import org.axsl.areaR.SVGArea; @@ -216,7 +217,7 @@ /** * {@inheritDoc} */ - protected void drawImage(Area area, Graphic image, + protected void drawImage(GraphicArea area, Graphic image, Rectangle contentRectangle, Rectangle clipRectangle) { Rectangle2D.Float pdfContentRectangle = convertMillipointRectangle( contentRectangle); @@ -229,7 +230,7 @@ /** * {@inheritDoc} */ - protected void drawSVG(Area area, SVGGraphic graphic, + protected void drawSVG(GraphicArea area, SVGGraphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) { Rectangle2D.Float pdfContentRectangle = convertMillipointRectangle( contentRectangle); 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-06-20 00:28:29 UTC (rev 7728) +++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2006-06-20 00:37:00 UTC (rev 7729) @@ -38,6 +38,7 @@ import org.axsl.areaR.ExternalGraphicArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaR.GraphicArea; import org.axsl.areaR.LeaderArea; import org.axsl.areaR.LineArea; import org.axsl.areaR.PageArea; @@ -460,7 +461,7 @@ * @param y the y offset */ protected void renderSVGDocument(Document doc, int x, int y, - Area area) { + GraphicArea area) { BridgeContext ctx = makeBridgeContext(); GVTBuilder builder = new GVTBuilder(); @@ -509,7 +510,7 @@ PSGraphics2D graphics = new PSGraphics2D(false, this, currentPSFont.getName(), - currentFontSize, area.rrOriginX(), area.rrOriginY()); + currentFontSize, x, y); graphics.setGraphicContext(new GraphicContext()); try { root.paint(graphics); @@ -527,7 +528,7 @@ /** * {@inheritDoc} */ - protected void drawImage(Area area, Graphic image, + protected void drawImage(GraphicArea area, Graphic image, Rectangle contentRectangle, Rectangle clipRectangle) { if (clipRectangle.width > 0 || clipRectangle.height >0) { drawImageClipped(contentRectangle.x, contentRectangle.y, @@ -553,7 +554,7 @@ } protected void drawImageClipped(int x, int y, - int clipW, int clipH, Graphic image, Area area) { + int clipW, int clipH, Graphic image, GraphicArea area) { write("gsave"); write("0 0 " + clipW + " " + clipH + " re"); write("clippath"); @@ -573,7 +574,7 @@ /** * {@inheritDoc} */ - protected void drawSVG(Area area, SVGGraphic graphic, + protected void drawSVG(GraphicArea area, SVGGraphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) { /* TODO: Implement this. */ } Modified: trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2006-06-20 00:28:29 UTC (rev 7728) +++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2006-06-20 00:37:00 UTC (rev 7729) @@ -33,6 +33,7 @@ import org.axsl.areaR.ExternalGraphicArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaR.GraphicArea; import org.axsl.areaR.LeaderArea; import org.axsl.areaR.PageArea; import org.axsl.areaR.SVGArea; @@ -334,7 +335,7 @@ /** * {@inheritDoc} */ - protected void drawImage(Area area, Graphic image, + protected void drawImage(GraphicArea area, Graphic image, Rectangle contentRectangle, Rectangle clipRectangle) { // TODO: implement this } @@ -342,7 +343,7 @@ /** * {@inheritDoc} */ - protected void drawSVG(Area area, SVGGraphic graphic, + protected void drawSVG(GraphicArea area, SVGGraphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) { /* TODO: Implement this. */ } 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-06-20 00:28:29 UTC (rev 7728) +++ trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2006-06-20 00:37:00 UTC (rev 7729) @@ -27,12 +27,12 @@ import org.foray.output.OutputConfig; import org.foray.render.PrintRenderer; -import org.axsl.areaR.Area; import org.axsl.areaR.BasicLinkArea; import org.axsl.areaR.BookmarkTreeArea; import org.axsl.areaR.ExternalGraphicArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaR.GraphicArea; import org.axsl.areaR.PageArea; import org.axsl.areaR.SVGArea; import org.axsl.common.Constants; @@ -334,7 +334,7 @@ /** * {@inheritDoc} */ - protected void drawImage(Area area, Graphic image, + protected void drawImage(GraphicArea area, Graphic image, Rectangle contentRectangle, Rectangle clipRectangle) { // TODO: implement this } @@ -342,7 +342,7 @@ /** * {@inheritDoc} */ - protected void drawSVG(Area area, SVGGraphic graphic, + protected void drawSVG(GraphicArea area, SVGGraphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) { /* TODO: Implement this. */ } Modified: trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-20 00:28:29 UTC (rev 7728) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-20 00:37:00 UTC (rev 7729) @@ -43,6 +43,7 @@ import org.axsl.areaR.FootnoteArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; +import org.axsl.areaR.GraphicArea; import org.axsl.areaR.InlineArea; import org.axsl.areaR.LeaderArea; import org.axsl.areaR.LineArea; @@ -202,7 +203,7 @@ /** * {@inheritDoc} */ - protected void drawImage(Area area, Graphic image, + protected void drawImage(GraphicArea area, Graphic image, Rectangle contentRectangle, Rectangle clipRectangle) { /* There is nothing to do here. */ } @@ -210,7 +211,7 @@ /** * {@inheritDoc} */ - protected void drawSVG(Area area, SVGGraphic graphic, + protected void drawSVG(GraphicArea area, SVGGraphic graphic, Rectangle contentRectangle, Rectangle clipRectangle) { /* There is nothing to do here. */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 00:28:34
|
Revision: 7728 Author: victormote Date: 2006-06-19 17:28:29 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7728&view=rev Log Message: ----------- Clean up background processing a bit. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-20 00:20:52 UTC (rev 7727) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-20 00:28:29 UTC (rev 7728) @@ -427,6 +427,8 @@ * @param area The TableRA instance to render. */ public void render(TableArea area) { + /* Render background Areas for the table-related background-only + * areas. */ BackgroundArea[] backgroundAreas = area.getBackgroundAreas(); if (backgroundAreas != null) { for (int i = 0; i < backgroundAreas.length; i++) { @@ -438,7 +440,6 @@ * as possible. Contiguous cells that have identical borders should have * their borders painted at the same time. */ markBorder(area); - markBackground(area); renderChildren(area); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 00:20:56
|
Revision: 7727 Author: victormote Date: 2006-06-19 17:20:52 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7727&view=rev Log Message: ----------- Remove requirement for SVGArea to know its FontConsumer. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-20 00:18:48 UTC (rev 7726) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-20 00:20:52 UTC (rev 7727) @@ -266,7 +266,7 @@ area.rrOriginX() / 1000f, area.rrOriginY() / 1000, area.rrIPD() / 1000f, area.rrBPD() / 1000f); getContentStream().drawSVGDocument(area.getSVGDocument(), - contentRectangle, null, area.getFontConsumer(), + contentRectangle, null, this.getFontConsumer(), getStrokeSVGText()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 00:18:53
|
Revision: 7726 Author: victormote Date: 2006-06-19 17:18:48 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7726&view=rev Log Message: ----------- Conform to axsl change: Remove font-specific information from SVG method. This should come from the SVG itself. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-20 00:18:40 UTC (rev 7725) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-20 00:18:48 UTC (rev 7726) @@ -243,9 +243,8 @@ * to do. */ return; } - FontUse font = area.getPrimaryFont(); getContentStream().drawSVGDocument(svgDocument, pdfContentRectangle, - pdfClipRectangle, font, getStrokeSVGText()); + pdfClipRectangle, area.getFontConsumer(), getStrokeSVGText()); } /** @@ -266,9 +265,9 @@ Rectangle2D.Float contentRectangle = new Rectangle2D.Float( area.rrOriginX() / 1000f, area.rrOriginY() / 1000, area.rrIPD() / 1000f, area.rrBPD() / 1000f); - FontUse font = area.getPrimaryFont(); getContentStream().drawSVGDocument(area.getSVGDocument(), - contentRectangle, null, font, getStrokeSVGText()); + contentRectangle, null, area.getFontConsumer(), + getStrokeSVGText()); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 00:18:46
|
Revision: 7725 Author: victormote Date: 2006-06-19 17:18:40 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7725&view=rev Log Message: ----------- Conform to axsl change: Remove font-specific information from SVG method. This should come from the SVG itself. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 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-06-20 00:10:18 UTC (rev 7724) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-06-20 00:18:40 UTC (rev 7725) @@ -31,7 +31,7 @@ import org.foray.pdf.svg.batik.PDFGraphics2D; import org.foray.pdf.svg.batik.PDFTextPainter; -import org.axsl.fontR.FontUse; +import org.axsl.fontR.FontConsumer; import org.axsl.graphicR.Graphic; import org.axsl.graphicR.GraphicException; import org.axsl.graphicR.SVGGraphic; @@ -268,10 +268,10 @@ */ public void drawSVGDocument(SVGDocument doc, Rectangle2D.Float contentRectangle, Rectangle2D.Float clipRectangle, - FontUse font, boolean strokeSVGText) { + FontConsumer fontConsumer, boolean strokeSVGText) { closeTextObject(); - PDFGraphics2D graphics = getPDFContent4SVG(contentRectangle, font, - doc, strokeSVGText); + PDFGraphics2D graphics = getPDFContent4SVG(contentRectangle, + fontConsumer, doc, strokeSVGText); if (graphics == null) { // Error messages have already been logged. return; @@ -327,7 +327,7 @@ } public PDFGraphics2D getPDFContent4SVG(Rectangle2D.Float contentRectangle, - FontUse font, + FontConsumer fontConsumer, SVGDocument svgDocument, boolean strokeSVGText) { /* If not running in a graphical environment, log an error message * and skip the SVG. */ @@ -344,8 +344,7 @@ if (strokeSVGText) { textPainter = new StrokingTextPainter(); } else { - textPainter = new PDFTextPainter(getLogger(), - font.getFontConsumer()); + textPainter = new PDFTextPainter(getLogger(), fontConsumer); } ctx.setTextPainter(textPainter); @@ -367,7 +366,7 @@ builder = null; PDFGraphics2D graphics = new PDFGraphics2D(true, this.getPDFDocument(), - contentRectangle, svgDocument, font.getFontConsumer()); + contentRectangle, svgDocument, fontConsumer); graphics.setGraphicContext(new GraphicContext()); try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-20 00:10:26
|
Revision: 7724 Author: victormote Date: 2006-06-19 17:10:18 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7724&view=rev Log Message: ----------- Dig the font and font-size information out of the AttributedCharacterIterator instead of getting it as constructor parameters. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 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-06-19 23:41:17 UTC (rev 7723) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-06-20 00:10:18 UTC (rev 7724) @@ -367,7 +367,7 @@ builder = null; PDFGraphics2D graphics = new PDFGraphics2D(true, this.getPDFDocument(), - contentRectangle, font, svgDocument); + contentRectangle, svgDocument, font.getFontConsumer()); graphics.setGraphicContext(new GraphicContext()); try { Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2006-06-19 23:41:17 UTC (rev 7723) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2006-06-20 00:10:18 UTC (rev 7724) @@ -32,7 +32,6 @@ import org.foray.ps.PSReal; import org.axsl.fontR.FontConsumer; -import org.axsl.fontR.FontException; import org.axsl.pdfW.PDFException; import org.apache.batik.ext.awt.g2d.GraphicContext; @@ -77,29 +76,6 @@ throws PDFException { super(textAsShapes); -/* - * TODO: Before the refactoring related to FOrayFont, the following essentially - * created an independent FontInfo object (now FontServer). FontServer is a - * singleton, so this is no longer independent. However, FontServer responds to - * requests from a FontConsumer, which interface keeps tracks of the needs of - * the various clients of FontServer. So, if it is desirable to have separate - * management of fonts used from those used in the main document, set up a - * different FontConsumer, perhaps this PDFDocumentGraphics2D object itself. - * (Victor Mote, 6-2-04) - */ - if (!textAsShapes) { - try { - this.font = fontConsumer.selectFontXSL( - org.axsl.fontR.Font.FONT_SELECTION_AUTO, - new String[] {"Helvetica"}, - org.axsl.fontR.Font.FONT_STYLE_NORMAL, - org.axsl.fontR.Font.FONT_WEIGHT_NORMAL, - org.axsl.fontR.Font.FONT_VARIANT_NORMAL, - org.axsl.fontR.Font.FONT_STRETCH_NORMAL, - 12, - ' '); - } catch (FontException e) {} - } standalone = true; this.stream = stream; this.pdfDoc = new PDFDocument(getLogger()); Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-06-19 23:41:17 UTC (rev 7723) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-06-20 00:10:18 UTC (rev 7724) @@ -67,6 +67,7 @@ import java.awt.Stroke; import java.awt.TexturePaint; import java.awt.color.ColorSpace; +import java.awt.font.TextAttribute; import java.awt.geom.AffineTransform; import java.awt.geom.PathIterator; import java.awt.geom.Point2D; @@ -109,7 +110,6 @@ */ PDFAnnotList currentAnnotList = null; - protected org.axsl.fontR.FontUse font; protected org.axsl.fontR.FontUse overrideFont = null; protected float overrideFontSize; @@ -135,16 +135,19 @@ private PDFXObject xObject; + private FontConsumer fontConsumer; + /** * Create a new PDFGraphics2D with the given pdf document info. * This is used to create a Graphics object for use inside an already * existing document. */ public PDFGraphics2D(boolean textAsShapes, PDFDocument doc, - Rectangle2D.Float contentRectangle, org.axsl.fontR.FontUse font, - SVGDocument svgDocument) { + Rectangle2D.Float contentRectangle, + SVGDocument svgDocument, FontConsumer fontConsumer) { super(textAsShapes); pdfDoc = doc; + this.fontConsumer = fontConsumer; org.axsl.pdfW.PDFFont pdfFont = doc.getCurrentGraphicsState().getFont(); if (pdfFont == null) { this.currentFont = null; @@ -152,7 +155,6 @@ this.currentFont = pdfFont.getFontUse(); } currentFontSize = doc.getCurrentGraphicsState().getFontSize(); - this.font = font; initGraphicalEnvironment(); transformCoordinates(contentRectangle, svgDocument); } @@ -453,7 +455,6 @@ */ public void dispose() { pdfDoc = null; - this.font = null; currentStream = null; currentFont = null; currentColour = null; @@ -930,11 +931,22 @@ for (char ch = iterator.first(); ch != CharacterIterator.DONE; ch = iterator.next()) { - org.axsl.fontR.FontUse font = this.font; - /* TODO: It looks like currentFont and currentFontSize should - * come from the PDFDocuments GraphicsState, and that the comparison - * items should come from the SVG itself. */ - float size = -1; + /* TODO: All of this should be integrated with the regular methods + * in PDFContentStream. */ + String[] fontFamily = new String[1]; + fontFamily[0] = (String) iterator.getAttribute( + TextAttribute.FAMILY); + Float fontSize = (Float) iterator.getAttribute( + TextAttribute.FAMILY); + org.axsl.fontR.FontUse font; + try { + font = this.fontConsumer.selectFontCSS( + fontFamily, 0, 0, 0, 0, 0, ch); + } catch (FontException e) { + /* We can't find a font for this character, so skip it. */ + continue; + } + float size = fontSize.floatValue(); if ((font != this.currentFont) || (size != this.currentFontSize)) { this.currentFont = font; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-19 23:41:22
|
Revision: 7723 Author: victormote Date: 2006-06-19 16:41:17 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7723&view=rev Log Message: ----------- Conform to axsl change: Remove font size from the parameters needed to draw an SVG. That information should come from within the SVG itself. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-19 23:41:08 UTC (rev 7722) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-19 23:41:17 UTC (rev 7723) @@ -244,9 +244,8 @@ return; } FontUse font = area.getPrimaryFont(); - float fontSize = area.traitFontSize()/1000; getContentStream().drawSVGDocument(svgDocument, pdfContentRectangle, - pdfClipRectangle, font, fontSize, getStrokeSVGText()); + pdfClipRectangle, font, getStrokeSVGText()); } /** @@ -268,9 +267,8 @@ area.rrOriginX() / 1000f, area.rrOriginY() / 1000, area.rrIPD() / 1000f, area.rrBPD() / 1000f); FontUse font = area.getPrimaryFont(); - float fontSize = area.traitFontSize()/1000; getContentStream().drawSVGDocument(area.getSVGDocument(), - contentRectangle, null, font, fontSize, getStrokeSVGText()); + contentRectangle, null, font, getStrokeSVGText()); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-19 23:41:15
|
Revision: 7722 Author: victormote Date: 2006-06-19 16:41:08 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7722&view=rev Log Message: ----------- Conform to axsl change: Remove font size from the parameters needed to draw an SVG. That information should come from within the SVG itself. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 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-06-19 23:26:34 UTC (rev 7721) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-06-19 23:41:08 UTC (rev 7722) @@ -268,10 +268,10 @@ */ public void drawSVGDocument(SVGDocument doc, Rectangle2D.Float contentRectangle, Rectangle2D.Float clipRectangle, - FontUse font, float fontSize, boolean strokeSVGText) { + FontUse font, boolean strokeSVGText) { closeTextObject(); PDFGraphics2D graphics = getPDFContent4SVG(contentRectangle, font, - fontSize, doc, strokeSVGText); + doc, strokeSVGText); if (graphics == null) { // Error messages have already been logged. return; @@ -327,7 +327,7 @@ } public PDFGraphics2D getPDFContent4SVG(Rectangle2D.Float contentRectangle, - FontUse font, float fontSize, + FontUse font, SVGDocument svgDocument, boolean strokeSVGText) { /* If not running in a graphical environment, log an error message * and skip the SVG. */ @@ -367,7 +367,7 @@ builder = null; PDFGraphics2D graphics = new PDFGraphics2D(true, this.getPDFDocument(), - contentRectangle, font, fontSize, svgDocument); + contentRectangle, font, svgDocument); graphics.setGraphicContext(new GraphicContext()); try { Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-06-19 23:26:34 UTC (rev 7721) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-06-19 23:41:08 UTC (rev 7722) @@ -110,7 +110,6 @@ PDFAnnotList currentAnnotList = null; protected org.axsl.fontR.FontUse font; - protected float fontSize; protected org.axsl.fontR.FontUse overrideFont = null; protected float overrideFontSize; @@ -143,7 +142,7 @@ */ public PDFGraphics2D(boolean textAsShapes, PDFDocument doc, Rectangle2D.Float contentRectangle, org.axsl.fontR.FontUse font, - float fontSize, SVGDocument svgDocument) { + SVGDocument svgDocument) { super(textAsShapes); pdfDoc = doc; org.axsl.pdfW.PDFFont pdfFont = doc.getCurrentGraphicsState().getFont(); @@ -154,7 +153,6 @@ } currentFontSize = doc.getCurrentGraphicsState().getFontSize(); this.font = font; - this.fontSize = fontSize; initGraphicalEnvironment(); transformCoordinates(contentRectangle, svgDocument); } @@ -933,7 +931,10 @@ for (char ch = iterator.first(); ch != CharacterIterator.DONE; ch = iterator.next()) { org.axsl.fontR.FontUse font = this.font; - float size = this.fontSize; + /* TODO: It looks like currentFont and currentFontSize should + * come from the PDFDocuments GraphicsState, and that the comparison + * items should come from the SVG itself. */ + float size = -1; if ((font != this.currentFont) || (size != this.currentFontSize)) { this.currentFont = font; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-19 23:26:42
|
Revision: 7721 Author: victormote Date: 2006-06-19 16:26:34 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7721&view=rev Log Message: ----------- Don't pass a font in to PDFTextPainter. The font used should be resolved from the SVG itself. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 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-06-19 23:15:34 UTC (rev 7720) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-06-19 23:26:34 UTC (rev 7721) @@ -344,7 +344,8 @@ if (strokeSVGText) { textPainter = new StrokingTextPainter(); } else { - textPainter = new PDFTextPainter(getLogger(), font); + textPainter = new PDFTextPainter(getLogger(), + font.getFontConsumer()); } ctx.setTextPainter(textPainter); Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2006-06-19 23:15:34 UTC (rev 7720) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2006-06-19 23:26:34 UTC (rev 7721) @@ -25,6 +25,7 @@ package org.foray.pdf.svg.batik; import org.axsl.fontR.Font; +import org.axsl.fontR.FontConsumer; import org.axsl.fontR.FontException; import org.axsl.fontR.FontUtility; @@ -57,9 +58,17 @@ * @version $Id$ */ public class PDFTextPainter implements TextPainter { + + /** A logger for user messages. */ Log logger; - org.axsl.fontR.FontUse nominalFont = null; + + /** The FontConsumer that should be used for font resolution. */ + FontConsumer fontConsumer; + + /** The resolved font for this text. */ org.axsl.fontR.FontUse fontToUse = null; + + /** The font family name use by this text. */ String fontFamily = null; /** @@ -70,9 +79,13 @@ StrokingTextPainter.getInstance(); - public PDFTextPainter(Log logger, org.axsl.fontR.FontUse font) { + /** + * Constructor. + * @param logger A Log instance for logging user messages. + * @param consumer The FontConsumer that should be used for font resolution. + */ + public PDFTextPainter(Log logger, FontConsumer consumer) { this.logger = logger; - this.nominalFont = font; } /** @@ -281,7 +294,7 @@ for (Iterator i = gvtFonts.iterator(); i.hasNext(); ) { GVTFontFamily fam = (GVTFontFamily)i.next(); this.fontFamily = fam.getFamilyName(); - font = this.nominalFont.getFontConsumer().selectFontCSS( + font = this.fontConsumer.selectFontCSS( FontUtility.foFontFamily(this.fontFamily), style, weight, 0, org.axsl.fontR.Font.FONT_STRETCH_NORMAL, fsize * 1000, @@ -297,13 +310,13 @@ } if (font == null) { this.fontFamily = "any"; - return this.nominalFont.getFontConsumer().selectFontXSL( + return this.fontConsumer.selectFontXSL( org.axsl.fontR.Font.FONT_SELECTION_AUTO, new String[] {"any"}, style, weight, 0, org.axsl.fontR.Font.FONT_STRETCH_NORMAL, fsize * 1000, ' '); } - return this.nominalFont; + return font; } public Mark getMark(TextNode node, int pos, boolean all) { Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2006-06-19 23:15:34 UTC (rev 7720) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2006-06-19 23:26:34 UTC (rev 7721) @@ -252,7 +252,8 @@ graphics.setSVGDimension(docWidth, docHeight); currentTransform.setTransform(1, 0, 0, -1, 0, height); if (!stroke) { - textPainter = new PDFTextPainter(graphics.getLogger(), this.font); + textPainter = new PDFTextPainter(graphics.getLogger(), + this.font.getFontConsumer()); ctx.setTextPainter(textPainter); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-19 23:15:38
|
Revision: 7720 Author: victormote Date: 2006-06-19 16:15:34 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7720&view=rev Log Message: ----------- Remove need to pass letter-spacing from the FO to the SVG. Any letter-spacing should be in the SVG itself. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-19 23:15:25 UTC (rev 7719) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-19 23:15:34 UTC (rev 7720) @@ -245,10 +245,8 @@ } FontUse font = area.getPrimaryFont(); float fontSize = area.traitFontSize()/1000; - float letterSpacing = area.actualLetterSpacing() / 1000f; getContentStream().drawSVGDocument(svgDocument, pdfContentRectangle, - pdfClipRectangle, font, fontSize, letterSpacing, - getStrokeSVGText()); + pdfClipRectangle, font, fontSize, getStrokeSVGText()); } /** @@ -271,10 +269,8 @@ area.rrIPD() / 1000f, area.rrBPD() / 1000f); FontUse font = area.getPrimaryFont(); float fontSize = area.traitFontSize()/1000; - float letterSpacing = area.actualLetterSpacing() / 1000f; getContentStream().drawSVGDocument(area.getSVGDocument(), - contentRectangle, null, font, fontSize, letterSpacing, - getStrokeSVGText()); + contentRectangle, null, font, fontSize, getStrokeSVGText()); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-19 23:15:33
|
Revision: 7719 Author: victormote Date: 2006-06-19 16:15:25 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7719&view=rev Log Message: ----------- Remove need to pass letter-spacing from the FO to the SVG. Any letter-spacing should be in the SVG itself. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 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-06-19 22:43:29 UTC (rev 7718) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-06-19 23:15:25 UTC (rev 7719) @@ -268,11 +268,10 @@ */ public void drawSVGDocument(SVGDocument doc, Rectangle2D.Float contentRectangle, Rectangle2D.Float clipRectangle, - FontUse font, float fontSize, float letterSpacing, - boolean strokeSVGText) { + FontUse font, float fontSize, boolean strokeSVGText) { closeTextObject(); PDFGraphics2D graphics = getPDFContent4SVG(contentRectangle, font, - fontSize, letterSpacing, doc, strokeSVGText); + fontSize, doc, strokeSVGText); if (graphics == null) { // Error messages have already been logged. return; @@ -328,7 +327,7 @@ } public PDFGraphics2D getPDFContent4SVG(Rectangle2D.Float contentRectangle, - FontUse font, float fontSize, float letterSpacing, + FontUse font, float fontSize, SVGDocument svgDocument, boolean strokeSVGText) { /* If not running in a graphical environment, log an error message * and skip the SVG. */ @@ -345,7 +344,7 @@ if (strokeSVGText) { textPainter = new StrokingTextPainter(); } else { - textPainter = new PDFTextPainter(getLogger(), font, letterSpacing); + textPainter = new PDFTextPainter(getLogger(), font); } ctx.setTextPainter(textPainter); Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2006-06-19 22:43:29 UTC (rev 7718) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2006-06-19 23:15:25 UTC (rev 7719) @@ -59,7 +59,6 @@ public class PDFTextPainter implements TextPainter { Log logger; org.axsl.fontR.FontUse nominalFont = null; - float letterSpacing = 0; org.axsl.fontR.FontUse fontToUse = null; String fontFamily = null; @@ -71,11 +70,9 @@ StrokingTextPainter.getInstance(); - public PDFTextPainter(Log logger, org.axsl.fontR.FontUse font, - float letterSpacing) { + public PDFTextPainter(Log logger, org.axsl.fontR.FontUse font) { this.logger = logger; this.nominalFont = font; - this.letterSpacing = letterSpacing; } /** @@ -239,9 +236,10 @@ //Get text and paint String txt = getText(aci); fontToUse.registerCharsUsed(txt); + /* TODO: If letter-spacing is used, it needs to come from the SVG. */ + int letterSpacing = 0; float advance = fontToUse.getFont().width(txt, awtFontSize * 1000, - (int) this.letterSpacing * 1000, 0) - / 1000f; + letterSpacing, 0) / 1000f; float tx = 0; if (anchor != null) { switch (anchor.getType()) { Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2006-06-19 22:43:29 UTC (rev 7718) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2006-06-19 23:15:25 UTC (rev 7719) @@ -252,8 +252,7 @@ graphics.setSVGDimension(docWidth, docHeight); currentTransform.setTransform(1, 0, 0, -1, 0, height); if (!stroke) { - textPainter = new PDFTextPainter(graphics.getLogger(), this.font, - this.fontSize); + textPainter = new PDFTextPainter(graphics.getLogger(), this.font); ctx.setTextPainter(textPainter); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-19 22:43:33
|
Revision: 7718 Author: victormote Date: 2006-06-19 15:43:29 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7718&view=rev Log Message: ----------- Conform to axsl change: Don't require the text-related stuff for the non-SVG graphics. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-19 22:43:23 UTC (rev 7717) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-19 22:43:29 UTC (rev 7718) @@ -222,12 +222,8 @@ contentRectangle); Rectangle2D.Float pdfClipRectangle = convertMillipointRectangle( clipRectangle); - FontUse font = area.getPrimaryFont(); - float fontSize = area.traitFontSize()/1000; - float letterSpacing = area.actualLetterSpacing() / 1000f; getContentStream().drawGraphic(pdfContentRectangle, pdfClipRectangle, - image, font, fontSize, letterSpacing, - getStrokeSVGText()); + image); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-19 22:43:28
|
Revision: 7717 Author: victormote Date: 2006-06-19 15:43:23 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7717&view=rev Log Message: ----------- Conform to axsl change: Don't require the text-related stuff for the non-SVG graphics. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 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-06-19 22:36:04 UTC (rev 7716) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-06-19 22:43:23 UTC (rev 7717) @@ -230,15 +230,9 @@ * {@inheritDoc} */ public void drawGraphic(Rectangle2D.Float contentRectangle, - Rectangle2D.Float clipRectangle, Graphic image, - FontUse font, float fontSize, float letterSpacing, - boolean strokeSVGText) { + Rectangle2D.Float clipRectangle, Graphic image) { + /* Use drawSVG() method for SVG. */ if (image instanceof SVGGraphic) { - try { - SVGDocument svg = ((SVGGraphic) image).getSVGDocument(); - drawSVGDocument(svg, contentRectangle, clipRectangle, font, - fontSize, letterSpacing, strokeSVGText); - } catch (GraphicException e) {} return; } PDFXObject xObject; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-19 22:36:10
|
Revision: 7716 Author: victormote Date: 2006-06-19 15:36:04 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7716&view=rev Log Message: ----------- Use the right ContentStream method for SVG. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-19 22:29:06 UTC (rev 7715) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-06-19 22:36:04 UTC (rev 7716) @@ -29,12 +29,12 @@ package org.foray.render.pdf; -import org.axsl.areaR.AreaRException; import org.foray.common.StringUtilPre5; import org.foray.output.OutputConfig; import org.foray.render.PrintRenderer; import org.axsl.areaR.Area; +import org.axsl.areaR.AreaRException; import org.axsl.areaR.BasicLinkArea; import org.axsl.areaR.BookmarkArea; import org.axsl.areaR.BookmarkTitleArea; @@ -48,6 +48,7 @@ import org.axsl.common.Constants; import org.axsl.fontR.FontUse; import org.axsl.graphicR.Graphic; +import org.axsl.graphicR.GraphicException; import org.axsl.graphicR.SVGGraphic; import org.axsl.pdfW.PDFColor; import org.axsl.pdfW.PDFContentStream; @@ -64,6 +65,8 @@ import org.apache.commons.logging.Log; +import org.w3c.dom.svg.SVGDocument; + import java.awt.Color; import java.awt.Rectangle; import java.awt.geom.Line2D; @@ -236,11 +239,19 @@ contentRectangle); Rectangle2D.Float pdfClipRectangle = convertMillipointRectangle( clipRectangle); + SVGDocument svgDocument; + try { + svgDocument = graphic.getSVGDocument(); + } catch (GraphicException e) { + /* For some reason the SVGDocument is not usable. There is nothing + * to do. */ + return; + } FontUse font = area.getPrimaryFont(); float fontSize = area.traitFontSize()/1000; float letterSpacing = area.actualLetterSpacing() / 1000f; - getContentStream().drawGraphic(pdfContentRectangle, pdfClipRectangle, - graphic, font, fontSize, letterSpacing, + getContentStream().drawSVGDocument(svgDocument, pdfContentRectangle, + pdfClipRectangle, font, fontSize, letterSpacing, getStrokeSVGText()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |