From f466690aaeed2dc93360d5f5f14fede90f2f5ad2 Mon Sep 17 00:00:00 2001
From: Adrian Cumiskey
- Apache FOP provides an Ant task for automating the document build process.
-
- The FOP Ant task will convert XSL-FO documents to PDF, PS, PCL etc. output
- (see Output formats for available formats).
-
- To call FOP tasks within Ant, first add a FOP task definition to your Ant build file.
- One method of defining the task is as follows:
-
- Then create FOP tasks within your Ant build file, using the FOP task parameters listed below.
- The following example converts a single XSL-FO file to a PDF document:
-
- This example converts all XSL-FO files within an entire directory to PostScript:
-
- FOP distributions are either pre-compiled binary or source.
- If you are using a binary distribution, it is already built and there is no need to build it again.
- See the Download Instructions for information about whether a
- binary or source distribution is best for your needs.
-
- If you got the source code from a repository snapshot or via Subversion you will need to build FOP
- in any case.
-
- Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.3
- (A Java Runtime Environment is not sufficient).
-
- There is generally no need to setup a classpath. All libraries needed to compile FOP are included
- in the source distribution and are referenced by the build script.
- You will only need to adjust the classpath if you build FOP in some other way. See the build
- script build.xml for details.
-
- The build script uses Apache Ant, a popular
- Java-based build tool, which usually requires that the environment variable JAVA_HOME point to
- your local JDK root directory. This is true even if you use JDK 1.2 or above, which normally
- does not need this setting.
-
- Apache Ant must be installed in order to
- build FOP. Following best practices we don't include Ant with FOP anymore. You can find the
- instructions to install Ant in the Ant manual on the web.
-
- Change to the FOP root directory and build FOP by executing the build script (build.xml)
- using the "ant" command.
-
- The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It
- contains information for numerous build targets, many of which are building blocks to more
- useful target, and others which are primarily used by the FOP developers.
- You may benefit from looking through this file to learn more about the various build targets.
- To obtain a complete list of useful build targets:
- The most useful targets are: To run the build: For example to do a normal build for the "all" target (which is the default): OR To clean the build directory first: If you have problems building FOP, please try the following:
- The FOP configuration file is an XML file containing a variety of settings that are useful
- for controlling FOP's behavior, and for helping it find resources that you wish it to use.
-
- The easiest way to get started using a FOP configuration file is to copy the sample found
- at After creating your configuration file, you must tell FOP how to find it:
- See Setting the Configuration Programmatically
- for instructions on how to do so in an embedded environment.
-
- This is an excerpt from the example configuration file coming with FOP:
-
- Each Renderer has its own configuration section which is identified by the
- MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.
-
- The configuration for the PDF Renderer could look like this:
-
- The details on the font configuration can be found on the separate Fonts page.
- Note especially the section entitled Register Fonts with FOP.
-
- The configuration element for the PDF renderer contains two elements. One is for the font configuration
- (please follow the link above) and one is for the "filter list". The filter list controls how the
- individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply
- compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that
- setting. For debugging purposes, it may be desired not to compress the internal objects at all so the
- generated PDF commands can be read. In that case, you can simply use the following filter list. The
- second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded
- so the produced PDF file is still easily readable in a text editor.
-
- Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC
- color profile which indicates the target color space the PDF file is generated for. This
- setting is mainly used in conjunction with the PDF/X feature.
- An example:
-
- Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript
- renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into
- the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false".
- Example:
-
- Non-standard fonts for the PCL renderer are made available through the Java2D subsystem which means that
- you don't have to do any custom font configuration in this case but you have to use the font names
- offered by Java.
-
- Additionally, there are certain settings that control who the renderer handles various elements.
-
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
-
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
- FOP searches the configuration file for the information it
-expects, at the position it expects. When that information is not
-present, FOP will not complain, it will just continue. When there is
-other information in the file, FOP will not complain, it will just
-ignore it. That means that when your configuration information is in
-the file but in a different XML element, or in a different XML path,
-than FOP expects, it will be silently ignored. Check the following possibilities:
- Review Running FOP for important information that applies
- to embedded applications as well as command-line use, such as options and performance.
-
- To embed Apache FOP in your application, first create a new
- org.apache.fop.apps.FopFactory instance. This object can be used to launch multiple
- rendering runs. For each run, create a new org.apache.fop.apps.Fop instance through
- one of the factory methods of FopFactory. In the method call you specify which output
- format (i.e. Renderer) to use and, if the selected renderer requires an OutputStream,
- which OutputStream to use for the results of the rendering. You can customize FOP's
- behaviour in a rendering run by supplying your own FOUserAgent instance. The
- FOUserAgent can, for example, be used to set your own Renderer instance (details
- below). Finally, you retrieve a SAX DefaultHandler instance from the Fop object and
- use that as the SAXResult of your transformation.
-
- Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO
- input document. It is therefore a good idea that you know a few things about JAXP (which
- is a good skill anyway). Let's look at the basic usage pattern for FOP...
- Here is the basic pattern to render an XSL-FO file to PDF:
-
- Let's discuss these 5 steps in detail:
-
- If you're not totally familiar with JAXP Transformers, please have a look at the
- Embedding examples below. The section contains examples
- for all sorts of use cases. If you look at all of them in turn you should be able
- to see the patterns in use and the flexibility this approach offers without adding
- too much complexity.
-
- This may look complicated at first, but it's really just the combination of an
- XSL transformation and a FOP run. It's also easy to comment out the FOP part
- for debugging purposes, for example when you're tracking down a bug in your
- stylesheet. You can easily write the XSL-FO output from the XSL transformation
- to a file to check if that part generates the expected output. An example for that
- can be found in the Embedding examples (See "ExampleXML2FO").
-
- Logging is now a little different than it was in FOP 0.20.5. We've switched from
- Avalon Logging to Jakarta Commons Logging.
- While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves
- its logger(s) through a statically available LogFactory. This is similar to the
- general pattern that you use when you work with Apache Log4J directly, for example.
- We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging"
- (Avalon Logging). This has a consequence: You can't give FOP a logger for each
- processing run anymore. The log output of multiple, simultaneously running FOP instances
- is sent to the same logger.
-
- By default, Jakarta Commons Logging uses
- JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons
- Logging to use an alternative backend, for example Log4J. Please consult the
- documentation for Jakarta Commons Logging on
- how to configure alternative backends.
-
- Once the Fop instance is set up, call
- If you want to process XSL-FO generated from XML using XSLT we recommend
- again using standard JAXP to do the XSLT part and piping the generated SAX
- events directly through to FOP. The only thing you'd change to do that
- on the basic usage pattern above is to set up the Transformer differently:
-
- The input XSL-FO document is always received by FOP as a SAX stream (see the
- Parsing Design Document for the rationale).
-
- However, you may not always have your input document available as a SAX stream.
- But with JAXP it's easy to convert different input sources to a SAX stream so you
- can pipe it into FOP. That sounds more difficult than it is. You simply have
- to set up the right Source instance as input for the JAXP transformation.
- A few examples:
-
- There are a variety of upstream data manipulations possible.
- For example, you may have a DOM and an XSL stylesheet; or you may want to
- set variables in the stylesheet. Interface documentation and some cookbook
- solutions to these situations are provided in
- Xalan Basic Usage Patterns.
-
- Apache FOP provides two levels on which you can customize FOP's
- behaviour: the FopFactory and the user agent.
-
- The FopFactory holds configuration data and references to objects which are reusable over
- multiple rendering runs. It's important to instantiate it only once (except in special
- environments) and reuse it every time to create new FOUserAgent and Fop instances.
-
- You can set all sorts of things on the FopFactory:
-
- The font base URL to use when resolving relative URLs for fonts. Example:
-
- Disable strict validation. When disabled FOP is less strict about the rules
- established by the XSL-FO specification. Example:
-
- Enable an alternative set of rules for text indents that tries to mimic the behaviour of many commercial
- FO implementations, that chose to break the specification in this respect. The default of this option is
- 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the
- alternative behaviour, call:
-
- Set the source resolution for the document. This is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:
-
- Manually add an ElementMapping instance. If you want to supply a special FOP extension
- you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected
- (see the documentation on extension for more info). Example:
-
- Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- Apache XML Commons Resolver to make use of XCatalogs. Example:
-
- The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single
- document. If you wish to customize the user agent's behaviour, the first step is to create your own instance
- of FOUserAgent using the appropriate factory method on FopFactory and pass that
- to the factory method that will create a new Fop instance:
-
- You can do all sorts of things on the user agent:
-
- The base URL to use when resolving relative URLs. Example:
-
- Set the producer of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:
-
- Set the creating user of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
- Set the author of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
- Override the creation date and time of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
- Set the title of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
- Set the keywords of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
- Set the target resolution for the document. This is used to
- specify the output resolution for bitmap images generated by bitmap renderers
- (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter
- effects and such. Default: 72 dpi. Example:
-
- Set your own Renderer instance. If you want to supply your own renderer or
- configure a Renderer in a special way you can give the instance to the FOUserAgent. Normally,
- the Renderer instance is created by FOP. Example:
-
- Set your own FOEventHandler instance. If you want to supply your own FOEventHandler or
- configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally,
- the FOEventHandler instance is created by FOP. Example:
-
- Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- Apache XML Commons Resolver to make use of XCatalogs. Example:
-
- Instead of setting the parameters manually in code as shown above you can also set
- many values from an XML configuration file:
-
- The layout of the configuration file is described on the Configuration page.
-
- Fop instances shouldn't (and can't) be reused. Please recreate
- Fop and FOUserAgent instances for each rendering run using the FopFactory.
- This is a cheap operation as all reusable information is held in the
- FopFactory. That's why it's so important to reuse the FopFactory instance.
-
- If your XSL-FO files contain SVG then Apache Batik will be used. When Batik is
- initialised it uses certain classes in
- The thread means that the Java application may not automatically quit
- when finished, you will need to call
- If you run into trouble running FOP on a head-less server, please see the
- notes on Batik.
-
- To get the number of pages that were rendered by FOP you can call
-
- There are several options to consider:
-
- Apache FOP may currently not be completely thread safe.
- The code has not been fully tested for multi-threading issues, yet.
- If you encounter any suspicious behaviour, please notify us.
-
- There is also a known issue with fonts being jumbled between threads when using
- the Java2D/AWT renderer (which is used by the -awt and -print output options).
- In general, you cannot safely run multiple threads through the AWT renderer.
-
- The directory "{fop-dir}/examples/embedding" contains several working examples.
- This
-
- example
-demonstrates the basic usage pattern to transform an XSL-FO
-file to PDF using FOP.
- This
-
- example
-has nothing to do with FOP. It is there to show you how an XML
-file can be converted to XSL-FO using XSLT. The JAXP API is used to do the
-transformation. Make sure you've got a JAXP-compliant XSLT processor in your
-classpath (ex. Xalan).
- This
-
- example
-demonstrates how you can convert an arbitrary XML file to PDF
-using XSLT and XSL-FO/FOP. It is a combination of the first two examples
-above. The example uses JAXP to transform the XML file to XSL-FO and FOP to
-transform the XSL-FO to PDF.
-
-The output (XSL-FO) from the XSL transformation is piped through to FOP using
-SAX events. This is the most efficient way to do this because the
-intermediate result doesn't have to be saved somewhere. Often, novice users
-save the intermediate result in a file, a byte array or a DOM tree. We
-strongly discourage you to do this if it isn't absolutely necessary. The
-performance is significantly higher with SAX.
- This
-
- example
-is a preparatory example for the next one. It's an example that
-shows how an arbitrary Java object can be converted to XML. It's an often
-needed task to do this. Often people create a DOM tree from a Java object and
-use that. This is pretty straightforward. The example here, however, shows how
-to do this using SAX, which will probably be faster and not even more
-complicated once you know how this works.
-
-For this example we've created two classes: ProjectTeam and ProjectMember
-(found in xml-fop/examples/embedding/java/embedding/model). They represent
-the same data structure found in
-xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a
-project team with several members which exist as Java objects.
-Therefore we created the two classes: ProjectTeamInputSource and
-ProjectTeamXMLReader (in the same place as ProjectTeam above).
-
-The XMLReader implementation (regard it as a special kind of XML parser) is
-responsible for creating SAX events from the Java object. The InputSource
-class is only used to hold the ProjectTeam object to be used.
-
-Have a look at the source of ExampleObj2XML.java to find out how this is
-used. For more detailed information see other resources on JAXP (ex.
-An older JAXP tutorial).
- This
-
- example
-combines the previous and the third to demonstrate
-how you can transform a Java object to a PDF directly in one smooth run
-by generating SAX events from the Java object that get fed to an XSL
-transformation. The result of the transformation is then converted to PDF
-using FOP as before.
- This
-
- example
-has FOP use a DOMSource instead of a StreamSource in order to
-use a DOM tree as input for an XSL transformation.
- This
-
- example
-shows the usage of the PDF Transcoder, a sub-application within FOP.
-It is used to generate a PDF document from an SVG file.
-
-These examples should give you an idea of what's possible. It should be easy
-to adjust these examples to your needs. Also, if you have other examples that you
-think should be added here, please let us know via either the fop-users or fop-dev
-mailing lists. Finally, for more help please send your questions to the fop-users
-mailing list.
-
- By "extension", we mean any data that can be placed in the input XML document that
- is not addressed by the XSL-FO standard.
- By having a mechanism for supporting extensions, FOP is able to add features that
- are not covered in the specification.
-
- The extensions documented here are included with FOP, and are automatically available
- to you. If you wish to add an extension of your own to FOP, please see the
- Developers' Extension Page.
-
- Please see the SVG documentation for more details.
-
- By convention, FO extensions in FOP use the "fox" namespace prefix.
- To use any of the FO extensions, add a namespace entry for
-
- In previous versions of Apache FOP there was a This extension element hasn't been reimplemented for the redesigned code, yet. This extension element hasn't been reimplemented for the redesigned code, yet.
- The two proprietary extension properties, fox:orphan-content-limit and
- fox:widow-content-limit, are used to improve the layout of list-blocks and tables.
- If you have a table with many entries, you don't want a single row to be left over
- on a page. You will want to make sure that at least two or three lines are kept
- together. The properties take an absolute length which specifies the area at the
- beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a
- table or list-block. The properties are inherited and only have an effect on fo:table
- and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure
- the you'll have at least three lines (assuming line-height="1.2") together on a table
- or list-block.
- The following table summarizes the font capabilities of the various FOP renderers: The Adobe PDF Specification specifies a set of 14 fonts that must be available to every PDF reader: Helvetica (normal, bold, italic, bold italic), Times (normal, bold, italic, bold italic), Courier (normal, bold, italic, bold italic), Symbol and ZapfDingbats. The AWT family of renderers (AWT, Print, SVG), use the Java AWT libraries for font metric information. Through operating system registration, the AWT libraries know what fonts are available on the system, and the font metrics for each one. Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP. Currently only Type 1 and TrueType fonts can be added.
-More information about fonts can be found at: FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
-To use it, run the class org.apache.fop.fonts.apps.PFMReader: Windows (on JDK 1.4 and later): Windows (on JDK 1.3.x): Unix (on JDK 1.4 and later): Unix (on JDK 1.3.1): PFMReader [options]: FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it.
-Use it in a similar manner to PFMReader.
-For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf: TTFReader [options]: TrueType collections (.ttc files) contain more than one font.
-To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader. To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option).
-It will display all of the font names and exit with an Exception. Here is an example of generating a metrics file for a .ttc file: You must tell FOP how to find and use the font metrics files by registering them in the FOP Configuration. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following: Font embedding is enabled in the userconfig.xml file and controlled by the embed-url attribute.
-If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced. When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
-This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts. When embedding PostScript fonts, the entire font is always embedded. When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the original font, containing only the glyphs used, is embedded in the output document.
-Currently, this embedded font contains only the minimum data needed to be embedded in a pdf document, and does not contain any codepage information.
-The PDF document contains indexes to the glyphs in the font instead of to encoded characters.
-While the document will be displayed correctly, the net effect of this is that searching, indexing, and cut-and-paste will not work properly. One workaround for this behavior is to use the "-enc ansi" option when generating metrics with TTFReader.
-This will cause the whole font to be embedded in the pdf document.
-Characters will be WinAnsi encoded (as specified in the PDF spec), so you lose the ability to use characters from other character sets.
-See Table of TTF Encoding Options for more details.
- There are cases where you might want to force the embedding of one or more of the base 14 fonts that
- can normally be considered available on the target platform (viewer, printer). One of these cases is
- PDF/A which mandates the embedding of even the base 14 fonts. Embedding a font such as Helvetica or
- Courier is straight-forward. The "Symbol" and "ZapfDingbats" fonts, however, currently present a
- problem because FOP cannot correctly determine the encoding of these two single-byte fonts through
- the PFM file. FOP now correctly interprets the "encoding" value in the XML font metrics file, but the
- PFMReader application writes "UnknownEncoding" to the generated XML file. In order to embed "Symbol"
- and "ZapfDingbats" you have to manually change the XML font metrics file and specify "SymbolEncoding"
- or "ZapfdingbatsEncoding" encoding respectively as the value for the "encoding" element.
- Example:
- The table below summarizes the theoretical support for graphical formats within FOP. In other words, within the constraints of the limitations listed here, these formats should work. However, many of them have not been tested, and there may be limitations that have not yet been discovered or documented. The packages needed to support some formats are not included in the FOP distribution and must be installed separately. Follow the links in the "Support Thru" column for more details.
-
- FOP has native ability to handle some graphic file formats.
-
- Apache Batik contains codecs for PNG and TIFF access. FOP can use these.
-
- For JDKs 1.4 or higher, FOP provides a wrapper to load images through the
- JDK's Image I/O API (JSR 015).
- Image I/O allows to dynamically add additional image codecs. An example of such an add-on library are the
- JAI Image I/O Tools available from Sun.
-
- Because of licensing issues, the JIMI image library is not included in the FOP distribution. First, download and install it.
-Then, copy the file "JimiProClasses.zip" from the archive to {fop-install-dir}/lib/jimi-1.0.jar. Please note that FOP binary distributions are compiled with JIMI support, so there is no need for you to build FOP to add the support. If jimi-1.0.jar is installed in the right place, it will automatically be used by FOP, otherwise it will not.
-
- FOP has been compiled with JAI support, but JAI is not included in the FOP distribution.
-To use it, install JAI, then copy the jai_core.jar and the jai_codec.jar files to {fop-install-dir}/lib.
-JAI is much faster than JIMI, but is not available for all platforms. See What platforms are supported? on the JAI FAQ page for more details.
- Current FOP distributions include a distribution of the Apache Batik version 1.6.
-It is automatically installed with FOP.
-Because Batik's API changes frequently, it is highly recommended that you use the version that ships with FOP, at least when running FOP. Batik must be run in a graphical environment.
-It uses AWT classes for rendering SVG, which in turn require an X server on Unixish systems.
-If you run a server without X, or if you can't connect to the X server due to security restrictions or policies (a so-called "headless" environment), SVG rendering will fail. Here are some workarounds: FOP native support for BMP images is limited to the RGB color-space. FOP provides support for two output targets:
- Other output targets can't be supported at the moment because
- FOP lacks a PostScript interpreter. Furthermore, FOP is not able
- to parse the preview bitmaps sometimes contained in EPS files.
- FOP native support of JPEG does not include all variants, especially those containing unusual color lookup tables and color profiles.
-If you have trouble with a JPEG image in FOP, try opening it with an image processing program (such as Photoshop or Gimp) and then saving it.
-Specifying 24-bit color output may also help.
-For the PDF and PostScript renderers most JPEG images can be passed through without decompression.
-User reports indicate that grayscale, RGB, and CMYK color-spaces are all rendered properly.
- If using JAI for PNG support, only RGB and RGBA color-spaces are supported for FOP rendering. FOP uses Batik for SVG support.
-This format can be handled as an
-The SVG is rendered into PDF by using PDF commands to draw and fill
-lines and curves. This means that the graphical objects created with
-this remain as vector graphics.
-
-There are a number of SVG things that cannot be converted directly into
-PDF. Parts of the graphic such as effects, patterns and images are inserted
-into the PDF as a raster graphic. The resolution of this graphic may not
-be ideal depending on the FOP dpi (72dpi) and the scaling for that graphic.
-We hope to improve this in the future.
-Currently transparency is not supported in PDF so many svg images that
-contain effects or graphics with transparent areas will not be displayed
-correctly.
- If possible, Batik will use normal PDF text when inserting text. It does
-this by checking if the text can be drawn normally and the font is
-supported. This example svg text.svg /
-text.pdf
-shows how various types and effects with text are handled.
-Note that tspan and outlined text are not yet implemented.
-Otherwise, text is converted and drawn as a set of shapes by batik, using the stroking text painter.
-This means that a typical character will
-have about 10 curves (each curve consists of at least 20 characters).
-This can make the pdf files large and when the pdf is viewed the
-viewer does not normally draw those fine curves very well (turning on
-Smooth Line Art in the Acrobat preferences will fix this).
-If the text is inserted into the PDF using the inbuilt text commands
-for PDF it will use a single character.
- Note that because SVG text can be rendered as either text or a vector graphic, you may need to consider settings in your viewer for both.
-The Acrobat viewer has both "smooth line art" and "smooth text" settings that may need to be set for SVG images to be displayed nicely on your screen (see Edit / Preferences / Display).
-This setting will not affect the printing of your document, which should be OK in any case, but will only affect the quality of the screen display. Currently, SVG images are rendered with the dimensions specified in the SVG file, within the viewport specified in the fo:external-graphic element.
-For everything to work properly, the two should be equal.
-The SVG standard leaves this issue as an implementation detail.
-FOP will probably implement a scaling mechanism in the future. FOP-native TIFF support is limited to PDF and PostScript output only. Also, according to user reports, FOP's native support for TIFF is limited to images with the following characteristics (all must be true for successful rendering): JAI: Supports RGB and RGBA only for FOP rendering. Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution value. Since PDF and most output formats do not have a concept of resolution, but only of absolute image units (i.e. pixels) FOP ignores the resolution values as well. Instead, FOP uses the dimensions of the image as specified in the fo:external-graphic element to render the image: If you need a higher apparent output resolution for bitmapped images, first make sure that at least one dimension of the image is defined in your XSL-FO input. Apart from that, resolution problems are in the image file itself, and must be corrected there: use or create a higher-resolution image file.
- FOP caches images between runs. The URL is used as a key to identify images which means that when
- a particular URL appears again, the image is taken from the cache. If you have a servlet that
- generates a different image each time it is called with the same URL you need to use a constantly
- changing dummy parameter on the URL to avoid caching.
-
- The image cache has been improved considerably in the redesigned code. Therefore, a resetCache() method
- has become unnecessary. If you still experience OutOfMemoryErrors, please notify us.
- FOP uses Liang's hyphenation algorithm, well known from TeX. It needs
- language specific pattern and other data for operation. Because of licensing issues (and for
- convenience), all hyphenation patterns for FOP are made available through
- the Objects For
- Formatting Objects project. Many of the hyphenation files distributed with TeX and its offspring are
- licenced under the LaTeX
- Project Public License (LPPL), which prevents them from being
- distributed with Apache software. The LPPL puts restrictions on file names
- in redistributed derived works which we feel can't guarantee. Some
- hyphenation pattern files have other or additional restrictions, for
- example against use for commercial purposes. Although Apache FOP cannot redistribute hyphenation pattern files that do
- not conform with its license scheme, that does not necessarily prevent users
- from using such hyphenation patterns with FOP. However, it does place on
- the user the responsibility for determining whether the user can rightly use
- such hyphenation patterns under the hyphenation pattern license. The most important source of hyphenation pattern files is the
- CTAN TeX
- Archive. To install a custom hyphenation pattern for use with FOP: If you would like to build your own hyphenation pattern files, or modify
- existing ones, this section will help you understand how to do so. Even
- when creating a pattern file from scratch, it may be beneficial to start
- with an existing file and modify it. See
- OFFO's Hyphenation page for examples.
- Here is a brief explanation of the contents of FOP's hyphenation patterns: If you want to convert a TeX hyphenation pattern file, you have to undo
- the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns
- must be proper Unicode too. You should be aware of the XML encoding issues,
- preferably use a good Unicode editor. Note that FOP does not do Unicode character normalization. If you use
- combining chars for accents and other character decorations, you must
- declare character classes for them, and use the same sequence of base character
- and combining marks in the XSLFO source, otherwise the pattern wouldn't match.
- Fortunately, Unicode provides precomposed characters for all important cases
- in common languages, until now nobody run seriously into this issue. Some dead
- languages and dialects, especially ancient ones, may pose a real problem
- though. If you want to generate your own patterns, an open-source utility called
- patgen is available on many Unix/Linux distributions and every TeX
- distribution which can be used to assist in
- creating pattern files from dictionaries. Pattern creation for languages like
- english or german is an art. If you can, read Frank Liang's original paper
- "Word Hy-phen-a-tion by Com-pu-ter" (yes, with hyphens). It is not available
- online. The original patgen.web source, included in the TeX source distributions,
- contains valuable comments, unfortunately technical details obscure often the
- high level issues. Another important source is
- The
- TeX Book, appendix H (either read the TeX source, or run it through
- TeX to typeset it). Secondary articles, for example the works by Petr Sojka,
- may also give some much needed insight into problems arising in automated
- hyphenation.
- The Apache FOP team is proud to present to you this production quality release. It has taken
- over three years to get this far and over two years without a new release from the FOP
- project. We're still in the process of adding new features. We welcome any feedback you
- might have and even more, any other form of help to get the project forward.
-
- This fourth release contains many bug fix release and new features compared
- to 0.92beta. To see what has changed since the last release, please visit the
- Changes Page and the Release Notes.
-
- If you're upgrading to this version from an earlier version of FOP, please read the
- information contained on the Upgrading page!
-
- To download this version, please visit the download page.
-
- The intermediate format (IF) is a proprietary XML format that represents the area tree
- generated by the layout engine. The area tree is conceptually defined in the
- XSL-FO specification in chapter 1.1.2.
- The IF can be generated through the area tree XML Renderer (the XMLRenderer).
-
- The intermediate format can be used to generate intermediate documents that are modified
- before they are finally rendered to their ultimate output format. Modifications include
- adjusting and changing trait values, adding or modifying area objects, inserting prefabricated
- pages, overlays, imposition (n-up, rotation, scaling etc.). Multiple IF files can be combined
- to a single output file.
-
- As already mentioned, the IF is generated by using the XMLRenderer (MIME type:
- application/X-fop-areatree). So, you basically set the right MIME type for
- the output format and process your FO files as if you would create a PDF file. However, there
- is an important detail to consider: The various Renderers don't all use the same font sources.
- To be able to create the right area tree for the ultimate output file, you need to create
- the IF file using the right font setup. This is achieved by telling the XMLRenderer to mimic
- another renderer. This is done by calling the XMLRenderer's mimicRenderer() method with an
- instance of the ultimate target renderer as the single parameter. This has a consequence: An
- IF file rendered with the Java2DRenderer may not look as expected when it was actually generated
- for the PDF renderer. For renderers that use the same font setup, this restriction does not
- apply (PDF and PS, for example). Generating the intermediate format file is the first step.
-
- The second step is to reparse the IF file using the AreaTreeParser which is
- found in the org.apache.fop.area package. The pages retrieved from the IF file are added to an
- AreaTreeModel instance from where they are normally rendered using one of the available Renderer
- implementations. You can find examples for the IF processing in the
-
- The basic pattern to parse the IF format looks like this:
-
- This example simply reads an IF file and renders it to a PDF file. Please note, that in normal
- FOP operation you're shielded from having to instantiate the FontInfo object yourself. This
- is normally a task of the AreaTreeHandler which is not present in this scenario. The same
- applies to the AreaTreeModel instance, in this case an instance of a subclass called
- RenderPagesModel. RenderPagesModel is ideal in this case as it has very little overhead
- processing the individual pages. An important line in the example is the call to
-
- The intermediate format can also be used from the command-line
- by using the "-atin" parameter for specifying the area tree XML as input file. You can also
- specify a "mimic renderer" by inserting a MIME type between "-at" and the output file.
-
- This initial example is obviously not very useful. It would be faster to create the PDF file
- directly. As the ExampleConcat.java
- example shows you can easily parse multiple IF files in a row and add the parsed pages to the
- same AreaTreeModel instance which essentially concatenates all the input document to one single
- output document.
-
- One of the most important use cases for the intermediate format is obviously modifying the area
- tree XML before finally rendering it to the target format. You can easily use XSLT to process
- the IF file according to your needs. Please note, that we will currently not formally describe
- the intermediate format. You need to have a good understanding its structure so you don't
- create any non-parseable files. We may add an XML Schema and more detailed documentation at a
- later time. You're invited to help us with that.
-
- The generation of the intermediate format as well as it parsing process has been designed to allow
- for maximum flexibility and optimization. Please note that you can call
- This page lists currently known issues in the current release.
-
- For additional information on known issues in Apache FOP, please have a look at the following pages, too:
-
- Apache FOP has an extensive automated testing infrastructure. Parts of this infrastructure are several
- sets of test cases. When a test case is listed in disabled-testcases.xml it is disabled in the JUnit
- tests during the normal build process. This indicates a problem in the current codebase. When a bug is
- fixed or a missing feature is added the entry for the relevant test case(s) are removed.
-
- This section lists currently disabled test cases in the test suite for the FO tree tests.
- The data for this section comes from
- test/fotree/disabled-testcases.xml.
-
- This section lists currently disabled test cases in the test suite for the layout engine tests.
- The data for this section comes from
- test/layoutengine/disabled-testcases.xml.
- This section lists other known issues.
- FOP supports multiple output formats by using a different renderer for each format.
- The renderers do not all have the same set of capabilities, sometimes because of
- the output format itself, sometimes because some renderers get more development
- attention than others.
-
- Most FOP renderers use a FOP-specific system for font registration.
- However, the Java2D/AWT and print renderers use the Java AWT package, which gets its
- font information from the operating system registration.
- This can result in several differences, including actually using different fonts,
- and having different font metrics for the same font.
- The net effect is that the layout of a given FO document can be quite different between
- renderers that do not use the same font information.
-
- The most obvious way to print your document is to use the FOP
- print renderer, which uses the Java2D API (AWT).
- However, you can also send output from the Postscript renderer directly to a Postscript
- device, or output from the PCL renderer directly to a PCL device.
-
- Here are Windows command-line examples for Postscript and PCL:
-
- Here is some Java code to accomplish the task in UNIX:
-
- Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and
- it happily sends the PCL to the UNIX printer queue.
-
- PDF is the best supported output format. It is also the most accurate
- with text and layout. This creates a PDF document that is streamed out
- as each page is rendered. This means that the internal page index
- information is stored near the end of the document.
- The PDF version supported is 1.4. PDF versions are forwards/backwards
- compatible.
-
- Note that FOP does not currently support "tagged PDF" or PDF/A-1a.
- Support for PDF/A-1b and PDF/X has recently been added, however.
-
- PDF has a set of fonts that are always available to all PDF viewers;
- to quote from the PDF Specification:
-
- "PDF prescribes a set of 14 standard fonts that can be used without prior
- definition.
- These include four faces each of three Latin text typefaces (Courier,
- Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf
- Dingbats). These fonts, or suitable substitute fonts with the same metrics, are
- guaranteed to be available in all PDF viewer applications."
-
- FOP does not currently support several desirable PDF features: XMP metadata and watermarks.
- One workaround is to use Adobe Acrobat (the full version, not the Reader) to process
- the file manually or with scripting that it supports.
-
- Another popular post-processing tool is iText,
- which has tools for adding security features, document properties, watermarks, and many
- other features to PDF files.
-
- Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now
- supports PDF encryption. However the principles for using
- iText for other PDF features are similar.)
-
- Check the iText tutorial and documentation for setting access flags, password,
- encryption strength and other parameters.
-
- In addition to the PDF Post-processing options, consider the following workarounds:
-
- The PostScript renderer has been brought up to a similar quality as the
- PDF renderer, but may still be missing certain features. It provides good
- support for most text and layout.
- Images and SVG are not fully supported, yet. Currently, the PostScript
- renderer generates PostScript Level 3 with most DSC comments. Actually,
- the only Level 3 feature used is FlateDecode, everything else is Level 2.
-
- This format is for the Hewlett-Packard PCL printers and other printers
- supporting PCL. It should produce output as close to identical as possible
- to the printed output of the PDFRenderer within the limitations of the
- renderer, and output device.
-
- The output created by the PCLRenderer is generic PCL 5, HP GL/2 and PJL.
- This should allow any device fully supporting PCL 5 to be able to
- print the output generated by the PCLRenderer. PJL is used to control the
- print job and switch to the PCL language. PCL 5 is used for text, raster
- graphics and rectangular fill graphics. HP GL/2 is used for more complex
- painting operations. Certain painting operations are done off-screen and
- rendered to PCL as bitmaps because of limitations in PCL 5.
-
- The PCL renderer configuration currently allows the following settings:
-
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
-
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
-
- You can control the output resolution for the PCL using the "target resolution"
- setting on the FOUserAgent. The actual value will be rounded up to the next
- supported PCL resolution. Currently, only 300 and 600 dpi are supported which
- should be enough for most use cases. Note that this setting directly affects
- the size of the output file and the print quality.
- The PCL Renderer supports some PCL specific extensions which can be embedded
- into the input FO document. To use the extensions the appropriate namespace must
- be declared in the fo:root element like this:
- The page-source extension attribute on fo:simple-page-master allows to
- select the paper tray the sheet for a particular simple-page-master is
- to be taken from. Example:
-
- Note: the tray number is a positive integer and the value depends on
- the target printer. Not all PCL printers support the same paper trays.
- Usually,
- "1" is the default tray,
- "2" is the manual paper feed,
- "3" is the manual envelope feed,
- "4" is the "lower" tray and
- "7" is "auto-select".
- Consult the technical reference for your printer for all available values.
-
- The FOP AFP Renderer deals with creating documents conforming to the IBM AFP document architecture
- also refered to as MO:DCA (Mixed Object Document Content Architecture).
- This list is most likely badly incomplete. The AFP Renderer requires special configuration particularly related to fonts.
- AFP Render configuration is done through the normal FOP configuration file. The MIME type
- for the AFP Renderer is application/x-afp which means the AFP Renderer section in the FOP configuration file
- looks like: There are 3 font configuration variants supported: A typical raster font configuration looks like: An outline font configuration is simpler as the individual font size entries are not required.
- However, the characterset definition is now required within the afp-font element. Experimentation has shown that the font metrics for the FOP built-in Base14 fonts are actually
- very similar to some of the IBM outline and raster fonts. In cases were the IBM font files are not
- available the path attribute in the afp-font element can be replaced by a base14-font attribute
- giving the name of the matching Base14 font. In this case the AFP Renderer will take the
- font metrics from the built-in font. By default the AFP Renderer converts all images to 8 bit grey level.
- This can be overridden by the <images> configuration element. Example: This will put images as RGB images into the AFP output stream. The default setting is: Only the values "color" and "b+w" are allowed for the mode attribute. The bits-per-pixel
- attribute is ignored if mode is "color". For "b+w" mode is must be 1, 4, or 8. The AFP Renderer supports some AFP specific extensions which can be embedded into the input
- fo document. To use the extensions the appropriate namespace must be declared in the fo:root element like this: The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example: The mandatory name attribute must refer to an 8 character (space padded) resource name that
- must be known in the AFP processing environment. The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements.
- Example: The include-page-segment extension element can only occur within a simple-page-master.
- Multiple include-page-segment extension elements within a simple-page-master are allowed.
- The mandatory name attribute must refer to an 8 character
- (space padded) resource name that must be known in the AFP processing environment.
- The value of the mandatory src attribute is compared against the value of the src attribute in
- fo:external-graphic elements and if it is identical (string matching is used) in the generated
- AFP the external graphic is replaced by a reference to the given resource.
- The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
- Example: The tag-logical-element extension element can only occur within a simple-page-master.
- Multiple tag-logical-element extension elements within a simple-page-master are allowed.
- The name and value attributes are mandatory.
-
- JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP.
- This will create an RTF (rich text format) document that will
- attempt to contain as much information from the fo document as
- possible. The RTF output follows Microsoft's RTF specifications
- and produces best results on Microsoft Word.
-
- This is primarily for testing and verification. The XML created is simply
- a representation of the internal area tree put into XML. We use that to verify
- the functionality of FOP's layout engine.
-
- The other use case of the Area Tree XML is as FOP's "intermediate format". More information
- on that can be found on the page dedicated to the Intermediate Format.
-
- The Java2DRenderer provides the basic functionality for all
- Java2D-based output formats (AWT viewer, direct print, PNG, TIFF).
-
- The AWT viewer shows a window with the pages displayed inside a
- Java graphic. It displays one page at a time.
- The fonts used for the formatting and viewing depend on the fonts
- available to your JRE.
-
- It is possible to directly print the document from the command line.
- This is done with the same code that renders to the Java2D/AWT renderer.
-
- It is possible to directly create bitmap images from the individual
- pages generated by the layout engine.
- This is done with the same code that renders to the Java2D/AWT renderer.
-
- Currently, two output formats are supported: PNG and TIFF. TIFF produces
- one file with multiple pages, while PNG output produces one file per
- page. The quality of the bitmap depends on the target resolution setting
- on the FOUserAgent.
-
- The TIFF and PNG renderer configuration currently allows the following settings:
-
- The default value for the "transparent-page-background" setting is "false" which
- paints an opaque, white background for the whole image. If you set this to true,
- no such background will be painted and you will get a transparent image if
- an alpha channel is available in the output format.
-
- In addition to the above values the TIFF renderer configuration allows some additional
- settings:
-
- The default value for the "compression" setting is "PackBits" which is a
- widely supported RLE compression scheme for TIFF. The set of compression
- names to be used here matches the set that the Image I/O API uses. Note that
- not all compression schemes may be available during runtime. This depends on the
- actual codecs being available. Here is a list of possible values:
-
- The text renderer produces plain ASCII text output
- that attempts to match the output of the PDFRenderer as closely as
- possible. This was originally developed to accommodate an archive system
- that could only accept plain text files, and is primarily useful for getting
- a quick-and-dirty view of the document text. The renderer is very limited,
- so do not be surprised if it gives unsatisfactory results.
-
- The Text renderer works with a fixed size page buffer. The size of this
- buffer is controlled with the textCPI and textLPI public variables.
- The textCPI is the effective horizontal characters per inch to use.
- The textLPI is the vertical lines per inch to use. From these values
- and the page width and height the size of the buffer is calculated.
- The formatting objects to be rendered are then mapped to this grid.
- Graphic elements (lines, borders, etc) are assigned a lower priority
- than text, so text will overwrite any graphic element representations.
-
- Because FOP lays the text onto a grid during layout, there are frequently
- extra or missing spaces between characters and lines, which is generally
- unsatisfactory.
- Users have reported that the optimal settings to avoid such spacing problems are:
-
- Due to the state of certain renderers we moved some of them to a "sandbox" area until
- they are ready for more serious use. The renderers and FOEventHandlers in the sandbox
- can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the
- main build. The output formats in the sandbox are marked as such below.
-
- This format is the Maker Interchange Format which is used by
- Adobe Framemaker.
-
- This format creates an SVG document that has links between the pages.
- This is primarily for slides and creating svg images of pages.
- Large documents will create SVG files that are far too large for
- an SVG viewer to handle. Since FO documents usually have text the
- SVG document will have a large number of text elements.
- The font information for the text is obtained from the JVM in the
- same way as for the AWT viewer. If the SVG is viewed on a
- system where the fonts are different, such as another platform,
- then the page may look wrong.
-
- Apache FOP is easily extensible and allows you to add new output formats to enhance FOP's functionality. There's a number of output formats
- which are on our wish list. We're looking for volunteers to help us implement them.
-
- PDF/A is a standard which turns PDF into an "electronic document file
- format for long-term preservation". PDF/A-1 is the first part of the
- standard and is documented in
- ISO 19005-1:2005(E).
- Work on PDF/A-2 is in progress at
- AIIM.
-
- Design documentation on PDF/A can be found on FOP's Wiki on the
- PDFA1ConformanceNotes page.
-
- PDF/A-1b is implemented to the degree that FOP supports
- the creation of the elements described in ISO 19005-1.
-
- Tests have been performed against jHove and Adobe Acrobat 7.0.7 (Preflight function).
- FOP does not validate completely against Apago's PDF Appraiser. Reasons unknown due to
- lack of a full license to get a detailed error protocol.
-
- PDF/A-1a is not implemented, yet. This is mostly because of the requirement
- for tagged PDF which is not available in FOP, yet.
-
- To activate PDF/A-1b from the command-line, specify "-pdfprofile PDF/A-1b"
- as a parameter. If there is a violation of one of the validation rules for
- PDF/A, an error message is presented and the processing stops.
-
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
-
- If one of the validation rules of PDF/A is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
-
- There are a number of things that must be looked after if you activate a PDF/A
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
-
- The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be
- activated at the same time.
-
- FOP supports encryption of PDF output, thanks to Patrick
- C. Lankswert. This feature is commonly used to prevent
- unauthorized viewing, printing, editing, copying text from the
- document and doing annotations. It is also possible to ask the
- user for a password in order to view the contents. Note that
- there already exist third party applications which can decrypt
- an encrypted PDF without effort and allow the aforementioned
- operations, therefore the degree of protection is limited.
-
- For further information about features and restrictions regarding PDF
- encryption, look at the documentation coming with Adobe Acrobat or the
- technical documentation on the Adobe web site.
-
- Encryption is enabled by supplying any of the encryption related
- options.
-
- An owner password is set with the
- If no owner password has been supplied but FOP was asked to apply some
- restrictions, a random password is used. In this case it is obviously
- impossiible to disregard restrictions in PDF processing tools.
-
- A user password, supplied with the
- Further restrictions can be imposed by using the
- When FOP is embedded in another Java application you need to set an
- options map on the renderer. These are the supported options:
-
- An example to enable PDF encryption in Java code:
-
- The parameters for the constructor of PDFEncryptionParams are:
-
- Alternatively, you can set each value separately in the Map provided by
- FOUserAgent.getRendererOptions() by using the following keys:
-
- In order to use PDF encryption, FOP has to be compiled with
- cryptography support. Currently, only JCE
- is supported. JCE is part of JDK 1.4. For earlier JDKs, it can
- be installed separately. The build process automatically
- detects JCE presence and installs PDF encryption support if
- possible, otherwise a stub is compiled in.
-
- Cryptography support must also be present at run time. In particular, a
- provider for the RC4 cipher is needed. Unfortunately, the sample JCE
- provider in Sun's JDK 1.4 does not provide RC4. If you
- get a message saying
-
- then you don't have the needed infrastructure.
-
- There are several commercial and a few Open Source packages which
- provide RC4. A pure Java implementation is produced by The Legion of the Bouncy
- Castle. Mozilla
- JSS is an interface to a native implementation.
-
- The pure Java implementation from Bouncy Castle is easy to
- install.
-
- If you have any experience with Mozilla JSS or any other
- cryptography provider, please post it to the fop-user list.
-
- PDF/X is a standard which faciliates prepress digital data exchange using PDF.
- Currently, only PDF/X-3:2003 is implemented out of the many different flavours of PDF/X
- profiles. PDF/X-3:2003 is documented in
- ISO 15930-6:2003(E).
- More info on PDF/X can be found on the
- PDF/X info site.
-
- PDF/X-3:2003 is implemented to the degree that FOP supports
- the creation of the elements described in ISO 15930-6.
-
- An important restriction of the current implementation is that all normal
- RGB colors specified in XSL-FO and SVG are left unchanged in the sRGB color
- space (XSL-FO and SVG both use sRGB as their default color space).
- There's no conversion to a CMYK color space. Although sRGB is a
- calibrated color space, its color space has a different size than a CMYK
- color space which makes the conversion a lossy conversion and can lead to
- unwanted results. Although the use of the calibrated sRGB has been promoted
- for years, print shops usually prefer to convert an sRGB PDF to CMYK prior
- to production. Until there's full CMYK support in FOP you will have to
- work closely with your print service provider to make sure you get the
- intended result.
-
- Tests have been performed against Adobe Acrobat 7.0.7 (Preflight function).
- Note that there are bugs in Adobe Acrobat which cause false alarms if both
- PDF/A-1b and PDF/X-3:2003 are activated at the same time.
-
- To activate PDF/X-3:2003 from the command-line, specify "-pdfprofile PDF/X-3:2003"
- as a parameter. If there is a violation of one of the validation rules for
- PDF/X, an error message is presented and the processing stops.
-
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
-
- If one of the validation rules of PDF/X is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
-
- There are a number of things that must be looked after if you activate a PDF/X
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
-
- The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be
- activated at the same time.
- The following software must be installed: The following software is optional, depending on your needs: In addition, the following system requirements apply:
- Basic FOP installation consists of first unzipping the
- Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip
- and unarchive their distribution media. This is a legacy of older Mac operating systems,
- which had a 31-character pathname limit. Several Mac OSX users have recommended that
- Mac OSX users use the shell command
- The usual and recommended practice for starting FOP from the command line is to run the
- batch file fop.bat (Windows) or the shell script fop (Unix/Linux).
- These scripts require that the environment variable JAVA_HOME be
- set to a path pointing to the appropriate Java installation on your system. Macintosh OSX
- includes a Java environment as part of its distribution. We are told by Mac OSX users that
- the path to use in this case is
- PDF encryption is only available if FOP was compiled with encryption support
- and if compatible encryption support is availabe at run time.
- Currently, only the JCE is supported. Check the Details.
- FOP's entry point for your own scripts is the class
-
- As an alternative to the start scripts you can run You can also run In both cases the arguments consist of the options and
- infile and outfile specifications as shown above for the
- standard scripts. If FOP is started without a proper classpath, it tries to
- add its dependencies dynamically. FOP uses the current working
- directory as the base directory for its search. If the base
- directory is called FOP expects to find If the system property
- FOP sessions that use -xml and -xsl input instead of -fo input are actually
- controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting
- the XSL-FO to PDF (or another FOP output format).
- Although FOP controls both of these processes, the first is included merely as
- a convenience and for performance reasons.
- Only the second is part of FOP's core processing.
- If a user has a problem running FOP, it is important to determine which of these
- two processes is causing the problem.
- If the problem is in the first process, the user's stylesheet is likely the cause.
- The FOP development team does not have resources to help with stylesheet issues,
- although we have included links to some useful
- Specifications and
- Books/Articles.
- If the problem is in the second process, FOP may have a bug or an unimplemented
- feature that does require attention from the FOP development team.
-
- In the case of using -xml and -xsl input, although the user is responsible for
- the XSL-FO code that is FOP's input, it is not visible to the user. To make the
- intermediate FO file visible, the FOP distribution includes the "-foout" option
- which causes FOP to run only the first (transformation) step, and write the
- results to a file. (See also the Xalan command-line below)
-
- The -foout option works the same way as if you would call the
- Xalan command-line:
-
-
- Note that there are some subtle differences between the FOP and Xalan command-lines.
-
- FOP can consume quite a bit of memory, even though this has been continually improved.
- This is partly inherent to the formatting process and partly caused by implementation choices.
- All FO processors currently on the market have memory problems with certain layouts.
-
- If you are running out of memory when using FOP, here are some ideas that may help:
-
- One of FOP's stated design goals is to be able to process input of arbitrary size.
- Addressing this goal is one of the prime motivations behind the
- FOP Redesign.
- If you have problems running FOP, please see the "How to get Help" page.
- This page discusses topic all around using Apache FOP in a servlet environment.
-
- In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example
- of a FOP-enabled servlet.
-
- The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building
- the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use
- URLs like the following to generate PDF files:
- The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.
- Here is a minimal code snippet to demonstrate the basics:
-
- A common requirement is to transform an XML source to
- XSL-FO using an XSL transformation. It is recommended to use
- JAXP for this task. The following snippet shows the basic
- code:
-
- The
- Because you have an explicit
- You can easily set up your own FOUserAgent as demonstrated on the Embedding page.
-
- There are several options to consider:
-
- Of course, the
- performance hints from the Embedding page
- apply here, too.
-
- Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times.
- These are well-known limitations of Internet Explorer and are not a problem of the servlet.
- However, Internet Explorer can still be used to download the PDF so that it can be viewed later.
- Here are some suggestions in this context:
-
- When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts
- with existing XML/XSLT libraries. Servlet containers also often use their own classloaders
- for loading webapps, which can cause bugs and security problems.
-
- Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon.
- There are known bugs that must be addressed, particularly for Tomcat 4.0.3.
-
- Put a copy of a working parser in some directory where WebSphere can access it.
- For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets,
- copy the Xerces jar into it (any other directory would also be fine).
- Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the
- application server which contains your web application.
- In the WebSphere administration console, click on the "environment" button in the
- "general" tab. In the "variable name" box, enter "CLASSPATH".
- In the "value" box, enter the correct path to the parser jar file
- (/usr/webapps/yourapp/servlets/Xerces.jar in our example here).
- Press "OK", then apply the change and restart the application server.
-
- Sometimes the requirements for a servlet get quite sophisticated: SQL data sources,
- multiple XSL transformations, merging of several datasources etc. In such a case
- consider using Apache Cocoon instead
- of a custom servlet to accomplish your goal.
-
- If you're planning to upgrade to the latest FOP version there are a few very important things
- to consider:
-
- The new code is much more strict about the interpretation of the XSL-FO 1.0 specification.
- Things that worked fine in version 0.20.5 might start to produce warnings or even errors
- now. FOP 0.20.5 contains many bugs which have been corrected in the new code.
-
- When you use your existing FO files or XML/XSL files which work fine with FOP version
- 0.20.5 against this FOP version some things may not work as expected. The following
- list will hopefully help you to identify and correct those problems.
-
-
-
-
- Attribute
- Description
- Required
-
-
- fofile
- XSL-FO file to be rendered
- Yes, if no fileset nested element is used
-
-
- outfile
- Output filename
- Yes, when fofile is used. (This attribute is not valid for filesets.)
-
-
- format
- Possible output formats:
-
- application/X-fop-awt-preview
- application/X-fop-print
- application/X-fop-areatree
- application/pdf
- application/postscript
- application/mif
- application/rtf
,
- text/richtext
,
- text/rtf
- application/x-pcl
,
- application/vnd.hp-PCL
- application/x-afp
,
- application/vnd.ibm.modcap
- text/plain
- image/svg+xml
- image/gif
- image/png
- image/tiff
- No, defaults to
- application/pdf
-
- outdir
- Output directory
- Required if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.)
-
-
- force
- Recreate target files, even if they are newer than their corresponding
- source files. Note: This attribute is available in post-0.20.5
- versions (0.20.x nightly build and 1.0dev) only; target files are
- always generated (i.e., force=true) in 0.20.5 release.
-
- No, default is
- false
-
- basedir
- Base directory to resolve relative references (e.g., graphics files) within the
- FO document.
-
- No, for single FO File entry, default is to use the location
- of that FO file.
-
-
-
- relativebase
- For fileset usage only. A value of
- true
specifies using the location
- of each .fo file as the base directory for resolving relative file references located
- within that .fo file. A value of false
specifies using the value of
- basedir for all files within the fileset, or just the current working directory
- if basedir is not specified.
- No, default is
- false
.
-
-
- userconfig
- User configuration file (same as the FOP "-c" command line option).
- No
-
-
- messagelevel
- Logging level
-
- Possible values: error
, warn
, info
, verbose
, debug
. Currently doesn't work in FOP Trunk!!!No, defaults to
- verbose
-
- logFiles
- Controls whether the names of the files that are processed are logged
- (
- true
) or not (false
). Currently doesn't work in FOP Trunk!!!No, default is
- true
-
-
- Attribute
- Description
- Required
-
-
- fileset
- FileSets
- are used to specify multiple XSL-FO files to be rendered.
- Yes, if no fofile attribute is supplied
-
-
-
-
- {fop-dir}/conf/fop.xconf
to a location of your choice, and then to
- edit it according to your needs.
- It contains templates for the various configuration options, most of which are commented
- out. Remove the comments and change the settings for entries that you wish to use.
- Be sure to follow any instructions, including comments which specify the value range.
- Also, since the configuration file is XML, be sure to keep it well-formed.
-
-
-
-
-
-
- Element
- Data Type (for the value)
- Default Value
-
-
- base
- URL or directory
- Specifies the base URL based on which relative URL will be resolved.
-
-
- font-base
- URL or directory
- Specifies the base URL based on which relative font URLs will be resolved.
- If not specified defaults to the base URL above.
-
-
-
- hyphenation-base
- URL or directory
- Specifies the base URL based on which relative URLs to hyphenation pattern
- files will be resolved. If not specified, support for user-supplied hyphenation
- patterns remains disabled.
-
-
-
- source-resolution
- Integer, dpi
-
- Resolution in dpi (dots per inch) which is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information.
-
-
-
- target-resolution
- Integer, dpi
-
- Resolution in dpi (dots per inch) used to specify the output resolution for bitmap
- images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps
- generated by Apache Batik for filter effects and such.
-
-
-
- strict-validation
- Boolean (true, false)
-
- Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity,
- for example, you're allowed to specify a border on a region-body which is supported
- by some FO implementations but is non-standard. Note that such a border would
- currently have no effect in Apache FOP.
-
-
- break-indent-inheritance
- Boolean (true, false)
-
- Setting this option to 'true' causes FOP to use an alternative rule set to determine
- text indents specified through margins, start-indent and end-indent. Many commercial
- FO implementations have chosen to break the XSL specification in this aspect. This
- option tries to mimic their behaviour. Please note that Apache FOP may still not
- behave exactly like those implementations either because FOP has not fully matched
- the desired behaviour and because the behaviour among the commercial implementations
- varies. The default for this option (i.e. false) is to behave exactly like the
- specification describes.
-
-
- default-page-settings
- n/a
-
- Specifies the default width and height of a page if "auto" is specified
- for either or both values. Use "height" and "width" attributes on the
- default-page-settings element to specify the two values.
-
-
- renderers
- (see text below)
- Contains the configuration for each renderer. See below.
-
-
-
- schema
element:
-
--d
). This makes FOP report which configuration
-information it finds. Check if FOP finds what you expect.
-
- transform()
method returns FOP will also have finished converting
- the FO file to a PDF file and you can close the OutputStream.
- getDefaultHandler()
to obtain a SAX
- DefaultHandler instance to which you can send the SAX events making up the XSL-FO
- document you'd like to render. FOP processing starts as soon as the DefaultHandler's
- startDocument()
method is called. Processing stops again when the
- DefaultHandler's endDocument()
method is called. Please refer to the basic
- usage pattern shown above to render a simple XSL-FO document.
-
-
- Source src = new StreamSource("http://localhost:8080/testfile.xml");
- Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));
- Source src = new StreamSource(new StringReader(myString)); // myString is a String
- Source src = new StreamSource(new MyInputStream(something));
- Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here
- Source src = new DOMSource(myDocument); // myDocument is a Document or a Node
-
-
-
-
- java.awt
that
- intialise the Java AWT classes. This means that a daemon thread
- is created by the JVM and on Unix it will need to connect to a
- DISPLAY.
- System.exit()
. These
- issues should be fixed in the JDK 1.4.
- Fop.getResults()
. This returns a FormattingResults
object
- where you can look up the number of pages produced. It also gives you the
- page-sequences that were produced along with their id attribute and their
- numbers of pages. This is particularly useful if you render multiple
- documents (each enclosed by a page-sequence) and have to know the number of
- pages of each document.
-
-
- out = new java.io.BufferedOutputStream(out);
-
- Make sure you properly close the OutputStream when FOP is finished.
- Templates
object and reuse it each time you do
- the XSL transformation. (More information can be found
- here.)
- http://xml.apache.org/fop/extensions
to the root element:
- fox:outline
element
- which was used to create outlines in PDF files. The redesigned code makes use
- of the new bookmark feature defined in the latest XSL 1.1 working draft.
-
-
-
-
- Renderer
- Base-14
- AWT/OS
- Custom
- Custom Embedding
-
-
- PDF
- yes
- no
- yes
- yes
-
-
-
- PostScript
- yes
- no
- yes
- yes
-
-
- TXT
- yes (used for layout but not for output)
- no
- yes (used for layout but not for output)
- no
-
-
- AWT
- if available from OS
- yes
- yes
- n/a (display only)
-
-
- Print
- if available from OS
- yes
- yes
- controlled by OS printer driver
-
-
- RTF
- n/a (font metrics not needed)
- n/a
- n/a
- n/a
-
-
- MIF
- n/a (font metrics not needed)
- n/a
- n/a
- n/a
-
-
- SVG
- if available from OS
- yes
- no
- no
-
-
- XML
- yes
- no
- yes
- n/a
-
-
-
-
-
-
-
-
-
-
- Issue
- WinAnsi
- CID-keyed
-
-
- Usable Character Set
- Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.
- Limited only by the characters in the font itself.
-
-
- Embedding the Font
- Optional.
- Mandatory. Not embedding the font produces invalid PDF documents.
-
-
-
-
-
-
-
- Format
- Type
- FOP native support
- Batik SVG
- Batik codecs
- Image I/O
- JAI
- JIMI
-
-
- BMP (Microsoft Windows Bitmap)
- bitmap
- X
-
-
-
-
-
-
-
- EPS (Encapsulated PostScript)
- metafile (both bitmap and vector), probably most frequently used for vector drawings
- (X)
-
-
-
-
-
-
-
- GIF (Graphics Interchange Format)
- bitmap
- X
-
-
- X
- X
- X
-
-
- JPEG (Joint Photographic Experts Group)
- bitmap
- (X)
-
-
-
-
-
-
-
- PNG (Portable Network Graphic)
- bitmap
-
-
- X
-
-
-
-
-
- SVG (Scalable Vector Graphics)
- vector (with embedded bitmaps)
-
- X
-
-
-
-
-
-
- TIFF (Tag Image Format File)
- bitmap
- (X)
-
- X
-
- X
-
-
-
-
- -Djava.awt.headless=true
command line option.
-
- fo:instream-foreign-object
or in a separate
-file referenced with fo:external-graphic
.
-
-
-
-
-
-
-
- {fop-dir}/hyph/hyphenation.dtd
.languageCode_countryCode.xml
. The country code is
- optional, and should be used only if needed. For example:
-
-
- The language and country codes must match the XSL-FO input, which
- follows ISO
- 639 (languages) and ISO
- 3166 (countries). NOTE: The ISO 639/ISO 3166 convention is that
- language names are written in lower case, while country codes are written
- in upper case. FOP does not check whether the language and country specified
- in the FO source are actually from the current standard, but it relies
- on it being two letter strings in a few places. So you can make up your
- own codes for custom hyphenation patterns, but they should be two
- letter strings too (patches for proper handling extensions are welcome)en_US.xml
would be the file name for American
- English hyphenation patterns.it.xml
would be the file name for Italian
- hyphenation patterns.
-
- {fop-dir}/lib
directory, or
- in a directory of your choice (and append the full path to the JAR to
- the environment variable FOP_HYPHENATION_PATH
).
-
- and run Ant with build target
- {fop-dir}/hyph
, user.hyph.dir
to point to that directory (in
- build-local.properties
),jar-hyphenation
. This will create a JAR containing the
- compiled patterns in {fop-dir}/build
that will be added to the
- classpath on the next run.
- (When FOP is built from scratch, and there are pattern source file(s)
- present in the directory pointed to by the
- user.hyph.dir
variable, this JAR will automatically
- be created from the supplied pattern(s)).
-
-
-
- This element is unused and not even read. It should be considered a
- documentation for parameters used during pattern generation.
-
-
- Here are some examples from the English patterns file:
-
-
- Note that the algorithm that uses this data searches for each of the word's substrings in the patterns, and chooses the highest value found for letter combination.
- examples/embedding
- directory in the FOP distribution
- endDocument()
on the AreaTreeModel. This lets the Renderer know that the processing
- is now finished.
- setTransformerHandler()
on
- XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would like to
- do custom serialization (to a W3C DOM, for example) and/or to directly modify the area tree using
- XSLT. The AreaTreeParser on the other side allows you to retrieve a ContentHandler instance where
- you can manually send SAX events to to start the parsing process (see getContentHandler()
).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -o
option. This
- password is actually used as encryption key. Many tools for
- PDF processing ask for this password to disregard any
- restriction imposed on the PDF document.
- -u
option, will
- cause the PDF display software to ask the reader for this password in
- order to view the contents of the document. If no user password was
- supplied, viewing the content is not restricted.
- -noprint
,
- -nocopy
, -noedit
and
- -noannotations
options, which disable printing, copying
- text, editing in Adobe Acrobat and making annotations, respectively.
-
-
-
-
- Option
- Description
- Values
- Default
-
-
- ownerPassword
- The owner password
- String
-
-
-
- userPassword
- The user password
- String
-
-
-
- allowPrint
- Allows/disallows printing of the PDF
- "TRUE" or "FALSE"
- "TRUE"
-
-
- allowCopyContent
- Allows/disallows copy/paste of content
- "TRUE" or "FALSE"
- "TRUE"
-
-
- allowEditContent
- Allows/disallows editing of content
- "TRUE" or "FALSE"
- "TRUE"
-
-
- allowEditAnnotations
- Allows/disallows editing of annotations
- "TRUE" or "FALSE"
- "TRUE"
-
-
-
-
-
-
- fop.sh
. If you have JDK 1.3 or earlier don't forget to
- install the JCE as well.
- java.security
file and add
- security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider
,
- preferably at the end of the block defining the other crypto
- providers. For JDK 1.4 this is detailed on Sun's web site.
-
-
-
-
-
-
-
-
-
-
- .gz
file that is the
- distribution medium, then unarchiving the resulting .tar
file in a
- directory/folder that is convenient on your system. Please consult your operating system
- documentation or Zip application software documentation for instructions specific to your
- site.
- tar -xzf
instead.
- /Library/Java/Home
. Caveat:
- We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum
- Java requirements, the two will inevitably not match on some systems. Please see
- Java on Mac OSX FAQ for information as
- it becomes available.
- org.apache.fop.cli.Main
. The general pattern for the
- command line is: java -classpath <CLASSPATH>
- org.apache.fop.cli.Main <arguments>
. The arguments
- consist of the options and infile and outfile specifications
- as shown above for the standard scripts. You may wish to review
- the standard scripts to make sure that
- you get your environment properly configured.
- -jar
optionjava
- -jar path/to/build/fop.jar <arguments>
, relying on
- FOP to build the classpath for running FOP dynamically, see below. If you use hyphenation,
- you must put fop-hyph.jar
in the lib
- directory.
- java -jar path/to/fop.jar
- <arguments>
, relying on the Class-Path
- entry in the manifest file. This works if you put
- fop.jar
and all jar files from the lib
- directory in a single directory. If you use hyphenation, you
- must also put fop-hyph.jar
in that directory.build
, then its parent
- directory becomes the base directory.fop.jar
in the
- build
subdirectory of the base directory, and
- adds it to the classpath. Subsequently FOP adds all
- jar
files in the lib directory to the
- classpath. The lib directory is either the lib
- subdirectory of the base directory, or, if that does not
- exist, the base directory itself.fop.optional.lib
- contains the name of a directory, then all jar
- files in that directory are also added to the classpath. See
- the methods getJARList
and
- checkDependencies
in
- org.apache.fop.cli.Main
.java org.apache.xalan.xslt.Process -IN xmlfile -XSL file -OUT outfile
-
-
-
-
-
- Source
instance used above is simply an
- example. If you have to read the XML from a string, supply
- a new StreamSource(new
- StringReader(xmlstring))
. Constructing and reparsing
- an XML string is generally less desirable than using a
- SAXSource if you generate your XML. You can alternatively
- supply a DOMSource as well. You may also use dynamically
- generated XSL if you like.
- Transformer
object, you can also use it to
- explicitely set parameters for the transformation run.
-
-
- org.apache.commons.io.output.ByteArrayOutputStream
-
-
- .pdf
, like
- http://myserver/servlet/stuff.pdf
. Yes, the servlet can
- be configured to handle this. If the URL has to contain parameters,
- try to have both the base URL as well as the last parameter end in
- .pdf
, if necessary append a dummy parameter, like
- http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf
. The
- effect may depend on IEx version.
- Expires
header entry may help in
- this case:
response.setDateHeader("Expires",
- System.currentTimeMillis() + cacheExpiringDuration *
- 1000);
Consult your server manual and the
- relevant RFCs for further details on HTTP headers and
- caching.
-
-
- fo:table-cell
elements, the new code
- will complain about that (unless relaxed validation is enabled) because the specification
- demands at least one block-level element ((%block;)+
, see
- XSL-FO 1.0, 6.7.10)
- inside an fo:table-cell
element.
-
-
- <fo:table-cell></fo:table-cell>
- are not allowed by the specification. The same applies to empty static-content
- and block-container
elements, for example.
- external-graphic
)
- or instream-foreign-object
- objects. If images or SVGs are sized differently in your outputs with the new FOP version
- check Bug 37136
- as it contains some hints on what to do. The file
-
- "examples/fo/basic/images.fo"
has
- a number of good examples that show the new, more correct behaviour.
- fox:outline
extension is not implemented in this version anymore.
- It has been superseded by the new bookmark elements from XSL-FO 1.1.
- fox:destination
extension is also not implemented in this version
- although it may be added in the future. See also
- Bug 37157.
-
This fifth release contains many bug fix release and new features compared - to 0.92beta. To see what has changed since the last release, please visit the + to 0.93. To see what has changed since the last release, please visit the Changes Page and the Release Notes.
diff --git a/src/documentation/content/xdocs/0.95/anttask.xml b/src/documentation/content/xdocs/0.95/anttask.xml new file mode 100644 index 000000000..44550c3d7 --- /dev/null +++ b/src/documentation/content/xdocs/0.95/anttask.xml @@ -0,0 +1,197 @@ + + + + ++ Apache FOP provides an Ant task for automating the document build process. +
++ The FOP Ant task will convert XSL-FO documents to PDF, PS, PCL etc. output + (see Output formats for available formats). +
++ To call FOP tasks within Ant, first add a FOP task definition to your Ant build file. + One method of defining the task is as follows: +
++ Then create FOP tasks within your Ant build file, using the FOP task parameters listed below.
+Attribute | +Description | +Required | +
---|---|---|
fofile | +XSL-FO file to be rendered | +Yes, if no fileset nested element is used | +
outfile | +Output filename | +Yes, when fofile is used. (This attribute is not valid for filesets.) | +
format | +Possible output formats: + application/X-fop-awt-preview + application/X-fop-print + application/X-fop-areatree + application/pdf + application/postscript + application/mif + application/rtf ,
+ text/richtext ,
+ text/rtf + application/x-pcl ,
+ application/vnd.hp-PCL + application/x-afp ,
+ application/vnd.ibm.modcap + text/plain + image/svg+xml + image/gif + image/png + image/tiff + |
+ No, defaults to application/pdf |
+
outdir | +Output directory | +Required if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.) | +
force | +Recreate target files, even if they are newer than their corresponding + source files. Note: This attribute is available in post-0.20.5 + versions (0.20.x nightly build and 1.0dev) only; target files are + always generated (i.e., force=true) in 0.20.5 release. + | +No, default is false |
+
basedir | +Base directory to resolve relative references (e.g., graphics files) within the + FO document. + | +No, for single FO File entry, default is to use the location + of that FO file. + | +
relativebase | +For fileset usage only. A value of true specifies using the location
+ of each .fo file as the base directory for resolving relative file references located
+ within that .fo file. A value of false specifies using the value of
+ basedir for all files within the fileset, or just the current working directory
+ if basedir is not specified.
+ |
+ No, default is false .
+ |
+
userconfig | +User configuration file (same as the FOP "-c" command line option). | +No | +
messagelevel | +Logging level + Possible values: error , warn , info , verbose , debug . Currently doesn't work in FOP Trunk!!! |
+ No, defaults to verbose |
+
logFiles | +Controls whether the names of the files that are processed are logged
+ (true ) or not (false ). Currently doesn't work in FOP Trunk!!! |
+ No, default is true |
+
Attribute | +Description | +Required | +
---|---|---|
fileset | +FileSets + are used to specify multiple XSL-FO files to be rendered. | +Yes, if no fofile attribute is supplied | +
+ The following example converts a single XSL-FO file to a PDF document: +
+ ++ This example converts all XSL-FO files within an entire directory to PostScript: +
++ FOP distributions are either pre-compiled binary or source. + If you are using a binary distribution, it is already built and there is no need to build it again. + See the Download Instructions for information about whether a + binary or source distribution is best for your needs. +
++ If you got the source code from a repository snapshot or via Subversion you will need to build FOP + in any case. +
++ Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.4 + (A Java Runtime Environment is not sufficient). +
++ There is generally no need to setup a classpath. All libraries needed to compile FOP are included + in the source distribution and are referenced by the build script. + You will only need to adjust the classpath if you build FOP in some other way. See the build + script build.xml for details. +
++ The build script uses Apache Ant, a popular + Java-based build tool, which usually requires that the environment variable JAVA_HOME point to + your local JDK root directory. This is true even if you use JDK 1.4 or above, which normally + does not need this setting. +
++ Apache Ant must be installed in order to + build FOP. Following best practices we don't include Ant with FOP anymore. You can find the + instructions to install Ant in the Ant manual on the web. +
++ Change to the FOP root directory and build FOP by executing the build script (build.xml) + using the "ant" command. +
++ The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It + contains information for numerous build targets, many of which are building blocks to more + useful target, and others which are primarily used by the FOP developers. + You may benefit from looking through this file to learn more about the various build targets. + To obtain a complete list of useful build targets: +
+The most useful targets are:
+To run the build:
+For example to do a normal build for the "all" target (which is the default):
+OR
+To clean the build directory first:
+If you have problems building FOP, please try the following:
++ The FOP configuration file is an XML file containing a variety of settings that are useful + for controlling FOP's behavior, and for helping it find resources that you wish it to use. +
+
+ The easiest way to get started using a FOP configuration file is to copy the sample found
+ at {fop-dir}/conf/fop.xconf
to a location of your choice, and then to
+ edit it according to your needs.
+ It contains templates for the various configuration options, most of which are commented
+ out. Remove the comments and change the settings for entries that you wish to use.
+ Be sure to follow any instructions, including comments which specify the value range.
+ Also, since the configuration file is XML, be sure to keep it well-formed.
+
After creating your configuration file, you must tell FOP how to find it:
++ See Setting the Configuration Programmatically + for instructions on how to do so in an embedded environment. +
+Element | +Data Type (for the value) | +Description | +Default Value | +
---|---|---|---|
base | +URL or directory | +Specifies the base URL based on which relative URL will be resolved. | +current directory | +
font-base | +URL or directory | +Specifies the base URL based on which relative font URLs will be resolved. + | +base URL/directory (above) | +
hyphenation-base | +URL or directory | +Specifies the base URL based on which relative URLs to hyphenation pattern + files will be resolved. If not specified, support for user-supplied hyphenation + patterns remains disabled. + | +disabled | +
source-resolution | +Integer, dpi | ++ Resolution in dpi (dots per inch) which is used internally to determine the pixel + size for SVG images and bitmap images without resolution information. + | +72 dpi | +
target-resolution | +Integer, dpi | ++ Resolution in dpi (dots per inch) used to specify the output resolution for bitmap + images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps + generated by Apache Batik for filter effects and such. + | +72 dpi | +
strict-configuration | +Boolean (true, false) | ++ Setting this option to 'true' will cause FOP to strictly verify the contents of the + FOP configuration file to ensure that defined resources (such as fonts and base + URLs/directories) are valid and available to FOP. Any errors found will cause FOP to + immediately raise an exception. | +false | +
strict-validation | +Boolean (true, false) | ++ Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity, + for example, you're allowed to specify a border on a region-body which is supported + by some FO implementations but is non-standard. Note that such a border would + currently have no effect in Apache FOP. | +true | +
break-indent-inheritance | +Boolean (true, false) | ++ Setting this option to 'true' causes FOP to use an alternative rule set to determine + text indents specified through margins, start-indent and end-indent. Many commercial + FO implementations have chosen to break the XSL specification in this aspect. This + option tries to mimic their behaviour. Please note that Apache FOP may still not + behave exactly like those implementations either because FOP has not fully matched + the desired behaviour and because the behaviour among the commercial implementations + varies. The default for this option (i.e. false) is to behave exactly like the + specification describes. | +false | +
default-page-settings | +n/a | ++ Specifies the default width and height of a page if "auto" is specified + for either or both values. Use "height" and "width" attributes on the + default-page-settings element to specify the two values. | +"height" 11 inches, "width" 8.26 inches | +
use-cache | +boolean (true, false) | +All fonts information that has been gathered as a result of "directory" + or "auto-detect" font configurations will be cached for future rendering runs. + This setting should improve performance on systems where + fonts have been configured using the "directory" or "auto-detect" tag mechanisms. + By default this option is switched on. | +true | +
cache-file | +String | +This options specifies the file/directory path of the fop cache file. + This option can also be specified on the command-line using the -cache option. + This file is currently only used to cache font triplet information for future reference. | +${base}/conf/fop.cache | +
renderers | +(see text below) | +Contains the configuration for each renderer. See below. | +N/A | +
+ This is an excerpt from the example configuration file coming with FOP: +
++ Each Renderer has its own configuration section which is identified by the + MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer. +
++ The configuration for the PDF Renderer could look like this: +
++ The details on the font configuration can be found on the separate Fonts page. + Note especially the section entitled Register Fonts with FOP. +
++ The configuration element for the PDF renderer contains two elements. One is for the font configuration + (please follow the link above) and one is for the "filter list". The filter list controls how the + individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply + compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that + setting. For debugging purposes, it may be desired not to compress the internal objects at all so the + generated PDF commands can be read. In that case, you can simply use the following filter list. The + second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded + so the produced PDF file is still easily readable in a text editor. +
++ Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC + color profile which indicates the target color space the PDF file is generated for. This + setting is mainly used in conjunction with the PDF/X feature. + An example: +
++ Some people don't have high requirements on color fidelity but instead want the smallest + PDF file sizes possible. In this case it's possible to disable the default sRGB color space + which XSL-FO requires. This will cause RGB colors to be generated as device-specific RGB. + Please note that this option is unavailable (and will cause an error) if you enable + PDF/A or PDF/X functionality or if you specify an output profile. This setting will make the + PDF about 4KB smaller. To disable the sRGB color space add the following setting: +
++ Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript + renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into + the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false". + Example: +
++ Non-standard fonts for the PCL renderer are made available through the Java2D subsystem which means that + you don't have to do any custom font configuration in this case but you have to use the font names + offered by Java. +
++ Additionally, there are certain settings that control how the renderer handles various elements. +
++ The default value for the "rendering" setting is "speed" which causes borders + to be painted as plain rectangles. In this mode, no special borders (dotted, + dashed etc.) are available. If you want support for all border modes, set the + value to "quality" as indicated above. This will cause the borders to be painted + as bitmaps. +
++ The default value for the "text-rendering" setting is "auto" which paints the + base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D. + If the mix of painting methods results in unwelcome output, you can set this + to "bitmap" which causes all text to be rendered as bitmaps. +
+FOP searches the configuration file for the information it +expects, at the position it expects. When that information is not +present, FOP will not complain, it will just continue. When there is +other information in the file, FOP will not complain, it will just +ignore it. That means that when your configuration information is in +the file but in a different XML element, or in a different XML path, +than FOP expects, it will be silently ignored.
+ +Check the following possibilities:
+ +schema
element:
+
+-d
). This makes FOP report which configuration
+information it finds. Check if FOP finds what you expect.+ Review Running FOP for important information that applies + to embedded applications as well as command-line use, such as options and performance. +
++ To embed Apache FOP in your application, first create a new + org.apache.fop.apps.FopFactory instance. This object can be used to launch multiple + rendering runs. For each run, create a new org.apache.fop.apps.Fop instance through + one of the factory methods of FopFactory. In the method call you specify which output + format (i.e. Renderer) to use and, if the selected renderer requires an OutputStream, + which OutputStream to use for the results of the rendering. You can customize FOP's + behaviour in a rendering run by supplying your own FOUserAgent instance. The + FOUserAgent can, for example, be used to set your own Renderer instance (details + below). Finally, you retrieve a SAX DefaultHandler instance from the Fop object and + use that as the SAXResult of your transformation. +
++ Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO + input document. It is therefore a good idea that you know a few things about JAXP (which + is a good skill anyway). Let's look at the basic usage pattern for FOP... +
+Here is the basic pattern to render an XSL-FO file to PDF: +
++ Let's discuss these 5 steps in detail: +
+transform()
method returns FOP will also have finished converting
+ the FO file to a PDF file and you can close the OutputStream.
+ + If you're not totally familiar with JAXP Transformers, please have a look at the + Embedding examples below. The section contains examples + for all sorts of use cases. If you look at all of them in turn you should be able + to see the patterns in use and the flexibility this approach offers without adding + too much complexity. +
++ This may look complicated at first, but it's really just the combination of an + XSL transformation and a FOP run. It's also easy to comment out the FOP part + for debugging purposes, for example when you're tracking down a bug in your + stylesheet. You can easily write the XSL-FO output from the XSL transformation + to a file to check if that part generates the expected output. An example for that + can be found in the Embedding examples (See "ExampleXML2FO"). +
++ Logging is now a little different than it was in FOP 0.20.5. We've switched from + Avalon Logging to Jakarta Commons Logging. + While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves + its logger(s) through a statically available LogFactory. This is similar to the + general pattern that you use when you work with Apache Log4J directly, for example. + We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging" + (Avalon Logging). This has a consequence: You can't give FOP a logger for each + processing run anymore. The log output of multiple, simultaneously running FOP instances + is sent to the same logger. +
++ By default, Jakarta Commons Logging uses + JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons + Logging to use an alternative backend, for example Log4J. Please consult the + documentation for Jakarta Commons Logging on + how to configure alternative backends. +
+
+ Once the Fop instance is set up, call getDefaultHandler()
to obtain a SAX
+ DefaultHandler instance to which you can send the SAX events making up the XSL-FO
+ document you'd like to render. FOP processing starts as soon as the DefaultHandler's
+ startDocument()
method is called. Processing stops again when the
+ DefaultHandler's endDocument()
method is called. Please refer to the basic
+ usage pattern shown above to render a simple XSL-FO document.
+
+ If you want to process XSL-FO generated from XML using XSLT we recommend + again using standard JAXP to do the XSLT part and piping the generated SAX + events directly through to FOP. The only thing you'd change to do that + on the basic usage pattern above is to set up the Transformer differently: +
++ The input XSL-FO document is always received by FOP as a SAX stream (see the + Parsing Design Document for the rationale). +
++ However, you may not always have your input document available as a SAX stream. + But with JAXP it's easy to convert different input sources to a SAX stream so you + can pipe it into FOP. That sounds more difficult than it is. You simply have + to set up the right Source instance as input for the JAXP transformation. + A few examples: +
+Source src = new StreamSource("http://localhost:8080/testfile.xml");
+ Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));
+ Source src = new StreamSource(new StringReader(myString)); // myString is a String
+ Source src = new StreamSource(new MyInputStream(something));
+ Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here
+ Source src = new DOMSource(myDocument); // myDocument is a Document or a Node
+ + There are a variety of upstream data manipulations possible. + For example, you may have a DOM and an XSL stylesheet; or you may want to + set variables in the stylesheet. Interface documentation and some cookbook + solutions to these situations are provided in + Xalan Basic Usage Patterns. +
++ Apache FOP provides two levels on which you can customize FOP's + behaviour: the FopFactory and the user agent. +
++ The FopFactory holds configuration data and references to objects which are reusable over + multiple rendering runs. It's important to instantiate it only once (except in special + environments) and reuse it every time to create new FOUserAgent and Fop instances. +
++ You can set all sorts of things on the FopFactory: +
++ The font base URL to use when resolving relative URLs for fonts. Example: +
++ The hyphenation base URL to use when resolving relative URLs for + hyphenation patterns. Example: +
++ Disable strict validation. When disabled FOP is less strict about the rules + established by the XSL-FO specification. Example: +
++ Enable an alternative set of rules for text indents that tries to mimic the behaviour of many commercial + FO implementations, that chose to break the specification in this respect. The default of this option is + 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the + alternative behaviour, call: +
++ Set the source resolution for the document. This is used internally to determine the pixel + size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example: +
++ Manually add an ElementMapping instance. If you want to supply a special FOP extension + you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected + (see the documentation on extension for more info). Example: +
++ Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add + custom URI resolution functionality to FOP. For example, you can use + Apache XML Commons Resolver to make use of XCatalogs. Example: +
++ The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single + document. If you wish to customize the user agent's behaviour, the first step is to create your own instance + of FOUserAgent using the appropriate factory method on FopFactory and pass that + to the factory method that will create a new Fop instance: +
++ You can do all sorts of things on the user agent: +
++ The base URL to use when resolving relative URLs. Example: +
++ Set the producer of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example: +
++ Set the creating user of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +
++ Set the author of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +
++ Override the creation date and time of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +
++ Set the title of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +
++ Set the keywords of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +
++ Set the target resolution for the document. This is used to + specify the output resolution for bitmap images generated by bitmap renderers + (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter + effects and such. Default: 72 dpi. Example: +
++ Set your own Renderer instance. If you want to supply your own renderer or + configure a Renderer in a special way you can give the instance to the FOUserAgent. Normally, + the Renderer instance is created by FOP. Example: +
++ Set your own FOEventHandler instance. If you want to supply your own FOEventHandler or + configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally, + the FOEventHandler instance is created by FOP. Example: +
++ Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add + custom URI resolution functionality to FOP. For example, you can use + Apache XML Commons Resolver to make use of XCatalogs. Example: +
++ Instead of setting the parameters manually in code as shown above you can also set + many values from an XML configuration file: +
++ The layout of the configuration file is described on the Configuration page. +
++ Fop instances shouldn't (and can't) be reused. Please recreate + Fop and FOUserAgent instances for each rendering run using the FopFactory. + This is a cheap operation as all reusable information is held in the + FopFactory. That's why it's so important to reuse the FopFactory instance. +
+
+ If your XSL-FO files contain SVG then Apache Batik will be used. When Batik is
+ initialised it uses certain classes in java.awt
that
+ intialise the Java AWT classes. This means that a daemon thread
+ is created by the JVM and on Unix it will need to connect to a
+ DISPLAY.
+
+ The thread means that the Java application may not automatically quit
+ when finished, you will need to call System.exit()
. These
+ issues should be fixed in the JDK 1.4.
+
+ If you run into trouble running FOP on a head-less server, please see the + notes on Batik. +
+
+ To get the number of pages that were rendered by FOP you can call
+ Fop.getResults()
. This returns a FormattingResults
object
+ where you can look up the number of pages produced. It also gives you the
+ page-sequences that were produced along with their id attribute and their
+ numbers of pages. This is particularly useful if you render multiple
+ documents (each enclosed by a page-sequence) and have to know the number of
+ pages of each document.
+
+ There are several options to consider: +
+out = new java.io.BufferedOutputStream(out);
+ Templates
object and reuse it each time you do
+ the XSL transformation. (More information can be found
+ here.)
+ + Apache FOP may currently not be completely thread safe. + The code has not been fully tested for multi-threading issues, yet. + If you encounter any suspicious behaviour, please notify us. +
++ There is also a known issue with fonts being jumbled between threads when using + the Java2D/AWT renderer (which is used by the -awt and -print output options). + In general, you cannot safely run multiple threads through the AWT renderer. +
++ The directory "{fop-dir}/examples/embedding" contains several working examples. +
+This + + example +demonstrates the basic usage pattern to transform an XSL-FO +file to PDF using FOP. +
+This + + example +has nothing to do with FOP. It is there to show you how an XML +file can be converted to XSL-FO using XSLT. The JAXP API is used to do the +transformation. Make sure you've got a JAXP-compliant XSLT processor in your +classpath (ex. Xalan). +
+This + + example +demonstrates how you can convert an arbitrary XML file to PDF +using XSLT and XSL-FO/FOP. It is a combination of the first two examples +above. The example uses JAXP to transform the XML file to XSL-FO and FOP to +transform the XSL-FO to PDF. +
++The output (XSL-FO) from the XSL transformation is piped through to FOP using +SAX events. This is the most efficient way to do this because the +intermediate result doesn't have to be saved somewhere. Often, novice users +save the intermediate result in a file, a byte array or a DOM tree. We +strongly discourage you to do this if it isn't absolutely necessary. The +performance is significantly higher with SAX. +
+This + + example +is a preparatory example for the next one. It's an example that +shows how an arbitrary Java object can be converted to XML. It's an often +needed task to do this. Often people create a DOM tree from a Java object and +use that. This is pretty straightforward. The example here, however, shows how +to do this using SAX, which will probably be faster and not even more +complicated once you know how this works. +
++For this example we've created two classes: ProjectTeam and ProjectMember +(found in xml-fop/examples/embedding/java/embedding/model). They represent +the same data structure found in +xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a +project team with several members which exist as Java objects. +Therefore we created the two classes: ProjectTeamInputSource and +ProjectTeamXMLReader (in the same place as ProjectTeam above). +
++The XMLReader implementation (regard it as a special kind of XML parser) is +responsible for creating SAX events from the Java object. The InputSource +class is only used to hold the ProjectTeam object to be used. +
++Have a look at the source of ExampleObj2XML.java to find out how this is +used. For more detailed information see other resources on JAXP (ex. +An older JAXP tutorial). +
+This + + example +combines the previous and the third to demonstrate +how you can transform a Java object to a PDF directly in one smooth run +by generating SAX events from the Java object that get fed to an XSL +transformation. The result of the transformation is then converted to PDF +using FOP as before. +
+This + + example +has FOP use a DOMSource instead of a StreamSource in order to +use a DOM tree as input for an XSL transformation. +
+This + + example +shows the usage of the PDF Transcoder, a sub-application within FOP. +It is used to generate a PDF document from an SVG file. +
++These examples should give you an idea of what's possible. It should be easy +to adjust these examples to your needs. Also, if you have other examples that you +think should be added here, please let us know via either the fop-users or fop-dev +mailing lists. Finally, for more help please send your questions to the fop-users +mailing list. +
++ By "extension", we mean any data that can be placed in the input XML document that + is not addressed by the XSL-FO standard. + By having a mechanism for supporting extensions, FOP is able to add features that + are not covered in the specification. +
++ The extensions documented here are included with FOP, and are automatically available + to you. If you wish to add an extension of your own to FOP, please see the + Developers' Extension Page. +
++ Please see the SVG documentation for more details. +
+
+ By convention, FO extensions in FOP use the "fox" namespace prefix.
+ To use any of the FO extensions, add a namespace entry for
+ http://xml.apache.org/fop/extensions
to the root element:
+
+ In previous versions of Apache FOP there was a fox:outline
element
+ which was used to create outlines in PDF files. The redesigned code makes use
+ of the new bookmark feature defined in the latest XSL 1.1 working draft.
+
Use the fox:destination element to define "named destinations" inside a PDF document. +These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name". +fox:destination elements can be placed almost anywhere in the fo document, including a child of +root, a block-level element, or an inline-level element. +For the destination to actually work, it must correspond to an "id" attribute on some fo element +within the document. In other words, the "id" attribute actually creates the "view" within the +PDF document. The fox:destination simply gives that view an independent name. +
+This extension element hasn't been reimplemented for the redesigned code, yet.
+ ++ The two proprietary extension properties, fox:orphan-content-limit and + fox:widow-content-limit, are used to improve the layout of list-blocks and tables. + If you have a table with many entries, you don't want a single row to be left over + on a page. You will want to make sure that at least two or three lines are kept + together. The properties take an absolute length which specifies the area at the + beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a + table or list-block. The properties are inherited and only have an effect on fo:table + and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure + the you'll have at least three lines (assuming line-height="1.2") together on a table + or list-block. +
+
+ This is a proprietary extension element which allows to add whole images as pages to
+ an FO document. For example, if you have a scanned document or a fax as multi-page TIFF
+ file, you can append or insert this document using the fox:external-document
+ element. Each page of the external document will create one full page in the target
+ format.
+
+ The fox:external-document
element is structurally a peer to
+ fo:page-sequence
, so wherever you can put an fo:page-sequence
+ you could also place a fox:external-document
.
+ Therefore, the specified contents for fo:root
change to:
+
+
+ (layout-master-set, declarations?, bookmark-tree?, (page-sequence|page-sequence-wrapper|fox:external-document|fox:destination)+)
+
+
+ The fox:external-document
extension formatting object is used to specify
+ how to create a (sub-)sequence of pages within a document. The content of these pages
+ comes from the individual subimages/pages of an image or paged document (for example:
+ multi-page TIFF in the form of faxes or scanned documents, or PDF files). The
+ formatting object creates the necessary areas to display one image per page.
+
+ In terms of page numbers, the behaviour is the same as for
+ fo:page-sequence
. The placement of the image inside the page is similar
+ to that of fo:external-graphic
or fo:instream-foreign-object
,
+ i.e. the viewport (and therefore the page size) is defined by either the intrinsic
+ size of the image or by the size properties that apply to this formatting object.
+
Content: EMPTY
+The following properties apply to this formatting object:
++ Datatype "page-set": Value: auto | <integer-range>, + Default: "auto" which means all pages/subimages of the document. + <integer-range> allows values such as "7" or "1-3" +
+fox:external-document
is not suitable for concatenating FO documents.
+ For this, XInclude is recommended.
+
+ For fo:block-container
elements whose absolute-position
set to
+ "absolute" or "fixed" you can use the extension attribute fox:transform
+ to apply a free-form transformation to the whole block-container. The content of the
+ fox:transform
attribute is the same as for
+ SVG's transform attribute.
+ The transformation specified here is performed in addition to other implicit
+ transformations of the block-container (resulting from top, left and other properties)
+ and after them.
+
+ Examples: fox:transform="rotate(45)"
would rotate the block-container
+ by 45 degrees clock-wise around its upper-left corner.
+ fox:transform="translate(10000,0)"
would move the block-container to the
+ right by 10 points (=10000 millipoints, FOP uses millipoints internally!).
+
+ XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions. + Apache FOP provides additional color functions for special use cases. Please note that + using these functions compromises the interoperability of an FO document. +
+color cmyk(numeric, numeric, numeric, numeric)
+ This function will construct a color in device-specific CMYK color space. The numbers + must be between 0.0 and 1.0. For output formats that don't support device-specific + color space the CMYK value is converted to an sRGB value. +
+The following table summarizes the font capabilities of the various FOP renderers:
+Renderer | +Base-14 | +AWT/OS | +Custom | +Custom Embedding | +
---|---|---|---|---|
yes | +no | +yes | +yes | +|
PostScript | +yes | +no | +yes | +yes | +
PCL | +yes (modified) | +yes (painted as bitmaps) | +yes (painted as bitmaps) | +no | +
AFP | +no | +no | +yes | +yes | +
Java2D/AWT/Bitmap | +if available from OS | +yes | +yes | +n/a (display only) | +
if available from OS | +yes | +yes | +controlled by OS printer driver | +|
RTF | +n/a (font metrics not needed) | +n/a | +n/a | +n/a | +
TXT | +yes (used for layout but not for output) | +no | +yes (used for layout but not for output) | +no | +
XML | +yes | +no | +yes | +n/a | +
+ The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be + available to every PostScript interpreter and PDF reader: + Helvetica (normal, bold, italic, bold italic), + Times (normal, bold, italic, bold italic), + Courier (normal, bold, italic, bold italic), + Symbol and ZapfDingbats. +
++ Please note that recent versions of Adobe Acrobat Reader replace + "Helvetica" with "Arial" and "Times" with "Times New Roman" internally. + GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with + "Nimbus Roman No9 L". Other document viewers may do similar font + substitutions. If you need to make sure that there are no such + substitutions, you need to specify an explicit font and embed it in + the target document. +
++ When FOP does not have a specific font at its disposal (because it's + not installed in the operating system or set up in FOP's configuration), + the font is replaced with "any". "any" is internally mapped to the + Base-14 font "Times" (see above). +
++ The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the + Java AWT subsystem for font metric information. Through operating system + registration, the AWT subsystem knows what fonts are available on the system, + and the font metrics for each one. +
++ When working with one of these output formats and you're missing a font, just + install it in your operating system and they should be available for these + renderers. Please note that this is not true for other output formats such as + PDF or PostScript. +
++ Support for custom fonts is highly output format dependent (see above table). + This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and + Java2D-based renderers. Other renderers (like AFP) support other font formats. Details + in this case can be found on the page about output formats. +
++ Prior to FOP version 0.94, it was always necessary to create an XML font metrics file + if you wanted to add a custom font. This unconvenient step has been removed and in + addition to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts + installed in your operating system or can scan user-specified directories for fonts. + Font registration via XML font metrics file is still supported and is still necessary + if you want to use a TrueType Collection (*.ttc). Direct support for TrueType + collections may be added later. Furthermore, the XML font metrics files are still + required if you don't want to embed, but only reference a font. +
++ Basic information about fonts can be found at: +
+ ++ If you want FOP to use custom fonts, you need to tell it where to find them. This + is done in the configuration file and once per renderer (because each output format + is a little different). In the basic form, you can either tell FOP to find your + operating system fonts or you can specify directories that it will search for + support fonts. These fonts will then automatically be registered. +
++ The instructions found above should be sufficient for most users. Below are some + additional instructions in case the basic font configuration doesn't lead to + the desired results. +
+FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it. + To use it, run the class org.apache.fop.fonts.apps.PFMReader:
+Windows:
+Unix:
+PFMReader [options]:
+FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it. + Use it in a similar manner to PFMReader. + For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:
+TTFReader [options]:
+Issue | +WinAnsi | +CID-keyed | +
---|---|---|
Usable Character Set | +Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1. | +Limited only by the characters in the font itself. | +
Embedding the Font | +Optional. | +Mandatory. Not embedding the font produces invalid PDF documents. | +
TrueType collections (.ttc files) contain more than one font. + To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.
+To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option). + It will display all of the font names and exit with an Exception.
+Here is an example of generating a metrics file for a .ttc file:
+You must tell FOP how to find and use the font metrics files by registering them in the FOP Configuration. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:
+When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.
+FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:
+This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.
+Font embedding is enabled in the userconfig.xml file and controlled by the embed-url attribute. + If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced.
+When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font. + This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.
+When embedding PostScript fonts, the entire font is always embedded.
+When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the + original font, containing only the glyphs used, is embedded in the output document.
++ After the Apache FOP 0.94 release, the image handling subsystem has been rewritten in + order to improve the range of supported images and image subtypes, to lower the + overall memory consumption when handling images, to produce smaller output files and to + increase the performance in certain areas. Of course, this causes a few changes most of + which the user will probably not notice. The most important changes are: +
++ The actual image loading framework + no longer resides in Apache FOP, but was instead placed in + XML Graphics Commons. +
++ The table below summarizes the theoretical support for graphical formats + within FOP. In other words, within the constraints of the limitations listed here, + these formats should work. However, many of them have not been tested, + and there may be limitations that have not yet been discovered or documented. + The packages needed to support some formats are not included in the FOP distribution + and must be installed separately. Follow the links in the "Support Through" columns + for more details. +
+Format | +Type | +Support Through | +||
---|---|---|---|---|
Apache FOP (native) | +Apache Batik | +Image I/O | +||
BMP (Microsoft Windows Bitmap) | +bitmap | ++ | + | X [1] | +
EMF (Windows Enhanced Metafile) | +vector (with embedded bitmaps) | +(X) | ++ | + |
EPS (Encapsulated PostScript) | +metafile (both bitmap and vector), most frequently used for vector drawings | +(X) | ++ | + |
GIF (Graphics Interchange Format) | +bitmap | ++ | + | X | +
JPEG (Joint Photographic Experts Group) | +bitmap | +(X) | ++ | X | +
PNG (Portable Network Graphic) | +bitmap | ++ | + | X | +
SVG (Scalable Vector Graphics) | +vector (with embedded bitmaps) | ++ | X | ++ |
TIFF (Tag Image Format File) | +bitmap | +(X) | ++ | X [1] | +
WMF (Windows Metafile) | +vector (with embedded bitmaps) | ++ | (X) | ++ |
+ Legend: +
++ Not all image formats are supported for all output formats! For example, while you can + use EPS (Encapsulated PostScript) files when you generate PostScript output, this format + will not be supported by any other output format. Here's an overview of which image + formats are supported by which output format: +
+Image Format | +PostScript | +Java2D, PNG, TIFF, AWT | +PCL | +AFP | +RTF | +|
---|---|---|---|---|---|---|
BMP (Microsoft Windows Bitmap) | +X | +X | +X | +X | +X | +X | +
EMF (Windows Enhanced Metafile) | ++ | + | + | + | + | X [1] | +
EPS (Encapsulated PostScript) | ++ | X [1] | ++ | + | + | + |
GIF (Graphics Interchange Format) | +X | +X | +X | +X | +X | +X | +
JPEG (Joint Photographic Experts Group) | +X [1] | +X [1] | +X | +X | +X [1] | +X | +
PNG (Portable Network Graphic) | +X | +X | +X | +X | +X | +X | +
SVG (Scalable Vector Graphics) | +X | +X | +X | +X | +X | +X | +
TIFF (Tag Image Format File) | +X [2] | +X [2] | +X | +X | +X [2] | +X | +
WMF (Windows Metafile) | +X | +X | +X | +X | +X | +X | +
+ Legend: +
++ XML Graphics Commons supports a number + of graphic file formats natively as basic functionality: all bitmap formats for which + there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF. +
++ FOP has no native image plug-ins for the image loading framework of its own but currently + hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to + Apache Batik. +
++ Apache Batik will later receive the + SVG and WMF plug-ins for the image loading framework that are currently hosted inside + FOP. +
++ Current FOP distributions include a distribution of the + Apache Batik. + Because Batik's API changes frequently, it is highly recommended that you use the + version that ships with FOP, at least when running FOP. +
++ Batik must be run in a graphical environment. + It uses AWT classes for rendering SVG, which in turn require an X server on Unixish + systems. If you run a server without X, or if you can't connect to the X server due to + security restrictions or policies (a so-called "headless" environment), SVG rendering + will fail. +
+Here are some workarounds:
+-Djava.awt.headless=true
command line option.
+ + BMP images are supported through an Image I/O codec. There may be limitations of the + codec which are outside the control of Apache FOP. +
++ Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are + embedded without decoding. +
+Apache FOP allows to use EPS files when generating PostScript output only.
++ Other output targets can't be supported at the moment because + FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able + to parse the preview bitmaps sometimes contained in EPS files. +
++ GIF images are supported through an Image I/O codec. Transparency is supported but + not guaranteed to work with every output format. +
++ FOP native support (i.e. the handling of undecoded images) of JPEG does not include all + variants, especially those containing unusual color lookup tables and color profiles. + If you have trouble with a JPEG image in FOP, try opening it with an image processing + program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output + may also help. For the PDF and PostScript renderers most JPEG images can be passed + through without decompression. User reports indicate that grayscale, RGB, and + CMYK color spaces are all rendered properly. However, for other output formats, the + JPEG images have to be decompressed. Tests have shown that there are some limitation + in some Image I/O codecs concerning images in the CMYK color space. Work-arounds are + in place but may not always work as expected. +
++ PNG images are supported through an Image I/O codec. Transparency is supported but + not guaranteed to work with every output format. +
+FOP uses Apache Batik for SVG support.
+ This format can be handled as an fo:instream-foreign-object
or in a separate
+ file referenced with fo:external-graphic
.
+ The SVG is rendered into PDF by using PDF commands to draw and fill + lines and curves. This means that the graphical objects created with + this remain as vector graphics. The same applies to PostScript output. + For other output formats the SVG graphic may be converted to a bitmap + image. +
++ There are a number of SVG things that cannot be converted directly into + PDF. Parts of the graphic such as effects, patterns and images are inserted + into the PDF as a raster graphic. The resolution of these raster images can + be controlled through the "target resolution" setting in the + configuration.
++ Currently transparency is limited in PDF so many SVG images that + contain effects or graphics with transparent areas may not be displayed + correctly. +
+If possible, Batik will use normal PDF or PostScript text when inserting text. It does + this by checking if the text can be drawn normally and the font is + supported. This example svg text.svg / + text.pdf + shows how various types and effects with text are handled. + Note that tspan and outlined text are not yet implemented.
++ Otherwise, text is converted and drawn as a set of shapes by Batik, using the + stroking text painter. This means that a typical character will + have about 10 curves (each curve consists of at least 20 characters). + This can make the output files large and when it is viewed the + viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on + "Smooth Line Art" in the preferences will fix this). Copy/paste functionality + will not be supported in this case. + If the text is inserted into the output file using the inbuilt text commands + it will use a single character. +
++ Note that because SVG text can be rendered as either text or a vector graphic, you + may need to consider settings in your viewer for both. The Acrobat viewer has both + "smooth line art" and "smooth text" settings that may need to be set for SVG images + to be displayed nicely on your screen (see Edit / Preferences / Display). + This setting will not affect the printing of your document, which should be OK in + any case, but will only affect the quality of the screen display.
++ Currently, SVG images are rendered with the dimensions specified in the SVG + file, within the viewport specified in the fo:external-graphic element. + For everything to work properly, the two should be equal. The SVG standard leaves + this issue as an implementation detail. Additional scaling options are available + through XSL-FO means. +
++ If you use pixels to specify the size of an SVG graphic the "source resolution" setting + in the configuration will be used to determine the + size of a pixel. The use of pixels to specify sizes is discouraged as they may + be interpreted differently in different environments. +
++ FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they + have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable + Image I/O codec is necessary for decoding the image. +
++ There may be some limitation concerning images in the CMYK color space. +
++ Windows Metafiles (WMF) are supported through classes in + Apache Batik. At the moment, support + for this format is experimental and may not always work as expected. +
++ Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution + values. FOP tries to use this resolution information whenever possible to determine + the image's intrinsic size. This size is used during the layout process when it is not + superseded by an explicit size on fo:external-graphic (content-width and content-height + properties). +
++ Please note that not all images contain resolution information. If it's not available + the source resolution set on the FopFactory (or through the user configuration XML) is used. + The default here is 72 dpi. +
++ Bitmap images are generally embedded into the output format at their original resolution + (as is). No resampling of the image is performed. Explicit resampling is on our wishlist, + but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to + the resolution specified in the "target resolution" setting in the + configuration if SVG filters are applied. This can be + used as a work-around to resample images in FO documents. +
+
+ Some image formats such as TIFF support multiple pages/sub-images per file. You can
+ select a particular page using a special URI fragment in the form:
+ <uri>#page=<nr>
+ (for example: http://localhost/images/myimage.tiff#page=3
)
+
+ FOP caches images between runs. There is one cache per FopFactory instance. The URI is + used as a key to identify images which means that when a particular URI appears again, + the image is taken from the cache. If you have a servlet that generates a different + image each time it is called with the same URI you need to use a constantly + changing dummy parameter on the URI to avoid caching. +
++ The image cache has been improved considerably in the redesigned code. Therefore, a + resetCache() method like in earlier versions of FOP has become unnecessary. If you + still experience OutOfMemoryErrors, please notify us. +
+FOP uses Liang's hyphenation algorithm, well known from TeX. It needs + language specific pattern and other data for operation.
+Because of licensing issues (and for + convenience), all hyphenation patterns for FOP are made available through + the Objects For + Formatting Objects project.
+Many of the hyphenation files distributed with TeX and its offspring are + licenced under the LaTeX + Project Public License (LPPL), which prevents them from being + distributed with Apache software. The LPPL puts restrictions on file names + in redistributed derived works which we feel can't guarantee. Some + hyphenation pattern files have other or additional restrictions, for + example against use for commercial purposes.
+Although Apache FOP cannot redistribute hyphenation pattern files that do + not conform with its license scheme, that does not necessarily prevent users + from using such hyphenation patterns with FOP. However, it does place on + the user the responsibility for determining whether the user can rightly use + such hyphenation patterns under the hyphenation pattern license.
+The most important source of hyphenation pattern files is the + CTAN TeX + Archive.
+To install a custom hyphenation pattern for use with FOP:
+{fop-dir}/hyph/hyphenation.dtd
.languageCode_countryCode.xml
. The country code is
+ optional, and should be used only if needed. For example:
+ en_US.xml
would be the file name for American
+ English hyphenation patterns.it.xml
would be the file name for Italian
+ hyphenation patterns.{fop-dir}/lib
directory, or
+ in a directory of your choice (and append the full path to the JAR to
+ the environment variable FOP_HYPHENATION_PATH
).{fop-dir}/hyph
, user.hyph.dir
to point to that directory (in
+ build-local.properties
),jar-hyphenation
. This will create a JAR containing the
+ compiled patterns in {fop-dir}/build
that will be added to the
+ classpath on the next run.
+ (When FOP is built from scratch, and there are pattern source file(s)
+ present in the directory pointed to by the
+ user.hyph.dir
variable, this JAR will automatically
+ be created from the supplied pattern(s)).If you would like to build your own hyphenation pattern files, or modify + existing ones, this section will help you understand how to do so. Even + when creating a pattern file from scratch, it may be beneficial to start + with an existing file and modify it. See + OFFO's Hyphenation page for examples. + Here is a brief explanation of the contents of FOP's hyphenation patterns:
+If you want to convert a TeX hyphenation pattern file, you have to undo + the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns + must be proper Unicode too. You should be aware of the XML encoding issues, + preferably use a good Unicode editor.
+Note that FOP does not do Unicode character normalization. If you use + combining chars for accents and other character decorations, you must + declare character classes for them, and use the same sequence of base character + and combining marks in the XSLFO source, otherwise the pattern wouldn't match. + Fortunately, Unicode provides precomposed characters for all important cases + in common languages, until now nobody run seriously into this issue. Some dead + languages and dialects, especially ancient ones, may pose a real problem + though.
+If you want to generate your own patterns, an open-source utility called + patgen is available on many Unix/Linux distributions and every TeX + distribution which can be used to assist in + creating pattern files from dictionaries. Pattern creation for languages like + english or german is an art. If you can, read Frank Liang's original paper + "Word Hy-phen-a-tion by Com-pu-ter" (yes, with hyphens). It is not available + online. The original patgen.web source, included in the TeX source distributions, + contains valuable comments, unfortunately technical details obscure often the + high level issues. Another important source is + The + TeX Book, appendix H (either read the TeX source, or run it through + TeX to typeset it). Secondary articles, for example the works by Petr Sojka, + may also give some much needed insight into problems arising in automated + hyphenation.
++ The Apache FOP team is proud to present to you this production quality release. + We're still in the process of adding new features. We welcome any feedback you + might have and even more, any other form of help to get the project forward. +
++ This sixth release contains many bug fix release and new features compared + to 0.94. To see what has changed since the last release, please visit the + Changes Page and the + Release Notes. +
++ If you're upgrading to this version from an earlier version of FOP, please read the + information contained on the Upgrading page! +
++ To download this version, please visit the download page. +
++ The intermediate format (IF) is a proprietary XML format that represents the area tree + generated by the layout engine. The area tree is conceptually defined in the + XSL-FO specification in chapter 1.1.2. + The IF can be generated through the area tree XML Renderer (the XMLRenderer). +
++ The intermediate format can be used to generate intermediate documents that are modified + before they are finally rendered to their ultimate output format. Modifications include + adjusting and changing trait values, adding or modifying area objects, inserting prefabricated + pages, overlays, imposition (n-up, rotation, scaling etc.). Multiple IF files can be combined + to a single output file. +
++ As already mentioned, the IF is generated by using the XMLRenderer (MIME type: + application/X-fop-areatree). So, you basically set the right MIME type for + the output format and process your FO files as if you would create a PDF file. However, there + is an important detail to consider: The various Renderers don't all use the same font sources. + To be able to create the right area tree for the ultimate output file, you need to create + the IF file using the right font setup. This is achieved by telling the XMLRenderer to mimic + another renderer. This is done by calling the XMLRenderer's mimicRenderer() method with an + instance of the ultimate target renderer as the single parameter. This has a consequence: An + IF file rendered with the Java2DRenderer may not look as expected when it was actually generated + for the PDF renderer. For renderers that use the same font setup, this restriction does not + apply (PDF and PS, for example). Generating the intermediate format file is the first step. +
+
+ The second step is to reparse the IF file using the AreaTreeParser which is
+ found in the org.apache.fop.area package. The pages retrieved from the IF file are added to an
+ AreaTreeModel instance from where they are normally rendered using one of the available Renderer
+ implementations. You can find examples for the IF processing in the
+ examples/embedding
+ directory in the FOP distribution
+
+ The basic pattern to parse the IF format looks like this: +
+
+ This example simply reads an IF file and renders it to a PDF file. Please note, that in normal
+ FOP operation you're shielded from having to instantiate the FontInfo object yourself. This
+ is normally a task of the AreaTreeHandler which is not present in this scenario. The same
+ applies to the AreaTreeModel instance, in this case an instance of a subclass called
+ RenderPagesModel. RenderPagesModel is ideal in this case as it has very little overhead
+ processing the individual pages. An important line in the example is the call to
+ endDocument()
on the AreaTreeModel. This lets the Renderer know that the processing
+ is now finished.
+
+ The intermediate format can also be used from the command-line + by using the "-atin" parameter for specifying the area tree XML as input file. You can also + specify a "mimic renderer" by inserting a MIME type between "-at" and the output file. +
++ This initial example is obviously not very useful. It would be faster to create the PDF file + directly. As the ExampleConcat.java + example shows you can easily parse multiple IF files in a row and add the parsed pages to the + same AreaTreeModel instance which essentially concatenates all the input document to one single + output document. +
++ One of the most important use cases for the intermediate format is obviously modifying the area + tree XML before finally rendering it to the target format. You can easily use XSLT to process + the IF file according to your needs. Please note, that we will currently not formally describe + the intermediate format. You need to have a good understanding its structure so you don't + create any non-parseable files. We may add an XML Schema and more detailed documentation at a + later time. You're invited to help us with that. +
+
+ The generation of the intermediate format as well as it parsing process has been designed to allow
+ for maximum flexibility and optimization. Please note that you can call setTransformerHandler()
on
+ XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would like to
+ do custom serialization (to a W3C DOM, for example) and/or to directly modify the area tree using
+ XSLT. The AreaTreeParser on the other side allows you to retrieve a ContentHandler instance where
+ you can manually send SAX events to to start the parsing process (see getContentHandler()
).
+
+ This page lists currently known issues in the current release. +
++ For additional information on known issues in Apache FOP, please have a look at the following pages, too: +
+ ++ Apache FOP has an extensive automated testing infrastructure. Parts of this infrastructure are several + sets of test cases. When a test case is listed in disabled-testcases.xml it is disabled in the JUnit + tests during the normal build process. This indicates a problem in the current codebase. When a bug is + fixed or a missing feature is added the entry for the relevant test case(s) are removed. +
++ This section lists disabled test cases in the test suite for the FO tree tests, at the time + of the release. +
++ This section lists disabled test cases in the test suite for the layout engine tests, at the + time of the release. +
+This section lists other known issues.
++ FOP supports multiple output formats by using a different renderer for each format. + The renderers do not all have the same set of capabilities, sometimes because of + the output format itself, sometimes because some renderers get more development + attention than others. +
++ Most FOP renderers use a FOP-specific system for font registration. + However, the Java2D/AWT and print renderers use the Java AWT package, which gets its + font information from the operating system registration. + This can result in several differences, including actually using different fonts, + and having different font metrics for the same font. + The net effect is that the layout of a given FO document can be quite different between + renderers that do not use the same font information. +
++ Theoretically, there's some potential to make the output of the PDF/PS renderers match + the output of the Java2D-based renderers. If FOP used the font metrics from its own + font subsystem but still used Java2D for text painting in the Java2D-based renderers, + this could probably be achieved. However, this approach hasn't been implemented, yet. +
++ With a work-around, it is possible to match the PDF/PS output in a Java2D-based + renderer pretty closely. The clue is to use the + intermediate format. The trick is to layout the + document using FOP's own font subsystem but then render the document using Java2D. + Here are the necessary steps (using the command-line): +
+fop -fo myfile.fo -at application/pdf myfile.at.xml
fop -atin myfile.at.xml -pdf myfile.pdf
fop -atin myfile.at.xml -print
fop -atin myfile.at.xml -awt
fop -atin myfile.at.xml -tiff myfile.tiff
+ The most obvious way to print your document is to use the FOP + print renderer, which uses the Java2D API (AWT). + However, you can also send output from the Postscript renderer directly to a Postscript + device, or output from the PCL renderer directly to a PCL device. +
++ Here are Windows command-line examples for Postscript and PCL: +
++ Here is some Java code to accomplish the task in UNIX: +
++ Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and + it happily sends the PCL to the UNIX printer queue. +
++ PDF is the best supported output format. It is also the most accurate + with text and layout. This creates a PDF document that is streamed out + as each page is rendered. This means that the internal page index + information is stored near the end of the document. + The PDF version supported is 1.4. PDF versions are forwards/backwards + compatible. +
++ Note that FOP does not currently support "tagged PDF" or PDF/A-1a. + Support for PDF/A-1b and PDF/X has recently been added, however. +
++ PDF has a set of fonts that are always available to all PDF viewers; + to quote from the PDF Specification: + + "PDF prescribes a set of 14 standard fonts that can be used without prior + definition. + These include four faces each of three Latin text typefaces (Courier, + Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf + Dingbats). These fonts, or suitable substitute fonts with the same metrics, are + guaranteed to be available in all PDF viewer applications." +
++ FOP does not currently support several desirable PDF features: watermarks and signatures. + One workaround is to use Adobe Acrobat (the full version, not the Reader) to process + the file manually or with scripting that it supports. +
++ Another popular post-processing tool is iText, + which has tools for adding security features, document properties, watermarks, and many + other features to PDF files. +
++ Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now + supports PDF encryption. However the principles for using + iText for other PDF features are similar.) +
++ Check the iText tutorial and documentation for setting access flags, password, + encryption strength and other parameters. +
++ In addition to the PDF Post-processing options, consider the following workarounds: +
++ The PostScript renderer has been brought up to a similar quality as the + PDF renderer, but may still be missing certain features. It provides good + support for most text and layout. + Images and SVG are not fully supported, yet. Currently, the PostScript + renderer generates PostScript Level 3 with most DSC comments. Actually, + the only Level 3 features used are the FlateDecode and DCTDecode + filter (the latter is used for 1:1 embedding of JPEG images), everything + else is Level 2. +
++ The PostScript renderer configuration currently allows the following settings: +
++ The default value for the "auto-rotate-landscape" setting is "false". Setting it + to "true" will automatically rotate landscape pages and will mark them as landscape. +
++ The default value for the "language-level" setting is "3". This setting specifies + the PostScript language level which should be used by FOP. Set this to "2" + only if you don't have a Level 3 capable interpreter. +
++ The default value for the "optimize-resources" setting is "false". Setting it + to "true" will produce the PostScript file in two steps. A temporary file will be + written first which will then be processed to add only the fonts which were really + used and images are added to the stream only once as PostScript forms. This will + reduce file size but can potentially increase the memory needed in the interpreter + to process. +
++ The default value for the "safe-set-page-device" setting is "false". Setting it + to "true" will cause the renderer to invoke a postscript macro which guards against + the possibility of invalid/unsupported postscript key/values being issued to the + implementing postscript page device. +
++ The default value for the "dsc-compliant" setting is "true". Setting it + to "false" will break DSC compliance by minimizing the number of setpagedevice + calls in the postscript document output. This feature may be useful when unwanted + blank pages are experienced in your postscript output. This problem is caused by + the particular postscript implementation issuing unwanted postscript subsystem + initgraphics/erasepage calls on each setpagedevice call. +
++ This format is for the Hewlett-Packard PCL printers and other printers + supporting PCL. It should produce output as close to identical as possible + to the printed output of the PDFRenderer within the limitations of the + renderer, and output device. +
++ The output created by the PCLRenderer is generic PCL 5, HP GL/2 and PJL. + This should allow any device fully supporting PCL 5 to be able to + print the output generated by the PCLRenderer. PJL is used to control the + print job and switch to the PCL language. PCL 5 is used for text, raster + graphics and rectangular fill graphics. HP GL/2 is used for more complex + painting operations. Certain painting operations are done off-screen and + rendered to PCL as bitmaps because of limitations in PCL 5. +
++ The PCL renderer configuration currently allows the following settings: +
++ The default value for the "rendering" setting is "speed" which causes borders + to be painted as plain rectangles. In this mode, no special borders (dotted, + dashed etc.) are available. If you want support for all border modes, set the + value to "quality" as indicated above. This will cause the borders to be painted + as bitmaps. +
++ The default value for the "text-rendering" setting is "auto" which paints the + base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D. + If the mix of painting methods results in unwelcome output, you can set this + to "bitmap" which causes all text to be rendered as bitmaps. +
++ The default value for the "disable-pjl" setting is "false". This means that + the PCL renderer usually generates PJL commands before and after the document + in order to switch a printer into PCL language. PJL commands can be disabled + if you set this value to "true". +
++ You can control the output resolution for the PCL using the "target resolution" + setting on the FOUserAgent. The actual value will be rounded up to the next + supported PCL resolution. Currently, only 300 and 600 dpi are supported which + should be enough for most use cases. Note that this setting directly affects + the size of the output file and the print quality. +
+The PCL Renderer supports some PCL specific extensions which can be embedded + into the input FO document. To use the extensions the appropriate namespace must + be declared in the fo:root element like this:
++ The page-source extension attribute on fo:simple-page-master allows to + select the paper tray the sheet for a particular simple-page-master is + to be taken from. Example: +
++ Note: the tray number is a positive integer and the value depends on + the target printer. Not all PCL printers support the same paper trays. + Usually, + "1" is the default tray, + "2" is the manual paper feed, + "3" is the manual envelope feed, + "4" is the "lower" tray and + "7" is "auto-select". + Consult the technical reference for your printer for all available values. +
++ The FOP AFP Renderer deals with creating documents conforming to the IBM AFP document architecture + also refered to as MO:DCA (Mixed Object Document Content Architecture). +
+This list is most likely badly incomplete.
+The AFP Renderer requires special configuration particularly related to fonts. + AFP Render configuration is done through the normal FOP configuration file. The MIME type + for the AFP Renderer is application/x-afp which means the AFP Renderer section in the FOP configuration file + looks like:
+There are 3 font configuration variants supported:
+A typical raster font configuration looks like:
+An outline font configuration is simpler as the individual font size entries are not required. + However, the characterset definition is now required within the afp-font element.
+Experimentation has shown that the font metrics for the FOP built-in Base14 fonts are actually + very similar to some of the IBM outline and raster fonts. In cases were the IBM font files are not + available the path attribute in the afp-font element can be replaced by a base14-font attribute + giving the name of the matching Base14 font. In this case the AFP Renderer will take the + font metrics from the built-in font.
+By default the AFP Renderer creates output with a resolution of 240 dpi. + This can be overridden by the <renderer-resolution/> configuration element. Example:
+By default the AFP Renderer converts all images to 8 bit grey level. + This can be overridden by the <images> configuration element. Example:
+This will put images as RGB images into the AFP output stream. The default setting is:
+Only the values "color" and "b+w" are allowed for the mode attribute. The bits-per-pixel + attribute is ignored if mode is "color". For "b+w" mode is must be 1, 4, or 8.
+The AFP Renderer supports some AFP specific extensions which can be embedded into the input + fo document. To use the extensions the appropriate namespace must be declared in the fo:root element like this:
+The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example:
+The mandatory name attribute must refer to an 8 character (space padded) resource name that + must be known in the AFP processing environment.
+The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements. + Example:
+The include-page-segment extension element can only occur within a simple-page-master. + Multiple include-page-segment extension elements within a simple-page-master are allowed. + The mandatory name attribute must refer to an 8 character + (space padded) resource name that must be known in the AFP processing environment. + The value of the mandatory src attribute is compared against the value of the src attribute in + fo:external-graphic elements and if it is identical (string matching is used) in the generated + AFP the external graphic is replaced by a reference to the given resource. +
+The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
+The tag-logical-element extension element can only occur within a simple-page-master. + Multiple tag-logical-element extension elements within a simple-page-master are allowed. + The name and value attributes are mandatory. +
+The no-operation extension provides the ability to carry up to 32K of comments or any other type + of unarchitected data into the AFP output stream. Example:
+The no-operation extension element can only occur within a simple-page-master. + Multiple no-operation extension elements within a simple-page-master are allowed. + The name attribute is mandatory. +
++ JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP. + This will create an RTF (rich text format) document that will + attempt to contain as much information from the XSL-FO document as + possible. It should be noted that is not possible (due to RTF's limitations) to map all + XSL-FO features to RTF. For complex documents, the RTF output will never reach the feature + level from PDF, for example. Thus, using RTF output is only recommended for simple documents + such as letters. +
++ The RTF output follows Microsoft's RTF specifications + and produces best results on Microsoft Word. +
++ This is primarily for testing and verification. The XML created is simply + a representation of the internal area tree put into XML. We use that to verify + the functionality of FOP's layout engine. +
++ The other use case of the Area Tree XML is as FOP's "intermediate format". More information + on that can be found on the page dedicated to the Intermediate Format. +
++ The Java2DRenderer provides the basic functionality for all + Java2D-based output formats (AWT viewer, direct print, PNG, TIFF). +
++ The AWT viewer shows a window with the pages displayed inside a + Java graphic. It displays one page at a time. + The fonts used for the formatting and viewing depend on the fonts + available to your JRE. +
++ It is possible to directly print the document from the command line. + This is done with the same code that renders to the Java2D/AWT renderer. +
++ It is possible to directly create bitmap images from the individual + pages generated by the layout engine. + This is done with the same code that renders to the Java2D/AWT renderer. +
++ Currently, two output formats are supported: PNG and TIFF. TIFF produces + one file with multiple pages, while PNG output produces one file per + page. The quality of the bitmap depends on the target resolution setting + on the FOUserAgent. +
++ The TIFF and PNG renderer configuration currently allows the following settings: +
++ The default value for the "transparent-page-background" setting is "false" which + paints an opaque, white background for the whole image. If you set this to true, + no such background will be painted and you will get a transparent image if + an alpha channel is available in the output format. +
++ In addition to the above values the TIFF renderer configuration allows some additional + settings: +
++ The default value for the "compression" setting is "PackBits" which + which is a widely supported RLE compression scheme for TIFF. The set of compression + names to be used here matches the set that the Image I/O API uses. Note that + not all compression schemes may be available during runtime. This depends on the + actual codecs being available. Here is a list of possible values: +
++ The text renderer produces plain ASCII text output + that attempts to match the output of the PDFRenderer as closely as + possible. This was originally developed to accommodate an archive system + that could only accept plain text files, and is primarily useful for getting + a quick-and-dirty view of the document text. The renderer is very limited, + so do not be surprised if it gives unsatisfactory results. +
++ The Text renderer works with a fixed size page buffer. The size of this + buffer is controlled with the textCPI and textLPI public variables. + The textCPI is the effective horizontal characters per inch to use. + The textLPI is the vertical lines per inch to use. From these values + and the page width and height the size of the buffer is calculated. + The formatting objects to be rendered are then mapped to this grid. + Graphic elements (lines, borders, etc) are assigned a lower priority + than text, so text will overwrite any graphic element representations. +
++ Because FOP lays the text onto a grid during layout, there are frequently + extra or missing spaces between characters and lines, which is generally + unsatisfactory. + Users have reported that the optimal settings to avoid such spacing problems are: +
++ Due to the state of certain renderers we moved some of them to a "sandbox" area until + they are ready for more serious use. The renderers and FOEventHandlers in the sandbox + can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the + main build. The output formats in the sandbox are marked as such below. +
++ This format is the Maker Interchange Format which is used by + Adobe Framemaker. +
++ This format creates an SVG document that has links between the pages. + This is primarily for slides and creating svg images of pages. + Large documents will create SVG files that are far too large for + an SVG viewer to handle. Since FO documents usually have text the + SVG document will have a large number of text elements. + The font information for the text is obtained from the JVM in the + same way as for the AWT viewer. If the SVG is viewed on a + system where the fonts are different, such as another platform, + then the page may look wrong. +
++ Apache FOP is easily extensible and allows you to add new output formats to enhance FOP's functionality. There's a number of output formats + which are on our wish list. We're looking for volunteers to help us implement them. +
++ PDF/A is a standard which turns PDF into an "electronic document file + format for long-term preservation". PDF/A-1 is the first part of the + standard and is documented in + ISO 19005-1:2005(E). + Work on PDF/A-2 is in progress at + AIIM. +
++ Design documentation on PDF/A can be found on FOP's Wiki on the + PDFA1ConformanceNotes page. +
++ PDF/A-1b is implemented to the degree that FOP supports + the creation of the elements described in ISO 19005-1. +
++ Tests have been performed against jHove and Adobe Acrobat 7.0.7 (Preflight function). + FOP does not validate completely against Apago's PDF Appraiser. Reasons unknown due to + lack of a full license to get a detailed error protocol. +
++ PDF/A-1a is not implemented, yet. This is mostly because of the requirement + for tagged PDF which is not available in FOP, yet. +
++ To activate PDF/A-1b from the command-line, specify "-pdfprofile PDF/A-1b" + as a parameter. If there is a violation of one of the validation rules for + PDF/A, an error message is presented and the processing stops. +
++ When FOP is embedded in another Java application you can set a special option + on the renderer options in the user agent to activate the PDF/A-1b profile. + Here's an example: +
++ If one of the validation rules of PDF/A is violated, an PDFConformanceException + (descendant of RuntimeException) is thrown. +
++ There are a number of things that must be looked after if you activate a PDF/A + profile. If you receive a PDFConformanceException, have a look at the following + list (not necessarily comprehensive): +
++ The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be + activated at the same time. +
++ There has been some confusion about the namespace for the PDF/A indicator in the XMP + metadata. At least three variants have been seen in the wild: +
+http://www.aiim.org/pdfa/ns/id.html | +obsolete, from an early draft of ISO-19005-1, used by Adobe Acrobat 7.x | +
http://www.aiim.org/pdfa/ns/id | +obsolete, found in the original ISO 19005-1:2005 document | +
http://www.aiim.org/pdfa/ns/id/ | +correct, found in the technical corrigendum 1 of ISO 19005-1:2005 | +
+ If you get an error validating a PDF/A file in Adobe Acrobat 7.x it doesn't mean that + FOP did something wrong. It's Acrobat that is at fault. This is fixed in Adobe Acrobat 8.x + which uses the correct namespace as described in the technical corrigendum 1. +
++ FOP supports encryption of PDF output, thanks to Patrick + C. Lankswert. This feature is commonly used to prevent + unauthorized viewing, printing, editing, copying text from the + document and doing annotations. It is also possible to ask the + user for a password in order to view the contents. Note that + there already exist third party applications which can decrypt + an encrypted PDF without effort and allow the aforementioned + operations, therefore the degree of protection is limited. +
++ For further information about features and restrictions regarding PDF + encryption, look at the documentation coming with Adobe Acrobat or the + technical documentation on the Adobe web site. +
++ Encryption is enabled by supplying any of the encryption related + options. +
+
+ An owner password is set with the -o
option. This
+ password is actually used as encryption key. Many tools for
+ PDF processing ask for this password to disregard any
+ restriction imposed on the PDF document.
+
+ If no owner password has been supplied but FOP was asked to apply some + restrictions, a random password is used. In this case it is obviously + impossiible to disregard restrictions in PDF processing tools. +
+
+ A user password, supplied with the -u
option, will
+ cause the PDF display software to ask the reader for this password in
+ order to view the contents of the document. If no user password was
+ supplied, viewing the content is not restricted.
+
+ Further restrictions can be imposed by using the -noprint
,
+ -nocopy
, -noedit
and
+ -noannotations
options, which disable printing, copying
+ text, editing in Adobe Acrobat and making annotations, respectively.
+
+ When FOP is embedded in another Java application you need to set an + options map on the renderer. These are the supported options: +
+Option | +Description | +Values | +Default | +
---|---|---|---|
ownerPassword | +The owner password | +String | ++ |
userPassword | +The user password | +String | ++ |
allowPrint | +Allows/disallows printing of the PDF | +"TRUE" or "FALSE" | +"TRUE" | +
allowCopyContent | +Allows/disallows copy/paste of content | +"TRUE" or "FALSE" | +"TRUE" | +
allowEditContent | +Allows/disallows editing of content | +"TRUE" or "FALSE" | +"TRUE" | +
allowEditAnnotations | +Allows/disallows editing of annotations | +"TRUE" or "FALSE" | +"TRUE" | +
+ An example to enable PDF encryption in Java code: +
++ The parameters for the constructor of PDFEncryptionParams are: +
++ Alternatively, you can set each value separately in the Map provided by + FOUserAgent.getRendererOptions() by using the following keys: +
++ In order to use PDF encryption, FOP has to be compiled with + cryptography support. Currently, only JCE + is supported. JCE is part of JDK 1.4. For earlier JDKs, it can + be installed separately. The build process automatically + detects JCE presence and installs PDF encryption support if + possible, otherwise a stub is compiled in. +
++ Cryptography support must also be present at run time. In particular, a + provider for the RC4 cipher is needed. Unfortunately, the sample JCE + provider in Sun's JDK 1.4 does not provide RC4. If you + get a message saying +
++ then you don't have the needed infrastructure. +
++ There are several commercial and a few Open Source packages which + provide RC4. A pure Java implementation is produced by The Legion of the Bouncy + Castle. Mozilla + JSS is an interface to a native implementation. +
++ The pure Java implementation from Bouncy Castle is easy to + install. +
+fop.sh
.
+ java.security
file and addsecurity.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider
,+ If you have any experience with Mozilla JSS or any other + cryptography provider, please post it to the fop-user list. +
++ PDF/X is a standard which faciliates prepress digital data exchange using PDF. + Currently, only PDF/X-3:2003 is implemented out of the many different flavours of PDF/X + profiles. PDF/X-3:2003 is documented in + ISO 15930-6:2003(E). + More info on PDF/X can be found on the + PDF/X info site. +
++ PDF/X-3:2003 is implemented to the degree that FOP supports + the creation of the elements described in ISO 15930-6. +
++ An important restriction of the current implementation is that all normal + RGB colors specified in XSL-FO and SVG are left unchanged in the sRGB color + space (XSL-FO and SVG both use sRGB as their default color space). + There's no conversion to a CMYK color space. Although sRGB is a + calibrated color space, its color space has a different size than a CMYK + color space which makes the conversion a lossy conversion and can lead to + unwanted results. Although the use of the calibrated sRGB has been promoted + for years, print shops usually prefer to convert an sRGB PDF to CMYK prior + to production. Until there's full CMYK support in FOP you will have to + work closely with your print service provider to make sure you get the + intended result. +
++ Tests have been performed against Adobe Acrobat 7.0.7 (Preflight function). + Note that there are bugs in Adobe Acrobat which cause false alarms if both + PDF/A-1b and PDF/X-3:2003 are activated at the same time. +
++ To activate PDF/X-3:2003 from the command-line, specify "-pdfprofile PDF/X-3:2003" + as a parameter. If there is a violation of one of the validation rules for + PDF/X, an error message is presented and the processing stops. +
++ When FOP is embedded in another Java application you can set a special option + on the renderer options in the user agent to activate the PDF/A-1b profile. + Here's an example: +
++ If one of the validation rules of PDF/X is violated, an PDFConformanceException + (descendant of RuntimeException) is thrown. +
++ There are a number of things that must be looked after if you activate a PDF/X + profile. If you receive a PDFConformanceException, have a look at the following + list (not necessarily comprehensive): +
++ The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be + activated at the same time. +
+The following software must be installed:
+The following software is optional, depending on your needs:
+In addition, the following system requirements apply:
+
+ Basic FOP installation consists of first unzipping the .gz
file that is the
+ distribution medium, then unarchiving the resulting .tar
file in a
+ directory/folder that is convenient on your system. Please consult your operating system
+ documentation or Zip application software documentation for instructions specific to your
+ site.
+
+ Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip
+ and unarchive their distribution media. This is a legacy of older Mac operating systems,
+ which had a 31-character pathname limit. Several Mac OSX users have recommended that
+ Mac OSX users use the shell command tar -xzf
instead.
+
+ The usual and recommended practice for starting FOP from the command line is to run the
+ batch file fop.bat (Windows) or the shell script fop (Unix/Linux).
+ These scripts require that the environment variable JAVA_HOME be
+ set to a path pointing to the appropriate Java installation on your system. Macintosh OSX
+ includes a Java environment as part of its distribution. We are told by Mac OSX users that
+ the path to use in this case is /Library/Java/Home
. Caveat:
+ We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum
+ Java requirements, the two will inevitably not match on some systems. Please see
+ Java on Mac OSX FAQ for information as
+ it becomes available.
+
+ PDF encryption is only available if FOP was compiled with encryption support + and if compatible encryption support is available at run time. + Currently, only the JCE is supported. Check the Details. +
+FOP's entry point for your own scripts is the class
+org.apache.fop.cli.Main
. The general pattern for the
+ command line is: java -classpath <CLASSPATH>
+ org.apache.fop.cli.Main <arguments>
. The arguments
+ consist of the options and infile and outfile specifications
+ as shown above for the standard scripts. You may wish to review
+ the standard scripts to make sure that
+ you get your environment properly configured.
+
-jar
option
+ As an alternative to the start scripts you can run java
+ -jar path/to/build/fop.jar <arguments>
, relying on
+ FOP to build the classpath for running FOP dynamically, see below. If you use hyphenation,
+ you must put fop-hyph.jar
in the lib
+ directory.
+
You can also run java -jar path/to/fop.jar
+ <arguments>
, relying on the Class-Path
+ entry in the manifest file. This works if you put
+ fop.jar
and all jar files from the lib
+ directory in a single directory. If you use hyphenation, you
+ must also put fop-hyph.jar
in that directory.
In both cases the arguments consist of the options and + infile and outfile specifications as shown above for the + standard scripts.
+If FOP is started without a proper classpath, it tries to
+ add its dependencies dynamically. If the system property
+ fop.home
contains the name of a directory, then
+ FOP uses that directory as the base directory for its
+ search. Otherwise the current working directory is the base
+ directory. If the base directory is called build
,
+ then its parent directory becomes the base directory.
FOP expects to find fop.jar
in the
+ build
subdirectory of the base directory, and
+ adds it to the classpath. Subsequently FOP adds all
+ jar
files in the lib directory to the
+ classpath. The lib directory is either the lib
+ subdirectory of the base directory, or, if that does not
+ exist, the base directory itself.
If the system property fop.optional.lib
+ contains the name of a directory, then all jar
+ files in that directory are also added to the classpath. See
+ the methods getJARList
and
+ checkDependencies
in
+ org.apache.fop.cli.Main
.
+ FOP sessions that use -xml and -xsl input instead of -fo input are actually + controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting + the XSL-FO to PDF (or another FOP output format). + Although FOP controls both of these processes, the first is included merely as + a convenience and for performance reasons. + Only the second is part of FOP's core processing. + If a user has a problem running FOP, it is important to determine which of these + two processes is causing the problem. + If the problem is in the first process, the user's stylesheet is likely the cause. + The FOP development team does not have resources to help with stylesheet issues, + although we have included links to some useful + Specifications and + Books/Articles. + If the problem is in the second process, FOP may have a bug or an unimplemented + feature that does require attention from the FOP development team. +
++ In the case of using -xml and -xsl input, although the user is responsible for + the XSL-FO code that is FOP's input, it is not visible to the user. To make the + intermediate FO file visible, the FOP distribution includes the "-foout" option + which causes FOP to run only the first (transformation) step, and write the + results to a file. (See also the Xalan command-line below) +
++ The -foout option works the same way as if you would call the + Xalan command-line: +
+
+ java org.apache.xalan.xslt.Process -IN xmlfile -XSL file -OUT outfile
+
+ Note that there are some subtle differences between the FOP and Xalan command-lines. +
++ FOP can consume quite a bit of memory, even though this has been continually improved. + This is partly inherent to the formatting process and partly caused by implementation choices. + All FO processors currently on the market have memory problems with certain layouts. +
++ If you are running out of memory when using FOP, here are some ideas that may help: +
+If you have problems running FOP, please see the "How to get Help" page.
++ This page discusses topic all around using Apache FOP in a servlet environment. +
++ In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example + of a FOP-enabled servlet. +
++ The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building + the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use + URLs like the following to generate PDF files: +
+The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.
++ Here is a minimal code snippet to demonstrate the basics: +
++ A common requirement is to transform an XML source to + XSL-FO using an XSL transformation. It is recommended to use + JAXP for this task. The following snippet shows the basic + code: +
+
+ The Source
instance used above is simply an
+ example. If you have to read the XML from a string, supply
+ a new StreamSource(new
+ StringReader(xmlstring))
. Constructing and reparsing
+ an XML string is generally less desirable than using a
+ SAXSource if you generate your XML. You can alternatively
+ supply a DOMSource as well. You may also use dynamically
+ generated XSL if you like.
+
+ Because you have an explicit Transformer
object, you can also use it to
+ explicitely set parameters for the transformation run.
+
+ You can easily set up your own FOUserAgent as demonstrated on the Embedding page. +
++ There are several options to consider: +
+org.apache.commons.io.output.ByteArrayOutputStream
+ + Of course, the + performance hints from the Embedding page + apply here, too. +
+
+ Often, you will want to use resources (stylesheets, images etc.) which are bundled with
+ your web application. FOP provides a URIResolver implementation that lets you access
+ files via the Servlet's ServletContext. The class is called
+ org.apache.fop.servlet.ServletContextURIResolver
.
+
+ Here's how to set it up in your servlet. Instantiate a new instance in the servlet's + init() method: +
++ The ServletContextURIResolver reacts on URIs beginning with "servlet-context:". If you + want to access an image in a subdirectory of your web application, you could, for + example, use: "servlet-context:/images/myimage.png". Don't forget the leading slash + after the colon! +
++ Further down, you can use the URIResolver for various things: +
++ Here are some example snippets: +
++ Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times. + These are well-known limitations of Internet Explorer and are not a problem of the servlet. + However, Internet Explorer can still be used to download the PDF so that it can be viewed later. + Here are some suggestions in this context: +
+.pdf
, like
+ http://myserver/servlet/stuff.pdf
. Yes, the servlet can
+ be configured to handle this. If the URL has to contain parameters,
+ try to have both the base URL as well as the last parameter end in
+ .pdf
, if necessary append a dummy parameter, like
+ http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf
. The
+ effect may depend on IEx version.
+ Expires
header entry may help in
+ this case:response.setDateHeader("Expires",
+ System.currentTimeMillis() + cacheExpiringDuration *
+ 1000);
+ When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts + with existing XML/XSLT libraries. Servlet containers also often use their own classloaders + for loading webapps, which can cause bugs and security problems. +
++ Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon. + There are known bugs that must be addressed, particularly for Tomcat 4.0.3. +
++ Put a copy of a working parser in some directory where WebSphere can access it. + For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets, + copy the Xerces jar into it (any other directory would also be fine). + Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the + application server which contains your web application. + In the WebSphere administration console, click on the "environment" button in the + "general" tab. In the "variable name" box, enter "CLASSPATH". + In the "value" box, enter the correct path to the parser jar file + (/usr/webapps/yourapp/servlets/Xerces.jar in our example here). + Press "OK", then apply the change and restart the application server. +
++ Sometimes the requirements for a servlet get quite sophisticated: SQL data sources, + multiple XSL transformations, merging of several datasources etc. In such a case + consider using Apache Cocoon instead + of a custom servlet to accomplish your goal. +
++ If you're planning to upgrade to the latest FOP version there are a few very important things + to consider: +
++ The new code is much more strict about the interpretation of the XSL-FO 1.0 specification. + Things that worked fine in version 0.20.5 might start to produce warnings or even errors + now. FOP 0.20.5 contains many bugs which have been corrected in the new code. +
+fo:table-cell
elements, the new code
+ will complain about that (unless relaxed validation is enabled) because the specification
+ demands at least one block-level element ((%block;)+
, see
+ XSL-FO 1.0, 6.7.10)
+ inside an fo:table-cell
element.
+ + When you use your existing FO files or XML/XSL files which work fine with FOP version + 0.20.5 against this FOP version some things may not work as expected. The following + list will hopefully help you to identify and correct those problems. This does not mean + that the new FOP is at fault. Quite the opposite actually! See below: +
+<fo:table-cell></fo:table-cell>
+ are not allowed by the specification. The same applies to empty static-content
+ and block-container
elements, for example.
+ external-graphic
)
+ or instream-foreign-object
+ objects. If images or SVGs are sized differently in your outputs with the new FOP version
+ check Bug 37136
+ as it contains some hints on what to do. The file
+
+ "examples/fo/basic/images.fo"
has
+ a number of good examples that show the new, more correct behaviour.
+ fox:outline
extension is not implemented in this version anymore.
+ It has been superseded by the new bookmark elements from XSL-FO 1.1. So please
+ update your stylesheets accordingly.
+ - One of FOP's design goals is conformance to the - W3C XSL-FO 1.0 standard, which specifies three levels - of "conformance": basic, extended, and complete. Although FOP does not currently conform to - any of these levels, it is nevertheless a useful work-in-progress for many applications. - The information presented here demonstrates FOP's progress toward the goal of conformance, - which progress consists of implementation of specific objects and properties in the standard. - The information presented is useful not only to the developers as a sort of "to do" list, - but also for setting proper expectations for users and potential users. -
-- In the tables below, "yes" (green background) indicates conformance, "no" (red background) - indicates a lack of conformance, "partial" (greyish background) indicates partial conformance, - and "na" indicates that the item is "not applicable" to FOP usually because FOP supports only - visual media. -
+ +One of FOP's design goals is conformance to the W3C XSL-FO 1.0 standard, which specifies three + levels of "conformance": basic, extended, and complete. Although FOP does not currently conform + to any of these levels, it is nevertheless a useful work-in-progress for many applications. The + information presented here demonstrates FOP's progress toward the goal of conformance, which + progress consists of implementation of specific objects and properties in the standard. The + information presented is useful not only to the developers as a sort of "to do" list, but also + for setting proper expectations for users and potential users.
+ +In the tables below, "yes" (green background) indicates conformance, "no" (red background) + indicates a lack of conformance, "partial" (greyish background) indicates partial conformance, + and "na" indicates that the item is "not applicable" to FOP usually because FOP supports only + visual media.
+- The following is a summary of FOP's current support for the standard XSL-FO objects. -
+ +The following is a summary of FOP's current support for the standard XSL-FO objects.
+- Object Name | -- XSL-FO Conformance Level | -- Citation | -- Support in FOP | -- Comments | +Object Name | + +XSL-FO Conformance Level | + +Citation | + +Support in FOP | + +Comments | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- 0.20.5 (previous) | -0.93 (stable) | -- 0.94 (stable) | -- develop- ment | +0.20.5 (ancient) | + +0.94 (stable) | + +0.95 (beta) | + +develop- ment | ||||||||
- Declarations and Pagination and Layout Formatting Objects (§6.4) | +Declarations and Pagination and Layout Formatting Objects + (§6.4) | ||||||||||||||
- root | -- Basic | -- §6.4.2 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- declarations | -- Basic | -- §6.4.3 | -- no | -no | -- no | -- no | -- | ||||||||
- color-profile | -- Extended | -- §6.4.4 | -- no | -no | -- no | -- no | -- | ||||||||
- page-sequence | -- Basic | -- §6.4.5 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- layout-master-set | -- Basic | -- §6.4.6 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- page-sequence-master | -- Basic | -- §6.4.7 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- single-page-master-reference | -- Basic | -- §6.4.8 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- repeatable-page-master-reference | -- Basic | -- §6.4.9 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- repeatable-page-master-alternatives | -- Extended | -- §6.4.10 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- conditional-page-master-reference | -- Extended | -- §6.4.11 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- simple-page-master | -- Basic | -- §6.4.12 | -- yes | -partial | -- partial | -- partial | -
-
|
+ root | + +Basic | + +§6.4.2 | + +yes | + +yes | + +yes | + +yes | + +|
- region-body | -- Basic | -- §6.4.13 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- region-before | -- Extended | -- §6.4.14 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- region-after | -- Extended | -- §6.4.15 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- region-start | -- Extended | -- §6.4.16 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- region-end | -- Extended | -- §6.4.17 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- flow | -- Basic | -- §6.4.18 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- static-content | -- Extended | -- §6.4.19 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- title | -- Extended | -- §6.4.20 | -- no | -no | -- no | -- no | -+ | declarations | + +Basic | + +§6.4.3 | + +no | + +no | + +no | + +no | + +|
- Block Formatting Objects (§6.5) | +color-profile | + +Extended | + +§6.4.4 | + +no | + +no | + +no | + +no | + +||||||||
- block | -- Basic | -- §6.5.2 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- block-container | -- Extended | -- §6.5.3 | -- partial | -partial | -- partial | -- partial | -
-
|
+ page-sequence | + +Basic | + +§6.4.5 | + +yes | + +yes | + +yes | + +yes | + +|
- Inline Formatting Objects (§6.6) | +layout-master-set | + +Basic | + +§6.4.6 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- bidi-override | -- Extended | -- §6.6.2 | -- no | -no | -- no | -- no | -- | ||||||||
- character | -- Basic | -- §6.6.3 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- initial-property-set | -- Extended | -- §6.6.4 | -- no | -no | -- no | -- no | -- | ||||||||
- external-graphic | -- Basic | -- §6.6.5 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- instream-foreign-object | -- Extended | -- §6.6.6 | -- yes | -yes | -- yes | -- yes | -
-
|
+ page-sequence-master | + +Basic | + +§6.4.7 | + +yes | + +yes | + +yes | + +yes | + +|
- inline | -- Basic | -- §6.6.7 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- inline-container | -- Extended | -- §6.6.8 | -- no | -no | -- no | -- no | -- | ||||||||
- leader | -- Basic | -- §6.6.9 | -- partial | -yes | -- yes | -- yes | -- | ||||||||
- page-number | -- Basic | -- §6.6.10 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- page-number-citation | -- Extended | -- §6.6.11 | -- partial | -partial | -- partial | -- partial | -
-
|
+ single-page-master-reference | + +Basic | + +§6.4.8 | + +yes | + +yes | + +yes | + +yes | + ++ |
repeatable-page-master-reference | + +Basic | + +§6.4.9 | + +yes | + +yes | + +yes | + +yes | + +|||||||||
- Table Formatting Objects (§6.7) | +repeatable-page-master-alternatives | + +Extended | + ++ §6.4.10 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- table-and-caption | -- Basic | -- §6.7.2 | -- no | -no | -- no | -- no | -- | ||||||||
- table | -- Basic | -- §6.7.3 | -- partial | -partial | -- partial | -- partial | -
-
|
+ conditional-page-master-reference | + +Extended | + ++ §6.4.11 | + +yes | + +yes | + +yes | + +yes | + +|
- table-column | -- Basic | +simple-page-master | + +Basic | + +§6.4.12 | + +yes | + +partial | + +partial | + +partial | +- §6.7.4 | -- partial | -yes | -- yes | -- yes | -
|
+ |
- table-caption | -- Extended | -- §6.7.5 | -- no | -no | -- no | -- no | -- | ||||||||
- table-header | -- Basic | -- §6.7.6 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- table-footer | -- Extended | -- §6.7.7 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- table-body | -- Basic | -- §6.7.8 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- table-row | -- Basic | -- §6.7.9 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- table-cell | -- Basic | -- §6.7.10 | -- partial | -yes | -- yes | -- yes | -- | ||||||||
- List Formatting Objects (§6.8) | +region-body | + +Basic | + +§6.4.13 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- list-block | -- Basic | -- §6.8.2 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- list-item | -- Basic | -- §6.8.3 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- list-item-body | -- Basic | -- §6.8.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- list-item-label | -- Extended | -- §6.8.5 | -- yes | -yes | -- yes | -- yes | -+ | region-before | + +Extended | + +§6.4.14 | + +yes | + +yes | + +yes | + +yes | + +|
- Link and Multi Formatting Objects (§6.9) | +region-after | + +Extended | + +§6.4.15 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- basic-link | -- Extended | -- §6.9.2 | -- yes | -yes | -- yes | -- yes | -
-
|
+ region-start | + +Extended | + +§6.4.16 | + +yes | + +yes | + +yes | + +yes | + +|
- multi-switch | -- Extended | -- §6.9.3 | -- no | -no | -- no | -- no | -- | ||||||||
- multi-case | -- Basic | -- §6.9.4 | -- no | -no | -- no | -- no | -- | ||||||||
- multi-toggle | -- Extended | -- §6.9.5 | -- no | -no | -- no | -- no | -- | ||||||||
- multi-properties | -- Extended | -- §6.9.6 | -- no | -no | -- no | -- no | -- | ||||||||
- multi-property-set | -- Extended | -- §6.9.7 | -- no | -no | -- no | -- no | -+ | region-end | + +Extended | + +§6.4.17 | + +yes | + +yes | + +yes | + +yes | + +|
- Formatting Objects for Bookmarks (§6.11 in XSL 1.1 WD) | +flow | + +Basic | + +§6.4.18 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- bookmark-tree (since XSL 1.1) | -- Extended | -- §6.11.1 in XSL 1.1 WD | -- no | -yes | -- yes | -- yes | -
-
|
+ static-content | + +Extended | + +§6.4.19 | + +yes | + +yes | + +yes | + +yes | + +|
- bookmark (since XSL 1.1) | -- Extended | -- §6.11.2 in XSL 1.1 WD | -- no | -yes | -- yes | -- yes | -
-
|
+ title | + +Extended | + +§6.4.20 | + +no | + +no | + +no | + +no | + +|
- bookmark-title (since XSL 1.1) | -- Extended | -- §6.11.3 in XSL 1.1 WD | -- no | -partial | -- partial | -- partial | -
-
|
+ Block Formatting Objects (§6.5) | |||||||
- Out-of-line Formatting Objects (§6.10) | +block | + +Basic | + +§6.5.2 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- float | -- Extended | -- §6.10.2 | -- no | -no | -- no | -- no | -- | ||||||||
- footnote | -- Extended | -- §6.10.3 | -- yes | -partial | -- partial | -- partial | +block-container | + +Extended | + +§6.5.3 | + +partial | + +partial | + +partial | + +partial | +
|
- |
- footnote-body | -- Extended | -- §6.10.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- Other Formatting Objects (§6.11) | +|||||||||||||||
- wrapper | -- Basic | -- §6.11.2 | -- yes | -partial | -- partial | -- partial | -
-
|
+ Inline Formatting Objects (§6.6) | |||||||
- marker | -- Extended | -- §6.11.3 | -- yes | -yes | -- yes | -- yes | +bidi-override | + +Extended | + +§6.6.2 | + +no | + +no | + +no | + +no | +||
- retrieve-marker | -- Extended | -- §6.11.4 | -- yes | -yes | -- yes | -- yes | -- |
- The following is a summary of FOP's current support for the standard XSL-FO properties. -
-- Property Name | -- XSL-FO Conformance Level | -- Citation | -- Support in FOP | -- Comments | -|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- 0.20.5 (previous) | -0.93 (stable) | -- 0.94 (stable) | -- develop- ment | -||||||||||||
- Common Accessibility Properties (§7.4) | +character | + +Basic | + +§6.6.3 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- source-document | -- Basic | -- §7.4.1 | -- na | -na | -- na | -- na | -- | ||||||||
- role | -- Basic | -- §7.4.2 | -- na | -na | -- na | -- na | -+ | initial-property-set | + +Extended | + +§6.6.4 | + +no | + +no | + +no | + +no | + +|
- Common Absolute Position Properties (§7.5) | +external-graphic | + +Basic | + +§6.6.5 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- absolute-position | -- Complete | +instream-foreign-object | + +Extended | + +§6.6.6 | + +yes | + +yes | + +yes | + +yes | +- §7.5.1 | -- no | -yes | -- yes | -- yes | -
|
+ |
- top | -- Extended | -- §7.5.2 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- right | -- Extended | -- §7.5.3 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- bottom | -- Extended | -- §7.5.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- left | -- Extended | -- §7.5.5 | -- yes | -yes | -- yes | -- yes | -+ | inline | + +Basic | + +§6.6.7 | + +yes | + +yes | + +yes | + +yes | + +|
- Common Aural Properties (§7.6) | +inline-container | + +Extended | + +§6.6.8 | + +no | + +no | + +no | + +no | + +||||||||
- azimuth | -- Basic | -- §7.6.1 | -- na | -na | -- na | -- na | -- | ||||||||
- cue-after | -- Basic | -- §7.6.2 | -- na | -na | -- na | -- na | -- | ||||||||
- cue-before | -- Basic | -- §7.6.3 | -- na | -na | -- na | -- na | -- | ||||||||
- elevation | -- Basic | -- §7.6.4 | -- na | -na | -- na | -- na | -- | ||||||||
- pause-after | -- Basic | -- §7.6.5 | -- na | -na | -- na | -- na | -- | ||||||||
- pause-before | -- Basic | -- §7.6.6 | -- na | -na | -- na | -- na | -- | ||||||||
- pitch | -- Basic | -- §7.6.7 | -- na | -na | -- na | -- na | -- | ||||||||
- pitch-range | -- Basic | -- §7.6.8 | -- na | -na | -- na | -- na | -- | ||||||||
- play-during | -- Basic | -- §7.6.9 | -- na | -na | -- na | -- na | -- | ||||||||
- richness | -- Basic | -- §7.6.10 | -- na | -na | -- na | -- na | -- | ||||||||
- speak | -- Basic | -- §7.6.11 | -- na | -na | -- na | -- na | -- | ||||||||
- speak-header | -- Basic | -- §7.6.12 | -- na | -na | -- na | -- na | -- | ||||||||
- speak-numeral | -- Basic | -- §7.6.13 | -- na | -na | -- na | -- na | -- | ||||||||
- speak-punctuation | -- Basic | -- §7.6.14 | -- na | -na | -- na | -- na | -- | ||||||||
- speech-rate | -- Basic | -- §7.6.15 | -- na | -na | -- na | -- na | -- | ||||||||
- stress | -- Basic | -- §7.6.16 | -- na | -na | -- na | -- na | -- | ||||||||
- voice-family | -- Basic | -- §7.6.17 | -- na | -na | -- na | -- na | -- | ||||||||
- volume | -- Basic | -- §7.6.18 | -- na | -na | -- na | -- na | -+ | leader | + +Basic | + +§6.6.9 | + +partial | + +yes | + +yes | + +yes | + +|
- Common Border, Padding, and Background Properties (§7.7) | +page-number | + +Basic | + +§6.6.10 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- background-attachment | -- Extended | -- §7.7.1 | -- no | -no | -- no | -- no | -- | ||||||||
- background-color | -- Basic | -- §7.7.2 | -- yes | -partial | -- partial | -- partial | +page-number-citation | + +Extended | + +§6.6.11 | + +partial | + +partial | + +partial | + +partial | +
|
+ |
- background-image | -- Extended | -- §7.7.3 | -- yes | -partial | -- partial | -- partial | -
-
|
+ Table Formatting Objects (§6.7) | |||||||
- background-repeat | -- Extended | -- §7.7.4 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- background-position-horizontal | -- Extended | -- §7.7.5 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- background-position-vertical | -- Extended | -- §7.7.6 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- border-before-color | -- Basic | -- §7.7.7 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-before-style | -- Basic | -- §7.7.8 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-and-caption | + +Basic | + +§6.7.2 | + +no | + +no | + +no | + +no | + +|
- border-before-width | -- Basic | -- §7.7.9 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-after-color | -- Basic | -- §7.7.10 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-after-style | -- Basic | -- §7.7.11 | -- partial | -yes | -- yes | -- yes | +table | + +Basic | + +§6.7.3 | + +partial | + +partial | + +partial | + +partial | +
|
+ |
- border-after-width | -- Basic | -- §7.7.12 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-start-color | -- Basic | -- §7.7.13 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-start-style | -- Basic | -- §7.7.14 | -- partial | -yes | -- yes | -- yes | +table-column | + +Basic | + +§6.7.4 | + +partial | + +yes | + +yes | + +yes | +
|
+ |
- border-start-width | -- Basic | -- §7.7.15 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-end-color | -- Basic | -- §7.7.16 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-end-style | -- Basic | -- §7.7.17 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-caption | + +Extended | + +§6.7.5 | + +no | + +no | + +no | + +no | + +|
- border-end-width | -- Basic | -- §7.7.18 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-top-color | -- Basic | -- §7.7.19 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-top-style | -- Basic | -- §7.7.20 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-header | + +Basic | + +§6.7.6 | + +yes | + +yes | + +yes | + +yes | + +|
- border-top-width | -- Basic | -- §7.7.21 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-bottom-color | -- Basic | -- §7.7.22 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-bottom-style | -- Basic | -- §7.7.23 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-footer | + +Extended | + +§6.7.7 | + +yes | + +yes | + +yes | + +yes | + +|
- border-bottom-width | -- Basic | -- §7.7.24 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-left-color | -- Basic | -- §7.7.25 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-left-style | -- Basic | -- §7.7.26 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-body | + +Basic | + +§6.7.8 | + +yes | + +yes | + +yes | + +yes | + +|
- border-left-width | -- Basic | -- §7.7.27 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-right-color | -- Basic | -- §7.7.28 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-right-style | -- Basic | -- §7.7.29 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-row | + +Basic | + +§6.7.9 | + +yes | + +yes | + +yes | + +yes | + +|
- border-right-width | -- Basic | -- §7.7.30 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- padding-before | -- Basic | -- §7.7.31 | -- partial | -yes | -- yes | -- yes | -
-
|
- ||||||||
- padding-after | -- Basic | -- §7.7.32 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-cell | + +Basic | + +§6.7.10 | + +partial | + +yes | + +yes | + +yes | + +|
- padding-start | -- Basic | -- §7.7.33 | -- partial | -yes | -- yes | -- yes | +List Formatting Objects (§6.8) | +||||||||
list-block | + +Basic | + +§6.8.2 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
list-item | + +Basic | + +§6.8.3 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
list-item-body | + +Basic | + +§6.8.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
list-item-label | + +Extended | + +§6.8.5 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Link and Multi Formatting Objects (§6.9) | +|||||||||||||||
basic-link | + +Extended | + +§6.9.2 | + +yes | + +yes | + +yes | + +yes | +
|
+ ||||||||
- padding-end | -- Basic | -- §7.7.34 | -- partial | -yes | -- yes | -- yes | +multi-switch | + +Extended | + +§6.9.3 | + +no | + +no | + +no | + +no | + ++ | |
multi-case | + +Basic | + +§6.9.4 | + +no | + +no | + +no | + +no | + ++ | ||||||||
multi-toggle | + +Extended | + +§6.9.5 | + +no | + +no | + +no | + +no | + ++ | ||||||||
multi-properties | + +Extended | + +§6.9.6 | + +no | + +no | + +no | + +no | + ++ | ||||||||
multi-property-set | + +Extended | + +§6.9.7 | + +no | + +no | + +no | + +no | + ++ | ||||||||
Formatting Objects for Bookmarks (§6.11 in XSL 1.1 WD) | +|||||||||||||||
bookmark-tree (since + XSL 1.1) | + +Extended | + +§6.11.1 in XSL + 1.1 WD | + +no | + +yes | + +yes | + +yes | +
|
+ ||||||||
- padding-top | -- Basic | -- §7.7.35 | -- partial | -yes | -- yes | -- yes | +bookmark (since XSL 1.1) | + +Extended | + +§6.11.2 in XSL 1.1 + WD | + +no | + +yes | + +yes | + +yes | + +
+
|
+ |
bookmark-title + (since XSL 1.1) | + +Extended | + +§6.11.3 in + XSL 1.1 WD | + +no | + +partial | + +partial | + +partial | +
|
+ ||||||||
Out-of-line Formatting Objects (§6.10) | |||||||||||||||
- padding-bottom | -- Basic | -- §7.7.36 | -- partial | -yes | -- yes | -- yes | +float | + +Extended | + +§6.10.2 | + +no | + +no | + +no | + +no | + ++ | |
footnote | + +Extended | + +§6.10.3 | + +yes | + +partial | + +partial | + +partial | +
|
+ ||||||||
footnote-body | + +Extended | + +§6.10.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Other Formatting Objects (§6.11) | +|||||||||||||||
wrapper | + +Basic | + +§6.11.2 | + +yes | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
marker | + +Extended | + +§6.11.3 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
retrieve-marker | + +Extended | + +§6.11.4 | + +yes | + +yes | + +yes | + +yes | + ++ |
The following is a summary of FOP's current support for the standard XSL-FO properties.
+ +Property Name | + +XSL-FO Conformance Level | + +Citation | + +Support in FOP | + +Comments | +|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0.20.5 (ancient) | + +0.94 (stable) | + +0.95 (beta) | + +develop- ment | +||||||||||||
Common Accessibility Properties (§7.4) | +|||||||||||||||
source-document | + +Basic | + +§7.4.1 | + +na | + +na | + +na | + +na | + ++ | ||||||||
role | + +Basic | + +§7.4.2 | + +na | + +na | + +na | + +na | + ++ | ||||||||
Common Absolute Position Properties (§7.5) | +|||||||||||||||
absolute-position | + +Complete | + +§7.5.1 | + +no | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
top | + +Extended | + +§7.5.2 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
right | + +Extended | + +§7.5.3 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
bottom | + +Extended | + +§7.5.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
left | + +Extended | + +§7.5.5 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Common Aural Properties (§7.6) | +|||||||||||||||
azimuth | + +Basic | + +§7.6.1 | + +na | + +na | + +na | + +na | + ++ | ||||||||
cue-after | + +Basic | + +§7.6.2 | + +na | + +na | + +na | + +na | + ++ | ||||||||
cue-before | + +Basic | + +§7.6.3 | + +na | + +na | + +na | + +na | + ++ | ||||||||
elevation | + +Basic | + +§7.6.4 | + +na | + +na | + +na | + +na | + ++ | ||||||||
pause-after | + +Basic | + +§7.6.5 | + +na | + +na | + +na | + +na | + ++ | ||||||||
pause-before | + +Basic | + +§7.6.6 | + +na | + +na | + +na | + +na | + ++ | ||||||||
pitch | + +Basic | + +§7.6.7 | + +na | + +na | + +na | + +na | + ++ | ||||||||
pitch-range | + +Basic | + +§7.6.8 | + +na | + +na | + +na | + +na | + ++ | ||||||||
play-during | + +Basic | + +§7.6.9 | + +na | + +na | + +na | + +na | + ++ | ||||||||
richness | + +Basic | + +§7.6.10 | + +na | + +na | + +na | + +na | + ++ | ||||||||
speak | + +Basic | + +§7.6.11 | + +na | + +na | + +na | + +na | + ++ | ||||||||
speak-header | + +Basic | + +§7.6.12 | + +na | + +na | + +na | + +na | + ++ | ||||||||
speak-numeral | + +Basic | + +§7.6.13 | + +na | + +na | + +na | + +na | + ++ | ||||||||
speak-punctuation | + +Basic | + +§7.6.14 | + +na | + +na | + +na | + +na | + ++ | ||||||||
speech-rate | + +Basic | + +§7.6.15 | + +na | + +na | + +na | + +na | + ++ | ||||||||
stress | + +Basic | + +§7.6.16 | + +na | + +na | + +na | + +na | + ++ | ||||||||
voice-family | + +Basic | + +§7.6.17 | + +na | + +na | + +na | + +na | + ++ | ||||||||
volume | + +Basic | + +§7.6.18 | + +na | + +na | + +na | + +na | + ++ | ||||||||
Common Border, Padding, and Background Properties + (§7.7) | +|||||||||||||||
background-attachment | + +Extended | + +§7.7.1 | + +no | + +no | + +no | + +no | + ++ | ||||||||
background-color | + +Basic | + +§7.7.2 | + +yes | + +partial | + +yes | + +yes | + +
+
|
+ ||||||||
background-image | + +Extended | + +§7.7.3 | + +yes | + +partial | + +yes | + +yes | + +
+
|
+ ||||||||
background-repeat | + +Extended | + +§7.7.4 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
background-position-horizontal | + +Extended | + +§7.7.5 | + +no | + +partial | + +partial | + +partial | + +[0.94 and later] Ignored when background-repeat set to + "repeat" or "repeat-x" | +||||||||
background-position-vertical | + +Extended | + +§7.7.6 | + +no | + +partial | + +partial | + +partial | + +[0.94 and later] Ignored when background-repeat set to + "repeat" or "repeat-y" | +||||||||
border-before-color | + +Basic | + +§7.7.7 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-before-style | + +Basic | + +§7.7.8 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
border-before-width | + +Basic | + +§7.7.9 | + +yes | + +partial | + +yes | + +yes | + +
+
|
+ ||||||||
border-after-color | + +Basic | + +§7.7.10 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-after-style | + +Basic | + +§7.7.11 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
border-after-width | + +Basic | + +§7.7.12 | + +yes | + +partial | + +yes | + +yes | + +
+
|
+ ||||||||
border-start-color | + +Basic | + +§7.7.13 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-start-style | + +Basic | + +§7.7.14 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
border-start-width | + +Basic | + +§7.7.15 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-end-color | + +Basic | + +§7.7.16 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-end-style | + +Basic | + +§7.7.17 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
border-end-width | + +Basic | + +§7.7.18 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-top-color | + +Basic | + +§7.7.19 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-top-style | + +Basic | + +§7.7.20 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
border-top-width | + +Basic | + +§7.7.21 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-bottom-color | + +Basic | + +§7.7.22 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-bottom-style | + +Basic | + +§7.7.23 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
border-bottom-width | + +Basic | + +§7.7.24 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-left-color | + +Basic | + +§7.7.25 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-left-style | + +Basic | + +§7.7.26 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
border-left-width | + +Basic | + +§7.7.27 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-right-color | + +Basic | + +§7.7.28 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
border-right-style | + +Basic | + +§7.7.29 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
border-right-width | + +Basic | + +§7.7.30 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
padding-before | + +Basic | + +§7.7.31 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
padding-after | + +Basic | + +§7.7.32 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
padding-start | + +Basic | + +§7.7.33 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
padding-end | + +Basic | + +§7.7.34 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
padding-top | + +Basic | + +§7.7.35 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
padding-bottom | + +Basic | + +§7.7.36 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
padding-left | + +Basic | + +§7.7.37 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
padding-right | + +Basic | + +§7.7.38 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
Common Font Properties (§7.8) | +|||||||||||||||
font-family | + +Basic | + +§7.8.2 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
font-selection-strategy | + +Complete | + +§7.8.3 | + +no | + +no | + +no | + +no | + ++ | ||||||||
font-size | + +Basic | + +§7.8.4 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
font-stretch | + +Extended | + +§7.8.5 | + +no | + +no | + +no | + +no | + ++ | ||||||||
font-size-adjust | + +Extended | + +§7.8.6 | + +no | + +no | + +no | + +no | + ++ | ||||||||
font-style | + +Basic | + +§7.8.7 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
font-variant | + +Basic | + +§7.8.8 | + +yes | + +no | + +no | + +no | + ++ | ||||||||
font-weight | + +Basic | + +§7.8.9 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
Common Hyphenation Properties (§7.9) | +|||||||||||||||
country | + +Extended | + +§7.9.1 | + +yes | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
language | + +Extended | + +§7.9.2 | + +yes | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
script | + +Extended | + +§7.9.3 | + +no | + +no | + +no | + +no | + ++ | ||||||||
hyphenate | + +Extended | + +§7.9.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
hyphenation-character | + +Extended | + +§7.9.5 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
hyphenation-push-character-count | + +Extended | + +§7.9.6 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
hyphenation-remain-character-count | + +Extended | + +§7.9.7 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Common Margin Properties - Block (§7.10) | +|||||||||||||||
margin-top | + +Basic | + +§7.10.1 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
margin-bottom | + +Basic | + +§7.10.2 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
margin-left | + +Basic | + +§7.10.3 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
margin-right | + +Basic | + +§7.10.4 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
space-before | + +Basic | + +§7.10.5 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
space-after | + +Basic | + +§7.10.6 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
start-indent | + +Basic | + +§7.10.7 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
end-indent | + +Basic | + +§7.10.8 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Common Margin Properties - Inline (§7.11) | +|||||||||||||||
space-end | + +Basic | + +§7.11.1 | + +no | + +no | + +no | + +no | + ++ | ||||||||
space-start | + +Basic | + +§7.11.2 | + +no | + +no | + +no | + +no | + ++ | ||||||||
Common Relative Position Properties (§7.12) | +|||||||||||||||
relative-position | + +Extended | + +§7.12.1 | + +no | + +no | + +no | + +no | + ++ | ||||||||
Area Alignment Properties (§7.13) | +|||||||||||||||
alignment-adjust | + +Basic | + +§7.13.1 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
alignment-baseline | + +Basic | + +§7.13.2 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
baseline-shift | + +Basic | + +§7.13.3 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
display-align | + +Extended | + +§7.13.4 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
dominant-baseline | + +Basic | + +§7.13.5 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
relative-align | + +Extended | + +§7.13.6 | + +no | + +no | + +no | + +no | + ++ | ||||||||
Area Dimension Properties (§7.14) | +|||||||||||||||
block-progression-dimension | + +Basic | + +§7.14.1 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
content-height | + +Extended | + +§7.14.2 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
content-width | + +Extended | + +§7.14.3 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
height | + +Basic | + +§7.14.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
inline-progression-dimension | + +Basic | + +§7.14.5 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
max-height | + +Complete | + +§7.14.6 | + +no | + +no | + +no | + +no | + ++ | ||||||||
max-width | + +Complete | + +§7.14.7 | + +no | + +no | + +no | + +no | + ++ | ||||||||
min-height | + +Complete | + +§7.14.8 | + +no | + +no | + +no | + +no | + ++ | ||||||||
min-width | + +Complete | + +§7.14.9 | + +no | + +no | + +no | + +no | + ++ | ||||||||
scaling | + +Extended | + +§7.14.10 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
scaling-method | + +Extended | + +§7.14.11 | + +no | + +no | + +no | + +no | + ++ | ||||||||
width | + +Basic | + +§7.14.12 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Block and Line-related Properties (§7.15) | +|||||||||||||||
hyphenation-keep | + +Extended | + +§7.15.1 | + +no | + +no | + +no | + +no | + ++ | ||||||||
hyphenation-ladder-count | + +Extended | + +§7.15.2 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
last-line-end-indent | + +Extended | + +§7.15.3 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
line-height | + +Basic | + +§7.15.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
line-height-shift-adjustment | + +Extended | + +§7.15.5 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
line-stacking-strategy | + +Basic | + +§7.15.6 | + +no | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
linefeed-treatment | + +Extended | + +§7.15.7 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
white-space-treatment | + +Extended | + +§7.15.8 | + +no | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
text-align | + +Basic | + +§7.15.9 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
text-align-last | + +Extended | + +§7.15.10 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
text-indent | + +Basic | + +§7.15.11 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
white-space-collapse | + +Extended | + +§7.15.12 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
wrap-option | + +Basic | + +§7.15.13 | + +yes | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
Character Properties (§7.16) | +|||||||||||||||
character | + +Basic | + +§7.16.1 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
letter-spacing | + +Extended | + +§7.16.2 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
suppress-at-line-break | + +Extended | + +§7.16.3 | + +no | + +no | + +no | + +no | + ++ | ||||||||
text-decoration | + +Extended | + +§7.16.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
text-shadow | + +Extended | + +§7.16.5 | + +no | + +no | + +no | + +no | + ++ | ||||||||
text-transform | + +Extended | + +§7.16.6 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
treat-as-word-space | + +Extended | + +§7.16.7 | + +no | + +no | + +no | + +no | + ++ | ||||||||
word-spacing | + +Extended | + +§7.16.8 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
Color-related Properties (§7.17) | +|||||||||||||||
color | + +Basic | + +§7.17.1 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
color-profile-name | + +Extended | + +§7.17.2 | + +no | + +no | + +no | + +no | + ++ | ||||||||
rendering-intent | + +Extended | + +§7.17.3 | + +no | + +no | + +no | + +no | + ++ | ||||||||
Float-related Properties (§7.18) | +|||||||||||||||
clear | + +Extended | + +§7.18.1 | + +no | + +no | + +no | + +no | + ++ | ||||||||
float | + +Extended | + +§7.18.2 | + +no | + +no | + +no | + +no | + ++ | ||||||||
intrusion-displace | + +Extended | + +§7.18.3 | + +no | + +no | + +no | + +no | + ++ | ||||||||
Keeps and Breaks Properties (§7.19) | +|||||||||||||||
break-after | + +Basic | + +§7.19.1 | + +yes | + +partial | + +yes | + +yes | + +
+
|
+ ||||||||
break-before | + +Basic | + +§7.19.2 | + +yes | + +partial | + +yes | + +yes | + +
+
|
+ ||||||||
keep-together | + +Extended | + +§7.19.3 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
keep-with-next | + +Basic | + +§7.19.4 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
keep-with-previous | + +Basic | + +§7.19.5 | + +partial | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
orphans | + +Basic | + +§7.19.6 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
widows | + +Basic | + +§7.19.7 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
Layout-related Properties (§7.20) | +|||||||||||||||
clip | + +Extended | + +§7.20.1 | + +no | + +no | + +no | + +no | + ++ | ||||||||
overflow | + +Basic | + +§7.20.2 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
reference-orientation | + +Extended | + +§7.20.3 | + +no | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
span | + +Extended | + +§7.20.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Leader and Rule Properties (§7.21) | +|||||||||||||||
leader-alignment | + +Extended | + +§7.21.1 | + +partial | + +no | + +no | + +no | + +
+
|
+ ||||||||
leader-pattern | + +Basic | + +§7.21.2 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
leader-pattern-width | + +Extended | + +§7.21.3 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
leader-length | + +Basic | + +§7.21.4 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
rule-style | + +Basic | + +§7.21.5 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
rule-thickness | + +Basic | + +§7.21.6 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Properties for Dynamic Effects Formatting Objects + (§7.22) | +|||||||||||||||
active-state | + +Extended | + +§7.22.1 | + +no | + +no | + +no | + +no | + ++ | ||||||||
auto-restore | + +Extended | + +§7.22.2 | + +no | + +no | + +no | + +no | + ++ | ||||||||
case-name | + +Extended | + +§7.22.3 | + +no | + +no | + +no | + +no | + ++ | ||||||||
case-title | + +Extended | + +§7.22.4 | + +no | + +no | + +no | + +no | + ++ | ||||||||
destination-placement-offset | + +Extended | + +§7.22.5 | + +no | + +no | + +no | + +no | + ++ | ||||||||
external-destination | + +Basic | + +§7.22.6 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
indicate-destination | + +Extended | + +§7.22.7 | + +no | + +no | + +no | + +no | + ++ | ||||||||
internal-destination | + +Extended | + +§7.22.8 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
show-destination | + +Extended | + +§7.22.9 | + +no | + +no | + +no | + +no | + ++ | ||||||||
starting-state | + +Extended | + +§7.22.10 | + +no | + +partial | + +partial | + +partial | + +
+
|
+ ||||||||
switch-to | + +Extended | + +§7.22.11 | + +no | + +no | + +no | + +no | + ++ | ||||||||
target-presentation-context | + +Extended | + +§7.22.12 | + +no | + +no | + +no | + +no | + ++ | ||||||||
target-processing-context | + +Extended | + +§7.22.13 | + +no | + +no | + +no | + +no | + ++ | ||||||||
target-stylesheet | + +Extended | + +§7.22.14 | + +no | + +no | + +no | + +no | + ++ | ||||||||
Properties for Markers (§7.23) | +|||||||||||||||
marker-class-name | + +Extended | + +§7.23.1 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
retrieve-class-name | + +Extended | + +§7.23.2 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
retrieve-position | + +Extended | + +§7.23.3 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
retrieve-boundary | + +Extended | + +§7.23.4 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
Properties for Number to String Conversion (§7.24) | +|||||||||||||||
format | + +Basic | + +§7.24.1 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
grouping-separator | + +Extended | + +§7.24.2 | + +no | + +no | + +no | + +no | + ++ | ||||||||
grouping-size | + +Extended | + +§7.24.3 | + +no | + +no | + +no | + +no | + ++ | ||||||||
letter-value | + +Basic | + +§7.24.4 | + +no | + +no | + +no | + +no | + ++ | ||||||||
Pagination and Layout Properties (§7.25) | +|||||||||||||||
blank-or-not-blank | + +Extended | + +§7.25.1 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
column-count | + +Extended | + +§7.25.2 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
column-gap | + +Extended | + +§7.25.3 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
extent | + +Extended | + +§7.25.4 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
flow-name | + +Basic | + +§7.25.5 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
force-page-count | + +Extended | + +§7.25.6 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
initial-page-number | + +Basic | + +§7.25.7 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
master-name | + +Basic | + +§7.25.8 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
master-reference | + +Basic | + +§7.25.9 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
maximum-repeats | + +Extended | + +§7.25.10 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
media-usage | + +Extended | + +§7.25.11 | + +no | + +no | + +no | + +no | + ++ | ||||||||
odd-or-even | + +Extended | + +§7.25.12 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
page-height | + +Basic | + +§7.25.13 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
page-position | + +Extended | + +§7.25.14 | + +partial | + +yes | + +yes | + +yes | + +
+
|
+ ||||||||
page-width | + +Basic | + +§7.25.15 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
precedence | + +Extended | + +§7.25.16 | + +no | + +yes | + +yes | + +yes | + ++ | ||||||||
region-name | + +Basic | + +§7.25.17 | + +yes | + +yes | + +yes | + +yes | + ++ | ||||||||
Table Properties (§7.26) | +|||||||||||||||
border-after-precedence | + +Basic | + +§7.26.1 | + +no | + +no | + +no | + +no | + ++ | ||||||||
border-before-precedence | + +Basic | + +§7.26.2 | + +no | + +no | + +no | + +no | + +|||||||||
- padding-left | -- Basic | -- §7.7.37 | -- partial | -yes | -- yes | -- yes | +border-collapse | + +Extended | + +§7.26.3 | + +partial | + +yes | + +yes | + +yes | +
|
+ |
- padding-right | -- Basic | -- §7.7.38 | -- partial | -yes | -- yes | -- yes | -
-
|
+ border-end-precedence | + +Basic | + +§7.26.4 | + +no | + +no | + +no | + +no | + +|
- Common Font Properties (§7.8) | +border-separation | + +Extended | + +§7.26.5 | + +no | + +yes | + +yes | + +yes | + +||||||||
- font-family | -- Basic | -- §7.8.2 | -- partial | -partial | -- partial | -- partial | -
-
|
+ border-start-precedence | + +Basic | + +§7.26.6 | + +no | + +no | + +no | + +no | + +|
- font-selection-strategy | -- Complete | -- §7.8.3 | -- no | -no | -- no | -- no | -- | ||||||||
- font-size | -- Basic | -- §7.8.4 | -- partial | -yes | -- yes | -- yes | -
-
|
+ caption-side | + +Complete | + +§7.26.7 | + +no | + +no | + +no | + +no | + +|
- font-stretch | -- Extended | -- §7.8.5 | -- no | -no | -- no | -- no | -- | ||||||||
- font-size-adjust | -- Extended | -- §7.8.6 | -- no | -no | -- no | -- no | -- | ||||||||
- font-style | -- Basic | -- §7.8.7 | -- partial | -yes | -- yes | -- yes | -
-
|
+ column-number | + +Basic | + +§7.26.8 | + +no | + +yes | + +yes | + +yes | + +|
- font-variant | -- Basic | -- §7.8.8 | -- yes | -no | -- no | -- no | -- | ||||||||
- font-weight | -- Basic | -- §7.8.9 | -- partial | -partial | -- partial | -- partial | +column-width | + +Basic | + +§7.26.9 | + +partial | + +yes | + +yes | + +yes | +
|
+ |
- Common Hyphenation Properties (§7.9) | +empty-cells | + +Extended | + +§7.26.10 | + +no | + +no | + +no | + +no | + +||||||||
- country | -- Extended | -- §7.9.1 | -- yes | -yes | -- yes | -- yes | -
-
|
+ ends-row | + +Extended | + +§7.26.11 | + +no | + +yes | + +yes | + +yes | + +|
- language | -- Extended | -- §7.9.2 | -- yes | -yes | -- yes | -- yes | -
-
|
+ number-columns-repeated | + +Basic | + +§7.26.12 | + +no | + +yes | + +yes | + +yes | + +|
- script | -- Extended | -- §7.9.3 | -- no | -no | -- no | -- no | -- | ||||||||
- hyphenate | -- Extended | -- §7.9.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- hyphenation-character | -- Extended | -- §7.9.5 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- hyphenation-push-character-count | -- Extended | -- §7.9.6 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- hyphenation-remain-character-count | -- Extended | -- §7.9.7 | -- yes | -yes | -- yes | -- yes | -+ | number-columns-spanned | + +Basic | + +§7.26.13 | + +yes | + +yes | + +yes | + +yes | + +|
- Common Margin Properties - Block (§7.10) | +number-rows-spanned | + +Basic | + +§7.26.14 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- margin-top | -- Basic | -- §7.10.1 | -- partial | -yes | -- yes | -- yes | -
-
|
+ starts-row | + +Extended | + +§7.26.15 | + +no | + +yes | + +yes | + +yes | + +|
- margin-bottom | -- Basic | -- §7.10.2 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-layout | + +Extended | + +§7.26.16 | + +no | + +no | + +no | + +no | + +|
- margin-left | -- Basic | -- §7.10.3 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-omit-footer-at-break | + +Extended | + +§7.26.17 | + +yes | + +yes | + +yes | + +yes | + +|
- margin-right | -- Basic | -- §7.10.4 | -- partial | -yes | -- yes | -- yes | -
-
|
+ table-omit-header-at-break | + +Extended | + +§7.26.18 | + +yes | + +yes | + +yes | + +yes | + +|
- space-before | -- Basic | -- §7.10.5 | -- partial | -partial | -- partial | -- partial | -
-
|
+ Writing-mode-related Properties (§7.27) | |||||||
- space-after | -- Basic | -- §7.10.6 | -- partial | -partial | -- partial | -- partial | -
-
|
+ direction | + +Basic | + +§7.27.1 | + +no | + +no | + +no | + +no | + +|
- start-indent | -- Basic | -- §7.10.7 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- end-indent | -- Basic | -- §7.10.8 | -- yes | -yes | -- yes | -- yes | -+ | glyph-orientation-horizontal | + +Extended | + +§7.27.2 | + +no | + +no | + +no | + +no | + +|
- Common Margin Properties - Inline (§7.11) | +glyph-orientation-vertical | + +Extended | + +§7.27.3 | + +no | + +no | + +no | + +no | + +||||||||
- space-end | -- Basic | -- §7.11.1 | -- no | +text-altitude | + +Extended | + +§7.27.4 | +no | -- no | -- no | -+ + | no | + +no | + +no | + +||
- space-start | -- Basic | -- §7.11.2 | -- no | +text-depth | + +Extended | + +§7.27.5 | + +no | + +no | + +no | +no | -- no | -- no | -+ + | ||
- Common Relative Position Properties (§7.12) | +unicode-bidi | + +Extended | + +§7.27.6 | + +no | + +no | + +no | + +no | + +||||||||
- relative-position | -- Extended | -- §7.12.1 | -- no | +writing-mode | + +Basic | + +§7.27.7 | + +no | + +no | + +no | +no | -- no | -- no | -+ + | ||
- Area Alignment Properties (§7.13) | +Miscellaneous Properties (§7.28) | ||||||||||||||
- alignment-adjust | -- Basic | -- §7.13.1 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- alignment-baseline | -- Basic | -- §7.13.2 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- baseline-shift | -- Basic | -- §7.13.3 | -- partial | -yes | -- yes | -- yes | -
-
|
+ content-type | + +Extended | + +§7.28.1 | + +no | + +no | + +no | + +no | + +|
- display-align | -- Extended | -- §7.13.4 | -- partial | -partial | -- partial | -- partial | +id | + +Basic | + +§7.28.2 | + +yes | + +partial | + +partial | + +partial | +
|
- |
- dominant-baseline | -- Basic | -- §7.13.5 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- relative-align | -- Extended | -- §7.13.6 | -- no | -no | -- no | -- no | -- | ||||||||
- Area Dimension Properties (§7.14) | -|||||||||||||||
- block-progression-dimension | -- Basic | -- §7.14.1 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- content-height | -- Extended | -- §7.14.2 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- content-width | -- Extended | -- §7.14.3 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- height | -- Basic | -- §7.14.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- inline-progression-dimension | -- Basic | -- §7.14.5 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- max-height | -- Complete | -- §7.14.6 | -- no | -no | -- no | -- no | -- | ||||||||
- max-width | -- Complete | -- §7.14.7 | -- no | -no | -- no | -- no | -- | ||||||||
- min-height | -- Complete | -- §7.14.8 | -- no | -no | -- no | -- no | -- | ||||||||
- min-width | -- Complete | -- §7.14.9 | -- no | -no | -- no | -- no | -- | ||||||||
- scaling | -- Extended | -- §7.14.10 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- scaling-method | -- Extended | -- §7.14.11 | -- no | -no | -- no | -- no | -- | ||||||||
- width | -- Basic | -- §7.14.12 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- Block and Line-related Properties (§7.15) | +|||||||||||||||
- hyphenation-keep | -- Extended | -- §7.15.1 | -- no | -no | -- no | -- no | -- | ||||||||
- hyphenation-ladder-count | -- Extended | -- §7.15.2 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- last-line-end-indent | -- Extended | -- §7.15.3 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- line-height | -- Basic | -- §7.15.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- line-height-shift-adjustment | -- Extended | -- §7.15.5 | -- no | -no | -- no | -- yes | -- | ||||||||
- line-stacking-strategy | -- Basic | -- §7.15.6 | -- no | -partial | -- partial | -- partial | -
-
|
+ provisional-label-separation | + +Basic | + +§7.28.3 | + +yes | + +yes | + +yes | + +yes | + +|
- linefeed-treatment | -- Extended | -- §7.15.7 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- white-space-treatment | -- Extended | -- §7.15.8 | -- no | -partial | -- partial | -- partial | -
-
|
+ provisional-distance-between-starts | + +Basic | + +§7.28.4 | + +yes | + +yes | + +yes | + +yes | + +|
- text-align | -- Basic | -- §7.15.9 | -- partial | -partial | -- partial | -- partial | -
-
|
+ ref-id | + +Extended | + +§7.28.5 | + +yes | + +yes | + +yes | + +yes | + +|
- text-align-last | -- Extended | -- §7.15.10 | -- partial | -partial | -- partial | -- partial | -
-
|
+ score-spaces | + +Extended | + +§7.28.6 | + +no | + +no | + +no | + +no | + +|
- text-indent | -- Basic | -- §7.15.11 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- white-space-collapse | -- Extended | -- §7.15.12 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- wrap-option | -- Basic | -- §7.15.13 | -- yes | -partial | -- partial | -- partial | -
-
|
+ src | + +Basic | + +§7.28.7 | + +yes | + +yes | + +yes | + +yes | + +|
- Character Properties (§7.16) | +visibility | + +Extended | + +§7.28.8 | + +no | + +no | + +no | + +no | + +||||||||
- character | -- Basic | -- §7.16.1 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- letter-spacing | -- Extended | -- §7.16.2 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- suppress-at-line-break | -- Extended | -- §7.16.3 | -- no | -no | -- no | -- no | -- | ||||||||
- text-decoration | -- Extended | -- §7.16.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- text-shadow | -- Extended | -- §7.16.5 | -- no | -no | -- no | -- no | -- | ||||||||
- text-transform | -- Extended | -- §7.16.6 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- treat-as-word-space | -- Extended | -- §7.16.7 | -- no | -no | -- no | -- no | -- | ||||||||
- word-spacing | -- Extended | -- §7.16.8 | -- no | -yes | -- yes | -- yes | -+ | z-index | + +Extended | + +§7.28.9 | + +no | + +no | + +no | + +no | + +|
- Color-related Properties (§7.17) | +Shorthand Properties (§7.29) | ||||||||||||||
- color | -- Basic | -- §7.17.1 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- color-profile-name | -- Extended | -- §7.17.2 | -- no | -no | -- no | -- no | -- | ||||||||
- rendering-intent | -- Extended | -- §7.17.3 | -- no | -no | -- no | -- no | -+ | background | + +Complete | + +§7.29.1 | + +no | + +no | + +no | + +no | + +|
- Float-related Properties (§7.18) | +background-position | + +Complete | + +§7.29.2 | + +no | + +yes | + +yes | + +yes | + +||||||||
- clear | -- Extended | -- §7.18.1 | -- no | -no | -- no | -- no | -- | ||||||||
- float | -- Extended | -- §7.18.2 | -- no | -no | -- no | -- no | -- | ||||||||
- intrusion-displace | -- Extended | -- §7.18.3 | -- no | -no | -- no | -- no | -+ | border | + +Complete | + +§7.29.3 | + +no | + +yes | + +yes | + +yes | + +|
- Keeps and Breaks Properties (§7.19) | +border-bottom | + +Complete | + +§7.29.4 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- break-after | -- Basic | -- §7.19.1 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- break-before | -- Basic | -- §7.19.2 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- keep-together | -- Extended | -- §7.19.3 | -- partial | -partial | -- partial | -- partial | +border-color | + +Complete | + +§7.29.5 | + +partial | + +yes | + +yes | + +yes | +
|
|
- keep-with-next | -- Basic | -- §7.19.4 | -- partial | -partial | -- partial | -- partial | -
-
|
- ||||||||
- keep-with-previous | -- Basic | -- §7.19.5 | -- partial | -partial | -- partial | -- partial | -
-
|
- ||||||||
- orphans | -- Basic | -- §7.19.6 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- widows | -- Basic | -- §7.19.7 | -- no | -yes | -- yes | -- yes | -+ | border-left | + +Complete | + +§7.29.6 | + +yes | + +yes | + +yes | + +yes | + +|
- Layout-related Properties (§7.20) | +border-right | + +Complete | + +§7.29.7 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- clip | -- Extended | -- §7.20.1 | -- no | -no | -- no | -- no | -- | ||||||||
- overflow | -- Basic | -- §7.20.2 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- reference-orientation | -- Extended | -- §7.20.3 | -- no | -yes | -- yes | -- yes | +border-style | + +Complete | + +§7.29.8 | + +partial | + +yes | + +yes | + +yes | +
|
+ |
- span | -- Extended | -- §7.20.4 | -- yes | -yes | -- yes | -- yes | -+ | border-spacing | + +Complete | + +§7.29.9 | + +no | + +yes | + +yes | + +yes | + +|
- Leader and Rule Properties (§7.21) | +border-top | + +Complete | + +§7.29.10 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- leader-alignment | -- Extended | -- §7.21.1 | -- partial | -no | -- no | -- no | -
-
|
+ border-width | + +Complete | + +§7.29.11 | + +yes | + +yes | + +yes | + +yes | + +|
- leader-pattern | -- Basic | -- §7.21.2 | -- partial | -yes | -- yes | -- yes | -
-
|
+ cue | + +Complete | + +§7.29.12 | + +na | + +na | + +na | + +na | + +|
- leader-pattern-width | -- Extended | -- §7.21.3 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- leader-length | -- Basic | +font | + +Complete | + +§7.29.13 | + +no | + +partial | + +partial | + +partial | +- §7.21.4 | -- partial | -yes | -- yes | -- yes | -
|
- |
- rule-style | -- Basic | -- §7.21.5 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- rule-thickness | -- Basic | -- §7.21.6 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- Properties for Dynamic Effects Formatting Objects (§7.22) | +|||||||||||||||
- active-state | -- Extended | -- §7.22.1 | -- no | -no | -- no | -- no | -- | ||||||||
- auto-restore | -- Extended | -- §7.22.2 | -- no | -no | -- no | -- no | -- | ||||||||
- case-name | -- Extended | -- §7.22.3 | -- no | -no | -- no | -- no | -- | ||||||||
- case-title | -- Extended | -- §7.22.4 | -- no | -no | -- no | -- no | -- | ||||||||
- destination-placement-offset | -- Extended | -- §7.22.5 | -- no | -no | -- no | -- no | -- | ||||||||
- external-destination | -- Basic | -- §7.22.6 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- indicate-destination | -- Extended | -- §7.22.7 | -- no | -no | -- no | -- no | -- | ||||||||
- internal-destination | -- Extended | -- §7.22.8 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- show-destination | -- Extended | -- §7.22.9 | -- no | -no | -- no | -- no | -- | ||||||||
- starting-state | -- Extended | -- §7.22.10 | -- no | -partial | -- partial | -- partial | +margin | + +Complete | + +§7.29.14 | + +partial | + +yes | + +yes | + +yes | +
|
- |
- switch-to | -- Extended | -- §7.22.11 | -- no | -no | -- no | -- no | -- | ||||||||
- target-presentation-context | -- Extended | -- §7.22.12 | -- no | -no | -- no | -- no | -- | ||||||||
- target-processing-context | -- Extended | -- §7.22.13 | -- no | -no | -- no | -- no | -- | ||||||||
- target-stylesheet | -- Extended | -- §7.22.14 | -- no | -no | -- no | -- no | -+ | ||||||||
- Properties for Markers (§7.23) | +padding | + +Complete | + +§7.29.15 | + +partial | + +yes | + +yes | + +yes | + +
+
|
|||||||
- marker-class-name | -- Extended | -- §7.23.1 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- retrieve-class-name | -- Extended | -- §7.23.2 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- retrieve-position | -- Extended | -- §7.23.3 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- retrieve-boundary | -- Extended | -- §7.23.4 | -- no | -yes | -- yes | -- yes | -+ | page-break-after | + +Complete | + +§7.29.16 | + +no | + +yes | + +yes | + +yes | + +|
- Properties for Number to String Conversion (§7.24) | +page-break-before | + +Complete | + +§7.29.17 | + +no | + +yes | + +yes | + +yes | + +||||||||
- format | -- Basic | -- §7.24.1 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- grouping-separator | -- Extended | -- §7.24.2 | -- no | -no | -- no | -- no | -- | ||||||||
- grouping-size | -- Extended | -- §7.24.3 | -- no | -no | -- no | -- no | -- | ||||||||
- letter-value | -- Basic | -- §7.24.4 | -- no | -no | -- no | -- no | -+ | page-break-inside | + +Complete | + +§7.29.18 | + +no | + +yes | + +yes | + +yes | + +|
- Pagination and Layout Properties (§7.25) | +pause | + +Complete | + +§7.29.19 | + +na | + +na | + +na | + +na | + +||||||||
- blank-or-not-blank | -- Extended | -- §7.25.1 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- column-count | -- Extended | -- §7.25.2 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- column-gap | -- Extended | -- §7.25.3 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- extent | -- Extended | -- §7.25.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- flow-name | -- Basic | -- §7.25.5 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- force-page-count | -- Extended | -- §7.25.6 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- initial-page-number | -- Basic | -- §7.25.7 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- master-name | -- Basic | -- §7.25.8 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- master-reference | -- Basic | -- §7.25.9 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- maximum-repeats | -- Extended | -- §7.25.10 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- media-usage | -- Extended | -- §7.25.11 | -- no | -no | -- no | -- no | -- | ||||||||
- odd-or-even | -- Extended | -- §7.25.12 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- page-height | -- Basic | -- §7.25.13 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- page-position | -- Extended | -- §7.25.14 | -- partial | -yes | -- yes | -- yes | +position | + +Complete | + +§7.29.20 | + +partial | + +yes | + +yes | + +yes | +
|
- |
- page-width | -- Basic | -- §7.25.15 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- precedence | -- Extended | -- §7.25.16 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- region-name | -- Basic | -- §7.25.17 | -- yes | -yes | -- yes | -- yes | -+ | ||||||||
- Table Properties (§7.26) | +size | + +Complete | + +§7.29.21 | + +no | + +no | + +no | + +no | + +||||||||
- border-after-precedence | -- Basic | -- §7.26.1 | -- no | -no | -- no | -- no | -- | ||||||||
- border-before-precedence | -- Basic | -- §7.26.2 | -- no | -no | -- no | -- no | -- | ||||||||
- border-collapse | -- Extended | -- §7.26.3 | +vertical-align | + +Complete | + +§7.29.22 | +partial | -no | -yes | -yes | + +partial | + +partial | + +partial | +
|
||
- border-end-precedence | -- Basic | -- §7.26.4 | -- no | -no | -- no | -- no | -- | ||||||||
- border-separation | -- Extended | -- §7.26.5 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- border-start-precedence | -- Basic | -- §7.26.6 | -- no | -no | -- no | -- no | -- | ||||||||
- caption-side | -- Complete | -- §7.26.7 | -- no | -no | -- no | -- no | -- | ||||||||
- column-number | -- Basic | -- §7.26.8 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- column-width | -- Basic | -- §7.26.9 | -- partial | -yes | -- yes | -- yes | -
-
|
+ white-space | + +Complete | + +§7.29.23 | + +no | + +yes | + +yes | + +yes | + +|
- empty-cells | -- Extended | -- §7.26.10 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- ends-row | -- Extended | -- §7.26.11 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- number-columns-repeated | -- Basic | -- §7.26.12 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- number-columns-spanned | -- Basic | -- §7.26.13 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- number-rows-spanned | -- Basic | -- §7.26.14 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- starts-row | -- Extended | -- §7.26.15 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- table-layout | -- Extended | -- §7.26.16 | -- no | -no | -- no | -- no | -- | ||||||||
- table-omit-footer-at-break | -- Extended | -- §7.26.17 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- table-omit-header-at-break | -- Extended | -- §7.26.18 | -- yes | -yes | -- yes | -- yes | -+ | xml:lang | + +Complete | + +§7.29.24 | + +no | + +yes | + +yes | + +yes | + +[0.95] Very basic parsing; no validation of the specified value. | +
The following is a summary of FOP's current support for the XSL-FO Core Function Library.
+ +Function Name | + +XSL-FO Conformance Level | + +Citation | + +Support in FOP | + +Comments | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- Writing-mode-related Properties (§7.27) | +0.20.5 (ancient) | + +0.94 (stable) | + +0.95 (beta) | + +develop- ment | |||||||||||
- direction | -- Basic | -- §7.27.1 | -- no | -no | -- no | -- no | -- | ||||||||
- glyph-orientation-horizontal | -- Extended | -- §7.27.2 | -- no | -no | -- no | -- no | -- | ||||||||
- glyph-orientation-vertical | -- Extended | -- §7.27.3 | -- no | -no | -- no | -- no | -- | ||||||||
- text-altitude | -- Extended | -- §7.27.4 | -- no | -no | -- no | -- no | -- | ||||||||
- text-depth | -- Extended | -- §7.27.5 | -- no | -no | -- no | -- no | -- | ||||||||
- unicode-bidi | -- Extended | -- §7.27.6 | -- no | -no | -- no | -- no | -- | ||||||||
- writing-mode | -- Basic | -- §7.27.7 | -- no | -no | -- no | -- no | -+ | Number Functions (§5.10.1) | |||||||
- Miscellaneous Properties (§7.28) | +floor | + +Basic | + +§5.10.1 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- content-type | -- Extended | -- §7.28.1 | -- no | -no | -- no | -- no | -- | ||||||||
- id | -- Basic | -- §7.28.2 | -- yes | -partial | -- partial | -- partial | -
-
|
+ ceiling | + +Basic | + +§5.10.1 | + +yes | + +yes | + +yes | + +yes | + +|
- provisional-label-separation | -- Basic | -- §7.28.3 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- provisional-distance-between-starts | -- Basic | -- §7.28.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- ref-id | -- Extended | -- §7.28.5 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- score-spaces | -- Extended | -- §7.28.6 | -- no | -no | -- no | -- no | -- | ||||||||
- src | -- Basic | -- §7.28.7 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- visibility | -- Extended | -- §7.28.8 | -- no | -no | -- no | -- no | -- | ||||||||
- z-index | -- Extended | -- §7.28.9 | -- no | -no | -- no | -- no | -+ | round | + +Basic | + +§5.10.1 | + +yes | + +yes | + +yes | + +yes | + +|
- Shorthand Properties (§7.29) | +min | + +Basic | + +§5.10.1 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- background | -- Complete | -- §7.29.1 | -- no | -no | -- no | -- no | -- | ||||||||
- background-position | -- Complete | -- §7.29.2 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- border | -- Complete | -- §7.29.3 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- border-bottom | -- Complete | -- §7.29.4 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-color | -- Complete | -- §7.29.5 | -- partial | -yes | -- yes | -- yes | -
-
|
+ max | + +Basic | + +§5.10.1 | + +yes | + +yes | + +yes | + +yes | + +|
- border-left | -- Complete | -- §7.29.6 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-right | -- Complete | -- §7.29.7 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-style | -- Complete | -- §7.29.8 | -- partial | -yes | -- yes | -- yes | -
-
|
+ abs | + +Basic | + +§5.10.1 | + +yes | + +yes | + +yes | + +yes | + +|
- border-spacing | -- Complete | -- §7.29.9 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- border-top | -- Complete | -- §7.29.10 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- border-width | -- Complete | -- §7.29.11 | -- yes | -yes | -- yes | -- yes | -- | ||||||||
- cue | -- Complete | -- §7.29.12 | -- na | -na | -- na | -- na | -- | ||||||||
- font | -- Complete | -- §7.29.13 | -- no | -partial | -- partial | -- partial | -
-
|
+ Color Functions (§5.10.2) | |||||||
- margin | -- Complete | -- §7.29.14 | -- partial | -yes | -- yes | -- yes | -
-
|
+ rgb | + +Basic | + +§5.10.2 | + +yes | + +yes | + +yes | + +yes | + +|
- padding | -- Complete | -- §7.29.15 | -- partial | -yes | -- yes | -- yes | -
-
|
- ||||||||
- page-break-after | -- Complete | -- §7.29.16 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- page-break-before | -- Complete | -- §7.29.17 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- page-break-inside | -- Complete | -- §7.29.18 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- pause | -- Complete | -- §7.29.19 | -- na | -na | -- na | -- na | -- | ||||||||
- position | -- Complete | -- §7.29.20 | -- partial | -yes | -- yes | -- yes | -
-
|
+ rgb-icc | + +Basic | + +§5.10.2 | + +no | + +yes | + +yes | + +yes | + +|
- size | -- Complete | -- §7.29.21 | -- no | -no | -- no | -- no | -- | ||||||||
- vertical-align | -- Complete | -- §7.29.22 | -- partial | -partial | -- partial | -- partial | -
-
|
+ system-color | + +Basic | + +§5.10.2 | + +no | + +yes | + +yes | + +yes | + +|
- white-space | -- Complete | -- §7.29.23 | -- no | -yes | -- yes | -- yes | -- | ||||||||
- xml:lang | -- Complete | -- §7.29.24 | -- no | -no | -- no | -- yes | -[dev] Very basic parsing; no validation of the specified value. | +Font Functions (§5.10.3) |
- The following is a summary of FOP's current support for the XSL-FO Core Function Library. -
-- Function Name | -- XSL-FO Conformance Level | -- Citation | -- Support in FOP | -- Comments | +system-font | + +Basic | + +§5.10.3 | + +no | + +no | + +no | + +no | + +||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- 0.20.5 (previous) | -- 0.93 (stable) | -0.94 (stable) | -- develop- ment | +Property Value Functions (§5.10.4) | |||||||||||
- Number Functions (§5.10.1) | +inherited-property-value | + +Basic | + ++ §5.10.4 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- floor | -- Basic | -- §5.10.1 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- ceiling | -- Basic | -- §5.10.1 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- round | -- Basic | -- §5.10.1 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- min | -- Basic | -- §5.10.1 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- max | -- Basic | -- §5.10.1 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- abs | -- Basic | -- §5.10.1 | -- yes | -- yes | -yes | -- yes | -+ | label-end | + +Basic | + ++ §5.10.4 | + +yes | + +yes | + +yes | + +yes | + +|
- Color Functions (§5.10.2) | +body-start | + +Basic | + ++ §5.10.4 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- rgb | -- Basic | -- §5.10.2 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- rgb-icc | -- Basic | -- §5.10.2 | -- no | -- yes | -yes | -- yes | -- | ||||||||
- system-color | -- Basic | -- §5.10.2 | -- no | -- yes | -yes | -- yes | -+ | from-parent | + +Basic | + ++ §5.10.4 | + +yes | + +yes | + +yes | + +yes | + +|
- Font Functions (§5.10.3) | +from-nearest-specified-value | + +Basic | + ++ §5.10.4 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- system-font | -- Basic | -- §5.10.3 | -- no | -- no | +from-table-column | + +Basic | + ++ §5.10.4 | +no | -- no | -+ + | yes | + +yes | + +yes | + +||
- Property Value Functions (§5.10.4) | +proportional-column-width | + +Basic | + ++ §5.10.4 | + +yes | + +yes | + +yes | + +yes | + +||||||||
- inherited-property-value | -- Basic | -- §5.10.4 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- label-end | -- Basic | -- §5.10.4 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- body-start | -- Basic | -- §5.10.4 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- from-parent | -- Basic | -- §5.10.4 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- from-nearest-specified-value | -- Basic | -- §5.10.4 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- from-table-column | -- Basic | -- §5.10.4 | -- no | -- yes | -yes | -- yes | -- | ||||||||
- proportional-column-width | -- Basic | -- §5.10.4 | -- yes | -- yes | -yes | -- yes | -- | ||||||||
- merge-property-values | -- Basic | -- §5.10.4 | -- no | -- no | -no | -- no | -+ | merge-property-values | + +Basic | + ++ §5.10.4 | + +no | + +no | + +no | + +no | + +
fop-hyph.jar
to lib/ (e.g. from
http://sourceforge.net/projects/offo
gpg -a -b --force-v3-sigs fop-0.94-src.tar.gz
etc.Latest Release | +Latest Stable Release | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Repository URL | @@ -102,6 +102,25 @@|||||||||||||||||||||||||||||||||
Latest Release | +|||||||||||||||||||||||||||||||||
Repository URL | +
+
+ http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95beta/
+
+ |
+ ||||||||||||||||||||||||||||||||
Web view | +
+
+ http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_95beta/
+
+ |
+ ||||||||||||||||||||||||||||||||
Trunk | |||||||||||||||||||||||||||||||||
Image Support | -stable, but in need of a redesign | +beta (recently rewritten) | |||||||||||||||||||||||||||||||
Hyphenation Subsystem | diff --git a/src/documentation/content/xdocs/tabs.xml b/src/documentation/content/xdocs/tabs.xml index bb2fd7e72..a42fc9bd7 100644 --- a/src/documentation/content/xdocs/tabs.xml +++ b/src/documentation/content/xdocs/tabs.xml @@ -21,14 +21,8 @@- | + | X | @@ -298,6 +303,19 @@ | |||||||||||||||||||||||||||||
AFP | ++ | + | + | + | + | + | + | + | + | + | |||||||||||||||||||||||
Forrest | diff --git a/src/documentation/content/xdocs/trunk/compiling.xml b/src/documentation/content/xdocs/trunk/compiling.xml index c6c17a3c0..57761429f 100644 --- a/src/documentation/content/xdocs/trunk/compiling.xml +++ b/src/documentation/content/xdocs/trunk/compiling.xml @@ -41,7 +41,7 @@ |
yes | yes | |||||||||
TXT | -yes (used for layout but not for output) | +AFP | no | -yes (used for layout but not for output) | no | +yes | +yes | |||
AWT | +Java2D/AWT/Bitmap | if available from OS | yes | yes | @@ -95,19 +90,26 @@n/a | |||||
TXT | +yes (used for layout but not for output) | +no | +yes (used for layout but not for output) | +no | +||||||
XML | yes | @@ -120,8 +122,8 @@
+ This test checks background painting for fo:table-row, fo:table-body and fo:table-column + when the cells use padding. +
+- This test checks tables with collapse border model. Simple cell borders to start with. -
-- This test checks tables with collapse border model. Simple cell borders to start with. -
-+ This is a testcase for bug #44621: when the width of the after border of a cell, in the + trailing case, is bigger than in the normal case, a wrong sequence of Knuth elements was + generated, leading to some content being swallowed. +
++ This test checks that a forced break is still taken into account when the minimal height of a + row is not reached yet. +
++ In versions until 0.20.5, FOP used + Avalon-style Logging where + it was possible to supply a logger per processing run. During the redesign + the logging infrastructure was switched over to + Commons Logging which is (like Log4J or + java.util.logging) a "static" logging framework (the logger is accessed through static + variables). This made it very difficult in a multi-threaded system to retrieve information + for a single processing run. +
++ With FOP's event subsystem, we'd like to close this gap again and even go further. The + first point is to realize that we have two kinds of "logging". Firstly, we have the logging + infrastructure for the (FOP) developer who needs to be able to enable finer log messages + for certain parts of FOP to track down a certain problem. Secondly, we have the user who + would like to be informed about missing images, overflowing lines or substituted fonts. + These messages (or events) are targeted at less technical people and may ideally be + localized (translated). Furthermore, tool and solution builders would like to integrate + FOP into their own solutions. For example, an FO editor should be able to point the user + to the right place where a particular problem occurred while developing a document template. + Finally, some integrators would like to abort processing if a resource (an image or a font) + has not been found, while others would simply continue. The event system allows to + react on these events. +
++ On this page, we won't discuss logging as such. We will show how the event subsystem can + be used for various tasks. We'll first look at the event subsystem from the consumer side. + Finally, the production of events inside FOP will be discussed (this is mostly interesting + for FOP developers only). +
+
+ The event subsystem is located in the org.apache.fop.events
package and its
+ base is the Event
class. An instance is created for each event and is sent
+ to a set of EventListener
instances by the EventBroadcaster
.
+ An Event
contains:
+
+ The EventFormatter
class can be used to translate the events into
+ human-readable, localized messages.
+
+ A full example of what is shown here can be found in the
+ examples/embedding/java/embedding/events
directory in the FOP distribution.
+ The example can also be accessed
+ via the web.
+
+ The following code sample shows a very simple EventListener. It basically just sends + all events to System.out (stdout) or System.err (stderr) depending on the event severity. +
+
+ You can see that for every event the method processEvent
of the
+ EventListener
will be called. Inside this method you can do whatever
+ processing you would like including throwing a RuntimeException
, if you want
+ to abort the current processing run.
+
+ The code above also shows how you can turn an event into a human-readable, localized
+ message that can be presented to a user. The EventFormatter
class does
+ this for you. It provides additional methods if you'd like to explicitly specify
+ the locale.
+
+ It is possible to gather all events for a whole processing run so they can be + evaluated afterwards. However, care should be taken about memory consumption since + the events provide references to objects inside FOP which may themselves have + references to other objects. So holding on to these objects may mean that whole + object trees cannot be released! +
+
+ To register the event listener with FOP, get the EventBroadcaster
which
+ is associated with the user agent (FOUserAgent
) and add it there:
+
+ Please note that this is done separately for each processing run, i.e. for each + new user agent. +
++ Here's an additional example of an event listener: +
++ By default, FOP continues processing even if an image wasn't found. If you have + more strict requirements and want FOP to stop if an image is not available, you can + do something like the following: +
+
+ This throws a RuntimeException
with the FileNotFoundException
+ as the cause. Further processing effectively stops in FOP. You can catch the exception
+ in your code and react as you see necessary.
+
+ This section is primarily for FOP and FOP plug-in developers. It describes how to use + the event subsystem for producing events. +
+
+ The basics are very simple. Just instantiate an Event
object and fill
+ it with the necessary parameters. Then pass it to the EventBroadcaster
+ which distributes the events to the interested listeneners. Here's a code example:
+
+ The Event.paramsBuilder()
is a
+ fluent interface
+ to help with the build-up of the parameters. You could just as well instantiate a
+ Map
(Map<String, Object>
) and fill it with values.
+
+ To simplify event production, the event subsystem provides the EventProducer
+ interface. You can create interfaces which extend EventProducer
. These
+ interfaces will contain one method per event to be generated. By contract, each event
+ method must have as its first parameter a parameter named "source" (Type Object) which
+ indicates the object that generated the event. After that come an arbitrary number of
+ parameters of any type as needed by the event.
+
+ The event producer interface does not need to have any implementation. The implementation
+ is produced at runtime by a dynamic proxy created by DefaultEventBroadcaster
.
+ The dynamic proxy creates Event
instances for each method call against
+ the event producer interface. Each parameter (except "source") is added to the event's
+ parameter map.
+
+ To simplify the code needed to get an instance of the event producer interface it is + suggested to create a public inner provider class inside the interface. +
++ Here's an example of such an event producer interface: +
++ To produce the same event as in the first example above, you'd use the following code: +
+
+ Inside an invocation handler for a dynamic proxy, there's no information about
+ the names of each parameter. The JVM doesn't provide it. The only thing you know is
+ the interface and method name. In order to properly fill the Event
's
+ parameter map we need to know the parameter names. These are retrieved from an
+ event object model. This is found in the org.apache.fop.events.model
+ package. The data for the object model is retrieved from an XML representation of the
+ event model that is loaded as a resource. The XML representation is generated using an
+ Ant task at build time (ant resourcegen
). The Ant task (found in
+ src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java
)
+ scans FOP's sources for descendants of the EventProducer
interface and
+ uses QDox to parse these interfaces.
+
+ Primarily, the QDox-based collector task records the parameters' names and types. + Furthermore, it extracts additional attributes embedded as Javadoc comments from + the methods. At the moment, the only such attribute is "@event.severity" which indicates + the default event severity (which can be changed by event listeners). The example event + producer above shows the Javadocs for an event method. +
+
+ There's one more information that is extracted from the event producer information for
+ the event model: an optional primary exception. The first exception in the "throws"
+ declaration of an event method is noted. It is used to throw an exception from
+ the invocation handler if the event has an event severity of "FATAL" when all
+ listeners have been called (listeners can update the event severity). Please note
+ that an implementation of
+ org.apache.fop.events.EventExceptionManager$ExceptionFactory
has to be
+ registered for the EventExceptionManager
to be able to construct the
+ exception from an event.
+
+ For a given application, there can be multiple event models active at the same time.
+ In FOP, each renderer is considered to be a plug-in and provides its own specific
+ event model. The individual event models are provided through an
+ EventModelFactory
. This interface is implemented for each event model
+ and registered through the service provider mechanism
+ (see the plug-ins section for details).
+
+ Four different levels of severity for events has been defined: +
++ Event listeners can choose to ignore certain events based on their event severity. + Please note that you may recieve an event "twice" in a specific case: if there is + a fatal error an event is generated and sent to the listeners. After that an exception + is thrown with the same information and processing stops. If the fatal event is + shown to the user and the following exception is equally presented to the user it + may appear that the event is duplicated. Of course, the same information is just + published through two different channels. +
++ The event subsystem is extensible. There are a number of extension points: +
+org.apache.fop.events.model.EventModelFactory
: Provides
+ an event model to the event subsystem.
+ org.apache.fop.events.EventExceptionManager$ExceptionFactory
:
+ Creates exceptions for events, i.e. turns an event into a specific exception.
+
+ The names in bold above are used as filenames for the service provider files that
+ are placed in the META-INF/services
directory. That way, they are
+ automatically detected. This is a mechanism defined by the
+ JAR file specification.
+
+ One goal of the event subsystem was to have localized (translated) event messages.
+ The EventFormatter
class can be used to convert an event to a
+ human-readable message. Each EventProducer
can provide its own XML-based
+ translation file. If there is none, a central translation file is used, called
+ "EventFormatter.xml" (found in the same directory as the EventFormatter
+ class).
+
+ The XML format used by the EventFormatter
is the same as
+ Apache Cocoon's catalog format. Here's an example:
+
+ The example (extracted from the RTF handler's event producer) has message templates for
+ two event methods. The class used to do variable replacement in the templates is
+ org.apache.fop.util.text.AdvancedMessageFormat
which is more powerful
+ than the MessageFormat
classes provided by the Java class library
+ (java.util.text
package).
+
+ "locator" is a template that is reused by the other message templates + by referencing it through "{{locator}}". This is some kind of include command. +
+
+ Normal event parameters are accessed by name inside single curly braces, for example:
+ "{node}". For objects, this format just uses the toString()
method to turn
+ the object into a string, unless there is an ObjectFormatter
registered
+ for that type (there's an example for org.xml.sax.Locator
).
+
+ The single curly braces pattern supports additional features. For example, it is possible + to do this: "{start,if,start,end}". "if" here is a special field modifier that evaluates + "start" as a boolean and if that is true returns the text right after the second comma + ("start"). Otherwise it returns the text after the third comma ("end"). The "equals" + modifier is similar to "if" but it takes as an additional (comma-separated) parameter + right after the "equals" modifier, a string that is compared to the value of the variable. + An example: {severity,equals,EventSeverity:FATAL,,some text} (this adds "some text" if + the severity is not FATAL). +
+
+ Additional such modifiers can be added by implementing the
+ AdvancedMessageFormat$Part
and AdvancedMessageFormat$PartFactory
+ interfaces.
+
+ Square braces can be used to specify optional template sections. The whole section will + be omitted if any of the variables used within are unavailable. Pipe (|) characters can + be used to specify alternative sub-templates (see "locator" above for an example). +
+
+ Developers can also register a function (in the above example:
+ {#gatherContextInfo})
+ to do more complex information rendering. These functions are implementations of the
+ AdvancedMessageFormat$Function
interface. Please take care that this is
+ done in a locale-independent way as there is no locale information available, yet.
+
Object source
+ * EventMethodModel
.
+ */
+public class EventMethodModel implements Serializable, XMLizable {
+
+ private static final long serialVersionUID = -7548882973341444354L;
+
+ private String methodName;
+ private EventSeverity severity;
+ private List params = new java.util.ArrayList();
+ private String exceptionClass;
+
+ /**
+ * Creates an new instance.
+ * @param methodName the event method's name
+ * @param severity the event severity
+ */
+ public EventMethodModel(String methodName, EventSeverity severity) {
+ this.methodName = methodName;
+ this.severity = severity;
+ }
+
+ /**
+ * Adds a method parameter.
+ * @param param the method parameter
+ */
+ public void addParameter(Parameter param) {
+ this.params.add(param);
+ }
+
+ /**
+ * Adds a method parameter.
+ * @param type the type of the parameter
+ * @param name the name of the parameter
+ * @return the resulting Parameter instance
+ */
+ public Parameter addParameter(Class type, String name) {
+ Parameter param = new Parameter(type, name);
+ addParameter(param);
+ return param;
+ }
+
+ /**
+ * Sets the event method name.
+ * @param name the event name
+ */
+ public void setMethodName(String name) {
+ this.methodName = name;
+ }
+
+ /**
+ * Returns the event method name
+ * @return the event name
+ */
+ public String getMethodName() {
+ return this.methodName;
+ }
+
+ /**
+ * Sets the event's severity level.
+ * @param severity the severity
+ */
+ public void setSeverity(EventSeverity severity) {
+ this.severity = severity;
+ }
+
+ /**
+ * Returns the event's severity level.
+ * @return the severity
+ */
+ public EventSeverity getSeverity() {
+ return this.severity;
+ }
+
+ /**
+ * Returns an unmodifiable list of parameters for this event method.
+ * @return the list of parameters
+ */
+ public List getParameters() {
+ return Collections.unmodifiableList(this.params);
+ }
+
+ /**
+ * Sets the primary exception class for this event method. Note: Not all event methods throw
+ * exceptions!
+ * @param exceptionClass the exception class
+ */
+ public void setExceptionClass(String exceptionClass) {
+ this.exceptionClass = exceptionClass;
+ }
+
+ /**
+ * Returns the primary exception class for this event method. This method returns null if
+ * the event is only informational or just a warning.
+ * @return the primary exception class or null
+ */
+ public String getExceptionClass() {
+ return this.exceptionClass;
+ }
+
+ /** {@inheritDoc} */
+ public void toSAX(ContentHandler handler) throws SAXException {
+ AttributesImpl atts = new AttributesImpl();
+ atts.addAttribute(null, "name", "name", "CDATA", getMethodName());
+ atts.addAttribute(null, "severity", "severity", "CDATA", getSeverity().getName());
+ if (getExceptionClass() != null) {
+ atts.addAttribute(null, "exception", "exception", "CDATA", getExceptionClass());
+ }
+ String elName = "method";
+ handler.startElement(null, elName, elName, atts);
+ Iterator iter = this.params.iterator();
+ while (iter.hasNext()) {
+ ((XMLizable)iter.next()).toSAX(handler);
+ }
+ handler.endElement(null, elName, elName);
+ }
+
+ /**
+ * Represents an event parameter.
+ */
+ public static class Parameter implements Serializable, XMLizable {
+
+ private static final long serialVersionUID = 6062500277953887099L;
+
+ private Class type;
+ private String name;
+
+ /**
+ * Creates a new event parameter.
+ * @param type the parameter type
+ * @param name the parameter name
+ */
+ public Parameter(Class type, String name) {
+ this.type = type;
+ this.name = name;
+ }
+
+ /**
+ * Returns the parameter type.
+ * @return the parameter type
+ */
+ public Class getType() {
+ return this.type;
+ }
+
+ /**
+ * Returns the parameter name.
+ * @return the parameter name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /** {@inheritDoc} */
+ public void toSAX(ContentHandler handler) throws SAXException {
+ AttributesImpl atts = new AttributesImpl();
+ atts.addAttribute(null, "type", "type", "CDATA", getType().getName());
+ atts.addAttribute(null, "name", "name", "CDATA", getName());
+ String elName = "parameter";
+ handler.startElement(null, elName, elName, atts);
+ handler.endElement(null, elName, elName);
+ }
+
+ }
+}
diff --git a/src/java/org/apache/fop/events/model/EventModel.java b/src/java/org/apache/fop/events/model/EventModel.java
new file mode 100644
index 000000000..61e221b3b
--- /dev/null
+++ b/src/java/org/apache/fop/events/model/EventModel.java
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.events.model;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+import org.apache.xmlgraphics.util.XMLizable;
+
+/**
+ * Represents a whole event model that supports multiple event producers.
+ */
+public class EventModel implements Serializable, XMLizable {
+
+ private static final long serialVersionUID = 7468592614934605082L;
+
+ private Map producers = new java.util.LinkedHashMap();
+
+ /**
+ * Creates a new, empty event model
+ */
+ public EventModel() {
+ }
+
+ /**
+ * Adds the model of an event producer to the event model.
+ * @param producer the event producer model
+ */
+ public void addProducer(EventProducerModel producer) {
+ this.producers.put(producer.getInterfaceName(), producer);
+ }
+
+ /**
+ * Returns an iterator over the contained event producer models.
+ * @return an iterator (Iterator<EventProducerModel>)
+ */
+ public Iterator getProducers() {
+ return this.producers.values().iterator();
+ }
+
+ /**
+ * Returns the model of an event producer with the given interface name.
+ * @param interfaceName the fully qualified name of the event producer
+ * @return the model instance for the event producer (or null if it wasn't found)
+ */
+ public EventProducerModel getProducer(String interfaceName) {
+ return (EventProducerModel)this.producers.get(interfaceName);
+ }
+
+ /**
+ * Returns the model of an event producer with the given interface.
+ * @param clazz the interface of the event producer
+ * @return the model instance for the event producer (or null if it wasn't found)
+ */
+ public EventProducerModel getProducer(Class clazz) {
+ return getProducer(clazz.getName());
+ }
+
+ /** {@inheritDoc} */
+ public void toSAX(ContentHandler handler) throws SAXException {
+ AttributesImpl atts = new AttributesImpl();
+ String elName = "event-model";
+ handler.startElement(null, elName, elName, atts);
+ Iterator iter = getProducers();
+ while (iter.hasNext()) {
+ ((XMLizable)iter.next()).toSAX(handler);
+ }
+ handler.endElement(null, elName, elName);
+ }
+
+ private void writeXMLizable(XMLizable object, File outputFile) throws IOException {
+ Result res = new StreamResult(outputFile);
+
+ try {
+ SAXTransformerFactory tFactory
+ = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
+ TransformerHandler handler = tFactory.newTransformerHandler();
+ Transformer transformer = handler.getTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ handler.setResult(res);
+ handler.startDocument();
+ object.toSAX(handler);
+ handler.endDocument();
+ } catch (TransformerConfigurationException e) {
+ throw new IOException(e.getMessage());
+ } catch (TransformerFactoryConfigurationError e) {
+ throw new IOException(e.getMessage());
+ } catch (SAXException e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ /**
+ * Saves this event model to an XML file.
+ * @param modelFile the target file
+ * @throws IOException if an I/O error occurs
+ */
+ public void saveToXML(File modelFile) throws IOException {
+ writeXMLizable(this, modelFile);
+ }
+
+}
diff --git a/src/java/org/apache/fop/events/model/EventModelFactory.java b/src/java/org/apache/fop/events/model/EventModelFactory.java
new file mode 100644
index 000000000..cd760501c
--- /dev/null
+++ b/src/java/org/apache/fop/events/model/EventModelFactory.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.events.model;
+
+/**
+ * This interface is used to instantiate (load, parse) event models.
+ */
+public interface EventModelFactory {
+
+ /**
+ * Creates a new EventModel instance.
+ * @return the new EventModel instance
+ */
+ EventModel createEventModel();
+
+}
diff --git a/src/java/org/apache/fop/events/model/EventModelParser.java b/src/java/org/apache/fop/events/model/EventModelParser.java
new file mode 100644
index 000000000..600e495c5
--- /dev/null
+++ b/src/java/org/apache/fop/events/model/EventModelParser.java
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.events.model;
+
+import java.util.Stack;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.sax.SAXTransformerFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.fop.util.DefaultErrorListener;
+
+/**
+ * This is a parser for the event model XML.
+ */
+public class EventModelParser {
+
+ /** Logger instance */
+ protected static Log log = LogFactory.getLog(EventModelParser.class);
+
+ private static SAXTransformerFactory tFactory
+ = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
+
+ /**
+ * Parses an event model file into an EventModel instance.
+ * @param src the Source instance pointing to the XML file
+ * @return the created event model structure
+ * @throws TransformerException if an error occurs while parsing the XML file
+ */
+ public static EventModel parse(Source src)
+ throws TransformerException {
+ Transformer transformer = tFactory.newTransformer();
+ transformer.setErrorListener(new DefaultErrorListener(log));
+
+ EventModel model = new EventModel();
+ SAXResult res = new SAXResult(getContentHandler(model));
+
+ transformer.transform(src, res);
+ return model;
+ }
+
+ /**
+ * Creates a new ContentHandler instance that you can send the event model XML to. The parsed
+ * content is accumulated in the model structure.
+ * @param model the EventModel
+ * @return the ContentHandler instance to receive the SAX stream from the XML file
+ */
+ public static ContentHandler getContentHandler(EventModel model) {
+ return new Handler(model);
+ }
+
+ private static class Handler extends DefaultHandler {
+
+ private EventModel model;
+ private Stack objectStack = new Stack();
+
+ public Handler(EventModel model) {
+ this.model = model;
+ }
+
+ /** {@inheritDoc} */
+ public void startElement(String uri, String localName, String qName, Attributes attributes)
+ throws SAXException {
+ try {
+ if ("event-model".equals(localName)) {
+ if (objectStack.size() > 0) {
+ throw new SAXException("event-model must be the root element");
+ }
+ objectStack.push(model);
+ } else if ("producer".equals(localName)) {
+ EventProducerModel producer = new EventProducerModel(
+ attributes.getValue("name"));
+ EventModel parent = (EventModel)objectStack.peek();
+ parent.addProducer(producer);
+ objectStack.push(producer);
+ } else if ("method".equals(localName)) {
+ EventSeverity severity = EventSeverity.valueOf(attributes.getValue("severity"));
+ String ex = attributes.getValue("exception");
+ EventMethodModel method = new EventMethodModel(
+ attributes.getValue("name"), severity);
+ if (ex != null && ex.length() > 0) {
+ method.setExceptionClass(ex);
+ }
+ EventProducerModel parent = (EventProducerModel)objectStack.peek();
+ parent.addMethod(method);
+ objectStack.push(method);
+ } else if ("parameter".equals(localName)) {
+ String className = attributes.getValue("type");
+ Class type;
+ try {
+ type = Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ throw new SAXException("Could not find Class for: " + className, e);
+ }
+ String name = attributes.getValue("name");
+ EventMethodModel parent = (EventMethodModel)objectStack.peek();
+ objectStack.push(parent.addParameter(type, name));
+ } else {
+ throw new SAXException("Invalid element: " + qName);
+ }
+ } catch (ClassCastException cce) {
+ throw new SAXException("XML format error: " + qName, cce);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ objectStack.pop();
+ }
+
+ }
+
+}
diff --git a/src/java/org/apache/fop/events/model/EventProducerModel.java b/src/java/org/apache/fop/events/model/EventProducerModel.java
new file mode 100644
index 000000000..938609cd9
--- /dev/null
+++ b/src/java/org/apache/fop/events/model/EventProducerModel.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.events.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+import org.apache.xmlgraphics.util.XMLizable;
+
+/**
+ * Represents the model of an event producer with multiple event methods.
+ */
+public class EventProducerModel implements Serializable, XMLizable {
+
+ private static final long serialVersionUID = 122267104123721902L;
+
+ private String interfaceName;
+ private Map methods = new java.util.LinkedHashMap();
+
+ /**
+ * Creates a new instance.
+ * @param interfaceName the fully qualified interface name of the event producer
+ */
+ public EventProducerModel(String interfaceName) {
+ this.interfaceName = interfaceName;
+ }
+
+ /**
+ * Returns the fully qualified interface name of the event producer.
+ * @return the fully qualified interface name
+ */
+ public String getInterfaceName() {
+ return this.interfaceName;
+ }
+
+ /**
+ * Sets the fully qualified interface name of the event producer.
+ * @param name the fully qualified interface name
+ */
+ public void setInterfaceName(String name) {
+ this.interfaceName = name;
+ }
+
+ /**
+ * Adds a model instance of an event method.
+ * @param method the event method model
+ */
+ public void addMethod(EventMethodModel method) {
+ this.methods.put(method.getMethodName(), method);
+ }
+
+ /**
+ * Returns the model instance of an event method for the given method name.
+ * @param methodName the method name
+ * @return the model instance (or null if no method with the given name exists)
+ */
+ public EventMethodModel getMethod(String methodName) {
+ return (EventMethodModel)this.methods.get(methodName);
+ }
+
+ /**
+ * Returns an iterator over the contained event producer methods.
+ * @return an iterator (Iterator<EventMethodModel>)
+ */
+ public Iterator getMethods() {
+ return this.methods.values().iterator();
+ }
+
+ /** {@inheritDoc} */
+ public void toSAX(ContentHandler handler) throws SAXException {
+ AttributesImpl atts = new AttributesImpl();
+ atts.addAttribute(null, "name", "name", "CDATA", getInterfaceName());
+ String elName = "producer";
+ handler.startElement(null, elName, elName, atts);
+ Iterator iter = getMethods();
+ while (iter.hasNext()) {
+ ((XMLizable)iter.next()).toSAX(handler);
+ }
+ handler.endElement(null, elName, elName);
+ }
+
+
+}
diff --git a/src/java/org/apache/fop/events/model/EventSeverity.java b/src/java/org/apache/fop/events/model/EventSeverity.java
new file mode 100644
index 000000000..d37c53c1e
--- /dev/null
+++ b/src/java/org/apache/fop/events/model/EventSeverity.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.events.model;
+
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+/** Enumeration class for event severities. */
+public final class EventSeverity implements Serializable {
+
+ private static final long serialVersionUID = 4108175215810759243L;
+
+ /** info level */
+ public static final EventSeverity INFO = new EventSeverity("INFO");
+ /** warning level */
+ public static final EventSeverity WARN = new EventSeverity("WARN");
+ /** error level */
+ public static final EventSeverity ERROR = new EventSeverity("ERROR");
+ /** fatal error */
+ public static final EventSeverity FATAL = new EventSeverity("FATAL");
+
+ private String name;
+
+ /**
+ * Constructor to add a new named item.
+ * @param name Name of the item.
+ */
+ private EventSeverity(String name) {
+ this.name = name;
+ }
+
+ /** @return the name of the enumeration */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Returns the enumeration/singleton object based on its name.
+ * @param name the name of the enumeration value
+ * @return the enumeration object
+ */
+ public static EventSeverity valueOf(String name) {
+ if (INFO.getName().equalsIgnoreCase(name)) {
+ return INFO;
+ } else if (WARN.getName().equalsIgnoreCase(name)) {
+ return WARN;
+ } else if (ERROR.getName().equalsIgnoreCase(name)) {
+ return ERROR;
+ } else if (FATAL.getName().equalsIgnoreCase(name)) {
+ return FATAL;
+ } else {
+ throw new IllegalArgumentException("Illegal value for enumeration: " + name);
+ }
+ }
+
+ private Object readResolve() throws ObjectStreamException {
+ return valueOf(getName());
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return "EventSeverity:" + name;
+ }
+
+}
diff --git a/src/java/org/apache/fop/fo/ElementMapping.java b/src/java/org/apache/fop/fo/ElementMapping.java
index 495983750..502fb07b8 100644
--- a/src/java/org/apache/fop/fo/ElementMapping.java
+++ b/src/java/org/apache/fop/fo/ElementMapping.java
@@ -24,9 +24,10 @@ import java.util.Map;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.apache.fop.util.QName;
import org.w3c.dom.DOMImplementation;
+import org.apache.xmlgraphics.util.QName;
+
/**
* Abstract base class for Element Mappings (including FO Element Mappings)
* which provide the framework of valid elements and attibutes for a given
diff --git a/src/java/org/apache/fop/fo/ElementMappingRegistry.java b/src/java/org/apache/fop/fo/ElementMappingRegistry.java
index 2ba142203..abc4ec834 100644
--- a/src/java/org/apache/fop/fo/ElementMappingRegistry.java
+++ b/src/java/org/apache/fop/fo/ElementMappingRegistry.java
@@ -23,6 +23,7 @@ import java.util.Iterator;
import java.util.Map;
import org.w3c.dom.DOMImplementation;
+
import org.xml.sax.Locator;
import org.apache.commons.logging.Log;
@@ -144,7 +145,6 @@ public class ElementMappingRegistry {
+ "No element mapping definition found for "
+ FONode.getNodeString(namespaceURI, localName), locator);
} else {
- log.warn("Unknown formatting object " + namespaceURI + "^" + localName);
fobjMaker = new UnknownXMLObj.Maker(namespaceURI);
}
}
diff --git a/src/java/org/apache/fop/fo/FOElementMapping.java b/src/java/org/apache/fop/fo/FOElementMapping.java
index 51ec85d21..62721afeb 100644
--- a/src/java/org/apache/fop/fo/FOElementMapping.java
+++ b/src/java/org/apache/fop/fo/FOElementMapping.java
@@ -22,7 +22,7 @@ package org.apache.fop.fo;
// Java
import java.util.HashMap;
-import org.apache.fop.util.QName;
+import org.apache.xmlgraphics.util.QName;
/**
* Element mapping class for all XSL-FO elements.
diff --git a/src/java/org/apache/fop/fo/FOEventHandler.java b/src/java/org/apache/fop/fo/FOEventHandler.java
index d226cfb6c..5a9a5bb9d 100644
--- a/src/java/org/apache/fop/fo/FOEventHandler.java
+++ b/src/java/org/apache/fop/fo/FOEventHandler.java
@@ -48,6 +48,7 @@ import org.apache.fop.fo.flow.table.TableColumn;
import org.apache.fop.fo.flow.table.TableRow;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.fonts.FontEventAdapter;
import org.apache.fop.fonts.FontInfo;
/**
@@ -101,6 +102,7 @@ public abstract class FOEventHandler {
public FOEventHandler(FOUserAgent foUserAgent) {
this.foUserAgent = foUserAgent;
this.fontInfo = new FontInfo();
+ this.fontInfo.setEventListener(new FontEventAdapter(foUserAgent.getEventBroadcaster()));
}
/**
diff --git a/src/java/org/apache/fop/fo/FONode.java b/src/java/org/apache/fop/fo/FONode.java
index f0422e414..197a2482d 100644
--- a/src/java/org/apache/fop/fo/FONode.java
+++ b/src/java/org/apache/fop/fo/FONode.java
@@ -21,6 +21,8 @@ package org.apache.fop.fo;
// Java
import java.util.ListIterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
@@ -29,6 +31,8 @@ import org.xml.sax.helpers.LocatorImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.xmlgraphics.util.QName;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.extensions.ExtensionAttachment;
@@ -37,6 +41,7 @@ import org.apache.fop.fo.extensions.svg.SVGElementMapping;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.util.CharUtilities;
import org.apache.fop.util.ContentHandlerFactory;
+import org.apache.fop.util.text.AdvancedMessageFormat.Function;
/**
* Base class for nodes in the XML tree
@@ -143,6 +148,10 @@ public abstract class FONode implements Cloneable {
return parent.getFOEventHandler();
}
+ /**
+ * Indicates whether this node is a child of an fo:marker.
+ * @return true if this node is a child of an fo:marker
+ */
protected boolean inMarker() {
return getFOEventHandler().inMarker();
}
@@ -239,7 +248,7 @@ public abstract class FONode implements Cloneable {
* @param start starting array element to add
* @param end ending array element to add
* @param pList currently applicable PropertyList
- * @param locator location in fo source file.
+ * @param locator location in the XSL-FO source file.
* @throws FOPException if there's a problem during processing
*/
protected void addCharacters(char[] data, int start, int end,
@@ -343,54 +352,50 @@ public abstract class FONode implements Cloneable {
}
/**
- * Helper function to standardize property error exceptions
- * (e.g., not specifying either an internal- or an external-destination
- * property for an FO:link)
- * @param problem text to display that indicates the problem
- * @throws ValidationException the validation error provoked by the method call
+ * Returns an instance of the FOValidationEventProducer.
+ * @return an event producer for FO validation
*/
- protected void attributeError(String problem)
- throws ValidationException {
- throw new ValidationException(errorText(locator) + getName()
- + ", " + problem, locator);
+ protected FOValidationEventProducer getFOValidationEventProducer() {
+ return FOValidationEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
}
-
+
/**
- * Helper function to standardize attribute warnings
- * (e.g., currently unsupported properties)
- * @param problem text to display that indicates the problem
+ * Helper function to standardize "too many" error exceptions
+ * (e.g., two fo:declarations within fo:root)
+ * @param loc org.xml.sax.Locator object of the error (*not* parent node)
+ * @param nsURI namespace URI of incoming invalid node
+ * @param lName local name (i.e., no prefix) of incoming node
+ * @throws ValidationException the validation error provoked by the method call
*/
- public void attributeWarning(String problem) {
- log.warn(warningText(locator) + getName() + ", " + problem);
+ protected void tooManyNodesError(Locator loc, String nsURI, String lName)
+ throws ValidationException {
+ tooManyNodesError(loc, new QName(nsURI, lName));
}
/**
* Helper function to standardize "too many" error exceptions
* (e.g., two fo:declarations within fo:root)
* @param loc org.xml.sax.Locator object of the error (*not* parent node)
- * @param nsURI namespace URI of incoming invalid node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param offendingNode the qualified name of the offending node
* @throws ValidationException the validation error provoked by the method call
*/
- protected void tooManyNodesError(Locator loc, String nsURI, String lName)
+ protected void tooManyNodesError(Locator loc, QName offendingNode)
throws ValidationException {
- throw new ValidationException(errorText(loc) + "For " + getName()
- + ", only one " + getNodeString(nsURI, lName) + " may be declared.",
- loc);
+ getFOValidationEventProducer().tooManyNodes(this, getName(), offendingNode, loc);
}
/**
* Helper function to standardize "too many" error exceptions
* (e.g., two fo:declarations within fo:root)
- * This overrloaded method helps make the caller code better self-documenting
+ * This overloaded method helps make the caller code better self-documenting
* @param loc org.xml.sax.Locator object of the error (*not* parent node)
* @param offendingNode incoming node that would cause a duplication.
* @throws ValidationException the validation error provoked by the method call
*/
protected void tooManyNodesError(Locator loc, String offendingNode)
throws ValidationException {
- throw new ValidationException(errorText(loc) + "For " + getName()
- + ", only one " + offendingNode + " may be declared.", loc);
+ tooManyNodesError(loc, new QName(FO_URI, offendingNode));
}
/**
@@ -402,9 +407,23 @@ public abstract class FONode implements Cloneable {
* @throws ValidationException the validation error provoked by the method call
*/
protected void nodesOutOfOrderError(Locator loc, String tooLateNode,
- String tooEarlyNode) throws ValidationException {
- throw new ValidationException(errorText(loc) + "For " + getName() + ", " + tooLateNode
- + " must be declared before " + tooEarlyNode + ".", loc);
+ String tooEarlyNode) throws ValidationException {
+ nodesOutOfOrderError(loc, tooLateNode, tooEarlyNode, false);
+ }
+
+ /**
+ * Helper function to standardize "out of order" exceptions
+ * (e.g., fo:layout-master-set appearing after fo:page-sequence)
+ * @param loc org.xml.sax.Locator object of the error (*not* parent node)
+ * @param tooLateNode string name of node that should be earlier in document
+ * @param tooEarlyNode string name of node that should be later in document
+ * @param canRecover indicates whether FOP can recover from this problem and continue working
+ * @throws ValidationException the validation error provoked by the method call
+ */
+ protected void nodesOutOfOrderError(Locator loc, String tooLateNode,
+ String tooEarlyNode, boolean canRecover) throws ValidationException {
+ getFOValidationEventProducer().nodeOutOfOrder(this, getName(),
+ tooLateNode, tooEarlyNode, canRecover, loc);
}
/**
@@ -417,24 +436,24 @@ public abstract class FONode implements Cloneable {
*/
protected void invalidChildError(Locator loc, String nsURI, String lName)
throws ValidationException {
- invalidChildError(loc, nsURI, lName, null);
+ invalidChildError(loc, getName(), nsURI, lName, null);
}
/**
* Helper function to return "invalid child" exceptions with more
* complex validation rules (i.e., needing more explanation of the problem)
* @param loc org.xml.sax.Locator object of the error (*not* parent node)
+ * @param parentName the name of the parent element
* @param nsURI namespace URI of incoming invalid node
* @param lName local name (i.e., no prefix) of incoming node
- * @param ruleViolated text explanation of problem
+ * @param ruleViolated name of the rule violated (used to lookup a resource in a bundle)
* @throws ValidationException the validation error provoked by the method call
*/
- protected void invalidChildError(Locator loc, String nsURI, String lName,
+ protected void invalidChildError(Locator loc, String parentName, String nsURI, String lName,
String ruleViolated)
throws ValidationException {
- throw new ValidationException(errorText(loc) + getNodeString(nsURI, lName)
- + " is not a valid child element of " + getName()
- + ((ruleViolated != null) ? ": " + ruleViolated : "."), loc);
+ getFOValidationEventProducer().invalidChild(this, parentName,
+ new QName(nsURI, lName), ruleViolated, loc);
}
/**
@@ -446,9 +465,22 @@ public abstract class FONode implements Cloneable {
*/
protected void missingChildElementError(String contentModel)
throws ValidationException {
- throw new ValidationException(errorText(locator) + getName()
- + " is missing child elements. \nRequired Content Model: "
- + contentModel, locator);
+ getFOValidationEventProducer().missingChildElement(this, getName(),
+ contentModel, false, locator);
+ }
+
+ /**
+ * Helper function to throw an error caused by missing mandatory child elements.
+ * E.g., fo:layout-master-set not having any page-master child element.
+ * @param contentModel The XSL Content Model for the fo: object or a similar description
+ * indicating the necessary child elements.
+ * @param canRecover indicates whether FOP can recover from this problem and continue working
+ * @throws ValidationException the validation error provoked by the method call
+ */
+ protected void missingChildElementError(String contentModel, boolean canRecover)
+ throws ValidationException {
+ getFOValidationEventProducer().missingChildElement(this, getName(),
+ contentModel, canRecover, locator);
}
/**
@@ -458,8 +490,7 @@ public abstract class FONode implements Cloneable {
*/
protected void missingPropertyError(String propertyName)
throws ValidationException {
- throw new ValidationException(errorText(locator) + getName()
- + " is missing required \"" + propertyName + "\" property.", locator);
+ getFOValidationEventProducer().missingProperty(this, getName(), propertyName, locator);
}
/**
@@ -513,9 +544,10 @@ public abstract class FONode implements Cloneable {
/**
* Returns a String containing as much context information as possible about a node. Call
- * this methods only in exceptional conditions because this method may perform quite extensive
+ * this method only in exceptional conditions because this method may perform quite extensive
* information gathering inside the FO tree.
- * @return a String containing
+ * @return a String containing context information
+ * @deprecated Not localized! Should rename getContextInfoAlt() to getContextInfo() when done!
*/
public String getContextInfo() {
StringBuffer sb = new StringBuffer();
@@ -542,6 +574,54 @@ public abstract class FONode implements Cloneable {
return sb.toString();
}
+ /**
+ * Returns a String containing as some context information about a node. It does not take the
+ * locator into consideration and returns null if no useful context information can be found.
+ * Call this method only in exceptional conditions because this method may perform quite
+ * extensive information gathering inside the FO tree. All text returned by this method that
+ * is not extracted from document content needs to be locale-independent.
+ * @return a String containing context information
+ */
+ protected String getContextInfoAlt() {
+ String s = gatherContextInfo();
+ if (s != null) {
+ StringBuffer sb = new StringBuffer();
+ if (getLocalName() != null) {
+ sb.append(getName());
+ sb.append(", ");
+ }
+ sb.append("\"");
+ sb.append(s);
+ sb.append("\"");
+ return sb.toString();
+ } else {
+ return null;
+ }
+ }
+
+ /** Function for AdvancedMessageFormat to retrieve context info from an FONode. */
+ public static class GatherContextInfoFunction implements Function {
+
+ /** {@inheritDoc} */
+ public Object evaluate(Map params) {
+ Object obj = params.get("source");
+ if (obj instanceof PropertyList) {
+ PropertyList propList = (PropertyList)obj;
+ obj = propList.getFObj();
+ }
+ if (obj instanceof FONode) {
+ FONode node = (FONode)obj;
+ return node.getContextInfoAlt();
+ }
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public Object getName() {
+ return "gatherContextInfo";
+ }
+ }
+
/**
* Gathers context information for the getContextInfo() method.
* @return the collected context information or null, if none is available
@@ -687,7 +767,7 @@ public abstract class FONode implements Cloneable {
* of child nodes
* @return the parent node
*/
- public FObj parentNode();
+ FObj parentNode();
/**
* Convenience method with return type of FONode
@@ -695,7 +775,7 @@ public abstract class FONode implements Cloneable {
* (FONode) next();
)
* @return the next node (if any), as a type FONode
*/
- public FONode nextNode();
+ FONode nextNode();
/**
* Convenience method with return type of FONode
@@ -703,7 +783,7 @@ public abstract class FONode implements Cloneable {
* (FONode) previous();
)
* @return the previous node (if any), as a type FONode
*/
- public FONode previousNode();
+ FONode previousNode();
/**
* Returns the first node in the list, and decreases the index,
@@ -711,7 +791,7 @@ public abstract class FONode implements Cloneable {
* @return the first node in the list
* @throws NoSuchElementException if the list is empty
*/
- public FONode firstNode();
+ FONode firstNode();
/**
* Returns the last node in the list, and advances the
@@ -720,7 +800,7 @@ public abstract class FONode implements Cloneable {
* @return the last node in the list
* @throws NoSuchElementException if the list is empty
*/
- public FONode lastNode();
+ FONode lastNode();
}
}
diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java
index 6d1ac417f..99d37dba9 100644
--- a/src/java/org/apache/fop/fo/FOText.java
+++ b/src/java/org/apache/fop/fo/FOText.java
@@ -19,11 +19,11 @@
package org.apache.fop.fo;
-// Java
import java.awt.Color;
import java.util.NoSuchElementException;
-// FOP
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.flow.Block;
@@ -34,9 +34,6 @@ import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.SpaceProperty;
-// SAX
-import org.xml.sax.Locator;
-
/**
* A text node (PCDATA) in the formatting object tree.
*
@@ -396,7 +393,7 @@ public class FOText extends FONode {
return ca[i];
}
default:
- log.warn("Invalid text-tranform value: " + textTransform);
+ assert false; //should never happen as the property subsystem catches that case
return ca[i];
}
}
diff --git a/src/java/org/apache/fop/fo/FOTreeBuilder.java b/src/java/org/apache/fop/fo/FOTreeBuilder.java
index d02a058fe..84abc4b8b 100644
--- a/src/java/org/apache/fop/fo/FOTreeBuilder.java
+++ b/src/java/org/apache/fop/fo/FOTreeBuilder.java
@@ -31,6 +31,8 @@ import org.xml.sax.helpers.DefaultHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.xmlgraphics.util.QName;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FormattingResults;
@@ -130,6 +132,7 @@ public class FOTreeBuilder extends DefaultHandler {
throw new IllegalStateException("FOTreeBuilder (and the Fop class) cannot be reused."
+ " Please instantiate a new instance.");
}
+
used = true;
empty = true;
rootFObj = null; // allows FOTreeBuilder to be reused
@@ -146,8 +149,10 @@ public class FOTreeBuilder extends DefaultHandler {
public void endDocument() throws SAXException {
this.delegate.endDocument();
if (this.rootFObj == null && empty) {
- throw new ValidationException(
- "Document is empty (something might be wrong with your XSLT stylesheet).");
+ FOValidationEventProducer eventProducer
+ = FOValidationEventProducer.Provider.get(
+ foEventHandler.getUserAgent().getEventBroadcaster());
+ eventProducer.emptyDocument(this);
}
rootFObj = null;
if (log.isDebugEnabled()) {
@@ -178,18 +183,6 @@ public class FOTreeBuilder extends DefaultHandler {
}
}
- /**
- * Finds the {@link Maker} used to create {@link FONode} objects of a particular type
- *
- * @param namespaceURI URI for the namespace of the element
- * @param localName name of the Element
- * @return the ElementMapping.Maker that can create an FO object for this element
- * @throws FOPException if a Maker could not be found for a bound namespace.
- */
- private Maker findFOMaker(String namespaceURI, String localName) throws FOPException {
- return elementMappingRegistry.findFOMaker(namespaceURI, localName, locator);
- }
-
/** {@inheritDoc} */
public void warning(SAXParseException e) {
log.warn(e.getLocalizedMessage());
@@ -258,22 +251,21 @@ public class FOTreeBuilder extends DefaultHandler {
if (rootFObj == null) {
empty = false;
if (!namespaceURI.equals(FOElementMapping.URI)
- || !localName.equals("root")) {
- throw new ValidationException(
- "Error: First element must be the fo:root formatting object. "
- + "Found " + FONode.getNodeString(namespaceURI, localName)
- + " instead."
- + " Please make sure you're producing a valid XSL-FO document.");
+ || !localName.equals("root")) {
+ FOValidationEventProducer eventProducer
+ = FOValidationEventProducer.Provider.get(
+ foEventHandler.getUserAgent().getEventBroadcaster());
+ eventProducer.invalidFORoot(this, FONode.getNodeString(namespaceURI, localName),
+ getEffectiveLocator());
}
} else { // check that incoming node is valid for currentFObj
- if (namespaceURI.equals(FOElementMapping.URI)
- || namespaceURI.equals(ExtensionElementMapping.URI)) {
+ if (currentFObj.getNamespaceURI().equals(FOElementMapping.URI)
+ || currentFObj.getNamespaceURI().equals(ExtensionElementMapping.URI)) {
currentFObj.validateChildNode(locator, namespaceURI, localName);
}
}
- ElementMapping.Maker fobjMaker =
- findFOMaker(namespaceURI, localName);
+ ElementMapping.Maker fobjMaker = findFOMaker(namespaceURI, localName);
try {
foNode = fobjMaker.make(currentFObj);
@@ -342,8 +334,7 @@ public class FOTreeBuilder extends DefaultHandler {
if (currentPropertyList != null
&& currentPropertyList.getFObj() == currentFObj
&& !foEventHandler.inMarker()) {
- currentPropertyList =
- currentPropertyList.getParentPropertyList();
+ currentPropertyList = currentPropertyList.getParentPropertyList();
}
if (currentFObj.getNameId() == Constants.FO_MARKER) {
@@ -373,7 +364,29 @@ public class FOTreeBuilder extends DefaultHandler {
/** {@inheritDoc} */
public void endDocument() throws SAXException {
currentFObj = null;
- }
+ }
+
+ /**
+ * Finds the {@link Maker} used to create {@link FONode} objects of a particular type
+ *
+ * @param namespaceURI URI for the namespace of the element
+ * @param localName name of the Element
+ * @return the ElementMapping.Maker that can create an FO object for this element
+ * @throws FOPException if a Maker could not be found for a bound namespace.
+ */
+ private Maker findFOMaker(String namespaceURI, String localName) throws FOPException {
+ Maker maker = elementMappingRegistry.findFOMaker(namespaceURI, localName, locator);
+ if (maker instanceof UnknownXMLObj.Maker) {
+ FOValidationEventProducer eventProducer
+ = FOValidationEventProducer.Provider.get(
+ foEventHandler.getUserAgent().getEventBroadcaster());
+ eventProducer.unknownFormattingObject(this, currentFObj.getName(),
+ new QName(namespaceURI, localName),
+ getEffectiveLocator());
+ }
+ return maker;
+ }
+
}
}
diff --git a/src/java/org/apache/fop/fo/FOValidationEventProducer.java b/src/java/org/apache/fop/fo/FOValidationEventProducer.java
new file mode 100644
index 000000000..aa7b14941
--- /dev/null
+++ b/src/java/org/apache/fop/fo/FOValidationEventProducer.java
@@ -0,0 +1,348 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fo;
+
+import org.xml.sax.Locator;
+
+import org.apache.xmlgraphics.util.QName;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.events.EventBroadcaster;
+import org.apache.fop.events.EventProducer;
+import org.apache.fop.fo.expr.PropertyException;
+
+/**
+ * Event producer interface for XSL-FO validation messages.
+ */
+public interface FOValidationEventProducer extends EventProducer {
+
+ /**
+ * Provider class for the event producer.
+ */
+ class Provider {
+
+ /**
+ * Returns an event producer.
+ * @param broadcaster the event broadcaster to use
+ * @return the event producer
+ */
+ public static FOValidationEventProducer get(EventBroadcaster broadcaster) {
+ return (FOValidationEventProducer)broadcaster.getEventProducerFor(
+ FOValidationEventProducer.class);
+ }
+ }
+
+ /**
+ * Too many child nodes.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param offendingNode the offending node
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void tooManyNodes(Object source, String elementName, QName offendingNode,
+ Locator loc) throws ValidationException;
+
+ /**
+ * The node order is wrong.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param tooLateNode string name of node that should be earlier in document
+ * @param tooEarlyNode string name of node that should be later in document
+ * @param canRecover indicates whether FOP can recover from this problem and continue working
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ */
+ void nodeOutOfOrder(Object source, String elementName,
+ String tooLateNode, String tooEarlyNode, boolean canRecover,
+ Locator loc) throws ValidationException;
+
+ /**
+ * An invalid child was encountered.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param offendingNode the offending node
+ * @param ruleViolated the rule that was violated or null
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ */
+ void invalidChild(Object source, String elementName, QName offendingNode, String ruleViolated,
+ Locator loc) throws ValidationException;
+
+ /**
+ * A required child element is missing.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param contentModel the expected content model
+ * @param canRecover indicates whether FOP can recover from this problem and continue working
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void missingChildElement(Object source, String elementName,
+ String contentModel, boolean canRecover,
+ Locator loc) throws ValidationException;
+
+ /**
+ * An element is missing a required property.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param propertyName the name of the missing property
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void missingProperty(Object source, String elementName, String propertyName,
+ Locator loc) throws ValidationException;
+
+ /**
+ * An id was used twice in a document.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param id the id that was reused
+ * @param canRecover indicates whether FOP can recover from this problem and continue working
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void idNotUnique(Object source, String elementName, String id, boolean canRecover,
+ Locator loc) throws ValidationException;
+
+ /**
+ * There are multiple color profiles defined with the same name.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param name the duplicate color profile name
+ * @param loc the location of the error or null
+ * @event.severity WARN
+ */
+ void colorProfileNameNotUnique(Object source, String elementName, String name,
+ Locator loc);
+
+ /**
+ * There are multiple page masters defined with the same name.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param name the duplicate page master name
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void masterNameNotUnique(Object source, String elementName, String name,
+ Locator loc) throws ValidationException;
+
+ /**
+ * A marker is not an initial child on a node.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param mcname the marker class name
+ * @param loc the location of the error or null
+ * @event.severity ERROR
+ */
+ void markerNotInitialChild(Object source, String elementName, String mcname, Locator loc);
+
+ /**
+ * A marker class name is not unique within the same parent.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param mcname the marker class name
+ * @param loc the location of the error or null
+ * @event.severity ERROR
+ */
+ void markerNotUniqueForSameParent(Object source, String elementName,
+ String mcname, Locator loc);
+
+ /**
+ * An invalid property was found.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param attr the invalid attribute
+ * @param canRecover indicates whether FOP can recover from this problem and continue working
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void invalidProperty(Object source, String elementName, QName attr, boolean canRecover,
+ Locator loc) throws ValidationException;
+
+ /**
+ * An invalid property value was encountered.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param propName the property name
+ * @param propValue the property value
+ * @param e the property exception caused by the invalid value
+ * @param loc the location of the error or null
+ * @event.severity ERROR
+ */
+ void invalidPropertyValue(Object source, String elementName,
+ String propName, String propValue, PropertyException e,
+ Locator loc);
+
+ /**
+ * A feature is not supported, yet.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param feature the unsupported feature
+ * @param loc the location of the error or null
+ * @event.severity WARN
+ */
+ void unimplementedFeature(Object source, String elementName, String feature,
+ Locator loc);
+
+ /**
+ * Missing internal-/external-destination on basic-link or bookmark.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void missingLinkDestination(Object source, String elementName, Locator loc)
+ throws ValidationException;
+
+ /**
+ * Indicates a problem while cloning a marker (ex. due to invalid property values).
+ * @param source the event source
+ * @param markerClassName the "marker-class-name" of the marker
+ * @param fe the FOP exception that cause this problem
+ * @param loc the location of the error or null
+ * @event.severity ERROR
+ */
+ void markerCloningFailed(Object source, String markerClassName, FOPException fe, Locator loc);
+
+ /**
+ * A region name is mapped to multiple region classes.
+ * @param source the event source
+ * @param regionName the region name
+ * @param defaultRegionClass1 the first default region class
+ * @param defaultRegionClass2 the second default region class
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void regionNameMappedToMultipleRegionClasses(Object source, String regionName,
+ String defaultRegionClass1, String defaultRegionClass2, Locator loc)
+ throws ValidationException;
+
+ /**
+ * There are multiple flows with the same name.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param flowName the flow name
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void duplicateFlowNameInPageSequence(Object source, String elementName, String flowName,
+ Locator loc) throws ValidationException;
+
+ /**
+ * A flow name could not be mapped to a region.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param flowName the flow name
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void flowNameNotMapped(Object source, String elementName, String flowName,
+ Locator loc) throws ValidationException;
+
+ /**
+ * A page master could not be found.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param masterReference the page master reference
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void masterNotFound(Object source, String elementName, String masterReference,
+ Locator loc) throws ValidationException;
+
+ /**
+ * An illegal region name was used.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param regionName the region name
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void illegalRegionName(Object source, String elementName, String regionName,
+ Locator loc) throws ValidationException;
+
+ /**
+ * A non-zero border and/or padding has been encountered on a region.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param regionName the region name
+ * @param canRecover indicates whether FOP can recover from this problem and continue working
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void nonZeroBorderPaddingOnRegion(Object source, String elementName, String regionName,
+ boolean canRecover, Locator loc) throws ValidationException;
+
+ /**
+ * If overflow property is set to "scroll", a column-count other than "1" may not be specified.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void columnCountErrorOnRegionBodyOverflowScroll(Object source, String elementName,
+ Locator loc) throws ValidationException;
+
+ /**
+ * fo:root must be root.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param loc the location of the error or null
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void invalidFORoot(Object source, String elementName,
+ Locator loc) throws ValidationException;
+
+ /**
+ * No FO document was found.
+ * @param source the event source
+ * @throws ValidationException the validation error provoked by the method call
+ * @event.severity FATAL
+ */
+ void emptyDocument(Object source) throws ValidationException;
+
+ /**
+ * An unknown/unsupported formatting object has been encountered.
+ * @param source the event source
+ * @param elementName the name of the context node
+ * @param offendingNode the offending node
+ * @param loc the location of the error or null
+ * @event.severity WARN
+ */
+ void unknownFormattingObject(Object source, String elementName,
+ QName offendingNode, Locator loc);
+
+}
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index b2587df2d..a03a351e0 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -27,13 +27,15 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
+import org.apache.xmlgraphics.util.QName;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.extensions.ExtensionAttachment;
import org.apache.fop.fo.flow.Marker;
import org.apache.fop.fo.properties.PropertyMaker;
-import org.apache.fop.util.QName;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
/**
* Base class for representation of formatting objects and their processing.
@@ -171,25 +173,7 @@ public abstract class FObj extends FONode implements Constants {
if (!idrefs.contains(id)) {
idrefs.add(id);
} else {
- if (getUserAgent().validateStrictly()) {
- throw new ValidationException("Property id \"" + id
- + "\" previously used; id values must be unique"
- + " in document.", locator);
- } else {
- if (log.isWarnEnabled()) {
- StringBuffer msg = new StringBuffer();
- msg.append("Found non-unique id on ").append(getName());
- if (locator.getLineNumber() != -1) {
- msg.append(" (at ").append(locator.getLineNumber())
- .append("/").append(locator.getColumnNumber())
- .append(")");
- }
- msg.append("\nAny reference to it will be considered "
- + "a reference to the first occurrence "
- + "in the document.");
- log.warn(msg);
- }
- }
+ getFOValidationEventProducer().idNotUnique(this, getName(), id, true, locator);
}
}
}
@@ -283,16 +267,22 @@ public abstract class FObj extends FONode implements Constants {
return false;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public FONodeIterator getChildNodes() {
- if (firstChild != null) {
+ if (hasChildren()) {
return new FObjIterator(this);
}
return null;
}
+ /**
+ * Indicates whether this formatting object has children.
+ * @return true if there are children
+ */
+ public boolean hasChildren() {
+ return this.firstChild != null;
+ }
+
/**
* Return an iterator over the object's childNodes starting
* at the passed-in node (= first call to iterator.next() will
@@ -348,8 +338,8 @@ public abstract class FObj extends FONode implements Constants {
if (node instanceof FObj
|| (node instanceof FOText
&& ((FOText) node).willCreateArea())) {
- log.error(
- "fo:marker must be an initial child: " + mcname);
+ getFOValidationEventProducer().markerNotInitialChild(this, getName(),
+ mcname, locator);
return;
} else if (node instanceof FOText) {
iter.remove();
@@ -363,8 +353,8 @@ public abstract class FObj extends FONode implements Constants {
if (!markers.containsKey(mcname)) {
markers.put(mcname, marker);
} else {
- log.error("fo:marker 'marker-class-name' "
- + "must be unique for same parent: " + mcname);
+ getFOValidationEventProducer().markerNotUniqueForSameParent(this, getName(),
+ mcname, locator);
}
}
@@ -382,6 +372,33 @@ public abstract class FObj extends FONode implements Constants {
return markers;
}
+ /** {@inheritDoc} */
+ protected String getContextInfoAlt() {
+ StringBuffer sb = new StringBuffer();
+ if (getLocalName() != null) {
+ sb.append(getName());
+ sb.append(", ");
+ }
+ if (hasId()) {
+ sb.append("id=").append(getId());
+ return sb.toString();
+ }
+ String s = gatherContextInfo();
+ if (s != null) {
+ sb.append("\"");
+ if (s.length() < 32) {
+ sb.append(s);
+ } else {
+ sb.append(s.substring(0, 32));
+ sb.append("...");
+ }
+ sb.append("\"");
+ return sb.toString();
+ } else {
+ return null;
+ }
+ }
+
/** {@inheritDoc} */
protected String gatherContextInfo() {
if (getLocator() != null) {
diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java
index 3d050efed..b6766bfe9 100644
--- a/src/java/org/apache/fop/fo/PropertyList.java
+++ b/src/java/org/apache/fop/fo/PropertyList.java
@@ -20,13 +20,13 @@
package org.apache.fop.fo;
// Java
-import java.text.MessageFormat;
-
import org.xml.sax.Attributes;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.xmlgraphics.util.QName;
+
import org.apache.fop.apps.FopFactory;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.properties.CommonAbsolutePosition;
@@ -41,7 +41,6 @@ import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.properties.CommonTextDecoration;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.PropertyMaker;
-import org.apache.fop.util.QName;
/**
* Class containing the collection of properties for a given FObj.
@@ -150,7 +149,7 @@ public abstract class PropertyList {
* the default value.
* @param propId The Constants ID of the property whose value is desired.
* @return the Property corresponding to that name
- * @throws PropertyException ...
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property get(int propId) throws PropertyException {
return get(propId, true, true);
@@ -166,7 +165,7 @@ public abstract class PropertyList {
* value is needed
* @param bTryDefault true when the default value may be used as a last resort
* @return the property
- * @throws PropertyException ...
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property get(int propId, boolean bTryInherit,
boolean bTryDefault) throws PropertyException {
@@ -321,20 +320,18 @@ public abstract class PropertyList {
} else if (!factory.isNamespaceIgnored(attributeNS)) {
ElementMapping mapping = factory.getElementMappingRegistry().getElementMapping(
attributeNS);
+ QName attr = new QName(attributeNS, attributeName);
if (mapping != null) {
- QName attName = new QName(attributeNS, attributeName);
- if (mapping.isAttributeProperty(attName)
+ if (mapping.isAttributeProperty(attr)
&& mapping.getStandardPrefix() != null) {
convertAttributeToProperty(attributes,
- mapping.getStandardPrefix() + ":" + attName.getLocalName(),
+ mapping.getStandardPrefix() + ":" + attr.getLocalName(),
attributeValue);
} else {
- getFObj().addForeignAttribute(attName, attributeValue);
+ getFObj().addForeignAttribute(attr, attributeValue);
}
} else {
- handleInvalidProperty(
- "Error processing foreign attribute: "
- + attributeNS + "/@" + attributeName, attributeName);
+ handleInvalidProperty(attr);
}
}
}
@@ -345,11 +342,8 @@ public abstract class PropertyList {
* @param propertyName the property name to check
* @return true if the base property name and the subproperty name (if any)
* can be correctly mapped to an id
- * @throws ValidationException in case the property name
- * is invalid for the FO namespace
*/
- protected boolean isValidPropertyName(String propertyName)
- throws ValidationException {
+ protected boolean isValidPropertyName(String propertyName) {
int propId = FOPropertyMapping.getPropertyId(
findBasePropertyName(propertyName));
@@ -359,9 +353,6 @@ public abstract class PropertyList {
if (propId == -1
|| (subpropId == -1
&& findSubPropertyName(propertyName) != null)) {
- String errorMessage = MessageFormat.format(
- "Invalid property name ''{0}''.", new Object[] {propertyName});
- handleInvalidProperty(errorMessage, propertyName);
return false;
}
return true;
@@ -382,19 +373,23 @@ public abstract class PropertyList {
if (attributeValue != null) {
- if (!isValidPropertyName(attributeName)) {
- //will log an error or throw an exception
+ if (attributeName.startsWith("xmlns:")) {
+ //Ignore namespace declarations
return;
}
- FObj parentFO = fobj.findNearestAncestorFObj();
-
/* Handle "compound" properties, ex. space-before.minimum */
String basePropertyName = findBasePropertyName(attributeName);
String subPropertyName = findSubPropertyName(attributeName);
int propId = FOPropertyMapping.getPropertyId(basePropertyName);
int subpropId = FOPropertyMapping.getSubPropertyId(subPropertyName);
+
+ if (propId == -1
+ || (subpropId == -1 && subPropertyName != null)) {
+ handleInvalidProperty(new QName(null, attributeName));
+ }
+ FObj parentFO = fobj.findNearestAncestorFObj();
PropertyMaker propertyMaker = findMaker(propId);
if (propertyMaker == null) {
@@ -417,8 +412,8 @@ public abstract class PropertyList {
}
prop = propertyMaker.make(this, attributeValue, parentFO);
} else { // e.g. "leader-length.maximum"
- Property baseProperty =
- findBaseProperty(attributes, parentFO, propId,
+ Property baseProperty
+ = findBaseProperty(attributes, parentFO, propId,
basePropertyName, propertyMaker);
prop = propertyMaker.make(baseProperty, subpropId,
this, attributeValue, parentFO);
@@ -427,8 +422,8 @@ public abstract class PropertyList {
putExplicit(propId, prop);
}
} catch (PropertyException e) {
- log.error("Ignoring property: "
- + attributeName + "=\"" + attributeValue + "\" (" + e.getMessage() + ")");
+ fobj.getFOValidationEventProducer().invalidPropertyValue(this, fobj.getName(),
+ attributeName, attributeValue, e, fobj.locator);
}
}
}
@@ -465,18 +460,16 @@ public abstract class PropertyList {
}
/**
- * @param message ...
- * @param propName ...
- * @throws ValidationException ...
+ * Handles an invalid property.
+ * @param attr the invalid attribute
+ * @throws ValidationException if an exception needs to be thrown depending on the
+ * validation settings
*/
- protected void handleInvalidProperty(String message, String propName)
+ protected void handleInvalidProperty(QName attr)
throws ValidationException {
- if (!propName.startsWith("xmlns")) {
- if (fobj.getUserAgent().validateStrictly()) {
- fobj.attributeError(message);
- } else {
- log.error(message + " Property ignored.");
- }
+ if (!attr.getQName().startsWith("xmlns")) {
+ fobj.getFOValidationEventProducer().invalidProperty(this, fobj.getName(),
+ attr, true, fobj.locator);
}
}
diff --git a/src/java/org/apache/fop/fo/expr/FromParentFunction.java b/src/java/org/apache/fop/fo/expr/FromParentFunction.java
index b5a82de56..b09d3c95f 100644
--- a/src/java/org/apache/fop/fo/expr/FromParentFunction.java
+++ b/src/java/org/apache/fop/fo/expr/FromParentFunction.java
@@ -64,7 +64,13 @@ public class FromParentFunction extends FunctionBase {
* non-inherited properties too. Perhaps the result is different for
* a property line line-height which "inherits specified"???
*/
- return pInfo.getPropertyList().getFromParent(FOPropertyMapping.getPropertyId(propName));
+ int propId = FOPropertyMapping.getPropertyId(propName);
+ if (propId < 0) {
+ throw new PropertyException(
+ "Unknown property name used with inherited-property-value function: "
+ + propName);
+ }
+ return pInfo.getPropertyList().getFromParent(propId);
}
}
diff --git a/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java b/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
index 3e5cadf04..e24c78caa 100644
--- a/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
+++ b/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
@@ -58,6 +58,11 @@ public class InheritedPropFunction extends FunctionBase {
}
int propId = FOPropertyMapping.getPropertyId(propName);
+ if (propId < 0) {
+ throw new PropertyException(
+ "Unknown property name used with inherited-property-value function: "
+ + propName);
+ }
return pInfo.getPropertyList().getInherited(propId);
}
diff --git a/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java b/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
index 2aab5eee9..cdde96092 100644
--- a/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
+++ b/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
@@ -60,6 +60,11 @@ public class NearestSpecPropFunction extends FunctionBase {
// NOTE: special cases for shorthand property
// Should return COMPUTED VALUE
int propId = FOPropertyMapping.getPropertyId(propName);
+ if (propId < 0) {
+ throw new PropertyException(
+ "Unknown property name used with inherited-property-value function: "
+ + propName);
+ }
return pInfo.getPropertyList().getNearestSpecified(propId);
}
diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
index de1d019f4..fc61167b2 100644
--- a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
@@ -19,14 +19,15 @@
package org.apache.fop.fo.extensions;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.apache.xmlgraphics.util.QName;
+
import org.apache.fop.fo.ElementMapping;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.UnknownXMLObj;
import org.apache.fop.fo.extensions.destination.Destination;
-import org.apache.fop.util.QName;
-
-import java.util.HashMap;
-import java.util.Set;
/**
* Element mapping for FOP's proprietary extension to XSL-FO.
diff --git a/src/java/org/apache/fop/fo/extensions/destination/Destination.java b/src/java/org/apache/fop/fo/extensions/destination/Destination.java
index d1e631e42..e3a2bbac4 100644
--- a/src/java/org/apache/fop/fo/extensions/destination/Destination.java
+++ b/src/java/org/apache/fop/fo/extensions/destination/Destination.java
@@ -19,15 +19,15 @@
package org.apache.fop.fo.extensions.destination;
-import org.apache.fop.fo.ValidationException;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.pagination.Root;
+import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
+import org.apache.fop.fo.pagination.Root;
/**
* Class for named destinations in PDF.
@@ -54,7 +54,7 @@ public class Destination extends FONode {
Attributes attlist, PropertyList pList) throws FOPException {
internalDestination = attlist.getValue("internal-destination");
if (internalDestination == null || internalDestination.length() == 0) {
- attributeError("Missing attribute: internal-destination must be specified.");
+ missingPropertyError("internal-destination");
}
}
diff --git a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
index 0fe6ed718..f99f9d947 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
@@ -62,14 +62,16 @@ public abstract class AbstractListItemPart extends FObj {
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("marker")) {
- if (blockItemFound) {
- nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("marker")) {
+ if (blockItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ }
+ } else if (!isBlockItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ } else {
+ blockItemFound = true;
}
- } else if (!isBlockItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
- } else {
- blockItemFound = true;
}
}
@@ -79,17 +81,8 @@ public abstract class AbstractListItemPart extends FObj {
protected void endOfNode() throws FOPException {
if (!this.blockItemFound) {
String contentModel = "marker* (%block;)+";
- if (getUserAgent().validateStrictly()) {
- missingChildElementError(contentModel);
- } else {
- StringBuffer message = new StringBuffer(
- errorText(getLocator()));
- message.append(getName())
- .append(" is missing child elements. ")
- .append("Required Content Model: ")
- .append(contentModel);
- log.warn(message.toString());
- }
+ getFOValidationEventProducer().missingChildElement(this, getName(),
+ contentModel, true, getLocator());
}
}
diff --git a/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java b/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
index b6b827248..e9a1176d6 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
@@ -113,8 +113,10 @@ public abstract class AbstractPageNumberCitation extends FObj {
* XSL Content Model: empty
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
+ }
}
/** @return the Common Font Properties. */
diff --git a/src/java/org/apache/fop/fo/flow/BasicLink.java b/src/java/org/apache/fop/fo/flow/BasicLink.java
index 61a4f8d19..b3ef48012 100644
--- a/src/java/org/apache/fop/fo/flow/BasicLink.java
+++ b/src/java/org/apache/fop/fo/flow/BasicLink.java
@@ -76,8 +76,7 @@ public class BasicLink extends Inline {
externalDestination = null;
} else if (externalDestination.length() == 0) {
// slightly stronger than spec "should be specified"
- attributeError("Missing attribute: Either external-destination or " +
- "internal-destination must be specified.");
+ getFOValidationEventProducer().missingLinkDestination(this, getName(), locator);
}
}
@@ -102,15 +101,17 @@ public class BasicLink extends Inline {
* XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("marker")) {
- if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:marker", "(#PCDATA|%inline;|%block;)");
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("marker")) {
+ if (blockOrInlineItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "(#PCDATA|%inline;|%block;)");
+ }
+ } else if (!isBlockOrInlineItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ } else {
+ blockOrInlineItemFound = true;
}
- } else if (!isBlockOrInlineItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
- } else {
- blockOrInlineItemFound = true;
}
}
diff --git a/src/java/org/apache/fop/fo/flow/BidiOverride.java b/src/java/org/apache/fop/fo/flow/BidiOverride.java
index 2157085ad..892f4a3c5 100644
--- a/src/java/org/apache/fop/fo/flow/BidiOverride.java
+++ b/src/java/org/apache/fop/fo/flow/BidiOverride.java
@@ -19,13 +19,14 @@
package org.apache.fop.fo.flow;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
import org.apache.fop.fo.properties.SpaceProperty;
-import org.xml.sax.Locator;
/**
* Class modelling the fo:bidi-override object.
@@ -96,22 +97,21 @@ public class BidiOverride extends FObjMixed {
* fo:inline-container."
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("marker")) {
- if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:marker",
- "(#PCDATA|%inline;|%block;)");
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("marker")) {
+ if (blockOrInlineItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker",
+ "(#PCDATA|%inline;|%block;)");
+ }
+ } else if (!isBlockOrInlineItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)) {
+ invalidChildError(loc, getParent().getName(), nsURI, getName(),
+ "rule.bidiOverrideContent");
+ } else {
+ blockOrInlineItemFound = true;
}
- } else if (!isBlockOrInlineItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
- } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)) {
- String ruleViolated = "An fo:bidi-override"
- + " that is a descendant of an fo:leader or of the fo:inline child"
- + " of an fo:footnote may not have block-level children, unless it"
- + " has a nearer ancestor that is an fo:inline-container.";
- invalidChildError(loc, nsURI, localName, ruleViolated);
- } else {
- blockOrInlineItemFound = true;
}
}
diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java
index a71999938..f1180ac16 100644
--- a/src/java/org/apache/fop/fo/flow/BlockContainer.java
+++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java
@@ -114,15 +114,17 @@ public class BlockContainer extends FObj {
* @todo - implement above restriction if possible
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
- if (FO_URI.equals(nsURI) && localName.equals("marker")) {
- if (blockItemFound) {
- nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
+ if (localName.equals("marker")) {
+ if (blockItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ }
+ } else if (!isBlockItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ } else {
+ blockItemFound = true;
}
- } else if (!isBlockItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
- } else {
- blockItemFound = true;
}
}
diff --git a/src/java/org/apache/fop/fo/flow/Character.java b/src/java/org/apache/fop/fo/flow/Character.java
index 022d54af7..aad4209f9 100644
--- a/src/java/org/apache/fop/fo/flow/Character.java
+++ b/src/java/org/apache/fop/fo/flow/Character.java
@@ -22,6 +22,8 @@ package org.apache.fop.fo.flow;
import java.awt.Color;
import java.util.NoSuchElementException;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.CharIterator;
@@ -35,7 +37,6 @@ import org.apache.fop.fo.properties.CommonHyphenation;
import org.apache.fop.fo.properties.CommonTextDecoration;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.SpaceProperty;
-import org.xml.sax.Locator;
/**
* Class modelling the fo:character object.
@@ -134,8 +135,10 @@ public class Character extends FObj {
* XSL Content Model: empty
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws ValidationException {
+ throws ValidationException {
+ if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
+ }
}
/**
diff --git a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
index fdddf3918..07f765e52 100644
--- a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
+++ b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
@@ -32,6 +32,7 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.URISpecification;
+import org.apache.fop.events.ResourceEventProducer;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
@@ -78,11 +79,17 @@ public class ExternalGraphic extends AbstractGraphics {
try {
info = manager.getImageInfo(url, userAgent.getImageSessionContext());
} catch (ImageException e) {
- log.error("Image not available: " + e.getMessage());
+ ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.imageError(this, url, e, getLocator());
} catch (FileNotFoundException fnfe) {
- log.error(fnfe.getMessage());
+ ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.imageNotFound(this, url, fnfe, getLocator());
} catch (IOException ioe) {
- log.error("I/O error while loading image: " + ioe.getMessage());
+ ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+ getUserAgent().getEventBroadcaster());
+ eventProducer.imageIOError(this, url, ioe, getLocator());
}
if (info != null) {
this.intrinsicWidth = info.getSize().getWidthMpt();
@@ -93,7 +100,6 @@ public class ExternalGraphic extends AbstractGraphics {
= FixedLength.getInstance(-baseline);
}
}
- //TODO Report to caller so he can decide to throw an exception
}
/** {@inheritDoc} */
@@ -107,8 +113,10 @@ public class ExternalGraphic extends AbstractGraphics {
* FOUserAgent
- */
+ /** {@inheritDoc} */
public FOUserAgent getUserAgent() {
return userAgent;
}
@@ -797,10 +792,11 @@ public abstract class AbstractRenderer
= new XMLHandlerConfigurator(userAgent);
configurator.configure(ctx, namespace);
handler.handleXML(ctx, doc, namespace);
- } catch (Throwable t) {
+ } catch (Exception e) {
// could not handle document
- log.error("Some XML content will be ignored. "
- + "Could not render XML", t);
+ ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+ ctx.getUserAgent().getEventBroadcaster());
+ eventProducer.foreignXMLProcessingError(this, doc, namespace, e);
}
} else {
if (warnedXMLHandlers == null) {
@@ -809,8 +805,9 @@ public abstract class AbstractRenderer
if (!warnedXMLHandlers.contains(namespace)) {
// no handler found for document
warnedXMLHandlers.add(namespace);
- log.warn("Some XML content will be ignored. "
- + "No handler defined for XML: " + namespace);
+ ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
+ ctx.getUserAgent().getEventBroadcaster());
+ eventProducer.foreignXMLNoHandler(this, doc, namespace);
}
}
}
diff --git a/src/java/org/apache/fop/render/Renderer.java b/src/java/org/apache/fop/render/Renderer.java
index b40eec0cf..03b4582f7 100644
--- a/src/java/org/apache/fop/render/Renderer.java
+++ b/src/java/org/apache/fop/render/Renderer.java
@@ -88,6 +88,12 @@ public interface Renderer {
*/
void setUserAgent(FOUserAgent agent);
+ /**
+ * Returns the associated user agent.
+ * @return the user agent
+ */
+ FOUserAgent getUserAgent();
+
/**
* Set up the given FontInfo.
*
diff --git a/src/java/org/apache/fop/render/RendererEventProducer.java b/src/java/org/apache/fop/render/RendererEventProducer.java
new file mode 100644
index 000000000..365c8f430
--- /dev/null
+++ b/src/java/org/apache/fop/render/RendererEventProducer.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render;
+
+import java.io.IOException;
+
+import org.apache.fop.events.EventBroadcaster;
+import org.apache.fop.events.EventProducer;
+
+/**
+ * Event producer interface for rendering-specific events.
+ */
+public interface RendererEventProducer extends EventProducer {
+
+ /** Provider class for the event producer. */
+ class Provider {
+
+ /**
+ * Returns an event producer.
+ * @param broadcaster the event broadcaster to use
+ * @return the event producer
+ */
+ public static RendererEventProducer get(EventBroadcaster broadcaster) {
+ return (RendererEventProducer)broadcaster.getEventProducerFor(
+ RendererEventProducer.class);
+ }
+ }
+
+ /**
+ * I/O error while writing target file.
+ * @param source the event source
+ * @param ioe the original I/O error
+ * @event.severity ERROR
+ */
+ void ioError(Object source, IOException ioe);
+}
diff --git a/src/java/org/apache/fop/render/afp/AFPEventProducer.java b/src/java/org/apache/fop/render/afp/AFPEventProducer.java
new file mode 100644
index 000000000..615c54c32
--- /dev/null
+++ b/src/java/org/apache/fop/render/afp/AFPEventProducer.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.afp;
+
+import org.apache.fop.events.EventBroadcaster;
+import org.apache.fop.events.EventProducer;
+import org.apache.fop.events.model.AbstractEventModelFactory;
+import org.apache.fop.events.model.EventModel;
+
+/**
+ * Event producer interface for AFP-specific events.
+ */
+public interface AFPEventProducer extends EventProducer {
+
+ /** Provider class for the event producer. */
+ class Provider {
+
+ /**
+ * Returns an event producer.
+ * @param broadcaster the event broadcaster to use
+ * @return the event producer
+ */
+ public static AFPEventProducer get(EventBroadcaster broadcaster) {
+ return (AFPEventProducer)broadcaster.getEventProducerFor(
+ AFPEventProducer.class);
+ }
+ }
+
+ /** Event model factory for AFP. */
+ public static class EventModelFactory extends AbstractEventModelFactory {
+
+ /** {@inheritDoc} */
+ public EventModel createEventModel() {
+ return loadModel(getClass(), "event-model.xml");
+ }
+
+ }
+
+ /**
+ * Warn about using default font setup.
+ * @param source the event source
+ * @event.severity WARN
+ */
+ void warnDefaultFontSetup(Object source);
+
+}
diff --git a/src/java/org/apache/fop/render/afp/AFPEventProducer.xml b/src/java/org/apache/fop/render/afp/AFPEventProducer.xml
new file mode 100644
index 000000000..8eec9b656
--- /dev/null
+++ b/src/java/org/apache/fop/render/afp/AFPEventProducer.xml
@@ -0,0 +1,4 @@
+
+* Note: This class allows to carry a namespace prefix but it is not used in the equals() and * hashCode() methods. + * @deprecated Use the XML Graphics Commons variant instead! */ -public class QName implements Serializable { +public class QName extends org.apache.xmlgraphics.util.QName { private static final long serialVersionUID = -5225376740044770690L; - private String namespaceURI; - private String localName; - private String prefix; - private int hashCode; - /** * Main constructor. * @param namespaceURI the namespace URI @@ -43,16 +37,7 @@ public class QName implements Serializable { * @param localName the local name */ public QName(String namespaceURI, String prefix, String localName) { - if (localName == null) { - throw new NullPointerException("Parameter localName must not be null"); - } - if (localName.length() == 0) { - throw new IllegalArgumentException("Parameter localName must not be empty"); - } - this.namespaceURI = namespaceURI; - this.prefix = prefix; - this.localName = localName; - this.hashCode = toHashString().hashCode(); + super(namespaceURI, prefix, localName); } /** @@ -61,78 +46,7 @@ public class QName implements Serializable { * @param qName the qualified name */ public QName(String namespaceURI, String qName) { - if (qName == null) { - throw new NullPointerException("Parameter localName must not be null"); - } - if (qName.length() == 0) { - throw new IllegalArgumentException("Parameter localName must not be empty"); - } - this.namespaceURI = namespaceURI; - int p = qName.indexOf(':'); - if (p > 0) { - this.prefix = qName.substring(0, p); - this.localName = qName.substring(p + 1); - } else { - this.prefix = null; - this.localName = qName; - } - this.hashCode = toHashString().hashCode(); + super(namespaceURI, qName); } - /** @return the namespace URI */ - public String getNamespaceURI() { - return this.namespaceURI; - } - - /** @return the namespace prefix */ - public String getPrefix() { - return this.prefix; - } - - /** @return the local name */ - public String getLocalName() { - return this.localName; - } - - /** @return the fully qualified name */ - public String getQName() { - return getPrefix() != null ? getPrefix() + ':' + getLocalName() : getLocalName(); - } - - /** {@inheritDoc} */ - public int hashCode() { - return this.hashCode; - } - - /** {@inheritDoc} */ - public boolean equals(Object obj) { - if (obj == null) { - return false; - } else if (obj == this) { - return true; - } else { - if (obj instanceof QName) { - QName other = (QName)obj; - if ((getNamespaceURI() == null && other.getNamespaceURI() == null) - || getNamespaceURI().equals(other.getNamespaceURI())) { - return getLocalName().equals(other.getLocalName()); - } - } - } - return false; - } - - /** {@inheritDoc} */ - public String toString() { - return prefix != null - ? (prefix + ":" + localName) - : toHashString(); - } - - private String toHashString() { - return (namespaceURI != null - ? ("{" + namespaceURI + "}" + localName) - : localName); - } - } diff --git a/src/java/org/apache/fop/util/XMLResourceBundle.java b/src/java/org/apache/fop/util/XMLResourceBundle.java new file mode 100644 index 000000000..1b320816b --- /dev/null +++ b/src/java/org/apache/fop/util/XMLResourceBundle.java @@ -0,0 +1,398 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.util; + +import java.io.IOException; +import java.io.InputStream; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Locale; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.Properties; +import java.util.ResourceBundle; +import java.util.Stack; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.stream.StreamSource; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +import org.apache.xmlgraphics.util.QName; + +/** + * This class is a ResourceBundle that loads its contents from XML files instead of properties + * files (like PropertiesResourceBundle). + *
+ * The XML format for this resource bundle implementation is the following + * (the same as Apache Cocoon's XMLResourceBundle): + *
+ * <catalogue xml:lang="en"> + * <message key="key1">Message <br/> Value 1</message> + * <message key="key2">Message <br/> Value 1</message> + * ... + * </catalogue> + *+ */ +public class XMLResourceBundle extends ResourceBundle { + + //Note: Some code here has been copied and adapted from Apache Harmony! + + private Properties resources = new Properties(); + + private Locale locale; + + private static SAXTransformerFactory tFactory + = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); + + /** + * Creates a resource bundle from an InputStream. + * @param in the stream to read from + * @throws IOException if an I/O error occurs + */ + public XMLResourceBundle(InputStream in) throws IOException { + try { + Transformer transformer = tFactory.newTransformer(); + StreamSource src = new StreamSource(in); + SAXResult res = new SAXResult(new CatalogueHandler()); + transformer.transform(src, res); + } catch (TransformerException e) { + throw new IOException("Error while parsing XML resource bundle: " + e.getMessage()); + } + } + + /** + * Gets a resource bundle using the specified base name, default locale, and class loader. + * @param baseName the base name of the resource bundle, a fully qualified class name + * @param loader the class loader from which to load the resource bundle + * @return a resource bundle for the given base name and the default locale + * @throws MissingResourceException if no resource bundle for the specified base name can be + * found + * @see java.util.ResourceBundle#getBundle(String) + */ + public static ResourceBundle getXMLBundle(String baseName, ClassLoader loader) + throws MissingResourceException { + return getXMLBundle(baseName, Locale.getDefault(), loader); + } + + /** + * Gets a resource bundle using the specified base name, locale, and class loader. + * @param baseName the base name of the resource bundle, a fully qualified class name + * @param locale the locale for which a resource bundle is desired + * @param loader the class loader from which to load the resource bundle + * @return a resource bundle for the given base name and locale + * @throws MissingResourceException if no resource bundle for the specified base name can be + * found + * @see java.util.ResourceBundle#getBundle(String, Locale, ClassLoader) + */ + public static ResourceBundle getXMLBundle(String baseName, Locale locale, ClassLoader loader) + throws MissingResourceException { + if (loader == null) { + throw new NullPointerException("loader must not be null"); + } + if (baseName == null) { + throw new NullPointerException("baseName must not be null"); + } + + ResourceBundle bundle; + if (!locale.equals(Locale.getDefault())) { + bundle = handleGetXMLBundle(baseName, "_" + locale, false, loader); + if (bundle != null) { + return bundle; + } + } + bundle = handleGetXMLBundle(baseName, "_" + Locale.getDefault(), true, loader); + if (bundle != null) { + return bundle; + } + throw new MissingResourceException( + baseName + " (" + locale + ")", baseName + '_' + locale, null); + } + + static class MissingBundle extends ResourceBundle { + public Enumeration getKeys() { + return null; + } + + public Object handleGetObject(String name) { + return null; + } + } + + private static final ResourceBundle MISSING = new MissingBundle(); + private static final ResourceBundle MISSINGBASE = new MissingBundle(); + + private static Map cache = new java.util.WeakHashMap(); + //
Adobe's browser plugin, for example, ignores the /NewWindow
flag.
+
For links pointing to non-PDF destinations (e.g.
ExternalLink
from a trait value/attribute value in the
+ * area tree
+ * @param traitValue the value to use (should match the result of {@link #toString()}
+ * @return an ExternalLink
instance corresponding to the given value
+ */
+ protected static ExternalLink makeFromTraitValue(String traitValue) {
+ if (traitValue.indexOf(ExternalLink.class.getName()) == -1
+ || traitValue.indexOf("dest=") == -1) {
+ throw new IllegalArgumentException(
+ "Malformed trait value for Trait.ExternalLink: " + traitValue);
+ }
+ int startIndex = traitValue.indexOf("dest=") + 5;
+ int endIndex = traitValue.indexOf(',', startIndex);
+ if (endIndex == -1) {
+ endIndex = traitValue.indexOf(']');
+ }
+ String dest = traitValue.substring(startIndex, endIndex);
+ startIndex = traitValue.indexOf("newWindow=", endIndex) + 10;
+ endIndex = traitValue.indexOf(']', startIndex);
+ boolean newWindow = Boolean.parseBoolean(
+ traitValue.substring(startIndex, endIndex));
+ return new ExternalLink(dest, newWindow);
+ }
+
+ /**
+ * Get the target/destination of the link
+ * @return the destination of the link
+ */
+ public String getDestination() {
+ return this.destination;
+ }
+
+ /**
+ * Check if the target has to be displayed in a new window
+ * @return true
if the target has to be displayed in a new window
+ */
+ public boolean newWindow() {
+ return this.newWindow;
+ }
+
+ /**
+ * Return a String representation of the object.
+ * @return a String
of the form
+ * "org.apache.fop.area.Trait.ExternalLink[dest=someURL,newWindow=false]"
+ */
+ public String toString() {
+ StringBuffer sb = new StringBuffer(64);
+ sb.append(super.toString());
+ sb.append("[dest=").append(this.destination);
+ sb.append(",newWindow=").append(newWindow).append("]");
+ return sb.toString();
+ }
+ }
+
/**
* Background trait structure.
* Used for storing back trait information which are related.
diff --git a/src/java/org/apache/fop/fo/Constants.java b/src/java/org/apache/fop/fo/Constants.java
index edfa68c1a..25c2fe371 100644
--- a/src/java/org/apache/fop/fo/Constants.java
+++ b/src/java/org/apache/fop/fo/Constants.java
@@ -1092,7 +1092,11 @@ public interface Constants {
/** Enumeration constant -- for instream-foreign-object and external-graphic, XSL 1.1 */
int EN_SCALE_DOWN_TO_FIT = 187;
/** Enumeration constant -- for instream-foreign-object and external-graphic, XSL 1.1 */
- int EN_SCALE_UP_TO_FIT = 188;
+ int EN_SCALE_UP_TO_FIT = 188;
+ /** Enumeration constant -- for fo:basic-link show-destination */
+ int EN_REPLACE = 189;
+ /** Enumeration constant -- for fo:basic-link show-destination */
+ int EN_NEW = 190;
/** Number of enumeration constants defined */
- int ENUM_COUNT = 188;
+ int ENUM_COUNT = 190;
}
diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java
index db19d6515..5d4185d68 100644
--- a/src/java/org/apache/fop/fo/FOPropertyMapping.java
+++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java
@@ -258,7 +258,7 @@ public final class FOPropertyMapping implements Constants {
/**
* Return a (possibly cached) enum property based in the enum value.
- * @param enum A enum value from Constants.java.
+ * @param enumValue A enum value from Constants.java.
* @param text the text value by which this enum property is known
* @return An EnumProperty instance.
*/
@@ -371,9 +371,8 @@ public final class FOPropertyMapping implements Constants {
|| ((id & Constants.PROPERTY_MASK) == 0)) {
return (String) s_htPropIds.get(new Integer(id));
} else {
- return (String) s_htPropIds.get(new Integer(
- id & Constants.PROPERTY_MASK)) + "." + s_htPropIds.get(
- new Integer(id & Constants.COMPOUND_MASK));
+ return s_htPropIds.get(new Integer(id & Constants.PROPERTY_MASK))
+ + "." + s_htPropIds.get(new Integer(id & Constants.COMPOUND_MASK));
}
}
@@ -2019,8 +2018,10 @@ public final class FOPropertyMapping implements Constants {
addPropertyMaker("internal-destination", m);
// show-destination
- m = new ToBeImplementedProperty.Maker(PR_SHOW_DESTINATION);
+ m = new EnumProperty.Maker(PR_SHOW_DESTINATION);
m.setInherited(false);
+ m.addEnum("new", getEnumProperty(EN_NEW, "NEW"));
+ m.addEnum("replace", getEnumProperty(EN_REPLACE, "REPLACE"));
m.setDefault("replace");
addPropertyMaker("show-destination", m);
diff --git a/src/java/org/apache/fop/fo/flow/BasicLink.java b/src/java/org/apache/fop/fo/flow/BasicLink.java
index b3ef48012..82d0134bd 100644
--- a/src/java/org/apache/fop/fo/flow/BasicLink.java
+++ b/src/java/org/apache/fop/fo/flow/BasicLink.java
@@ -27,19 +27,21 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
/**
- * Class modelling the fo:basic-link object.
+ * Class modelling the
+ * fo:basic-link
object.
*
* This class contains the logic to determine the link represented by this FO,
* and whether that link is external (uses a URI) or internal (an id
* reference).
*/
public class BasicLink extends Inline {
+
// The value of properties relevant for fo:basic-link.
// private ToBeImplementedProperty destinationPlacementOffset;
private String externalDestination;
// private ToBeImplementedProperty indicateDestination;
private String internalDestination;
- // private ToBeImplementedProperty showDestination;
+ private int showDestination;
// private ToBeImplementedProperty targetProcessingContext;
// private ToBeImplementedProperty targetPresentationContext;
// private ToBeImplementedProperty targetStylesheet;
@@ -51,22 +53,23 @@ public class BasicLink extends Inline {
private boolean blockOrInlineItemFound = false;
/**
- * @param parent FONode that is the parent of this object
+ * Construct a BasicLink instance with the given {@link FONode}
+ * as its parent.
+ *
+ * @param parent {@link FONode} that is the parent of this object
*/
public BasicLink(FONode parent) {
super(parent);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
// destinationPlacementOffset = pList.get(PR_DESTINATION_PLACEMENT_OFFSET);
externalDestination = pList.get(PR_EXTERNAL_DESTINATION).getString();
// indicateDestination = pList.get(PR_INDICATE_DESTINATION);
internalDestination = pList.get(PR_INTERNAL_DESTINATION).getString();
- // showDestination = pList.get(PR_SHOW_DESTINATION);
+ showDestination = pList.get(PR_SHOW_DESTINATION).getEnum();
// targetProcessingContext = pList.get(PR_TARGET_PROCESSING_CONTEXT);
// targetPresentationContext = pList.get(PR_TARGET_PRESENTATION_CONTEXT);
// targetStylesheet = pList.get(PR_TARGET_STYLESHEET);
@@ -80,26 +83,19 @@ public class BasicLink extends Inline {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
getFOEventHandler().startLink(this);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void endOfNode() throws FOPException {
super.endOfNode();
getFOEventHandler().endLink();
}
- /**
- * {@inheritDoc} String, String)
- * XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
- */
+ /** {@inheritDoc} */
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
@@ -116,39 +112,61 @@ public class BasicLink extends Inline {
}
/**
- * @return the "internal-destination" property.
+ * Get the value of the internal-destination
property.
+ *
+ * @return the "internal-destination" property
*/
public String getInternalDestination() {
return internalDestination;
}
/**
- * @return the "external-destination" property.
+ * Get the value of the external-destination
property.
+ *
+ * @return the "external-destination" property
*/
public String getExternalDestination() {
return externalDestination;
}
/**
- * @return whether or not this basic link has an internal destination or not
+ * Convenience method to check if this instance has an internal destination.
+ *
+ * @return true
if this basic link has an internal destination;
+ * false
otherwise
*/
public boolean hasInternalDestination() {
return internalDestination != null && internalDestination.length() > 0;
}
/**
- * @return whether or not this basic link has an external destination or not
+ * Convenience method to check if this instance has an external destination
+ *
+ * @return true
if this basic link has an external destination;
+ * false
otherwise
*/
public boolean hasExternalDestination() {
return externalDestination != null && externalDestination.length() > 0;
}
+ /**
+ * Get the value of the show-destination
property.
+ *
+ * @return the "show-destination" property
+ */
+ public int getShowDestination() {
+ return this.showDestination;
+ }
+
/** {@inheritDoc} */
public String getLocalName() {
return "basic-link";
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ * @return {@link org.apache.fop.fo.Constants#FO_BASIC_LINK}
+ */
public int getNameId() {
return FO_BASIC_LINK;
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java
index e7339034c..b8979e187 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java
@@ -21,7 +21,7 @@ package org.apache.fop.layoutmgr.inline;
import org.apache.fop.datatypes.URISpecification;
import org.apache.fop.fo.flow.BasicLink;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.fo.Constants;
import org.apache.fop.layoutmgr.PageSequenceLayoutManager;
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.Trait;
@@ -31,7 +31,6 @@ import org.apache.fop.area.LinkResolver;
* LayoutManager for the fo:basic-link formatting object
*/
public class BasicLinkLayoutManager extends InlineLayoutManager {
- private BasicLink fobj;
/**
* Create an fo:basic-link layout manager.
@@ -40,23 +39,22 @@ public class BasicLinkLayoutManager extends InlineLayoutManager {
*/
public BasicLinkLayoutManager(BasicLink node) {
super(node);
- fobj = node;
}
/** {@inheritDoc} */
protected InlineArea createArea(boolean bInlineParent) {
InlineArea area = super.createArea(bInlineParent);
- setupBasicLinkArea(parentLM, area);
+ setupBasicLinkArea(area);
return area;
}
/*
* Detect internal or external link and add it as an area trait
*
- * @param parentLM the parent LayoutManager
* @param area the basic-link's area
*/
- private void setupBasicLinkArea(LayoutManager parentLM, InlineArea area) {
+ private void setupBasicLinkArea(InlineArea area) {
+ BasicLink fobj = (BasicLink) this.fobj;
// internal destinations take precedence:
if (fobj.hasInternalDestination()) {
String idref = fobj.getInternalDestination();
@@ -70,8 +68,10 @@ public class BasicLinkLayoutManager extends InlineLayoutManager {
}
} else if (fobj.hasExternalDestination()) {
String url = URISpecification.getURL(fobj.getExternalDestination());
+ boolean newWindow = (fobj.getShowDestination() == Constants.EN_NEW);
if (url.length() > 0) {
- area.addTrait(Trait.EXTERNAL_LINK, url);
+ area.addTrait(Trait.EXTERNAL_LINK,
+ new Trait.ExternalLink(url, newWindow));
}
}
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
index f3bb66022..b59f0466a 100755
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
@@ -68,8 +68,6 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
*/
private static Log log = LogFactory.getLog(InlineLayoutManager.class);
- private InlineLevel fobj;
-
private CommonMarginInline inlineProps = null;
private CommonBorderPaddingBackground borderProps = null;
@@ -105,7 +103,6 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
// The node should be FObjMixed
public InlineLayoutManager(InlineLevel node) {
super(node);
- fobj = node;
}
private Inline getInlineFO() {
@@ -114,6 +111,8 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
/** {@inheritDoc} */
public void initialize() {
+ InlineLevel fobj = (InlineLevel) this.fobj;
+
int padding = 0;
FontInfo fi = fobj.getFOEventHandler().getFontInfo();
FontTriplet[] fontkeys = fobj.getCommonFont().getFontState(fi);
@@ -555,7 +554,8 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
if (returnList instanceof BlockKnuthSequence) {
return;
}
- CommonBorderPaddingBackground borderAndPadding = fobj.getCommonBorderPaddingBackground();
+ CommonBorderPaddingBackground borderAndPadding =
+ ((InlineLevel)fobj).getCommonBorderPaddingBackground();
if (borderAndPadding != null) {
int ipStart = borderAndPadding.getBorderStartWidth(false)
+ borderAndPadding.getPaddingStart(false, this);
@@ -579,7 +579,8 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
if (returnList instanceof BlockKnuthSequence) {
return;
}
- CommonBorderPaddingBackground borderAndPadding = fobj.getCommonBorderPaddingBackground();
+ CommonBorderPaddingBackground borderAndPadding =
+ ((InlineLevel)fobj).getCommonBorderPaddingBackground();
if (borderAndPadding != null) {
int ipEnd = borderAndPadding.getBorderEndWidth(false)
+ borderAndPadding.getPaddingEnd(false, this);
diff --git a/src/java/org/apache/fop/pdf/PDFFactory.java b/src/java/org/apache/fop/pdf/PDFFactory.java
index f4474331f..02f0c2cdb 100644
--- a/src/java/org/apache/fop/pdf/PDFFactory.java
+++ b/src/java/org/apache/fop/pdf/PDFFactory.java
@@ -724,6 +724,7 @@ public class PDFFactory {
* @param theColors the list of colors for the gradient
* @param theBounds the list of bounds associated with the colors
* @param theCoords the coordinates for the gradient
+ * @param theMatrix the coordinate-transformation matrix
* @return the PDF pattern that was created
*/
public PDFPattern makeGradient(PDFResourceContext res, boolean radial,
@@ -737,7 +738,7 @@ public class PDFFactory {
List theCone;
PDFPattern myPattern;
//PDFColorSpace theColorSpace;
- double interpolation = (double)1.000;
+ double interpolation = 1.000;
List theFunctions = new ArrayList();
int currentPosition;
@@ -874,7 +875,8 @@ public class PDFFactory {
*/
public PDFDests makeDests(List destinationList) {
PDFDests dests;
-
+
+ //TODO: Check why the below conditional branch is needed. Condition is always true...
final boolean deep = true;
//true for a "deep" structure (one node per entry), true for a "flat" structure
if (deep) {
@@ -961,7 +963,7 @@ public class PDFFactory {
}
/**
- * make a link object
+ * Make a {@link PDFLink} object
*
* @param rect the clickable rectangle
* @param destination the destination file
@@ -976,7 +978,7 @@ public class PDFFactory {
PDFLink link = new PDFLink(rect);
if (linkType == PDFLink.EXTERNAL) {
- link.setAction(getExternalAction(destination));
+ link.setAction(getExternalAction(destination, false));
} else {
// linkType is internal
String goToReference = getGoToReference(destination, yoffset);
@@ -999,9 +1001,11 @@ public class PDFFactory {
*
* @param target The external target. This may be a PDF file name
* (optionally with internal page number or destination) or any type of URI.
+ * @param newWindow boolean indicating whether the target should be
+ * displayed in a new window
* @return the PDFAction thus created or found
*/
- public PDFAction getExternalAction(String target) {
+ public PDFAction getExternalAction(String target, boolean newWindow) {
int index;
String targetLo = target.toLowerCase();
// HTTP URL?
@@ -1009,17 +1013,17 @@ public class PDFFactory {
return new PDFUri(target);
// Bare PDF file name?
} else if (targetLo.endsWith(".pdf")) {
- return getGoToPDFAction(target, null, -1);
+ return getGoToPDFAction(target, null, -1, newWindow);
// PDF file + page?
} else if ((index = targetLo.indexOf(".pdf#page=")) > 0) {
String filename = target.substring(0, index + 4);
int page = Integer.parseInt(target.substring(index + 10));
- return getGoToPDFAction(filename, null, page);
+ return getGoToPDFAction(filename, null, page, newWindow);
// PDF file + destination?
} else if ((index = targetLo.indexOf(".pdf#dest=")) > 0) {
String filename = target.substring(0, index + 4);
String dest = target.substring(index + 10);
- return getGoToPDFAction(filename, dest, -1);
+ return getGoToPDFAction(filename, dest, -1, newWindow);
// None of the above? Default to URI:
} else {
return new PDFUri(target);
@@ -1069,9 +1073,11 @@ public class PDFFactory {
* @param file the pdf file name
* @param dest the remote name destination, may be null
* @param page the remote page number, -1 means not specified
+ * @param newWindow boolean indicating whether the target should be
+ * displayed in a new window
* @return the pdf goto remote object
*/
- private PDFGoToRemote getGoToPDFAction(String file, String dest, int page) {
+ private PDFGoToRemote getGoToPDFAction(String file, String dest, int page, boolean newWindow) {
getDocument().getProfile().verifyActionAllowed();
PDFFileSpec fileSpec = new PDFFileSpec(file);
PDFFileSpec oldspec = getDocument().findFileSpec(fileSpec);
@@ -1083,11 +1089,11 @@ public class PDFFactory {
PDFGoToRemote remote;
if (dest == null && page == -1) {
- remote = new PDFGoToRemote(fileSpec);
+ remote = new PDFGoToRemote(fileSpec, newWindow);
} else if (dest != null) {
- remote = new PDFGoToRemote(fileSpec, dest);
+ remote = new PDFGoToRemote(fileSpec, dest, newWindow);
} else {
- remote = new PDFGoToRemote(fileSpec, page);
+ remote = new PDFGoToRemote(fileSpec, page, newWindow);
}
PDFGoToRemote oldremote = getDocument().findGoToRemote(remote);
if (oldremote == null) {
@@ -1197,8 +1203,7 @@ public class PDFFactory {
PDFFontDescriptor pdfdesc = makeFontDescriptor(descriptor);
PDFFont font = null;
- font = (PDFFont)PDFFont.createFont(fontname, fonttype,
- basefont, encoding);
+ font = PDFFont.createFont(fontname, fonttype, basefont, encoding);
getDocument().registerObject(font);
if (fonttype == FontType.TYPE0) {
@@ -1298,6 +1303,7 @@ public class PDFFactory {
/**
* Creates a PDFEncoding instance from a CodePointMapping instance.
* @param encoding the code point mapping (encoding)
+ * @param fontNameHint ...
* @return the PDF Encoding dictionary (or a String with the predefined encoding)
*/
public Object createPDFEncoding(SingleByteEncoding encoding, String fontNameHint) {
@@ -1458,6 +1464,7 @@ public class PDFFactory {
try {
in = new java.net.URL(source.getSystemId()).openStream();
} catch (MalformedURLException e) {
+ //TODO: Why construct a new exception here, when it is not thrown?
new FileNotFoundException(
"File not found. URL could not be resolved: "
+ e.getMessage());
@@ -1514,7 +1521,7 @@ public class PDFFactory {
log.error(
"Failed to embed font [" + desc + "] "
+ desc.getEmbedFontName(), ioe);
- return (PDFStream) null;
+ return null;
}
}
@@ -1563,7 +1570,6 @@ public class PDFFactory {
/**
* Create a PDFICCStream
* @see PDFImageXObject
- * @see org.apache.fop.image.JpegImage
* @see org.apache.fop.pdf.PDFDeviceColorSpace
* @return the new PDF ICC stream object
*/
diff --git a/src/java/org/apache/fop/pdf/PDFGoToRemote.java b/src/java/org/apache/fop/pdf/PDFGoToRemote.java
index 71cae5ba6..2cd937df3 100644
--- a/src/java/org/apache/fop/pdf/PDFGoToRemote.java
+++ b/src/java/org/apache/fop/pdf/PDFGoToRemote.java
@@ -20,7 +20,7 @@
package org.apache.fop.pdf;
/**
- * class representing a /GoToR object.
+ * Class representing a /GoToR object.
*/
public class PDFGoToRemote extends PDFAction {
@@ -30,17 +30,21 @@ public class PDFGoToRemote extends PDFAction {
private PDFFileSpec pdfFileSpec;
private int pageReference = 0;
private String destination = null;
+ private boolean newWindow = false;
/**
- * create an GoToR object.
+ * Create an GoToR object.
*
* @param pdfFileSpec the fileSpec associated with the action
+ * @param newWindow boolean indicating whether the target should be
+ * displayed in a new window
*/
- public PDFGoToRemote(PDFFileSpec pdfFileSpec) {
+ public PDFGoToRemote(PDFFileSpec pdfFileSpec, boolean newWindow) {
/* generic creation of object */
super();
this.pdfFileSpec = pdfFileSpec;
+ this.newWindow = newWindow;
}
/**
@@ -48,13 +52,16 @@ public class PDFGoToRemote extends PDFAction {
*
* @param pdfFileSpec the fileSpec associated with the action
* @param page a page reference within the remote document
+ * @param newWindow boolean indicating whether the target should be
+ * displayed in a new window
*/
- public PDFGoToRemote(PDFFileSpec pdfFileSpec, int page) {
+ public PDFGoToRemote(PDFFileSpec pdfFileSpec, int page, boolean newWindow) {
/* generic creation of object */
super();
this.pdfFileSpec = pdfFileSpec;
this.pageReference = page;
+ this.newWindow = newWindow;
}
/**
@@ -62,13 +69,16 @@ public class PDFGoToRemote extends PDFAction {
*
* @param pdfFileSpec the fileSpec associated with the action
* @param dest a named destination within the remote document
+ * @param newWindow boolean indicating whether the target should be
+ * displayed in a new window
*/
- public PDFGoToRemote(PDFFileSpec pdfFileSpec, String dest) {
+ public PDFGoToRemote(PDFFileSpec pdfFileSpec, String dest, boolean newWindow) {
/* generic creation of object */
super();
this.pdfFileSpec = pdfFileSpec;
this.destination = dest;
+ this.newWindow = newWindow;
}
/**
@@ -86,12 +96,18 @@ public class PDFGoToRemote extends PDFAction {
public String toPDFString() {
StringBuffer sb = new StringBuffer(64);
sb.append(getObjectID());
- sb.append("<<\n/S /GoToR\n/F " + pdfFileSpec.referencePDF() + "\n");
+ sb.append("<<\n/S /GoToR\n/F ");
+ sb.append(pdfFileSpec.referencePDF());
+ sb.append("\n");
if (destination != null) {
- sb.append("/D (" + this.destination + ")");
+ sb.append("/D (").append(this.destination).append(")");
} else {
- sb.append("/D [ " + this.pageReference + " /XYZ null null null ]");
+ sb.append("/D [ ").append(this.pageReference).append(" /XYZ null null null ]");
+ }
+
+ if (newWindow) {
+ sb.append("/NewWindow true");
}
sb.append(" \n>>\nendobj\n");
@@ -142,7 +158,7 @@ public class PDFGoToRemote extends PDFAction {
}
}
- return true;
+ return (this.newWindow == remote.newWindow);
}
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index d2c8446eb..eae961e9b 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -837,7 +837,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* @param value the value
* @return the formatted value
*/
- protected static final String format(float value) {
+ protected static String format(float value) {
return PDFNumber.doubleOut(value);
}
@@ -1134,9 +1134,11 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* (i.e. if the area qualifies as a link target).
* Otherwise, or if the area has no id, null is returned.
*
- * NOTE : area must be on currentPageViewport, otherwise result may be wrong!
+ * NOTE: area must be on currentPageViewport, otherwise result may be wrong!
*
* @param area the area for which to return the id
+ * @return the area's id (null if the area has no id or
+ * other preceding areas have the same id)
*/
protected String getTargetableID(Area area) {
String id = (String) area.getTrait(Trait.PROD_ID);
@@ -1374,11 +1376,14 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
// no INTERNAL_LINK, look for EXTERNAL_LINK
if (!linkTraitFound) {
- String extDest = (String) ip.getTrait(Trait.EXTERNAL_LINK);
- if (extDest != null && extDest.length() > 0) {
- linkTraitFound = true;
- if (annotsAllowed) {
- action = factory.getExternalAction(extDest);
+ Trait.ExternalLink extLink = (Trait.ExternalLink) ip.getTrait(Trait.EXTERNAL_LINK);
+ if (extLink != null) {
+ String extDest = extLink.getDestination();
+ if (extDest != null && extDest.length() > 0) {
+ linkTraitFound = true;
+ if (annotsAllowed) {
+ action = factory.getExternalAction(extDest, extLink.newWindow());
+ }
}
}
}
@@ -1610,7 +1615,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced.
* @param uri URL of the bitmap
* @param pos Position of the bitmap
- * @deprecated Use {@link @putImage(String, Rectangle2D, Map)} instead.
+ * @deprecated Use {@link #putImage(String, Rectangle2D, Map)} instead.
*/
protected void putImage(String uri, Rectangle2D pos) {
putImage(uri, pos, null);
diff --git a/status.xml b/status.xml
index 0b2b2ac38..7d813f6f8 100644
--- a/status.xml
+++ b/status.xml
@@ -53,11 +53,16 @@
FOP supports encryption of PDF output, thanks to Patrick C. Lankswert. + This feature is commonly used to prevent unauthorized viewing, printing, editing, copying text + from the document and doing annotations. It is also possible to ask the user for a password in + order to view the contents. Note that there already exist third party applications which can + decrypt an encrypted PDF without effort and allow the aforementioned operations, therefore the + degree of protection is limited. For further information about features and restrictions + regarding PDF encryption, look at the documentation coming with Adobe Acrobat or the technical + documentation on the Adobe web site.
+String
into
+ * an array of int
, splitting the base along the
+ * given separator pattern.
+ * Note: this method assumes the input is a string containing
+ * only decimal integers, signed or unsigned, that are parsable
+ * by java.lang.Integer.parseInt(String)
. If this
+ * is not the case, the resulting NumberFormatException
+ * will have to be handled by the caller.
+ *
+ * @param baseString the base string
+ * @param separatorPattern the pattern separating the integer values
+ * (if this is null
, the baseString is parsed as one
+ * integer value)
+ * @return an array of int
whose size is equal to the number
+ * values in the input string; null
if this number
+ * is equal to zero.
+ */
+ public static int[] toIntArray(String baseString, String separatorPattern) {
+
+ if (baseString == null || "".equals(baseString)) {
+ return null;
+ }
+
+ if (separatorPattern == null || "".equals(separatorPattern)) {
+ return new int[] { Integer.parseInt(baseString) };
+ }
+
+ String[] values = baseString.split(separatorPattern);
+ int numValues = values.length;
+ if (numValues == 0) {
+ return null;
+ }
+
+ int[] returnArray = new int[numValues];
+ for (int i = 0; i < numValues; ++i) {
+ returnArray[i] = Integer.parseInt(values[i]);
+ }
+ return returnArray;
+
+ }
+
+ /**
+ * Converts the given base String
into
+ * an array of double
, splitting the base along the
+ * given separator pattern.
+ * Note: this method assumes the input is a string containing
+ * only decimal doubles, signed or unsigned, that are parsable
+ * by java.lang.Double.parseDouble(String)
. If this
+ * is not the case, the resulting NumberFormatException
+ * will have to be handled by the caller.
+ *
+ * @param baseString the base string
+ * @param separatorPattern the pattern separating the integer values
+ * (if this is null
, the baseString is parsed as one
+ * double value)
+ * @return an array of double
whose size is equal to the number
+ * values in the input string; null
if this number
+ * is equal to zero.
+ */
+ public static double[] toDoubleArray(String baseString, String separatorPattern) {
+
+ if (baseString == null || "".equals(baseString)) {
+ return null;
+ }
+
+ if (separatorPattern == null || "".equals(separatorPattern)) {
+ return new double[] { Double.parseDouble(baseString) };
+ }
+
+ String[] values = baseString.split(separatorPattern);
+ int numValues = values.length;
+ if (numValues == 0) {
+ return null;
+ }
+
+ double[] returnArray = new double[numValues];
+ for (int i = 0; i < numValues; ++i) {
+ returnArray[i] = Double.parseDouble(values[i]);
+ }
+ return returnArray;
+
+ }
+
+}
diff --git a/status.xml b/status.xml
index 42996789e..6f22165c5 100644
--- a/status.xml
+++ b/status.xml
@@ -53,6 +53,9 @@
- * - * The region may clip the area and it establishes a position from where the - * region is placed. - *
- * - * @param port - * The region viewport to be rendered - */ - public void renderRegionViewport(RegionViewport port) { - if (port != null) { - Rectangle2D view = port.getViewArea(); - // The CTM will transform coordinates relative to - // this region-reference area into page coords, so - // set origin for the region to 0,0. - currentBPPosition = 0; - currentIPPosition = 0; - - RegionReference regionReference = port.getRegionReference(); - handleRegionTraits(port); - - /* - * _afpDataStream.startOverlay(mpts2units(view.getX()) , - * mpts2units(view.getY()) , mpts2units(view.getWidth()) , - * mpts2units(view.getHeight()) - * , rotation); - */ - - pushViewPortPos(new ViewPortPos(view, regionReference.getCTM())); - - if (regionReference.getRegionClass() == FO_REGION_BODY) { - renderBodyRegion((BodyRegion) regionReference); - } else { - renderRegion(regionReference); - } - /* - * _afpDataStream.endOverlay(); - */ - popViewPortPos(); + saveGraphicsState(); + if (ctm != null) { + AffineTransform at = ctm.toAffineTransform(); + concatenateTransformationMatrix(at); + } + if (clippingRect != null) { + clipRect((float)clippingRect.getX() / 1000f, + (float)clippingRect.getY() / 1000f, + (float)clippingRect.getWidth() / 1000f, + (float)clippingRect.getHeight() / 1000f); } } /** {@inheritDoc} */ - protected void renderBlockViewport(BlockViewport bv, List children) { - // clip and position viewport if necessary - - // save positions - int saveIP = currentIPPosition; - int saveBP = currentBPPosition; - - CTM ctm = bv.getCTM(); - int borderPaddingStart = bv.getBorderAndPaddingWidthStart(); - int borderPaddingBefore = bv.getBorderAndPaddingWidthBefore(); - // This is the content-rect - float width = (float) bv.getIPD() / 1000f; - float height = (float) bv.getBPD() / 1000f; - - if (bv.getPositioning() == Block.ABSOLUTE - || bv.getPositioning() == Block.FIXED) { - - // For FIXED, we need to break out of the current viewports to the - // one established by the page. We save the state stack for - // restoration - // after the block-container has been painted. See below. - List breakOutList = null; - if (bv.getPositioning() == Block.FIXED) { - breakOutList = breakOutOfStateStack(); - } - - AffineTransform positionTransform = new AffineTransform(); - positionTransform.translate(bv.getXOffset(), bv.getYOffset()); - - // "left/"top" (bv.getX/YOffset()) specify the position of the - // content rectangle - positionTransform.translate(-borderPaddingStart, - -borderPaddingBefore); - - // skipping fox:transform here - - // saveGraphicsState(); - // Viewport position - // concatenateTransformationMatrix(mptToPt(positionTransform)); - - // Background and borders - float bpwidth = (borderPaddingStart + bv - .getBorderAndPaddingWidthEnd()) / 1000f; - float bpheight = (borderPaddingBefore + bv - .getBorderAndPaddingWidthAfter()) / 1000f; - Point2D ptSrc = new Point(0, 0); - Point2D ptDst = positionTransform.transform(ptSrc, null); - Rectangle2D borderRect = new Rectangle2D.Double(ptDst.getX(), ptDst - .getY(), 1000 * (width + bpwidth), - 1000 * (height + bpheight)); - pushViewPortPos(new ViewPortPos(borderRect, new CTM( - positionTransform))); - drawBackAndBorders(bv, 0, 0, width + bpwidth, height + bpheight); - - // Shift to content rectangle after border painting - AffineTransform contentRectTransform = new AffineTransform(); - contentRectTransform.translate(borderPaddingStart, - borderPaddingBefore); - // concatenateTransformationMatrix(mptToPt(contentRectTransform)); - ptSrc = new Point(0, 0); - ptDst = contentRectTransform.transform(ptSrc, null); - Rectangle2D contentRect = new Rectangle2D.Double(ptDst.getX(), - ptDst.getY(), 1000 * width, 1000 * height); - pushViewPortPos(new ViewPortPos(contentRect, new CTM( - contentRectTransform))); - - // Clipping is not supported, yet - // Rectangle2D clippingRect = null; - // clippingRect = new Rectangle(0, 0, bv.getIPD(), bv.getBPD()); - - // saveGraphicsState(); - // Set up coordinate system for content rectangle - AffineTransform contentTransform = ctm.toAffineTransform(); - // concatenateTransformationMatrix(mptToPt(contentTransform)); - contentRect = new Rectangle2D.Double(0, 0, 1000 * width, - 1000 * height); - pushViewPortPos(new ViewPortPos(contentRect, new CTM( - contentTransform))); - - currentIPPosition = 0; - currentBPPosition = 0; - renderBlocks(bv, children); - - popViewPortPos(); - popViewPortPos(); - // restoreGraphicsState(); - popViewPortPos(); - // restoreGraphicsState(); - - if (breakOutList != null) { - restoreStateStackAfterBreakOut(breakOutList); - } - - currentIPPosition = saveIP; - currentBPPosition = saveBP; - } else { - - currentBPPosition += bv.getSpaceBefore(); - - // borders and background in the old coordinate system - handleBlockTraits(bv); - - // Advance to start of content area - currentIPPosition += bv.getStartIndent(); - - CTM tempctm = new CTM(containingIPPosition, currentBPPosition); - ctm = tempctm.multiply(ctm); - - // Now adjust for border/padding - currentBPPosition += borderPaddingBefore; - - Rectangle2D clippingRect = null; - clippingRect = new Rectangle(currentIPPosition, currentBPPosition, - bv.getIPD(), bv.getBPD()); - - // startVParea(ctm, clippingRect); - pushViewPortPos(new ViewPortPos(clippingRect, ctm)); - - currentIPPosition = 0; - currentBPPosition = 0; - renderBlocks(bv, children); - // endVParea(); - popViewPortPos(); - - currentIPPosition = saveIP; - currentBPPosition = saveBP; - - currentBPPosition += (int) (bv.getAllocBPD()); - } + public void endVParea() { + restoreGraphicsState(); } /** {@inheritDoc} */ - protected void renderReferenceArea(Block block) { - //TODO Remove this method once concatenateTransformationMatrix() is implemented - - // save position and offset - int saveIP = currentIPPosition; - int saveBP = currentBPPosition; - - //Establish a new coordinate system - AffineTransform at = new AffineTransform(); - at.translate(currentIPPosition, currentBPPosition); - at.translate(block.getXOffset(), block.getYOffset()); - at.translate(0, block.getSpaceBefore()); - - if (!at.isIdentity()) { - Rectangle2D contentRect - = new Rectangle2D.Double(at.getTranslateX(), at.getTranslateY(), - block.getAllocIPD(), block.getAllocBPD()); - pushViewPortPos(new ViewPortPos(contentRect, new CTM(at))); - } - - currentIPPosition = 0; - currentBPPosition = 0; - handleBlockTraits(block); - - List children = block.getChildAreas(); - if (children != null) { - renderBlocks(block, children); - } - + protected void concatenateTransformationMatrix(AffineTransform at) { if (!at.isIdentity()) { - popViewPortPos(); + currentState.concatenate(at); } - - // stacked and relative blocks effect stacking - currentIPPosition = saveIP; - currentBPPosition = saveBP; } - - /** {@inheritDoc} */ - protected void renderFlow(NormalFlow flow) { - // save position and offset - int saveIP = currentIPPosition; - int saveBP = currentBPPosition; - - //Establish a new coordinate system - AffineTransform at = new AffineTransform(); - at.translate(currentIPPosition, currentBPPosition); - - if (!at.isIdentity()) { - Rectangle2D contentRect - = new Rectangle2D.Double(at.getTranslateX(), at.getTranslateY(), - flow.getAllocIPD(), flow.getAllocBPD()); - pushViewPortPos(new ViewPortPos(contentRect, new CTM(at))); - } - currentIPPosition = 0; - currentBPPosition = 0; - super.renderFlow(flow); - - if (!at.isIdentity()) { - popViewPortPos(); - } - - // stacked and relative blocks effect stacking - currentIPPosition = saveIP; - currentBPPosition = saveBP; - } - - /** {@inheritDoc} */ - protected void concatenateTransformationMatrix(AffineTransform at) { - // Not used here since AFPRenderer defines its own renderBlockViewport() - // method. - throw new UnsupportedOperationException("NYI"); - } - - /** - * {@inheritDoc} - */ - public void renderPage(PageViewport pageViewport) { - - // initializeRootExtensions(page); - - // this.currentFontFamily = ""; - this.currentFontSize = 0; - this.pageFontCounter = 0; - this.currentPageFontMap = null; - // this.lineCache = new HashSet(); + public void renderPage(PageViewport pageViewport) throws IOException, FOPException { + currentState.clear(); Rectangle2D bounds = pageViewport.getViewArea(); + + AffineTransform basicPageTransform = new AffineTransform(); + int resolution = currentState.getResolution(); + double scale = (double)1 / (AFPConstants.DPI_72_MPTS / resolution); + basicPageTransform.scale(scale, scale); - this.pageWidth = mpts2units(bounds.getWidth()); - this.pageHeight = mpts2units(bounds.getHeight()); - - if (pages != null && pages.containsKey(pageViewport)) { + currentState.concatenate(basicPageTransform); + if (getPages().containsKey(pageViewport)) { getAFPDataStream().restorePage( - (PageObject) pages.remove(pageViewport)); - + (PageObject)getPages().remove(pageViewport)); } else { - // renderPageGroupExtensions(page); + int pageWidth + = (int)Math.round(bounds.getWidth() / (AFPConstants.DPI_72_MPTS / resolution)); + currentState.setPageWidth(pageWidth); + int pageHeight + = (int)Math.round(bounds.getHeight() / (AFPConstants.DPI_72_MPTS / resolution)); + currentState.setPageHeight(pageHeight); final int pageRotation = 0; getAFPDataStream().startPage(pageWidth, pageHeight, pageRotation, - getResolution(), getResolution()); + resolution, resolution); renderPageObjectExtensions(pageViewport); - } + + super.renderPage(pageViewport); - pushViewPortPos(new ViewPortPos()); - - renderPageAreas(pageViewport.getPage()); - - if (currentPageFontMap != null) { - Iterator iter = currentPageFontMap.values().iterator(); - while (iter.hasNext()) { - AFPFontAttributes afpFontAttributes = (AFPFontAttributes) iter - .next(); - - getAFPDataStream().createFont( - (byte) afpFontAttributes.getFontReference(), - afpFontAttributes.getFont(), - afpFontAttributes.getPointSize()); - } + AFPPageFonts pageFonts = currentState.getPageFonts(); + if (pageFonts != null && !pageFonts.isEmpty()) { + getAFPDataStream().addFontsToCurrentPage(pageFonts); } getAFPDataStream().endPage(); - - popViewPortPos(); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void clip() { // TODO + log.debug("NYI clip()"); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void clipRect(float x, float y, float width, float height) { // TODO + log.debug("NYI clipRect(x=" + x + ",y=" + y + ",width=" + width + ", height=" + height + ")"); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void moveTo(float x, float y) { // TODO + log.debug("NYI moveTo(x=" + x + ",y=" + y + ")"); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void lineTo(float x, float y) { // TODO + log.debug("NYI lineTo(x=" + x + ",y=" + y + ")"); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void closePath() { // TODO + log.debug("NYI closePath()"); } - /** - * {@inheritDoc} - */ + private int[] mpts2units(float[] srcPts, float[] dstPts) { + return transformPoints(srcPts, dstPts, true); + } + + private int[] pts2units(float[] srcPts, float[] dstPts) { + return transformPoints(srcPts, dstPts, false); + } + + private int[] mpts2units(float[] srcPts) { + return transformPoints(srcPts, null, true); + } + + private int[] pts2units(float[] srcPts) { + return transformPoints(srcPts, null, false); + } + + /** {@inheritDoc} */ public void fillRect(float x, float y, float width, float height) { -// getAFPDataStream().createShading( -// pts2units(x), pts2units(y), pts2units(width), pts2units(height), -// currentColor); - getAFPDataStream().createLine(pts2units(x), pts2units(y), - pts2units(x + width), pts2units(y), pts2units(height), - currentColor); + float[] srcPts = new float[] {x * 1000, y * 1000}; + float[] dstPts = new float[srcPts.length]; + int[] coords = mpts2units(srcPts, dstPts); + int resolution = currentState.getResolution(); + int x2 = Math.round(dstPts[X] + ((width * 1000) / (AFPConstants.DPI_72_MPTS / resolution))); + int thickness = Math.round((height * 1000) / (AFPConstants.DPI_72_MPTS / resolution)); + getAFPDataStream().createLine( + coords[X], + coords[Y], + x2, + coords[Y], + thickness, + currentState.getColor()); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void drawBorderLine(float x1, float y1, float x2, float y2, boolean horz, boolean startOrBefore, int style, Color col) { - float w = x2 - x1; - float h = y2 - y1; - if ((w < 0) || (h < 0)) { + float[] srcPts = new float[] {x1 * 1000, y1 * 1000, x2 * 1000, y2 * 1000}; + float[] dstPts = new float[srcPts.length]; + int[] coords = mpts2units(srcPts, dstPts); + + float width = dstPts[X2] - dstPts[X1]; + float height = dstPts[Y2] - dstPts[Y1]; + if ((width < 0) || (height < 0)) { log.error("Negative extent received. Border won't be painted."); return; } @@ -816,58 +446,91 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { switch (style) { case Constants.EN_DOUBLE: if (horz) { - float h3 = h / 3; - float ym1 = y1; - float ym2 = ym1 + h3 + h3; - getAFPDataStream().createLine(pts2units(x1), pts2units(ym1), - pts2units(x2), pts2units(ym1), pts2units(h3), col); - getAFPDataStream().createLine(pts2units(x1), pts2units(ym2), - pts2units(x2), pts2units(ym2), pts2units(h3), col); + float h3 = height / 3; + float ym2 = dstPts[Y1] + h3 + h3; + afpDataStream.createLine( + coords[X1], + coords[Y1], + coords[X2], + coords[Y1], + Math.round(h3), + col); + afpDataStream.createLine( + coords[X1], + Math.round(ym2), + coords[X2], + Math.round(ym2), + Math.round(h3), + col); } else { - float w3 = w / 3; - float xm1 = x1; - float xm2 = xm1 + w3 + w3; - getAFPDataStream().createLine(pts2units(xm1), pts2units(y1), - pts2units(xm1), pts2units(y2), pts2units(w3), col); - getAFPDataStream().createLine(pts2units(xm2), pts2units(y1), - pts2units(xm2), pts2units(y2), pts2units(w3), col); + float w3 = width / 3; + float xm2 = dstPts[X1] + w3 + w3; + afpDataStream.createLine( + coords[X1], + coords[Y1], + coords[X1], + coords[Y2], + Math.round(w3), + col); + afpDataStream.createLine( + Math.round(xm2), + coords[Y1], + Math.round(xm2), + coords[Y2], + Math.round(w3), + col); } break; case Constants.EN_DASHED: if (horz) { - float w2 = 2 * h; - while (x1 + w2 < x2) { - getAFPDataStream().createLine(pts2units(x1), pts2units(y1), - pts2units(x1 + w2), pts2units(y1), pts2units(h), + float w2 = 2 * height; + while (coords[X1] + w2 < coords[X2]) { + afpDataStream.createLine( + coords[X1], + coords[Y1], + coords[X1] + Math.round(w2), + coords[Y1], + Math.round(height), col); - x1 += 2 * w2; + coords[X1] += 2 * w2; } } else { - float h2 = 2 * w; - while (y1 + h2 < y2) { - getAFPDataStream().createLine(pts2units(x1), pts2units(y1), - pts2units(x1), pts2units(y1 + h2), pts2units(w), + float h2 = 2 * width; + while (coords[Y1] + h2 < coords[Y2]) { + afpDataStream.createLine( + coords[X1], + coords[Y2], + coords[X1], + coords[Y1] + Math.round(h2), + Math.round(width), col); - y1 += 2 * h2; + coords[Y1] += 2 * h2; } } break; case Constants.EN_DOTTED: if (horz) { - while (x1 + h < x2) { - getAFPDataStream() - .createLine(pts2units(x1), pts2units(y1), - pts2units(x1 + h), pts2units(y1), - pts2units(h), col); - x1 += 2 * h; + while (coords[X1] + height < coords[X2]) { + afpDataStream.createLine( + coords[X1], + coords[Y1], + coords[X1] + Math.round(height), + coords[Y1], + Math.round(height), + col + ); + coords[X1] += 2 * height; } } else { - while (y1 + w < y2) { - getAFPDataStream() - .createLine(pts2units(x1), pts2units(y1), - pts2units(x1), pts2units(y1 + w), - pts2units(w), col); - y1 += 2 * w; + while (y1 + width < y2) { + afpDataStream.createLine( + coords[X1], + coords[Y1], + coords[X1], + coords[Y1] + Math.round(width), + Math.round(width), + col); + coords[Y1] += 2 * width; } } break; @@ -877,29 +540,54 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { if (horz) { Color uppercol = lightenColor(col, -colFactor); Color lowercol = lightenColor(col, colFactor); - float h3 = h / 3; - float ym1 = y1; - getAFPDataStream().createLine(pts2units(x1), pts2units(ym1), - pts2units(x2), pts2units(ym1), pts2units(h3), uppercol); - getAFPDataStream().createLine(pts2units(x1), - pts2units(ym1 + h3), pts2units(x2), - pts2units(ym1 + h3), pts2units(h3), col); - getAFPDataStream().createLine(pts2units(x1), - pts2units(ym1 + h3 + h3), pts2units(x2), - pts2units(ym1 + h3 + h3), pts2units(h3), lowercol); + float h3 = height / 3; + afpDataStream.createLine( + coords[X1], + coords[Y1], + coords[X2], + coords[Y1], + Math.round(h3), + uppercol); + afpDataStream.createLine( + coords[X1], + Math.round(dstPts[Y1] + h3), + coords[X2], + Math.round(dstPts[Y1] + h3), + Math.round(h3), + col); + afpDataStream.createLine( + coords[X1], + Math.round(dstPts[Y1] + h3 + h3), + coords[X2], + Math.round(dstPts[Y1] + h3 + h3), + Math.round(h3), + lowercol); } else { Color leftcol = lightenColor(col, -colFactor); Color rightcol = lightenColor(col, colFactor); - float w3 = w / 3; - float xm1 = x1 + (w3 / 2); - getAFPDataStream().createLine(pts2units(xm1), pts2units(y1), - pts2units(xm1), pts2units(y2), pts2units(w3), leftcol); - getAFPDataStream().createLine(pts2units(xm1 + w3), - pts2units(y1), pts2units(xm1 + w3), pts2units(y2), - pts2units(w3), col); - getAFPDataStream().createLine(pts2units(xm1 + w3 + w3), - pts2units(y1), pts2units(xm1 + w3 + w3), pts2units(y2), - pts2units(w3), rightcol); + float w3 = width / 3; + float xm1 = dstPts[X1] + (w3 / 2); + afpDataStream.createLine( + Math.round(xm1), + coords[Y1], + Math.round(xm1), + coords[Y2], + Math.round(w3), + leftcol); + afpDataStream.createLine( + Math.round(xm1 + w3), + coords[Y1], + Math.round(xm1 + w3), + coords[Y2], + Math.round(w3), + col); + afpDataStream.createLine( + Math.round(xm1 + w3 + w3), + coords[Y1], + Math.round(xm1 + w3 + w3), + coords[Y2], + Math.round(w3), + rightcol); } break; } @@ -908,28 +596,24 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { case Constants.EN_INSET: case Constants.EN_OUTSET: default: - getAFPDataStream().createLine(pts2units(x1), pts2units(y1), - pts2units(horz ? x2 : x1), pts2units(horz ? y1 : y2), - pts2units(Math.abs(horz ? (y2 - y1) : (x2 - x1))), col); + afpDataStream.createLine( + coords[X1], + coords[Y1], + (horz ? coords[X2] : coords[X1]), + (horz ? coords[Y1] : coords[Y2]), + Math.abs(Math.round(horz ? height : width)), + col); } } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ protected RendererContext createRendererContext(int x, int y, int width, int height, Map foreignAttributes) { RendererContext context; context = super.createRendererContext(x, y, width, height, foreignAttributes); - context.setProperty(AFPRendererContextConstants.AFP_GRAYSCALE, Boolean - .valueOf(!this.colorImages)); context.setProperty(AFPRendererContextConstants.AFP_FONT_INFO, this.fontInfo); - context.setProperty(AFPRendererContextConstants.AFP_RESOLUTION, - new Integer(this.resolution)); - context.setProperty(AFPRendererContextConstants.AFP_BITS_PER_PIXEL, - new Integer(this.bitsPerPixel)); context.setProperty(AFPRendererContextConstants.AFP_DATASTREAM, getAFPDataStream()); context.setProperty(AFPRendererContextConstants.AFP_STATE, getState()); @@ -944,17 +628,18 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { /** {@inheritDoc} */ public void drawImage(String uri, Rectangle2D pos, Map foreignAttributes) { uri = URISpecification.getURL(uri); - getState().setImageUri(uri); + currentState.setImageUri(uri); Rectangle posInt = new Rectangle((int) pos.getX(), (int) pos.getY(), (int) pos.getWidth(), (int) pos.getHeight()); Point origin = new Point(currentIPPosition, currentBPPosition); int x = origin.x + posInt.x; int y = origin.y + posInt.y; - + String name = (String)getPageSegments().get(uri); if (name != null) { - getAFPDataStream().createIncludePageSegment(name, mpts2units(x), - mpts2units(y)); + float[] srcPts = {x, y}; + int[] coords = mpts2units(srcPts); + getAFPDataStream().createIncludePageSegment(name, coords[X], coords[Y]); } else { ImageManager manager = getUserAgent().getFactory().getImageManager(); ImageInfo info = null; @@ -989,31 +674,41 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { ImageRawCCITTFax ccitt = (ImageRawCCITTFax) img; in = ccitt.createInputStream(); byte[] buf = IOUtils.toByteArray(in); - int afpx = mpts2units(posInt.x + currentIPPosition); - int afpy = mpts2units(posInt.y + currentBPPosition); - int afpw = mpts2units(posInt.getWidth()); - int afph = mpts2units(posInt.getHeight()); - int afpres = getResolution(); + float[] srcPts = new float[] { + posInt.x + currentIPPosition, + posInt.y + currentBPPosition, + (float)posInt.getWidth(), + (float)posInt.getHeight() + }; + int[] coords = mpts2units(srcPts); String mimeType = info.getMimeType(); // create image object parameters ImageObjectInfo imageObjectInfo = new ImageObjectInfo(); + imageObjectInfo.setBuffered(false); imageObjectInfo.setUri(uri); imageObjectInfo.setMimeType(mimeType); ObjectAreaInfo objectAreaInfo = new ObjectAreaInfo(); - objectAreaInfo.setX(afpx); - objectAreaInfo.setY(afpy); - objectAreaInfo.setWidth(afpw); - objectAreaInfo.setHeight(afph); - objectAreaInfo.setWidthRes(afpres); - objectAreaInfo.setHeightRes(afpres); + objectAreaInfo.setX(coords[X]); + objectAreaInfo.setY(coords[Y]); + int resolution = currentState.getResolution(); + int w = Math.round( + ((float)posInt.getWidth() * 1000) + / (AFPConstants.DPI_72_MPTS / resolution)); + int h = Math.round( + ((float)posInt.getHeight() * 1000) + / (AFPConstants.DPI_72_MPTS / resolution)); + objectAreaInfo.setWidth(w); + objectAreaInfo.setHeight(h); + objectAreaInfo.setWidthRes(resolution); + objectAreaInfo.setHeightRes(resolution); imageObjectInfo.setObjectAreaInfo(objectAreaInfo); imageObjectInfo.setData(buf); imageObjectInfo.setDataHeight(ccitt.getSize().getHeightPx()); imageObjectInfo.setDataWidth(ccitt.getSize().getWidthPx()); - imageObjectInfo.setColor(colorImages); - imageObjectInfo.setBitsPerPixel(bitsPerPixel); + imageObjectInfo.setColor(currentState.isColorImages()); + imageObjectInfo.setBitsPerPixel(currentState.getBitsPerPixel()); imageObjectInfo.setCompression(ccitt.getCompression()); imageObjectInfo.setResourceInfoFromForeignAttributes(foreignAttributes); getAFPDataStream().createObject(imageObjectInfo); @@ -1079,15 +774,15 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { * the x coordinate (in mpt) * @param y * the y coordinate (in mpt) - * @param w + * @param width * the width of the viewport (in mpt) - * @param h + * @param height * the height of the viewport (in mpt) * @param foreignAttributes * a mapping of foreign attributes */ public void drawBufferedImage(ImageInfo imageInfo, RenderedImage image, - int imageRes, int x, int y, int w, int h, Map foreignAttributes) { + int imageRes, int x, int y, int width, int height, Map foreignAttributes) { ByteArrayOutputStream baout = new ByteArrayOutputStream(); try { // Serialize image @@ -1111,129 +806,127 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { } ObjectAreaInfo objectAreaInfo = new ObjectAreaInfo(); - objectAreaInfo.setX(mpts2units(x)); - objectAreaInfo.setY(mpts2units(y)); - objectAreaInfo.setWidth(mpts2units(w)); - objectAreaInfo.setHeight(mpts2units(h)); + + float[] srcPts = new float[] {x, y}; + int[] coords = mpts2units(srcPts); + objectAreaInfo.setX(coords[X]); + objectAreaInfo.setY(coords[Y]); + int resolution = currentState.getResolution(); + int w = Math.round( + (width * 1000) + / (AFPConstants.DPI_72_MPTS / resolution)); + int h = Math.round( + (height * 1000) + / (AFPConstants.DPI_72_MPTS / resolution)); + objectAreaInfo.setWidth(w); + objectAreaInfo.setHeight(h); + objectAreaInfo.setWidthRes(imageRes); objectAreaInfo.setHeightRes(imageRes); imageObjectInfo.setObjectAreaInfo(objectAreaInfo); - + imageObjectInfo.setData(baout.toByteArray()); imageObjectInfo.setDataHeight(image.getHeight()); imageObjectInfo.setDataWidth(image.getWidth()); - imageObjectInfo.setColor(colorImages); - imageObjectInfo.setBitsPerPixel(bitsPerPixel); + imageObjectInfo.setColor(currentState.isColorImages()); + imageObjectInfo.setBitsPerPixel(currentState.getBitsPerPixel()); imageObjectInfo.setResourceInfoFromForeignAttributes(foreignAttributes); getAFPDataStream().createObject(imageObjectInfo); } - /** - * Establishes a new foreground or fill color. {@inheritDoc} - */ + /** {@inheritDoc} */ public void updateColor(Color col, boolean fill) { if (fill) { - currentColor = col; + currentState.setColor(col); } } /** {@inheritDoc} */ - public List breakOutOfStateStack() { - log.debug("Block.FIXED --> break out"); - List breakOutList = new java.util.ArrayList(); - //Don't pop the last ViewPortPos (created by renderPage()) - while (this.viewPortPositions.size() > 1) { - breakOutList.add(0, popViewPortPos()); + public void restoreStateStackAfterBreakOut(List breakOutList) { + log.debug("Block.FIXED --> restoring context after break-out"); + AbstractState.AbstractData data; + Iterator it = breakOutList.iterator(); + while (it.hasNext()) { + data = (AbstractState.AbstractData)it.next(); + saveGraphicsState(); + concatenateTransformationMatrix(data.getTransform()); } - return breakOutList; } /** {@inheritDoc} */ - public void restoreStateStackAfterBreakOut(List breakOutList) { - log.debug("Block.FIXED --> restoring context after break-out"); - for (int i = 0, c = breakOutList.size(); i < c; i++) { - ViewPortPos vps = (ViewPortPos)breakOutList.get(i); - pushViewPortPos(vps); + protected List breakOutOfStateStack() { + log.debug("Block.FIXED --> break out"); + List breakOutList = new java.util.ArrayList(); + AbstractState.AbstractData data; + while (true) { + data = currentState.getData(); + if (currentState.pop() == null) { + break; + } + breakOutList.add(0, data); //Insert because of stack-popping } + return breakOutList; } - /** Saves the graphics state of the rendering engine. */ + /** {@inheritDoc} */ public void saveGraphicsState() { - + currentState.push(); } - /** Restores the last graphics state of the rendering engine. */ + /** {@inheritDoc} */ public void restoreGraphicsState() { - + currentState.pop(); } /** Indicates the beginning of a text object. */ public void beginTextObject() { - + //TODO maybe? + log.debug("NYI beginTextObject()"); } /** Indicates the end of a text object. */ public void endTextObject() { - + //TODO maybe? + log.debug("NYI endTextObject()"); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void renderImage(Image image, Rectangle2D pos) { drawImage(image.getURL(), pos, image.getForeignAttributes()); } - /** - * {@inheritDoc} - */ - public void renderText(TextArea text) { + /** {@inheritDoc} */ + public void renderText(TextArea text) { + log.debug(text.getText()); renderInlineAreaBackAndBorders(text); String name = getInternalFontNameForArea(text); - this.currentFontSize = ((Integer) text.getTrait(Trait.FONT_SIZE)) - .intValue(); - AFPFont font = (AFPFont) fontInfo.getFonts().get(name); - - Color col = (Color) text.getTrait(Trait.COLOR); - - int vsci = mpts2units(font.getWidth(' ', currentFontSize) / 1000 - + text.getTextWordSpaceAdjust() - + text.getTextLetterSpaceAdjust()); - - // word.getOffset() = only height of text itself - // currentBlockIPPosition: 0 for beginning of line; nonzero - // where previous line area failed to take up entire allocated space - int rx = currentIPPosition + text.getBorderAndPaddingWidthStart(); - int bl = currentBPPosition + text.getOffset() - + text.getBaselineOffset(); + int fontSize = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue(); + currentState.setFontSize(fontSize); + AFPFont font = (AFPFont)fontInfo.getFonts().get(name); // Set letterSpacing // float ls = fs.getLetterSpacing() / this.currentFontSize; - String worddata = text.getText(); - // Create an AFPFontAttributes object from the current font details - AFPFontAttributes afpFontAttributes = new AFPFontAttributes(name, font, - currentFontSize); + AFPFontAttributes afpFontAttributes + = new AFPFontAttributes(name, font, fontSize); - if (!getCurrentPageFonts().containsKey(afpFontAttributes.getFontKey())) { + AFPPageFonts pageFonts = currentState.getPageFonts(); + if (!pageFonts.containsKey(afpFontAttributes.getFontKey())) { // Font not found on current page, so add the new one - this.pageFontCounter++; - afpFontAttributes.setFontReference(pageFontCounter); - getCurrentPageFonts().put(afpFontAttributes.getFontKey(), - afpFontAttributes); + afpFontAttributes.setFontReference(currentState.incrementPageFontCount()); + pageFonts.put(afpFontAttributes.getFontKey(), afpFontAttributes); } else { // Use the previously stored font attributes - afpFontAttributes = (AFPFontAttributes) currentPageFontMap - .get(afpFontAttributes.getFontKey()); + afpFontAttributes = (AFPFontAttributes) pageFonts.get(afpFontAttributes.getFontKey()); } // Try and get the encoding to use for the font String encoding = null; try { - encoding = font.getCharacterSet(currentFontSize).getEncoding(); + encoding = font.getCharacterSet(fontSize).getEncoding(); } catch (Throwable ex) { encoding = AFPConstants.EBCIDIC_ENCODING; log.warn("renderText():: Error getting encoding for font '" @@ -1241,19 +934,50 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { + encoding); } + byte[] data = null; try { - getAFPDataStream().createText(afpFontAttributes.getFontReference(), - mpts2units(rx), mpts2units(bl), col, vsci, - mpts2units(text.getTextLetterSpaceAdjust()), - worddata.getBytes(encoding)); + String worddata = text.getText(); + data = worddata.getBytes(encoding); } catch (UnsupportedEncodingException usee) { log.error("renderText:: Font " + afpFontAttributes.getFontKey() + " caused UnsupportedEncodingException"); + return; } + int fontReference = afpFontAttributes.getFontReference(); + + int x = (currentIPPosition + text.getBorderAndPaddingWidthStart()); + int y = (currentBPPosition + text.getOffset() + text.getBaselineOffset()); + float[] srcPts = new float[] {x, y}; + int[] coords = mpts2units(srcPts); + + Color color = (Color) text.getTrait(Trait.COLOR); + + int variableSpaceCharacterIncrement = font.getWidth(' ', fontSize) / 1000 + + text.getTextWordSpaceAdjust() + + text.getTextLetterSpaceAdjust(); + int resolution = currentState.getResolution(); + variableSpaceCharacterIncrement /= (AFPConstants.DPI_72_MPTS / resolution); + + int interCharacterAdjustment = text.getTextLetterSpaceAdjust(); + interCharacterAdjustment /= (AFPConstants.DPI_72_MPTS / resolution); + + AFPTextDataInfo textDataInfo = new AFPTextDataInfo(); + textDataInfo.setFontReference(fontReference); + textDataInfo.setX(coords[X]); + textDataInfo.setY(coords[Y]); + textDataInfo.setColor(color); + textDataInfo.setVariableSpaceCharacterIncrement(variableSpaceCharacterIncrement); + textDataInfo.setInterCharacterAdjustment(interCharacterAdjustment); + textDataInfo.setData(data); + getAFPDataStream().createText(textDataInfo); + // word.getOffset() = only height of text itself + // currentBlockIPPosition: 0 for beginning of line; nonzero + // where previous line area failed to take up entire allocated space + super.renderText(text); - renderTextDecoration(font, currentFontSize, text, bl, rx); + renderTextDecoration(font, fontSize, text, coords[Y], coords[X]); } /** @@ -1291,58 +1015,6 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { super.renderLeader(area); } - /** - * Sets the AFPRenderer options - * - * @param options - * theMap
containing the options
- */
- // UNUSED
- // public void setOptions(Map options) {
- //
- // this.afpOptions = options;
- //
- // }
- /**
- * Determines the orientation from the string representation, this method
- * guarantees to return a value of either 0, 90, 180 or 270.
- *
- * @return the orientation
- */
- // UNUSED
- // private int getOrientation(String orientationString) {
- //
- // int orientation = 0;
- // if (orientationString != null && orientationString.length() > 0) {
- // try {
- // orientation = Integer.parseInt(orientationString);
- // } catch (NumberFormatException nfe) {
- // log.error("Cannot use orientation of " + orientation
- // + " defaulting to zero.");
- // orientation = 0;
- // }
- // } else {
- // orientation = 0;
- // }
- // switch (orientation) {
- // case 0:
- // break;
- // case 90:
- // break;
- // case 180:
- // break;
- // case 270:
- // break;
- // default:
- // log.error("Cannot use orientation of " + orientation
- // + " defaulting to zero.");
- // orientation = 0;
- // break;
- // }
- //
- // return orientation;
- //
- // }
/**
* Sets the rotation to be used for portrait pages, valid values are 0
* (default), 90, 180, 270.
@@ -1351,15 +1023,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
* The rotation in degrees.
*/
public void setPortraitRotation(int rotation) {
- if (rotation == 0 || rotation == 90 || rotation == 180
- || rotation == 270) {
- portraitRotation = rotation;
- } else {
- throw new IllegalArgumentException(
- "The portrait rotation must be one"
- + " of the values 0, 90, 180, 270");
-
- }
+ currentState.setPortraitRotation(rotation);
}
/**
@@ -1370,14 +1034,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
* The rotation in degrees.
*/
public void setLandscapeRotation(int rotation) {
- if (rotation == 0 || rotation == 90 || rotation == 180
- || rotation == 270) {
- landscapeRotation = rotation;
- } else {
- throw new IllegalArgumentException(
- "The landscape rotation must be one"
- + " of the values 0, 90, 180, 270");
- }
+ currentState.setLandscapeRotation(rotation);
}
/**
@@ -1444,215 +1101,6 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
}
- /**
- * Converts FOP mpt measurement to afp measurement units
- *
- * @param mpt
- * the millipoints value
- */
- private int mpts2units(int mpt) {
- return mpts2units((double) mpt);
- }
-
- /**
- * Converts FOP pt measurement to afp measurement units
- *
- * @param mpt
- * the millipoints value
- */
- private int pts2units(float mpt) {
- return mpts2units(mpt * 1000d);
- }
-
- /**
- * Converts FOP mpt measurement to afp measurement units
- *
- * @param mpt
- * the millipoints value
- * @return afp measurement unit value
- */
- private int mpts2units(double mpt) {
- return (int) Math
- .round(mpt / (DPI_CONVERSION_FACTOR / getResolution()));
- }
-
- /**
- * Converts a byte array containing 24 bit RGB image data to a grayscale
- * image.
- *
- * @param io
- * the target image object
- * @param raw
- * the buffer containing the RGB image data
- * @param width
- * the width of the image in pixels
- * @param height
- * the height of the image in pixels
- * @param bitsPerPixel
- * the number of bits to use per pixel
- */
- protected static void convertToGrayScaleImage(ImageObject io, byte[] raw,
- int width, int height, int bitsPerPixel) {
- int pixelsPerByte = 8 / bitsPerPixel;
- int bytewidth = (width / pixelsPerByte);
- if ((width % pixelsPerByte) != 0) {
- bytewidth++;
- }
- byte[] bw = new byte[height * bytewidth];
- byte ib;
- for (int y = 0; y < height; y++) {
- ib = 0;
- int i = 3 * y * width;
- for (int x = 0; x < width; x++, i += 3) {
-
- // see http://www.jguru.com/faq/view.jsp?EID=221919
- double greyVal = 0.212671d * ((int) raw[i] & 0xff) + 0.715160d
- * ((int) raw[i + 1] & 0xff) + 0.072169d
- * ((int) raw[i + 2] & 0xff);
- switch (bitsPerPixel) {
- case 1:
- if (greyVal < 128) {
- ib |= (byte) (1 << (7 - (x % 8)));
- }
- break;
- case 4:
- greyVal /= 16;
- ib |= (byte) ((byte) greyVal << ((1 - (x % 2)) * 4));
- break;
- case 8:
- ib = (byte) greyVal;
- break;
- default:
- throw new UnsupportedOperationException(
- "Unsupported bits per pixel: " + bitsPerPixel);
- }
-
- if ((x % pixelsPerByte) == (pixelsPerByte - 1)
- || ((x + 1) == width)) {
- bw[(y * bytewidth) + (x / pixelsPerByte)] = ib;
- ib = 0;
- }
- }
- }
- io.setImageIDESize((byte) bitsPerPixel);
- io.setImageData(bw);
- }
-
- private final class ViewPortPos {
- private int x = 0;
-
- private int y = 0;
-
- private int rot = 0;
-
- private ViewPortPos() {
- }
-
- private ViewPortPos(Rectangle2D view, CTM ctm) {
- ViewPortPos currentVP = (ViewPortPos) viewPortPositions
- .get(viewPortPositions.size() - 1);
- int xOrigin;
- int yOrigin;
- int width;
- int height;
- switch (currentVP.rot) {
- case 90:
- width = mpts2units(view.getHeight());
- height = mpts2units(view.getWidth());
- xOrigin = pageWidth - width - mpts2units(view.getY())
- - currentVP.y;
- yOrigin = mpts2units(view.getX()) + currentVP.x;
- break;
- case 180:
- width = mpts2units(view.getWidth());
- height = mpts2units(view.getHeight());
- xOrigin = pageWidth - width - mpts2units(view.getX())
- - currentVP.x;
- yOrigin = pageHeight - height - mpts2units(view.getY())
- - currentVP.y;
- break;
- case 270:
- width = mpts2units(view.getHeight());
- height = mpts2units(view.getWidth());
- xOrigin = mpts2units(view.getY()) + currentVP.y;
- yOrigin = pageHeight - height - mpts2units(view.getX())
- - currentVP.x;
- break;
- default:
- xOrigin = mpts2units(view.getX()) + currentVP.x;
- yOrigin = mpts2units(view.getY()) + currentVP.y;
- width = mpts2units(view.getWidth());
- height = mpts2units(view.getHeight());
- break;
- }
- this.rot = currentVP.rot;
- double[] ctmf = ctm.toArray();
- if (ctmf[0] == 0.0d && ctmf[1] == -1.0d && ctmf[2] == 1.0d
- && ctmf[3] == 0.d) {
- this.rot += 270;
- } else if (ctmf[0] == -1.0d && ctmf[1] == 0.0d && ctmf[2] == 0.0d
- && ctmf[3] == -1.0d) {
- this.rot += 180;
- } else if (ctmf[0] == 0.0d && ctmf[1] == 1.0d && ctmf[2] == -1.0d
- && ctmf[3] == 0.0d) {
- this.rot += 90;
- }
- this.rot %= 360;
- switch (this.rot) {
- /*
- * case 0: this.x = mpts2units(view.getX()) + x; this.y =
- * mpts2units(view.getY()) + y; break; case 90: this.x =
- * mpts2units(view.getY()) + y; this.y = _pageWidth -
- * mpts2units(view.getX() + view.getWidth()) - x; break; case 180:
- * this.x = _pageWidth - mpts2units(view.getX() + view.getWidth()) -
- * x; this.y = _pageHeight - mpts2units(view.getY() +
- * view.getHeight()) - y; break; case 270: this.x = _pageHeight -
- * mpts2units(view.getY() + view.getHeight()) - y; this.y =
- * mpts2units(view.getX()) + x; break;
- */
- case 0:
- this.x = xOrigin;
- this.y = yOrigin;
- break;
- case 90:
- this.x = yOrigin;
- this.y = pageWidth - width - xOrigin;
- break;
- case 180:
- this.x = pageWidth - width - xOrigin;
- this.y = pageHeight - height - yOrigin;
- break;
- case 270:
- this.x = pageHeight - height - yOrigin;
- this.y = xOrigin;
- break;
- default:
- }
- }
-
- public String toString() {
- return "x:" + x + " y:" + y + " rot:" + rot;
- }
-
- }
-
- private List viewPortPositions = new java.util.ArrayList();
-
- private void pushViewPortPos(ViewPortPos vpp) {
- viewPortPositions.add(vpp);
- getAFPDataStream().setOffsets(vpp.x, vpp.y, vpp.rot);
- }
-
- private ViewPortPos popViewPortPos() {
- ViewPortPos current = (ViewPortPos)viewPortPositions.remove(viewPortPositions.size() - 1);
- if (viewPortPositions.size() > 0) {
- ViewPortPos vpp = (ViewPortPos) viewPortPositions
- .get(viewPortPositions.size() - 1);
- getAFPDataStream().setOffsets(vpp.x, vpp.y, vpp.rot);
- }
- return current;
- }
-
/**
* Sets the number of bits used per pixel
*
@@ -1660,17 +1108,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
* number of bits per pixel
*/
public void setBitsPerPixel(int bitsPerPixel) {
- this.bitsPerPixel = bitsPerPixel;
- switch (bitsPerPixel) {
- case 1:
- case 4:
- case 8:
- break;
- default:
- log.warn("Invalid bits_per_pixel value, must be 1, 4 or 8.");
- bitsPerPixel = 8;
- break;
- }
+ currentState.setBitsPerPixel(bitsPerPixel);
}
/**
@@ -1680,7 +1118,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
* color image output
*/
public void setColorImages(boolean colorImages) {
- this.colorImages = colorImages;
+ currentState.setColorImages(colorImages);
}
/**
@@ -1702,10 +1140,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
* the output resolution (dpi)
*/
public void setResolution(int resolution) {
- if (log.isDebugEnabled()) {
- log.debug("renderer-resolution set to: " + resolution + "dpi");
- }
- this.resolution = resolution;
+ ((AFPState)getState()).setResolution(resolution);
}
/**
@@ -1714,18 +1149,19 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
* @return the resolution in dpi
*/
public int getResolution() {
- return this.resolution;
+ return ((AFPState)getState()).getResolution();
}
- private AFPState getState() {
+ /**
+ * @return the current AFP state
+ */
+ protected AbstractState getState() {
if (currentState == null) {
currentState = new AFPState();
}
return currentState;
}
- private boolean gocaEnabled = false;
-
/**
* @param enabled
* true if AFP GOCA is enabled for SVG support
@@ -1740,4 +1176,61 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
protected boolean isGOCAEnabled() {
return this.gocaEnabled;
}
+
+ // TODO: remove this and use the superclass implementation
+ /** {@inheritDoc} */
+ protected void renderReferenceArea(Block block) {
+ // save position and offset
+ int saveIP = currentIPPosition;
+ int saveBP = currentBPPosition;
+
+ //Establish a new coordinate system
+ AffineTransform at = new AffineTransform();
+ at.translate(currentIPPosition, currentBPPosition);
+ at.translate(block.getXOffset(), block.getYOffset());
+ at.translate(0, block.getSpaceBefore());
+
+ if (!at.isIdentity()) {
+ saveGraphicsState();
+ concatenateTransformationMatrix(at);
+ }
+
+ currentIPPosition = 0;
+ currentBPPosition = 0;
+ handleBlockTraits(block);
+
+ List children = block.getChildAreas();
+ if (children != null) {
+ renderBlocks(block, children);
+ }
+
+ if (!at.isIdentity()) {
+ restoreGraphicsState();
+ }
+
+ // stacked and relative blocks effect stacking
+ currentIPPosition = saveIP;
+ currentBPPosition = saveBP;
+ }
+
+ protected int[] transformPoints(float[] srcPts, float[] dstPts) {
+ return transformPoints(srcPts, dstPts, true);
+ }
+
+ protected int[] transformPoints(float[] srcPts, float[] dstPts, boolean milli) {
+ if (dstPts == null) {
+ dstPts = new float[srcPts.length];
+ }
+ AbstractState state = (AbstractState)getState();
+ AffineTransform at = state.getData().getTransform();
+ at.transform(srcPts, 0, dstPts, 0, srcPts.length / 2);
+ int[] coords = new int[srcPts.length];
+ for (int i = 0; i < srcPts.length; i++) {
+ if (!milli) {
+ dstPts[i] *= 1000;
+ }
+ coords[i] = Math.round(dstPts[i]);
+ }
+ return coords;
+ }
}
diff --git a/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java b/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
index a4b449bb0..360132863 100644
--- a/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
@@ -35,15 +35,9 @@ public interface AFPRendererContextConstants extends RendererContextConstants {
/** The font information for the AFP renderer. */
String AFP_FONT_INFO = "afpFontInfo";
- /** The afp resolution. */
- String AFP_RESOLUTION = "afpResolution";
-
/** The afp datastream */
String AFP_DATASTREAM = "afpDataStream";
/** The afp state */
String AFP_STATE = "afpPageState";
-
- /** The afp bits per pixel */
- String AFP_BITS_PER_PIXEL = "afpBitsPerPixel";
}
diff --git a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
index b0d155cd9..9173a1d23 100644
--- a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
+++ b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
@@ -34,6 +34,7 @@ import org.apache.fop.render.AbstractGenericSVGHandler;
import org.apache.fop.render.Renderer;
import org.apache.fop.render.RendererContext;
import org.apache.fop.render.RendererContextConstants;
+import org.apache.fop.render.afp.modca.AFPConstants;
import org.apache.fop.render.afp.modca.AFPDataStream;
import org.apache.fop.render.afp.modca.GraphicsObject;
import org.apache.fop.svg.SVGUserAgent;
@@ -71,19 +72,13 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler {
afpi.setHandlerConfiguration((Configuration)context.getProperty(HANDLER_CONFIGURATION));
afpi.setFontInfo((org.apache.fop.fonts.FontInfo)context.getProperty(
AFPRendererContextConstants.AFP_FONT_INFO));
- afpi.setResolution(((Integer)context.getProperty(
- AFPRendererContextConstants.AFP_RESOLUTION)).intValue());
afpi.setState((AFPState)context.getProperty(
AFPRendererContextConstants.AFP_STATE));
afpi.setAFPDataStream((AFPDataStream)context.getProperty(
AFPRendererContextConstants.AFP_DATASTREAM));
- afpi.setColor(!((Boolean)context.getProperty(
- AFPRendererContextConstants.AFP_GRAYSCALE)).booleanValue());
- afpi.setBitsPerPixel(((Integer)context.getProperty(
- AFPRendererContextConstants.AFP_BITS_PER_PIXEL)).intValue());
return afpi;
}
-
+
/**
* Render the SVG document.
*
@@ -137,20 +132,20 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler {
double h = ctx.getDocumentSize().getHeight() * 1000f;
// convert to afp inches
- double sx = ((afpInfo.getWidth() / w) * res) / 72f;
- double sy = ((afpInfo.getHeight() / h) * res) / 72f;
- double xOffset = (afpInfo.getX() * res) / 72000f;
- double yOffset = ((afpInfo.getHeight() - afpInfo.getY()) * res) / 72000f;
+ double scaleX = ((afpInfo.getWidth() / w) * res) / AFPConstants.DPI_72;
+ double scaleY = ((afpInfo.getHeight() / h) * res) / AFPConstants.DPI_72;
+ double xOffset = (afpInfo.getX() * res) / AFPConstants.DPI_72_MPTS;
+ double yOffset = ((afpInfo.getHeight() - afpInfo.getY()) * res) / AFPConstants.DPI_72_MPTS;
// Transformation matrix that establishes the local coordinate system for the SVG graphic
// in relation to the current coordinate system (note: y axis is inverted)
- AffineTransform trans = new AffineTransform(sx, 0, 0, -sy, xOffset, yOffset);
+ AffineTransform trans = new AffineTransform(scaleX, 0, 0, -scaleY, xOffset, yOffset);
graphics.setTransform(trans);
- int x = (int)Math.round((afpInfo.getX() * 25.4f) / 1000);
- int y = (int)Math.round((afpInfo.getY() * 25.4f) / 1000);
- int width = (int)Math.round((afpInfo.getWidth() * res) / 72000f);
- int height = (int)Math.round((afpInfo.getHeight() * res) / 72000f);
+ int x = (int)Math.round((afpInfo.getX() * 25.4f) / 1000f);
+ int y = (int)Math.round((afpInfo.getY() * 25.4f) / 1000f);
+ int width = (int)Math.round((afpInfo.getWidth() * res) / AFPConstants.DPI_72_MPTS);
+ int height = (int)Math.round((afpInfo.getHeight() * res) / AFPConstants.DPI_72_MPTS);
// set the data object parameters
DataObjectInfo dataObjectInfo = new DataObjectInfo();
diff --git a/src/java/org/apache/fop/render/afp/AFPState.java b/src/java/org/apache/fop/render/afp/AFPState.java
index 7c28e8bf0..9d93817be 100644
--- a/src/java/org/apache/fop/render/afp/AFPState.java
+++ b/src/java/org/apache/fop/render/afp/AFPState.java
@@ -19,157 +19,183 @@
package org.apache.fop.render.afp;
-import java.awt.Color;
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
- * This keeps information about the current state when writing to pdf.
+ * This keeps information about the current state when writing to an AFP datastream.
*/
-public class AFPState {
- private Data data = new Data();
-
- private List stateStack = new java.util.ArrayList();
+public class AFPState extends org.apache.fop.render.AbstractState {
+
+ private static Log log = LogFactory.getLog("org.apache.fop.render.afp.AFPState");
/**
- * Set the current color.
- * Check if the new color is a change and then set the current color.
- *
- * @param col the color to set
- * @return true if the color has changed
+ * The portrait rotation
*/
- protected boolean setColor(Color col) {
- if (!col.equals(getData().color)) {
- getData().color = col;
- return true;
+ private int portraitRotation = 0;
+
+ /**
+ * The landscape rotation
+ */
+ private int landscapeRotation = 270;
+
+ /**
+ * Flag to the set the output object type for images
+ */
+ private boolean colorImages = false;
+
+ /**
+ * Default value for image depth
+ */
+ private int bitsPerPixel = 8;
+
+ /**
+ * The output resolution
+ */
+ private int resolution = 240; // 240 dpi
+
+ /**
+ * The current page
+ */
+ private AFPPageState pageState = new AFPPageState();
+
+ /**
+ * Sets the rotation to be used for portrait pages, valid values are 0
+ * (default), 90, 180, 270.
+ *
+ * @param rotation
+ * The rotation in degrees.
+ */
+ protected void setPortraitRotation(int rotation) {
+ if (rotation == 0 || rotation == 90 || rotation == 180
+ || rotation == 270) {
+ portraitRotation = rotation;
+ } else {
+ throw new IllegalArgumentException(
+ "The portrait rotation must be one"
+ + " of the values 0, 90, 180, 270");
+
}
- return false;
}
/**
- * Sets if the current painted shape is to be filled
- * @param fill true if the current painted shape is to be filled
- * @return true if the fill value has changed
+ * @return the rotation to be used for portrait pages
*/
- protected boolean setFill(boolean fill) {
- if (fill != getData().filled) {
- getData().filled = fill;
- return true;
- }
- return false;
+ protected int getPortraitRotation() {
+ return this.portraitRotation;
}
/**
- * Get the color.
- * @return the color
+ * Sets the rotation to be used for landscape pages, valid values are 0, 90,
+ * 180, 270 (default).
+ *
+ * @param rotation
+ * The rotation in degrees.
*/
- protected Color getColor() {
- if (getData().color == null) {
- getData().color = Color.black;
+ protected void setLandscapeRotation(int rotation) {
+ if (rotation == 0 || rotation == 90 || rotation == 180
+ || rotation == 270) {
+ landscapeRotation = rotation;
+ } else {
+ throw new IllegalArgumentException(
+ "The landscape rotation must be one"
+ + " of the values 0, 90, 180, 270");
}
- return getData().color;
}
/**
- * Set the current line width.
- * @param width the line width in points
- * @return true if the line width has changed
+ * @return the landscape rotation
*/
- protected boolean setLineWidth(float width) {
- if (getData().lineWidth != width) {
- getData().lineWidth = width;
- return true;
- }
- return false;
+ protected int getLandscapeRotation() {
+ return this.landscapeRotation;
}
/**
- * Sets the dash array (line type) for the current basic stroke
- * @param dash the line dash array
- * @return true if the dash array has changed
+ * Sets the number of bits used per pixel
+ *
+ * @param bitsPerPixel
+ * number of bits per pixel
*/
- public boolean setDashArray(float[] dash) {
- if (!Arrays.equals(dash, getData().dashArray)) {
- getData().dashArray = dash;
- return true;
+ public void setBitsPerPixel(int bitsPerPixel) {
+ this.bitsPerPixel = bitsPerPixel;
+ switch (bitsPerPixel) {
+ case 1:
+ case 4:
+ case 8:
+ break;
+ default:
+ log.warn("Invalid bits_per_pixel value, must be 1, 4 or 8.");
+ bitsPerPixel = 8;
+ break;
}
- return false;
}
/**
- * Gets the current line width
- * @return the current line width
+ * @return the number of bits per pixel
*/
- protected float getLineWidth() {
- return getData().lineWidth;
+ public int getBitsPerPixel() {
+ return this.bitsPerPixel;
}
/**
- * Get the background color.
- * @return the background color
+ * Sets whether images are color or not
+ *
+ * @param colorImages
+ * color image output
*/
- protected Color getBackColor() {
- if (getData().backColor == null) {
- getData().backColor = Color.white;
- }
- return getData().backColor;
+ public void setColorImages(boolean colorImages) {
+ this.colorImages = colorImages;
}
/**
- * Set the current background color.
- * Check if the new background color is a change and then set the current background color.
- *
- * @param col the background color to set
- * @return true if the color has changed
+ * @return true if color images are to be used
*/
- protected boolean setBackColor(Color col) {
- if (!col.equals(getData().backColor)) {
- getData().backColor = col;
- return true;
- }
- return false;
+ protected boolean isColorImages() {
+ return this.colorImages;
}
/**
- * Set the current font name
- * @param internalFontName the internal font name
- * @return true if the font name has changed
+ * Sets the output/device resolution
+ *
+ * @param resolution
+ * the output resolution (dpi)
*/
- protected boolean setFontName(String internalFontName) {
- if (!internalFontName.equals(getData().fontName)) {
- getData().fontName = internalFontName;
- return true;
+ public void setResolution(int resolution) {
+ if (log.isDebugEnabled()) {
+ log.debug("renderer-resolution set to: " + resolution + "dpi");
}
- return false;
+ this.resolution = resolution;
}
/**
- * Gets the current font name
- * @return the current font name
+ * Returns the output/device resolution.
+ *
+ * @return the resolution in dpi
*/
- protected String getFontName() {
- return getData().fontName;
+ protected int getResolution() {
+ return this.resolution;
}
-
+
+ /** {@inheritDoc} */
+ protected AbstractData instantiateData() {
+ return new AFPData();
+ }
+
/**
- * Gets the current font size
- * @return the current font size
+ * @return the state of the current page
*/
- protected int getFontSize() {
- return getData().fontSize;
+ protected AFPPageState getPageState() {
+ return this.pageState;
}
-
+
/**
- * Set the current font size.
- * Check if the font size is a change and then set the current font size.
- *
- * @param size the font size to set
- * @return true if the font size has changed
+ * Sets if the current painted shape is to be filled
+ * @param fill true if the current painted shape is to be filled
+ * @return true if the fill value has changed
*/
- protected boolean setFontSize(int size) {
- if (size != getData().fontSize) {
- getData().fontSize = size;
+ protected boolean setFill(boolean fill) {
+ if (fill != ((AFPData)getData()).filled) {
+ ((AFPData)getData()).filled = fill;
return true;
}
return false;
@@ -180,137 +206,177 @@ public class AFPState {
* @return the current page fonts
*/
protected AFPPageFonts getPageFonts() {
- if (getData().pageFonts == null) {
- getData().pageFonts = new AFPPageFonts();
- }
- return getData().pageFonts;
+ return pageState.getFonts();
}
/**
- * Sets the image uri of the current image being processed
- * @param uri the image uri of the current image being processed
- * @return true if the image uri has changed
+ * Increments and returns the page font count
+ * @return the page font count
*/
- public boolean setImageUri(String uri) {
- if (!uri.equals(getData().imageUri)) {
- getData().imageUri = uri;
- return true;
- }
- return false;
+ public int incrementPageFontCount() {
+ return pageState.incrementFontCount();
}
/**
- * Returns the image uri of the current image being processed
- * @return the image uri of the current image being processed
+ * Sets the page width
+ * @param pageWidth the page width
*/
- protected String getImageUri() {
- return getData().imageUri;
+ public void setPageWidth(int pageWidth) {
+ pageState.setWidth(pageWidth);
}
-
+
/**
- * Push the current state onto the stack.
- * This call should be used when the q operator is used
- * so that the state is known when popped.
+ * @return the page width
*/
- public void push() {
- Data copy;
- try {
- copy = (Data)getData().clone();
- } catch (CloneNotSupportedException e) {
- throw new RuntimeException(e.getMessage());
- }
- stateStack.add(copy);
+ public int getPageWidth() {
+ return pageState.getWidth();
}
/**
- * Get the current stack level.
- *
- * @return the current stack level
+ * Sets the page height
+ * @param pageHeight the page height
*/
- public int getStackLevel() {
- return stateStack.size();
+ public void setPageHeight(int pageHeight) {
+ pageState.setHeight(pageHeight);
}
/**
- * Pop the state from the stack and set current values to popped state.
- * This should be called when a Q operator is used so
- * the state is restored to the correct values.
- * @return the restored state, null if the stack is empty
+ * @return the page height
*/
- public Data pop() {
- if (getStackLevel() > 0) {
- Data popped = (Data)stateStack.remove(stateStack.size() - 1);
- data = popped;
- return popped;
- } else {
- return null;
- }
+ public int getPageHeight() {
+ return pageState.getHeight();
}
/**
- * @return the currently valid state
+ * Sets the uri of the current image
+ * @param uri the uri of the current image
*/
- public Data getData() {
- return data;
+ protected void setImageUri(String uri) {
+ ((AFPData)getData()).imageUri = uri;
}
-
- /** the state data instance */
- public class Data implements Cloneable, Serializable {
- private static final long serialVersionUID = -1789481244175275686L;
- /** The current color */
- private Color color = null;
+ /**
+ * Gets the uri of the current image
+ * @return the uri of the current image
+ */
+ public String getImageUri() {
+ return ((AFPData)getData()).imageUri;
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return "AFPState{portraitRotation=" + portraitRotation
+ + ", landscapeRotation=" + landscapeRotation
+ + ", colorImages=" + colorImages
+ + ", bitsPerPixel=" + bitsPerPixel
+ + ", resolution=" + resolution
+ + ", pageState=" + pageState
+ + "}";
+ }
- /** The current background color */
- private Color backColor = null;
+ /**
+ * Page level state data
+ */
+ private class AFPPageState {
+ /** The current page width */
+ private int width = 0;
- /** The current font name */
- private String fontName = null;
+ /** The current page height */
+ private int height = 0;
- /** The current font size */
- private int fontSize = 0;
+ /** The current page fonts */
+ private AFPPageFonts fonts = new AFPPageFonts();
- /** The current line width */
- private float lineWidth = 0;
+ /** The current page font count */
+ private int fontCount = 0;
- /** The dash array for the current basic stroke (line type) */
- private float[] dashArray = null;
+ /**
+ * @return the page width
+ */
+ protected int getWidth() {
+ return width;
+ }
+
+ /**
+ * Sets the page width
+ * @param width the page width
+ */
+ protected void setWidth(int width) {
+ this.width = width;
+ }
+
+ /**
+ * @return the page height
+ */
+ protected int getHeight() {
+ return height;
+ }
+
+ /**
+ * Sets the page height
+ * @param height the page height
+ */
+ protected void setHeight(int height) {
+ this.height = height;
+ }
+
+ /**
+ * @return the page fonts
+ */
+ protected AFPPageFonts getFonts() {
+ return fonts;
+ }
+
+ /**
+ * Sets the current page fonts
+ * @param fonts the current page fonts
+ */
+ protected void setFonts(AFPPageFonts fonts) {
+ this.fonts = fonts;
+ }
+
+ /**
+ * @return increment and return the current page font count
+ */
+ protected int incrementFontCount() {
+ return ++fontCount;
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return "AFPPageState{width=" + width
+ + ", height=" + height
+ + ", fonts=" + fonts
+ + ", fontCount=" + fontCount
+ + "}";
+ }
+ }
+
+ /**
+ * Block level data
+ */
+ private class AFPData extends org.apache.fop.render.AbstractState.AbstractData {
+ private static final long serialVersionUID = -1789481244175275686L;
/** The current fill status */
private boolean filled = false;
- /** The fonts on the current page */
- private AFPPageFonts pageFonts = null;
-
- /** The current image uri */
private String imageUri = null;
/** {@inheritDoc} */
public Object clone() throws CloneNotSupportedException {
- Data obj = new Data();
- obj.color = this.color;
- obj.backColor = this.backColor;
- obj.fontName = this.fontName;
- obj.fontSize = this.fontSize;
- obj.lineWidth = this.lineWidth;
- obj.dashArray = this.dashArray;
+ AFPData obj = (AFPData)super.clone();
obj.filled = this.filled;
- obj.pageFonts = this.pageFonts;
obj.imageUri = this.imageUri;
return obj;
}
- /** {@inheritDoc} */
+ /** {@inheritDoc} */
public String toString() {
- return "color=" + color
- + ", backColor=" + backColor
- + ", fontName=" + fontName
- + ", fontSize=" + fontSize
- + ", lineWidth=" + lineWidth
- + ", dashArray=" + dashArray
+ return "AFPData{" + super.toString()
+ ", filled=" + filled
- + ", pageFonts=" + pageFonts
- + ", imageUri=" + imageUri;
+ + ", imageUri=" + imageUri
+ + "}";
}
}
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/render/afp/ObjectAreaInfo.java b/src/java/org/apache/fop/render/afp/ObjectAreaInfo.java
index 49b799489..b6538b327 100644
--- a/src/java/org/apache/fop/render/afp/ObjectAreaInfo.java
+++ b/src/java/org/apache/fop/render/afp/ObjectAreaInfo.java
@@ -16,6 +16,7 @@
*/
/* $Id$ */
+
package org.apache.fop.render.afp;
public class ObjectAreaInfo {
@@ -144,4 +145,4 @@ public class ObjectAreaInfo {
+ ", heightRes=" + heightRes
+ ", rotation=" + rotation;
}
-}
\ No newline at end of file
+}
diff --git a/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java b/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java
index bad46dd7c..8c2c1b958 100644
--- a/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java
+++ b/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java
@@ -30,6 +30,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.render.afp.AFPFontAttributes;
+import org.apache.fop.render.afp.AFPTextDataInfo;
import org.apache.fop.render.afp.DataObjectInfo;
import org.apache.fop.render.afp.ObjectAreaInfo;
import org.apache.fop.render.afp.ResourceInfo;
@@ -121,20 +122,10 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
*/
private int landscapeRotation = 270;
- /**
- * The x offset
- */
- private int xOffset = 0;
-
- /**
- * The y offset
- */
- private int yOffset = 0;
-
/**
* The rotation
*/
- private int rotation;
+ private int orientation;
/**
* The outputstream for the data stream
@@ -276,7 +267,7 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
pageRotation, pageWidthRes, pageHeightRes);
currentPage = currentPageObject;
currentOverlay = null;
- setOffsets(0, 0, 0);
+// setOffsets(0, 0, 0);
}
/**
@@ -315,7 +306,7 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
currentPageObject.createIncludePageOverlay(overlayName, x, y, 0);
currentPage = currentOverlay;
- setOffsets(0, 0, 0);
+// setOffsets(0, 0, 0);
}
/**
@@ -380,15 +371,24 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
* the offset in the x direction
* @param yOff
* the offset in the y direction
- * @param rot
+ * @param orientation
* the rotation
+ * @deprecated offsets are no longer used, use setOrientation() for setting the orientation
*/
- public void setOffsets(int xOff, int yOff, int rot) {
- this.xOffset = xOff;
- this.yOffset = yOff;
- this.rotation = rot;
+ public void setOffsets(int xOff, int yOff, int orientation) {
+ setOrientation(orientation);
}
+ /**
+ * Sets the orientation to be used for element positioning
+ *
+ * @param orientation
+ * the orientation used for element positioning
+ */
+ public void setOrientation(int orientation) {
+ this.orientation = orientation;
+ }
+
/**
* Creates the given page fonts in the current page
*
@@ -425,25 +425,12 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
* Helper method to create text on the current page, this method delegates
* to the current presentation text object in order to construct the text.
*
- * @param fontReference
- * the font reference used as the resource identifier
- * @param x
- * the x coordinate of the text
- * @param y
- * the y coordinate of the text
- * @param col
- * the text color
- * @param vsci
- * The variable space character increment.
- * @param ica
- * The inter character adjustment.
- * @param data
- * the text data to create
+ * @param textDataInfo
+ * the afp text data
*/
- public void createText(int fontReference, int x, int y, Color col,
- int vsci, int ica, byte[] data) {
- getCurrentPage().createText(fontReference, x + xOffset, y + yOffset,
- rotation, col, vsci, ica, data);
+ public void createText(AFPTextDataInfo textDataInfo) {
+ textDataInfo.setOrientation(orientation);
+ getCurrentPage().createText(textDataInfo);
}
/**
@@ -469,8 +456,8 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
//Update placement with current state
ObjectAreaInfo areaInfo = dataObjectInfo.getObjectAreaInfo();
- areaInfo.setX(areaInfo.getX() + this.xOffset);
- areaInfo.setY(areaInfo.getY() + this.yOffset);
+ areaInfo.setX(areaInfo.getX());
+ areaInfo.setY(areaInfo.getY());
areaInfo.setRotation(this.rotation);
Registry registry = Registry.getInstance();
@@ -593,8 +580,7 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
*/
public void createLine(int x1, int y1, int x2, int y2, int thickness,
Color col) {
- getCurrentPage().createLine(x1 + xOffset, y1 + yOffset, x2 + xOffset,
- y2 + yOffset, thickness, rotation, col);
+ getCurrentPage().createLine(x1, y1, x2, y2, thickness, orientation, col);
}
/**
@@ -614,8 +600,7 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
* the shading color
*/
public void createShading(int x, int y, int w, int h, Color col) {
- currentPageObject.createShading(x + xOffset, y + xOffset, w, h,
- col.getRed(), col.getGreen(), col.getBlue());
+ currentPageObject.createShading(x, y, w, h, col.getRed(), col.getGreen(), col.getBlue());
}
/**
@@ -626,7 +611,7 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
* the name of the static overlay
*/
public void createIncludePageOverlay(String name) {
- currentPageObject.createIncludePageOverlay(name, 0, 0, rotation);
+ currentPageObject.createIncludePageOverlay(name, 0, 0, orientation);
currentPageObject.getActiveEnvironmentGroup().createOverlay(name);
}
@@ -653,22 +638,22 @@ public class AFPDataStream extends AbstractResourceGroupContainer {
public void createIncludePageSegment(String name, int x, int y) {
int xOrigin;
int yOrigin;
- switch (rotation) {
+ switch (orientation) {
case 90:
- xOrigin = getCurrentPage().getWidth() - y - yOffset;
- yOrigin = x + xOffset;
+ xOrigin = getCurrentPage().getWidth() - y;
+ yOrigin = x;
break;
case 180:
- xOrigin = getCurrentPage().getWidth() - x - xOffset;
- yOrigin = getCurrentPage().getHeight() - y - yOffset;
+ xOrigin = getCurrentPage().getWidth() - x;
+ yOrigin = getCurrentPage().getHeight() - y;
break;
case 270:
- xOrigin = y + yOffset;
- yOrigin = getCurrentPage().getHeight() - x - xOffset;
+ xOrigin = y;
+ yOrigin = getCurrentPage().getHeight() - x;
break;
default:
- xOrigin = x + xOffset;
- yOrigin = y + yOffset;
+ xOrigin = x;
+ yOrigin = y;
break;
}
getCurrentPage().createIncludePageSegment(name, xOrigin, yOrigin);
diff --git a/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java b/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
index 065886a49..c5b2f3ea2 100644
--- a/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
+++ b/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
@@ -24,6 +24,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
+import org.apache.fop.render.afp.AFPTextDataInfo;
import org.apache.fop.render.afp.fonts.AFPFont;
/**
@@ -189,27 +190,11 @@ public abstract class AbstractPageObject extends AbstractNamedAFPObject {
* Helper method to create text on the current page, this method delegates
* to the presentation text object in order to construct the text.
*
- * @param fontRef
- * the font number used as the resource identifier
- * @param x
- * the x coordinate of the text data
- * @param y
- * the y coordinate of the text data
- * @param textRotation
- * the rotation of the text data
- * @param col
- * the text color
- * @param vsci
- * The variable space character increment.
- * @param ica
- * The inter character adjustment.
- * @param data
- * the text data to create
+ * @param textDataInfo
+ * the afp text data
*/
- public void createText(int fontRef, int x, int y, int textRotation, Color col,
- int vsci, int ica, byte[] data) {
- getPresentationTextObject().createTextData(
- fontRef, x, y, textRotation, col, vsci, ica, data);
+ public void createText(AFPTextDataInfo textDataInfo) {
+ getPresentationTextObject().createTextData(textDataInfo);
}
/**
diff --git a/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java b/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java
index b6b367ab5..03e3f848d 100644
--- a/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java
+++ b/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java
@@ -24,6 +24,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import org.apache.fop.render.afp.AFPTextDataInfo;
import org.apache.fop.render.afp.tools.BinaryUtils;
/**
@@ -33,18 +34,18 @@ import org.apache.fop.render.afp.tools.BinaryUtils;
* that position them - modal control sequences that adjust the positions by
* small amounts - other functions causing text to be presented with differences
* in appearance.
- *
+ *
* The graphic characters are expected to conform to a coded font representation
* so that they can be translated from the code point in the object data to the
* character in the coded font. The units of measure for linear displacements
* are derived from the PresentationTextDescriptor or from the hierarchical
* defaults.
- *
+ *
* In addition to graphic character code points, Presentation Text data can
* contain embedded control sequences. These are strings of two or more bytes
* which signal an alternate mode of processing for the content of the current
* Presentation Text data.
- *
+ *
*/
public class PresentationTextData extends AbstractAFPObject {
@@ -104,21 +105,20 @@ public class PresentationTextData extends AbstractAFPObject {
* Constructor for the PresentationTextData, the boolean flag indicate
* whether the control sequence prefix should be set to indicate the start
* of a new control sequence.
- *
+ *
* @param controlInd
* The control sequence indicator.
*/
public PresentationTextData(boolean controlInd) {
- final byte[] data = {
- 0x5A, // Structured field identifier
- 0x00, // Record length byte 1
- 0x00, // Record length byte 2
- (byte) 0xD3, // PresentationTextData identifier byte 1
- (byte) 0xEE, // PresentationTextData identifier byte 2
- (byte) 0x9B, // PresentationTextData identifier byte 3
- 0x00, // Flag
- 0x00, // Reserved
- 0x00, // Reserved
+ final byte[] data = { 0x5A, // Structured field identifier
+ 0x00, // Record length byte 1
+ 0x00, // Record length byte 2
+ (byte) 0xD3, // PresentationTextData identifier byte 1
+ (byte) 0xEE, // PresentationTextData identifier byte 2
+ (byte) 0x9B, // PresentationTextData identifier byte 3
+ 0x00, // Flag
+ 0x00, // Reserved
+ 0x00, // Reserved
};
baos.write(data, 0, 9);
@@ -131,7 +131,7 @@ public class PresentationTextData extends AbstractAFPObject {
* The Set Coded Font Local control sequence activates a coded font and
* specifies the character attributes to be used. This is a modal control
* sequence.
- *
+ *
* @param font
* The font local identifier.
* @param afpdata
@@ -152,13 +152,14 @@ public class PresentationTextData extends AbstractAFPObject {
* Establishes the current presentation position on the baseline at a new
* I-axis coordinate, which is a specified number of measurement units from
* the B-axis. There is no change to the current B-axis coordinate.
- *
+ *
* @param coordinate
* The coordinate for the inline move.
* @param afpdata
* The output stream to which data should be written.
*/
- private void absoluteMoveInline(int coordinate, ByteArrayOutputStream afpdata) {
+ private void absoluteMoveInline(int coordinate,
+ ByteArrayOutputStream afpdata) {
byte[] b = BinaryUtils.convert(coordinate, 2);
afpdata.write(new byte[] { 0x04, (byte) 0xC7, b[0], b[1], }, 0, 4);
currentXCoordinate = coordinate;
@@ -168,13 +169,14 @@ public class PresentationTextData extends AbstractAFPObject {
* Establishes the baseline and the current presentation position at a new
* B-axis coordinate, which is a specified number of measurement units from
* the I-axis. There is no change to the current I-axis coordinate.
- *
+ *
* @param coordinate
* The coordinate for the baseline move.
* @param afpdata
* The output stream to which data should be written.
*/
- private void absoluteMoveBaseline(int coordinate, ByteArrayOutputStream afpdata) {
+ private void absoluteMoveBaseline(int coordinate,
+ ByteArrayOutputStream afpdata) {
byte[] b = BinaryUtils.convert(coordinate, 2);
afpdata.write(new byte[] { 0x04, (byte) 0xD3, b[0], b[1], }, 0, 4);
currentYCoordinate = coordinate;
@@ -183,7 +185,7 @@ public class PresentationTextData extends AbstractAFPObject {
/**
* The Transparent Data control sequence contains a sequence of code points
* that are presented without a scan for embedded control sequences.
- *
+ *
* @param data
* The text data to add.
* @param afpdata
@@ -195,10 +197,10 @@ public class PresentationTextData extends AbstractAFPObject {
if (l > 255) {
// Check that we are not exceeding the maximum length
throw new IllegalArgumentException(
- "Transparent data is longer than 253 bytes: " + data);
+ "Transparent data is longer than 253 bytes: " + data);
}
afpdata.write(new byte[] { BinaryUtils.convert(l)[0], (byte) 0xDB, },
- 0, 2);
+ 0, 2);
afpdata.write(data, 0, data.length);
}
@@ -206,7 +208,7 @@ public class PresentationTextData extends AbstractAFPObject {
* Draws a line of specified length and specified width in the B-direction
* from the current presentation position. The location of the current
* presentation position is unchanged.
- *
+ *
* @param length
* The length of the rule.
* @param width
@@ -214,9 +216,10 @@ public class PresentationTextData extends AbstractAFPObject {
* @param afpdata
* The output stream to which data should be written.
*/
- private void drawBaxisRule(int length, int width, ByteArrayOutputStream afpdata) {
+ private void drawBaxisRule(int length, int width,
+ ByteArrayOutputStream afpdata) {
afpdata.write(new byte[] { 0x07, // Length
- (byte) 0xE7, // Type
+ (byte) 0xE7, // Type
}, 0, 2);
// Rule length
byte[] data1 = BinaryUtils.shortToByteArray((short) length);
@@ -232,7 +235,7 @@ public class PresentationTextData extends AbstractAFPObject {
* Draws a line of specified length and specified width in the I-direction
* from the current presentation position. The location of the current
* presentation position is unchanged.
- *
+ *
* @param length
* The length of the rule.
* @param width
@@ -240,9 +243,10 @@ public class PresentationTextData extends AbstractAFPObject {
* @param afpdata
* The output stream to which data should be written.
*/
- private void drawIaxisRule(int length, int width, ByteArrayOutputStream afpdata) {
+ private void drawIaxisRule(int length, int width,
+ ByteArrayOutputStream afpdata) {
afpdata.write(new byte[] { 0x07, // Length
- (byte) 0xE5, // Type
+ (byte) 0xE5, // Type
}, 0, 2);
// Rule length
byte[] data1 = BinaryUtils.shortToByteArray((short) length);
@@ -256,73 +260,66 @@ public class PresentationTextData extends AbstractAFPObject {
/**
* Create the presentation text data for the byte array of data.
- *
- * @param fontNumber
- * The font resource identifier.
- * @param x
- * The x coordinate for the text data.
- * @param y
- * The y coordinate for the text data.
- * @param orientation
- * The orientation of the text data.
- * @param col
- * The text color.
- * @param vsci
- * The variable space character increment.
- * @param ica
- * The inter character adjustment.
- * @param data
- * The text data to be created.
+ *
+ * @param textDataInfo
+ * the afp text data
* @throws MaximumSizeExceededException
+ * thrown if the maximum number of text data is exceeded
*/
- public void createTextData(int fontNumber, int x, int y, int orientation,
- Color col, int vsci, int ica, byte[] data) throws MaximumSizeExceededException {
+ public void createTextData(AFPTextDataInfo textDataInfo)
+ throws MaximumSizeExceededException {
ByteArrayOutputStream afpdata = new ByteArrayOutputStream();
- if (currentOrientation != orientation) {
- setTextOrientation(orientation, afpdata);
- currentOrientation = orientation;
+ if (currentOrientation != textDataInfo.getOrientation()) {
+ setTextOrientation(textDataInfo.getOrientation(), afpdata);
+ currentOrientation = textDataInfo.getOrientation();
currentXCoordinate = -1;
currentYCoordinate = -1;
}
// Avoid unnecessary specification of the Y co-ordinate
- if (y != currentYCoordinate) {
- absoluteMoveBaseline(y, afpdata);
+ if (textDataInfo.getY() != currentYCoordinate) {
+ absoluteMoveBaseline(textDataInfo.getY(), afpdata);
currentXCoordinate = -1;
}
// Avoid unnecessary specification of the X co-ordinate
- if (x != currentXCoordinate) {
- absoluteMoveInline(x, afpdata);
+ if (textDataInfo.getX() != currentXCoordinate) {
+ absoluteMoveInline(textDataInfo.getX(), afpdata);
}
// Avoid unnecessary specification of the variable space increment
- if (vsci != currentVariableSpaceCharacterIncrement) {
- setVariableSpaceCharacterIncrement(vsci, afpdata);
- currentVariableSpaceCharacterIncrement = vsci;
+ if (textDataInfo.getVariableSpaceCharacterIncrement()
+ != currentVariableSpaceCharacterIncrement) {
+ setVariableSpaceCharacterIncrement(textDataInfo
+ .getVariableSpaceCharacterIncrement(), afpdata);
+ currentVariableSpaceCharacterIncrement = textDataInfo
+ .getVariableSpaceCharacterIncrement();
}
// Avoid unnecessary specification of the inter character adjustment
- if (ica != currentInterCharacterAdjustment) {
- setInterCharacterAdjustment(ica, afpdata);
- currentInterCharacterAdjustment = ica;
+ if (textDataInfo.getInterCharacterAdjustment() != currentInterCharacterAdjustment) {
+ setInterCharacterAdjustment(textDataInfo.getInterCharacterAdjustment(),
+ afpdata);
+ currentInterCharacterAdjustment = textDataInfo
+ .getInterCharacterAdjustment();
}
// Avoid unnecessary specification of the text color
- if (!col.equals(currentColor)) {
- setExtendedTextColor(col, afpdata);
- currentColor = col;
+ if (!textDataInfo.getColor().equals(currentColor)) {
+ setExtendedTextColor(textDataInfo.getColor(), afpdata);
+ currentColor = textDataInfo.getColor();
}
- setCodedFont(BinaryUtils.convert(fontNumber)[0], afpdata);
- addTransparentData(data, afpdata);
+ setCodedFont(BinaryUtils.convert(textDataInfo.getFontReference())[0],
+ afpdata);
+ addTransparentData(textDataInfo.getData(), afpdata);
currentXCoordinate = -1;
- int s = afpdata.size();
+ int dataSize = afpdata.size();
- if (baos.size() + s > MAX_SIZE) {
+ if (baos.size() + dataSize > MAX_SIZE) {
currentXCoordinate = -1;
currentYCoordinate = -1;
throw new MaximumSizeExceededException();
@@ -335,7 +332,7 @@ public class PresentationTextData extends AbstractAFPObject {
/**
* Drawing of lines using the starting and ending coordinates, thickness and
* colour arguments.
- *
+ *
* @param x1
* The starting X coordinate.
* @param y1
@@ -350,9 +347,11 @@ public class PresentationTextData extends AbstractAFPObject {
* The orientation of the text data.
* @param col
* The text color.
+ * @throws MaximumSizeExceededException
+ * thrown if the maximum number of line data has been exceeded
*/
public void createLineData(int x1, int y1, int x2, int y2, int thickness,
- int orientation, Color col) throws MaximumSizeExceededException {
+ int orientation, Color col) throws MaximumSizeExceededException {
ByteArrayOutputStream afpdata = new ByteArrayOutputStream();
@@ -399,105 +398,103 @@ public class PresentationTextData extends AbstractAFPObject {
/**
* The Set Text Orientation control sequence establishes the I-direction and
* B-direction for the subsequent text. This is a modal control sequence.
- *
+ *
* Semantics: This control sequence specifies the I-axis and B-axis
* orientations with respect to the Xp-axis for the current Presentation
* Text object. The orientations are rotational values expressed in degrees
* and minutes.
- *
+ *
* @param orientation
- * The text orientation (0,90, 180, 270).
+ * The text orientation (0, 90, 180, 270).
* @param afpdata
* The output stream to which data should be written.
*/
- private void setTextOrientation(int orientation, ByteArrayOutputStream afpdata) {
- afpdata.write(new byte[] { 0x06, (byte) 0xF7, }, 0, 2);
+ private void setTextOrientation(int orientation,
+ ByteArrayOutputStream afpdata) {
+ afpdata.write(new byte[] {0x06, (byte) 0xF7, }, 0, 2);
switch (orientation) {
- case 90:
- afpdata.write(0x2D);
- afpdata.write(0x00);
- afpdata.write(0x5A);
- afpdata.write(0x00);
- break;
- case 180:
- afpdata.write(0x5A);
- afpdata.write(0x00);
- afpdata.write(0x87);
- afpdata.write(0x00);
- break;
- case 270:
- afpdata.write(0x87);
- afpdata.write(0x00);
- afpdata.write(0x00);
- afpdata.write(0x00);
- break;
- default:
- afpdata.write(0x00);
- afpdata.write(0x00);
- afpdata.write(0x2D);
- afpdata.write(0x00);
- break;
+ case 90:
+ afpdata.write(0x2D);
+ afpdata.write(0x00);
+ afpdata.write(0x5A);
+ afpdata.write(0x00);
+ break;
+ case 180:
+ afpdata.write(0x5A);
+ afpdata.write(0x00);
+ afpdata.write(0x87);
+ afpdata.write(0x00);
+ break;
+ case 270:
+ afpdata.write(0x87);
+ afpdata.write(0x00);
+ afpdata.write(0x00);
+ afpdata.write(0x00);
+ break;
+ default:
+ afpdata.write(0x00);
+ afpdata.write(0x00);
+ afpdata.write(0x2D);
+ afpdata.write(0x00);
+ break;
}
}
/**
* The Set Extended Text Color control sequence specifies a color value and
- * defines the color space and encoding for that value. The specified color
- * value is applied to foreground areas of the text presentation space.
- * This is a modal control sequence.
- *
+ * defines the color space and encoding for that value. The specified color
+ * value is applied to foreground areas of the text presentation space. This
+ * is a modal control sequence.
+ *
* @param col
* The color to be set.
* @param afpdata
* The output stream to which data should be written.
*/
- private void setExtendedTextColor(Color col,
- ByteArrayOutputStream afpdata) {
-
- afpdata.write(new byte[] {
- 15 // Control sequence length
- , (byte)0x81 // Control sequence function type
- , 0x00 // Reserved; must be zero
- , 0x01 // Color space - 0x01 = RGB
- , 0x00 // Reserved; must be zero
- , 0x00 // Reserved; must be zero
- , 0x00 // Reserved; must be zero
- , 0x00 // Reserved; must be zero
- , 8 // Number of bits in component 1
- , 8 // Number of bits in component 2
- , 8 // Number of bits in component 3
- , 0 // Number of bits in component 4
- , (byte)(col.getRed()) // Red intensity
- , (byte)(col.getGreen()) // Green intensity
- , (byte)(col.getBlue()) // Blue intensity
- }, 0, 15);
-
+ private void setExtendedTextColor(Color col, ByteArrayOutputStream afpdata) {
+ byte[] colorData = new byte[] {
+ 15, // Control sequence length
+ (byte) 0x81, // Control sequence function type
+ 0x00, // Reserved; must be zero
+ 0x01, // Color space - 0x01 = RGB
+ 0x00, // Reserved; must be zero
+ 0x00, // Reserved; must be zero
+ 0x00, // Reserved; must be zero
+ 0x00, // Reserved; must be zero
+ 8, // Number of bits in component 1
+ 8, // Number of bits in component 2
+ 8, // Number of bits in component 3
+ 0, // Number of bits in component 4
+ (byte) (col.getRed()), // Red intensity
+ (byte) (col.getGreen()), // Green intensity
+ (byte) (col.getBlue()), // Blue intensity
+ };
+
+ afpdata.write(colorData, 0, colorData.length);
}
/**
- * //TODO
- * This is a modal control sequence.
- *
+ * //TODO This is a modal control sequence.
+ *
* @param incr
* The increment to be set.
* @param afpdata
* The output stream to which data should be written.
*/
- private void setVariableSpaceCharacterIncrement(int incr, ByteArrayOutputStream afpdata) {
+ private void setVariableSpaceCharacterIncrement(int incr,
+ ByteArrayOutputStream afpdata) {
byte[] b = BinaryUtils.convert(incr, 2);
afpdata.write(new byte[] {
- 4 // Control sequence length
- , (byte)0xC5 // Control sequence function type
- , b[0]
- , b[1]
- }, 0, 4);
+ 4, // Control sequence length
+ (byte) 0xC5, // Control sequence function type
+ b[0], b[1] },
+ 0, 4);
}
/**
- * //TODO
- * This is a modal control sequence.
- *
+ * //TODO This is a modal control sequence.
+ *
* @param incr
* The increment to be set.
* @param afpdata
@@ -506,12 +503,10 @@ public class PresentationTextData extends AbstractAFPObject {
private void setInterCharacterAdjustment(int incr, ByteArrayOutputStream afpdata) {
byte[] b = BinaryUtils.convert(Math.abs(incr), 2);
afpdata.write(new byte[] {
- 5 // Control sequence length
- , (byte)0xC3 // Control sequence function type
- , b[0]
- , b[1]
- , (byte)(incr >= 0 ? 0 : 1) // Direction
- }, 0, 5);
+ 5, // Control sequence length
+ (byte) 0xC3, // Control sequence function type
+ b[0], b[1], (byte) (incr >= 0 ? 0 : 1) // Direction
+ }, 0, 5);
}
/**
@@ -531,8 +526,9 @@ public class PresentationTextData extends AbstractAFPObject {
* and zero or more parameters. The control sequence can extend multiple
* presentation text data objects, but must eventually be terminated. This
* method terminates the control sequence.
- *
+ *
* @throws MaximumSizeExceededException
+ * thrown in the event that maximum size has been exceeded
*/
public void endControlSequence() throws MaximumSizeExceededException {
byte[] data = new byte[2];
diff --git a/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java b/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java
index 3dda2006a..290a1e46a 100644
--- a/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java
+++ b/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java
@@ -24,6 +24,8 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
+import org.apache.fop.render.afp.AFPTextDataInfo;
+
/**
* The Presentation Text object is the data object used in document processing
* environments for representing text which has been prepared for presentation.
@@ -76,58 +78,18 @@ public class PresentationTextObject extends AbstractNamedAFPObject {
/**
* Create the presentation text data for the byte array of data.
*
- * @param fontNum
- * The font resource identifier.
- * @param x
- * The x coordinate for the text data.
- * @param y
- * The y coordinate for the text data.
- * @param col
- * The text color.
- * @param vsci
- * The variable space character increment.
- * @param ica
- * The inter character increment.
- * @param data
- * The text data to be created.
- */
- public void createTextData(int fontNum, int x, int y, Color col,
- int vsci, int ica, byte[] data) {
- // Use a default orientation of zero
- createTextData(fontNum, x, y, 0, col, vsci, ica, data);
- }
-
- /**
- * Create the presentation text data for the byte array of data.
- *
- * @param fontRef
- * The font resource identifier.
- * @param x
- * The x coordinate for the text data.
- * @param y
- * The y coordinate for the text data.
- * @param orientation
- * The orientation of the text data.
- * @param col
- * The text color.
- * @param vsci
- * The variable space character increment.
- * @param ica
- * The inter character adjustment.
- * @param data
- * The text data to be created.
+ * @param textDataInfo
+ * The afp text data
*/
- public void createTextData(int fontRef, int x, int y, int orientation,
- Color col, int vsci, int ica, byte[] data) {
+ public void createTextData(AFPTextDataInfo textDataInfo) {
if (currentPresentationTextData == null) {
startPresentationTextData();
}
try {
- currentPresentationTextData.createTextData(fontRef, x, y,
- orientation, col, vsci, ica, data);
+ currentPresentationTextData.createTextData(textDataInfo);
} catch (MaximumSizeExceededException msee) {
endPresentationTextData();
- createTextData(fontRef, x, y, orientation, col, vsci, ica, data);
+ createTextData(textDataInfo);
}
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index ff0e64806..c3e4a9657 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -112,6 +112,7 @@ import org.apache.fop.pdf.PDFTextUtil;
import org.apache.fop.pdf.PDFXMode;
import org.apache.fop.pdf.PDFXObject;
import org.apache.fop.render.AbstractPathOrientedRenderer;
+import org.apache.fop.render.AbstractState;
import org.apache.fop.render.Graphics2DAdapter;
import org.apache.fop.render.RendererContext;
import org.apache.fop.util.CharUtilities;
@@ -1094,7 +1095,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
*/
protected List breakOutOfStateStack() {
List breakOutList = new java.util.ArrayList();
- PDFState.Data data;
+ AbstractState.AbstractData data;
while (true) {
data = currentState.getData();
if (currentState.pop() == null) {
@@ -1115,10 +1116,10 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
*/
protected void restoreStateStackAfterBreakOut(List breakOutList) {
comment("------ restoring context after break-out...");
- PDFState.Data data;
+ AbstractState.AbstractData data;
Iterator i = breakOutList.iterator();
while (i.hasNext()) {
- data = (PDFState.Data)i.next();
+ data = (AbstractState.AbstractData)i.next();
saveGraphicsState();
AffineTransform at = data.getTransform();
concatenateTransformationMatrix(at);
--
cgit v1.2.3
From 030cd56ed235409e5fe6d2914d7224d9a58380c1 Mon Sep 17 00:00:00 2001
From: Adrian Cumiskey true
false
if SAX Locators should be disabled
*/
public void setLocatorEnabled(boolean enableLocator) {
diff --git a/src/java/org/apache/fop/apps/Fop.java b/src/java/org/apache/fop/apps/Fop.java
index d1a56789f..0527ea290 100644
--- a/src/java/org/apache/fop/apps/Fop.java
+++ b/src/java/org/apache/fop/apps/Fop.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,13 +30,13 @@ import org.apache.fop.fo.FOTreeBuilder;
* Primary class that activates the FOP process for embedded usage.
* * JAXP is the standard method of embedding FOP in Java programs. - * Please check our + * Please check our * embedding page - * for samples (these are also available within the distribution in + * for samples (these are also available within the distribution in * FOP_DIR\examples\embedding) *
* Methods within FOUserAgent are available to customize portions of the - * process. For example, a specific Renderer object can be specified, + * process. For example, a specific Renderer object can be specified, * also ElementMappings which determine elements in the FO that can be * processed) can be added. *
@@ -58,7 +58,7 @@ public class Fop {
private FOTreeBuilder foTreeBuilder = null;
/**
- * Constructor for use with already-created FOUserAgents. It uses MIME types to select the
+ * Constructor for use with already-created FOUserAgents. It uses MIME types to select the
* output format (ex. "application/pdf" for PDF).
* @param outputFormat the MIME type of the output format to use (ex. "application/pdf").
* @param ua FOUserAgent object
@@ -72,9 +72,9 @@ public class Fop {
if (foUserAgent == null) {
foUserAgent = FopFactory.newInstance().newFOUserAgent();
}
-
+
this.stream = stream;
-
+
createDefaultHandler();
}
@@ -119,7 +119,7 @@ public class Fop {
* page-sequence. Call this method only after the rendering process is
* finished. Note that the results are only available for output formats
* which make use of FOP's layout engine (PDF, PS, etc.).
- * @return the results of the rendering process, or null for flow-oriented
+ * @return the results of the rendering process, or null for flow-oriented
* output formats like RTF and MIF.
*/
public FormattingResults getResults() {
diff --git a/src/java/org/apache/fop/apps/FopFactory.java b/src/java/org/apache/fop/apps/FopFactory.java
index 2d4029da8..883afdcfa 100644
--- a/src/java/org/apache/fop/apps/FopFactory.java
+++ b/src/java/org/apache/fop/apps/FopFactory.java
@@ -537,7 +537,7 @@ public class FopFactory implements ImageContext {
/**
* Gets the default page-height to use as fallback,
* in case page-height="auto"
- *
+ *
* @return the page-height, as a String
*/
public String getPageHeight() {
@@ -547,7 +547,7 @@ public class FopFactory implements ImageContext {
/**
* Sets the page-height to use as fallback, in case
* page-height="auto"
- *
+ *
* @param pageHeight page-height as a String
*/
public void setPageHeight(String pageHeight) {
@@ -560,7 +560,7 @@ public class FopFactory implements ImageContext {
/**
* Gets the default page-width to use as fallback,
* in case page-width="auto"
- *
+ *
* @return the page-width, as a String
*/
public String getPageWidth() {
@@ -570,7 +570,7 @@ public class FopFactory implements ImageContext {
/**
* Sets the page-width to use as fallback, in case
* page-width="auto"
- *
+ *
* @param pageWidth page-width as a String
*/
public void setPageWidth(String pageWidth) {
@@ -729,13 +729,13 @@ public class FopFactory implements ImageContext {
/**
* Create (if needed) and return an ICC ColorSpace instance.
- *
+ *
* The ICC profile source is taken from the src attribute of the color-profile FO element.
* If the ICC ColorSpace is not yet in the cache a new one is created and stored in the cache.
- *
+ *
* The FOP URI resolver is used to try and locate the ICC file.
* If that fails null is returned.
- *
+ *
* @param baseUri a base URI to resolve relative URIs
* @param iccProfileSrc ICC Profile source to return a ColorSpace for
* @return ICC ColorSpace object or null if ColorSpace could not be created
diff --git a/src/java/org/apache/fop/apps/FopFactoryConfigurator.java b/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
index ffcc1332b..e71173845 100644
--- a/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
+++ b/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/apps/FormattingResults.java b/src/java/org/apache/fop/apps/FormattingResults.java
index af421f4ac..0c0cddcc6 100644
--- a/src/java/org/apache/fop/apps/FormattingResults.java
+++ b/src/java/org/apache/fop/apps/FormattingResults.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/apps/PageSequenceResults.java b/src/java/org/apache/fop/apps/PageSequenceResults.java
index 16c74f66b..241f4a5f9 100644
--- a/src/java/org/apache/fop/apps/PageSequenceResults.java
+++ b/src/java/org/apache/fop/apps/PageSequenceResults.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/area/AbstractOffDocumentItem.java b/src/java/org/apache/fop/area/AbstractOffDocumentItem.java
index 94cfa9e09..bdec281d4 100644
--- a/src/java/org/apache/fop/area/AbstractOffDocumentItem.java
+++ b/src/java/org/apache/fop/area/AbstractOffDocumentItem.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
/**
@@ -51,10 +51,10 @@ public abstract class AbstractOffDocumentItem implements OffDocumentItem {
*/
public static final int START_OF_DOC = 2;
-
+
/** Indicates in what phase the item should be processed. */
protected int whenToProcess = IMMEDIATELY;
-
+
/**
* Get an indicator of when this item should be processed
* @return int constant (IMMEDIATELY, AFTER_PAGE, START_OF_DOC, END_OF_DOC)
diff --git a/src/java/org/apache/fop/area/Area.java b/src/java/org/apache/fop/area/Area.java
index ab9590685..87ba2146a 100644
--- a/src/java/org/apache/fop/area/Area.java
+++ b/src/java/org/apache/fop/area/Area.java
@@ -167,9 +167,9 @@ public class Area extends AreaTreeObject implements Serializable {
}
/**
- * Get the inline progression dimension of the content rectangle
+ * Get the inline progression dimension of the content rectangle
* for this area.
- *
+ *
* @return the inline progression dimension
* @see ipd
*/
@@ -218,7 +218,7 @@ public class Area extends AreaTreeObject implements Serializable {
* @return the total BPD allocation for this area
*/
public int getAllocBPD() {
- return getSpaceBefore() + getBorderAndPaddingWidthBefore() + getBPD()
+ return getSpaceBefore() + getBorderAndPaddingWidthBefore() + getBPD()
+ getBorderAndPaddingWidthAfter() + getSpaceAfter();
}
@@ -233,7 +233,7 @@ public class Area extends AreaTreeObject implements Serializable {
if (bps != null) {
margin = bps.width;
}
-
+
Integer padWidth = (Integer) getTrait(Trait.PADDING_BEFORE);
if (padWidth != null) {
margin += padWidth.intValue();
@@ -241,7 +241,7 @@ public class Area extends AreaTreeObject implements Serializable {
return margin;
}
-
+
/**
* Return the sum of region border- and padding-after
*
@@ -249,12 +249,12 @@ public class Area extends AreaTreeObject implements Serializable {
*/
public int getBorderAndPaddingWidthAfter() {
int margin = 0;
-
+
BorderProps bps = (BorderProps) getTrait(Trait.BORDER_AFTER);
if (bps != null) {
margin = bps.width;
}
-
+
Integer padWidth = (Integer) getTrait(Trait.PADDING_AFTER);
if (padWidth != null) {
margin += padWidth.intValue();
@@ -274,7 +274,7 @@ public class Area extends AreaTreeObject implements Serializable {
if (bps != null) {
margin = bps.width;
}
-
+
Integer padWidth = (Integer) getTrait(Trait.PADDING_START);
if (padWidth != null) {
margin += padWidth.intValue();
@@ -294,7 +294,7 @@ public class Area extends AreaTreeObject implements Serializable {
if (bps != null) {
margin = bps.width;
}
-
+
Integer padWidth = (Integer) getTrait(Trait.PADDING_END);
if (padWidth != null) {
margin += padWidth.intValue();
@@ -316,7 +316,7 @@ public class Area extends AreaTreeObject implements Serializable {
}
return margin;
}
-
+
/**
* Returns the space after
*
@@ -330,7 +330,7 @@ public class Area extends AreaTreeObject implements Serializable {
}
return margin;
}
-
+
/**
* Returns the space start
*
@@ -344,7 +344,7 @@ public class Area extends AreaTreeObject implements Serializable {
}
return margin;
}
-
+
/**
* Returns the space end
*
@@ -358,7 +358,7 @@ public class Area extends AreaTreeObject implements Serializable {
}
return margin;
}
-
+
/**
* Add a child to this area.
* The default is to do nothing. Subclasses must override
@@ -395,7 +395,7 @@ public class Area extends AreaTreeObject implements Serializable {
public boolean hasTraits() {
return (this.props != null);
}
-
+
/**
* Get a trait from this area.
*
@@ -405,7 +405,7 @@ public class Area extends AreaTreeObject implements Serializable {
public Object getTrait(Object oTraitCode) {
return (props != null ? props.get(oTraitCode) : null);
}
-
+
/**
* Checks whether a certain trait is set on this area.
* @param oTraitCode the trait key
@@ -414,7 +414,7 @@ public class Area extends AreaTreeObject implements Serializable {
public boolean hasTrait(Object oTraitCode) {
return (getTrait(oTraitCode) != null);
}
-
+
/**
* Get a boolean trait from this area.
* @param oTraitCode the trait key
@@ -440,10 +440,10 @@ public class Area extends AreaTreeObject implements Serializable {
+ " could not be converted to an integer");
}
}
-
+
/**
* {@inheritDoc}
- * @return ipd and bpd of area
+ * @return ipd and bpd of area
* */
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
diff --git a/src/java/org/apache/fop/area/AreaEventProducer.java b/src/java/org/apache/fop/area/AreaEventProducer.java
index 7747d2d79..325367199 100644
--- a/src/java/org/apache/fop/area/AreaEventProducer.java
+++ b/src/java/org/apache/fop/area/AreaEventProducer.java
@@ -31,7 +31,7 @@ public interface AreaEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -51,7 +51,7 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity WARN
*/
void unresolvedIDReference(Object source, String type, String id);
-
+
/**
* An unresolved ID reference was encountered on a page.
* @param source the event source
@@ -60,7 +60,7 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity WARN
*/
void unresolvedIDReferenceOnPage(Object source, String page, String id);
-
+
/**
* A page could not be loaded/deserialized from a file.
* @param source the event source
@@ -69,7 +69,7 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity ERROR
*/
void pageLoadError(Object source, String page, Exception e);
-
+
/**
* A page could not be saved/serialized to a file.
* @param source the event source
@@ -78,7 +78,7 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity ERROR
*/
void pageSaveError(Object source, String page, Exception e);
-
+
/**
* A page could not be rendered.
* @param source the event source
@@ -87,5 +87,5 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity ERROR
*/
void pageRenderingError(Object source, String page, Exception e);
-
+
}
diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java
index 3c89fd3d9..128fc8ce9 100644
--- a/src/java/org/apache/fop/area/AreaTreeHandler.java
+++ b/src/java/org/apache/fop/area/AreaTreeHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -49,7 +49,7 @@ import org.apache.fop.layoutmgr.TopLevelLayoutManager;
/**
* Area tree handler for formatting objects.
- *
+ *
* Concepts: The area tree is to be as small as possible. With minimal classes
* and data to fully represent an area tree for formatting objects. The area
* tree needs to be simple to render and follow the spec closely. This area tree
@@ -61,7 +61,7 @@ import org.apache.fop.layoutmgr.TopLevelLayoutManager;
* type of renderer.
*/
public class AreaTreeHandler extends FOEventHandler {
-
+
private static Log log = LogFactory.getLog(AreaTreeHandler.class);
// Recorder of debug statistics
@@ -78,7 +78,7 @@ public class AreaTreeHandler extends FOEventHandler {
// The fo:root node of the document
private Root rootFObj;
-
+
// The formatting results to be handed back to the caller.
private FormattingResults results = new FormattingResults();
@@ -88,7 +88,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Constructor.
- *
+ *
* @param userAgent FOUserAgent object for process
* @param outputFormat the MIME type of the output format to use (ex.
* "application/pdf").
@@ -107,7 +107,7 @@ public class AreaTreeHandler extends FOEventHandler {
}
this.idTracker = new IDTracker();
-
+
if (log.isDebugEnabled()) {
statistics = new Statistics();
}
@@ -115,7 +115,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Sets up the AreaTreeModel instance for use by the AreaTreeHandler.
- *
+ *
* @param userAgent FOUserAgent object for process
* @param outputFormat the MIME type of the output format to use (ex.
* "application/pdf").
@@ -129,7 +129,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get the area tree model for this area tree.
- *
+ *
* @return AreaTreeModel the model being used for this area tree
*/
public AreaTreeModel getAreaTreeModel() {
@@ -138,7 +138,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get the LayoutManager maker for this area tree.
- *
+ *
* @return LayoutManagerMaker the LayoutManager maker being used for this
* area tree
*/
@@ -148,7 +148,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get the IDTracker for this area tree.
- *
+ *
* @return IDTracker used to track reference ids for items in this area tree
*/
public IDTracker getIDTracker() {
@@ -157,7 +157,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get information about the rendered output, like number of pages created.
- *
+ *
* @return the results structure
*/
public FormattingResults getResults() {
@@ -167,7 +167,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Prepare AreaTreeHandler for document processing This is called from
* FOTreeBuilder.startDocument()
- *
+ *
* @throws SAXException
* if there is an error
*/
@@ -193,7 +193,7 @@ public class AreaTreeHandler extends FOEventHandler {
public void startPageSequence(PageSequence pageSequence) {
startAbstractPageSequence(pageSequence);
}
-
+
private void startAbstractPageSequence(AbstractPageSequence pageSequence) {
rootFObj = pageSequence.getRoot();
finishPrevPageSequence(pageSequence.getInitialPageNumber());
@@ -217,7 +217,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* End the PageSequence. The PageSequence formats Pages and adds them to the
* AreaTree. The area tree then handles what happens with the pages.
- *
+ *
* @param pageSequence the page sequence ending
*/
public void endPageSequence(PageSequence pageSequence) {
@@ -248,20 +248,20 @@ public class AreaTreeHandler extends FOEventHandler {
if (statistics != null) {
statistics.end();
}
-
+
ExternalDocumentLayoutManager edLM;
edLM = getLayoutManagerMaker().makeExternalDocumentLayoutManager(this, document);
edLM.activateLayout();
// preserve the current PageSequenceLayoutManger for the
// force-page-count check at the beginning of the next PageSequence
prevPageSeqLM = edLM;
-
+
}
/**
* Called by the PageSequenceLayoutManager when it is finished with a
* page-sequence.
- *
+ *
* @param pageSequence the page-sequence just finished
* @param pageCount The number of pages generated for the page-sequence
*/
@@ -275,7 +275,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* End the document.
- *
+ *
* @throws SAXException if there is some error
*/
public void endDocument() throws SAXException {
@@ -313,7 +313,7 @@ public class AreaTreeHandler extends FOEventHandler {
* Add a OffDocumentItem to the area tree model. This checks if the
* OffDocumentItem is resolvable and attempts to resolve or add the
* resolvable ids for later resolution.
- *
+ *
* @param odi the OffDocumentItem to add.
*/
private void addOffDocumentItem(OffDocumentItem odi) {
@@ -342,7 +342,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Generates and returns a unique key for a page viewport.
- *
+ *
* @return the generated key.
*/
public String generatePageViewportKey() {
@@ -354,7 +354,7 @@ public class AreaTreeHandler extends FOEventHandler {
* Tie a PageViewport with an ID found on a child area of the PV. Note that
* an area with a given ID may be on more than one PV, hence an ID may have
* more than one PV associated with it.
- *
+ *
* @param id the property ID of the area
* @param pv a page viewport that contains the area with this ID
* @deprecated use getIDTracker().associateIDWithPageViewport(id, pv) instead
@@ -367,7 +367,7 @@ public class AreaTreeHandler extends FOEventHandler {
* This method tie an ID to the areaTreeHandler until this one is ready to
* be processed. This is used in page-number-citation-last processing so we
* know when an id can be resolved.
- *
+ *
* @param id the id of the object being processed
* @deprecated use getIDTracker().signalPendingID(id) instead
*/
@@ -379,7 +379,7 @@ public class AreaTreeHandler extends FOEventHandler {
* Signals that all areas for the formatting object with the given ID have
* been generated. This is used to determine when page-number-citation-last
* ref-ids can be resolved.
- *
+ *
* @param id the id of the formatting object which was just finished
* @deprecated use getIDTracker().signalIDProcessed(id) instead
*/
@@ -389,7 +389,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Check if an ID has already been resolved
- *
+ *
* @param id the id to check
* @return true if the ID has been resolved
* @deprecated use getIDTracker().alreadyResolvedID(id) instead
@@ -400,7 +400,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Tries to resolve all unresolved ID references on the given page.
- *
+ *
* @param pv page viewport whose ID refs to resolve
* @deprecated use getIDTracker().tryIDResolution(pv) instead
*/
@@ -410,7 +410,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get the list of page viewports that have an area with a given id.
- *
+ *
* @param id the id to lookup
* @return the list of PageViewports
* @deprecated use getIDTracker().getPageViewportsContainingID(id) instead
@@ -421,7 +421,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Add an Resolvable object with an unresolved idref
- *
+ *
* @param idref the idref whose target id has not yet been located
* @param res the Resolvable object needing the idref to be resolved
* @deprecated use getIDTracker().addUnresolvedIDRef(idref, res) instead
@@ -429,7 +429,7 @@ public class AreaTreeHandler extends FOEventHandler {
public void addUnresolvedIDRef(String idref, Resolvable res) {
idTracker.addUnresolvedIDRef(idref, res);
}
-
+
private class Statistics {
// for statistics gathering
private Runtime runtime;
diff --git a/src/java/org/apache/fop/area/AreaTreeModel.java b/src/java/org/apache/fop/area/AreaTreeModel.java
index 544ff612a..e5f6db17b 100644
--- a/src/java/org/apache/fop/area/AreaTreeModel.java
+++ b/src/java/org/apache/fop/area/AreaTreeModel.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
// Java
@@ -80,7 +80,7 @@ public class AreaTreeModel {
}
/**
- * Handle an OffDocumentItem
+ * Handle an OffDocumentItem
* @param ext the extension to handle
*/
public void handleOffDocumentItem(OffDocumentItem ext) { };
@@ -98,7 +98,7 @@ public class AreaTreeModel {
public PageSequence getCurrentPageSequence() {
return this.currentPageSequence;
}
-
+
/**
* Get the page sequence count.
* @return the number of page sequences in the document.
diff --git a/src/java/org/apache/fop/area/AreaTreeObject.java b/src/java/org/apache/fop/area/AreaTreeObject.java
index 7fa30aee9..5929e7c4e 100644
--- a/src/java/org/apache/fop/area/AreaTreeObject.java
+++ b/src/java/org/apache/fop/area/AreaTreeObject.java
@@ -33,7 +33,7 @@ public abstract class AreaTreeObject {
/** Foreign attributes */
protected Map foreignAttributes = null;
-
+
/** Extension attachments */
protected List/*
* To support relative numerics internally in the expresion parser and
- * during evaulation one additional methods exists: isAbsolute() which
+ * during evaulation one additional methods exists: isAbsolute() which
* return true for absolute numerics and false for relative numerics.
*/
public interface Numeric {
@@ -40,7 +40,7 @@ public interface Numeric {
* @throws PropertyException
*/
double getNumericValue() throws PropertyException;
-
+
/**
* Return the value of this Numeric
* @param context The context for the length calculation (for percentage based lengths)
@@ -78,10 +78,10 @@ public interface Numeric {
public int getValue(PercentBaseContext context);
/**
- * Return the resolved value. This method will becalled during evaluation
- * of the expression tree and relative numerics can then return a
+ * Return the resolved value. This method will becalled during evaluation
+ * of the expression tree and relative numerics can then return a
* resolved absolute Numeric. Absolute numerics can just return themself.
- *
+ *
* @return A resolved value.
* @throws PropertyException
*/
diff --git a/src/java/org/apache/fop/datatypes/PercentBase.java b/src/java/org/apache/fop/datatypes/PercentBase.java
index 6452086de..6bc9ac939 100644
--- a/src/java/org/apache/fop/datatypes/PercentBase.java
+++ b/src/java/org/apache/fop/datatypes/PercentBase.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,28 +26,28 @@ import org.apache.fop.fo.expr.PropertyException;
* computations
*/
public interface PercentBase {
-
+
/**
* Determines whether a numeric property is created or one with a percentage
* base.
* @return 0 for length, 1 for percentage
*/
int getDimension();
-
+
/**
- * @return the base value (this will be used as the base to which a percentage will be
+ * @return the base value (this will be used as the base to which a percentage will be
* applied to compute the length of the referencing item)
*/
double getBaseValue();
/**
* @param context The context for percentage evaluation
- * @return the integer size in millipoints of the object (this will be used
- * as the base to which a percentage will be applied to compute the length
+ * @return the integer size in millipoints of the object (this will be used
+ * as the base to which a percentage will be applied to compute the length
* of the referencing item)
* @throws PropertyException if a problem occurs during evaluation of this
* value.
*/
int getBaseLength(PercentBaseContext context) throws PropertyException;
-
+
}
diff --git a/src/java/org/apache/fop/datatypes/PercentBaseContext.java b/src/java/org/apache/fop/datatypes/PercentBaseContext.java
index bf01482f0..9744f417e 100644
--- a/src/java/org/apache/fop/datatypes/PercentBaseContext.java
+++ b/src/java/org/apache/fop/datatypes/PercentBaseContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id $ */
-
+
package org.apache.fop.datatypes;
import org.apache.fop.fo.FObj;
@@ -37,5 +37,5 @@ public interface PercentBaseContext {
* @return The base length value of the given kind
*/
public int getBaseLength(int lengthBase, FObj fobj);
-
+
}
diff --git a/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java b/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
index 3b3c87525..271702f4e 100644
--- a/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
+++ b/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,14 +25,14 @@ import org.apache.fop.fo.FObj;
* Class to implement a simple lookup context for a single percent base value.
*/
public class SimplePercentBaseContext implements PercentBaseContext {
-
+
private PercentBaseContext parentContext;
private int lengthBase;
private int lengthBaseValue;
/**
* @param parentContext the context to be used for all percentages other than lengthBase
- * @param lengthBase the particular percentage length base for which this context provides
+ * @param lengthBase the particular percentage length base for which this context provides
* a value
* @param lengthBaseValue the value to be returned for requests to the given lengthBase
*/
@@ -46,7 +46,7 @@ public class SimplePercentBaseContext implements PercentBaseContext {
/**
* Returns the value for the given lengthBase.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int getBaseLength(int lengthBase, FObj fobj) {
// if its for us return our value otherwise delegate to parent context
diff --git a/src/java/org/apache/fop/datatypes/URISpecification.java b/src/java/org/apache/fop/datatypes/URISpecification.java
index 99d445b4d..9311851ea 100644
--- a/src/java/org/apache/fop/datatypes/URISpecification.java
+++ b/src/java/org/apache/fop/datatypes/URISpecification.java
@@ -57,19 +57,19 @@ public class URISpecification {
private static final String PUNCT = ",;:$&+=";
private static final String RESERVED = PUNCT + "?/[]@";
-
+
private static boolean isValidURIChar(char ch) {
return true;
}
-
+
private static boolean isDigit(char ch) {
return (ch >= '0' && ch <= '9');
}
-
+
private static boolean isAlpha(char ch) {
return (ch >= 'A' && ch <= 'Z') || (ch >= 'A' && ch <= 'z');
}
-
+
private static boolean isHexDigit(char ch) {
return (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f');
}
@@ -83,7 +83,7 @@ public class URISpecification {
}
return false;
}
-
+
private static boolean isUnreserved(char ch) {
if (isDigit(ch) || isAlpha(ch)) {
return true;
@@ -93,7 +93,7 @@ public class URISpecification {
}
return false;
}
-
+
private final static char[] HEX_DIGITS = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
@@ -137,5 +137,5 @@ public class URISpecification {
}
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java b/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java
index 6301c4d85..dba6d89ff 100644
--- a/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java
+++ b/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,11 +26,11 @@ import org.apache.fop.fo.FObj;
* but should still already be checked. The actual value returned is not so important in this
* case. But it's important that zero and non-zero values can be distinguished.
*
- * Example: A table with collapsing border model has no padding. The Table FO should be able
+ * Example: A table with collapsing border model has no padding. The Table FO should be able
* to check if non-zero values (even percentages) have been specified.
*/
public final class ValidationPercentBaseContext implements PercentBaseContext {
-
+
/**
* Main constructor.
*/
@@ -39,7 +39,7 @@ public final class ValidationPercentBaseContext implements PercentBaseContext {
/**
* Returns the value for the given lengthBase.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int getBaseLength(int lengthBase, FObj fobj) {
//Simply return a dummy value which produces a non-zero value when a non-zero percentage
@@ -48,7 +48,7 @@ public final class ValidationPercentBaseContext implements PercentBaseContext {
}
private static PercentBaseContext pseudoContextForValidation = null;
-
+
/** @return a base context for validation purposes. See class description. */
public static PercentBaseContext getPseudoContext() {
if (pseudoContextForValidation == null) {
@@ -56,5 +56,5 @@ public final class ValidationPercentBaseContext implements PercentBaseContext {
}
return pseudoContextForValidation;
}
-
+
}
diff --git a/src/java/org/apache/fop/events/CompositeEventListener.java b/src/java/org/apache/fop/events/CompositeEventListener.java
index a65728b71..2b5cbffb2 100644
--- a/src/java/org/apache/fop/events/CompositeEventListener.java
+++ b/src/java/org/apache/fop/events/CompositeEventListener.java
@@ -27,7 +27,7 @@ import java.util.List;
public class CompositeEventListener implements EventListener {
private List listeners = new java.util.ArrayList();
-
+
/**
* Adds an event listener to the broadcaster. It is appended to the list of previously
* registered listeners (the order of registration defines the calling order).
@@ -49,7 +49,7 @@ public class CompositeEventListener implements EventListener {
private synchronized int getListenerCount() {
return this.listeners.size();
}
-
+
/**
* Indicates whether any listeners have been registered with the broadcaster.
* @return true if listeners are present, false otherwise
@@ -57,7 +57,7 @@ public class CompositeEventListener implements EventListener {
public boolean hasEventListeners() {
return (getListenerCount() > 0);
}
-
+
/** {@inheritDoc} */
public synchronized void processEvent(Event event) {
for (int i = 0, c = getListenerCount(); i < c; i++) {
diff --git a/src/java/org/apache/fop/events/DefaultEventBroadcaster.java b/src/java/org/apache/fop/events/DefaultEventBroadcaster.java
index bb1752a72..cd415a8d7 100644
--- a/src/java/org/apache/fop/events/DefaultEventBroadcaster.java
+++ b/src/java/org/apache/fop/events/DefaultEventBroadcaster.java
@@ -42,7 +42,7 @@ public class DefaultEventBroadcaster implements EventBroadcaster {
/** Holds all registered event listeners */
protected CompositeEventListener listeners = new CompositeEventListener();
-
+
/** {@inheritDoc} */
public void addEventListener(EventListener listener) {
this.listeners.addEventListener(listener);
@@ -57,7 +57,7 @@ public class DefaultEventBroadcaster implements EventBroadcaster {
public boolean hasEventListeners() {
return this.listeners.hasEventListeners();
}
-
+
/** {@inheritDoc} */
public void broadcastEvent(Event event) {
this.listeners.processEvent(event);
@@ -65,7 +65,7 @@ public class DefaultEventBroadcaster implements EventBroadcaster {
private static List/* Note: this works only after getNextKuthElements on the
* corresponding TableCellLM have been called! Note: this works only after getNextKuthElements on the
* corresponding TableCellLM have been called! If the source does contain explicit fo:table-row elements, then the
* {@link #endTableRow()} method will be called instead.
- * The set of active nodes can be traversed by
+ * The set of active nodes can be traversed by
*
@@ -60,7 +60,7 @@ public class KeepUtil {
getKeepStrength(keep.getWithinPage()),
getKeepStrength(keep.getWithinColumn()));
}
-
+
/**
* Indicates whether a keep strength indicates a keep constraint.
* @param strength the keep strength
@@ -69,7 +69,7 @@ public class KeepUtil {
public static boolean hasKeep(int strength) {
return strength > BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
/**
* Returns the penalty value to be used for a certain keep strength.
* Additional functionality makes sure that surplus instances that are requested by the
* page breaker are properly discarded, especially in situations where hard breaks cause
- * blank pages. The reason for that: The page breaker sometimes needs to preallocate
+ * blank pages. The reason for that: The page breaker sometimes needs to preallocate
* additional pages since it doesn't know exactly until the end how many pages it really needs.
* Note: The area's IPD and BPD must be set before calling this method. TODO the regular
* {@link #addBackground(Area, CommonBorderPaddingBackground, PercentBaseContext)}
* method should be used instead, and a means to retrieve the original area's
* dimensions must be found. TODO the placement of images in the x- or y-direction will be incorrect if
* background-repeat is set for that direction. In the collapsing-border model, the borders of a cell that spans over several
* rows or columns are drawn separately for each grid unit. Therefore we must know the
* height of each grid row spanned over by the cell. Also, if the cell is broken over
* two pages we must know which spanned grid rows are present on the current page.FOTreeBuilder
constructor
- *
+ *
* @param outputFormat the MIME type of the output format to use (ex. "application/pdf").
* @param foUserAgent the {@link FOUserAgent} in effect for this process
* @param stream the OutputStream
to direct the results to
* @throws FOPException if the FOTreeBuilder
cannot be properly created
*/
public FOTreeBuilder(
- String outputFormat,
+ String outputFormat,
FOUserAgent foUserAgent,
- OutputStream stream)
+ OutputStream stream)
throws FOPException {
this.userAgent = foUserAgent;
- this.elementMappingRegistry = userAgent.getFactory().getElementMappingRegistry();
+ this.elementMappingRegistry = userAgent.getFactory().getElementMappingRegistry();
//This creates either an AreaTreeHandler and ultimately a Renderer, or
//one of the RTF-, MIF- etc. Handlers.
foEventHandler = foUserAgent.getRendererFactory().createFOEventHandler(
@@ -116,16 +116,16 @@ public class FOTreeBuilder extends DefaultHandler {
public void setDocumentLocator(Locator locator) {
this.locator = locator;
}
-
- /**
+
+ /**
* @return a {@link Locator} instance if it is available and not disabled
*/
protected Locator getEffectiveLocator() {
return (userAgent.isLocatorEnabled() ? this.locator : null);
}
-
+
/** {@inheritDoc} */
- public void characters(char[] data, int start, int length)
+ public void characters(char[] data, int start, int length)
throws SAXException {
delegate.characters(data, start, length);
}
@@ -136,7 +136,7 @@ public class FOTreeBuilder extends DefaultHandler {
throw new IllegalStateException("FOTreeBuilder (and the Fop class) cannot be reused."
+ " Please instantiate a new instance.");
}
-
+
used = true;
empty = true;
rootFObj = null; // allows FOTreeBuilder to be reused
@@ -204,7 +204,7 @@ public class FOTreeBuilder extends DefaultHandler {
/**
* Provides access to the underlying {@link FOEventHandler} object.
- *
+ *
* @return the FOEventHandler object
*/
public FOEventHandler getEventHandler() {
@@ -215,30 +215,30 @@ public class FOTreeBuilder extends DefaultHandler {
* Returns the results of the rendering process. Information includes
* the total number of pages generated and the number of pages per
* page-sequence.
- *
+ *
* @return the results of the rendering process.
*/
public FormattingResults getResults() {
if (getEventHandler() instanceof AreaTreeHandler) {
return ((AreaTreeHandler) getEventHandler()).getResults();
} else {
- //No formatting results available for output formats no
+ //No formatting results available for output formats no
//involving the layout engine.
return null;
}
}
-
+
/**
* Main DefaultHandler
implementation which builds the FO tree.
*/
private class MainFOHandler extends DefaultHandler {
-
+
/** Current formatting object being handled */
protected FONode currentFObj = null;
/** Current propertyList for the node being handled */
protected PropertyList currentPropertyList;
-
+
/** Current marker nesting-depth */
private int nestedMarkerDepth = 0;
@@ -253,7 +253,7 @@ public class FOTreeBuilder extends DefaultHandler {
// Check to ensure first node encountered is an fo:root
if (rootFObj == null) {
empty = false;
- if (!namespaceURI.equals(FOElementMapping.URI)
+ if (!namespaceURI.equals(FOElementMapping.URI)
|| !localName.equals("root")) {
FOValidationEventProducer eventProducer
= FOValidationEventProducer.Provider.get(
@@ -267,7 +267,7 @@ public class FOTreeBuilder extends DefaultHandler {
currentFObj.validateChildNode(locator, namespaceURI, localName);
}
}
-
+
ElementMapping.Maker fobjMaker = findFOMaker(namespaceURI, localName);
try {
@@ -279,7 +279,7 @@ public class FOTreeBuilder extends DefaultHandler {
}
propertyList = foNode.createPropertyList(
currentPropertyList, foEventHandler);
- foNode.processNode(localName, getEffectiveLocator(),
+ foNode.processNode(localName, getEffectiveLocator(),
attlist, propertyList);
if (foNode.getNameId() == Constants.FO_MARKER) {
if (builderContext.inMarker()) {
@@ -295,19 +295,19 @@ public class FOTreeBuilder extends DefaultHandler {
ContentHandlerFactory chFactory = foNode.getContentHandlerFactory();
if (chFactory != null) {
ContentHandler subHandler = chFactory.createContentHandler();
- if (subHandler instanceof ObjectSource
+ if (subHandler instanceof ObjectSource
&& foNode instanceof ObjectBuiltListener) {
((ObjectSource) subHandler).setObjectBuiltListener(
(ObjectBuiltListener) foNode);
}
-
+
subHandler.startDocument();
- subHandler.startElement(namespaceURI, localName,
+ subHandler.startElement(namespaceURI, localName,
rawName, attlist);
depth = 1;
delegate = subHandler;
}
-
+
if (currentFObj != null) {
currentFObj.addChildNode(foNode);
}
@@ -330,28 +330,28 @@ public class FOTreeBuilder extends DefaultHandler {
throws SAXException {
if (currentFObj == null) {
throw new SAXException(
- "endElement() called for " + rawName
+ "endElement() called for " + rawName
+ " where there is no current element.");
- } else if (!currentFObj.getLocalName().equals(localName)
+ } else if (!currentFObj.getLocalName().equals(localName)
|| !currentFObj.getNamespaceURI().equals(uri)) {
- throw new SAXException("Mismatch: " + currentFObj.getLocalName()
- + " (" + currentFObj.getNamespaceURI()
+ throw new SAXException("Mismatch: " + currentFObj.getLocalName()
+ + " (" + currentFObj.getNamespaceURI()
+ ") vs. " + localName + " (" + uri + ")");
}
-
+
// fo:characters can potentially be removed during
// white-space handling.
// Do not notify the FOEventHandler.
if (currentFObj.getNameId() != Constants.FO_CHARACTER) {
currentFObj.endOfNode();
}
-
+
if (currentPropertyList != null
&& currentPropertyList.getFObj() == currentFObj
&& !builderContext.inMarker()) {
currentPropertyList = currentPropertyList.getParentPropertyList();
}
-
+
if (currentFObj.getNameId() == Constants.FO_MARKER) {
if (nestedMarkerDepth == 0) {
builderContext.switchMarkerContext(false);
@@ -359,19 +359,19 @@ public class FOTreeBuilder extends DefaultHandler {
nestedMarkerDepth--;
}
}
-
+
if (currentFObj.getParent() == null) {
log.debug("endElement for top-level " + currentFObj.getName());
}
-
+
currentFObj = currentFObj.getParent();
}
/** {@inheritDoc} */
- public void characters(char[] data, int start, int length)
+ public void characters(char[] data, int start, int length)
throws FOPException {
if (currentFObj != null) {
- currentFObj.addCharacters(data, start, length,
+ currentFObj.addCharacters(data, start, length,
currentPropertyList, getEffectiveLocator());
}
}
@@ -380,10 +380,10 @@ public class FOTreeBuilder extends DefaultHandler {
public void endDocument() throws SAXException {
currentFObj = null;
}
-
+
/**
* Finds the {@link Maker} used to create {@link FONode} objects of a particular type
- *
+ *
* @param namespaceURI URI for the namespace of the element
* @param localName name of the Element
* @return the ElementMapping.Maker that can create an FO object for this element
diff --git a/src/java/org/apache/fop/fo/FOTreeBuilderContext.java b/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
index 0cbdd7797..870b2b599 100644
--- a/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
+++ b/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ public class FOTreeBuilderContext {
* This is used so we know if the FO tree contains duplicates.
*/
private Set idReferences = new HashSet();
-
+
/**
* The property list maker.
*/
@@ -42,12 +42,12 @@ public class FOTreeBuilderContext {
* The XMLWhitespaceHandler for this tree
*/
protected XMLWhiteSpaceHandler whiteSpaceHandler = new XMLWhiteSpaceHandler();
-
+
/**
* Indicates whether processing descendants of a marker
*/
private boolean inMarker = false;
-
+
/**
* Returns the set of ID references.
* @return the ID references
@@ -58,22 +58,22 @@ public class FOTreeBuilderContext {
/**
* Return the propertyListMaker.
- *
+ *
* @return the currently active {@link PropertyListMaker}
*/
public PropertyListMaker getPropertyListMaker() {
return propertyListMaker;
}
-
+
/**
* Set a new propertyListMaker.
- *
+ *
* @param propertyListMaker the new {@link PropertyListMaker} to use
*/
public void setPropertyListMaker(PropertyListMaker propertyListMaker) {
this.propertyListMaker = propertyListMaker;
}
-
+
/**
* Return the XMLWhiteSpaceHandler
* @return the whiteSpaceHandler
@@ -86,22 +86,22 @@ public class FOTreeBuilderContext {
* Switch to or from marker context
* (used by FOTreeBuilder when processing
* a marker)
- *
- * @param inMarker true if a marker is being processed;
+ *
+ * @param inMarker true if a marker is being processed;
* false otherwise
*
*/
protected void switchMarkerContext(boolean inMarker) {
this.inMarker = inMarker;
}
-
+
/**
* Check whether in marker context
- *
+ *
* @return true if a marker is being processed
*/
protected boolean inMarker() {
return this.inMarker;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/FOValidationEventProducer.java b/src/java/org/apache/fop/fo/FOValidationEventProducer.java
index 61bd68340..889bf706a 100644
--- a/src/java/org/apache/fop/fo/FOValidationEventProducer.java
+++ b/src/java/org/apache/fop/fo/FOValidationEventProducer.java
@@ -37,7 +37,7 @@ public interface FOValidationEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -55,12 +55,12 @@ public interface FOValidationEventProducer extends EventProducer {
* @param elementName the name of the context node
* @param offendingNode the offending node
* @param loc the location of the error or null
- * @throws ValidationException the validation error provoked by the method call
+ * @throws ValidationException the validation error provoked by the method call
* @event.severity FATAL
*/
void tooManyNodes(Object source, String elementName, QName offendingNode,
Locator loc) throws ValidationException;
-
+
/**
* The node order is wrong.
* @param source the event source
@@ -74,7 +74,7 @@ public interface FOValidationEventProducer extends EventProducer {
void nodeOutOfOrder(Object source, String elementName,
String tooLateNode, String tooEarlyNode, boolean canRecover,
Locator loc) throws ValidationException;
-
+
/**
* An invalid child was encountered.
* @param source the event source
@@ -112,7 +112,7 @@ public interface FOValidationEventProducer extends EventProducer {
*/
void missingProperty(Object source, String elementName, String propertyName,
Locator loc) throws ValidationException;
-
+
/**
* An id was used twice in a document.
* @param source the event source
@@ -334,7 +334,7 @@ public interface FOValidationEventProducer extends EventProducer {
*/
void invalidFORoot(Object source, String elementName,
Locator loc) throws ValidationException;
-
+
/**
* No FO document was found.
* @param source the event source
@@ -342,7 +342,7 @@ public interface FOValidationEventProducer extends EventProducer {
* @event.severity FATAL
*/
void emptyDocument(Object source) throws ValidationException;
-
+
/**
* An unknown/unsupported formatting object has been encountered.
* @param source the event source
@@ -353,5 +353,5 @@ public interface FOValidationEventProducer extends EventProducer {
*/
void unknownFormattingObject(Object source, String elementName,
QName offendingNode, Locator loc);
-
+
}
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index 20573fa7a..e0624df69 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,22 +42,22 @@ import org.apache.fop.fo.properties.PropertyMaker;
* All standard formatting object classes extend this class.
*/
public abstract class FObj extends FONode implements Constants {
-
+
/** the list of property makers */
private static final PropertyMaker[] propertyListTable
= FOPropertyMapping.getGenericMappings();
-
- /**
+
+ /**
* pointer to the descendant subtree
*/
protected FONode firstChild;
-
+
/** The list of extension attachments, null if none */
private List extensionAttachments = null;
-
+
/** The map of foreign attributes, null if none */
private Map foreignAttributes = null;
-
+
/** Used to indicate if this FO is either an Out Of Line FO (see rec)
* or a descendant of one. Used during FO validation.
*/
@@ -65,7 +65,7 @@ public abstract class FObj extends FONode implements Constants {
/** Markers added to this element. */
private Map markers = null;
-
+
// The value of properties relevant for all fo objects
private String id = null;
// End of property values
@@ -77,7 +77,7 @@ public abstract class FObj extends FONode implements Constants {
*/
public FObj(FONode parent) {
super(parent);
-
+
// determine if isOutOfLineFODescendant should be set
if (parent != null && parent instanceof FObj) {
if (((FObj) parent).getIsOutOfLineFODescendant()) {
@@ -101,7 +101,7 @@ public abstract class FObj extends FONode implements Constants {
}
return fobj;
}
-
+
/**
* Returns the PropertyMaker for a given property ID.
* @param propId the property ID
@@ -112,8 +112,8 @@ public abstract class FObj extends FONode implements Constants {
}
/** {@inheritDoc} */
- public void processNode(String elementName, Locator locator,
- Attributes attlist, PropertyList pList)
+ public void processNode(String elementName, Locator locator,
+ Attributes attlist, PropertyList pList)
throws FOPException {
setLocator(locator);
pList.addAttributesToList(attlist);
@@ -125,10 +125,10 @@ public abstract class FObj extends FONode implements Constants {
}
/**
- * Create a default property list for this element.
+ * Create a default property list for this element.
* {@inheritDoc}
*/
- protected PropertyList createPropertyList(PropertyList parent,
+ protected PropertyList createPropertyList(PropertyList parent,
FOEventHandler foEventHandler) throws FOPException {
return getBuilderContext().getPropertyListMaker().make(this, parent);
}
@@ -158,7 +158,7 @@ public abstract class FObj extends FONode implements Constants {
* Setup the id for this formatting object.
* Most formatting objects can have an id that can be referenced.
* This methods checks that the id isn't already used by another FO
- *
+ *
* @param id the id to check
* @throws ValidationException if the ID is already defined elsewhere
* (strict validation only)
@@ -186,11 +186,11 @@ public abstract class FObj extends FONode implements Constants {
protected void addChildNode(FONode child) throws FOPException {
if (child.getNameId() == FO_MARKER) {
addMarker((Marker) child);
- } else {
+ } else {
ExtensionAttachment attachment = child.getExtensionAttachment();
if (attachment != null) {
- /* This removes the element from the normal children,
- * so no layout manager is being created for them
+ /* This removes the element from the normal children,
+ * so no layout manager is being created for them
* as they are only additional information.
*/
addExtensionAttachment(attachment);
@@ -215,11 +215,11 @@ public abstract class FObj extends FONode implements Constants {
* @param parent the (cloned) parent node
* @throws FOPException when the child could not be added to the parent
*/
- protected static void addChildTo(FONode child, FObj parent)
+ protected static void addChildTo(FONode child, FObj parent)
throws FOPException {
parent.addChildNode(child);
}
-
+
/** {@inheritDoc} */
public void removeChild(FONode child) {
FONode nextChild = null;
@@ -239,7 +239,7 @@ public abstract class FObj extends FONode implements Constants {
}
}
}
-
+
/**
* Find the nearest parent, grandparent, etc. FONode that is also an FObj
* @return FObj the nearest ancestor FONode that is an FObj
@@ -276,7 +276,7 @@ public abstract class FObj extends FONode implements Constants {
public boolean hasChildren() {
return this.firstChild != null;
}
-
+
/**
* Return an iterator over the object's childNodes starting
* at the passed-in node (= first call to iterator.next() will
@@ -307,7 +307,7 @@ public abstract class FObj extends FONode implements Constants {
/**
* Notifies a FObj that one of it's children is removed.
- * This method is subclassed by Block to clear the
+ * This method is subclassed by Block to clear the
* firstInlineChild variable in case it doesn't generate
* any areas (see addMarker()).
* @param node the node that was removed
@@ -315,7 +315,7 @@ public abstract class FObj extends FONode implements Constants {
void notifyChildRemoval(FONode node) {
//nop
}
-
+
/**
* Add the marker to this formatting object.
* If this object can contain markers it checks that the marker
@@ -392,7 +392,7 @@ public abstract class FObj extends FONode implements Constants {
return null;
}
}
-
+
/** {@inheritDoc} */
protected String gatherContextInfo() {
if (getLocator() != null) {
@@ -422,11 +422,11 @@ public abstract class FObj extends FONode implements Constants {
* incoming node is a member of the "%block;" parameter entity
* as defined in Sect. 6.2 of the XSL 1.0 & 1.1 Recommendations
* @param nsURI namespace URI of incoming node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
*/
protected boolean isBlockItem(String nsURI, String lName) {
- return (FO_URI.equals(nsURI)
+ return (FO_URI.equals(nsURI)
&& ("block".equals(lName)
|| "table".equals(lName)
|| "table-and-caption".equals(lName)
@@ -441,11 +441,11 @@ public abstract class FObj extends FONode implements Constants {
* incoming node is a member of the "%inline;" parameter entity
* as defined in Sect. 6.2 of the XSL 1.0 & 1.1 Recommendations
* @param nsURI namespace URI of incoming node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
*/
protected boolean isInlineItem(String nsURI, String lName) {
- return (FO_URI.equals(nsURI)
+ return (FO_URI.equals(nsURI)
&& ("bidi-override".equals(lName)
|| "character".equals(lName)
|| "external-graphic".equals(lName)
@@ -470,7 +470,7 @@ public abstract class FObj extends FONode implements Constants {
* incoming node is a member of the "%block;" parameter entity
* or "%inline;" parameter entity
* @param nsURI namespace URI of incoming node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
*/
protected boolean isBlockOrInlineItem(String nsURI, String lName) {
@@ -482,11 +482,11 @@ public abstract class FObj extends FONode implements Constants {
* incoming node is a member of the neutral item list
* as defined in Sect. 6.2 of the XSL 1.0 & 1.1 Recommendations
* @param nsURI namespace URI of incoming node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
*/
boolean isNeutralItem(String nsURI, String lName) {
- return (FO_URI.equals(nsURI)
+ return (FO_URI.equals(nsURI)
&& ("multi-switch".equals(lName)
|| "multi-properties".equals(lName)
|| "wrapper".equals(lName)
@@ -494,12 +494,12 @@ public abstract class FObj extends FONode implements Constants {
|| "retrieve-marker".equals(lName)
|| "retrieve-table-marker".equals(lName)));
}
-
+
/**
* Convenience method for validity checking. Checks if the
* current node has an ancestor of a given name.
* @param ancestorID ID of node name to check for (e.g., FO_ROOT)
- * @return number of levels above FO where ancestor exists,
+ * @return number of levels above FO where ancestor exists,
* -1 if not found
*/
protected int findAncestor(int ancestorID) {
@@ -514,19 +514,19 @@ public abstract class FObj extends FONode implements Constants {
}
return -1;
}
-
+
/**
* Clears the list of child nodes.
*/
public void clearChildNodes() {
this.firstChild = null;
}
-
+
/** @return the "id" property. */
public String getId() {
return id;
}
-
+
/** @return whether this object has an id set */
public boolean hasId() {
return id != null && id.length() > 0;
@@ -543,9 +543,9 @@ public abstract class FObj extends FONode implements Constants {
}
/**
- * Add a new extension attachment to this FObj.
+ * Add a new extension attachment to this FObj.
* (see org.apache.fop.fo.FONode for details)
- *
+ *
* @param attachment the attachment to add.
*/
void addExtensionAttachment(ExtensionAttachment attachment) {
@@ -557,13 +557,13 @@ public abstract class FObj extends FONode implements Constants {
extensionAttachments = new java.util.ArrayList();
}
if (log.isDebugEnabled()) {
- log.debug("ExtensionAttachment of category "
- + attachment.getCategory() + " added to "
+ log.debug("ExtensionAttachment of category "
+ + attachment.getCategory() + " added to "
+ getName() + ": " + attachment);
}
extensionAttachments.add(attachment);
}
-
+
/** @return the extension attachments of this FObj. */
public List getExtensionAttachments() {
if (extensionAttachments == null) {
@@ -584,7 +584,7 @@ public abstract class FObj extends FONode implements Constants {
* @param value the attribute value
*/
public void addForeignAttribute(QName attributeName, String value) {
- /* TODO: Handle this over FOP's property mechanism so we can use
+ /* TODO: Handle this over FOP's property mechanism so we can use
* inheritance.
*/
if (attributeName == null) {
@@ -595,7 +595,7 @@ public abstract class FObj extends FONode implements Constants {
}
foreignAttributes.put(attributeName, value);
}
-
+
/** @return the map of foreign attributes */
public Map getForeignAttributes() {
if (foreignAttributes == null) {
@@ -604,7 +604,7 @@ public abstract class FObj extends FONode implements Constants {
return foreignAttributes;
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return (super.toString() + "[@id=" + this.id + "]");
@@ -612,28 +612,28 @@ public abstract class FObj extends FONode implements Constants {
/** Basic {@link FONodeIterator} implementation */
public class FObjIterator implements FONodeIterator {
-
+
private static final int F_NONE_ALLOWED = 0;
private static final int F_SET_ALLOWED = 1;
private static final int F_REMOVE_ALLOWED = 2;
-
+
private FONode currentNode;
private final FObj parentNode;
private int currentIndex;
private int flags = F_NONE_ALLOWED;
-
+
FObjIterator(FObj parent) {
this.parentNode = parent;
this.currentNode = parent.firstChild;
this.currentIndex = 0;
this.flags = F_NONE_ALLOWED;
}
-
+
/** {@inheritDoc} */
public FObj parentNode() {
return parentNode;
}
-
+
/** {@inheritDoc} */
public Object next() {
if (currentNode != null) {
@@ -665,7 +665,7 @@ public abstract class FObj extends FONode implements Constants {
throw new NoSuchElementException();
}
}
-
+
/** {@inheritDoc} */
public void set(Object o) {
if ((flags & F_SET_ALLOWED) == F_SET_ALLOWED) {
@@ -683,7 +683,7 @@ public abstract class FObj extends FONode implements Constants {
throw new IllegalStateException();
}
}
-
+
/** {@inheritDoc} */
public void add(Object o) {
FONode newNode = (FONode) o;
@@ -718,7 +718,7 @@ public abstract class FObj extends FONode implements Constants {
|| (currentNode.siblings != null
&& currentNode.siblings[0] != null);
}
-
+
/** {@inheritDoc} */
public int nextIndex() {
return currentIndex + 1;
@@ -759,19 +759,19 @@ public abstract class FObj extends FONode implements Constants {
}
return currentNode;
}
-
+
/** {@inheritDoc} */
public FONode firstNode() {
currentNode = parentNode.firstChild;
currentIndex = 0;
return currentNode;
}
-
+
/** {@inheritDoc} */
public FONode nextNode() {
return (FONode) next();
}
-
+
/** {@inheritDoc} */
public FONode previousNode() {
return (FONode) previous();
diff --git a/src/java/org/apache/fop/fo/FObjMixed.java b/src/java/org/apache/fop/fo/FObjMixed.java
index 068c2d635..64faa3253 100644
--- a/src/java/org/apache/fop/fo/FObjMixed.java
+++ b/src/java/org/apache/fop/fo/FObjMixed.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -71,7 +71,7 @@ public abstract class FObjMixed extends FObj {
// send character[s]() events to the FOEventHandler
sendCharacters();
}
-
+
}
/**
@@ -180,10 +180,10 @@ public abstract class FObjMixed extends FObj {
/**
* Returns a {@link CharIterator} over this FO's character content
- *
+ *
* @return iterator for this object
*/
public CharIterator charIterator() {
return new RecursiveCharIterator(this);
- }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/fo/GraphicsProperties.java b/src/java/org/apache/fop/fo/GraphicsProperties.java
index 5cee68679..a22d59c24 100644
--- a/src/java/org/apache/fop/fo/GraphicsProperties.java
+++ b/src/java/org/apache/fop/fo/GraphicsProperties.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -47,7 +47,7 @@ public interface GraphicsProperties {
* @return the "width" property.
*/
Length getWidth();
-
+
/**
* @return the "content-height" property.
*/
diff --git a/src/java/org/apache/fop/fo/InlineCharIterator.java b/src/java/org/apache/fop/fo/InlineCharIterator.java
index 8a375097e..f71753dde 100644
--- a/src/java/org/apache/fop/fo/InlineCharIterator.java
+++ b/src/java/org/apache/fop/fo/InlineCharIterator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/NullCharIterator.java b/src/java/org/apache/fop/fo/NullCharIterator.java
index bb98b4a52..2b2a2a9a0 100644
--- a/src/java/org/apache/fop/fo/NullCharIterator.java
+++ b/src/java/org/apache/fop/fo/NullCharIterator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,7 +27,7 @@ import java.util.NoSuchElementException;
public class NullCharIterator extends CharIterator {
private static CharIterator instance;
-
+
public static CharIterator getInstance() {
if (instance == null) {
instance = new NullCharIterator();
diff --git a/src/java/org/apache/fop/fo/OneCharIterator.java b/src/java/org/apache/fop/fo/OneCharIterator.java
index 1d96320c1..e2c7275e8 100644
--- a/src/java/org/apache/fop/fo/OneCharIterator.java
+++ b/src/java/org/apache/fop/fo/OneCharIterator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java
index e3e9f9f83..13f983841 100644
--- a/src/java/org/apache/fop/fo/PropertyList.java
+++ b/src/java/org/apache/fop/fo/PropertyList.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -149,7 +149,7 @@ public abstract class PropertyList {
* the default value.
* @param propId The Constants ID of the property whose value is desired.
* @return the Property corresponding to that name
- * @throws PropertyException if there is a problem evaluating the property
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property get(int propId) throws PropertyException {
return get(propId, true, true);
@@ -161,11 +161,11 @@ public abstract class PropertyList {
* inheritable, to return the inherited value. If all else fails, it returns
* the default value.
* @param propId the property's id
- * @param bTryInherit true for inherited properties, or when the inherited
+ * @param bTryInherit true for inherited properties, or when the inherited
* value is needed
* @param bTryDefault true when the default value may be used as a last resort
* @return the property
- * @throws PropertyException if there is a problem evaluating the property
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property get(int propId, boolean bTryInherit,
boolean bTryDefault) throws PropertyException {
@@ -189,7 +189,7 @@ public abstract class PropertyList {
public Property getNearestSpecified(int propId) throws PropertyException {
Property p = null;
PropertyList pList = parentPropertyList;
-
+
while (pList != null) {
p = pList.getExplicit(propId);
if (p != null) {
@@ -198,8 +198,8 @@ public abstract class PropertyList {
pList = pList.parentPropertyList;
}
}
-
- // If no explicit value found on any of the ancestor-nodes,
+
+ // If no explicit value found on any of the ancestor-nodes,
// return initial (default) value.
return makeProperty(propId);
}
@@ -238,7 +238,7 @@ public abstract class PropertyList {
}
/**
- * Return the "writing-mode" property value.
+ * Return the "writing-mode" property value.
* @return the "writing-mode" property value.
*/
public int getWritingMode() {
@@ -266,34 +266,34 @@ public abstract class PropertyList {
/**
* Adds the attributes, passed in by the parser to the PropertyList
- *
+ *
* @param attributes Collection of attributes passed to us from the parser.
* @throws ValidationException if there is an attribute that does not
* map to a property id (strict validation only)
*/
- public void addAttributesToList(Attributes attributes)
+ public void addAttributesToList(Attributes attributes)
throws ValidationException {
/*
- * If column-number/number-columns-spanned are specified, then we
- * need them before all others (possible from-table-column() on any
+ * If column-number/number-columns-spanned are specified, then we
+ * need them before all others (possible from-table-column() on any
* other property further in the list...
*/
String attributeName = "column-number";
String attributeValue = attributes.getValue(attributeName);
- convertAttributeToProperty(attributes, attributeName,
+ convertAttributeToProperty(attributes, attributeName,
attributeValue);
attributeName = "number-columns-spanned";
attributeValue = attributes.getValue(attributeName);
- convertAttributeToProperty(attributes, attributeName,
+ convertAttributeToProperty(attributes, attributeName,
attributeValue);
-
+
/*
* If font-size is set on this FO, must set it first, since
* other attributes specified in terms of "ems" depend on it.
*/
attributeName = "font";
attributeValue = attributes.getValue(attributeName);
- convertAttributeToProperty(attributes, attributeName,
+ convertAttributeToProperty(attributes, attributeName,
attributeValue);
if (attributeValue == null) {
/*
@@ -302,19 +302,19 @@ public abstract class PropertyList {
*/
attributeName = "font-size";
attributeValue = attributes.getValue(attributeName);
- convertAttributeToProperty(attributes, attributeName,
+ convertAttributeToProperty(attributes, attributeName,
attributeValue);
}
-
+
String attributeNS;
- FopFactory factory = getFObj().getUserAgent().getFactory();
+ FopFactory factory = getFObj().getUserAgent().getFactory();
for (int i = 0; i < attributes.getLength(); i++) {
/* convert all attributes with the same namespace as the fo element
* the "xml:lang" property is a special case */
attributeNS = attributes.getURI(i);
attributeName = attributes.getQName(i);
attributeValue = attributes.getValue(i);
- if (attributeNS == null || attributeNS.length() == 0
+ if (attributeNS == null || attributeNS.length() == 0
|| "xml:lang".equals(attributeName)) {
convertAttributeToProperty(attributes, attributeName, attributeValue);
} else if (!factory.isNamespaceIgnored(attributeNS)) {
@@ -322,10 +322,10 @@ public abstract class PropertyList {
attributeNS);
QName attr = new QName(attributeNS, attributeName);
if (mapping != null) {
- if (mapping.isAttributeProperty(attr)
+ if (mapping.isAttributeProperty(attr)
&& mapping.getStandardPrefix() != null) {
- convertAttributeToProperty(attributes,
- mapping.getStandardPrefix() + ":" + attr.getLocalName(),
+ convertAttributeToProperty(attributes,
+ mapping.getStandardPrefix() + ":" + attr.getLocalName(),
attributeValue);
} else {
getFObj().addForeignAttribute(attr, attributeValue);
@@ -336,7 +336,7 @@ public abstract class PropertyList {
}
}
}
-
+
/**
* Validates a property name.
* @param propertyName the property name to check
@@ -360,34 +360,34 @@ public abstract class PropertyList {
* @param attributes Collection of attributes
* @param attributeName Attribute name to convert
* @param attributeValue Attribute value to assign to property
- * @throws ValidationException in case the property name is invalid
+ * @throws ValidationException in case the property name is invalid
* for the FO namespace
*/
private void convertAttributeToProperty(Attributes attributes,
String attributeName,
- String attributeValue)
+ String attributeValue)
throws ValidationException {
-
+
if (attributeValue != null) {
if (attributeName.startsWith("xmlns:")) {
//Ignore namespace declarations
return;
}
-
+
/* Handle "compound" properties, ex. space-before.minimum */
String basePropertyName = findBasePropertyName(attributeName);
String subPropertyName = findSubPropertyName(attributeName);
int propId = FOPropertyMapping.getPropertyId(basePropertyName);
int subpropId = FOPropertyMapping.getSubPropertyId(subPropertyName);
-
- if (propId == -1
+
+ if (propId == -1
|| (subpropId == -1 && subPropertyName != null)) {
handleInvalidProperty(new QName(null, attributeName));
}
FObj parentFO = fobj.findNearestAncestorFObj();
-
+
PropertyMaker propertyMaker = findMaker(propId);
if (propertyMaker == null) {
log.warn("No PropertyMaker registered for " + attributeName
@@ -401,7 +401,7 @@ public abstract class PropertyList {
/* Do nothing if the base property has already been created.
* This is e.g. the case when a compound attribute was
* specified before the base attribute; in these cases
- * the base attribute was already created in
+ * the base attribute was already created in
* findBaseProperty()
*/
if (getExplicit(propId) != null) {
@@ -410,7 +410,7 @@ public abstract class PropertyList {
prop = propertyMaker.make(this, attributeValue, parentFO);
} else { // e.g. "leader-length.maximum"
Property baseProperty
- = findBaseProperty(attributes, parentFO, propId,
+ = findBaseProperty(attributes, parentFO, propId,
basePropertyName, propertyMaker);
prop = propertyMaker.make(baseProperty, subpropId,
this, attributeValue, parentFO);
@@ -446,13 +446,13 @@ public abstract class PropertyList {
* e.g.
Here, blocks XSL-FO's from having non-FO parents.
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -74,7 +74,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
}
/** {@inheritDoc} */
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList) throws FOPException {
setLocator(locator);
name = elementName;
@@ -90,17 +90,17 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
/**
* Returns the dimensions of the generated area in pts.
- *
+ *
* @param view Point2D instance to receive the dimensions
* @return the requested dimensions in pts.
*/
public Point2D getDimension(Point2D view) {
return null;
}
-
+
/**
* Retrieve the intrinsic alignment-adjust of the child element.
- *
+ *
* @return the intrinsic alignment-adjust.
*/
public Length getIntrinsicAlignmentAdjust() {
@@ -149,10 +149,10 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
}
}
}
-
+
/**
* Add the top-level element to the DOM document
- *
+ *
* @param doc DOM document
* @param svgRoot non-XSL-FO element to be added as the root of this document
*/
@@ -163,7 +163,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
/**
* Create an empty DOM document
- *
+ *
* @return DOM document
*/
public Document createBasicDocument() {
@@ -183,7 +183,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
element.setAttributeNS(XMLNS_NAMESPACE_URI, "xmlns",
getNamespaceURI());
}
-
+
} catch (Exception e) {
//TODO this is ugly because there may be subsequent failures like NPEs
log.error("Error while trying to instantiate a DOM Document", e);
@@ -205,7 +205,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
/**
* Add parsed characters to this object
- *
+ *
* @param data array of characters contaning the text to add
* @param start starting array element to add
* @param length number of characters from the array to add
@@ -223,6 +223,6 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
public void notifyObjectBuilt(Object obj) {
this.doc = (Document)obj;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java b/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
index d8915b124..759cdaed9 100644
--- a/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
+++ b/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
@@ -27,7 +27,7 @@ import org.apache.fop.util.CharUtilities;
/**
* Class encapsulating the functionality for white-space-handling
* during refinement stage.
- * The handleWhiteSpace()
methods are called during
+ * The handleWhiteSpace()
methods are called during
* FOTree-building and marker-cloning:
*
*
@@ -47,8 +47,8 @@ import org.apache.fop.util.CharUtilities;
* after the previous non-text child
*
*
- * The iteration always starts at firstTextNode
,
- * goes on until the last text-node is reached, and deals only
+ * The iteration always starts at firstTextNode
,
+ * goes on until the last text-node is reached, and deals only
* with FOText
or Character
nodes.
*
* Note: if the method is called from an inline's endOfNode(),
@@ -60,25 +60,25 @@ import org.apache.fop.util.CharUtilities;
* of the ancestor block.
*/
public class XMLWhiteSpaceHandler {
-
+
/** True if we are in a run of white space */
private boolean inWhiteSpace = false;
/** True if the last char was a linefeed */
private boolean afterLinefeed = true;
/** Counter, increased every time a non-white-space is encountered */
private int nonWhiteSpaceCount;
-
+
private int linefeedTreatment;
private int whiteSpaceTreatment;
private int whiteSpaceCollapse;
private boolean endOfBlock;
private boolean nextChildIsBlockLevel;
private RecursiveCharIterator charIter;
-
+
private List pendingInlines;
private Stack nestedBlockStack = new java.util.Stack();
private CharIterator firstWhiteSpaceInSeq;
-
+
/**
* Handle white-space for the fo that is passed in, starting at
* firstTextNode
@@ -93,14 +93,14 @@ public class XMLWhiteSpaceHandler {
Block currentBlock = null;
int foId = fo.getNameId();
-
+
/* set the current block */
switch (foId) {
case Constants.FO_BLOCK:
currentBlock = (Block) fo;
if (nestedBlockStack.empty() || fo != nestedBlockStack.peek()) {
if (nextChild != null) {
- /* if already in a block, push the current block
+ /* if already in a block, push the current block
* onto the stack of nested blocks
*/
nestedBlockStack.push(currentBlock);
@@ -111,7 +111,7 @@ public class XMLWhiteSpaceHandler {
}
}
break;
-
+
case Constants.FO_RETRIEVE_MARKER:
/* look for the nearest block ancestor, if any */
FONode ancestor = fo;
@@ -119,19 +119,19 @@ public class XMLWhiteSpaceHandler {
ancestor = ancestor.getParent();
} while (ancestor.getNameId() != Constants.FO_BLOCK
&& ancestor.getNameId() != Constants.FO_STATIC_CONTENT);
-
+
if (ancestor.getNameId() == Constants.FO_BLOCK) {
currentBlock = (Block) ancestor;
nestedBlockStack.push(currentBlock);
}
break;
-
+
default:
if (!nestedBlockStack.empty()) {
currentBlock = (Block) nestedBlockStack.peek();
}
}
-
+
if (currentBlock != null) {
linefeedTreatment = currentBlock.getLinefeedTreatment();
whiteSpaceCollapse = currentBlock.getWhitespaceCollapse();
@@ -141,9 +141,9 @@ public class XMLWhiteSpaceHandler {
whiteSpaceCollapse = Constants.EN_TRUE;
whiteSpaceTreatment = Constants.EN_IGNORE_IF_SURROUNDING_LINEFEED;
}
-
+
endOfBlock = (nextChild == null && fo == currentBlock);
-
+
if (firstTextNode == null) {
//no text means no white-space to handle; return early
afterLinefeed = (fo == currentBlock && fo.firstChild == null);
@@ -153,10 +153,10 @@ public class XMLWhiteSpaceHandler {
}
return;
}
-
+
charIter = new RecursiveCharIterator(fo, firstTextNode);
inWhiteSpace = false;
-
+
if (fo == currentBlock
|| currentBlock == null
|| (foId == Constants.FO_RETRIEVE_MARKER
@@ -172,7 +172,7 @@ public class XMLWhiteSpaceHandler {
|| previousChildId == Constants.FO_BLOCK_CONTAINER);
}
}
-
+
if (foId == Constants.FO_WRAPPER) {
FONode parent = fo.parent;
int parentId = parent.getNameId();
@@ -187,7 +187,7 @@ public class XMLWhiteSpaceHandler {
endOfBlock = (nextChild == null);
}
}
-
+
if (nextChild != null) {
int nextChildId = nextChild.getNameId();
nextChildIsBlockLevel = (
@@ -199,20 +199,20 @@ public class XMLWhiteSpaceHandler {
} else {
nextChildIsBlockLevel = false;
}
-
+
handleWhiteSpace();
-
- if (fo == currentBlock
+
+ if (fo == currentBlock
&& (endOfBlock || nextChildIsBlockLevel)) {
handlePendingInlines();
}
-
+
if (nextChild == null) {
if (fo != currentBlock) {
/* current FO is not a block, and is about to end */
if (nonWhiteSpaceCount > 0 && pendingInlines != null) {
- /* there is non-white-space text between the pending
- * inline(s) and the end of the non-block node;
+ /* there is non-white-space text between the pending
+ * inline(s) and the end of the non-block node;
* clear list of pending inlines */
pendingInlines.clear();
}
@@ -222,7 +222,7 @@ public class XMLWhiteSpaceHandler {
addPendingInline(fo);
}
} else {
- /* end of block: clear the references and pop the
+ /* end of block: clear the references and pop the
* nested block stack */
if (!nestedBlockStack.empty()) {
nestedBlockStack.pop();
@@ -231,7 +231,7 @@ public class XMLWhiteSpaceHandler {
}
}
}
-
+
/**
* Handle white-space for the fo that is passed in, starting at
* firstTextNode (when a nested FO is encountered)
@@ -241,13 +241,13 @@ public class XMLWhiteSpaceHandler {
public void handleWhiteSpace(FObjMixed fo, FONode firstTextNode) {
handleWhiteSpace(fo, firstTextNode, null);
}
-
+
private void handleWhiteSpace() {
-
+
EOLchecker lfCheck = new EOLchecker(charIter);
-
+
nonWhiteSpaceCount = 0;
-
+
while (charIter.hasNext()) {
if (!inWhiteSpace) {
firstWhiteSpaceInSeq = charIter.mark();
@@ -265,7 +265,7 @@ public class XMLWhiteSpaceHandler {
switch (CharUtilities.classOf(currentChar)) {
case CharUtilities.XMLWHITESPACE:
// Some kind of whitespace character, except linefeed.
- if (inWhiteSpace
+ if (inWhiteSpace
&& whiteSpaceCollapse == Constants.EN_TRUE) {
// We are in a run of whitespace and should collapse
// Just delete the char
@@ -343,14 +343,14 @@ public class XMLWhiteSpaceHandler {
}
}
}
-
+
private void addPendingInline(FObjMixed fo) {
if (pendingInlines == null) {
pendingInlines = new java.util.ArrayList(5);
}
pendingInlines.add(new PendingInline(fo, firstWhiteSpaceInSeq));
}
-
+
private void handlePendingInlines() {
if (!(pendingInlines == null || pendingInlines.isEmpty())) {
if (nonWhiteSpaceCount == 0) {
@@ -370,7 +370,7 @@ public class XMLWhiteSpaceHandler {
}
}
}
-
+
/**
* Helper class, used during white-space handling to look ahead, and
* see if the next character is a linefeed (or if there will be
@@ -401,7 +401,7 @@ public class XMLWhiteSpaceHandler {
}
// No more characters == end of text run
// means EOL if there either is a nested block to be added,
- // or if this is the last text node in the current block
+ // or if this is the last text node in the current block
nextIsEOL = nextChildIsBlockLevel || endOfBlock;
}
return nextIsEOL;
@@ -411,16 +411,16 @@ public class XMLWhiteSpaceHandler {
nextIsEOL = false;
}
}
-
+
/**
- * Helper class to store unfinished inline nodes together
+ * Helper class to store unfinished inline nodes together
* with an iterator that starts at the first white-space
* character in the sequence of trailing white-space
*/
private class PendingInline {
protected FObjMixed fo;
protected CharIterator firstTrailingWhiteSpace;
-
+
PendingInline(FObjMixed fo, CharIterator firstTrailingWhiteSpace) {
this.fo = fo;
this.firstTrailingWhiteSpace = firstTrailingWhiteSpace;
diff --git a/src/java/org/apache/fop/fo/expr/AbsFunction.java b/src/java/org/apache/fop/fo/expr/AbsFunction.java
index 64936459f..0e8355faa 100644
--- a/src/java/org/apache/fop/fo/expr/AbsFunction.java
+++ b/src/java/org/apache/fop/fo/expr/AbsFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
index a1c0259fa..eb68b2a23 100644
--- a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
+++ b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java b/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java
index 3aab1325d..fe86860f4 100644
--- a/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.properties.ColorProperty;
@@ -26,22 +26,22 @@ import org.apache.fop.fo.properties.Property;
* Implements the cmyk() function.
*/
class CMYKcolorFunction extends FunctionBase {
-
+
/**
- * cmyk takes four arguments.
- * {@inheritDoc}
+ * cmyk takes four arguments.
+ * {@inheritDoc}
*/
public int nbArgs() {
return 4;
}
-
+
/** {@inheritDoc} */
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
StringBuffer sb = new StringBuffer();
sb.append("cmyk(" + args[0] + "," + args[1] + "," + args[2] + "," + args[3] + ")");
- FOUserAgent ua = (pInfo == null)
- ? null
+ FOUserAgent ua = (pInfo == null)
+ ? null
: (pInfo.getFO() == null ? null : pInfo.getFO().getUserAgent());
return ColorProperty.getInstance(ua, sb.toString());
}
diff --git a/src/java/org/apache/fop/fo/expr/CeilingFunction.java b/src/java/org/apache/fop/fo/expr/CeilingFunction.java
index 29ac1940a..875c88751 100644
--- a/src/java/org/apache/fop/fo/expr/CeilingFunction.java
+++ b/src/java/org/apache/fop/fo/expr/CeilingFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.fo.properties.NumberProperty;
diff --git a/src/java/org/apache/fop/fo/expr/FloorFunction.java b/src/java/org/apache/fop/fo/expr/FloorFunction.java
index 9cdbf1a28..043473140 100644
--- a/src/java/org/apache/fop/fo/expr/FloorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/FloorFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.fo.properties.NumberProperty;
diff --git a/src/java/org/apache/fop/fo/expr/FromParentFunction.java b/src/java/org/apache/fop/fo/expr/FromParentFunction.java
index b09d3c95f..b1e9d689d 100644
--- a/src/java/org/apache/fop/fo/expr/FromParentFunction.java
+++ b/src/java/org/apache/fop/fo/expr/FromParentFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java b/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java
index 66cafc2ac..df84939f1 100644
--- a/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java
+++ b/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/Function.java b/src/java/org/apache/fop/fo/expr/Function.java
index a06627f6c..78e40fad2 100644
--- a/src/java/org/apache/fop/fo/expr/Function.java
+++ b/src/java/org/apache/fop/fo/expr/Function.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/FunctionBase.java b/src/java/org/apache/fop/fo/expr/FunctionBase.java
index 24d2fef49..b5040c635 100644
--- a/src/java/org/apache/fop/fo/expr/FunctionBase.java
+++ b/src/java/org/apache/fop/fo/expr/FunctionBase.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/ICCColorFunction.java b/src/java/org/apache/fop/fo/expr/ICCColorFunction.java
index 9444639a5..2069945f1 100644
--- a/src/java/org/apache/fop/fo/expr/ICCColorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/ICCColorFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.datatypes.PercentBase;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -29,16 +29,16 @@ import org.apache.fop.fo.properties.Property;
* Implements the rgb-icc() function.
*/
class ICCColorFunction extends FunctionBase {
-
+
/**
- * rgb-icc takes a variable number of arguments.
- * At least 4 should be passed - returns -4
- * {@inheritDoc}
+ * rgb-icc takes a variable number of arguments.
+ * At least 4 should be passed - returns -4
+ * {@inheritDoc}
*/
public int nbArgs() {
return -4;
}
-
+
/** {@inheritDoc} */
public PercentBase getPercentBase() {
return new ICCPercentBase();
@@ -52,7 +52,7 @@ class ICCColorFunction extends FunctionBase {
Declarations decls = pInfo.getFO().getRoot().getDeclarations();
ColorProfile cp = null;
if (decls == null) {
- //function used in a color-specification
+ //function used in a color-specification
//on a FO occurring:
//a) before the fo:declarations,
//b) or in a document without fo:declarations?
@@ -63,27 +63,27 @@ class ICCColorFunction extends FunctionBase {
} else {
cp = decls.getColorProfile(colorProfileName);
if (cp == null) {
- PropertyException pe = new PropertyException("The " + colorProfileName
+ PropertyException pe = new PropertyException("The " + colorProfileName
+ " color profile was not declared");
pe.setPropertyInfo(pInfo);
throw pe;
}
}
String src = cp.getSrc();
-
+
float red = 0, green = 0, blue = 0;
red = args[0].getNumber().floatValue();
green = args[1].getNumber().floatValue();
blue = args[2].getNumber().floatValue();
/* Verify rgb replacement arguments */
- if ((red < 0 || red > 255)
- || (green < 0 || green > 255)
+ if ((red < 0 || red > 255)
+ || (green < 0 || green > 255)
|| (blue < 0 || blue > 255)) {
throw new PropertyException("Color values out of range. "
+ "Arguments to rgb-icc() must be [0..255] or [0%..100%]");
}
-
- // rgb-icc is replaced with fop-rgb-icc which has an extra fifth argument containing the
+
+ // rgb-icc is replaced with fop-rgb-icc which has an extra fifth argument containing the
// color profile src attribute as it is defined in the color-profile declarations element.
StringBuffer sb = new StringBuffer();
sb.append("fop-rgb-icc(");
@@ -92,19 +92,19 @@ class ICCColorFunction extends FunctionBase {
sb.append(',').append(blue / 255f);
for (int ix = 3; ix < args.length; ix++) {
if (ix == 3) {
- sb.append(',').append(colorProfileName);
- sb.append(',').append(src);
+ sb.append(',').append(colorProfileName);
+ sb.append(',').append(src);
} else {
sb.append(',').append(args[ix]);
}
}
sb.append(")");
-
+
return ColorProperty.getInstance(pInfo.getUserAgent(), sb.toString());
}
private static final class ICCPercentBase implements PercentBase {
-
+
/** {@inheritDoc} */
public int getBaseLength(PercentBaseContext context) throws PropertyException {
return 0;
diff --git a/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java b/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
index e24c78caa..94c4fdf22 100644
--- a/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
+++ b/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
index 8a02d21d6..65be6cf9f 100644
--- a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
+++ b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -70,13 +70,13 @@ public class LabelEndFunction extends FunctionBase {
LengthBase.CONTAINING_REFAREA_WIDTH);
PercentLength refWidth = new PercentLength(1.0, base);
- Numeric labelEnd = distance;
+ Numeric labelEnd = distance;
labelEnd = NumericOp.addition(labelEnd, startIndent);
//TODO add start-intrusion-adjustment
labelEnd = NumericOp.subtraction(labelEnd, separation);
-
+
labelEnd = NumericOp.subtraction(refWidth, labelEnd);
-
+
return (Property) labelEnd;
}
diff --git a/src/java/org/apache/fop/fo/expr/MaxFunction.java b/src/java/org/apache/fop/fo/expr/MaxFunction.java
index 26e1a8f4c..fd2fee0b1 100644
--- a/src/java/org/apache/fop/fo/expr/MaxFunction.java
+++ b/src/java/org/apache/fop/fo/expr/MaxFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/MinFunction.java b/src/java/org/apache/fop/fo/expr/MinFunction.java
index 5e5fc7bee..979d16b27 100644
--- a/src/java/org/apache/fop/fo/expr/MinFunction.java
+++ b/src/java/org/apache/fop/fo/expr/MinFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/NCnameProperty.java b/src/java/org/apache/fop/fo/expr/NCnameProperty.java
index 8e2f8e27f..6bc16f2a9 100644
--- a/src/java/org/apache/fop/fo/expr/NCnameProperty.java
+++ b/src/java/org/apache/fop/fo/expr/NCnameProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,13 +42,13 @@ public class NCnameProperty extends Property {
/**
* If a system color, return the corresponding value.
- *
- * @param foUserAgent
+ *
+ * @param foUserAgent
* Reference to FOP user agent - keeps track of cached ColorMaps for ICC colors
* @return Color object corresponding to the NCName
*/
public Color getColor(FOUserAgent foUserAgent) {
- try {
+ try {
return ColorUtil.parseColorString(foUserAgent, ncName);
} catch (PropertyException e) {
//Not logging this error since for properties like "border" you would get an awful
@@ -71,7 +71,7 @@ public class NCnameProperty extends Property {
public Object getObject() {
return this.ncName;
}
-
+
/**
* @return ncName for this
*/
diff --git a/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java b/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
index cdde96092..3e0dda565 100644
--- a/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
+++ b/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/NumericOp.java b/src/java/org/apache/fop/fo/expr/NumericOp.java
index af77bb44c..9fe35d96d 100755
--- a/src/java/org/apache/fop/fo/expr/NumericOp.java
+++ b/src/java/org/apache/fop/fo/expr/NumericOp.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,12 +23,12 @@ import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.datatypes.Numeric;
/**
- * This class contains static methods to evaluate operations on Numeric
+ * This class contains static methods to evaluate operations on Numeric
* operands. If the operands are absolute numerics the result is computed
* rigth away and a new absolute numeric is return. If one of the operands are
* relative a n operation node is created with the operation and the operands.
* The evaluation of the operation can then occur when getNumericValue() is
- * called.
+ * called.
*/
public class NumericOp {
/**
@@ -46,16 +46,16 @@ public class NumericOp {
return new RelativeNumericProperty(RelativeNumericProperty.ADDITION, op1, op2);
}
}
-
+
public static Numeric addition2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
if (op1.getDimension() != op2.getDimension()) {
throw new PropertyException("Can't subtract Numerics of different dimensions");
}
return numeric(op1.getNumericValue(context) + op2.getNumericValue(context), op1.getDimension());
}
-
+
/**
- * Add the second operand from the first and return a new Numeric
+ * Add the second operand from the first and return a new Numeric
* representing the result.
* @param op1 The first operand.
* @param op2 The second operand.
@@ -77,9 +77,9 @@ public class NumericOp {
}
return numeric(op1.getNumericValue(context) - op2.getNumericValue(context), op1.getDimension());
}
-
+
/**
- * Multiply the two operands and return a new Numeric representing the
+ * Multiply the two operands and return a new Numeric representing the
* result.
* @param op1 The first operand.
* @param op2 The second operand.
@@ -93,16 +93,16 @@ public class NumericOp {
} else {
return new RelativeNumericProperty(RelativeNumericProperty.MULTIPLY, op1, op2);
}
- }
+ }
public static Numeric multiply2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
- return numeric(op1.getNumericValue(context) * op2.getNumericValue(context),
+ return numeric(op1.getNumericValue(context) * op2.getNumericValue(context),
op1.getDimension() + op2.getDimension());
}
-
+
/**
- * Divide the second operand into the first and return a new
- * Numeric representing the
+ * Divide the second operand into the first and return a new
+ * Numeric representing the
* result.
* @param op1 The first operand.
* @param op2 The second operand.
@@ -117,12 +117,12 @@ public class NumericOp {
return new RelativeNumericProperty(RelativeNumericProperty.DIVIDE, op1, op2);
}
}
-
+
public static Numeric divide2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
- return numeric(op1.getNumericValue(context) / op2.getNumericValue(context),
+ return numeric(op1.getNumericValue(context) / op2.getNumericValue(context),
op1.getDimension() - op2.getDimension());
}
-
+
/**
* Return the remainder of a division of the two operand Numeric.
* @param op1 The first operand.
@@ -136,7 +136,7 @@ public class NumericOp {
return new RelativeNumericProperty(RelativeNumericProperty.MODULO, op1, op2);
}
}
-
+
public static Numeric modulo2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
return numeric(op1.getNumericValue(context) % op2.getNumericValue(context), op1.getDimension());
}
@@ -157,7 +157,7 @@ public class NumericOp {
public static Numeric abs2(Numeric op, PercentBaseContext context) throws PropertyException {
return numeric(Math.abs(op.getNumericValue(context)), op.getDimension());
}
-
+
/**
* Return the negation of a Numeric.
* @param op the operand.
@@ -174,7 +174,7 @@ public class NumericOp {
public static Numeric negate2(Numeric op, PercentBaseContext context) throws PropertyException {
return numeric(- op.getNumericValue(context), op.getDimension());
}
-
+
/**
* Return the larger of the two Numerics.
* @param op1 The first operand.
@@ -196,7 +196,7 @@ public class NumericOp {
}
return op1.getNumericValue(context) > op2.getNumericValue(context) ? op1 : op2;
}
-
+
/**
* Return the smaller of two Numerics.
* @param op1 The first operand.
@@ -218,9 +218,9 @@ public class NumericOp {
}
return op1.getNumericValue(context) <= op2.getNumericValue(context) ? op1 : op2;
}
-
+
/**
- * Create a new absolute numeric with the specified value and dimension.
+ * Create a new absolute numeric with the specified value and dimension.
* @param value
* @param dimension
* @return a new absolute numeric.
diff --git a/src/java/org/apache/fop/fo/expr/NumericProperty.java b/src/java/org/apache/fop/fo/expr/NumericProperty.java
index 54fe1f2f7..f80e1f5a5 100644
--- a/src/java/org/apache/fop/fo/expr/NumericProperty.java
+++ b/src/java/org/apache/fop/fo/expr/NumericProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import java.awt.Color;
@@ -30,7 +30,7 @@ import org.apache.fop.fo.properties.Property;
/**
* A numeric property which hold the final absolute result of an expression
- * calculations.
+ * calculations.
*/
public class NumericProperty extends Property implements Numeric, Length {
private double value;
diff --git a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
index 394035b49..5defda0fe 100644
--- a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
+++ b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,8 +40,8 @@ public class PPColWidthFunction extends FunctionBase {
return 1;
}
- /**
- * @return the {@link PercentBase} for the proportional-column-width()
+ /**
+ * @return the {@link PercentBase} for the proportional-column-width()
* function
*/
public PercentBase getPercentBase() {
@@ -68,7 +68,7 @@ public class PPColWidthFunction extends FunctionBase {
throw new PropertyException("proportional-column-width() function "
+ "may only be used on fo:table-column.");
}
-
+
Table t = (Table) pList.getParentFObj();
if (t.isAutoLayout()) {
throw new PropertyException("proportional-column-width() function "
@@ -96,6 +96,6 @@ public class PPColWidthFunction extends FunctionBase {
public int getDimension() {
return 0;
}
-
+
}
}
diff --git a/src/java/org/apache/fop/fo/expr/PropertyException.java b/src/java/org/apache/fop/fo/expr/PropertyException.java
index d16d1c8ff..2d1d04913 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyException.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyException.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ public class PropertyException extends FOPException {
this.propertyName = ((PropertyException)cause).propertyName;
}
}
-
+
/**
* Sets the property context information.
* @param propInfo the property info instance
diff --git a/src/java/org/apache/fop/fo/expr/PropertyInfo.java b/src/java/org/apache/fop/fo/expr/PropertyInfo.java
index 039e8783e..2bce0793f 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyInfo.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyInfo.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -94,7 +94,7 @@ public class PropertyInfo {
public PropertyMaker getPropertyMaker() {
return maker;
}
-
+
/**
* push a function onto the function stack
* @param func function to push onto stack
@@ -117,15 +117,15 @@ public class PropertyInfo {
/**
* Convenience shortcut to get a reference to the FOUserAgent
- *
+ *
* @return the FOUserAgent
*/
protected FOUserAgent getUserAgent() {
- return (plist.getFObj() != null)
- ? plist.getFObj().getUserAgent()
+ return (plist.getFObj() != null)
+ ? plist.getFObj().getUserAgent()
: null;
}
-
+
private PercentBase getFunctionPercentBase() {
if (stkFunction != null) {
Function f = (Function)stkFunction.peek();
diff --git a/src/java/org/apache/fop/fo/expr/PropertyParser.java b/src/java/org/apache/fop/fo/expr/PropertyParser.java
index c63142773..7ae1db7f3 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyParser.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ public final class PropertyParser extends PropertyTokenizer {
private static final String RELUNIT = "em";
private static final HashMap FUNCTION_TABLE = new HashMap();
-
+
static {
// Initialize the HashMap of XSL-defined functions
FUNCTION_TABLE.put("ceiling", new CeilingFunction());
@@ -310,10 +310,10 @@ public final class PropertyParser extends PropertyTokenizer {
propInfo.currentFontSize());
} else {
if ("px".equals(unitPart)) {
- //pass the ratio between source-resolution and
+ //pass the ratio between source-resolution and
//the default resolution of 72dpi
prop = FixedLength.getInstance(
- numPart, unitPart,
+ numPart, unitPart,
propInfo.getPropertyList().getFObj()
.getUserAgent().getSourceResolution() / 72.0f);
} else {
@@ -344,7 +344,7 @@ public final class PropertyParser extends PropertyTokenizer {
}
propInfo.popFunction();
return prop;
-
+
default:
// TODO: add the token or the expr to the error message.
throw new PropertyException("syntax error");
@@ -357,7 +357,7 @@ public final class PropertyParser extends PropertyTokenizer {
* Parse a comma separated list of function arguments. Each argument
* may itself be an expression. This method consumes the closing right
* parenthesis of the argument list.
- * @param function The function object for which the arguments are
+ * @param function The function object for which the arguments are
* collected.
* @return An array of Property objects representing the arguments
* found.
@@ -397,27 +397,27 @@ public final class PropertyParser extends PropertyTokenizer {
}
return args;
}
-
+
/**
- *
+ *
* Parse a comma separated list of function arguments. Each argument
* may itself be an expression. This method consumes the closing right
* parenthesis of the argument list.
- *
- * The method differs from parseArgs in that it accepts a variable
+ *
+ * The method differs from parseArgs in that it accepts a variable
* number of arguments.
- *
- * @param function The function object for which the arguments are
+ *
+ * @param function The function object for which the arguments are
* collected.
* @return An array of Property objects representing the arguments
* found.
* @throws PropertyException If the number of arguments found isn't equal
* to the number expected.
- *
- * TODO Merge this with parseArgs?
+ *
+ * TODO Merge this with parseArgs?
*/
Property[] parseVarArgs(Function function) throws PropertyException {
- // For variable argument functions the minimum number of arguments is returned as a
+ // For variable argument functions the minimum number of arguments is returned as a
// negative integer from the nbArgs method
int nbArgs = -function.nbArgs();
List args = new LinkedList();
diff --git a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
index 5fe5f4445..2ddcd0922 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/expr/RGBColorFunction.java b/src/java/org/apache/fop/fo/expr/RGBColorFunction.java
index ba39662eb..1c7a91503 100644
--- a/src/java/org/apache/fop/fo/expr/RGBColorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/RGBColorFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -28,7 +28,7 @@ import org.apache.fop.fo.properties.Property;
* Implements the rgb() function.
*/
class RGBColorFunction extends FunctionBase {
-
+
/** {@inheritDoc} */
public int nbArgs() {
return 3;
@@ -46,8 +46,8 @@ class RGBColorFunction extends FunctionBase {
/** {@inheritDoc} */
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
- return ColorProperty.getInstance(pInfo.getUserAgent(),
- "rgb(" + args[0] + ","
+ return ColorProperty.getInstance(pInfo.getUserAgent(),
+ "rgb(" + args[0] + ","
+ args[1] + "," + args[2] + ")");
}
diff --git a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
index 647528692..a4e257546 100755
--- a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
+++ b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,10 +27,10 @@ import org.apache.fop.fo.properties.TableColLength;
/**
- * This class represent a node in a property expression tree.
+ * This class represent a node in a property expression tree.
* It is created when an operation involve relative expression and is used
* to delay evaluation of the operation until the time where getNumericValue()
- * or getValue() is called.
+ * or getValue() is called.
*/
public class RelativeNumericProperty extends Property implements Length {
public static final int ADDITION = 1;
@@ -42,10 +42,10 @@ public class RelativeNumericProperty extends Property implements Length {
public static final int ABS = 7;
public static final int MAX = 8;
public static final int MIN = 9;
-
+
// Used in the toString() method, indexed by operation id.
private static String operations = " +-*/%";
-
+
/**
* The operation identifier.
*/
@@ -62,7 +62,7 @@ public class RelativeNumericProperty extends Property implements Length {
* The dimension of the result.
*/
private int dimension;
-
+
/**
* Constructor for a two argument operation.
* @param operation the operation opcode: ADDITION, SUBTRACTION, ...
@@ -124,12 +124,12 @@ public class RelativeNumericProperty extends Property implements Length {
case MIN:
return NumericOp.min2(op1, op2, context);
default:
- throw new PropertyException("Unknown expr operation " + operation);
+ throw new PropertyException("Unknown expr operation " + operation);
}
}
/**
- * Return the resolved (calculated) value of the expression.
+ * Return the resolved (calculated) value of the expression.
* {@inheritDoc}
*/
public double getNumericValue() throws PropertyException {
@@ -152,14 +152,14 @@ public class RelativeNumericProperty extends Property implements Length {
/**
* Return false since an expression is only created when there is relative
- * numerics involved.
+ * numerics involved.
*/
public boolean isAbsolute() {
return false;
}
/**
- * Cast this numeric as a Length.
+ * Cast this numeric as a Length.
*/
public Length getLength() {
if (dimension == 1) {
@@ -205,7 +205,7 @@ public class RelativeNumericProperty extends Property implements Length {
* If this value is not 0, the actual value of the Length cannot be known
* without looking at all of the columns in the table to determine the value
* of a "table-unit".
- *
+ *
* @return The number of table units which are included in this length
* specification.
*/
@@ -261,7 +261,7 @@ public class RelativeNumericProperty extends Property implements Length {
*/
public String toString() {
switch (operation) {
- case ADDITION: case SUBTRACTION:
+ case ADDITION: case SUBTRACTION:
case DIVIDE: case MULTIPLY: case MODULO:
return "(" + op1 + " " + operations.charAt(operation) + op2 + ")";
case NEGATE:
diff --git a/src/java/org/apache/fop/fo/expr/RoundFunction.java b/src/java/org/apache/fop/fo/expr/RoundFunction.java
index a28a46e28..a29c33e5b 100644
--- a/src/java/org/apache/fop/fo/expr/RoundFunction.java
+++ b/src/java/org/apache/fop/fo/expr/RoundFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
diff --git a/src/java/org/apache/fop/fo/expr/SystemColorFunction.java b/src/java/org/apache/fop/fo/expr/SystemColorFunction.java
index b32c38e54..eeb1870f7 100644
--- a/src/java/org/apache/fop/fo/expr/SystemColorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/SystemColorFunction.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.apps.FOUserAgent;
@@ -27,7 +27,7 @@ import org.apache.fop.fo.properties.Property;
* Implements the system-color() function.
*/
class SystemColorFunction extends FunctionBase {
-
+
/** {@inheritDoc} */
public int nbArgs() {
return 1;
@@ -36,8 +36,8 @@ class SystemColorFunction extends FunctionBase {
/** {@inheritDoc} */
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
- FOUserAgent ua = (pInfo == null)
- ? null
+ FOUserAgent ua = (pInfo == null)
+ ? null
: (pInfo.getFO() == null ? null : pInfo.getFO().getUserAgent());
return ColorProperty.getInstance(ua, "system-color(" + args[0] + ")");
diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionAttachment.java b/src/java/org/apache/fop/fo/extensions/ExtensionAttachment.java
index ed4f69041..993768c81 100644
--- a/src/java/org/apache/fop/fo/extensions/ExtensionAttachment.java
+++ b/src/java/org/apache/fop/fo/extensions/ExtensionAttachment.java
@@ -35,5 +35,5 @@ public interface ExtensionAttachment {
* @return the category URI
*/
String getCategory();
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
index fc61167b2..56521b7e8 100644
--- a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,12 +33,12 @@ import org.apache.fop.fo.extensions.destination.Destination;
* Element mapping for FOP's proprietary extension to XSL-FO.
*/
public class ExtensionElementMapping extends ElementMapping {
-
+
/** The FOP extension namespace URI */
public static final String URI = "http://xmlgraphics.apache.org/fop/extensions";
private static final Set propertyAttributes = new java.util.HashSet();
-
+
static {
//These are FOP's standard extension properties (fox:*)
propertyAttributes.add("block-progression-unit");
@@ -46,7 +46,7 @@ public class ExtensionElementMapping extends ElementMapping {
propertyAttributes.add("orphan-content-limit");
propertyAttributes.add("internal-destination");
}
-
+
/**
* Constructor.
*/
@@ -66,7 +66,7 @@ public class ExtensionElementMapping extends ElementMapping {
foObjs.put("external-document", new ExternalDocumentMaker());
}
}
-
+
static class DestinationMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new Destination(parent);
@@ -83,7 +83,7 @@ public class ExtensionElementMapping extends ElementMapping {
public String getStandardPrefix() {
return "fox";
}
-
+
/** {@inheritDoc} */
public boolean isAttributeProperty(QName attributeName) {
if (!URI.equals(attributeName.getNamespaceURI())) {
@@ -91,5 +91,5 @@ public class ExtensionElementMapping extends ElementMapping {
}
return propertyAttributes.contains(attributeName.getLocalName());
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionObj.java b/src/java/org/apache/fop/fo/extensions/ExtensionObj.java
index f22c6fbbc..da732f421 100644
--- a/src/java/org/apache/fop/fo/extensions/ExtensionObj.java
+++ b/src/java/org/apache/fop/fo/extensions/ExtensionObj.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ public abstract class ExtensionObj extends FObj {
/**
* {@inheritDoc}
*/
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList pList)
throws FOPException
{
@@ -53,9 +53,9 @@ public abstract class ExtensionObj extends FObj {
}
/**
- * Create a default property list for this element.
+ * Create a default property list for this element.
*/
- protected PropertyList createPropertyList(PropertyList parent,
+ protected PropertyList createPropertyList(PropertyList parent,
FOEventHandler foEventHandler) throws FOPException {
return null;
}
diff --git a/src/java/org/apache/fop/fo/extensions/ExternalDocument.java b/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
index b8707726f..bea6f6f61 100644
--- a/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
+++ b/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -76,7 +76,7 @@ public class ExternalDocument extends AbstractPageSequence implements GraphicsPr
textAlign = pList.get(PR_TEXT_ALIGN).getEnum();
width = pList.get(PR_WIDTH).getLength();
src = pList.get(PR_SRC).getString();
-
+
if (this.src == null || this.src.length() == 0) {
missingPropertyError("src");
}
diff --git a/src/java/org/apache/fop/fo/extensions/OldExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/OldExtensionElementMapping.java
index fb1810db1..e5ab93c35 100644
--- a/src/java/org/apache/fop/fo/extensions/OldExtensionElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/OldExtensionElementMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ import org.apache.fop.fo.UnknownXMLObj;
* Element mapping for the old FOP extension namespace.
*/
public class OldExtensionElementMapping extends ElementMapping {
-
+
/** The old FOP extension namespace URI (FOP 0.20.5 and earlier) */
public static final String URI = "http://xml.apache.org/fop/extensions";
diff --git a/src/java/org/apache/fop/fo/extensions/destination/Destination.java b/src/java/org/apache/fop/fo/extensions/destination/Destination.java
index e3a2bbac4..98114bb23 100644
--- a/src/java/org/apache/fop/fo/extensions/destination/Destination.java
+++ b/src/java/org/apache/fop/fo/extensions/destination/Destination.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -50,14 +50,14 @@ public class Destination extends FONode {
/**
* {@inheritDoc}
*/
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList pList) throws FOPException {
internalDestination = attlist.getValue("internal-destination");
if (internalDestination == null || internalDestination.length() == 0) {
missingPropertyError("internal-destination");
}
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
index a39562877..2cc451b64 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,10 +32,10 @@ import org.w3c.dom.DOMImplementation;
* of the http://xml.apache.org/batik/ext namespace.
*/
public class BatikExtensionElementMapping extends ElementMapping {
-
+
/** Namespace URI for Batik extension elements */
public static final String URI = "http://xml.apache.org/batik/ext";
-
+
private boolean batikAvail = true;
/** Main constructor. */
diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
index 7711130b1..a40b80190 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -65,14 +65,14 @@ public class SVGElement extends SVGObj {
* {@inheritDoc}
*/
public ContentHandlerFactory getContentHandlerFactory() {
- return new DOMBuilderContentHandlerFactory(getNamespaceURI(),
+ return new DOMBuilderContentHandlerFactory(getNamespaceURI(),
SVGDOMImplementation.getDOMImplementation());
}
-
+
/**
* {@inheritDoc}
*/
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList) throws FOPException {
super.processNode(elementName, locator, attlist, propertyList);
init();
@@ -91,11 +91,11 @@ public class SVGElement extends SVGObj {
/* if width and height are zero, get the bounds of the content. */
try {
- URL baseURL = new URL(getUserAgent().getBaseURL() == null
- ? new java.io.File("").toURI().toURL().toExternalForm()
+ URL baseURL = new URL(getUserAgent().getBaseURL() == null
+ ? new java.io.File("").toURI().toURL().toExternalForm()
: getUserAgent().getBaseURL());
if (baseURL != null) {
- SVGOMDocument svgdoc = (SVGOMDocument)doc;
+ SVGOMDocument svgdoc = (SVGOMDocument)doc;
svgdoc.setURLObject(baseURL);
//The following line should not be called to leave FOP compatible to Batik 1.6.
//svgdoc.setDocumentURI(baseURL.toString());
diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java b/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
index 586fd2d92..167baf723 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,13 +37,13 @@ import org.w3c.dom.DOMImplementation;
* that create the SVG Document.
*/
public class SVGElementMapping extends ElementMapping {
-
+
/** the SVG namespace */
public static final String URI = SVGDOMImplementation.SVG_NAMESPACE_URI;
-
+
/** logging instance */
protected Log log = LogFactory.getLog(SVGElementMapping.class);
-
+
private boolean batikAvailable = true;
/** Main constructor. */
diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGObj.java b/src/java/org/apache/fop/fo/extensions/svg/SVGObj.java
index 93193aac4..b23e0f6c6 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/SVGObj.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/SVGObj.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,7 +27,7 @@ import org.apache.fop.fo.XMLObj;
* This aids in the construction of the SVG Document.
*/
public class SVGObj extends XMLObj {
-
+
/**
* Constructs an SVG object (called by Maker).
*
@@ -46,6 +46,6 @@ public class SVGObj extends XMLObj {
public String getNormalNamespacePrefix() {
return "svg";
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/AbstractMetadataElement.java b/src/java/org/apache/fop/fo/extensions/xmp/AbstractMetadataElement.java
index 0fff78623..f4b770bbe 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/AbstractMetadataElement.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/AbstractMetadataElement.java
@@ -32,7 +32,7 @@ import org.apache.xmlgraphics.xmp.Metadata;
public abstract class AbstractMetadataElement extends FONode implements ObjectBuiltListener {
private XMPMetadata attachment;
-
+
/**
* Main constructor.
* @param parent the parent formatting object
@@ -40,14 +40,14 @@ public abstract class AbstractMetadataElement extends FONode implements ObjectBu
public AbstractMetadataElement(FONode parent) {
super(parent);
}
-
+
/**
* {@inheritDoc}
*/
public ContentHandlerFactory getContentHandlerFactory() {
return new XMPContentHandlerFactory();
}
-
+
/** {@inheritDoc} */
public ExtensionAttachment getExtensionAttachment() {
if (parent instanceof FObj) {
@@ -65,5 +65,5 @@ public abstract class AbstractMetadataElement extends FONode implements ObjectBu
attachment.setMetadata((Metadata)obj);
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/RDFElement.java b/src/java/org/apache/fop/fo/extensions/xmp/RDFElement.java
index 6a67575c5..cf1c40c4a 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/RDFElement.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/RDFElement.java
@@ -34,7 +34,7 @@ public class RDFElement extends AbstractMetadataElement {
public RDFElement(FONode parent) {
super(parent);
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "RDF";
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/RDFElementMapping.java b/src/java/org/apache/fop/fo/extensions/xmp/RDFElementMapping.java
index e2aa1ba95..ff84ee11f 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/RDFElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/RDFElementMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.w3c.dom.DOMImplementation;
* Setup the element mapping for XMP metadata.
*/
public class RDFElementMapping extends ElementMapping {
-
+
/** Main constructor. */
public RDFElementMapping() {
namespaceURI = XMPConstants.RDF_NAMESPACE;
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPContentHandlerFactory.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPContentHandlerFactory.java
index 5c30801f2..02a74b86d 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/XMPContentHandlerFactory.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPContentHandlerFactory.java
@@ -30,7 +30,7 @@ import org.xml.sax.SAXException;
*/
public class XMPContentHandlerFactory implements ContentHandlerFactory {
- private static final String[] NAMESPACES = new String[]
+ private static final String[] NAMESPACES = new String[]
{XMPConstants.XMP_NAMESPACE, XMPConstants.RDF_NAMESPACE};
/** {@inheritDoc} */
@@ -49,7 +49,7 @@ public class XMPContentHandlerFactory implements ContentHandlerFactory {
private class FOPXMPHandler extends XMPHandler implements ObjectSource {
private ObjectBuiltListener obListener;
-
+
public Object getObject() {
return getMetadata();
}
@@ -58,14 +58,14 @@ public class XMPContentHandlerFactory implements ContentHandlerFactory {
public void setObjectBuiltListener(ObjectBuiltListener listener) {
this.obListener = listener;
}
-
+
/** {@inheritDoc} */
public void endDocument() throws SAXException {
if (obListener != null) {
obListener.notifyObjectBuilt(getObject());
}
}
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPElementMapping.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPElementMapping.java
index dd250f8b4..b2b3570f2 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/XMPElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPElementMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.w3c.dom.DOMImplementation;
* Setup the element mapping for XMP metadata.
*/
public class XMPElementMapping extends ElementMapping {
-
+
/** Main constructor. */
public XMPElementMapping() {
namespaceURI = XMPConstants.XMP_NAMESPACE;
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetaElement.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetaElement.java
index 2d3058d3f..f99ccd2aa 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetaElement.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetaElement.java
@@ -34,7 +34,7 @@ public class XMPMetaElement extends AbstractMetadataElement {
public XMPMetaElement(FONode parent) {
super(parent);
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "xmpmeta";
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java
index bdfd1fc29..224741294 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java
@@ -35,7 +35,7 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
/** The category URI for this extension attachment. */
public static final String CATEGORY = XMPConstants.XMP_NAMESPACE;
-
+
private Metadata meta;
private boolean readOnly = true;
@@ -45,7 +45,7 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
public XMPMetadata() {
//nop
}
-
+
/**
* Default constructor.
* @param metadata the XMP metadata
@@ -53,12 +53,12 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
public XMPMetadata(Metadata metadata) {
this.meta = metadata;
}
-
+
/** @return the XMP metadata */
public Metadata getMetadata() {
return this.meta;
}
-
+
/**
* Sets the XMP metadata.
* @param metadata the XMP metadata
@@ -66,7 +66,7 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
public void setMetadata(Metadata metadata) {
this.meta = metadata;
}
-
+
/** @return true if the XMP metadata is marked read-only. */
public boolean isReadOnly() {
return readOnly;
@@ -84,10 +84,10 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
public String getCategory() {
return CATEGORY;
}
-
+
/** {@inheritDoc} */
public void toSAX(ContentHandler handler) throws SAXException {
getMetadata().toSAX(handler);
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/AbstractGraphics.java b/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
index 19cea1510..d72682282 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
index 092358891..b0e93e9c6 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ public abstract class AbstractListItemPart extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public AbstractListItemPart(FONode parent) {
@@ -62,7 +62,7 @@ public abstract class AbstractListItemPart extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
diff --git a/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java b/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
index 8849d4d1c..5f420efb8 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,12 +38,12 @@ import org.apache.fop.fo.properties.SpaceProperty;
/**
* Common base class for the
- * fo:page-number-citation
and
+ * fo:page-number-citation
and
*
* fo:page-number-citation-last
objects.
*/
public abstract class AbstractPageNumberCitation extends FObj {
-
+
// The value of properties relevant for fo:page-number-citation(-last).
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private CommonFont commonFont;
@@ -73,12 +73,12 @@ public abstract class AbstractPageNumberCitation extends FObj {
// private int wrapOption;
// End of property values
- // Properties which are not explicitely listed but are still applicable
+ // Properties which are not explicitely listed but are still applicable
private Color color;
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public AbstractPageNumberCitation(FONode parent) {
@@ -99,7 +99,7 @@ public abstract class AbstractPageNumberCitation extends FObj {
refId = pList.get(PR_REF_ID).getString();
textDecoration = pList.getTextDecorationProps();
// textShadow = pList.get(PR_TEXT_SHADOW);
-
+
// implicit properties
color = pList.get(Constants.PR_COLOR).getColor(getUserAgent());
}
@@ -116,7 +116,7 @@ public abstract class AbstractPageNumberCitation extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -135,29 +135,29 @@ public abstract class AbstractPageNumberCitation extends FObj {
/** @return the "text-decoration" property. */
public CommonTextDecoration getTextDecoration() {
- return textDecoration;
+ return textDecoration;
}
-
+
/** @return the "alignment-adjust" property */
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** @return the {@link CommonBorderPaddingBackground} */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return commonBorderPaddingBackground;
@@ -167,10 +167,10 @@ public abstract class AbstractPageNumberCitation extends FObj {
public SpaceProperty getLineHeight() {
return lineHeight;
}
-
+
/** @return the "ref-id" property. */
public String getRefId() {
return refId;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java b/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
index c88147350..ebba1fda5 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/flow/BasicLink.java b/src/java/org/apache/fop/fo/flow/BasicLink.java
index 82d0134bd..ee3171188 100644
--- a/src/java/org/apache/fop/fo/flow/BasicLink.java
+++ b/src/java/org/apache/fop/fo/flow/BasicLink.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.fop.fo.ValidationException;
* fo:basic-link
object.
*
* This class contains the logic to determine the link represented by this FO,
- * and whether that link is external (uses a URI) or internal (an id
+ * and whether that link is external (uses a URI) or internal (an id
* reference).
*/
public class BasicLink extends Inline {
@@ -55,7 +55,7 @@ public class BasicLink extends Inline {
/**
* Construct a BasicLink instance with the given {@link FONode}
* as its parent.
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public BasicLink(FONode parent) {
@@ -74,8 +74,8 @@ public class BasicLink extends Inline {
// targetPresentationContext = pList.get(PR_TARGET_PRESENTATION_CONTEXT);
// targetStylesheet = pList.get(PR_TARGET_STYLESHEET);
- // per spec, internal takes precedence if both specified
- if (internalDestination.length() > 0) {
+ // per spec, internal takes precedence if both specified
+ if (internalDestination.length() > 0) {
externalDestination = null;
} else if (externalDestination.length() == 0) {
// slightly stronger than spec "should be specified"
@@ -96,7 +96,7 @@ public class BasicLink extends Inline {
}
/** {@inheritDoc} */
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -162,7 +162,7 @@ public class BasicLink extends Inline {
public String getLocalName() {
return "basic-link";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_BASIC_LINK}
diff --git a/src/java/org/apache/fop/fo/flow/BidiOverride.java b/src/java/org/apache/fop/fo/flow/BidiOverride.java
index 492e6c4ba..6e4a74379 100644
--- a/src/java/org/apache/fop/fo/flow/BidiOverride.java
+++ b/src/java/org/apache/fop/fo/flow/BidiOverride.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -54,12 +54,12 @@ public class BidiOverride extends FObjMixed {
/**
* Base constructor
- *
+ *
* @param parent FONode that is the parent of this object
*/
public BidiOverride(FONode parent) {
super(parent);
-
+
/* Check to see if this node can have block-level children.
* See validateChildNode() below.
*/
@@ -94,15 +94,15 @@ public class BidiOverride extends FObjMixed {
*
XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
*
Additionally: "An fo:bidi-override that is a descendant of an fo:leader
* or of the fo:inline child of an fo:footnote may not have block-level
- * children, unless it has a nearer ancestor that is an
+ * children, unless it has a nearer ancestor that is an
* fo:inline-container."
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:marker",
+ nodesOutOfOrderError(loc, "fo:marker",
"(#PCDATA|%inline;|%block;)");
}
} else if (!isBlockOrInlineItem(nsURI, localName)) {
diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java
index 40175ce49..d1df9c21d 100644
--- a/src/java/org/apache/fop/fo/flow/Block.java
+++ b/src/java/org/apache/fop/fo/flow/Block.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -86,10 +86,10 @@ public class Block extends FObjMixed {
// private Length textAltitude;
// private int visibility;
// End of property values
-
+
/**
* Base constructor
- *
+ *
* @param parent FONode that is the parent of this object
*
*/
@@ -254,22 +254,22 @@ public class Block extends FObjMixed {
*
XSL Content Model: marker* initial-property-set? (#PCDATA|%inline;|%block;)*
*
Additionally: "An fo:bidi-override that is a descendant of an fo:leader
* or of the fo:inline child of an fo:footnote may not have block-level
- * children, unless it has a nearer ancestor that is an
+ * children, unless it has a nearer ancestor that is an
* fo:inline-container."
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if ("marker".equals(localName)) {
if (blockOrInlineItemFound || initialPropertySetFound) {
- nodesOutOfOrderError(loc, "fo:marker",
+ nodesOutOfOrderError(loc, "fo:marker",
"initial-property-set? (#PCDATA|%inline;|%block;)");
}
} else if ("initial-property-set".equals(localName)) {
if (initialPropertySetFound) {
tooManyNodesError(loc, "fo:initial-property-set");
} else if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:initial-property-set",
+ nodesOutOfOrderError(loc, "fo:initial-property-set",
"(#PCDATA|%inline;|%block;)");
} else {
initialPropertySetFound = true;
@@ -286,17 +286,17 @@ public class Block extends FObjMixed {
public int getLinefeedTreatment() {
return linefeedTreatment;
}
-
+
/** @return the "white-space-treatment" property */
public int getWhitespaceTreatment() {
return whiteSpaceTreatment;
}
-
+
/** @return the "white-space-collapse" property */
public int getWhitespaceCollapse() {
return whiteSpaceCollapse;
}
-
+
/** @return the {@link CommonRelativePosition} */
public CommonRelativePosition getCommonRelativePosition() {
return this.commonRelativePosition;
@@ -334,5 +334,5 @@ public class Block extends FObjMixed {
public int getNameId() {
return FO_BLOCK;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java
index 431dae954..25b3f2a2a 100644
--- a/src/java/org/apache/fop/fo/flow/BlockContainer.java
+++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -67,7 +67,7 @@ public class BlockContainer extends FObj {
/**
* Creates a new BlockContainer instance as a child of
* the given {@link FONode}.
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public BlockContainer(FONode parent) {
@@ -104,13 +104,13 @@ public class BlockContainer extends FObj {
/**
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
- *
BUT: "In addition an fo:block-container that does not generate an
- * absolutely positioned area may have a sequence of zero or more
+ *
BUT: "In addition an fo:block-container that does not generate an
+ * absolutely positioned area may have a sequence of zero or more
* fo:markers as its initial children."
* The latter refers to block-containers with absolute-position="absolute"
* or absolute-position="fixed".
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if ("marker".equals(localName)) {
@@ -148,7 +148,7 @@ public class BlockContainer extends FObj {
public CommonAbsolutePosition getCommonAbsolutePosition() {
return commonAbsolutePosition;
}
-
+
/** @return the {@link CommonMarginBlock} */
public CommonMarginBlock getCommonMarginBlock() {
return commonMarginBlock;
@@ -170,7 +170,7 @@ public class BlockContainer extends FObj {
public int getDisplayAlign() {
return displayAlign;
}
-
+
/** @return the "break-after" property. */
public int getBreakAfter() {
return breakAfter;
@@ -220,12 +220,12 @@ public class BlockContainer extends FObj {
public int getWritingMode() {
return writingMode;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "block-container";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_BLOCK_CONTAINER}
diff --git a/src/java/org/apache/fop/fo/flow/Character.java b/src/java/org/apache/fop/fo/flow/Character.java
index 7fd98b0ef..f76b3225d 100644
--- a/src/java/org/apache/fop/fo/flow/Character.java
+++ b/src/java/org/apache/fop/fo/flow/Character.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -120,7 +120,7 @@ public class Character extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -161,25 +161,25 @@ public class Character extends FObj {
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** @return the "letter-spacing" property */
public Property getLetterSpacing() {
- return letterSpacing;
+ return letterSpacing;
}
/** @return the "line-height" property */
@@ -189,29 +189,29 @@ public class Character extends FObj {
/** @return the "text-decoration" property. */
public CommonTextDecoration getTextDecoration() {
- return textDecoration;
+ return textDecoration;
}
-
+
/** @return the "word-spacing" property */
public Property getWordSpacing() {
- return wordSpacing;
+ return wordSpacing;
}
/** @return the "keep-with-next" property */
public KeepProperty getKeepWithNext() {
return keepWithNext;
}
-
+
/** @return the "keep-with-previous" property */
public KeepProperty getKeepWithPrevious() {
return keepWithPrevious;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "character";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_CHARACTER}
@@ -219,16 +219,16 @@ public class Character extends FObj {
public int getNameId() {
return FO_CHARACTER;
}
-
+
private class FOCharIterator extends CharIterator {
private boolean bFirst = true;
private Character foChar;
-
+
FOCharIterator(Character foChar) {
this.foChar = foChar;
}
-
+
public boolean hasNext() {
return bFirst;
}
diff --git a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
index bfe54cbd9..fa952000d 100644
--- a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
+++ b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ import org.apache.fop.fo.properties.FixedLength;
* inline area that can be added to the area tree.
*/
public class ExternalGraphic extends AbstractGraphics {
-
+
// The value of properties relevant for fo:external-graphic.
// All but one of the e-g properties are kept in AbstractGraphics
private String src;
@@ -56,7 +56,7 @@ public class ExternalGraphic extends AbstractGraphics {
private int intrinsicWidth;
private int intrinsicHeight;
private Length intrinsicAlignmentAdjust;
-
+
/**
* Create a new ExternalGraphic node that is a child
* of the given {@link FONode}.
@@ -71,7 +71,7 @@ public class ExternalGraphic extends AbstractGraphics {
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
src = pList.get(PR_SRC).getString();
-
+
//Additional processing: obtain the image's intrinsic size and baseline information
url = URISpecification.getURL(src);
FOUserAgent userAgent = getUserAgent();
@@ -113,7 +113,7 @@ public class ExternalGraphic extends AbstractGraphics {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
diff --git a/src/java/org/apache/fop/fo/flow/Float.java b/src/java/org/apache/fop/fo/flow/Float.java
index 90bc423fd..815b30393 100644
--- a/src/java/org/apache/fop/fo/flow/Float.java
+++ b/src/java/org/apache/fop/fo/flow/Float.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,15 +39,15 @@ public class Float extends FObj {
// End of property values
static boolean notImplementedWarningGiven = false;
-
+
/**
* Base constructor
- *
+ *
* @param parent the parent {@link FONode}
*/
public Float(FONode parent) {
super(parent);
-
+
if (!notImplementedWarningGiven) {
getFOValidationEventProducer().unimplementedFeature(this, getName(),
getName(), getLocator());
@@ -64,7 +64,7 @@ public class Float extends FObj {
* {@inheritDoc}
*
XSL Content Model: (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockItem(nsURI, localName)) {
@@ -84,7 +84,7 @@ public class Float extends FObj {
public String getLocalName() {
return "float";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_FLOAT}
diff --git a/src/java/org/apache/fop/fo/flow/Footnote.java b/src/java/org/apache/fop/fo/flow/Footnote.java
index 5b13b502c..e73701c3b 100644
--- a/src/java/org/apache/fop/fo/flow/Footnote.java
+++ b/src/java/org/apache/fop/fo/flow/Footnote.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,7 +42,7 @@ public class Footnote extends FObj {
/**
* Create a Footnote instance that is a child of the
* given {@link FONode}
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public Footnote(FONode parent) {
@@ -53,7 +53,7 @@ public class Footnote extends FObj {
public void bind(PropertyList pList) throws FOPException {
// No active properties -> do nothing.
}
-
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
getFOEventHandler().startFootnote(this);
@@ -62,7 +62,7 @@ public class Footnote extends FObj {
/**
* Make sure content model satisfied, if so then tell the
* {@link org.apache.fop.fo.FOEventHandler} that we are at the end of the footnote.
- *
+ *
* {@inheritDoc}
*/
protected void endOfNode() throws FOPException {
@@ -78,11 +78,11 @@ public class Footnote extends FObj {
*
XSL Content Model: (inline,footnote-body)
* @todo implement additional constraint: A fo:footnote is not permitted
* to have a fo:float, fo:footnote, or fo:marker as a descendant.
- * @todo implement additional constraint: A fo:footnote is not
- * permitted to have as a descendant a fo:block-container that
+ * @todo implement additional constraint: A fo:footnote is not
+ * permitted to have as a descendant a fo:block-container that
* generates an absolutely positioned area.
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("inline")) {
@@ -94,7 +94,7 @@ public class Footnote extends FObj {
nodesOutOfOrderError(loc, "fo:inline", "fo:footnote-body");
} else if (footnoteBody != null) {
tooManyNodesError(loc, "fo:footnote-body");
- }
+ }
} else {
invalidChildError(loc, nsURI, localName);
}
@@ -112,7 +112,7 @@ public class Footnote extends FObj {
/**
* Public accessor for inline FO
- *
+ *
* @return the {@link Inline} child
*/
public Inline getFootnoteCitation() {
@@ -121,7 +121,7 @@ public class Footnote extends FObj {
/**
* Public accessor for footnote-body FO
- *
+ *
* @return the {@link FootnoteBody} child
*/
public FootnoteBody getFootnoteBody() {
@@ -132,7 +132,7 @@ public class Footnote extends FObj {
public String getLocalName() {
return "footnote";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_FOOTNOTE}
diff --git a/src/java/org/apache/fop/fo/flow/FootnoteBody.java b/src/java/org/apache/fop/fo/flow/FootnoteBody.java
index 711d56c60..eb26a2009 100644
--- a/src/java/org/apache/fop/fo/flow/FootnoteBody.java
+++ b/src/java/org/apache/fop/fo/flow/FootnoteBody.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,7 +39,7 @@ public class FootnoteBody extends FObj {
/**
* Base constructor
- *
+ *
* @param parent FONode that is the parent of this object
*/
public FootnoteBody(FONode parent) {
@@ -57,7 +57,7 @@ public class FootnoteBody extends FObj {
/**
* Make sure the content model is satisfied, if so then tell the
- * {@link org.apache.fop.fo.FOEventHandler} that we are at the
+ * {@link org.apache.fop.fo.FOEventHandler} that we are at the
* end of the footnote-body.
* {@inheritDoc}
*/
@@ -72,7 +72,7 @@ public class FootnoteBody extends FObj {
* {@inheritDoc}
*
XSL Content Model: (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockItem(nsURI, localName)) {
@@ -85,7 +85,7 @@ public class FootnoteBody extends FObj {
public String getLocalName() {
return "footnote-body";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_FOOTNOTE_BODY}
diff --git a/src/java/org/apache/fop/fo/flow/InitialPropertySet.java b/src/java/org/apache/fop/fo/flow/InitialPropertySet.java
index a7f62535f..0df7379f2 100644
--- a/src/java/org/apache/fop/fo/flow/InitialPropertySet.java
+++ b/src/java/org/apache/fop/fo/flow/InitialPropertySet.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -53,7 +53,7 @@ public class InitialPropertySet extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public InitialPropertySet(FONode parent) {
@@ -72,7 +72,7 @@ public class InitialPropertySet extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -88,7 +88,7 @@ public class InitialPropertySet extends FObj {
public String getLocalName() {
return "initial-property-set";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_INITIAL_PROPERTY_SET}
diff --git a/src/java/org/apache/fop/fo/flow/Inline.java b/src/java/org/apache/fop/fo/flow/Inline.java
index a770b0f06..dae7d306b 100644
--- a/src/java/org/apache/fop/fo/flow/Inline.java
+++ b/src/java/org/apache/fop/fo/flow/Inline.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,7 +52,7 @@ public class Inline extends InlineLevel {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public Inline(FONode parent) {
@@ -71,7 +71,7 @@ public class Inline extends InlineLevel {
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
-
+
/* Check to see if this node can have block-level children.
* See validateChildNode() below.
*/
@@ -106,12 +106,12 @@ public class Inline extends InlineLevel {
* or fo:footnote may not have block-level children, unless it has a
* nearer ancestor that is an fo:inline-container." (paraphrased)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:marker",
+ nodesOutOfOrderError(loc, "fo:marker",
"(#PCDATA|%inline;|%block;)");
}
} else if (!isBlockOrInlineItem(nsURI, localName)) {
@@ -128,27 +128,27 @@ public class Inline extends InlineLevel {
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "inline";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_INLINE}
diff --git a/src/java/org/apache/fop/fo/flow/InlineContainer.java b/src/java/org/apache/fop/fo/flow/InlineContainer.java
index c26730b3a..d2422a24b 100644
--- a/src/java/org/apache/fop/fo/flow/InlineContainer.java
+++ b/src/java/org/apache/fop/fo/flow/InlineContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,7 +39,7 @@ import org.apache.fop.fo.properties.SpaceProperty;
* fo:inline-container
object.
*/
public class InlineContainer extends FObj {
-
+
// The value of properties relevant for fo:inline-container.
private Length alignmentAdjust;
private int alignmentBaseline;
@@ -69,7 +69,7 @@ public class InlineContainer extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public InlineContainer(FONode parent) {
@@ -99,7 +99,7 @@ public class InlineContainer extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -125,27 +125,27 @@ public class InlineContainer extends FObj {
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "block-progression-dimension" property */
public LengthRangeProperty getBlockProgressionDimension() {
return blockProgressionDimension;
}
-
+
/** @return the "clip" property */
public int getClip() {
return clip;
}
-
+
/**@return Returns the {@link CommonBorderPaddingBackground} */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return this.commonBorderPaddingBackground;
@@ -160,17 +160,17 @@ public class InlineContainer extends FObj {
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** @return the "keep-together" property */
public KeepProperty getKeepTogether() {
return keepTogether;
}
-
+
/** @return the "inline-progression-dimension" property */
public LengthRangeProperty getInlineProgressionDimension() {
return inlineProgressionDimension;
}
-
+
/** @return the "line-height" property */
public SpaceProperty getLineHeight() {
return lineHeight;
@@ -180,22 +180,22 @@ public class InlineContainer extends FObj {
public int getOverflow() {
return overflow;
}
-
+
/** @return the "reference-orientation" property */
public int getReferenceOrientation() {
return referenceOrientation.getValue();
}
-
+
/** @return the "writing-mode" property */
public int getWritingMode() {
return writingMode;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "inline-container";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_INLINE_CONTAINER}
@@ -203,5 +203,5 @@ public class InlineContainer extends FObj {
public int getNameId() {
return FO_INLINE_CONTAINER;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/InlineLevel.java b/src/java/org/apache/fop/fo/flow/InlineLevel.java
index 92af98d3c..5410e1ca7 100644
--- a/src/java/org/apache/fop/fo/flow/InlineLevel.java
+++ b/src/java/org/apache/fop/fo/flow/InlineLevel.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@ import org.apache.fop.fo.properties.SpaceProperty;
* formatting objects.
*/
public abstract class InlineLevel extends FObjMixed {
-
+
// The value of properties relevant for inline-level FOs.
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private CommonMarginInline commonMarginInline;
@@ -49,7 +49,7 @@ public abstract class InlineLevel extends FObjMixed {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
protected InlineLevel(FONode parent) {
@@ -76,7 +76,7 @@ public abstract class InlineLevel extends FObjMixed {
/** @return the {@link CommonBorderPaddingBackground} */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return commonBorderPaddingBackground;
- }
+ }
/** @return the {@link CommonFont} */
public CommonFont getCommonFont() {
@@ -92,15 +92,15 @@ public abstract class InlineLevel extends FObjMixed {
public SpaceProperty getLineHeight() {
return lineHeight;
}
-
+
/** @return the "keep-with-next" property */
public KeepProperty getKeepWithNext() {
return keepWithNext;
}
-
+
/** @return the "keep-with-previous" property */
public KeepProperty getKeepWithPrevious() {
return keepWithPrevious;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
index 3583087d4..fe478770e 100644
--- a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
+++ b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,7 +38,7 @@ import org.apache.fop.fo.XMLObj;
* This is an atomic inline object that contains XML data.
*/
public class InstreamForeignObject extends AbstractGraphics {
-
+
// The value of properties relevant for fo:instream-foreign-object.
// All property values contained in AbstractGraphics
// End of property values
@@ -48,9 +48,9 @@ public class InstreamForeignObject extends AbstractGraphics {
private boolean instrisicSizeDetermined;
private Length intrinsicAlignmentAdjust;
-
+
/**
- * Constructs an instream-foreign-object object
+ * Constructs an instream-foreign-object object
* (called by {@link org.apache.fop.fo.ElementMapping.Maker}).
*
* @param parent the parent {@link FONode}
@@ -61,7 +61,7 @@ public class InstreamForeignObject extends AbstractGraphics {
/**
* Make sure content model satisfied, if so then tell the
- * {@link org.apache.fop.fo.FOEventHandler} that we are at
+ * {@link org.apache.fop.fo.FOEventHandler} that we are at
* the end of the instream-foreign-object.
* {@inheritDoc}
*/
@@ -76,7 +76,7 @@ public class InstreamForeignObject extends AbstractGraphics {
* {@inheritDoc}
*
XSL Content Model: one (1) non-XSL namespace child
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -89,7 +89,7 @@ public class InstreamForeignObject extends AbstractGraphics {
public String getLocalName() {
return "instream-foreign-object";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_INSTREAM_FOREIGN_OBJECT}
@@ -139,7 +139,7 @@ public class InstreamForeignObject extends AbstractGraphics {
prepareIntrinsicSize();
return intrinsicAlignmentAdjust;
}
-
+
/** {@inheritDoc} */
protected void addChildNode(FONode child) throws FOPException {
super.addChildNode(child);
@@ -149,5 +149,5 @@ public class InstreamForeignObject extends AbstractGraphics {
public XMLObj getChildXMLObj() {
return (XMLObj) firstChild;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java
index b73534d87..d72ed1e63 100644
--- a/src/java/org/apache/fop/fo/flow/Leader.java
+++ b/src/java/org/apache/fop/fo/flow/Leader.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -55,7 +55,7 @@ public class Leader extends InlineLevel {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public Leader(FONode parent) {
@@ -130,22 +130,22 @@ public class Leader extends InlineLevel {
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "leader";
diff --git a/src/java/org/apache/fop/fo/flow/ListBlock.java b/src/java/org/apache/fop/fo/flow/ListBlock.java
index 8c7777e6a..dfadc9c02 100644
--- a/src/java/org/apache/fop/fo/flow/ListBlock.java
+++ b/src/java/org/apache/fop/fo/flow/ListBlock.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -56,13 +56,13 @@ public class ListBlock extends FObj {
/** extension properties */
private Length widowContentLimit;
private Length orphanContentLimit;
-
+
// used for child node validation
private boolean hasListItem = false;
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public ListBlock(FONode parent) {
@@ -89,10 +89,10 @@ public class ListBlock extends FObj {
super.startOfNode();
getFOEventHandler().startList(this);
}
-
+
/**
* Make sure the content model is satisfied, if so then tell the
- * {@link org.apache.fop.fo.FOEventHandler} that we are at the end
+ * {@link org.apache.fop.fo.FOEventHandler} that we are at the end
* of the list-block.
* {@inheritDoc}
*/
@@ -107,7 +107,7 @@ public class ListBlock extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (list-item)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -171,7 +171,7 @@ public class ListBlock extends FObj {
public String getLocalName() {
return "list-block";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LIST_BLOCK}
diff --git a/src/java/org/apache/fop/fo/flow/ListItem.java b/src/java/org/apache/fop/fo/flow/ListItem.java
index 398d91558..95760c00b 100644
--- a/src/java/org/apache/fop/fo/flow/ListItem.java
+++ b/src/java/org/apache/fop/fo/flow/ListItem.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -56,7 +56,7 @@ public class ListItem extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public ListItem(FONode parent) {
@@ -93,7 +93,7 @@ public class ListItem extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (list-item-label,list-item-body)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -118,12 +118,12 @@ public class ListItem extends FObj {
/**
* {@inheritDoc}
- * @todo see if can/should rely on base class for this
+ * @todo see if can/should rely on base class for this
* (i.e., add to childNodes instead)
*/
public void addChildNode(FONode child) {
int nameId = child.getNameId();
-
+
if (nameId == FO_LIST_ITEM_LABEL) {
label = (ListItemLabel) child;
} else if (nameId == FO_LIST_ITEM_BODY) {
@@ -184,7 +184,7 @@ public class ListItem extends FObj {
public String getLocalName() {
return "list-item";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LIST_ITEM}
diff --git a/src/java/org/apache/fop/fo/flow/ListItemBody.java b/src/java/org/apache/fop/fo/flow/ListItemBody.java
index 226cacd12..853beb20b 100644
--- a/src/java/org/apache/fop/fo/flow/ListItemBody.java
+++ b/src/java/org/apache/fop/fo/flow/ListItemBody.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,12 +46,12 @@ public class ListItemBody extends AbstractListItemPart {
super.endOfNode();
getFOEventHandler().endListBody();
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "list-item-body";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LIST_ITEM_BODY}
diff --git a/src/java/org/apache/fop/fo/flow/ListItemLabel.java b/src/java/org/apache/fop/fo/flow/ListItemLabel.java
index 7fbbe77d3..1c757686c 100644
--- a/src/java/org/apache/fop/fo/flow/ListItemLabel.java
+++ b/src/java/org/apache/fop/fo/flow/ListItemLabel.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,7 +30,7 @@ public class ListItemLabel extends AbstractListItemPart {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public ListItemLabel(FONode parent) {
@@ -53,7 +53,7 @@ public class ListItemLabel extends AbstractListItemPart {
public String getLocalName() {
return "list-item-label";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LIST_ITEM_LABEL}
diff --git a/src/java/org/apache/fop/fo/flow/Marker.java b/src/java/org/apache/fop/fo/flow/Marker.java
index ea6721686..1e8b352bb 100644
--- a/src/java/org/apache/fop/fo/flow/Marker.java
+++ b/src/java/org/apache/fop/fo/flow/Marker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -49,7 +49,7 @@ public class Marker extends FObjMixed {
/**
* Create a marker fo.
- *
+ *
* @param parent the parent {@link FONode}
*/
public Marker(FONode parent) {
@@ -59,32 +59,32 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
if (findAncestor(FO_FLOW) < 0) {
- invalidChildError(locator, getParent().getName(), FO_URI, getName(),
+ invalidChildError(locator, getParent().getName(), FO_URI, getName(),
"rule.markerDescendantOfFlow");
}
-
+
markerClassName = pList.get(PR_MARKER_CLASS_NAME).getString();
-
+
if (markerClassName == null || markerClassName.equals("")) {
missingPropertyError("marker-class-name");
- }
+ }
}
-
+
/**
- * Retrieve the property list of the given {@link FONode}
+ * Retrieve the property list of the given {@link FONode}
* descendant
- *
+ *
* @param foNode the {@link FONode} whose property list is requested
* @return the {@link MarkerPropertyList} for the given node
*/
protected MarkerPropertyList getPropertyListFor(FONode foNode) {
- return (MarkerPropertyList)
+ return (MarkerPropertyList)
descendantPropertyLists.get(foNode);
}
-
+
/** {@inheritDoc} */
protected void startOfNode() {
- FOTreeBuilderContext builderContext = getBuilderContext();
+ FOTreeBuilderContext builderContext = getBuilderContext();
// Push a new property list maker which will make MarkerPropertyLists.
savePropertyListMaker = builderContext.getPropertyListMaker();
builderContext.setPropertyListMaker(new PropertyListMaker() {
@@ -95,7 +95,7 @@ public class Marker extends FObjMixed {
}
});
}
-
+
/** {@inheritDoc} */
protected void endOfNode() throws FOPException {
super.endOfNode();
@@ -112,7 +112,7 @@ public class Marker extends FObjMixed {
* the fo:marker's children."
* @todo implement "additional" constraint, possibly within fo:retrieve-marker
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockOrInlineItem(nsURI, localName)) {
@@ -120,12 +120,12 @@ public class Marker extends FObjMixed {
}
}
}
-
+
/** {@inheritDoc} */
protected boolean inMarker() {
return true;
}
-
+
/** @return the "marker-class-name" property */
public String getMarkerClassName() {
return markerClassName;
@@ -135,7 +135,7 @@ public class Marker extends FObjMixed {
public String getLocalName() {
return "marker";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_MARKER}
@@ -156,15 +156,15 @@ public class Marker extends FObjMixed {
* specified properties/attributes as bundles of name-value-namespace
* strings
*/
- protected class MarkerPropertyList extends PropertyList
+ protected class MarkerPropertyList extends PropertyList
implements Attributes {
-
+
/** the array of attributes **/
private MarkerAttribute[] attribs;
-
+
/**
* Overriding default constructor
- *
+ *
* @param fobj the {@link FObj} to attach
* @param parentPropertyList ignored
*/
@@ -175,34 +175,34 @@ public class Marker extends FObjMixed {
*/
super(fobj, null);
}
-
+
/**
* Override that doesn't convert the attributes to {@link Property}
* instances, but simply stores the attributes for later processing.
- *
+ *
* {@inheritDoc}
*/
- public void addAttributesToList(Attributes attributes)
+ public void addAttributesToList(Attributes attributes)
throws ValidationException {
-
+
this.attribs = new MarkerAttribute[attributes.getLength()];
String name;
String value;
String namespace;
String qname;
-
+
for (int i = attributes.getLength(); --i >= 0;) {
namespace = attributes.getURI(i);
qname = attributes.getQName(i);
name = attributes.getLocalName(i);
value = attributes.getValue(i);
-
- this.attribs[i] =
+
+ this.attribs[i] =
MarkerAttribute.getInstance(namespace, qname, name, value);
}
}
-
+
/** Null implementation; not used by this type of {@link PropertyList} */
public void putExplicit(int propId, Property value) {
//nop
@@ -224,7 +224,7 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public String getURI(int index) {
- if (attribs != null
+ if (attribs != null
&& index < attribs.length
&& index >= 0
&& attribs[index] != null) {
@@ -236,7 +236,7 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public String getLocalName(int index) {
- if (attribs != null
+ if (attribs != null
&& index < attribs.length
&& index >= 0
&& attribs[index] != null) {
@@ -248,7 +248,7 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public String getQName(int index) {
- if (attribs != null
+ if (attribs != null
&& index < attribs.length
&& index >= 0
&& attribs[index] != null) {
@@ -265,7 +265,7 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public String getValue(int index) {
- if (attribs != null
+ if (attribs != null
&& index < attribs.length
&& index >= 0
&& attribs[index] != null) {
@@ -295,7 +295,7 @@ public class Marker extends FObjMixed {
int index = -1;
if (attribs != null && qname != null) {
for (int i = attribs.length; --i >= 0;) {
- if (attribs[i] != null
+ if (attribs[i] != null
&& qname.equals(attribs[i].qname)) {
break;
}
@@ -332,18 +332,18 @@ public class Marker extends FObjMixed {
return null;
}
}
-
+
/** Convenience inner class */
private static final class MarkerAttribute {
-
- private static Map attributeCache =
+
+ private static Map attributeCache =
Collections.synchronizedMap(new java.util.WeakHashMap());
protected String namespace;
protected String qname;
protected String name;
protected String value;
-
+
/**
* Main constructor
* @param namespace the namespace URI
@@ -351,14 +351,14 @@ public class Marker extends FObjMixed {
* @param name the name
* @param value the value
*/
- private MarkerAttribute(String namespace, String qname,
+ private MarkerAttribute(String namespace, String qname,
String name, String value) {
this.namespace = namespace;
this.qname = qname;
this.name = (name == null ? qname : name);
this.value = value;
}
-
+
/**
* Convenience method, reduces the number
* of distinct MarkerAttribute instances
@@ -367,13 +367,13 @@ public class Marker extends FObjMixed {
* @param qname the fully qualified name of the attribute
* @param name the attribute name
* @param value the attribute value
- * @return the single MarkerAttribute instance corresponding to
+ * @return the single MarkerAttribute instance corresponding to
* the name/value-pair
*/
private static MarkerAttribute getInstance(
String namespace, String qname,
String name, String value) {
- MarkerAttribute newInstance =
+ MarkerAttribute newInstance =
new MarkerAttribute(namespace, qname, name, value);
if (attributeCache.containsKey(newInstance)) {
return (MarkerAttribute) attributeCache.get(newInstance);
@@ -382,7 +382,7 @@ public class Marker extends FObjMixed {
return newInstance;
}
}
-
+
/** {@inheritDoc} */
public boolean equals(Object o) {
if (o instanceof MarkerAttribute) {
diff --git a/src/java/org/apache/fop/fo/flow/MultiCase.java b/src/java/org/apache/fop/fo/flow/MultiCase.java
index 284d82d63..b2d630ba7 100644
--- a/src/java/org/apache/fop/fo/flow/MultiCase.java
+++ b/src/java/org/apache/fop/fo/flow/MultiCase.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,7 +42,7 @@ public class MultiCase extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiCase(FONode parent) {
diff --git a/src/java/org/apache/fop/fo/flow/MultiProperties.java b/src/java/org/apache/fop/fo/flow/MultiProperties.java
index ef015a9c1..091934203 100644
--- a/src/java/org/apache/fop/fo/flow/MultiProperties.java
+++ b/src/java/org/apache/fop/fo/flow/MultiProperties.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ public class MultiProperties extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiProperties(FONode parent) {
@@ -69,7 +69,7 @@ public class MultiProperties extends FObj {
* {@inheritDoc}
*
XSL Content Model: (multi-property-set+, wrapper)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("multi-property-set")) {
@@ -89,7 +89,7 @@ public class MultiProperties extends FObj {
}
}
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "multi-properties";
diff --git a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
index 0736976b4..96e73ec97 100644
--- a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
+++ b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,7 +41,7 @@ public class MultiPropertySet extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiPropertySet(FONode parent) {
@@ -64,7 +64,7 @@ public class MultiPropertySet extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -75,7 +75,7 @@ public class MultiPropertySet extends FObj {
public String getLocalName() {
return "multi-property-set";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_MULTI_PROPERTY_SET}
diff --git a/src/java/org/apache/fop/fo/flow/MultiSwitch.java b/src/java/org/apache/fop/fo/flow/MultiSwitch.java
index 81cb2aff9..1db72159e 100644
--- a/src/java/org/apache/fop/fo/flow/MultiSwitch.java
+++ b/src/java/org/apache/fop/fo/flow/MultiSwitch.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -43,7 +43,7 @@ public class MultiSwitch extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiSwitch(FONode parent) {
@@ -74,7 +74,7 @@ public class MultiSwitch extends FObj {
* {@inheritDoc}
*
XSL Content Model: (multi-case+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("multi-case")) {
diff --git a/src/java/org/apache/fop/fo/flow/MultiToggle.java b/src/java/org/apache/fop/fo/flow/MultiToggle.java
index bcb1f806a..aacfda8eb 100644
--- a/src/java/org/apache/fop/fo/flow/MultiToggle.java
+++ b/src/java/org/apache/fop/fo/flow/MultiToggle.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,12 +38,12 @@ public class MultiToggle extends FObj {
// private CommonAccessibility commonAccessibility;
// public ToBeImplementedProperty prSwitchTo;
// End of property values
-
+
static boolean notImplementedWarningGiven = false;
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiToggle(FONode parent) {
@@ -66,7 +66,7 @@ public class MultiToggle extends FObj {
* {@inheritDoc}
*
XSL Content Model: (#PCDATA|%inline;|%block;)*
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockOrInlineItem(nsURI, localName)) {
@@ -79,7 +79,7 @@ public class MultiToggle extends FObj {
public String getLocalName() {
return "multi-toggle";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_MULTI_TOGGLE}
diff --git a/src/java/org/apache/fop/fo/flow/PageNumber.java b/src/java/org/apache/fop/fo/flow/PageNumber.java
index 3b91c6b44..dc834d708 100644
--- a/src/java/org/apache/fop/fo/flow/PageNumber.java
+++ b/src/java/org/apache/fop/fo/flow/PageNumber.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -68,12 +68,12 @@ public class PageNumber extends FObj {
// private int wrapOption;
// End of property values
- // Properties which are not explicitely listed but are still applicable
+ // Properties which are not explicitely listed but are still applicable
private Color color;
-
+
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public PageNumber(FONode parent) {
@@ -113,7 +113,7 @@ public class PageNumber extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -137,34 +137,34 @@ public class PageNumber extends FObj {
/** @return the "text-decoration" property. */
public CommonTextDecoration getTextDecoration() {
- return textDecoration;
+ return textDecoration;
}
/** @return the "alignment-adjust" property */
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** @return the "line-height" property */
public SpaceProperty getLineHeight() {
return lineHeight;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "page-number";
diff --git a/src/java/org/apache/fop/fo/flow/PageNumberCitation.java b/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
index b31bc9a11..0ebb6eb3d 100644
--- a/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
+++ b/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,7 +33,7 @@ public class PageNumberCitation extends AbstractPageNumberCitation {
/**
* Main constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public PageNumberCitation(FONode parent) {
diff --git a/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java b/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java
index 9e98c06be..6a08568b1 100644
--- a/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java
+++ b/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,13 +34,13 @@ public class PageNumberCitationLast extends AbstractPageNumberCitation {
/**
* Main constructor
- *
+ *
* @param parent the parent {@link FONode}
*/
public PageNumberCitationLast(FONode parent) {
super(parent);
}
-
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
@@ -57,7 +57,7 @@ public class PageNumberCitationLast extends AbstractPageNumberCitation {
public String getLocalName() {
return "page-number-citation-last";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_PAGE_NUMBER_CITATION_LAST}
diff --git a/src/java/org/apache/fop/fo/flow/RetrieveMarker.java b/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
index c696d3d14..0d0331359 100644
--- a/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
+++ b/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -109,5 +109,5 @@ public class RetrieveMarker extends AbstractRetrieveMarker {
*/
public int getNameId() {
return FO_RETRIEVE_MARKER;
- }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java b/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
index 9d04e308d..c58ecc628 100644
--- a/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
+++ b/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/flow/Wrapper.java b/src/java/org/apache/fop/fo/flow/Wrapper.java
index 5ed594ecc..74072da87 100644
--- a/src/java/org/apache/fop/fo/flow/Wrapper.java
+++ b/src/java/org/apache/fop/fo/flow/Wrapper.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,20 +31,20 @@ import org.apache.fop.fo.ValidationException;
/**
* Class modelling the
* fo:wrapper
object.
- * The fo:wrapper
object serves as a property holder for
+ * The fo:wrapper
object serves as a property holder for
* its child node objects.
*/
public class Wrapper extends FObjMixed {
// The value of properties relevant for fo:wrapper.
// End of property values
-
+
// used for FO validation
private boolean blockOrInlineItemFound = false;
/**
* Create a Wrapper instance that is a child of the
* given {@link FONode}
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public Wrapper(FONode parent) {
@@ -54,16 +54,16 @@ public class Wrapper extends FObjMixed {
/**
* {@inheritDoc}
*
XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
- *
Additionally (unimplemented): "An fo:wrapper that is a child of an
- * fo:multi-properties is only permitted to have children that would
+ *
Additionally (unimplemented): "An fo:wrapper that is a child of an
+ * fo:multi-properties is only permitted to have children that would
* be permitted in place of the fo:multi-properties."
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if ("marker".equals(localName)) {
if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:marker",
+ nodesOutOfOrderError(loc, "fo:marker",
"(#PCDATA|%inline;|%block;)");
}
} else if (isBlockOrInlineItem(nsURI, localName)) {
diff --git a/src/java/org/apache/fop/fo/flow/table/BorderResolver.java b/src/java/org/apache/fop/fo/flow/table/BorderResolver.java
index 82bdac845..1b856abff 100644
--- a/src/java/org/apache/fop/fo/flow/table/BorderResolver.java
+++ b/src/java/org/apache/fop/fo/flow/table/BorderResolver.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,7 +29,7 @@ interface BorderResolver {
/**
* Receives notification of the end of a row.
- *
+ *
* @param row the row that has just been finished
* @param container the FO element holding the given row
*/
@@ -37,7 +37,7 @@ interface BorderResolver {
/**
* Receives notification of the start of a table-header/footer/body.
- *
+ *
* @param part the part that has started
*/
void startPart(TablePart part);
diff --git a/src/java/org/apache/fop/fo/flow/table/BorderSpecification.java b/src/java/org/apache/fop/fo/flow/table/BorderSpecification.java
index ce6e1b802..3fa3eb15b 100644
--- a/src/java/org/apache/fop/fo/flow/table/BorderSpecification.java
+++ b/src/java/org/apache/fop/fo/flow/table/BorderSpecification.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,7 +37,7 @@ public/*TODO*/ class BorderSpecification {
/**
* Creates a new border specification.
- *
+ *
* @param borderInfo the border's informations
* @param holder the FO element declaring this border
*/
@@ -56,7 +56,7 @@ public/*TODO*/ class BorderSpecification {
/**
* Returns this border's informations.
- *
+ *
* @return this border's informations
*/
public/*TODO*/ BorderInfo getBorderInfo() {
@@ -65,7 +65,7 @@ public/*TODO*/ class BorderSpecification {
/**
* Returns the FO element declaring this border.
- *
+ *
* @return one of {@link Constants#FO_TABLE}, {@link Constants#FO_TABLE_COLUMN},
* {@link Constants#FO_TABLE_HEADER}, {@link Constants#FO_TABLE_FOOTER},
* {@link Constants#FO_TABLE_BODY}, {@link Constants#FO_TABLE_ROW},
diff --git a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java
index 3a887166a..783c2ff8f 100644
--- a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java
+++ b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -82,7 +82,7 @@ class CollapsingBorderResolver implements BorderResolver {
/**
* Integrates border-before specified on the table and its column.
- *
+ *
* @param row the first row of the table (in the header, or in the body if the
* table has no header)
* @param withNormal
@@ -103,7 +103,7 @@ class CollapsingBorderResolver implements BorderResolver {
/**
* Resolves border-after for the first row, border-before for the second one.
- *
+ *
* @param rowBefore
* @param rowAfter
*/
@@ -129,7 +129,7 @@ class CollapsingBorderResolver implements BorderResolver {
/**
* Integrates border-after specified on the table and its columns.
- *
+ *
* @param row the last row of the footer, or of the last body if the table has no
* footer
* @param withNormal
@@ -149,7 +149,7 @@ class CollapsingBorderResolver implements BorderResolver {
* Integrates either border-before specified on the table and its columns if the
* table has no header, or border-after specified on the cells of the header's
* last row. For the case the grid unit are at the top of a page.
- *
+ *
* @param row
*/
void integrateLeadingBorders(List/*start
to end
as occupied,
* and updates the number of the next available column.
- *
+ *
* @param start start number, inclusive, 1-based
* @param end end number, inclusive
*/
@@ -68,7 +68,7 @@ public class ColumnNumberManager {
/**
* Resets the record of occupied columns, taking into account columns already occupied
* by previous spanning cells, and computes the number of the first free column.
- *
+ *
* @param pendingSpans List<PendingSpan> of possible spans over the next row
*/
void prepareForNextRow(List pendingSpans) {
@@ -95,7 +95,7 @@ public class ColumnNumberManager {
/**
* Checks whether a given column-number is already in use
* for the current row.
- *
+ *
* @param colNr the column-number to check
* @return true if column-number is already occupied
*/
diff --git a/src/java/org/apache/fop/fo/flow/table/ColumnNumberManagerHolder.java b/src/java/org/apache/fop/fo/flow/table/ColumnNumberManagerHolder.java
index 5b253709b..6eb6bab53 100644
--- a/src/java/org/apache/fop/fo/flow/table/ColumnNumberManagerHolder.java
+++ b/src/java/org/apache/fop/fo/flow/table/ColumnNumberManagerHolder.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ public interface ColumnNumberManagerHolder {
/**
* Returns the encapsulated ColumnNumberManage instance.
- *
+ *
* @return a {@link ColumnNumberManager} instance
*/
ColumnNumberManager getColumnNumberManager();
diff --git a/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java b/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java
index 389681f1d..5ff01b7fa 100644
--- a/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java
+++ b/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -65,7 +65,7 @@ public class ConditionalBorder {
/**
* Creates a new conditional border.
- *
+ *
* @param borderSpecification the border specification to take as a basis
* @param collapsingBorderModel the model that will be used to resolved borders
*/
@@ -83,7 +83,7 @@ public class ConditionalBorder {
/**
* Resolves and updates the relevant parts of this border as well as the given one.
- *
+ *
* @param competitor
* @param withNormal
* @param withLeadingTrailing
@@ -122,7 +122,7 @@ public class ConditionalBorder {
* {@link #integrateSegment(ConditionalBorder, boolean, boolean, boolean)}, this
* method nicely handles the case where the CollapsingBorderModel returns null, by
* keeping the components to their old values.
- *
+ *
* @param competitor
* @param withNormal
* @param withLeadingTrailing
@@ -156,7 +156,7 @@ public class ConditionalBorder {
/**
* Updates this border after taking into account the given segment. The
* CollapsingBorderModel is not expected to return null.
- *
+ *
* @param segment
* @param withNormal
* @param withLeadingTrailing
@@ -181,7 +181,7 @@ public class ConditionalBorder {
/**
* Returns a shallow copy of this border.
- *
+ *
* @return a copy of this border
*/
ConditionalBorder copy() {
@@ -195,7 +195,7 @@ public class ConditionalBorder {
/**
* Returns a default border specification.
- *
+ *
* @param collapsingBorderModel the model that will be used to resolve borders
* @return a border with style 'none' for all of the three components
*/
diff --git a/src/java/org/apache/fop/fo/flow/table/EffRow.java b/src/java/org/apache/fop/fo/flow/table/EffRow.java
index fc8209b01..16d507303 100644
--- a/src/java/org/apache/fop/fo/flow/table/EffRow.java
+++ b/src/java/org/apache/fop/fo/flow/table/EffRow.java
@@ -34,19 +34,19 @@ import org.apache.fop.util.BreakUtil;
* the row as well as some additional values.
*/
public class EffRow {
-
+
/** Indicates that the row is the first in a table-body */
public static final int FIRST_IN_PART = GridUnit.FIRST_IN_PART;
/** Indicates that the row is the last in a table-body */
public static final int LAST_IN_PART = GridUnit.LAST_IN_PART;
-
+
private List gridUnits = new java.util.ArrayList();
private int index;
/** One of HEADER, FOOTER, BODY */
private int bodyType;
private MinOptMax height;
private MinOptMax explicitHeight;
-
+
/**
* Creates a new effective row instance.
* @param index index of the row
@@ -70,45 +70,45 @@ public class EffRow {
public int getIndex() {
return this.index;
}
-
+
/**
- * @return an indicator what type of body this EffRow is in (one of HEADER, FOOTER, BODY
+ * @return an indicator what type of body this EffRow is in (one of HEADER, FOOTER, BODY
* as found on TableRowIterator)
*/
public int getBodyType() {
return this.bodyType;
}
-
+
/** @return the table-row FO for this EffRow, or null if there is no table-row. */
public TableRow getTableRow() {
return getGridUnit(0).getRow();
}
-
+
/**
* Returns the calculated height for this EffRow, including the cells'
* bpds/paddings/borders, and the table's border-separation.
- *
+ *
* @return the row's height
*/
public MinOptMax getHeight() {
return this.height;
}
-
+
/**
* Sets the calculated height for this EffRow, including everything (cells' bpds,
* paddings, borders, and border-separation).
- *
+ *
* @param mom the calculated height
*/
public void setHeight(MinOptMax mom) {
this.height = mom;
}
-
+
/** @return the explicit height of the EffRow (as specified through properties) */
public MinOptMax getExplicitHeight() {
return this.explicitHeight;
}
-
+
/**
* Sets the height for this row that resulted from the explicit height properties specified
* by the user.
@@ -117,12 +117,12 @@ public class EffRow {
public void setExplicitHeight(MinOptMax mom) {
this.explicitHeight = mom;
}
-
+
/** @return the list of GridUnits for this EffRow */
public List getGridUnits() {
return gridUnits;
}
-
+
/**
* Returns the grid unit at a given position.
* @param column index of the grid unit in the row (zero based)
@@ -131,9 +131,9 @@ public class EffRow {
public GridUnit getGridUnit(int column) {
return (GridUnit)gridUnits.get(column);
}
-
+
/**
- * Returns the grid unit at a given position. In contrast to getGridUnit() this
+ * Returns the grid unit at a given position. In contrast to getGridUnit() this
* method returns null if there's no grid unit at the given position. The number of
* grid units for row x can be smaller than the number of grid units for row x-1.
* @param column index of the grid unit in the row (zero based)
@@ -167,7 +167,7 @@ public class EffRow {
/**
* Returns the strength of the keep constraint if the enclosing (if any) fo:table-row element
* of this row, or if any of the cells starting on this row, have keep-with-previous set.
- *
+ *
* @return the strength of the keep-with-previous constraint
*/
public int getKeepWithPreviousStrength() {
@@ -189,7 +189,7 @@ public class EffRow {
/**
* Returns the strength of the keep constraint if the enclosing (if any) fo:table-row element
* of this row, or if any of the cells ending on this row, have keep-with-next set.
- *
+ *
* @return the strength of the keep-with-next constraint
*/
public int getKeepWithNextStrength() {
@@ -224,7 +224,7 @@ public class EffRow {
}
return strength;
}
-
+
/**
* Returns the break class for this row. This is a combination of break-before set on
* the first children of any cells starting on this row.
@@ -233,7 +233,7 @@ public class EffRow {
* belongs to a group of spanned rows (see XSL-FO 1.1, 7.20.2).
*
XSL Content Model: marker* table-caption? table
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
diff --git a/src/java/org/apache/fop/fo/flow/table/TableBody.java b/src/java/org/apache/fop/fo/flow/table/TableBody.java
index b4071e255..0ddfa97e3 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableBody.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableBody.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/flow/table/TableCaption.java b/src/java/org/apache/fop/fo/flow/table/TableCaption.java
index 80fccb236..bbc9b52bc 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableCaption.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableCaption.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -82,7 +82,7 @@ public class TableCaption extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
diff --git a/src/java/org/apache/fop/fo/flow/table/TableCell.java b/src/java/org/apache/fop/fo/flow/table/TableCell.java
index 21da54128..637ee2a9a 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableCell.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableCell.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -108,7 +108,7 @@ public class TableCell extends TableFObj {
/** {@inheritDoc} */
public void finalizeNode() throws FOPException {
-
+
if (!blockItemFound) {
missingChildElementError("marker* (%block;)+", true);
}
@@ -118,9 +118,9 @@ public class TableCell extends TableFObj {
getUserAgent().getEventBroadcaster());
eventProducer.startEndRowUnderTableRowWarning(this, getLocator());
}
-
+
}
-
+
/**
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
diff --git a/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java b/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java
index 1d1a29b35..9b4fe755f 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -94,7 +94,7 @@ public abstract class TableCellContainer extends TableFObj implements ColumnNumb
/**
* Returns the enclosing table-header/footer/body of this container.
- *
+ *
* @return this
for TablePart, or the parent element for TableRow
*/
abstract TablePart getTablePart();
diff --git a/src/java/org/apache/fop/fo/flow/table/TableColumn.java b/src/java/org/apache/fop/fo/flow/table/TableColumn.java
index 025f5a74f..5047822da 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableColumn.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableColumn.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java b/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
index 9c4a82dd6..d6abf609e 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
@@ -33,7 +33,7 @@ public interface TableEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -83,7 +83,7 @@ public interface TableEventProducer extends EventProducer {
*/
void footerOrderCannotRecover(Object source, String elementName, Locator loc)
throws ValidationException;
-
+
/**
* starts-row/ends-row for fo:table-cells non-applicable for children of an fo:table-row
* @param source the event source
@@ -93,7 +93,7 @@ public interface TableEventProducer extends EventProducer {
void startEndRowUnderTableRowWarning(Object source, Locator loc);
/**
- * Column-number or number of cells in the row overflows the number of fo:table-column
+ * Column-number or number of cells in the row overflows the number of fo:table-column
* specified for the table.
* @param source the event source
* @param loc the location of the error or null
@@ -166,5 +166,5 @@ public interface TableEventProducer extends EventProducer {
void breakIgnoredDueToRowSpanning(Object source, String elementName, boolean breakBefore,
Locator loc);
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/table/TableFObj.java b/src/java/org/apache/fop/fo/flow/table/TableFObj.java
index f459ecd65..ec508580c 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableFObj.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableFObj.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -234,7 +234,7 @@ public abstract class TableFObj extends FObj {
setCollapsedBorders();
}
}
-
+
/**
* Prepares the borders of this element if the collapsing-border model is in use.
* Conflict resolution with parent elements is done where applicable.
diff --git a/src/java/org/apache/fop/fo/flow/table/TableFooter.java b/src/java/org/apache/fop/fo/flow/table/TableFooter.java
index a89a2e431..cfd0136dc 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableFooter.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableFooter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/flow/table/TableHeader.java b/src/java/org/apache/fop/fo/flow/table/TableHeader.java
index 7f4173754..a0ad40798 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableHeader.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableHeader.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/flow/table/TablePart.java b/src/java/org/apache/fop/fo/flow/table/TablePart.java
index 4d20db8c4..b1db59d91 100644
--- a/src/java/org/apache/fop/fo/flow/table/TablePart.java
+++ b/src/java/org/apache/fop/fo/flow/table/TablePart.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -79,7 +79,7 @@ public abstract class TablePart extends TableCellContainer {
public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList pList)
throws FOPException {
-
+
super.processNode(elementName, locator, attlist, pList);
if (!inMarker()) {
Table t = getTable();
@@ -94,7 +94,7 @@ public abstract class TablePart extends TableCellContainer {
}
columnNumberManager = new ColumnNumberManager();
}
-
+
}
/** {@inheritDoc} */
diff --git a/src/java/org/apache/fop/fo/flow/table/TableRow.java b/src/java/org/apache/fop/fo/flow/table/TableRow.java
index ac6eafc2f..4d11f8780 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableRow.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableRow.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -118,7 +118,7 @@ public class TableRow extends TableCellContainer {
columnNumberManager = null;
}
}
-
+
/**
* {@inheritDoc} String, String)
*
XSL Content Model: (table-cell+)
diff --git a/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java b/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
index 23c16d1f2..f005c8fbe 100644
--- a/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
+++ b/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -43,7 +43,7 @@ class VariableColRowGroupBuilder extends RowGroupBuilder {
private static interface Event {
/**
* Plays this event
- *
+ *
* @param rowGroupBuilder the delegate builder which will actually create the row
* groups
* @throws ValidationException if a row-spanning cell overflows its parent body
diff --git a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
index f0928a8ca..dce36f95c 100644
--- a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
+++ b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ import org.apache.fop.fo.PropertyList;
* fox:external-document
extension object.
*/
public abstract class AbstractPageSequence extends FObj {
-
+
// The value of properties relevant for fo:page-sequence.
protected Numeric initialPageNumber;
protected int forcePageCount;
@@ -81,7 +81,7 @@ public abstract class AbstractPageSequence extends FObj {
*/
public void initPageNumber() {
int pageNumberType = 0;
-
+
if (initialPageNumber.getEnum() != 0) {
// auto | auto-odd | auto-even.
startingPageNumber = getRoot().getEndingPageNumberOfPreviousSequence() + 1;
@@ -143,7 +143,7 @@ public abstract class AbstractPageSequence extends FObj {
public Numeric getInitialPageNumber() {
return initialPageNumber;
}
-
+
/**
* Get the value of the reference-orientation
property.
* @return the "reference-orientation" property
diff --git a/src/java/org/apache/fop/fo/pagination/ColorProfile.java b/src/java/org/apache/fop/fo/pagination/ColorProfile.java
index 0af1aa42d..7fac8655e 100644
--- a/src/java/org/apache/fop/fo/pagination/ColorProfile.java
+++ b/src/java/org/apache/fop/fo/pagination/ColorProfile.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -60,7 +60,7 @@ public class ColorProfile extends FObj {
* {@inheritDoc}
*
XSL 1.0/FOP: EMPTY (no child nodes permitted)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -78,7 +78,7 @@ public class ColorProfile extends FObj {
public String getLocalName() {
return "color-profile";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_COLOR_PROFILE}
@@ -86,26 +86,26 @@ public class ColorProfile extends FObj {
public int getNameId() {
return FO_COLOR_PROFILE;
}
-
- /**
+
+ /**
* Get src attribute
- *
+ *
* @return value of color-profile src attribute
*/
public String getSrc() {
return this.src;
}
-
+
/**
* Get rendering-intent attribute
- *
+ *
* Returned value is one of
* Constants.EN_AUTO
* Constants.EN_PERCEPTUAL
* Constants.EN_RELATIVE_COLOMETRIC
* Constants.EN_SATURATION
* Constants.EN_ABSOLUTE_COLORMETRIC
- *
+ *
* @return Rendering intent attribute
*/
public int getRenderingIntent() {
diff --git a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
index 7c76109f4..eaa8c2491 100644
--- a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.fop.fo.ValidationException;
/**
* Class modelling the
* fo:conditional-page-master-reference
object.
- *
+ *
* This is a reference to a page master with a set of conditions.
* The conditions must be satisfied for the referenced master to
* be used.
@@ -45,7 +45,7 @@ public class ConditionalPageMasterReference extends FObj {
private int oddOrEven;
private int blankOrNotBlank;
// End of property values
-
+
/**
* Create a ConditionalPageMasterReference instance that is a
* child of the given {@link FONode}.
@@ -65,7 +65,7 @@ public class ConditionalPageMasterReference extends FObj {
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
- }
+ }
}
/** {@inheritDoc} */
@@ -76,12 +76,12 @@ public class ConditionalPageMasterReference extends FObj {
private RepeatablePageMasterAlternatives getConcreteParent() {
return (RepeatablePageMasterAlternatives) parent;
}
-
+
/**
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
invalidChildError(loc, nsURI, localName);
}
@@ -158,7 +158,7 @@ public class ConditionalPageMasterReference extends FObj {
public String getMasterReference() {
return masterReference;
}
-
+
/**
* Get the value for the page-position
property.
* @return the page-position property value
@@ -166,12 +166,12 @@ public class ConditionalPageMasterReference extends FObj {
public int getPagePosition() {
return this.pagePosition;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "conditional-page-master-reference";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_CONDITIONAL_PAGE_MASTER_REFERENCE}
diff --git a/src/java/org/apache/fop/fo/pagination/Declarations.java b/src/java/org/apache/fop/fo/pagination/Declarations.java
index eb24cffe0..1385bccc9 100644
--- a/src/java/org/apache/fop/fo/pagination/Declarations.java
+++ b/src/java/org/apache/fop/fo/pagination/Declarations.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -61,7 +61,7 @@ public class Declarations extends FObj {
*
XSL 1.0: (color-profile)+ (and non-XSL NS nodes)
*
FOP/XSL 1.1: (color-profile)* (and non-XSL NS nodes)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("color-profile")) {
@@ -88,7 +88,7 @@ public class Declarations extends FObj {
cp.getName(), "color-profile-name", locator);
}
} else {
- log.debug("Ignoring element " + node.getName()
+ log.debug("Ignoring element " + node.getName()
+ " inside fo:declarations.");
}
}
@@ -112,7 +112,7 @@ public class Declarations extends FObj {
public String getLocalName() {
return "declarations";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_DECLARATIONS}
@@ -120,13 +120,13 @@ public class Declarations extends FObj {
public int getNameId() {
return FO_DECLARATIONS;
}
-
+
/**
* Return ColorProfile with given name.
- *
- * @param cpName Name of ColorProfile, i.e. the value of the color-profile-name attribute of
+ *
+ * @param cpName Name of ColorProfile, i.e. the value of the color-profile-name attribute of
* the fo:color-profile element
- * @return The org.apache.fop.fo.pagination.ColorProfile object associated with this
+ * @return The org.apache.fop.fo.pagination.ColorProfile object associated with this
* color-profile-name or null
*/
public ColorProfile getColorProfile(String cpName) {
@@ -136,6 +136,6 @@ public class Declarations extends FObj {
}
return profile;
}
-
-
+
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/Flow.java b/src/java/org/apache/fop/fo/pagination/Flow.java
index d3682fa81..153f06fc1 100644
--- a/src/java/org/apache/fop/fo/pagination/Flow.java
+++ b/src/java/org/apache/fop/fo/pagination/Flow.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@ public class Flow extends FObj {
// The value of properties relevant for fo:flow.
private String flowName;
// End of property values
-
+
/** used for FO validation */
private boolean blockItemFound = false;
@@ -53,7 +53,7 @@ public class Flow extends FObj {
super.bind(pList);
flowName = pList.get(PR_FLOW_NAME).getString();
}
-
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
if (flowName == null || flowName.equals("")) {
@@ -92,7 +92,7 @@ public class Flow extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -124,7 +124,7 @@ public class Flow extends FObj {
public String getLocalName() {
return "flow";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_FLOW}
diff --git a/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java b/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
index 7f081579d..482ec83c4 100644
--- a/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
+++ b/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -81,11 +81,11 @@ public class LayoutMasterSet extends FObj {
* {@inheritDoc}
*
XSL/FOP: (simple-page-master|page-sequence-master)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
- if (!localName.equals("simple-page-master")
- && !localName.equals("page-sequence-master")) {
+ if (!localName.equals("simple-page-master")
+ && !localName.equals("page-sequence-master")) {
invalidChildError(loc, nsURI, localName);
}
}
@@ -207,7 +207,7 @@ public class LayoutMasterSet extends FObj {
public String getLocalName() {
return "layout-master-set";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LAYOUT_MASTER_SET}
diff --git a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java
index 50620f678..485fb67cc 100644
--- a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java
+++ b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.pagination;
/**
diff --git a/src/java/org/apache/fop/fo/pagination/PageProductionException.java b/src/java/org/apache/fop/fo/pagination/PageProductionException.java
index 068e38ff8..bb09db6f4 100644
--- a/src/java/org/apache/fop/fo/pagination/PageProductionException.java
+++ b/src/java/org/apache/fop/fo/pagination/PageProductionException.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,7 +37,7 @@ public class PageProductionException extends RuntimeException {
private String localizedMessage;
private Locator locator;
-
+
/**
* Creates a new PageProductionException.
* @param message the message
@@ -47,7 +47,7 @@ public class PageProductionException extends RuntimeException {
super(message);
setLocator(locator);
}
-
+
/**
* Set a location associated with the exception.
* @param locator the locator holding the location.
@@ -64,7 +64,7 @@ public class PageProductionException extends RuntimeException {
public Locator getLocator() {
return this.locator;
}
-
+
/**
* Sets the localized message for this exception.
* @param msg the localized message
@@ -81,7 +81,7 @@ public class PageProductionException extends RuntimeException {
return super.getLocalizedMessage();
}
}
-
+
/** Exception factory for {@link PageProductionException}. */
public static class PageProductionExceptionFactory implements ExceptionFactory {
@@ -96,11 +96,11 @@ public class PageProductionException extends RuntimeException {
}
return ex;
}
-
+
/** {@inheritDoc} */
public Class getExceptionClass() {
return PageProductionException.class;
}
-
- }
+
+ }
}
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java
index c8f7c66d7..bdcb27198 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequence.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@ import org.apache.fop.fo.ValidationException;
* fo:page-sequence
object.
*/
public class PageSequence extends AbstractPageSequence {
-
+
// The value of properties relevant for fo:page-sequence.
private String country;
private String language;
@@ -87,10 +87,10 @@ public class PageSequence extends AbstractPageSequence {
language = pList.get(PR_LANGUAGE).getString();
masterReference = pList.get(PR_MASTER_REFERENCE).getString();
//writingMode = pList.getWritingMode();
-
+
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
- }
+ }
}
/** {@inheritDoc} */
@@ -124,7 +124,7 @@ public class PageSequence extends AbstractPageSequence {
* {@inheritDoc}
XSL Content Model: (title?,static-content*,flow)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("title")) {
@@ -138,7 +138,7 @@ public class PageSequence extends AbstractPageSequence {
} else if (localName.equals("static-content")) {
if (mainFlow != null) {
nodesOutOfOrderError(loc, "fo:static-content", "fo:flow");
- }
+ }
} else if (localName.equals("flow")) {
if (mainFlow != null) {
tooManyNodesError(loc, "fo:flow");
@@ -186,8 +186,8 @@ public class PageSequence extends AbstractPageSequence {
flowName, flow.getLocator());
}
- if (!getRoot().getLayoutMasterSet().regionNameExists(flowName)
- && !flowName.equals("xsl-before-float-separator")
+ if (!getRoot().getLayoutMasterSet().regionNameExists(flowName)
+ && !flowName.equals("xsl-before-float-separator")
&& !flowName.equals("xsl-footnote-separator")) {
getFOValidationEventProducer().flowNameNotMapped(this, flow.getName(),
flowName, flow.getLocator());
@@ -226,7 +226,7 @@ public class PageSequence extends AbstractPageSequence {
* Determine if this PageSequence already has a flow with the given flow-name
* Used for validation of incoming fo:flow or fo:static-content objects
* @param flowName The flow-name to search for
- * @return true if flow-name already defined within this page sequence,
+ * @return true if flow-name already defined within this page sequence,
* false otherwise
*/
public boolean hasFlowName(String flowName) {
@@ -237,7 +237,7 @@ public class PageSequence extends AbstractPageSequence {
public Map getFlowMap() {
return this.flowMap;
}
-
+
/**
* Public accessor for determining the next page master to use within this page sequence.
* @param page the page number of the page to be created
@@ -251,9 +251,9 @@ public class PageSequence extends AbstractPageSequence {
* @return the SimplePageMaster to use for this page
* @throws PageProductionException if there's a problem determining the page master
*/
- public SimplePageMaster getNextSimplePageMaster(int page,
- boolean isFirstPage,
- boolean isLastPage,
+ public SimplePageMaster getNextSimplePageMaster(int page,
+ boolean isFirstPage,
+ boolean isLastPage,
boolean isOnlyPage,
boolean isBlank) throws PageProductionException {
@@ -263,13 +263,13 @@ public class PageSequence extends AbstractPageSequence {
boolean isOddPage = ((page % 2) == 1);
if (log.isDebugEnabled()) {
log.debug("getNextSimplePageMaster(page=" + page
- + " isOdd=" + isOddPage
- + " isFirst=" + isFirstPage
+ + " isOdd=" + isOddPage
+ + " isFirst=" + isFirstPage
+ " isLast=" + isLastPage
+ " isOnly=" + isOnlyPage
+ " isBlank=" + isBlank + ")");
}
- return pageSequenceMaster.getNextSimplePageMaster(isOddPage,
+ return pageSequenceMaster.getNextSimplePageMaster(isOddPage,
isFirstPage, isLastPage, isOnlyPage, isBlank);
}
@@ -293,7 +293,7 @@ public class PageSequence extends AbstractPageSequence {
return pageSequenceMaster.hasPagePositionLast();
}
}
-
+
/** @return true if the page-sequence has a page-master with page-position="only" */
public boolean hasPagePositionOnly() {
if (pageSequenceMaster == null) {
@@ -302,7 +302,7 @@ public class PageSequence extends AbstractPageSequence {
return pageSequenceMaster.hasPagePositionOnly();
}
}
-
+
/**
* Get the value of the master-reference
property.
* @return the "master-reference" property
@@ -323,7 +323,7 @@ public class PageSequence extends AbstractPageSequence {
public int getNameId() {
return FO_PAGE_SEQUENCE;
}
-
+
/**
* Get the value of the country
property.
* @return the country property value
@@ -331,7 +331,7 @@ public class PageSequence extends AbstractPageSequence {
public String getCountry() {
return this.country;
}
-
+
/**
* Get the value of the language
property.
* @return the language property value
@@ -347,5 +347,5 @@ public class PageSequence extends AbstractPageSequence {
this.mainFlow = null;
this.flowMap.clear();
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
index a16514705..b1d8d4055 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,7 +42,7 @@ public class PageSequenceMaster extends FObj {
// The value of properties relevant for fo:page-sequence-master.
private String masterName;
// End of property values
-
+
private LayoutMasterSet layoutMasterSet;
private List subSequenceSpecifiers;
private SubSequenceSpecifier currentSubSequence;
@@ -68,7 +68,7 @@ public class PageSequenceMaster extends FObj {
/** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
masterName = pList.get(PR_MASTER_NAME).getString();
-
+
if (masterName == null || masterName.equals("")) {
missingPropertyError("master-name");
}
@@ -80,7 +80,7 @@ public class PageSequenceMaster extends FObj {
layoutMasterSet = parent.getRoot().getLayoutMasterSet();
layoutMasterSet.addPageSequenceMaster(masterName, this);
}
-
+
/** {@inheritDoc} */
protected void endOfNode() throws FOPException {
if (firstChild == null) {
@@ -94,12 +94,12 @@ public class PageSequenceMaster extends FObj {
*
XSL/FOP: (single-page-master-reference|repeatable-page-master-reference|
* repeatable-page-master-alternatives)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
- if (!"single-page-master-reference".equals(localName)
+ if (!"single-page-master-reference".equals(localName)
&& !"repeatable-page-master-reference".equals(localName)
- && !"repeatable-page-master-alternatives".equals(localName)) {
+ && !"repeatable-page-master-alternatives".equals(localName)) {
invalidChildError(loc, nsURI, localName);
}
}
@@ -159,19 +159,19 @@ public class PageSequenceMaster extends FObj {
}
return (currentSubSequence != null);
}
-
+
/** @return true if the page-sequence-master has a page-master with page-position="last" */
public boolean hasPagePositionLast() {
return (currentSubSequence != null
&& currentSubSequence.hasPagePositionLast());
}
-
+
/** @return true if the page-sequence-master has a page-master with page-position="only" */
public boolean hasPagePositionOnly() {
return (currentSubSequence != null
&& currentSubSequence.hasPagePositionOnly());
}
-
+
/**
* Returns the next simple-page-master.
* @param isOddPage True if the next page number is odd
@@ -230,7 +230,7 @@ public class PageSequenceMaster extends FObj {
public String getLocalName() {
return "page-sequence-master";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_PAGE_SEQUENCE_MASTER}
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java b/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java
index f8a37d8c0..247384770 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,7 +37,7 @@ public class PageSequenceWrapper extends FObj {
private String indexClass;
private String indexKey;
// End of property values
-
+
/**
* Create a PageSequenceWrapper instance that is a child of
* the given parent {@link FONode}.
@@ -59,7 +59,7 @@ public class PageSequenceWrapper extends FObj {
* {@inheritDoc}
*
XSL/FOP: (bookmark+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!(localName.equals("page-sequence")
diff --git a/src/java/org/apache/fop/fo/pagination/Region.java b/src/java/org/apache/fop/fo/pagination/Region.java
index 753e8f735..87e9c4590 100644
--- a/src/java/org/apache/fop/fo/pagination/Region.java
+++ b/src/java/org/apache/fop/fo/pagination/Region.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,7 +46,7 @@ public abstract class Region extends FObj {
private Numeric referenceOrientation;
private int writingMode;
// End of property values
-
+
private SimplePageMaster layoutMaster;
/**
@@ -68,7 +68,7 @@ public abstract class Region extends FObj {
regionName = pList.get(PR_REGION_NAME).getString();
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
writingMode = pList.getWritingMode();
-
+
// regions may have name, or default
if (regionName.equals("")) {
regionName = getDefaultRegionName();
@@ -80,7 +80,7 @@ public abstract class Region extends FObj {
regionName, getLocator());
}
}
-
+
//TODO do we need context for getBPPaddingAndBorder() and getIPPaddingAndBorder()?
if ((getCommonBorderPaddingBackground().getBPPaddingAndBorder(false, null) != 0
|| getCommonBorderPaddingBackground().getIPPaddingAndBorder(false, null) != 0)) {
@@ -93,7 +93,7 @@ public abstract class Region extends FObj {
* {@inheritDoc} String, String)
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -149,7 +149,7 @@ public abstract class Region extends FObj {
* @return the Background Properties (border and padding are not used here).
*/
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
- return commonBorderPaddingBackground;
+ return commonBorderPaddingBackground;
}
/** @return the "region-name" property. */
@@ -166,12 +166,12 @@ public abstract class Region extends FObj {
public int getOverflow() {
return overflow;
}
-
+
/** @return the display-align property. */
public int getDisplayAlign() {
return displayAlign;
}
-
+
/** @return the "reference-orientation" property. */
public int getReferenceOrientation() {
return referenceOrientation.getValue();
diff --git a/src/java/org/apache/fop/fo/pagination/RegionAfter.java b/src/java/org/apache/fop/fo/pagination/RegionAfter.java
index 91aadce76..2189fa67b 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionAfter.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionAfter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,13 +45,13 @@ public class RegionAfter extends RegionBA {
/** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
- /* Special rules apply to resolving extent as values are resolved relative
+ /* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -59,7 +59,7 @@ public class RegionAfter extends RegionBA {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
diff --git a/src/java/org/apache/fop/fo/pagination/RegionBA.java b/src/java/org/apache/fop/fo/pagination/RegionBA.java
index 4cedee6d1..149e470cf 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionBA.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionBA.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@ public abstract class RegionBA extends SideRegion {
// The value of properties relevant for fo:region-[before|after].
private int precedence;
// End of property values
-
+
/**
* Create a RegionBA instance that is a child of the
* given parent {@link FONode}.
diff --git a/src/java/org/apache/fop/fo/pagination/RegionBefore.java b/src/java/org/apache/fop/fo/pagination/RegionBefore.java
index fbcf7e8e7..71ea26818 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionBefore.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionBefore.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -50,13 +50,13 @@ public class RegionBefore extends RegionBA {
/** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
- /* Special rules apply to resolving extent as values are resolved relative
+ /* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -64,7 +64,7 @@ public class RegionBefore extends RegionBA {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java
index c9dd792db..43499678a 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionBody.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -58,7 +58,7 @@ public class RegionBody extends Region {
commonMarginBlock = pList.getMarginBlockProps();
columnCount = pList.get(PR_COLUMN_COUNT).getNumeric();
columnGap = pList.get(PR_COLUMN_GAP).getLength();
-
+
if ((getColumnCount() > 1) && (getOverflow() == EN_SCROLL)) {
/* This is an error (See XSL Rec, fo:region-body description).
* The Rec allows for acting as if "1" is chosen in
@@ -103,13 +103,13 @@ public class RegionBody extends Region {
* all margin properties are configured to using BLOCK_WIDTH.
* That's why we 'cheat' here and setup a context for the height but
* use the LengthBase.BLOCK_WIDTH.
- * Also the values are resolved relative to the page size
+ * Also the values are resolved relative to the page size
* and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CONTAINING_BLOCK_WIDTH,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -117,7 +117,7 @@ public class RegionBody extends Region {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CONTAINING_BLOCK_WIDTH,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -152,7 +152,7 @@ public class RegionBody extends Region {
public String getLocalName() {
return "region-body";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_REGION_BODY}
diff --git a/src/java/org/apache/fop/fo/pagination/RegionEnd.java b/src/java/org/apache/fop/fo/pagination/RegionEnd.java
index 1b1abd53c..611b1edf6 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionEnd.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionEnd.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,13 +45,13 @@ public class RegionEnd extends RegionSE {
/** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
- /* Special rules apply to resolving extent as values are resolved relative
+ /* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -59,7 +59,7 @@ public class RegionEnd extends RegionSE {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -91,7 +91,7 @@ public class RegionEnd extends RegionSE {
public String getLocalName() {
return "region-end";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_REGION_END}
diff --git a/src/java/org/apache/fop/fo/pagination/RegionSE.java b/src/java/org/apache/fop/fo/pagination/RegionSE.java
index 15f61096b..f106e8a36 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionSE.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionSE.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/pagination/RegionStart.java b/src/java/org/apache/fop/fo/pagination/RegionStart.java
index e11a8f201..12b578634 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionStart.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionStart.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,13 +45,13 @@ public class RegionStart extends RegionSE {
/** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
- /* Special rules apply to resolving extent as values are resolved relative
+ /* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -59,7 +59,7 @@ public class RegionStart extends RegionSE {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
index 5c06dd40d..d1e710c89 100644
--- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
+++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -43,7 +43,7 @@ public class RepeatablePageMasterAlternatives extends FObj
// The value of properties relevant for fo:repeatable-page-master-alternatives.
private Property maximumRepeats;
// End of property values
-
+
private static final int INFINITE = -1;
private int numberConsumed = 0;
@@ -86,7 +86,7 @@ public class RepeatablePageMasterAlternatives extends FObj
* {@inheritDoc}
*
XSL/FOP: (conditional-page-master-reference+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("conditional-page-master-reference")) {
@@ -168,17 +168,17 @@ public class RepeatablePageMasterAlternatives extends FObj
return true;
}
}
-
+
/** {@inheritDoc} */
public boolean hasPagePositionLast() {
return this.hasPagePositionLast;
}
-
+
/** {@inheritDoc} */
public boolean hasPagePositionOnly() {
return this.hasPagePositionOnly;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "repeatable-page-master-alternatives";
diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
index 1cf77675d..60f8e0d6a 100644
--- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,7 +42,7 @@ public class RepeatablePageMasterReference extends FObj
private String masterReference;
private Property maximumRepeats;
// End of property values
-
+
private static final int INFINITE = -1;
private int numberConsumed = 0;
@@ -60,10 +60,10 @@ public class RepeatablePageMasterReference extends FObj
public void bind(PropertyList pList) throws FOPException {
masterReference = pList.get(PR_MASTER_REFERENCE).getString();
maximumRepeats = pList.get(PR_MAXIMUM_REPEATS);
-
+
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
- }
+ }
}
/** {@inheritDoc} */
@@ -76,12 +76,12 @@ public class RepeatablePageMasterReference extends FObj
pageSequenceMaster.addSubsequenceSpecifier(this);
}
}
-
+
/**
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
invalidChildError(loc, nsURI, localName);
}
@@ -125,7 +125,7 @@ public class RepeatablePageMasterReference extends FObj
this.numberConsumed = 0;
}
-
+
/** {@inheritDoc} */
public boolean goToPrevious() {
if (numberConsumed == 0) {
@@ -135,7 +135,7 @@ public class RepeatablePageMasterReference extends FObj
return true;
}
}
-
+
/** {@inheritDoc} */
public boolean hasPagePositionLast() {
return false;
diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java
index c6346e9fb..fcbb54abd 100644
--- a/src/java/org/apache/fop/fo/pagination/Root.java
+++ b/src/java/org/apache/fop/fo/pagination/Root.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -63,12 +63,12 @@ public class Root extends FObj {
* Context class used while building the FO tree.
*/
private FOTreeBuilderContext builderContext;
-
+
/**
* FOEventHandler object for this FO Tree
*/
private FOEventHandler foEventHandler = null;
-
+
/**
* Base constructor
*
@@ -88,7 +88,7 @@ public class Root extends FObj {
/** {@inheritDoc} */
protected void endOfNode() throws FOPException {
if (!pageSequenceFound || layoutMasterSet == null) {
- missingChildElementError("(layout-master-set, declarations?, "
+ missingChildElementError("(layout-master-set, declarations?, "
+ "bookmark-tree?, (page-sequence|fox:external-document)+)");
}
}
@@ -98,14 +98,14 @@ public class Root extends FObj {
*
XSL 1.0 Spec: (layout-master-set,declarations?,page-sequence+)
*
FOP: (layout-master-set, declarations?, fox:bookmarks?, page-sequence+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
- if (localName.equals("layout-master-set")) {
+ if (localName.equals("layout-master-set")) {
if (layoutMasterSet != null) {
tooManyNodesError(loc, "fo:layout-master-set");
}
- } else if (localName.equals("declarations")) {
+ } else if (localName.equals("declarations")) {
if (layoutMasterSet == null) {
nodesOutOfOrderError(loc, "fo:layout-master-set", "fo:declarations");
} else if (declarations != null) {
@@ -123,7 +123,7 @@ public class Root extends FObj {
} else if (pageSequenceFound) {
nodesOutOfOrderError(loc, "fo:bookmark-tree", "fo:page-sequence");
}
- } else if (localName.equals("page-sequence")) {
+ } else if (localName.equals("page-sequence")) {
if (layoutMasterSet == null) {
nodesOutOfOrderError(loc, "fo:layout-master-set", "fo:page-sequence");
} else {
@@ -142,7 +142,7 @@ public class Root extends FObj {
//Ignore non-FO elements under root
}
}
-
+
/** @inheritDoc */
protected void validateChildNode(Locator loc, FONode child) throws ValidationException {
@@ -159,15 +159,15 @@ public class Root extends FObj {
this.foEventHandler = foEventHandler;
}
- /**
- * This method overrides the FONode version. The FONode version calls the
- * method by the same name for the parent object. Since Root is at the top
- * of the tree, it returns the actual FOEventHandler object. Thus, any FONode
- * can use this chain to find which FOEventHandler it is being built for.
- * @return the FOEventHandler implementation that this Root is attached to
- */
- public FOEventHandler getFOEventHandler() {
- return foEventHandler;
+ /**
+ * This method overrides the FONode version. The FONode version calls the
+ * method by the same name for the parent object. Since Root is at the top
+ * of the tree, it returns the actual FOEventHandler object. Thus, any FONode
+ * can use this chain to find which FOEventHandler it is being built for.
+ * @return the FOEventHandler implementation that this Root is attached to
+ */
+ public FOEventHandler getFOEventHandler() {
+ return foEventHandler;
}
/**
@@ -182,7 +182,7 @@ public class Root extends FObj {
public FOTreeBuilderContext getBuilderContext() {
return this.builderContext;
}
-
+
/**
* Gets the last page number generated by the previous page-sequence
* @return the last page number, 0 if no page sequences yet generated
@@ -207,15 +207,15 @@ public class Root extends FObj {
* @param additionalPages the total pages generated by the sequence (for statistics)
* @throws IllegalArgumentException for negative additional page counts
*/
- public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) {
-
+ public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) {
+
if (additionalPages >= 0) {
totalPagesGenerated += additionalPages;
- endingPageNumberOfPreviousSequence = lastPageNumber;
+ endingPageNumberOfPreviousSequence = lastPageNumber;
} else {
throw new IllegalArgumentException(
"Number of additional pages must be zero or greater.");
- }
+ }
}
/**
diff --git a/src/java/org/apache/fop/fo/pagination/SideRegion.java b/src/java/org/apache/fop/fo/pagination/SideRegion.java
index 552ca871b..1b78de73f 100644
--- a/src/java/org/apache/fop/fo/pagination/SideRegion.java
+++ b/src/java/org/apache/fop/fo/pagination/SideRegion.java
@@ -30,7 +30,7 @@ import org.apache.fop.fo.PropertyList;
public abstract class SideRegion extends Region {
private Length extent;
-
+
/**
* Creates a new side region.
* @param parent the parent node
@@ -45,10 +45,10 @@ public abstract class SideRegion extends Region {
super.bind(pList);
extent = pList.get(PR_EXTENT).getLength();
}
-
+
/** @return the "extent" property. */
public Length getExtent() {
return extent;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java b/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
index b296b8579..b0ec96406 100644
--- a/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
+++ b/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -80,7 +80,7 @@ public class SimplePageMaster extends FObj {
pageWidth = pList.get(PR_PAGE_WIDTH).getLength();
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
writingMode = pList.getWritingMode();
-
+
if (masterName == null || masterName.equals("")) {
missingPropertyError("master-name");
}
@@ -112,7 +112,7 @@ public class SimplePageMaster extends FObj {
* {@inheritDoc}
*
XSL Content Model: (region-body,region-before?,region-after?,region-start?,region-end?)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("region-body")) {
@@ -247,12 +247,12 @@ public class SimplePageMaster extends FObj {
public Length getPageHeight() {
return pageHeight;
}
-
+
/** @return the "writing-mode" property. */
public int getWritingMode() {
return writingMode;
}
-
+
/** @return the "reference-orientation" property. */
public int getReferenceOrientation() {
return referenceOrientation.getValue();
diff --git a/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
index f58f32d1f..89416a534 100644
--- a/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,13 +34,13 @@ import org.apache.fop.fo.ValidationException;
* This is a reference for a single page. It returns the
* master name only once until reset.
*/
-public class SinglePageMasterReference extends FObj
+public class SinglePageMasterReference extends FObj
implements SubSequenceSpecifier {
// The value of properties relevant for fo:single-page-master-reference.
private String masterReference;
// End of property values
-
+
private static final int FIRST = 0;
private static final int DONE = 1;
@@ -62,7 +62,7 @@ public class SinglePageMasterReference extends FObj
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
- }
+ }
}
/** {@inheritDoc} */
@@ -70,12 +70,12 @@ public class SinglePageMasterReference extends FObj
PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
pageSequenceMaster.addSubsequenceSpecifier(this);
}
-
+
/**
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -100,8 +100,8 @@ public class SinglePageMasterReference extends FObj
public void reset() {
this.state = FIRST;
}
-
-
+
+
/** {@inheritDoc} */
public boolean goToPrevious() {
@@ -112,7 +112,7 @@ public class SinglePageMasterReference extends FObj
return true;
}
}
-
+
/** {@inheritDoc} */
public boolean hasPagePositionLast() {
return false;
@@ -122,7 +122,7 @@ public class SinglePageMasterReference extends FObj
public boolean hasPagePositionOnly() {
return false;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "single-page-master-reference";
diff --git a/src/java/org/apache/fop/fo/pagination/StaticContent.java b/src/java/org/apache/fop/fo/pagination/StaticContent.java
index 9a5e47d8a..4084a250a 100644
--- a/src/java/org/apache/fop/fo/pagination/StaticContent.java
+++ b/src/java/org/apache/fop/fo/pagination/StaticContent.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -63,7 +63,7 @@ public class StaticContent extends Flow {
* {@inheritDoc}
*
XSL Content Model: (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockItem(nsURI, localName)) {
diff --git a/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java b/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
index 68c8ed9b9..a8eddf5d3 100644
--- a/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
+++ b/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.pagination;
@@ -25,7 +25,7 @@ package org.apache.fop.fo.pagination;
* and are capable of looking up an appropriate {@link SimplePageMaster}.
*/
public interface SubSequenceSpecifier {
-
+
/**
* Returns the name of the next page master.
* @param isOddPage True if the next page number is odd
@@ -57,9 +57,9 @@ public interface SubSequenceSpecifier {
/** @return true if the subsequence has a page master for page-position "last" */
boolean hasPagePositionLast();
-
+
/** @return true if the subsequence has a page master for page-position "only" */
boolean hasPagePositionOnly();
-
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/Title.java b/src/java/org/apache/fop/fo/pagination/Title.java
index 03afcf5f6..5838e6ae1 100644
--- a/src/java/org/apache/fop/fo/pagination/Title.java
+++ b/src/java/org/apache/fop/fo/pagination/Title.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,7 +46,7 @@ public class Title extends InlineLevel {
* {@inheritDoc} String, String)
*
XSL/FOP: (#PCDATA|%inline;)*
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isInlineItem(nsURI, localName)) {
diff --git a/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java b/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
index ac1ef66de..5969729d4 100644
--- a/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
+++ b/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.fop.fo.ValidationException;
/**
* Class modelling the
- * fo:bookmark
object, first introduced in the
+ * fo:bookmark
object, first introduced in the
* XSL 1.1 WD.
*/
public class Bookmark extends FObj {
@@ -42,7 +42,7 @@ public class Bookmark extends FObj {
private String internalDestination;
private String externalDestination;
private boolean bShow = true; // from starting-state property
-
+
// Valid, but unused properties. Commented out for performance
// private CommonAccessibility commonAccessibility;
@@ -63,8 +63,8 @@ public class Bookmark extends FObj {
internalDestination = pList.get(PR_INTERNAL_DESTINATION).getString();
bShow = (pList.get(PR_STARTING_STATE).getEnum() == EN_SHOW);
- // per spec, internal takes precedence if both specified
- if (internalDestination.length() > 0) {
+ // per spec, internal takes precedence if both specified
+ if (internalDestination.length() > 0) {
externalDestination = null;
} else if (externalDestination.length() == 0) {
// slightly stronger than spec "should be specified"
@@ -79,7 +79,7 @@ public class Bookmark extends FObj {
* {@inheritDoc}
*
XSL/FOP: (bookmark-title, bookmark*)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("bookmark-title")) {
@@ -89,7 +89,7 @@ public class Bookmark extends FObj {
} else if (localName.equals("bookmark")) {
if (bookmarkTitle == null) {
nodesOutOfOrderError(loc, "fo:bookmark-title", "fo:bookmark");
- }
+ }
} else {
invalidChildError(loc, nsURI, localName);
}
diff --git a/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java b/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java
index 6cee46752..fc508dc96 100644
--- a/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java
+++ b/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,7 +46,7 @@ public class BookmarkTitle extends FObj {
/**
* Add the characters to this BookmarkTitle.
- * The text data inside the BookmarkTitle xml element
+ * The text data inside the BookmarkTitle xml element
* is used for the BookmarkTitle string.
*
* @param data the character data
@@ -64,7 +64,7 @@ public class BookmarkTitle extends FObj {
* {@inheritDoc}
*
XSL/FOP: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -79,7 +79,7 @@ public class BookmarkTitle extends FObj {
public String getTitle() {
return title;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "bookmark-title";
diff --git a/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java b/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java
index 9df049251..22bf0769b 100644
--- a/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java
+++ b/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -67,7 +67,7 @@ public class BookmarkTree extends FObj {
* {@inheritDoc}
*
XSL/FOP: (bookmark+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("bookmark")) {
diff --git a/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java b/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java
index 6307ad1c5..709fdf7f2 100644
--- a/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java
+++ b/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -43,16 +43,16 @@ public class BackgroundPositionShorthand extends ListProperty {
/**
* Construct an instance of a Maker for the given property.
- *
+ *
* @param propId The Constant ID of the property to be made.
*/
public Maker(int propId) {
super(propId);
}
-
-
- /**
- * {@inheritDoc}
+
+
+ /**
+ * {@inheritDoc}
* If only background-position-horizontal
is
* specified, background-position-vertical
is set
* to "50%".
@@ -60,7 +60,7 @@ public class BackgroundPositionShorthand extends ListProperty {
public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException {
Property p = super.make(propertyList, value, fo);
if (p.getList().size() == 1) {
- /* only background-position-horizontal specified
+ /* only background-position-horizontal specified
* through the shorthand, as a length or percentage:
* background-position-vertical=50% (see: XSL-FO 1.1 -- 7.31.2)
*/
@@ -71,8 +71,8 @@ public class BackgroundPositionShorthand extends ListProperty {
return p;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* Returns a {@link org.apache.fop.datatypes.PercentBase} whose
* getDimension()
returns 1.
*/
@@ -92,11 +92,11 @@ public class BackgroundPositionShorthand extends ListProperty {
public int getDimension() {
return 1;
}
-
+
};
}
}
-
+
/**
* Inner class to provide shorthand parsing capabilities
*
@@ -109,7 +109,7 @@ public class BackgroundPositionShorthand extends ListProperty {
PropertyMaker maker,
PropertyList propertyList)
throws PropertyException {
-
+
int index = -1;
List propList = property.getList();
if (propId == Constants.PR_BACKGROUND_POSITION_HORIZONTAL) {
@@ -119,8 +119,8 @@ public class BackgroundPositionShorthand extends ListProperty {
}
if (index >= 0) {
return maker.convertProperty(
- (Property) propList.get(index),
- propertyList,
+ (Property) propList.get(index),
+ propertyList,
propertyList.getFObj());
} // else: invalid index? shouldn't happen...
return null;
diff --git a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java
index 341baca1a..7c2854759 100644
--- a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,21 +24,21 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
/**
- * This subclass of LengthProperty.Maker handles the special treatment of
+ * This subclass of LengthProperty.Maker handles the special treatment of
* border width described in 7.7.20.
*/
public class BorderWidthPropertyMaker extends LengthProperty.Maker {
- int borderStyleId = 0;
-
+ int borderStyleId = 0;
+
/**
* Create a length property which check the value of the border-*-style
- * property and return a length of 0 when the style is "none".
+ * property and return a length of 0 when the style is "none".
* @param propId the border-*-width of the property.
*/
public BorderWidthPropertyMaker(int propId) {
super(propId);
}
-
+
/**
* Set the propId of the style property for the same side.
* @param borderStyleId
@@ -50,9 +50,9 @@ public class BorderWidthPropertyMaker extends LengthProperty.Maker {
/**
* Check the value of the style property and return a length of 0 when
* the style is NONE.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
-
+
public Property get(int subpropId, PropertyList propertyList,
boolean bTryInherit, boolean bTryDefault)
throws PropertyException
diff --git a/src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java b/src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java
index c71bc830f..feee406ab 100644
--- a/src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/properties/CharacterProperty.java b/src/java/org/apache/fop/fo/properties/CharacterProperty.java
index f42591fe8..c078da0c7 100644
--- a/src/java/org/apache/fop/fo/properties/CharacterProperty.java
+++ b/src/java/org/apache/fop/fo/properties/CharacterProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@ import org.apache.fop.fo.PropertyList;
* Superclass for properties that wrap a character value
*/
public final class CharacterProperty extends Property {
-
+
/**
* Inner class for creating instances of CharacterProperty
*/
@@ -58,7 +58,7 @@ public final class CharacterProperty extends Property {
private CharacterProperty(char character) {
this.character = character;
}
-
+
public static CharacterProperty getInstance(char character) {
return (CharacterProperty) cache.fetch(
new CharacterProperty(character));
@@ -85,7 +85,7 @@ public final class CharacterProperty extends Property {
return new Character(character).toString();
}
- /**
+ /**
* {@inheritDoc}
*/
public boolean equals(Object obj) {
@@ -96,7 +96,7 @@ public final class CharacterProperty extends Property {
}
}
- /**
+ /**
* {@inheritDoc}
*/
public int hashCode() {
diff --git a/src/java/org/apache/fop/fo/properties/ColorProperty.java b/src/java/org/apache/fop/fo/properties/ColorProperty.java
index a2a3d2150..925d275af 100644
--- a/src/java/org/apache/fop/fo/properties/ColorProperty.java
+++ b/src/java/org/apache/fop/fo/properties/ColorProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,16 +31,16 @@ import org.apache.fop.util.ColorUtil;
* Class for properties that wrap Color values
*/
public final class ColorProperty extends Property {
-
+
/** cache holding canonical ColorProperty instances */
private static final PropertyCache cache = new PropertyCache(ColorProperty.class);
-
+
/**
* The color represented by this property.
*/
protected final Color color;
-
+
/**
* Inner class for creating instances of ColorTypeProperty
*/
@@ -57,7 +57,7 @@ public final class ColorProperty extends Property {
* Return a ColorProperty object based on the passed Property object.
* This method is called if the Property object built by the parser
* isn't the right type for this property.
- *
+ *
* @param p
* The Property object return by the expression parser
* @param propertyList
@@ -70,7 +70,7 @@ public final class ColorProperty extends Property {
* for invalid or inconsistent FO input
*/
public Property convertProperty(Property p,
- PropertyList propertyList, FObj fo)
+ PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof ColorProperty) {
return p;
@@ -89,10 +89,10 @@ public final class ColorProperty extends Property {
/**
* Set the color given a particular String. For a full List of supported
* values please see ColorUtil.
- *
+ *
* @param foUserAgent FOP user agent
* @param value RGB value as String to be parsed
- * @return the canonical ColorProperty instance corresponding
+ * @return the canonical ColorProperty instance corresponding
* to the given value
* @throws PropertyException if the value can't be parsed
* @see ColorUtil#parseColorString(FOUserAgent, String)
@@ -106,13 +106,13 @@ public final class ColorProperty extends Property {
/**
* Create a new ColorProperty with a given color.
- *
+ *
* @param value the color to use.
*/
private ColorProperty(Color value) {
this.color = value;
}
-
+
/**
* Returns an AWT instance of this color
* @param foUserAgent FOP user agent
@@ -141,19 +141,19 @@ public final class ColorProperty extends Property {
public Object getObject() {
return this;
}
-
+
/** {@inheritDoc} */
public boolean equals(Object o) {
if (this == o) {
return true;
}
-
+
if (o instanceof ColorProperty) {
return ((ColorProperty) o).color.equals(this.color);
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
return this.color.hashCode();
diff --git a/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java b/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java
index 36e7377f4..e32e9dbd9 100644
--- a/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java
+++ b/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,12 +44,12 @@ public class CommonAbsolutePosition {
* The "right" property.
*/
public Length right;
-
+
/**
* The "bottom" property.
*/
public Length bottom;
-
+
/**
* The "left" property.
*/
@@ -64,9 +64,9 @@ public class CommonAbsolutePosition {
top = pList.get(Constants.PR_TOP).getLength();
bottom = pList.get(Constants.PR_BOTTOM).getLength();
left = pList.get(Constants.PR_LEFT).getLength();
- right = pList.get(Constants.PR_RIGHT).getLength();
+ right = pList.get(Constants.PR_RIGHT).getLength();
}
-
+
public String toString() {
StringBuffer sb = new StringBuffer("CommonAbsolutePosition{");
sb.append(" absPos=");
diff --git a/src/java/org/apache/fop/fo/properties/CommonAccessibility.java b/src/java/org/apache/fop/fo/properties/CommonAccessibility.java
index e97ba5a0a..74edf046b 100644
--- a/src/java/org/apache/fop/fo/properties/CommonAccessibility.java
+++ b/src/java/org/apache/fop/fo/properties/CommonAccessibility.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,7 +52,7 @@ public class CommonAccessibility {
if ("none".equals(role)) {
role = null;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonAural.java b/src/java/org/apache/fop/fo/properties/CommonAural.java
index f5e20584a..a47f183f1 100644
--- a/src/java/org/apache/fop/fo/properties/CommonAural.java
+++ b/src/java/org/apache/fop/fo/properties/CommonAural.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
index 35913ce3a..94639a5a6 100755
--- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
+++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,14 +39,14 @@ import org.apache.fop.fo.expr.PropertyException;
*/
public class CommonBorderPaddingBackground {
- /**
- * cache holding all canonical instances
+ /**
+ * cache holding all canonical instances
* (w/ absolute background-position-* and padding-*)
*/
private static final PropertyCache cache = new PropertyCache(CommonBorderPaddingBackground.class);
-
+
private int hash = -1;
-
+
/**
* The "background-attachment" property.
*/
@@ -91,17 +91,17 @@ public class CommonBorderPaddingBackground {
public static final int END = 3;
/**
- *
+ *
*/
public static class BorderInfo {
-
+
/** cache holding all canonical instances */
private static final PropertyCache cache = new PropertyCache(BorderInfo.class);
-
+
private int mStyle; // Enum for border style
private Color mColor; // Border color
private CondLengthProperty mWidth;
-
+
private int hash = -1;
/**
@@ -115,7 +115,7 @@ public class CommonBorderPaddingBackground {
/**
* Returns a BorderInfo instance corresponding to the given values
- *
+ *
* @param style the border-style
* @param width the border-width
* @param color the border-color
@@ -149,7 +149,7 @@ public class CommonBorderPaddingBackground {
/**
* Convenience method returning the border-width,
* taking into account values of "none" and "hidden"
- *
+ *
* @return the retained border-width
*/
public int getRetainedWidth() {
@@ -173,23 +173,23 @@ public class CommonBorderPaddingBackground {
sb.append("}");
return sb.toString();
}
-
+
/** {@inheritDoc} */
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
-
+
if (obj instanceof BorderInfo) {
BorderInfo bi = (BorderInfo)obj;
return (this.mColor == bi.mColor
&& this.mStyle == bi.mStyle
&& this.mWidth == bi.mWidth);
}
-
+
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == -1) {
@@ -207,9 +207,9 @@ public class CommonBorderPaddingBackground {
* A border info with style "none". Used as a singleton, in the collapsing-border model,
* for elements which don't specify any border on some of their sides.
*/
- private static final BorderInfo defaultBorderInfo
+ private static final BorderInfo defaultBorderInfo
= BorderInfo.getInstance(Constants.EN_NONE, new ConditionalNullLength(), null);
-
+
/**
* A conditional length of value 0. Returned by the
* {@link CommonBorderPaddingBackground#getBorderInfo(int)} method when the
@@ -265,7 +265,7 @@ public class CommonBorderPaddingBackground {
/**
* Returns a default BorderInfo of style none.
- *
+ *
* @return a BorderInfo instance with style set to {@link Constants#EN_NONE}
*/
public static BorderInfo getDefaultBorderInfo() {
@@ -277,14 +277,14 @@ public class CommonBorderPaddingBackground {
/**
* Construct a CommonBorderPaddingBackground object.
- *
+ *
* @param pList The PropertyList to get properties from.
* @throws PropertyException if there's an error while binding the properties
*/
private CommonBorderPaddingBackground(PropertyList pList) throws PropertyException {
backgroundAttachment = pList.get(Constants.PR_BACKGROUND_ATTACHMENT).getEnum();
-
+
Color bc = pList.get(Constants.PR_BACKGROUND_COLOR).getColor(
pList.getFObj().getUserAgent());
if (bc.getAlpha() == 0) {
@@ -332,16 +332,16 @@ public class CommonBorderPaddingBackground {
}
/**
- * Obtain a CommonBorderPaddingBackground instance based on the
+ * Obtain a CommonBorderPaddingBackground instance based on the
* related property valus in the given {@link PropertyList}
- *
+ *
* @param pList the {@link PropertyList} to use
* @return a CommonBorderPaddingBackground instance (cached if possible)
* @throws PropertyException in case of an error
*/
- public static CommonBorderPaddingBackground getInstance(PropertyList pList)
+ public static CommonBorderPaddingBackground getInstance(PropertyList pList)
throws PropertyException {
-
+
CommonBorderPaddingBackground newInstance
= new CommonBorderPaddingBackground(pList);
CommonBorderPaddingBackground cachedInstance = null;
@@ -355,9 +355,9 @@ public class CommonBorderPaddingBackground {
&& (newInstance.backgroundPositionVertical == null || newInstance.backgroundPositionVertical.isAbsolute())) {
cachedInstance = cache.fetch(newInstance);
}
-
+
/* for non-cached, or not-yet-cached instances, preload the image */
- if ((cachedInstance == null
+ if ((cachedInstance == null
|| cachedInstance == newInstance)
&& !("".equals(newInstance.backgroundImage))) {
//Additional processing: preload image
@@ -374,14 +374,14 @@ public class CommonBorderPaddingBackground {
}
//TODO Report to caller so he can decide to throw an exception
}
-
+
return (cachedInstance != null ? cachedInstance : newInstance);
}
private void initBorderInfo(PropertyList pList, int side,
int colorProp, int styleProp, int widthProp, int paddingProp)
throws PropertyException {
-
+
padding[side] = pList.get(paddingProp).getCondLength();
// If style = none, force width to 0, don't get Color (spec 7.7.20)
int style = pList.get(styleProp).getEnum();
@@ -391,7 +391,7 @@ public class CommonBorderPaddingBackground {
pList.get(widthProp).getCondLength(),
pList.get(colorProp).getColor(ua)), side);
}
-
+
}
/**
@@ -517,7 +517,7 @@ public class CommonBorderPaddingBackground {
/**
* The border-color for the given side
- *
+ *
* @param side one of {@link #BEFORE}, {@link #AFTER}, {@link #START}, {@link #END}
* @return the border-color for the given side
*/
@@ -531,7 +531,7 @@ public class CommonBorderPaddingBackground {
/**
* The border-style for the given side
- *
+ *
* @param side one of {@link #BEFORE}, {@link #AFTER}, {@link #START}, {@link #END}
* @return the border-style for the given side
*/
@@ -547,7 +547,7 @@ public class CommonBorderPaddingBackground {
* Return the padding for the given side, taking into account
* the conditionality and evaluating any percentages in the given
* context.
- *
+ *
* @param side one of {@link #BEFORE}, {@link #AFTER}, {@link #START}, {@link #END}
* @param discard true if the conditionality component should be considered
* @param context the context for percentage-resolution
@@ -620,7 +620,7 @@ public class CommonBorderPaddingBackground {
+ getBorderStartWidth(false) + getBorderEndWidth(false)) > 0);
}
- /**
+ /**
* @param context for percentage based evaluation.
* @return true if padding is non-zero.
*/
@@ -634,7 +634,7 @@ public class CommonBorderPaddingBackground {
return (borderInfo[BEFORE] != null || borderInfo[AFTER] != null
|| borderInfo[START] != null || borderInfo[END] != null);
}
-
+
/** {@inheritDoc} */
public boolean equals(Object obj) {
if (this == obj) {
@@ -657,10 +657,10 @@ public class CommonBorderPaddingBackground {
&& this.padding[START] == cbpb.padding[START]
&& this.padding[END] == cbpb.padding[END]);
}
-
+
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == -1) {
@@ -681,7 +681,7 @@ public class CommonBorderPaddingBackground {
hash = 37 * hash + (padding[END] == null ? 0 : padding[END].hashCode());
this.hash = hash;
}
-
+
return this.hash;
}
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonFont.java b/src/java/org/apache/fop/fo/properties/CommonFont.java
index ca543a050..11275fdd3 100755
--- a/src/java/org/apache/fop/fo/properties/CommonFont.java
+++ b/src/java/org/apache/fop/fo/properties/CommonFont.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,10 +38,10 @@ public final class CommonFont {
/** cache holding canonical CommonFont instances (only those with
* absolute font-size and font-size-adjust) */
private static final PropertyCache cache = new PropertyCache(CommonFont.class);
-
+
/** hashcode of this instance */
private int hash = 0;
-
+
/** The "font-family" property. */
private final FontFamilyProperty fontFamily;
@@ -59,17 +59,17 @@ public final class CommonFont {
/** The "font-weight" property. */
private final EnumProperty fontWeight;
-
+
/** The "font-size" property. */
public final Length fontSize;
/** The "font-size-adjust" property. */
public final Numeric fontSizeAdjust;
-
+
/**
* Construct a CommonFont instance
- *
+ *
* @param fontFamily the font-family property
* @param fontSelectionStrategy the font-selection-strategy property
* @param fontStretch the font-stretch property
@@ -84,8 +84,8 @@ public final class CommonFont {
EnumProperty fontStretch,
EnumProperty fontStyle,
EnumProperty fontVariant,
- EnumProperty fontWeight,
- Length fontSize,
+ EnumProperty fontWeight,
+ Length fontSize,
Numeric fontSizeAdjust) {
this.fontFamily = fontFamily;
this.fontSelectionStrategy = fontSelectionStrategy;
@@ -103,7 +103,7 @@ public final class CommonFont {
* the entire instance will be cached.
* If not, then a distinct instance will be returned, with
* as much cached information as possible.
- *
+ *
* @param pList the PropertyList to get the properties from
* @return a CommonFont instance corresponding to the properties
* @throws PropertyException if there was a problem getting the properties
@@ -117,19 +117,19 @@ public final class CommonFont {
EnumProperty fontWeight = (EnumProperty) pList.get(Constants.PR_FONT_WEIGHT);
Numeric fontSizeAdjust = pList.get(Constants.PR_FONT_SIZE_ADJUST).getNumeric();
Length fontSize = pList.get(Constants.PR_FONT_SIZE).getLength();
-
- CommonFont commonFont = new CommonFont(fontFamily,
- fontSelectionStrategy,
- fontStretch,
- fontStyle,
- fontVariant,
+
+ CommonFont commonFont = new CommonFont(fontFamily,
+ fontSelectionStrategy,
+ fontStretch,
+ fontStyle,
+ fontVariant,
fontWeight,
fontSize,
fontSizeAdjust);
-
+
return cache.fetch(commonFont);
}
-
+
/** @return an array with the font-family names */
private String[] getFontFamily() {
List lst = fontFamily.getList();
@@ -139,12 +139,12 @@ public final class CommonFont {
}
return fontFamily;
}
-
+
/** @return the first font-family name in the list */
public String getFirstFontFamily() {
return ((Property) fontFamily.list.get(0)).getString();
}
-
+
/** @return the "font-selection-strategy" property */
public int getFontSelectionStrategy() {
return fontSelectionStrategy.getEnum();
@@ -154,12 +154,12 @@ public final class CommonFont {
public int getFontStretch() {
return fontStretch.getEnum();
}
-
+
/** @return the "font-style" property */
public int getFontStyle() {
return fontStyle.getEnum();
}
-
+
/** @return the "font-variant" property */
public int getFontVariant() {
return fontVariant.getEnum();
@@ -169,11 +169,11 @@ public final class CommonFont {
public int getFontWeight() {
return fontWeight.getEnum();
}
-
+
/**
- * Create and return an array of FontTriplets
based on
+ * Create and return an array of FontTriplets
based on
* the properties stored in the instance variables.
- *
+ *
* @param fontInfo
* @return a Font object.
*/
@@ -194,13 +194,13 @@ public final class CommonFont {
String style;
switch (fontStyle.getEnum()) {
- case Constants.EN_ITALIC:
+ case Constants.EN_ITALIC:
style = "italic";
break;
- case Constants.EN_OBLIQUE:
+ case Constants.EN_OBLIQUE:
style = "oblique";
break;
- case Constants.EN_BACKSLANT:
+ case Constants.EN_BACKSLANT:
style = "backslant";
break;
default:
@@ -210,22 +210,22 @@ public final class CommonFont {
// various kinds of keywords too
//int fontVariant = propertyList.get("font-variant").getEnum();
FontTriplet[] triplets = fontInfo.fontLookup(
- getFontFamily(),
+ getFontFamily(),
style, font_weight);
return triplets;
}
/** {@inheritDoc} */
public boolean equals(Object o) {
-
+
if (o == null) {
return false;
}
-
+
if (this == o) {
return true;
}
-
+
if (o instanceof CommonFont) {
CommonFont cf = (CommonFont) o;
return (cf.fontFamily == this.fontFamily)
@@ -238,12 +238,12 @@ public final class CommonFont {
&& (cf.fontSizeAdjust == this.fontSizeAdjust);
}
return false;
-
+
}
-
+
/** {@inheritDoc} */
public int hashCode() {
-
+
if (this.hash == -1) {
int hash = 17;
hash = 37 * hash + (fontSize == null ? 0 : fontSize.hashCode());
@@ -257,6 +257,6 @@ public final class CommonFont {
this.hash = hash;
}
return hash;
-
+
}
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java
index a294b2bbd..0e32f250a 100644
--- a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java
+++ b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,11 +37,11 @@ public final class CommonHyphenation {
/** Logger */
protected static Log log = LogFactory.getLog(CommonHyphenation.class);
-
+
private static final PropertyCache cache = new PropertyCache(CommonHyphenation.class);
-
+
private int hash = 0;
-
+
/** The "language" property */
public final StringProperty language;
@@ -65,7 +65,7 @@ public final class CommonHyphenation {
/**
* Construct a CommonHyphenation object holding the given properties
- *
+ *
*/
private CommonHyphenation(StringProperty language,
StringProperty country,
@@ -82,46 +82,46 @@ public final class CommonHyphenation {
this.hyphenationPushCharacterCount = hyphenationPushCharacterCount;
this.hyphenationRemainCharacterCount = hyphenationRemainCharacterCount;
}
-
+
/**
* Gets the canonical CommonHyphenation
instance corresponding
- * to the values of the related properties present on the given
+ * to the values of the related properties present on the given
* PropertyList
- *
+ *
* @param propertyList the PropertyList
*/
public static CommonHyphenation getInstance(PropertyList propertyList) throws PropertyException {
- StringProperty language =
+ StringProperty language =
(StringProperty) propertyList.get(Constants.PR_LANGUAGE);
- StringProperty country =
+ StringProperty country =
(StringProperty) propertyList.get(Constants.PR_COUNTRY);
- StringProperty script =
+ StringProperty script =
(StringProperty) propertyList.get(Constants.PR_SCRIPT);
- EnumProperty hyphenate =
+ EnumProperty hyphenate =
(EnumProperty) propertyList.get(Constants.PR_HYPHENATE);
- CharacterProperty hyphenationCharacter =
+ CharacterProperty hyphenationCharacter =
(CharacterProperty) propertyList.get(Constants.PR_HYPHENATION_CHARACTER);
- NumberProperty hyphenationPushCharacterCount =
+ NumberProperty hyphenationPushCharacterCount =
(NumberProperty) propertyList.get(Constants.PR_HYPHENATION_PUSH_CHARACTER_COUNT);
- NumberProperty hyphenationRemainCharacterCount =
+ NumberProperty hyphenationRemainCharacterCount =
(NumberProperty) propertyList.get(Constants.PR_HYPHENATION_REMAIN_CHARACTER_COUNT);
-
+
CommonHyphenation instance = new CommonHyphenation(
- language,
- country,
- script,
- hyphenate,
- hyphenationCharacter,
- hyphenationPushCharacterCount,
+ language,
+ country,
+ script,
+ hyphenate,
+ hyphenationCharacter,
+ hyphenationPushCharacterCount,
hyphenationRemainCharacterCount);
-
+
return cache.fetch(instance);
-
+
}
-
+
private static final char HYPHEN_MINUS = '-';
private static final char MINUS_SIGN = '\u2212';
-
+
/**
* Returns the effective hyphenation character for a font. The hyphenation character specified
* in XSL-FO may be substituted if it's not available in the font.
@@ -166,13 +166,13 @@ public final class CommonHyphenation {
if (warn) {
log.warn("Substituted specified hyphenation character (0x"
+ Integer.toHexString(hyphChar)
- + ") with 0x" + Integer.toHexString(effHyphChar)
- + " because the font doesn't have the specified hyphenation character: "
+ + ") with 0x" + Integer.toHexString(effHyphChar)
+ + " because the font doesn't have the specified hyphenation character: "
+ font.getFontTriplet());
}
return effHyphChar;
}
-
+
/**
* Returns the IPD for the hyphenation character for a font.
* @param font the font
@@ -182,7 +182,7 @@ public final class CommonHyphenation {
char hyphChar = getHyphChar(font);
return font.getCharWidth(hyphChar);
}
-
+
/** {@inheritDoc} */
public boolean equals(Object obj) {
if (obj == this) {
@@ -200,7 +200,7 @@ public final class CommonHyphenation {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == 0) {
@@ -209,15 +209,15 @@ public final class CommonHyphenation {
hash = 37 * hash + (script == null ? 0 : script.hashCode());
hash = 37 * hash + (country == null ? 0 : country.hashCode());
hash = 37 * hash + (hyphenate == null ? 0 : hyphenate.hashCode());
- hash = 37 * hash +
+ hash = 37 * hash +
(hyphenationCharacter == null ? 0 : hyphenationCharacter.hashCode());
- hash = 37 * hash +
+ hash = 37 * hash +
(hyphenationPushCharacterCount == null ? 0 : hyphenationPushCharacterCount.hashCode());
- hash = 37 * hash +
+ hash = 37 * hash +
(hyphenationRemainCharacterCount == null ? 0 : hyphenationRemainCharacterCount.hashCode());
this.hash = hash;
}
return this.hash;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java b/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
index 6ca9e5817..8d63b3d22 100644
--- a/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
+++ b/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -86,17 +86,17 @@ public class CommonMarginBlock {
startIndent = pList.get(Constants.PR_START_INDENT).getLength();
endIndent = pList.get(Constants.PR_END_INDENT).getLength();
}
-
+
/** {@inheritDoc} */
public String toString() {
- return "CommonMarginBlock:\n"
- + "Margins (top, bottom, left, right): ("
- + marginTop + ", " + marginBottom + ", "
+ return "CommonMarginBlock:\n"
+ + "Margins (top, bottom, left, right): ("
+ + marginTop + ", " + marginBottom + ", "
+ marginLeft + ", " + marginRight + ")\n"
- + "Space (before, after): ("
- + spaceBefore + ", " + spaceAfter + ")\n"
+ + "Space (before, after): ("
+ + spaceBefore + ", " + spaceAfter + ")\n"
+ "Indents (start, end): ("
+ startIndent + ", " + endIndent + ")\n";
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonMarginInline.java b/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
index eb892d0a4..c578e58b8 100644
--- a/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
+++ b/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java b/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
index 504fb6362..f28a3edb3 100644
--- a/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
+++ b/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@ public class CommonRelativePosition {
* The "relative-position" property.
*/
public int relativePosition;
-
+
/**
* The "top" property.
*/
@@ -44,12 +44,12 @@ public class CommonRelativePosition {
* The "right" property.
*/
public Length right;
-
+
/**
* The "bottom" property.
*/
public Length bottom;
-
+
/**
* The "left" property.
*/
@@ -64,7 +64,7 @@ public class CommonRelativePosition {
top = pList.get(Constants.PR_TOP).getLength();
bottom = pList.get(Constants.PR_BOTTOM).getLength();
left = pList.get(Constants.PR_LEFT).getLength();
- right = pList.get(Constants.PR_RIGHT).getLength();
+ right = pList.get(Constants.PR_RIGHT).getLength();
}
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java b/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
index d56d9a101..f7c11578d 100644
--- a/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
+++ b/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
@@ -39,30 +39,30 @@ public class CommonTextDecoration {
private static final int OVERLINE = 2;
private static final int LINE_THROUGH = 4;
private static final int BLINK = 8;
-
+
private int decoration;
private Color underColor;
private Color overColor;
private Color throughColor;
-
+
/**
* Creates a new CommonTextDecoration object with default values.
*/
public CommonTextDecoration() {
}
-
+
/**
* Creates a CommonTextDecoration object from a property list.
* @param pList the property list to build the object for
* @return a CommonTextDecoration object or null if the obj would only have default values
* @throws PropertyException if there's a problem while processing the property
*/
- public static CommonTextDecoration createFromPropertyList(PropertyList pList)
+ public static CommonTextDecoration createFromPropertyList(PropertyList pList)
throws PropertyException {
return calcTextDecoration(pList);
}
-
- private static CommonTextDecoration calcTextDecoration(PropertyList pList)
+
+ private static CommonTextDecoration calcTextDecoration(PropertyList pList)
throws PropertyException {
CommonTextDecoration deco = null;
PropertyList parentList = pList.getParentPropertyList();
@@ -76,7 +76,7 @@ public class CommonTextDecoration {
List list = textDecoProp.getList();
Iterator i = list.iterator();
while (i.hasNext()) {
- Property prop = (Property)i.next();
+ Property prop = (Property)i.next();
int propEnum = prop.getEnum();
FOUserAgent ua = (pList == null)
? null
@@ -135,7 +135,7 @@ public class CommonTextDecoration {
}
return deco;
}
-
+
/** @return true if underline is active */
public boolean hasUnderline() {
return (this.decoration & UNDERLINE) != 0;
@@ -155,12 +155,12 @@ public class CommonTextDecoration {
public boolean isBlinking() {
return (this.decoration & BLINK) != 0;
}
-
+
/** @return the color of the underline mark */
public Color getUnderlineColor() {
return this.underColor;
}
-
+
/** @return the color of the overline mark */
public Color getOverlineColor() {
return this.overColor;
diff --git a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
index f15050fbe..45f6b2e9f 100644
--- a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,13 +26,13 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
/**
- * This class extends Property.Maker with support for sub-properties.
+ * This class extends Property.Maker with support for sub-properties.
*/
public class CompoundPropertyMaker extends PropertyMaker {
/**
* The list of subproperty makers supported by this compound maker.
- */
- private PropertyMaker[] subproperties =
+ */
+ private PropertyMaker[] subproperties =
new PropertyMaker[Constants.COMPOUND_COUNT];
/**
@@ -63,7 +63,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
}
}
-
+
/**
* Add a subproperty to this maker.
* @param subproperty
@@ -72,7 +72,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
// Place the base propId in the propId of the subproperty.
subproperty.propId &= Constants.COMPOUND_MASK;
subproperty.propId |= propId;
-
+
subproperties[getSubpropIndex(subproperty.getPropId())] = subproperty;
// Store the first subproperty with a setByShorthand. That subproperty
@@ -81,8 +81,8 @@ public class CompoundPropertyMaker extends PropertyMaker {
shorthandMaker = subproperty;
}
}
-
-
+
+
/**
* Return a Maker object which is used to set the values on components
* of compound property types, such as "space".
@@ -96,11 +96,11 @@ public class CompoundPropertyMaker extends PropertyMaker {
public PropertyMaker getSubpropMaker(int subpropertyId) {
return subproperties[getSubpropIndex(subpropertyId)];
}
-
+
/**
* Calculate the real value of a subproperty by unmasking and shifting
* the value into the range [0 - (COMPOUND_COUNT-1)].
- * The value is used as index into the subproperties array.
+ * The value is used as index into the subproperties array.
* @param propId the property id of the sub property.
* @return the array index.
*/
@@ -111,7 +111,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
/**
* For compound properties which can take enumerate values.
- * Delegate the enumeration check to one of the subpropeties.
+ * Delegate the enumeration check to one of the subpropeties.
* @param value the string containing the property value
* @return the Property encapsulating the enumerated equivalent of the
* input value
@@ -136,7 +136,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
* Is 0 when retriving a base property.
* @param propertyList The PropertyList object being built for this FO.
* @param tryInherit true if inherited properties should be examined.
- * @param tryDefault true if the default value should be returned.
+ * @param tryDefault true if the default value should be returned.
*/
public Property get(int subpropertyId, PropertyList propertyList,
boolean tryInherit, boolean tryDefault)
@@ -148,7 +148,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
return p;
}
-
+
/**
* Return a Property object based on the passed Property object.
* This method is called if the Property object built by the parser
@@ -165,7 +165,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
FObj fo) throws PropertyException {
// Delegate to the subproperty maker to do conversions.
p = shorthandMaker.convertProperty(p, propertyList, fo);
-
+
if (p != null) {
Property prop = makeCompound(propertyList, fo);
CompoundDatatype pval = (CompoundDatatype) prop.getObject();
@@ -181,7 +181,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
/**
- * Make a compound property with default values.
+ * Make a compound property with default values.
* @param propertyList The PropertyList object being built for this FO.
* @return the Property object corresponding to the parameters
* @throws PropertyException for invalid or inconsisten FO input
@@ -193,7 +193,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
return makeCompound(propertyList, propertyList.getParentFObj());
}
}
-
+
/**
* Create a Property object from an attribute specification.
* @param propertyList The PropertyList object being built for this FO.
@@ -201,14 +201,14 @@ public class CompoundPropertyMaker extends PropertyMaker {
* @param fo The parent FO for the FO whose property is being made.
* @return The initialized Property object.
* @throws PropertyException for invalid or inconsistent FO input
- */
+ */
public Property make(PropertyList propertyList, String value,
FObj fo) throws PropertyException {
Property p = super.make(propertyList, value, fo);
p = convertProperty(p, propertyList, fo);
- return p;
+ return p;
}
-
+
/**
* Return a property value for a compound property. If the property
* value is already partially initialized, this method will modify it.
@@ -243,7 +243,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
return baseProperty;
}
-
+
/**
* Create a empty compound property and fill it with default values for
* the subproperties.
@@ -265,5 +265,5 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
}
return p;
- }
+ }
}
diff --git a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
index 15d430051..aa913d969 100644
--- a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
+++ b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,14 +31,14 @@ import org.apache.fop.fo.expr.PropertyException;
* Superclass for properties that have conditional lengths
*/
public class CondLengthProperty extends Property implements CompoundDatatype {
-
+
/** cache holding canonical instances (for absolute conditional lengths) */
private static final PropertyCache cache = new PropertyCache(CondLengthProperty.class);
-
+
/** components */
private Property length;
private EnumProperty conditionality;
-
+
private boolean isCached = false;
private int hash = -1;
@@ -56,7 +56,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
/**
* Create a new empty instance of CondLengthProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new CondLengthProperty();
@@ -64,7 +64,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof KeepProperty) {
@@ -75,7 +75,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -83,7 +83,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
throw new IllegalStateException(
"CondLengthProperty.setComponent() called on a cached value!");
}
-
+
if (cmpId == CP_LENGTH) {
length = cmpnValue;
} else if (cmpId == CP_CONDITIONALITY) {
@@ -147,11 +147,11 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
/** {@inheritDoc} */
public String toString() {
- return "CondLength[" + length.getObject().toString()
- + ", " + (isDiscard()
- ? conditionality.toString().toLowerCase()
+ return "CondLength[" + length.getObject().toString()
+ + ", " + (isDiscard()
+ ? conditionality.toString().toLowerCase()
: conditionality.toString()) + "]";
- }
+ }
/**
* @return this.condLength
@@ -188,7 +188,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
if (this == obj) {
return true;
}
-
+
if (obj instanceof CondLengthProperty) {
CondLengthProperty clp = (CondLengthProperty)obj;
return (this.length == clp.length
@@ -196,7 +196,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == -1) {
diff --git a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
index add38161e..60237c53a 100644
--- a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,19 +33,19 @@ public class CorrespondingPropertyMaker {
protected int tb_rl;
protected boolean useParent;
private boolean relative;
-
+
public CorrespondingPropertyMaker(PropertyMaker baseMaker) {
this.baseMaker = baseMaker;
baseMaker.setCorresponding(this);
}
-
-
+
+
public void setCorresponding(int lr_tb, int rl_tb, int tb_rl) {
this.lr_tb = lr_tb;
this.rl_tb = rl_tb;
this.tb_rl = tb_rl;
}
-
+
/**
* Controls whether the PropertyMaker accesses the parent property list or the current
* property list for determining the writing mode.
@@ -58,7 +58,7 @@ public class CorrespondingPropertyMaker {
public void setRelative(boolean relative) {
this.relative = relative;
}
-
+
/**
* For properties that operate on a relative direction (before, after,
* start, end) instead of an absolute direction (top, bottom, left,
@@ -80,18 +80,18 @@ public class CorrespondingPropertyMaker {
if (!relative) {
return false;
}
-
+
PropertyList pList = getWMPropertyList(propertyList);
if (pList != null) {
int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
-
+
if (pList.getExplicit(correspondingId) != null) {
return true;
}
- }
+ }
return false;
}
-
+
/**
* Return a Property object representing the value of this property,
* based on other property values for this FO.
@@ -108,7 +108,7 @@ public class CorrespondingPropertyMaker {
return null;
}
int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
-
+
Property p = propertyList.getExplicitOrShorthand(correspondingId);
if (p != null) {
FObj parentFO = propertyList.getParentFObj();
@@ -116,7 +116,7 @@ public class CorrespondingPropertyMaker {
}
return p;
}
-
+
/**
* Return the property list to use for fetching writing mode depending property
* ids.
diff --git a/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java b/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
index 6bd30929a..29715fe66 100644
--- a/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,7 +35,7 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
public DimensionPropertyMaker(PropertyMaker baseMaker) {
super(baseMaker);
}
-
+
public void setExtraCorresponding(int[][] extraCorresponding) {
this.extraCorresponding = extraCorresponding;
}
@@ -47,7 +47,7 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
int wmcorr = extraCorresponding[i][0]; //propertyList.getWritingMode()];
if (propertyList.getExplicit(wmcorr) != null)
return true;
- }
+ }
return false;
}
@@ -59,8 +59,8 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
}
// Based on min-[width|height]
- int wmcorr = propertyList.getWritingMode(extraCorresponding[0][0],
- extraCorresponding[0][1],
+ int wmcorr = propertyList.getWritingMode(extraCorresponding[0][0],
+ extraCorresponding[0][1],
extraCorresponding[0][2]);
Property subprop = propertyList.getExplicitOrShorthand(wmcorr);
if (subprop != null) {
@@ -68,8 +68,8 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
}
// Based on max-[width|height]
- wmcorr = propertyList.getWritingMode(extraCorresponding[1][0],
- extraCorresponding[1][1],
+ wmcorr = propertyList.getWritingMode(extraCorresponding[1][0],
+ extraCorresponding[1][1],
extraCorresponding[1][2]);
subprop = propertyList.getExplicitOrShorthand(wmcorr);
// TODO: Don't set when NONE.
@@ -78,5 +78,5 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
}
return p;
- }
+ }
}
diff --git a/src/java/org/apache/fop/fo/properties/EnumLength.java b/src/java/org/apache/fop/fo/properties/EnumLength.java
index 95b759356..76fd0e5b7 100755
--- a/src/java/org/apache/fop/fo/properties/EnumLength.java
+++ b/src/java/org/apache/fop/fo/properties/EnumLength.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.properties;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -26,7 +26,7 @@ import org.apache.fop.datatypes.PercentBaseContext;
*/
public class EnumLength extends LengthProperty {
private Property enumProperty;
-
+
public EnumLength(Property enumProperty) {
this.enumProperty = enumProperty;
}
diff --git a/src/java/org/apache/fop/fo/properties/EnumNumber.java b/src/java/org/apache/fop/fo/properties/EnumNumber.java
index 5e60b4e35..fdc359a06 100755
--- a/src/java/org/apache/fop/fo/properties/EnumNumber.java
+++ b/src/java/org/apache/fop/fo/properties/EnumNumber.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.properties;
import org.apache.fop.datatypes.Numeric;
@@ -32,7 +32,7 @@ public final class EnumNumber extends Property implements Numeric {
private static final PropertyCache cache = new PropertyCache(EnumNumber.class);
private final EnumProperty enumProperty;
-
+
/**
* Constructor
* @param enumProperty the base EnumProperty
@@ -44,7 +44,7 @@ public final class EnumNumber extends Property implements Numeric {
/**
* Returns the canonical EnumNumber instance corresponding
* to the given Property
- *
+ *
* @param enumProperty the base EnumProperty
* @return the canonical instance
*/
@@ -87,16 +87,16 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
+ /**
* {@inheritDoc}
* Always true
for instances of this type
*/
public boolean isAbsolute() {
return true;
}
-
- /**
- * {@inheritDoc}
+
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public double getNumericValue(PercentBaseContext context) throws PropertyException {
@@ -104,8 +104,8 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public int getValue(PercentBaseContext context) {
@@ -113,8 +113,8 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public int getValue() {
@@ -122,8 +122,8 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public double getNumericValue() {
@@ -131,7 +131,7 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
+ /**
* {@inheritDoc}
*/
public Numeric getNumeric() {
diff --git a/src/java/org/apache/fop/fo/properties/EnumProperty.java b/src/java/org/apache/fop/fo/properties/EnumProperty.java
index d3043c5c3..07cfaadcc 100644
--- a/src/java/org/apache/fop/fo/properties/EnumProperty.java
+++ b/src/java/org/apache/fop/fo/properties/EnumProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,7 +27,7 @@ import org.apache.fop.fo.expr.PropertyException;
* Superclass for properties that wrap an enumeration value
*/
public final class EnumProperty extends Property {
-
+
/** cache holding all canonical EnumProperty instances */
private static final PropertyCache cache = new PropertyCache(EnumProperty.class);
@@ -102,7 +102,7 @@ public final class EnumProperty extends Property {
public boolean equals(Object obj) {
if (obj instanceof EnumProperty) {
EnumProperty ep = (EnumProperty)obj;
- return (ep.value == this.value)
+ return (ep.value == this.value)
&& ((ep.text == this.text)
|| (ep.text != null
&& ep.text.equals(this.text)));
diff --git a/src/java/org/apache/fop/fo/properties/FixedLength.java b/src/java/org/apache/fop/fo/properties/FixedLength.java
index 5636a4225..84d159edf 100644
--- a/src/java/org/apache/fop/fo/properties/FixedLength.java
+++ b/src/java/org/apache/fop/fo/properties/FixedLength.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,7 +25,7 @@ import org.apache.fop.datatypes.PercentBaseContext;
* An absolute length quantity in XSL
*/
public final class FixedLength extends LengthProperty {
-
+
/** Describes the unit pica. */
public static final String PICA = "pc";
@@ -46,16 +46,16 @@ public final class FixedLength extends LengthProperty {
/** cache holding all canonical FixedLength instances */
private static final PropertyCache cache = new PropertyCache(FixedLength.class);
-
+
/** canonical zero-length instance */
public static final FixedLength ZERO_FIXED_LENGTH = new FixedLength(0, FixedLength.MPT, 1.0f);
-
+
private int millipoints;
/**
* Set the length given a number of units, a unit name and
* an assumed resolution (used in case the units are pixels)
- *
+ *
* @param numUnits quantity of input units
* @param units input unit specifier
* @param res input/source resolution
@@ -63,11 +63,11 @@ public final class FixedLength extends LengthProperty {
private FixedLength(double numUnits, String units, float res) {
this.millipoints = convert(numUnits, units, res);
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value in base-units (millipoints).
- *
+ *
* @param numUnits quantity of input units
* @param units input unit specifier
* @param sourceResolution input/source resolution (= ratio of pixels per pt)
@@ -75,7 +75,7 @@ public final class FixedLength extends LengthProperty {
* to the given number of units and unit specifier
* in the given resolution
*/
- public static FixedLength getInstance(double numUnits,
+ public static FixedLength getInstance(double numUnits,
String units,
float sourceResolution) {
if (numUnits == 0.0) {
@@ -84,44 +84,44 @@ public final class FixedLength extends LengthProperty {
return (FixedLength)cache.fetch(
new FixedLength(numUnits, units, sourceResolution));
}
-
+
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value
* This method assumes a source-resolution of 1 (1px = 1pt)
- *
+ *
* @param numUnits input units
* @param units unit specifier
* @return the canonical FixedLength instance corresponding
* to the given number of units and unit specifier
*/
- public static FixedLength getInstance(double numUnits,
+ public static FixedLength getInstance(double numUnits,
String units) {
return getInstance(numUnits, units, 1.0f);
-
+
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value.
- * This method assumes 'millipoints' (non-standard) as units,
+ * This method assumes 'millipoints' (non-standard) as units,
* and an implied source-resolution of 1 (1px = 1pt).
- *
+ *
* @param numUnits input units
* @return the canonical FixedLength instance corresponding
* to the given number of units and unit specifier
*/
public static FixedLength getInstance(double numUnits) {
return getInstance(numUnits, FixedLength.MPT, 1.0f);
-
+
}
-
+
/**
* Convert the given length to a dimensionless integer representing
* a whole number of base units (milli-points).
- *
+ *
* @param dvalue quantity of input units
* @param unit input unit specifier (in, cm, etc.)
* @param res the input/source resolution (in case the unit spec is "px")
diff --git a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
index 7404dbe9b..34a6b58d8 100644
--- a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
+++ b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,9 +32,9 @@ public final class FontFamilyProperty extends ListProperty {
/** cache holding all canonical FontFamilyProperty instances */
private static final PropertyCache cache = new PropertyCache(FontFamilyProperty.class);
-
+
private int hash = 0;
-
+
/**
* Inner class for creating instances of ListProperty
*/
@@ -126,7 +126,7 @@ public final class FontFamilyProperty extends ListProperty {
private FontFamilyProperty() {
super();
}
-
+
/**
* Add a new property to the list
* @param prop Property to be added to the list
@@ -154,7 +154,7 @@ public final class FontFamilyProperty extends ListProperty {
if (this == o) {
return true;
}
-
+
if (o instanceof FontFamilyProperty) {
FontFamilyProperty ffp = (FontFamilyProperty) o;
return (this.list != null
@@ -162,7 +162,7 @@ public final class FontFamilyProperty extends ListProperty {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == 0) {
diff --git a/src/java/org/apache/fop/fo/properties/FontShorthandParser.java b/src/java/org/apache/fop/fo/properties/FontShorthandParser.java
index 89e029c5e..c22ba4745 100644
--- a/src/java/org/apache/fop/fo/properties/FontShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/FontShorthandParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,14 +29,14 @@ import org.apache.fop.fo.expr.PropertyException;
public class FontShorthandParser extends GenericShorthandParser {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
PropertyMaker maker,
PropertyList propertyList)
throws PropertyException {
-
+
int index = -1;
Property newProp;
switch (propId) {
diff --git a/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java b/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java
index 638f77338..0cb44d7f8 100644
--- a/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java
+++ b/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,24 +39,24 @@ public class FontShorthandProperty extends ListProperty {
Constants.PR_LINE_HEIGHT, Constants.PR_FONT_STYLE,
Constants.PR_FONT_VARIANT, Constants.PR_FONT_WEIGHT
};
-
+
/**
* @param propId ID of the property for which Maker should be created
*/
public Maker(int propId) {
super(propId);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
- public Property make(PropertyList propertyList,
+ public Property make(PropertyList propertyList,
String value, FObj fo) throws PropertyException {
-
+
try {
FontShorthandProperty newProp = new FontShorthandProperty();
newProp.setSpecifiedValue(value);
-
+
String specVal = value;
Property prop = null;
if ("inherit".equals(specVal)) {
@@ -80,14 +80,14 @@ public class FontShorthandProperty extends ListProperty {
int spaceIndex = value.indexOf(' ');
int quoteIndex = (value.indexOf('\'') == -1)
? value.indexOf('\"') : value.indexOf('\'');
- if (spaceIndex == -1
+ if (spaceIndex == -1
|| (quoteIndex != -1 && spaceIndex > quoteIndex)) {
/* no spaces or first space appears after the first
* single/double quote, so malformed value string
*/
throw new PropertyException("Invalid property value: "
- + "font=\"" + value + "\"");
- }
+ + "font=\"" + value + "\"");
+ }
PropertyMaker m = null;
int fromIndex = spaceIndex + 1;
int toIndex = specVal.length();
@@ -97,11 +97,11 @@ public class FontShorthandProperty extends ListProperty {
boolean fontFamilyParsed = false;
int commaIndex = value.indexOf(',');
while (!fontFamilyParsed) {
- /* value contains a (list of) possibly quoted
- * font-family name(s)
+ /* value contains a (list of) possibly quoted
+ * font-family name(s)
*/
if (commaIndex == -1) {
- /* no list, just a single name
+ /* no list, just a single name
* (or first name in the list)
*/
if (quoteIndex != -1) {
@@ -112,7 +112,7 @@ public class FontShorthandProperty extends ListProperty {
m = FObj.getPropertyMakerFor(PROP_IDS[1]);
prop = m.make(propertyList, specVal.substring(fromIndex), fo);
newProp.addProperty(prop, 1);
- fontFamilyParsed = true;
+ fontFamilyParsed = true;
} else {
if (quoteIndex != -1 && quoteIndex < commaIndex) {
/* a quoted font-family name as first name
@@ -131,7 +131,7 @@ public class FontShorthandProperty extends ListProperty {
fromIndex = value.lastIndexOf(' ', toIndex - 1) + 1;
value = specVal.substring(fromIndex, toIndex);
int slashIndex = value.indexOf('/');
- String fontSize = value.substring(0,
+ String fontSize = value.substring(0,
(slashIndex == -1) ? value.length() : slashIndex);
m = FObj.getPropertyMakerFor(PROP_IDS[0]);
prop = m.make(propertyList, fontSize, fo);
@@ -190,7 +190,7 @@ public class FontShorthandProperty extends ListProperty {
}
}
}
-
+
private void addProperty(Property prop, int pos) {
while (list.size() < (pos + 1)) {
list.add(null);
diff --git a/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
index b641b2abf..5096d6160 100644
--- a/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,30 +24,30 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
/**
- * This subclass of LengthProperty.Maker handles the special treatment of
+ * This subclass of LengthProperty.Maker handles the special treatment of
* relative font sizes described in 7.8.4.
*/
-public class FontSizePropertyMaker
+public class FontSizePropertyMaker
extends LengthProperty.Maker implements Constants {
/** The default normal font size in mpt */
private static final int FONT_SIZE_NORMAL = 12000;
/** The factor to be applied when stepping font sizes upwards */
private static final double FONT_SIZE_GROWTH_FACTOR = 1.2;
-
+
/**
- * Create a length property which can handle relative font sizes
+ * Create a length property which can handle relative font sizes
* @param propId the font size property id.
*/
public FontSizePropertyMaker(int propId) {
super(propId);
}
-
-
+
+
/**
* {@inheritDoc}
* Contrary to basic lengths, percentages for font-size can be resolved
- * here already: if the property evaluates to a {@link PercentLength},
+ * here already: if the property evaluates to a {@link PercentLength},
* it is immediately replaced by the resolved {@link FixedLength}.
*/
public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException {
@@ -82,7 +82,7 @@ public class FontSizePropertyMaker
}
return super.convertProperty(p, propertyList, fo);
}
-
+
/**
* Calculates the nearest absolute font size to the given
* font size.
@@ -107,7 +107,7 @@ public class FontSizePropertyMaker
}
// baseFontSize is between last and next step font size
// Return the step value closer to the baseFontSize
- if (Math.abs(lastStepFontSize - baseFontSize)
+ if (Math.abs(lastStepFontSize - baseFontSize)
<= Math.abs(baseFontSize - nextStepFontSize)) {
return lastStepFontSize;
}
diff --git a/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java
index 82f152ff5..eba62946d 100644
--- a/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,24 +24,24 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
/**
- * This subclass of EnumProperty.Maker handles the special treatment of
+ * This subclass of EnumProperty.Maker handles the special treatment of
* relative font stretch values described in 7.8.5.
*/
-public class FontStretchPropertyMaker
+public class FontStretchPropertyMaker
extends EnumProperty.Maker implements Constants {
-
+
/* Ordered list of absolute font stretch properties so we can easily find the next /
* previous one */
private Property[] orderedFontStretchValues = null;
-
+
/**
- * Create an enum property which can handle relative font stretches
+ * Create an enum property which can handle relative font stretches
* @param propId the font size property id.
*/
public FontStretchPropertyMaker(int propId) {
super(propId);
}
-
+
/**
* {@inheritDoc}
* Implements the parts of 7.8.5 relevant to relative font stretches
diff --git a/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
index 173b28f7c..278fec862 100644
--- a/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
@@ -26,7 +26,7 @@ import org.apache.fop.fo.expr.PropertyInfo;
import org.apache.fop.fo.expr.PropertyParser;
public class FontWeightPropertyMaker extends EnumProperty.Maker {
-
+
/**
* Main constructor
* @param propId the property id
@@ -34,11 +34,11 @@ public class FontWeightPropertyMaker extends EnumProperty.Maker {
public FontWeightPropertyMaker(int propId) {
super(propId);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
- public Property make(PropertyList pList, String value, FObj fo)
+ public Property make(PropertyList pList, String value, FObj fo)
throws PropertyException {
if ("inherit".equals(value)) {
return super.make(pList, value, fo);
diff --git a/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java b/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
index 5802112bc..b008c714d 100644
--- a/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,7 +30,7 @@ import org.apache.fop.fo.expr.PropertyException;
public class GenericShorthandParser implements ShorthandParser {
/**
- * Constructor.
+ * Constructor.
*/
public GenericShorthandParser() {
}
@@ -47,9 +47,9 @@ public class GenericShorthandParser implements ShorthandParser {
return null;
}
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
diff --git a/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java b/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
index 75ecb9d24..d976fc6ea 100644
--- a/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,15 +33,15 @@ import org.apache.fop.fo.expr.PropertyException;
*/
public class IndentPropertyMaker extends CorrespondingPropertyMaker {
/**
- * The corresponding padding-* propIds
+ * The corresponding padding-* propIds
*/
- private int[] paddingCorresponding = null;
+ private int[] paddingCorresponding = null;
/**
- * The corresponding border-*-width propIds
+ * The corresponding border-*-width propIds
*/
private int[] borderWidthCorresponding = null;
-
+
/**
* Create a start-indent or end-indent property maker.
* @param baseMaker the property maker to use
@@ -57,7 +57,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
public void setPaddingCorresponding(int[] paddingCorresponding) {
this.paddingCorresponding = paddingCorresponding;
}
-
+
/**
* Set the corresponding values for the border-*-width properties.
* @param borderWidthCorresponding the corresping propids.
@@ -65,9 +65,9 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
public void setBorderWidthCorresponding(int[] borderWidthCorresponding) {
this.borderWidthCorresponding = borderWidthCorresponding;
}
-
+
/**
- * Calculate the corresponding value for start-indent and end-indent.
+ * Calculate the corresponding value for start-indent and end-indent.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property compute(PropertyList propertyList) throws PropertyException {
@@ -78,9 +78,9 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
return computeConforming(propertyList);
}
}
-
+
/**
- * Calculate the corresponding value for start-indent and end-indent.
+ * Calculate the corresponding value for start-indent and end-indent.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property computeConforming(PropertyList propertyList) throws PropertyException {
@@ -92,7 +92,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();
-
+
int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
// Calculate the absolute margin.
if (propertyList.getExplicitOrShorthand(marginProp) == null) {
@@ -107,7 +107,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
} else {
//Margin is used
Numeric margin = propertyList.get(marginProp).getNumeric();
-
+
Numeric v = FixedLength.ZERO_FIXED_LENGTH;
if (!propertyList.getFObj().generatesReferenceAreas()) {
// The inherited_value_of([start|end]-indent)
@@ -119,23 +119,23 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
v = NumericOp.addition(v, border);
return (Property) v;
}
-
+
}
-
+
private boolean isInherited(PropertyList pList) {
if (pList.getFObj().getUserAgent().isBreakIndentInheritanceOnReferenceAreaBoundary()) {
- FONode nd = pList.getFObj().getParent();
+ FONode nd = pList.getFObj().getParent();
return !((nd instanceof FObj) && ((FObj)nd).generatesReferenceAreas());
} else {
return true;
}
}
-
+
/**
* Calculate the corresponding value for start-indent and end-indent.
* This method calculates indent following an alternative rule set that
* tries to mimic many commercial solutions that chose to violate the
- * XSL specification.
+ * XSL specification.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property computeAlternativeRuleset(PropertyList propertyList) throws PropertyException {
@@ -148,10 +148,10 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();
-
+
int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
- //Determine whether the nearest anscestor indent was specified through
+ //Determine whether the nearest anscestor indent was specified through
//start-indent|end-indent or through a margin property.
boolean marginNearest = false;
PropertyList pl = propertyList.getParentPropertyList();
@@ -164,7 +164,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
}
pl = pl.getParentPropertyList();
}
-
+
// Calculate the absolute margin.
if (propertyList.getExplicitOrShorthand(marginProp) == null) {
Property indent = propertyList.getExplicit(baseMaker.propId);
@@ -181,7 +181,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
} else {
//Margin is used
Numeric margin = propertyList.get(marginProp).getNumeric();
-
+
Numeric v = FixedLength.ZERO_FIXED_LENGTH;
if (isInherited(propertyList)) {
// The inherited_value_of([start|end]-indent)
@@ -194,7 +194,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
return (Property) v;
}
}
-
+
private Property getCorresponding(int[] corresponding, PropertyList propertyList)
throws PropertyException {
PropertyList pList = getWMPropertyList(propertyList);
diff --git a/src/java/org/apache/fop/fo/properties/KeepProperty.java b/src/java/org/apache/fop/fo/properties/KeepProperty.java
index 67961b6e5..d2e2c70a7 100644
--- a/src/java/org/apache/fop/fo/properties/KeepProperty.java
+++ b/src/java/org/apache/fop/fo/properties/KeepProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,10 +28,10 @@ import org.apache.fop.fo.expr.PropertyException;
* Class for properties that wrap Keep values
*/
public final class KeepProperty extends Property implements CompoundDatatype {
-
+
/** class holding all canonical KeepProperty instances*/
private static final PropertyCache cache = new PropertyCache(KeepProperty.class);
-
+
private boolean isCachedValue = false;
private Property withinLine;
private Property withinColumn;
@@ -51,7 +51,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
/**
* Create a new empty instance of KeepProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new KeepProperty();
@@ -59,7 +59,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException
{
@@ -71,7 +71,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -154,9 +154,9 @@ public final class KeepProperty extends Property implements CompoundDatatype {
* @return String representation
*/
public String toString() {
- return "Keep[" +
- "withinLine:" + getWithinLine().getObject() +
- ", withinColumn:" + getWithinColumn().getObject() +
+ return "Keep[" +
+ "withinLine:" + getWithinLine().getObject() +
+ ", withinColumn:" + getWithinColumn().getObject() +
", withinPage:" + getWithinPage().getObject() + "]";
}
@@ -183,7 +183,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
if (this == o) {
return true;
}
-
+
if (o instanceof KeepProperty) {
KeepProperty keep = (KeepProperty) o;
return (keep.withinColumn == this.withinColumn)
@@ -192,7 +192,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
int hash = 17;
diff --git a/src/java/org/apache/fop/fo/properties/LengthPairProperty.java b/src/java/org/apache/fop/fo/properties/LengthPairProperty.java
index f89b7d8b7..9840c4683 100644
--- a/src/java/org/apache/fop/fo/properties/LengthPairProperty.java
+++ b/src/java/org/apache/fop/fo/properties/LengthPairProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,7 +45,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
/**
* Create a new empty instance of LengthPairProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new LengthPairProperty();
@@ -53,7 +53,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof LengthPairProperty) {
@@ -69,7 +69,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
public LengthPairProperty() {
super();
}
-
+
/**
* Creates a new LengthPairProperty.
* @param ipd inline-progression-dimension
@@ -80,7 +80,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
this.ipd = ipd;
this.bpd = bpd;
}
-
+
/**
* Creates a new LengthPairProperty which sets both bpd and ipd to the
* same value.
@@ -89,9 +89,9 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
public LengthPairProperty(Property len) {
this(len, len);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -131,8 +131,8 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
/** {@inheritDoc} */
public String toString() {
- return "LengthPair["
- + "ipd:" + getIPD().getObject()
+ return "LengthPair["
+ + "ipd:" + getIPD().getObject()
+ ", bpd:" + getBPD().getObject() + "]";
}
diff --git a/src/java/org/apache/fop/fo/properties/LengthProperty.java b/src/java/org/apache/fop/fo/properties/LengthProperty.java
index 697aa75a7..4ffe38074 100644
--- a/src/java/org/apache/fop/fo/properties/LengthProperty.java
+++ b/src/java/org/apache/fop/fo/properties/LengthProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,9 +28,9 @@ import org.apache.fop.fo.expr.PropertyException;
/**
* Superclass for properties wrapping a Length value.
*/
-public abstract class LengthProperty extends Property
+public abstract class LengthProperty extends Property
implements Length, Numeric {
-
+
/**
* Inner class for making instances of LengthProperty
*/
@@ -38,7 +38,7 @@ public abstract class LengthProperty extends Property
/**
* Constructor
- *
+ *
* @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
diff --git a/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java b/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
index aeab37972..3161fc517 100644
--- a/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
+++ b/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -53,7 +53,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
/**
* Create a new empty instance of LengthRangeProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new LengthRangeProperty();
@@ -64,16 +64,16 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
&& ((PercentLength) len).getPercentage() < 0)
|| (len.isAbsolute() && len.getValue() < 0));
}
-
- /** {@inheritDoc} */
- public Property convertProperty(Property p,
+
+ /** {@inheritDoc} */
+ public Property convertProperty(Property p,
PropertyList propertyList, FObj fo)
throws PropertyException {
-
+
if (p instanceof LengthRangeProperty) {
return p;
}
-
+
if (this.propId == PR_BLOCK_PROGRESSION_DIMENSION
|| this.propId == PR_INLINE_PROGRESSION_DIMENSION) {
Length len = p.getLength();
@@ -86,13 +86,13 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
}
}
}
-
+
return super.convertProperty(p, propertyList, fo);
}
-
-
+
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected Property setSubprop(Property baseProperty, int subpropertyId,
Property subproperty) {
@@ -119,7 +119,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -191,7 +191,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
}
consistent = false;
}
-
+
// Minimum is prioritaire, if explicit
private void checkConsistency(PercentBaseContext context) {
if (consistent) {
@@ -203,7 +203,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
// Make sure max >= min
// Must also control if have any allowed enum values!
- if (!minimum.isAuto() && !maximum.isAuto()
+ if (!minimum.isAuto() && !maximum.isAuto()
&& minimum.getLength().getValue(context) > maximum.getLength().getValue(context)) {
if ((bfSet & MINSET) != 0) {
// if minimum is explicit, force max to min
@@ -217,7 +217,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
}
}
// Now make sure opt <= max and opt >= min
- if (!optimum.isAuto() && !maximum.isAuto()
+ if (!optimum.isAuto() && !maximum.isAuto()
&& optimum.getLength().getValue(context) > maximum.getLength().getValue(context)) {
if ((bfSet & OPTSET) != 0) {
if ((bfSet & MAXSET) != 0) {
@@ -231,8 +231,8 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
// opt is default and max is explicit or default
optimum = maximum;
}
- } else if (!optimum.isAuto() && !minimum.isAuto()
- && optimum.getLength().getValue(context)
+ } else if (!optimum.isAuto() && !minimum.isAuto()
+ && optimum.getLength().getValue(context)
< minimum.getLength().getValue(context)) {
if ((bfSet & MINSET) != 0) {
// if minimum is explicit, force opt to min
@@ -244,7 +244,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
minimum = optimum; // minimum was default value
}
}
-
+
consistent = true;
}
@@ -278,8 +278,8 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
/** {@inheritDoc} */
public String toString() {
return "LengthRange["
- + "min:" + getMinimum(null).getObject()
- + ", max:" + getMaximum(null).getObject()
+ + "min:" + getMinimum(null).getObject()
+ + ", max:" + getMaximum(null).getObject()
+ ", opt:" + getOptimum(null).getObject() + "]";
}
diff --git a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
index dd57502d8..4b408e83b 100644
--- a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,7 +33,7 @@ import org.apache.fop.fo.expr.PropertyException;
* value, instead of the computed value.
* So when a line-height is create based on an attribute, the specified value
* is stored in the property and in compute() the stored specified value of
- * the nearest specified is used to recalculate the line-height.
+ * the nearest specified is used to recalculate the line-height.
*/
public class LineHeightPropertyMaker extends SpaceProperty.Maker {
@@ -48,9 +48,9 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
/**
* {@inheritDoc}
*/
- public Property make(PropertyList propertyList, String value, FObj fo)
+ public Property make(PropertyList propertyList, String value, FObj fo)
throws PropertyException {
- /* if value was specified as a number/length/percentage then
+ /* if value was specified as a number/length/percentage then
* conditionality and precedence components are overridden
*/
Property p = super.make(propertyList, value, fo);
@@ -60,7 +60,7 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
EnumProperty.getInstance(Constants.EN_FORCE, "FORCE"), true);
return p;
}
-
+
/**
* Recalculate the line-height value based on the nearest specified
* value.
@@ -80,7 +80,7 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property convertProperty(Property p,
PropertyList propertyList,
diff --git a/src/java/org/apache/fop/fo/properties/ListProperty.java b/src/java/org/apache/fop/fo/properties/ListProperty.java
index 46d8c9496..4c5208505 100644
--- a/src/java/org/apache/fop/fo/properties/ListProperty.java
+++ b/src/java/org/apache/fop/fo/properties/ListProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -64,7 +64,7 @@ public class ListProperty extends Property {
protected ListProperty() {
//nop
}
-
+
/**
* @param prop the first Property to be added to the list
*/
diff --git a/src/java/org/apache/fop/fo/properties/NumberProperty.java b/src/java/org/apache/fop/fo/properties/NumberProperty.java
index aa4791889..4d7c3b97b 100644
--- a/src/java/org/apache/fop/fo/properties/NumberProperty.java
+++ b/src/java/org/apache/fop/fo/properties/NumberProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -51,7 +51,7 @@ public final class NumberProperty extends Property implements Numeric {
* {@inheritDoc}
*/
public Property convertProperty(Property p,
- PropertyList propertyList, FObj fo)
+ PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof NumberProperty) {
return p;
@@ -79,12 +79,12 @@ public final class NumberProperty extends Property implements Numeric {
}
/**
- * If the value is not positive, return a property with value 1
- *
+ * If the value is not positive, return a property with value 1
+ *
* {@inheritDoc}
*/
- public Property convertProperty(Property p,
- PropertyList propertyList, FObj fo)
+ public Property convertProperty(Property p,
+ PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof EnumProperty) {
return EnumNumber.getInstance(p);
@@ -101,10 +101,10 @@ public final class NumberProperty extends Property implements Numeric {
}
}
-
+
/** cache holding all canonical NumberProperty instances */
private static final PropertyCache cache = new PropertyCache(NumberProperty.class);
-
+
private final Number number;
/**
@@ -132,7 +132,7 @@ public final class NumberProperty extends Property implements Numeric {
private NumberProperty(int num) {
this.number = new Integer(num);
}
-
+
/**
* Returns the canonical NumberProperty instance
* corresponding to the given Number
@@ -143,7 +143,7 @@ public final class NumberProperty extends Property implements Numeric {
return (NumberProperty)cache.fetch(
new NumberProperty(num.doubleValue()));
}
-
+
/**
* Returns the canonical NumberProperty instance
* corresponding to the given Integer
@@ -176,7 +176,7 @@ public final class NumberProperty extends Property implements Numeric {
return (NumberProperty)cache.fetch(
new NumberProperty(num));
}
-
+
/**
* Plain number always has a dimension of 0.
* @return a dimension of 0.
@@ -254,7 +254,7 @@ public final class NumberProperty extends Property implements Numeric {
/**
* Convert NumberProperty to a Color. Not sure why this is needed.
- * @param foUserAgent FOUserAgent
+ * @param foUserAgent FOUserAgent
* @return Color that corresponds to black
*/
public Color getColor(FOUserAgent foUserAgent) {
@@ -268,7 +268,7 @@ public final class NumberProperty extends Property implements Numeric {
public int hashCode() {
return number.hashCode();
}
-
+
/** {@inheritDoc} */
public boolean equals(Object o) {
if (o == this) {
diff --git a/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java b/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java
index f04cdd3cc..066c00336 100644
--- a/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,9 +28,9 @@ import org.apache.fop.fo.expr.PropertyException;
* Used to set the corresponding keep-* and break-* properties.
*/
public class PageBreakShorthandParser implements ShorthandParser {
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
@@ -38,11 +38,11 @@ public class PageBreakShorthandParser implements ShorthandParser {
PropertyList propertyList)
throws PropertyException {
- if (propId == Constants.PR_KEEP_WITH_PREVIOUS
+ if (propId == Constants.PR_KEEP_WITH_PREVIOUS
|| propId == Constants.PR_KEEP_WITH_NEXT
|| propId == Constants.PR_KEEP_TOGETHER) {
if (property.getEnum() == Constants.EN_AVOID) {
- return maker.make(null, Constants.CP_WITHIN_PAGE,
+ return maker.make(null, Constants.CP_WITHIN_PAGE,
propertyList, "always", propertyList.getFObj());
}
} else if (propId == Constants.PR_BREAK_BEFORE
diff --git a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java
index 542dcac32..53a9c1286 100644
--- a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java
+++ b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,38 +26,38 @@ import org.apache.fop.fo.expr.PropertyException;
/**
* Custom Maker for page-height / page-width
- *
+ *
*/
public class PageDimensionMaker extends LengthProperty.Maker {
-
+
/**
* Constructor
- *
+ *
* @param propId the property Id
*/
public PageDimensionMaker(int propId) {
super(propId);
}
-
+
/**
- * Check the value of the page-width / page-height property.
+ * Check the value of the page-width / page-height property.
* Return the default or user-defined fallback in case the value
* was specified as "auto"
- *
+ *
* @see PropertyMaker#get(int, PropertyList, boolean, boolean)
*/
public Property get(int subpropId, PropertyList propertyList,
- boolean tryInherit, boolean tryDefault)
+ boolean tryInherit, boolean tryDefault)
throws PropertyException {
-
- Property p = super.get(0, propertyList, tryInherit, tryDefault);
+
+ Property p = super.get(0, propertyList, tryInherit, tryDefault);
FObj fo = propertyList.getFObj();
String fallbackValue = (propId == Constants.PR_PAGE_HEIGHT)
? fo.getUserAgent().getPageHeight()
: fo.getUserAgent().getPageWidth();
-
+
if (p.getEnum() == Constants.EN_INDEFINITE) {
- int otherId = (propId == Constants.PR_PAGE_HEIGHT)
+ int otherId = (propId == Constants.PR_PAGE_HEIGHT)
? Constants.PR_PAGE_WIDTH : Constants.PR_PAGE_HEIGHT;
int writingMode = propertyList.get(Constants.PR_WRITING_MODE).getEnum();
int refOrientation = propertyList.get(Constants.PR_REFERENCE_ORIENTATION)
@@ -66,10 +66,10 @@ public class PageDimensionMaker extends LengthProperty.Maker {
&& propertyList.getExplicit(otherId).getEnum() == Constants.EN_INDEFINITE) {
//both set to "indefinite":
//determine which one of the two defines the dimension
- //in block-progression-direction, and set the other to
+ //in block-progression-direction, and set the other to
//"auto"
if ((writingMode != Constants.EN_TB_RL
- && (refOrientation == 0
+ && (refOrientation == 0
|| refOrientation == 180
|| refOrientation == -180))
|| (writingMode == Constants.EN_TB_RL
@@ -94,7 +94,7 @@ public class PageDimensionMaker extends LengthProperty.Maker {
} else if (p.isAuto()) {
return make(propertyList, fallbackValue, fo);
}
-
+
return p;
- }
+ }
}
diff --git a/src/java/org/apache/fop/fo/properties/PercentLength.java b/src/java/org/apache/fop/fo/properties/PercentLength.java
index 82f5e60f9..f89007f34 100644
--- a/src/java/org/apache/fop/fo/properties/PercentLength.java
+++ b/src/java/org/apache/fop/fo/properties/PercentLength.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,7 +27,7 @@ import org.apache.fop.fo.expr.PropertyException;
* a percent specified length quantity in XSL
*/
public class PercentLength extends LengthProperty {
-
+
/**
* The percentage itself, expressed as a decimal value, e.g. for 95%, set
* the value to .95
@@ -39,7 +39,7 @@ public class PercentLength extends LengthProperty {
* {@link #factor} should be applied to compute the actual length
*/
private PercentBase lbase = null;
-
+
private double resolvedValue;
/**
@@ -63,9 +63,9 @@ public class PercentLength extends LengthProperty {
}
/**
- * Used during property resolution to check for
+ * Used during property resolution to check for
* negative percentages
- *
+ *
* @return the percentage value
*/
protected double getPercentage() {
@@ -95,7 +95,7 @@ public class PercentLength extends LengthProperty {
return 0;
}
}
-
+
/** {@inheritDoc} */
public String getString() {
return (factor * 100.0) + "%";
@@ -103,7 +103,7 @@ public class PercentLength extends LengthProperty {
/**
* Return the length of this PercentLength.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int getValue() {
return (int) getNumericValue();
@@ -113,12 +113,12 @@ public class PercentLength extends LengthProperty {
public int getValue(PercentBaseContext context) {
return (int) getNumericValue(context);
}
-
+
/**
* @return the String equivalent of this
*/
public String toString() {
- StringBuffer sb =
+ StringBuffer sb =
new StringBuffer(PercentLength.class.getName())
.append("[factor=").append(factor)
.append(",lbase=").append(lbase).append("]");
diff --git a/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java b/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java
index 5f2468ed6..5040afeaf 100755
--- a/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,15 +27,15 @@ import org.apache.fop.fo.PropertyList;
* values for absolute-position and relative-position.
*/
public class PositionShorthandParser implements ShorthandParser {
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
PropertyMaker maker,
PropertyList propertyList) {
-
+
int propVal = property.getEnum();
if (propId == Constants.PR_ABSOLUTE_POSITION) {
switch (propVal) {
diff --git a/src/java/org/apache/fop/fo/properties/Property.java b/src/java/org/apache/fop/fo/properties/Property.java
index 5aef1b881..29e8faac5 100644
--- a/src/java/org/apache/fop/fo/properties/Property.java
+++ b/src/java/org/apache/fop/fo/properties/Property.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@ import org.apache.fop.fo.Constants;
* Base class for all property objects
*/
public class Property {
-
+
/** Logger for all property classes */
protected static Log log = LogFactory.getLog(PropertyMaker.class);
@@ -134,7 +134,7 @@ public class Property {
public boolean isAuto() {
return (getEnum() == Constants.EN_AUTO);
}
-
+
/**
* This method expects to be overridden by subclasses
* @return char property value
diff --git a/src/java/org/apache/fop/fo/properties/PropertyCache.java b/src/java/org/apache/fop/fo/properties/PropertyCache.java
index 6f87c0c45..f834a78ae 100644
--- a/src/java/org/apache/fop/fo/properties/PropertyCache.java
+++ b/src/java/org/apache/fop/fo/properties/PropertyCache.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,35 +28,35 @@ import java.lang.ref.WeakReference;
* The public access points are overloaded fetch()
methods
* that each correspond to a cached type.
* It is designed especially to be used concurrently by multiple threads,
- * drawing heavily upon the principles behind Java 1.5's
- * ConcurrentHashMap
.
+ * drawing heavily upon the principles behind Java 1.5's
+ * ConcurrentHashMap
.
*/
public final class PropertyCache {
- /** bitmask to apply to the hash to get to the
+ /** bitmask to apply to the hash to get to the
* corresponding cache segment */
private static final int SEGMENT_MASK = 0x1F;
- /**
+ /**
* Indicates whether the cache should be used at all
* Can be controlled by the system property:
* org.apache.fop.fo.properties.use-cache
*/
private final boolean useCache;
-
+
/** the segments array (length = 32) */
private CacheSegment[] segments = new CacheSegment[SEGMENT_MASK + 1];
/** the table of hash-buckets */
private CacheEntry[] table = new CacheEntry[8];
-
+
private Class runtimeType;
-
+
final boolean[] votesForRehash = new boolean[SEGMENT_MASK + 1];
-
+
/* same hash function as used by java.util.HashMap */
private static int hash(Object x) {
return hash(x.hashCode());
}
-
+
private static int hash(int hashCode) {
int h = hashCode;
h += ~(h << 9);
@@ -65,32 +65,32 @@ public final class PropertyCache {
h ^= (h >>> 10);
return h;
}
-
+
/* shortcut function */
private static boolean eq(Object p, Object q) {
return (p == q || (p != null && p.equals(q)));
}
-
+
/* Class modeling a cached entry */
private final class CacheEntry extends WeakReference {
volatile CacheEntry nextEntry;
final int hash;
-
+
/* main constructor */
public CacheEntry(Object p, CacheEntry nextEntry, ReferenceQueue refQueue) {
super(p, refQueue);
this.nextEntry = nextEntry;
this.hash = p.hashCode();
}
-
+
}
-
+
/* Wrapper objects to synchronize on */
private final class CacheSegment {
private int count = 0;
private volatile ReferenceQueue staleEntries = new ReferenceQueue();
- }
-
+ }
+
private void cleanSegment(int segmentIndex) {
CacheEntry entry;
CacheSegment segment = segments[segmentIndex];
@@ -145,7 +145,7 @@ public final class PropertyCache {
}
}
}
-
+
/*
* Puts a new instance in the cache.
* If the total number of entries for the corresponding
@@ -154,14 +154,14 @@ public final class PropertyCache {
* entries.
*/
private void put(Object o) {
-
+
int hash = hash(o);
CacheSegment segment = segments[hash & SEGMENT_MASK];
-
+
synchronized (segment) {
int index = hash & (table.length - 1);
CacheEntry entry = table[index];
-
+
if (entry == null) {
entry = new CacheEntry(o, null, segment.staleEntries);
table[index] = entry;
@@ -176,23 +176,23 @@ public final class PropertyCache {
segment.count++;
}
}
-
+
if (segment.count > (2 * table.length)) {
cleanSegment(hash & SEGMENT_MASK);
}
}
}
-
+
/* Gets a cached instance. Returns null if not found */
private Object get(Object o) {
-
+
int hash = hash(o);
int index = hash & (table.length - 1);
-
+
CacheEntry entry = table[index];
Object q;
-
+
/* try non-synched first */
for (CacheEntry e = entry; e != null; e = e.nextEntry) {
if (e.hash == o.hashCode()
@@ -201,7 +201,7 @@ public final class PropertyCache {
return q;
}
}
-
+
/* retry synched, only if the above attempt did not succeed,
* as another thread may, in the meantime, have added a
* corresponding entry */
@@ -218,14 +218,14 @@ public final class PropertyCache {
}
return null;
}
-
+
/*
* Recursively acquires locks on all 32 segments,
* extends the cache and redistributes the entries.
- *
+ *
*/
private void rehash(int index) {
-
+
CacheSegment seg = segments[index];
synchronized (seg) {
if (index > 0) {
@@ -239,9 +239,9 @@ public final class PropertyCache {
for (int i = segments.length; --i >= 0;) {
segments[i].count = 0;
}
-
+
CacheEntry[] newTable = new CacheEntry[newLength];
-
+
int hash, idx;
Object o;
newLength--;
@@ -250,7 +250,7 @@ public final class PropertyCache {
if ((o = c.get()) != null) {
hash = c.hash;
idx = hash & newLength;
- newTable[idx] = new CacheEntry(o, newTable[idx],
+ newTable[idx] = new CacheEntry(o, newTable[idx],
segments[hash & SEGMENT_MASK].staleEntries);
segments[hash & SEGMENT_MASK].count++;
}
@@ -261,10 +261,10 @@ public final class PropertyCache {
}
}
}
-
+
/**
* Default constructor.
- *
+ *
* @param c Runtime type of the objects that will be stored in the cache
*/
public PropertyCache(Class c) {
@@ -278,13 +278,13 @@ public final class PropertyCache {
}
this.runtimeType = c;
}
-
+
/**
* Generic fetch() method.
- * Checks if the given Object
is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given Object
is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param obj the Object to check for
* @return the cached instance
*/
@@ -292,81 +292,81 @@ public final class PropertyCache {
if (!this.useCache) {
return obj;
}
-
+
if (obj == null) {
return null;
}
Object cacheEntry = get(obj);
if (cacheEntry != null) {
- return cacheEntry;
+ return cacheEntry;
}
put(obj);
return obj;
}
-
+
/**
- * Checks if the given {@link Property} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link Property} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param prop the Property instance to check for
* @return the cached instance
*/
public final Property fetch(Property prop) {
-
+
return (Property) fetch((Object) prop);
}
-
+
/**
- * Checks if the given {@link CommonHyphenation} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonHyphenation} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param chy the CommonHyphenation instance to check for
* @return the cached instance
*/
public final CommonHyphenation fetch(CommonHyphenation chy) {
-
+
return (CommonHyphenation) fetch((Object) chy);
}
-
+
/**
- * Checks if the given {@link CommonFont} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonFont} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param cf the CommonFont instance to check for
* @return the cached instance
*/
public final CommonFont fetch(CommonFont cf) {
-
+
return (CommonFont) fetch((Object) cf);
}
/**
- * Checks if the given {@link CommonBorderPaddingBackground} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonBorderPaddingBackground} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param cbpb the CommonBorderPaddingBackground instance to check for
* @return the cached instance
*/
public final CommonBorderPaddingBackground fetch(CommonBorderPaddingBackground cbpb) {
-
+
return (CommonBorderPaddingBackground) fetch((Object) cbpb);
}
/**
- * Checks if the given {@link CommonBorderPaddingBackground.BorderInfo} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonBorderPaddingBackground.BorderInfo} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param bi the BorderInfo instance to check for
* @return the cached instance
*/
public final CommonBorderPaddingBackground.BorderInfo fetch(CommonBorderPaddingBackground.BorderInfo bi) {
-
+
return (CommonBorderPaddingBackground.BorderInfo) fetch((Object) bi);
}
@@ -374,6 +374,6 @@ public final class PropertyCache {
public String toString() {
return super.toString() + "[runtimeType=" + this.runtimeType + "]";
}
-
-
+
+
}
diff --git a/src/java/org/apache/fop/fo/properties/PropertyMaker.java b/src/java/org/apache/fop/fo/properties/PropertyMaker.java
index b1162563d..0f4632110 100644
--- a/src/java/org/apache/fop/fo/properties/PropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/PropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -123,8 +123,8 @@ public class PropertyMaker implements Cloneable {
/**
* Add a enum constant.
- * @param constant the enum constant
- * @param value the Property value to use when the constant is specified
+ * @param constant the enum constant
+ * @param value the Property value to use when the constant is specified
*/
public void addEnum(String constant, Property value) {
if (enums == null) {
@@ -138,16 +138,16 @@ public class PropertyMaker implements Cloneable {
* @param subproperty the PropertyMaker for the subproperty
*/
public void addSubpropMaker(PropertyMaker subproperty) {
- throw new RuntimeException("Unable to add subproperties " + getClass());
+ throw new RuntimeException("Unable to add subproperties " + getClass());
}
/**
- * Return a subproperty maker for the subpropertyId.
- * @param subpropertyId The subpropertyId of the maker.
+ * Return a subproperty maker for the subpropertyId.
+ * @param subpropertyId The subpropertyId of the maker.
* @return The subproperty maker.
*/
public PropertyMaker getSubpropMaker(int subpropertyId) {
- throw new RuntimeException("Unable to add subproperties");
+ throw new RuntimeException("Unable to add subproperties");
}
/**
@@ -155,7 +155,7 @@ public class PropertyMaker implements Cloneable {
* shorthands list. Later the Integers are replaced with references
* to the actual shorthand property makers.
* @param shorthand a property maker thar is that is checked for
- * shorthand values.
+ * shorthand values.
*/
public void addShorthand(PropertyMaker shorthand) {
if (shorthands == null) {
@@ -197,7 +197,7 @@ public class PropertyMaker implements Cloneable {
}
/**
- * Set the percent base identifier for this maker.
+ * Set the percent base identifier for this maker.
* @param percentBase the percent base (ex. LengthBase.FONTSIZE)
*/
public void setPercentBase(int percentBase) {
@@ -205,9 +205,9 @@ public class PropertyMaker implements Cloneable {
}
/**
- * Set the setByShorthand flag which only is applicable for subproperty
- * makers. It should be true for the subproperties which must be
- * assigned a value when the base property is assigned a attribute
+ * Set the setByShorthand flag which only is applicable for subproperty
+ * makers. It should be true for the subproperties which must be
+ * assigned a value when the base property is assigned a attribute
* value directly.
* @param setByShorthand true if this subproperty must be set when the base property is set
*/
@@ -217,7 +217,7 @@ public class PropertyMaker implements Cloneable {
/**
* Set the correspoding property information.
- * @param corresponding a corresponding maker where the
+ * @param corresponding a corresponding maker where the
* isForcedCorresponding and compute methods are delegated to.
*/
public void setCorresponding(CorrespondingPropertyMaker corresponding) {
@@ -225,7 +225,7 @@ public class PropertyMaker implements Cloneable {
}
/**
- * Create a new empty property. Must be overriden in compound
+ * Create a new empty property. Must be overriden in compound
* subclasses.
* @return a new instance of the Property for which this is a maker.
*/
@@ -243,13 +243,13 @@ public class PropertyMaker implements Cloneable {
* @param propertyList the applicable property list
* @param tryInherit true if inherited properties should be examined.
* @return the property value
- * @throws PropertyException if there is a problem evaluating the property
+ * @throws PropertyException if there is a problem evaluating the property
*/
- public Property findProperty(PropertyList propertyList,
+ public Property findProperty(PropertyList propertyList,
boolean tryInherit)
throws PropertyException {
Property p = null;
-
+
if (log.isTraceEnabled()) {
log.trace("PropertyMaker.findProperty: "
+ FOPropertyMapping.getPropertyName(propId)
@@ -267,9 +267,9 @@ public class PropertyMaker implements Cloneable {
p = this.compute(propertyList);
}
}
- if (p == null && tryInherit) {
+ if (p == null && tryInherit) {
// else inherit (if has parent and is inheritable)
- PropertyList parentPropertyList = propertyList.getParentPropertyList();
+ PropertyList parentPropertyList = propertyList.getParentPropertyList();
if (parentPropertyList != null && isInherited()) {
p = parentPropertyList.get(propId, true, false);
}
@@ -287,8 +287,8 @@ public class PropertyMaker implements Cloneable {
* @param propertyList The PropertyList object being built for this FO.
* @param tryInherit true if inherited properties should be examined.
* @param tryDefault true if the default value should be returned.
- * @return the property value
- * @throws PropertyException if there is a problem evaluating the property
+ * @return the property value
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property get(int subpropertyId, PropertyList propertyList,
boolean tryInherit, boolean tryDefault)
@@ -370,7 +370,7 @@ public class PropertyMaker implements Cloneable {
}
/**
- * Return the default value.
+ * Return the default value.
* @param propertyList The PropertyList object being built for this FO.
* @return the Property object corresponding to the parameters
* @throws PropertyException for invalid or inconsisten FO input
@@ -422,7 +422,7 @@ public class PropertyMaker implements Cloneable {
.getExplicit(getPropId());
if (parentExplicit == null) {
log.warn(FOPropertyMapping.getPropertyName(getPropId())
- + "=\"inherit\" on " + propertyList.getFObj().getName()
+ + "=\"inherit\" on " + propertyList.getFObj().getName()
+ ", but no explicit value found on the parent FO.");
}
}
@@ -436,7 +436,7 @@ public class PropertyMaker implements Cloneable {
newProp = PropertyParser.parse(pvalue,
new PropertyInfo(this,
propertyList));
- }
+ }
if (newProp != null) {
newProp = convertProperty(newProp, propertyList, fo);
}
@@ -475,7 +475,7 @@ public class PropertyMaker implements Cloneable {
/**
* Converts a shorthand property
- *
+ *
* @param propertyList the propertyList for which to convert
* @param prop the shorthand property
* @param fo ...
@@ -538,7 +538,7 @@ public class PropertyMaker implements Cloneable {
* file specifies a length value equivalent for these keywords,
* such as "0.5pt" for "thin".
* @param keyword the string value of property attribute.
- * @return a String containing a parseable equivalent or null if
+ * @return a String containing a parseable equivalent or null if
* the passed value isn't a keyword initializer for this Property
*/
protected String checkValueKeywords(String keyword) {
@@ -549,7 +549,7 @@ public class PropertyMaker implements Cloneable {
}
}
// TODO: should return null here?
- return keyword;
+ return keyword;
}
/**
@@ -642,7 +642,7 @@ public class PropertyMaker implements Cloneable {
}
return null;
}
-
+
/** @return the name of the property this maker is used for. */
public String getName() {
return FOPropertyMapping.getPropertyName(propId);
@@ -650,7 +650,7 @@ public class PropertyMaker implements Cloneable {
/**
* Return a clone of the makers. Used by useGeneric() to clone the
- * subproperty makers of the generic compound makers.
+ * subproperty makers of the generic compound makers.
* {@inheritDoc}
*/
public Object clone() {
diff --git a/src/java/org/apache/fop/fo/properties/ReferenceOrientationMaker.java b/src/java/org/apache/fop/fo/properties/ReferenceOrientationMaker.java
index 505afccd5..009b85b35 100644
--- a/src/java/org/apache/fop/fo/properties/ReferenceOrientationMaker.java
+++ b/src/java/org/apache/fop/fo/properties/ReferenceOrientationMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,16 +35,16 @@ public class ReferenceOrientationMaker extends Maker {
public ReferenceOrientationMaker(int propId) {
super(propId);
}
-
+
/**
* Check the value of the reference-orientation property.
- *
- * {@inheritDoc}
+ *
+ * {@inheritDoc}
*/
public Property get(int subpropId, PropertyList propertyList,
- boolean tryInherit, boolean tryDefault)
+ boolean tryInherit, boolean tryDefault)
throws PropertyException {
-
+
Property p = super.get(0, propertyList, tryInherit, tryDefault);
int ro = 0;
if (p != null) {
diff --git a/src/java/org/apache/fop/fo/properties/ShorthandParser.java b/src/java/org/apache/fop/fo/properties/ShorthandParser.java
index bf51c3f66..f0ec0e6e9 100644
--- a/src/java/org/apache/fop/fo/properties/ShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/ShorthandParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/properties/SpaceProperty.java b/src/java/org/apache/fop/fo/properties/SpaceProperty.java
index 98caa04ff..49f76f874 100644
--- a/src/java/org/apache/fop/fo/properties/SpaceProperty.java
+++ b/src/java/org/apache/fop/fo/properties/SpaceProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -47,7 +47,7 @@ public class SpaceProperty extends LengthRangeProperty {
/**
* Create a new empty instance of SpaceProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new SpaceProperty();
@@ -69,7 +69,7 @@ public class SpaceProperty extends LengthRangeProperty {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -138,10 +138,10 @@ public class SpaceProperty extends LengthRangeProperty {
public String toString() {
return "Space[" +
- "min:" + getMinimum(null).getObject() +
- ", max:" + getMaximum(null).getObject() +
- ", opt:" + getOptimum(null).getObject() +
- ", precedence:" + precedence.getObject() +
+ "min:" + getMinimum(null).getObject() +
+ ", max:" + getMaximum(null).getObject() +
+ ", opt:" + getOptimum(null).getObject() +
+ ", precedence:" + precedence.getObject() +
", conditionality:" + conditionality.getObject() + "]";
}
diff --git a/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java
index ba547b37a..19fa7baa7 100755
--- a/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@ import org.apache.fop.fo.expr.PropertyException;
/**
* A maker which creates 'letter-spacing' and 'word-spacing' properties.
- * These two properties properties are standard space properties with
+ * These two properties properties are standard space properties with
* additinal support for the 'normal' enum value.
*/
@@ -42,7 +42,7 @@ public class SpacingPropertyMaker extends SpaceProperty.Maker {
/**
* Support for the 'normal' value.
*/
- public Property convertProperty(Property p,
+ public Property convertProperty(Property p,
PropertyList propertyList,
FObj fo) throws PropertyException {
if (p.getEnum() == Constants.EN_NORMAL) {
diff --git a/src/java/org/apache/fop/fo/properties/StringProperty.java b/src/java/org/apache/fop/fo/properties/StringProperty.java
index 087feb350..ec7e1f841 100644
--- a/src/java/org/apache/fop/fo/properties/StringProperty.java
+++ b/src/java/org/apache/fop/fo/properties/StringProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -81,13 +81,13 @@ public final class StringProperty extends Property {
}
}
-
+
/** cache containing all canonical StringProperty instances */
private static final PropertyCache cache = new PropertyCache(StringProperty.class);
-
+
/** canonical instance for empty strings */
public static final StringProperty EMPTY_STRING_PROPERTY = new StringProperty("");
-
+
private final String str;
/**
@@ -99,7 +99,7 @@ public final class StringProperty extends Property {
}
/**
- * Return the canonical StringProperty instance
+ * Return the canonical StringProperty instance
* corresponding to the given string value
* @param str the base String
* @return the canonical instance
@@ -112,7 +112,7 @@ public final class StringProperty extends Property {
new StringProperty(str));
}
}
-
+
/** @return the Object equivalent of this property */
public Object getObject() {
return this.str;
@@ -135,7 +135,7 @@ public final class StringProperty extends Property {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
return str.hashCode();
diff --git a/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java b/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java
index 181dd00d5..4a2fc92f4 100644
--- a/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java
+++ b/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,10 +36,10 @@ public class TableBorderPrecedence extends NumberProperty.Maker{
public TableBorderPrecedence(int propId) {
super(propId);
}
-
+
/**
* Set default precedence according to the parent FObj
- *
+ *
* {@inheritDoc}
*/
public Property make(PropertyList propertyList) throws PropertyException {
diff --git a/src/java/org/apache/fop/fo/properties/TableColLength.java b/src/java/org/apache/fop/fo/properties/TableColLength.java
index 251007093..ccb85bcfb 100644
--- a/src/java/org/apache/fop/fo/properties/TableColLength.java
+++ b/src/java/org/apache/fop/fo/properties/TableColLength.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,7 +41,7 @@ public class TableColLength extends LengthProperty {
private double tcolUnits;
/**
- * The column the column-units are defined on.
+ * The column the column-units are defined on.
*/
private FObj column;
diff --git a/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java b/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java
index 4cb1b2f4a..3cbe56f00 100644
--- a/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java
+++ b/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java
@@ -84,7 +84,7 @@ public class TextDecorationProperty extends ListProperty {
}
return lst;
}
-
+
}
/**
@@ -156,5 +156,5 @@ public class TextDecorationProperty extends ListProperty {
addProperty(prop);
}
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
index 20d3d7303..c04b1a892 100644
--- a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
+++ b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java b/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java
index d71dc4db1..c0950a794 100644
--- a/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,13 +23,13 @@ import org.apache.fop.fo.PropertyList;
/**
* A shorthand parser for the vertical-align shorthand. It is used to set
- * values for alignment-baseline, alignment-adjust, baseline-shift
+ * values for alignment-baseline, alignment-adjust, baseline-shift
* and dominant-baseline.
*/
public class VerticalAlignShorthandParser implements ShorthandParser, Constants {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
diff --git a/src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java b/src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java
index 2feb5e9c8..26df69c91 100644
--- a/src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ import org.apache.fop.fo.expr.PropertyException;
public class WhiteSpaceShorthandParser implements ShorthandParser {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId, Property property,
PropertyMaker maker, PropertyList propertyList)
diff --git a/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java b/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java
index 5a5cf95c5..efadd8957 100644
--- a/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java
@@ -25,14 +25,14 @@ import org.apache.fop.fo.expr.PropertyException;
public class XMLLangShorthandParser extends GenericShorthandParser {
private static final char HYPHEN_MINUS = '-';
-
+
/** {@inheritDoc} */
public Property getValueForProperty(int propId,
Property property,
PropertyMaker maker,
PropertyList propertyList)
throws PropertyException {
-
+
String shorthandValue = property.getString();
int hyphenIndex = shorthandValue.indexOf(HYPHEN_MINUS);
if (propId == Constants.PR_LANGUAGE) {
diff --git a/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java b/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java
index 3a2ac5022..56558b02e 100644
--- a/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java
+++ b/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,7 +38,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
private char[] unicodeMap; //code point to Unicode char
private String[] charNameMap; //all character names in the encoding
private Map fallbackMap; //Here we accumulate all mappings we have found through substitution
-
+
/**
* Main constructor.
* @param name the name of the encoding
@@ -140,7 +140,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
bot = mid + 1;
}
}
-
+
//Fallback: using cache
synchronized (this) {
if (fallbackMap != null) {
@@ -164,7 +164,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
}
}
}
-
+
putFallbackCharacter(c, NOT_FOUND_CODE_POINT);
return NOT_FOUND_CODE_POINT;
}
@@ -177,7 +177,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
this.fallbackMap.put(new Character(c), new Character(mapTo));
}
}
-
+
/**
* Returns the main Unicode value that is associated with the given code point in the encoding.
* Note that multiple Unicode values can theoretically be mapped to one code point in the
@@ -200,10 +200,10 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
System.arraycopy(this.unicodeMap, 0, copy, 0, this.unicodeMap.length);
return copy;
}
-
+
/**
* Returns the index of a character/glyph with the given name. Note that this
- * method is relatively slow and should only be used for fallback operations.
+ * method is relatively slow and should only be used for fallback operations.
* @param charName the character name
* @return the index of the character in the encoding or -1 if it doesn't exist
*/
@@ -219,7 +219,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
}
return -1;
}
-
+
/** {@inheritDoc} */
public String[] getCharNameMap() {
if (this.charNameMap != null) {
@@ -235,7 +235,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
if (c != CharUtilities.NOT_A_CHARACTER) {
String charName = Glyphs.charToGlyphName(c);
if (charName.length() > 0) {
- derived[i] = charName;
+ derived[i] = charName;
}
}
}
diff --git a/src/java/org/apache/fop/fonts/BFEntry.java b/src/java/org/apache/fop/fonts/BFEntry.java
index 2cc527b61..4e0b169fd 100644
--- a/src/java/org/apache/fop/fonts/BFEntry.java
+++ b/src/java/org/apache/fop/fonts/BFEntry.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,14 +16,14 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts;
/**
* This is just a holder class for bfentries, groups of characters of a base font (bf).
*/
public class BFEntry {
-
+
private int unicodeStart;
private int unicodeEnd;
private int glyphStartIndex;
diff --git a/src/java/org/apache/fop/fonts/Base14Font.java b/src/java/org/apache/fop/fonts/Base14Font.java
index 26c11e72b..04349a148 100644
--- a/src/java/org/apache/fop/fonts/Base14Font.java
+++ b/src/java/org/apache/fop/fonts/Base14Font.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts;
/**
diff --git a/src/java/org/apache/fop/fonts/CIDFont.java b/src/java/org/apache/fop/fonts/CIDFont.java
index 7216c8f15..8f468f7a4 100644
--- a/src/java/org/apache/fop/fonts/CIDFont.java
+++ b/src/java/org/apache/fop/fonts/CIDFont.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fonts/CIDFontType.java b/src/java/org/apache/fop/fonts/CIDFontType.java
index 51b4a73d1..24132ffc2 100644
--- a/src/java/org/apache/fop/fonts/CIDFontType.java
+++ b/src/java/org/apache/fop/fonts/CIDFontType.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts;
import org.apache.avalon.framework.ValuedEnum;
@@ -59,8 +59,8 @@ public class CIDFontType extends ValuedEnum {
throw new IllegalArgumentException("Invalid CID font type: " + name);
}
}
-
-
+
+
/**
* Returns the CID FontType by value.
* @param value Value of the CID font type to look up
@@ -75,5 +75,5 @@ public class CIDFontType extends ValuedEnum {
throw new IllegalArgumentException("Invalid CID font type: " + value);
}
}
-
+
}
diff --git a/src/java/org/apache/fop/fonts/CIDSubset.java b/src/java/org/apache/fop/fonts/CIDSubset.java
index 6bcfc0b71..c2505488b 100644
--- a/src/java/org/apache/fop/fonts/CIDSubset.java
+++ b/src/java/org/apache/fop/fonts/CIDSubset.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -54,10 +54,10 @@ public class CIDSubset {
* usedCharsIndex contains new glyph, original char (char selector -> Unicode)
*/
private Map/*AttributeValue
object holding the
* value of the specified String
.
- *
+ *
* @param valuesString the value to be parsed
* @return an AttributeValue
object holding the value
* represented by the string argument.
diff --git a/src/java/org/apache/fop/fonts/substitute/FontQualifier.java b/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
index 63ec13db1..3419ab2c7 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -144,7 +144,7 @@ public class FontQualifier {
/**
* Returns a list of matching font triplet found in a given font info
- *
+ *
* @param fontInfo the font info
* @return a list of matching font triplets
*/
diff --git a/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java b/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
index 7e9709a51..7725fc147 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,7 +29,7 @@ public class FontSubstitution {
/**
* Main constructor
- *
+ *
* @param fromQualifier the substitution from qualifier
* @param toQualifier the substitution to qualifier
*/
diff --git a/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java b/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
index cc4e74143..313ad04a8 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java b/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
index 44950221d..0c6c0db0e 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ public class FontSubstitutionsConfigurator {
/**
* Main constructor
- *
+ *
* @param cfg a configuration
*/
public FontSubstitutionsConfigurator(Configuration cfg) {
@@ -59,7 +59,7 @@ public class FontSubstitutionsConfigurator {
/**
* Configures a font substitution catalog
- *
+ *
* @param substitutions font substitutions
* @throws FOPException if something's wrong with the config data
*/
diff --git a/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java b/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
index 890d6cf7b..29ae0556d 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,7 +35,7 @@ public class FontWeightRange {
/**
* Returns an FontWeightRange
object holding the
* range values of the specified String
.
- *
+ *
* @param weightRangeString the value range string
* @return an FontWeightRange
object holding the value ranges
*/
diff --git a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
index 0d1af4785..d12b19654 100644
--- a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
+++ b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
import java.io.File;
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
index ce3f3efe9..171f71a76 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
/**
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
index c1dfc5ea0..405a71395 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
import java.io.IOException;
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFile.java b/src/java/org/apache/fop/fonts/truetype/TTFFile.java
index 8c5211e67..f6b9ac020 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFFile.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFFile.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -111,7 +111,7 @@ public class TTFFile {
private int[] ansiWidth;
private Map ansiIndex;
-
+
// internal mapping of glyph indexes to unicode indexes
// used for quick mappings in this class
private Map glyphToUnicodeMap = new java.util.HashMap();
@@ -120,12 +120,12 @@ public class TTFFile {
private TTFDirTabEntry currentDirTab;
private boolean isCFF;
-
+
/**
* logging instance
*/
protected Log log = LogFactory.getLog(TTFFile.class);
-
+
/**
* Key-value helper class
*/
@@ -186,7 +186,7 @@ public class TTFFile {
if (n < 0) {
long rest1 = n % upem;
long storrest = 1000 * rest1;
- long ledd2 = (storrest != 0 ? rest1 / storrest : 0);
+ long ledd2 = (storrest != 0 ? rest1 / storrest : 0);
ret = -((-1000 * n) / upem - (int)ledd2);
} else {
ret = (n / upem) * 1000 + ((n % upem) * 1000) / upem;
@@ -329,7 +329,7 @@ public class TTFFile {
Iterator e = v.listIterator();
while (e.hasNext()) {
Integer aIdx = (Integer)e.next();
- ansiWidth[aIdx.intValue()]
+ ansiWidth[aIdx.intValue()]
= mtxTab[glyphIdx].getWx();
if (log.isTraceEnabled()) {
@@ -754,7 +754,7 @@ public class TTFFile {
public boolean isCFF() {
return this.isCFF;
}
-
+
/**
* Read Table Directory from the current position in the
* FontFileReader and fill the global HashMap dirTabs
@@ -840,11 +840,11 @@ public class TTFFile {
protected void readHorizontalHeader(FontFileReader in)
throws IOException {
seekTab(in, "hhea", 4);
- hheaAscender = in.readTTFShort();
+ hheaAscender = in.readTTFShort();
log.debug("hhea.Ascender: " + hheaAscender + " " + convertTTFUnit2PDFUnit(hheaAscender));
hheaDescender = in.readTTFShort();
log.debug("hhea.Descender: " + hheaDescender + " " + convertTTFUnit2PDFUnit(hheaDescender));
-
+
in.skip(2 + 2 + 3 * 2 + 8 * 2);
nhmtx = in.readTTFUShort();
log.debug("Number of horizontal metrics: " + nhmtx);
@@ -988,10 +988,10 @@ public class TTFFile {
if (dirTabs.get("OS/2") != null) {
seekTab(in, "OS/2", 2 * 2);
this.usWeightClass = in.readTTFUShort();
-
+
// usWidthClass
in.skip(2);
-
+
int fsType = in.readTTFUShort();
if (fsType == 2) {
isEmbeddable = false;
@@ -1005,10 +1005,10 @@ public class TTFFile {
in.skip(3 * 2);
int v;
os2Ascender = in.readTTFShort(); //sTypoAscender
- log.debug("sTypoAscender: " + os2Ascender
+ log.debug("sTypoAscender: " + os2Ascender
+ " " + convertTTFUnit2PDFUnit(os2Ascender));
os2Descender = in.readTTFShort(); //sTypoDescender
- log.debug("sTypoDescender: " + os2Descender
+ log.debug("sTypoDescender: " + os2Descender
+ " " + convertTTFUnit2PDFUnit(os2Descender));
v = in.readTTFShort(); //sTypoLineGap
log.debug("sTypoLineGap: " + v);
@@ -1021,7 +1021,7 @@ public class TTFFile {
log.debug("sxHeight: " + this.os2xHeight);
this.os2CapHeight = in.readTTFShort(); //sCapHeight
log.debug("sCapHeight: " + this.os2CapHeight);
-
+
} else {
isEmbeddable = true;
}
@@ -1123,7 +1123,7 @@ public class TTFFile {
int k = in.readTTFUShort();
int l = in.readTTFUShort();
- if (((platformID == 1 || platformID == 3)
+ if (((platformID == 1 || platformID == 3)
&& (encodingID == 0 || encodingID == 1))) {
in.seekSet(j + in.readTTFUShort());
String txt;
@@ -1132,9 +1132,9 @@ public class TTFFile {
} else {
txt = in.readTTFString(l);
}
-
+
if (log.isDebugEnabled()) {
- log.debug(platformID + " "
+ log.debug(platformID + " "
+ encodingID + " "
+ languageID + " "
+ k + " " + txt);
@@ -1182,11 +1182,11 @@ public class TTFFile {
if (dirTab != null) {
in.seekSet(dirTab.getOffset() + 4 + 4 + 2);
xHeight = in.readTTFUShort();
- log.debug("xHeight from PCLT: " + xHeight
+ log.debug("xHeight from PCLT: " + xHeight
+ " " + convertTTFUnit2PDFUnit(xHeight));
in.skip(2 * 2);
capHeight = in.readTTFUShort();
- log.debug("capHeight from PCLT: " + capHeight
+ log.debug("capHeight from PCLT: " + capHeight
+ " " + convertTTFUnit2PDFUnit(capHeight));
in.skip(2 + 16 + 8 + 6 + 1 + 1);
@@ -1211,7 +1211,7 @@ public class TTFFile {
* the hhea values are defined after the Apple interpretation, but not in every font. The
* same problem is in the OS/2 table. FOP needs the ascender and descender to determine the
* baseline so we need values which add up more or less to the "em box". However, due to
- * accent modifiers a character can grow beyond the em box.
+ * accent modifiers a character can grow beyond the em box.
*/
private void determineAscDesc() {
int hheaBoxHeight = hheaAscender - hheaDescender;
@@ -1279,7 +1279,7 @@ public class TTFFile {
}
}
}
- log.debug("Ascender from glyph 'd': " + localAscender
+ log.debug("Ascender from glyph 'd': " + localAscender
+ " " + convertTTFUnit2PDFUnit(localAscender));
log.debug("Descender from glyph 'p': " + localDescender
+ " " + convertTTFUnit2PDFUnit(localDescender));
@@ -1351,7 +1351,7 @@ public class TTFFile {
final Integer u2 = glyphToUnicode(j);
if (iObj == null) {
// happens for many fonts (Ubuntu font set),
- // stray entries in the kerning table??
+ // stray entries in the kerning table??
log.debug("Ignoring kerning pair because no Unicode index was"
+ " found for the first glyph " + i);
} else if (u2 == null) {
@@ -1370,7 +1370,7 @@ public class TTFFile {
}
// Create winAnsiEncoded kerning table from kerningTab
- // (could probably be simplified, for now we remap back to CID indexes and
+ // (could probably be simplified, for now we remap back to CID indexes and
// then to winAnsi)
Iterator ae = kerningTab.keySet().iterator();
while (ae.hasNext()) {
@@ -1534,7 +1534,7 @@ public class TTFFile {
return null;
}
}
-
+
/*
* Helper classes, they are not very efficient, but that really
* doesn't matter...
@@ -1580,7 +1580,7 @@ public class TTFFile {
/**
* Map a glyph index to the corresponding unicode code point
- *
+ *
* @param glyphIndex
* @return unicode code point
* @throws IOException if glyphIndex not found
@@ -1588,10 +1588,10 @@ public class TTFFile {
private Integer glyphToUnicode(int glyphIndex) throws IOException {
return (Integer) glyphToUnicodeMap.get(new Integer(glyphIndex));
}
-
+
/**
- * Map a unicode code point to the corresponding glyph index
- *
+ * Map a unicode code point to the corresponding glyph index
+ *
* @param unicodeIndex unicode code point
* @return glyph index
* @throws IOException if unicodeIndex not found
@@ -1605,7 +1605,7 @@ public class TTFFile {
}
return result;
}
-
+
/**
* Static main method to get info about a TrueType font.
* @param args The command line arguments
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
index 325c46971..e14514b51 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,7 +46,7 @@ public class TTFFontLoader extends FontLoader {
private MultiByteFont multiFont;
private SingleByteFont singleFont;
private String subFontName;
-
+
/**
* Default constructor
* @param fontFileURI the URI representing the font file
@@ -55,7 +55,7 @@ public class TTFFontLoader extends FontLoader {
public TTFFontLoader(String fontFileURI, FontResolver resolver) {
this(fontFileURI, null, true, resolver);
}
-
+
/**
* Additional constructor for TrueType Collections.
* @param fontFileURI the URI representing the font file
@@ -69,14 +69,14 @@ public class TTFFontLoader extends FontLoader {
super(fontFileURI, embedded, resolver);
this.subFontName = subFontName;
}
-
+
/** {@inheritDoc} */
protected void read() throws IOException {
read(this.subFontName);
}
/**
- * Reads a TrueType font.
+ * Reads a TrueType font.
* @param ttcFontName the TrueType sub-font name of TrueType Collection (may be null for
* normal TrueType fonts)
* @throws IOException if an I/O error occurs
@@ -96,16 +96,16 @@ public class TTFFontLoader extends FontLoader {
IOUtils.closeQuietly(in);
}
}
-
-
+
+
private void buildFont(TTFFile ttf, String ttcFontName) {
if (ttf.isCFF()) {
throw new UnsupportedOperationException(
"OpenType fonts with CFF data are not supported, yet");
}
-
+
boolean isCid = this.embedded;
-
+
if (isCid) {
multiFont = new MultiByteFont();
returnFont = multiFont;
@@ -153,7 +153,7 @@ public class TTFFontLoader extends FontLoader {
returnFont.setLastChar(ttf.getLastChar());
copyWidthsSingleByte(ttf);
}
-
+
copyKerning(ttf, isCid);
if (this.embedded && ttf.isEmbeddable()) {
multiFont.setEmbedFileName(this.fontFileURI);
@@ -184,12 +184,12 @@ public class TTFFontLoader extends FontLoader {
}
}
}
-
+
/**
* Copy kerning information.
*/
private void copyKerning(TTFFile ttf, boolean isCid) {
-
+
// Get kerning
Iterator iter;
if (isCid) {
@@ -209,5 +209,5 @@ public class TTFFontLoader extends FontLoader {
}
returnFont.putKerningEntry(kpx1, h2);
}
- }
+ }
}
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFMtxEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFMtxEntry.java
index dae192404..6884a633d 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFMtxEntry.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFMtxEntry.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
import java.util.List;
@@ -37,7 +37,7 @@ class TTFMtxEntry {
/**
* Returns a String representation of this object.
- *
+ *
* @param t TTFFile to use for unit conversion
* @return String String representation
*/
@@ -81,7 +81,7 @@ class TTFMtxEntry {
public int getIndex() {
return index;
}
-
+
/**
* Determines whether this index represents a reserved character.
* @return True if it is reserved
@@ -89,7 +89,7 @@ class TTFMtxEntry {
public boolean isIndexReserved() {
return (getIndex() >= 32768) && (getIndex() <= 65535);
}
-
+
/**
* Returns a String representation of the index taking into account if
* the index is in the reserved range.
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
index d593c4544..37e24836e 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
import java.io.IOException;
@@ -86,7 +86,7 @@ public class TTFSubSetFile extends TTFFile {
}
return numTables;
}
-
+
/**
* Create the directory table
*/
@@ -651,7 +651,7 @@ public class TTFSubSetFile extends TTFFile {
if (!checkTTC(in, name)) {
throw new IOException("Failed to read font");
}
-
+
//Copy the Map as we're going to modify it
Map subsetGlyphs = new java.util.HashMap(glyphs);
diff --git a/src/java/org/apache/fop/fonts/type1/AFMCharMetrics.java b/src/java/org/apache/fop/fonts/type1/AFMCharMetrics.java
index 758078af4..4906f2c31 100644
--- a/src/java/org/apache/fop/fonts/type1/AFMCharMetrics.java
+++ b/src/java/org/apache/fop/fonts/type1/AFMCharMetrics.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@ public class AFMCharMetrics {
private double widthX;
private double widthY;
private RectangularShape bBox;
-
+
/**
* Returns the character code.
* @return the charCode (-1 if not part of the encoding)
@@ -42,7 +42,7 @@ public class AFMCharMetrics {
public int getCharCode() {
return charCode;
}
-
+
/**
* Indicates whether the character has a character code, i.e. is part of the default encoding.
* @return true if there is a character code.
@@ -50,7 +50,7 @@ public class AFMCharMetrics {
public boolean hasCharCode() {
return charCode >= 0;
}
-
+
/**
* Sets the character code.
* @param charCode the charCode to set
@@ -58,7 +58,7 @@ public class AFMCharMetrics {
public void setCharCode(int charCode) {
this.charCode = charCode;
}
-
+
/**
* Returns the named character represented by this instance.
* @return the named character (or null if no named character is associated)
@@ -66,7 +66,7 @@ public class AFMCharMetrics {
public NamedCharacter getCharacter() {
return this.character;
}
-
+
/**
* Sets the named character represented by this instance.
* @param ch the named character
@@ -74,7 +74,7 @@ public class AFMCharMetrics {
public void setCharacter(NamedCharacter ch) {
this.character = ch;
}
-
+
/**
* Sets the named character represented by this instance.
* @param charName the character name (as defined in the Adobe glyph list)
@@ -83,7 +83,7 @@ public class AFMCharMetrics {
public void setCharacter(String charName, String unicodeSequence) {
setCharacter(new NamedCharacter(charName, unicodeSequence));
}
-
+
/**
* Returns the Unicode sequence for this character.
* @return the Unicode characters
@@ -92,7 +92,7 @@ public class AFMCharMetrics {
public String getUnicodeSequence() {
return (getCharacter() != null ? getCharacter().getUnicodeSequence() : null);
}
-
+
/**
* Returns the PostScript character name.
* @return the charName (or null if no character name is associated)
@@ -100,7 +100,7 @@ public class AFMCharMetrics {
public String getCharName() {
return (getCharacter() != null ? getCharacter().getName() : null);
}
-
+
/**
* Returns the progression dimension in x-direction.
* @return the widthX
@@ -108,7 +108,7 @@ public class AFMCharMetrics {
public double getWidthX() {
return widthX;
}
-
+
/**
* Sets the progression dimension in x-direction
* @param widthX the widthX to set
@@ -116,7 +116,7 @@ public class AFMCharMetrics {
public void setWidthX(double widthX) {
this.widthX = widthX;
}
-
+
/**
* Returns the progression dimension in y-direction.
* @return the widthY
@@ -124,7 +124,7 @@ public class AFMCharMetrics {
public double getWidthY() {
return widthY;
}
-
+
/**
* Sets the progression dimension in y-direction
* @param widthY the widthY to set
@@ -132,7 +132,7 @@ public class AFMCharMetrics {
public void setWidthY(double widthY) {
this.widthY = widthY;
}
-
+
/**
* Returns the character's bounding box.
* @return the bounding box (or null if it isn't available)
@@ -163,5 +163,5 @@ public class AFMCharMetrics {
sb.append(getCharName()).append(')');
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/fonts/type1/AFMFile.java b/src/java/org/apache/fop/fonts/type1/AFMFile.java
index 3cb4b3343..c427ff22f 100644
--- a/src/java/org/apache/fop/fonts/type1/AFMFile.java
+++ b/src/java/org/apache/fop/fonts/type1/AFMFile.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,13 +36,13 @@ public class AFMFile {
private String fontName;
private String fullName;
private String familyName;
-
+
private String weight;
private RectangularShape fontBBox;
-
+
private String encodingScheme;
private String characterSet;
-
+
private Number capHeight;
private Number xHeight;
private Number ascender;
@@ -52,17 +52,17 @@ public class AFMFile {
private AFMWritingDirectionMetrics[] writingDirectionMetrics
= new AFMWritingDirectionMetrics[3];
-
+
private List charMetrics = new java.util.ArrayList();
//ListLayoutContext
.
+ * Handles span changes reported through the LayoutContext
.
* Only used by the PSLM and called by getNextBlockList()
.
* @param childLC the LayoutContext
* @param nextSequenceStartsOn previous value for break handling
@@ -543,12 +543,12 @@ public abstract class AbstractBreaker {
* @param nextSequenceStartsOn indicates on what page the next sequence should start
* @return the page on which the next content should appear after a hard break
*/
- protected int getNextBlockList(LayoutContext childLC,
+ protected int getNextBlockList(LayoutContext childLC,
int nextSequenceStartsOn) {
updateLayoutContext(childLC);
//Make sure the span change signal is reset
childLC.signalSpanChange(Constants.NOT_SET);
-
+
BlockSequence blockList;
List returnedList = getNextKnuthElements(childLC, alignment);
if (returnedList != null) {
@@ -557,10 +557,10 @@ public abstract class AbstractBreaker {
return nextSequenceStartsOn;
}
blockList = new BlockSequence(nextSequenceStartsOn, getCurrentDisplayAlign());
-
+
//Only implemented by the PSLM
nextSequenceStartsOn = handleSpanChange(childLC, nextSequenceStartsOn);
-
+
Position breakPosition = null;
if (((KnuthElement) ListUtil.getLast(returnedList)).isForcedBreak()) {
KnuthPenalty breakPenalty = (KnuthPenalty) ListUtil
@@ -585,7 +585,7 @@ public abstract class AbstractBreaker {
nextSequenceStartsOn = Constants.EN_EVEN_PAGE;
break;
default:
- throw new IllegalStateException("Invalid break class: "
+ throw new IllegalStateException("Invalid break class: "
+ breakPenalty.getBreakClass());
}
}
@@ -649,7 +649,7 @@ public abstract class AbstractBreaker {
* Justifies the boxes and returns them as a new KnuthSequence.
* @param blockList block list to justify
* @param alg reference to the algorithm instance
- * @param availableBPD the available BPD
+ * @param availableBPD the available BPD
* @return the effective list
*/
private BlockSequence justifyBoxes(BlockSequence blockList, PageBreakingAlgorithm alg, int availableBPD) {
@@ -659,7 +659,7 @@ public abstract class AbstractBreaker {
1, true, BreakingAlgorithm.ALL_BREAKS);
log.debug("PLM> iOptPageNumber= " + iOptPageNumber);
- //
+ //
ListIterator sequenceIterator = blockList.listIterator();
ListIterator breakIterator = alg.getPageBreaks().listIterator();
KnuthElement thisElement = null;
@@ -687,7 +687,7 @@ public abstract class AbstractBreaker {
KnuthElement firstElement;
while (!(firstElement = (KnuthElement) sequenceIterator
.next()).isBox()) {
- //
+ //
log.debug("PLM> ignoring glue or penalty element "
+ "at the beginning of the sequence");
if (firstElement.isGlue()) {
@@ -811,7 +811,7 @@ public abstract class AbstractBreaker {
// create a new sequence: the new elements will contain the
// Positions
// which will be used in the addAreas() phase
- BlockSequence effectiveList = new BlockSequence(blockList.getStartOn(),
+ BlockSequence effectiveList = new BlockSequence(blockList.getStartOn(),
blockList.getDisplayAlign());
effectiveList.addAll(getCurrentChildLM().getChangedKnuthElements(
blockList.subList(0, blockList.size() - blockList.ignoreAtEnd),
@@ -828,7 +828,7 @@ public abstract class AbstractBreaker {
private int adjustBlockSpaces(LinkedList spaceList, int difference, int total) {
if (log.isDebugEnabled()) {
- log.debug("AdjustBlockSpaces: difference " + difference + " / " + total
+ log.debug("AdjustBlockSpaces: difference " + difference + " / " + total
+ " on " + spaceList.size() + " spaces in block");
}
ListIterator spaceListIterator = spaceList.listIterator();
@@ -839,8 +839,8 @@ public abstract class AbstractBreaker {
partial += (difference > 0 ? blockSpace.getY() : blockSpace.getZ());
if (log.isDebugEnabled()) {
log.debug("available = " + partial + " / " + total);
- log.debug("competenza = "
- + (((int)((float) partial * difference / total)) - adjustedDiff)
+ log.debug("competenza = "
+ + (((int)((float) partial * difference / total)) - adjustedDiff)
+ " / " + difference);
}
int newAdjust = ((BlockLevelLayoutManager) blockSpace.getLayoutManager()).negotiateBPDAdjustment(((int) ((float) partial * difference / total)) - adjustedDiff, blockSpace);
@@ -888,5 +888,5 @@ public abstract class AbstractBreaker {
}
return adjustedDiff;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
index 13ea66d1f..a5393ced2 100644
--- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -294,7 +294,7 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
if (pos.getIndex() >= 0) {
throw new IllegalStateException("Position already got its index");
}
-
+
lastGeneratedPosition++;
pos.setIndex(lastGeneratedPosition);
return pos;
@@ -383,27 +383,27 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
* Checks to see if the incoming {@link Position}
* is the last one for this LM, and if so, calls
* {@link #notifyEndOfLayout()} and cleans up.
- *
+ *
* @param pos the {@link Position} to check
*/
protected void checkEndOfLayout(Position pos) {
if (pos != null
&& pos.getLM() == this
&& this.isLast(pos)) {
-
+
notifyEndOfLayout();
-
+
/* References to the child LMs are no longer needed
*/
childLMs = null;
curChildLM = null;
childLMiter = null;
-
+
/* markers that qualify have been transferred to the page
*/
markers = null;
-
- /* References to the FO's children can be released if the
+
+ /* References to the FO's children can be released if the
* LM is a descendant of the FlowLM. For static-content
* the FO may still be needed on following pages.
*/
@@ -418,7 +418,7 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
}
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return (super.toString() + (fobj != null ? "[fobj=" + fobj.toString() + "]" : ""));
diff --git a/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
index 2b61fb6c6..758761303 100644
--- a/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
@@ -43,15 +43,15 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
private static Log log = LogFactory.getLog(AbstractPageSequenceLayoutManager.class);
- /**
+ /**
* AreaTreeHandler which activates the PSLM and controls
* the rendering of its pages.
*/
protected AreaTreeHandler areaTreeHandler;
-
+
/** ID tracker supplied by the AreaTreeHandler */
protected IDTracker idTracker;
-
+
/** page sequence formatting object being processed by this class */
protected AbstractPageSequence pageSeq;
@@ -62,7 +62,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
protected int currentPageNum = 0;
/** The stating page number */
protected int startPageNum = 0;
-
+
/**
* Constructor
*
@@ -112,12 +112,12 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
startPageNum = pageSeq.getStartingPageNumber();
currentPageNum = startPageNum - 1;
}
-
+
/**
* This returns the first PageViewport that contains an id trait
* matching the idref argument, or null if no such PV exists.
*
- * @param idref the idref trait needing to be resolved
+ * @param idref the idref trait needing to be resolved
* @return the first PageViewport that contains the ID trait
*/
public PageViewport getFirstPVWithID(String idref) {
@@ -132,7 +132,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
* This returns the last PageViewport that contains an id trait
* matching the idref argument, or null if no such PV exists.
*
- * @param idref the idref trait needing to be resolved
+ * @param idref the idref trait needing to be resolved
* @return the last PageViewport that contains the ID trait
*/
public PageViewport getLastPVWithID(String idref) {
@@ -142,7 +142,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
}
return null;
}
-
+
/**
* Add an ID reference to the current page.
* When adding areas the area adds its ID reference.
@@ -156,7 +156,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
idTracker.associateIDWithPageViewport(id, curPage.getPageViewport());
}
}
-
+
/**
* Add an id reference of the layout manager in the AreaTreeHandler,
* if the id hasn't been resolved yet
@@ -175,7 +175,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
return true;
}
}
-
+
/**
* Notify the areaTreeHandler that the LayoutManagers containing
* idrefs have finished creating areas
@@ -184,16 +184,16 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
public void notifyEndOfLayout(String id) {
idTracker.signalIDProcessed(id);
}
-
+
/**
- * Identify an unresolved area (one needing an idref to be
+ * Identify an unresolved area (one needing an idref to be
* resolved, e.g. the internal-destination of an fo:basic-link)
* for both the AreaTreeHandler and PageViewport object.
- *
+ *
* The IDTracker keeps a document-wide list of idref's
- * and the PV's needing them to be resolved. It uses this to
+ * and the PV's needing them to be resolved. It uses this to
* send notifications to the PV's when an id has been resolved.
- *
+ *
* The PageViewport keeps lists of id's needing resolving, along
* with the child areas (page-number-citation, basic-link, etc.)
* of the PV needing their resolution.
@@ -216,7 +216,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
* then the containing page does not have a qualifying area,
* and all qualifying areas have ended.
* Therefore we use last-ending-within-page (Constants.EN_LEWP)
- * as the position.
+ * as the position.
*
* @param rm the RetrieveMarker instance whose properties are to
* used to find the matching Marker.
@@ -227,8 +227,8 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
AreaTreeModel areaTreeModel = areaTreeHandler.getAreaTreeModel();
String name = rm.getRetrieveClassName();
int pos = rm.getRetrievePosition();
- int boundary = rm.getRetrieveBoundary();
-
+ int boundary = rm.getRetrieveBoundary();
+
// get marker from the current markers on area tree
Marker mark = (Marker)getCurrentPV().getMarker(name, pos);
if (mark == null && boundary != EN_PAGE) {
@@ -271,10 +271,10 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
* @return the newly created page
*/
protected abstract Page createPage(int pageNumber, boolean isBlank);
-
+
/**
* Makes a new page
- *
+ *
* @param bIsBlank whether this page is blank or not
* @param bIsLast whether this page is the last page or not
* @return a new page
@@ -289,14 +289,14 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
curPage = createPage(currentPageNum, isBlank);
if (log.isDebugEnabled()) {
- log.debug("[" + curPage.getPageViewport().getPageNumberString()
+ log.debug("[" + curPage.getPageViewport().getPageNumberString()
+ (isBlank ? "*" : "") + "]");
}
-
+
addIDToPage(pageSeq.getId());
return curPage;
}
-
+
/**
* Finishes a page in preparation for a new page.
*/
@@ -304,19 +304,19 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
if (log.isTraceEnabled()) {
curPage.getPageViewport().dumpMarkers();
}
-
+
// Try to resolve any unresolved IDs for the current page.
- //
+ //
idTracker.tryIDResolution(curPage.getPageViewport());
// Queue for ID resolution and rendering
areaTreeHandler.getAreaTreeModel().addPage(curPage.getPageViewport());
if (log.isDebugEnabled()) {
- log.debug("page finished: " + curPage.getPageViewport().getPageNumberString()
+ log.debug("page finished: " + curPage.getPageViewport().getPageNumberString()
+ ", current num: " + currentPageNum);
}
curPage = null;
}
-
+
/** {@inheritDoc} */
public void doForcePageCount(Numeric nextPageSeqInitialPageNumber) {
@@ -325,14 +325,14 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
// xsl-spec version 1.0 (15.oct 2001)
// auto | even | odd | end-on-even | end-on-odd | no-force | inherit
// auto:
- // Force the last page in this page-sequence to be an odd-page
- // if the initial-page-number of the next page-sequence is even.
- // Force it to be an even-page
- // if the initial-page-number of the next page-sequence is odd.
- // If there is no next page-sequence
+ // Force the last page in this page-sequence to be an odd-page
+ // if the initial-page-number of the next page-sequence is even.
+ // Force it to be an even-page
+ // if the initial-page-number of the next page-sequence is odd.
+ // If there is no next page-sequence
// or if the value of its initial-page-number is "auto" do not force any page.
-
- // if force-page-count is auto then set the value of forcePageCount
+
+ // if force-page-count is auto then set the value of forcePageCount
// depending on the initial-page-number of the next page-sequence
if (nextPageSeqInitialPageNumber != null && forcePageCount == Constants.EN_AUTO) {
if (nextPageSeqInitialPageNumber.getEnum() != 0) {
@@ -381,5 +381,5 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
finishPage();
}
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java b/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
index 1b0d02639..a429359ad 100644
--- a/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
+++ b/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
@@ -49,7 +49,7 @@ public class AreaAdditionUtil {
* @param parentIter the position iterator
* @param layoutContext the layout context
*/
- public static void addAreas(BlockStackingLayoutManager bslm,
+ public static void addAreas(BlockStackingLayoutManager bslm,
PositionIterator parentIter, LayoutContext layoutContext) {
LayoutManager childLM = null;
LayoutContext lc = new LayoutContext(0);
@@ -57,9 +57,9 @@ public class AreaAdditionUtil {
LayoutManager lastLM = null;
Position firstPos = null;
Position lastPos = null;
-
+
// "unwrap" the NonLeafPositions stored in parentIter
- // and put them in a new list;
+ // and put them in a new list;
LinkedList positionList = new LinkedList();
Position pos;
while (parentIter.hasNext()) {
@@ -93,11 +93,11 @@ public class AreaAdditionUtil {
//correctly determine first and last conditions. The Iterator
//doesn't give us that info.
}
-
+
if (bslm != null) {
bslm.addMarkersToPage(
- true,
- bslm.isFirst(firstPos),
+ true,
+ bslm.isFirst(firstPos),
bslm.isLast(lastPos));
}
@@ -120,15 +120,15 @@ public class AreaAdditionUtil {
lc.setStackLimitsFrom(layoutContext);
childLM.addAreas(childPosIter, lc);
}
-
+
if (bslm != null) {
bslm.addMarkersToPage(
- false,
- bslm.isFirst(firstPos),
+ false,
+ bslm.isFirst(firstPos),
bslm.isLast(lastPos));
}
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
index a28fdbfbc..2bb499a36 100644
--- a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
+++ b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
@@ -30,11 +30,11 @@ import org.apache.fop.traits.MinOptMax;
public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
private Log log = LogFactory.getLog(BalancingColumnBreakingAlgorithm.class);
-
+
private int columnCount;
private int fullLen;
private int idealPartLen;
-
+
public BalancingColumnBreakingAlgorithm(LayoutManager topLevelLM,
PageProvider pageProvider,
PageBreakingLayoutListener layoutListener,
@@ -43,18 +43,18 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
boolean partOverflowRecovery,
int columnCount) {
super(topLevelLM, pageProvider, layoutListener,
- alignment, alignmentLast,
+ alignment, alignmentLast,
footnoteSeparatorLength, partOverflowRecovery, false, false);
this.columnCount = columnCount;
this.considerTooShort = true; //This is important!
}
-
+
/** {@inheritDoc} */
protected double computeDemerits(KnuthNode activeNode,
KnuthElement element, int fitnessClass, double r) {
double dem = super.computeDemerits(activeNode, element, fitnessClass, r);
if (log.isTraceEnabled()) {
- log.trace("original demerit=" + dem + " " + totalWidth
+ log.trace("original demerit=" + dem + " " + totalWidth
+ " line=" + activeNode.line + "/" + columnCount
+ " pos=" + activeNode.position + "/" + (par.size() - 1));
}
@@ -71,7 +71,7 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
avgRestLen = restLen / remParts;
}
if (log.isTraceEnabled()) {
- log.trace("remaining parts: " + remParts + " rest len: " + restLen
+ log.trace("remaining parts: " + remParts + " rest len: " + restLen
+ " avg=" + avgRestLen);
}
double balance = (idealPartLen - partLen) / 1000f;
@@ -92,9 +92,9 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
dem = dem * 1.2f;
}
}
- //Step 2: This helps keep the trailing parts shorter than the previous ones
+ //Step 2: This helps keep the trailing parts shorter than the previous ones
dem += (avgRestLen) / 1000f;
-
+
if (activeNode.line >= columnCount) {
//We don't want more columns than available
dem = Double.MAX_VALUE;
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
index 4aa73cc37..17eb44049 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,14 +44,14 @@ import org.apache.fop.util.ListUtil;
/**
* LayoutManager for a block-container FO.
*/
-public class BlockContainerLayoutManager extends BlockStackingLayoutManager
+public class BlockContainerLayoutManager extends BlockStackingLayoutManager
implements ConditionalElementListener {
/**
* logging instance
*/
private static Log log = LogFactory.getLog(BlockContainerLayoutManager.class);
-
+
private BlockViewport viewportBlockArea;
private Block referenceArea;
@@ -62,11 +62,11 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
private Length height;
//private int vpContentIPD;
private int vpContentBPD;
-
+
// When viewport should grow with the content.
private boolean autoHeight = true;
private boolean inlineElementList = false;
-
+
/* holds the (one-time use) fo:block space-before
and -after properties. Large fo:blocks are split
into multiple Area.Blocks to accomodate the subsequent
@@ -78,7 +78,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
//TODO space-before|after: handle space-resolution rules
private MinOptMax foBlockSpaceBefore;
private MinOptMax foBlockSpaceAfter;
-
+
private boolean discardBorderBefore;
private boolean discardBorderAfter;
private boolean discardPaddingBefore;
@@ -86,7 +86,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
private MinOptMax effSpaceBefore;
private MinOptMax effSpaceAfter;
-
+
/**
* Create a new block container layout manager.
* @param node block-container node to create the layout manager for.
@@ -94,7 +94,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
public BlockContainerLayoutManager(BlockContainer node) {
super(node);
}
-
+
/** {@inheritDoc} */
public void initialize() {
abProps = getBlockContainerFO().getCommonAbsolutePosition();
@@ -103,7 +103,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
foBlockSpaceAfter = new SpaceVal(getBlockContainerFO().getCommonMarginBlock()
.spaceAfter, this).getSpace();
startIndent = getBlockContainerFO().getCommonMarginBlock().startIndent.getValue(this);
- endIndent = getBlockContainerFO().getCommonMarginBlock().endIndent.getValue(this);
+ endIndent = getBlockContainerFO().getCommonMarginBlock().endIndent.getValue(this);
boolean rotated = (getBlockContainerFO().getReferenceOrientation() % 180 != 0);
if (rotated) {
@@ -117,7 +117,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
width = getBlockContainerFO().getInlineProgressionDimension()
.getOptimum(this).getLength();
}
-
+
bpUnit = 0; //layoutProps.blockProgressionUnit;
if (bpUnit == 0) {
// use optimum space values
@@ -133,11 +133,11 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
.spaceAfter.getSpace().getMinimum(this).getLength().getValue(this);
}
}
-
+
private void resetSpaces() {
- this.discardBorderBefore = false;
- this.discardBorderAfter = false;
- this.discardPaddingBefore = false;
+ this.discardBorderBefore = false;
+ this.discardBorderAfter = false;
+ this.discardPaddingBefore = false;
this.discardPaddingAfter = false;
this.effSpaceBefore = null;
this.effSpaceAfter = null;
@@ -153,11 +153,11 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
int overflow = getBlockContainerFO().getOverflow();
return (overflow == EN_HIDDEN || overflow == EN_ERROR_IF_OVERFLOW);
}
-
+
private int getSpaceBefore() {
return foBlockSpaceBefore.opt;
}
-
+
private int getBPIndents() {
int indents = 0;
/* TODO This is wrong isn't it?
@@ -170,16 +170,16 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
.getBPPaddingAndBorder(false, this);
return indents;
}
-
+
private boolean isAbsoluteOrFixed() {
- return (abProps.absolutePosition == EN_ABSOLUTE)
+ return (abProps.absolutePosition == EN_ABSOLUTE)
|| (abProps.absolutePosition == EN_FIXED);
}
private boolean isFixed() {
return (abProps.absolutePosition == EN_FIXED);
}
-
+
/** {@inheritDoc} */
public int getContentAreaBPD() {
if (autoHeight) {
@@ -188,26 +188,26 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
return this.vpContentBPD;
}
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
resetSpaces();
if (isAbsoluteOrFixed()) {
return getNextKnuthElementsAbsolute(context, alignment);
}
-
+
autoHeight = false;
//boolean rotated = (getBlockContainerFO().getReferenceOrientation() % 180 != 0);
int maxbpd = context.getStackLimitBP().opt;
int allocBPD;
- if (height.getEnum() == EN_AUTO
+ if (height.getEnum() == EN_AUTO
|| (!height.isAbsolute() && getAncestorBlockAreaBPD() <= 0)) {
- //auto height when height="auto" or "if that dimension is not specified explicitly
+ //auto height when height="auto" or "if that dimension is not specified explicitly
//(i.e., it depends on content's block-progression-dimension)" (XSL 1.0, 7.14.1)
allocBPD = maxbpd;
autoHeight = true;
if (getBlockContainerFO().getReferenceOrientation() == 0) {
- //Cannot easily inline element list when ref-or="180"
+ //Cannot easily inline element list when ref-or="180"
inlineElementList = true;
}
} else {
@@ -223,7 +223,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
int contentWidth = width.getValue(this);
updateContentAreaIPDwithOverconstrainedAdjust(contentWidth);
}
-
+
double contentRectOffsetX = 0;
contentRectOffsetX += getBlockContainerFO()
.getCommonMarginBlock().startIndent.getValue(this);
@@ -232,7 +232,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
.getCommonBorderPaddingBackground().getBorderBeforeWidth(false);
contentRectOffsetY += getBlockContainerFO()
.getCommonBorderPaddingBackground().getPaddingBefore(false, this);
-
+
updateRelDims(contentRectOffsetX, contentRectOffsetY, autoHeight);
int availableIPD = referenceIPD - getIPIndents();
@@ -243,13 +243,13 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
getContentAreaIPD(), context.getRefIPD(),
getBlockContainerFO().getLocator());
}
-
+
MinOptMax stackLimit = new MinOptMax(relDims.bpd);
List returnedList;
List contentList = new LinkedList();
List returnList = new LinkedList();
-
+
if (!breakBeforeServed) {
try {
if (addKnuthElementsForBreakBefore(returnList, context)) {
@@ -264,7 +264,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
addKnuthElementsForSpaceBefore(returnList, alignment);
context.updateKeepWithPreviousPending(getKeepWithPreviousStrength());
}
-
+
addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed);
firstVisibleMarkServed = true;
@@ -366,7 +366,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
returnList.add(new KnuthBox(vpContentBPD, notifyPos(bcPosition), false));
//TODO Handle min/opt/max for block-progression-dimension
/* These two elements will be used to add stretchability to the above box
- returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE,
+ returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE,
false, returnPosition, false));
returnList.add(new KnuthGlue(0, 1 * constantLineHeight, 0,
LINE_NUMBER_ADJUSTMENT, returnPosition, false));
@@ -375,7 +375,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (contentOverflows) {
BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
getBlockContainerFO().getUserAgent().getEventBroadcaster());
- boolean canRecover = (getBlockContainerFO().getOverflow() != EN_ERROR_IF_OVERFLOW);
+ boolean canRecover = (getBlockContainerFO().getOverflow() != EN_ERROR_IF_OVERFLOW);
eventProducer.viewportOverflow(this, getBlockContainerFO().getName(),
breaker.getOverflowAmount(), needClip(), canRecover,
getBlockContainerFO().getLocator());
@@ -384,7 +384,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
addKnuthElementsForBorderPaddingAfter(returnList, true);
addKnuthElementsForSpaceAfter(returnList, alignment);
- //All child content is processed. Only break-after can occur now, so...
+ //All child content is processed. Only break-after can occur now, so...
context.clearPendingMarks();
addKnuthElementsForBreakAfter(returnList, context);
@@ -393,7 +393,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
setFinished(true);
return returnList;
}
-
+
private List getNextKnuthElementsAbsolute(LayoutContext context, int alignment) {
autoHeight = false;
@@ -403,7 +403,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
int allocBPD, allocIPD;
if (height.getEnum() == EN_AUTO
|| (!height.isAbsolute() && getAncestorBlockAreaBPD() <= 0)) {
- //auto height when height="auto" or "if that dimension is not specified explicitly
+ //auto height when height="auto" or "if that dimension is not specified explicitly
//(i.e., it depends on content's blockprogression-dimension)" (XSL 1.0, 7.14.1)
allocBPD = 0;
if (abProps.bottom.getEnum() != EN_AUTO) {
@@ -411,7 +411,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (isFixed()) {
availHeight = (int)getCurrentPV().getViewArea().getHeight();
} else {
- availHeight = context.getStackLimitBP().opt;
+ availHeight = context.getStackLimitBP().opt;
}
allocBPD = availHeight;
allocBPD -= offset.y;
@@ -456,7 +456,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (width.getEnum() == EN_AUTO) {
int availWidth;
if (isFixed()) {
- availWidth = (int)getCurrentPV().getViewArea().getWidth();
+ availWidth = (int)getCurrentPV().getViewArea().getWidth();
} else {
availWidth = context.getRefIPD();
}
@@ -500,7 +500,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
vpContentBPD = allocBPD - getBPIndents();
setContentAreaIPD(allocIPD - getIPIndents());
-
+
updateRelDims(0, 0, autoHeight);
MinOptMax range = new MinOptMax(relDims.ipd);
@@ -521,12 +521,12 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (!breaker.isEmpty()) {
Position bcPosition = new BlockContainerPosition(this, breaker);
returnList.add(new KnuthBox(0, notifyPos(bcPosition), false));
-
+
//TODO Maybe check for page overflow when autoHeight=true
if (!autoHeight & (contentOverflows)) {
BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
getBlockContainerFO().getUserAgent().getEventBroadcaster());
- boolean canRecover = (getBlockContainerFO().getOverflow() != EN_ERROR_IF_OVERFLOW);
+ boolean canRecover = (getBlockContainerFO().getOverflow() != EN_ERROR_IF_OVERFLOW);
eventProducer.viewportOverflow(this, getBlockContainerFO().getName(),
breaker.getOverflowAmount(), needClip(), canRecover,
getBlockContainerFO().getLocator());
@@ -539,16 +539,16 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
private void updateRelDims(double xOffset, double yOffset, boolean skipAutoHeight) {
Rectangle2D rect = new Rectangle2D.Double(
- xOffset, yOffset,
+ xOffset, yOffset,
getContentAreaIPD(),
this.vpContentBPD);
relDims = new FODimension(0, 0);
absoluteCTM = CTM.getCTMandRelDims(
getBlockContainerFO().getReferenceOrientation(),
- getBlockContainerFO().getWritingMode(),
+ getBlockContainerFO().getWritingMode(),
rect, relDims);
}
-
+
private class BlockContainerPosition extends NonLeafPosition {
private BlockContainerBreaker breaker;
@@ -557,23 +557,23 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
super(lm, null);
this.breaker = breaker;
}
-
+
public BlockContainerBreaker getBreaker() {
return this.breaker;
}
-
+
}
-
+
private class BlockContainerBreaker extends AbstractBreaker {
-
+
private BlockContainerLayoutManager bclm;
private MinOptMax ipd;
-
+
//Info for deferred adding of areas
private PageBreakingAlgorithm deferredAlg;
private BlockSequence deferredOriginalList;
private BlockSequence deferredEffectiveList;
-
+
public BlockContainerBreaker(BlockContainerLayoutManager bclm, MinOptMax ipd) {
this.bclm = bclm;
this.ipd = ipd;
@@ -581,10 +581,10 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
/** {@inheritDoc} */
protected void observeElementList(List elementList) {
- ElementListObserver.observe(elementList, "block-container",
+ ElementListObserver.observe(elementList, "block-container",
bclm.getBlockContainerFO().getId());
}
-
+
/** {@inheritDoc} */
protected boolean isPartOverflowRecoveryActivated() {
//For block-containers, this must be disabled because of wanted overflow.
@@ -600,19 +600,19 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
PageBreakPosition pbp = (PageBreakPosition)this.deferredAlg.getPageBreaks().getFirst();
return pbp.difference;
}
-
+
public boolean isOverflow() {
return !isEmpty()
&& ((deferredAlg.getPageBreaks().size() > 1)
|| (deferredAlg.totalWidth - deferredAlg.totalShrink)
> deferredAlg.getLineWidth());
}
-
+
public int getOverflowAmount() {
- return (deferredAlg.totalWidth - deferredAlg.totalShrink)
+ return (deferredAlg.totalWidth - deferredAlg.totalShrink)
- deferredAlg.getLineWidth();
}
-
+
protected LayoutManager getTopLevelLM() {
return bclm;
}
@@ -623,7 +623,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
lc.setWritingMode(getBlockContainerFO().getWritingMode());
return lc;
}
-
+
protected List getNextKnuthElements(LayoutContext context, int alignment) {
LayoutManager curLM; // currently active LM
List returnList = new LinkedList();
@@ -633,7 +633,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(context.getRefIPD());
childLC.setWritingMode(getBlockContainerFO().getWritingMode());
-
+
List returnedList = null;
if (!curLM.isFinished()) {
returnedList = curLM.getNextKnuthElements(childLC, alignment);
@@ -650,45 +650,45 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
protected int getCurrentDisplayAlign() {
return getBlockContainerFO().getDisplayAlign();
}
-
+
protected boolean hasMoreContent() {
return !isFinished();
}
-
+
protected void addAreas(PositionIterator posIter, LayoutContext context) {
- AreaAdditionUtil.addAreas(bclm, posIter, context);
+ AreaAdditionUtil.addAreas(bclm, posIter, context);
}
-
- protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
+
+ protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
//Defer adding of areas until addAreas is called by the parent LM
this.deferredAlg = alg;
this.deferredOriginalList = originalList;
this.deferredEffectiveList = effectiveList;
}
-
+
protected void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp) {
//nop for bclm
}
-
+
protected LayoutManager getCurrentChildLM() {
return curChildLM;
}
-
+
public void addContainedAreas() {
if (isEmpty()) {
return;
}
- //Rendering all parts (not just the first) at once for the case where the parts that
+ //Rendering all parts (not just the first) at once for the case where the parts that
//overflow should be visible.
this.deferredAlg.removeAllPageBreaks();
- this.addAreas(this.deferredAlg,
- this.deferredAlg.getPageBreaks().size(),
+ this.addAreas(this.deferredAlg,
+ this.deferredAlg.getPageBreaks().size(),
this.deferredOriginalList, this.deferredEffectiveList);
}
-
+
}
-
+
private Point getAbsOffset() {
int x = 0;
int y = 0;
@@ -696,7 +696,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
x = abProps.left.getValue(this);
} else if (abProps.right.getEnum() != EN_AUTO
&& width.getEnum() != EN_AUTO) {
- x = getReferenceAreaIPD()
+ x = getReferenceAreaIPD()
- abProps.right.getValue(this) - width.getValue(this);
}
if (abProps.top.getEnum() != EN_AUTO) {
@@ -708,7 +708,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
}
return new Point(x, y);
}
-
+
/** {@inheritDoc} */
public void addAreas(PositionIterator parentIter,
LayoutContext layoutContext) {
@@ -755,7 +755,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (bcpos != null) {
throw new IllegalStateException("Only one BlockContainerPosition allowed");
}
- bcpos = (BlockContainerPosition)pos;
+ bcpos = (BlockContainerPosition)pos;
//Add child areas inside the reference area
//bcpos.getBreaker().addContainedAreas();
} else if (innerPosition == null) {
@@ -786,9 +786,9 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
}
addId();
-
+
addMarkersToPage(true, isFirst(firstPos), isLast(lastPos));
-
+
if (bcpos == null) {
if (bpUnit == 0) {
// the Positions in positionList were inside the elements
@@ -831,7 +831,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
//log.debug("Adding areas from " + iFirst + " to " + iLast);
//log.debug("splitLength= " + splitLength
// + " (" + neededUnits(splitLength) + " units') "
- // + (neededUnits(splitLength) * bpUnit - splitLength)
+ // + (neededUnits(splitLength) * bpUnit - splitLength)
// + " spacing");
// add space before and / or after the paragraph
// to reach a multiple of bpUnit
@@ -864,7 +864,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
.size());
//}
}
-
+
while ((childLM = childPosIter.getNextChildLM()) != null) {
// set last area flag
lc.setFlags(LayoutContext.LAST_AREA,
@@ -880,7 +880,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
- TraitSetter.addSpaceBeforeAfter(viewportBlockArea, layoutContext.getSpaceAdjust(),
+ TraitSetter.addSpaceBeforeAfter(viewportBlockArea, layoutContext.getSpaceAdjust(),
effSpaceBefore, effSpaceAfter);
flush();
@@ -890,7 +890,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
notifyEndOfLayout();
}
-
+
/**
* Get the parent area for children of this block container.
* This returns the current block container area
@@ -906,7 +906,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
viewportBlockArea = new BlockViewport(allowBPDUpdate);
viewportBlockArea.addTrait(Trait.IS_VIEWPORT_AREA, Boolean.TRUE);
-
+
viewportBlockArea.setIPD(getContentAreaIPD());
if (allowBPDUpdate) {
viewportBlockArea.setBPD(0);
@@ -914,22 +914,22 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
viewportBlockArea.setBPD(this.vpContentBPD);
}
transferForeignAttributes(viewportBlockArea);
-
+
TraitSetter.setProducerID(viewportBlockArea, getBlockContainerFO().getId());
- TraitSetter.addBorders(viewportBlockArea,
- getBlockContainerFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addBorders(viewportBlockArea,
+ getBlockContainerFO().getCommonBorderPaddingBackground(),
discardBorderBefore, discardBorderAfter, false, false, this);
- TraitSetter.addPadding(viewportBlockArea,
- getBlockContainerFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addPadding(viewportBlockArea,
+ getBlockContainerFO().getCommonBorderPaddingBackground(),
discardPaddingBefore, discardPaddingAfter, false, false, this);
- // TraitSetter.addBackground(viewportBlockArea,
+ // TraitSetter.addBackground(viewportBlockArea,
// getBlockContainerFO().getCommonBorderPaddingBackground(),
// this);
- TraitSetter.addMargins(viewportBlockArea,
+ TraitSetter.addMargins(viewportBlockArea,
getBlockContainerFO().getCommonBorderPaddingBackground(),
startIndent, endIndent,
this);
-
+
viewportBlockArea.setCTM(absoluteCTM);
viewportBlockArea.setClip(needClip());
/*
@@ -940,7 +940,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
viewportBlockArea.addTrait(Trait.SPACE_AFTER, new Integer(foBlockSpaceAfter.opt));
}*/
- if (abProps.absolutePosition == EN_ABSOLUTE
+ if (abProps.absolutePosition == EN_ABSOLUTE
|| abProps.absolutePosition == EN_FIXED) {
Point offset = getAbsOffset();
viewportBlockArea.setXOffset(offset.x);
@@ -981,17 +981,17 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
}
}
- /**
+ /**
* Force current area to be added to parent area.
* {@inheritDoc}
*/
protected void flush() {
viewportBlockArea.addBlock(referenceArea, autoHeight);
- TraitSetter.addBackground(viewportBlockArea,
+ TraitSetter.addBackground(viewportBlockArea,
getBlockContainerFO().getCommonBorderPaddingBackground(),
this);
-
+
super.flush();
}
@@ -1004,7 +1004,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
/** {@inheritDoc} */
public void discardSpace(KnuthGlue spaceGlue) {
// TODO Auto-generated method stub
-
+
}
/** {@inheritDoc} */
@@ -1032,15 +1032,15 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
*/
protected BlockContainer getBlockContainerFO() {
return (BlockContainer) fobj;
- }
+ }
// --------- Property Resolution related functions --------- //
-
+
/** {@inheritDoc} */
public boolean getGeneratesReferenceArea() {
return true;
}
-
+
/** {@inheritDoc} */
public boolean getGeneratesBlockArea() {
return true;
@@ -1050,13 +1050,13 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
public void notifySpace(RelSide side, MinOptMax effectiveLength) {
if (RelSide.BEFORE == side) {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceBefore + "-> " + effectiveLength);
}
this.effSpaceBefore = effectiveLength;
} else {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceAfter + "-> " + effectiveLength);
}
this.effSpaceAfter = effectiveLength;
diff --git a/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java
index d3365b10f..fac5bf075 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java
@@ -26,16 +26,16 @@ import java.util.List;
* Represents a list of block level Knuth elements.
*/
public class BlockKnuthSequence extends KnuthSequence {
-
+
private boolean isClosed = false;
-
+
/**
* Creates a new and empty list.
*/
public BlockKnuthSequence() {
super();
}
-
+
/**
* Creates a new list from an existing list.
* @param list The list from which to create the new list.
@@ -59,7 +59,7 @@ public class BlockKnuthSequence extends KnuthSequence {
// log.debug("Cannot append a sequence without a BreakElement");
return false;
}
-
+
/** {@inheritDoc} */
public boolean appendSequence(KnuthSequence sequence, boolean keepTogether,
BreakElement breakElement) {
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
index b6b6f921f..c641c3e69 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
@@ -42,14 +42,14 @@ import org.apache.fop.traits.SpaceVal;
/**
* LayoutManager for a block FO.
*/
-public class BlockLayoutManager extends BlockStackingLayoutManager
+public class BlockLayoutManager extends BlockStackingLayoutManager
implements ConditionalElementListener {
/**
* logging instance
*/
private static Log log = LogFactory.getLog(BlockLayoutManager.class);
-
+
private Block curBlockArea;
/** Iterator over the child layout managers. */
@@ -59,7 +59,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
private Length lineHeight;
private int follow = 2000;
//private int middleShift = 0;
-
+
private boolean discardBorderBefore;
private boolean discardBorderAfter;
private boolean discardPaddingBefore;
@@ -91,7 +91,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
//middleShift = -fs.getXHeight() / 2;
lineHeight = getBlockFO().getLineHeight().getOptimum(this).getLength();
startIndent = getBlockFO().getCommonMarginBlock().startIndent.getValue(this);
- endIndent = getBlockFO().getCommonMarginBlock().endIndent.getValue(this);
+ endIndent = getBlockFO().getCommonMarginBlock().endIndent.getValue(this);
foSpaceBefore = new SpaceVal(getBlockFO().getCommonMarginBlock().spaceBefore, this)
.getSpace();
foSpaceAfter = new SpaceVal(getBlockFO().getCommonMarginBlock().spaceAfter, this)
@@ -114,19 +114,19 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
- resetSpaces();
+ resetSpaces();
return super.getNextKnuthElements(context, alignment);
}
-
+
private void resetSpaces() {
- this.discardBorderBefore = false;
- this.discardBorderAfter = false;
- this.discardPaddingBefore = false;
+ this.discardBorderBefore = false;
+ this.discardBorderAfter = false;
+ this.discardPaddingBefore = false;
this.discardPaddingAfter = false;
this.effSpaceBefore = null;
this.effSpaceAfter = null;
}
-
+
/**
* Proxy iterator for Block LM.
* This iterator creates and holds the complete list
@@ -216,7 +216,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KeepUtil.getCombinedBlockLevelKeepStrength(getBlockFO().getKeepWithNext());
@@ -298,7 +298,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
}
addId();
-
+
addMarkersToPage(true, isFirst(firstPos), isLast(lastPos));
if (bpUnit == 0) {
@@ -340,7 +340,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
//log.debug("Adding areas from " + iFirst + " to " + iLast);
//log.debug("splitLength= " + splitLength
// + " (" + neededUnits(splitLength) + " units') "
- // + (neededUnits(splitLength) * bpUnit - splitLength)
+ // + (neededUnits(splitLength) * bpUnit - splitLength)
// + " spacing");
// add space before and / or after the paragraph
// to reach a multiple of bpUnit
@@ -385,13 +385,13 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
- TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
+ TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
effSpaceBefore, effSpaceAfter);
flush();
curBlockArea = null;
resetSpaces();
-
+
//Notify end of block layout manager to the PSLM
checkEndOfLayout(lastPos);
}
@@ -414,7 +414,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
curBlockArea.setIPD(super.getContentAreaIPD());
- TraitSetter.addBreaks(curBlockArea,
+ TraitSetter.addBreaks(curBlockArea,
getBlockFO().getBreakBefore(), getBlockFO().getBreakAfter());
// Must get dimensions from parent area
@@ -423,14 +423,14 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
// set traits
TraitSetter.setProducerID(curBlockArea, getBlockFO().getId());
- TraitSetter.addBorders(curBlockArea,
- getBlockFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addBorders(curBlockArea,
+ getBlockFO().getCommonBorderPaddingBackground(),
discardBorderBefore, discardBorderAfter, false, false, this);
- TraitSetter.addPadding(curBlockArea,
- getBlockFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addPadding(curBlockArea,
+ getBlockFO().getCommonBorderPaddingBackground(),
discardPaddingBefore, discardPaddingAfter, false, false, this);
TraitSetter.addMargins(curBlockArea,
- getBlockFO().getCommonBorderPaddingBackground(),
+ getBlockFO().getCommonBorderPaddingBackground(),
startIndent, endIndent,
this);
@@ -458,7 +458,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
*/
protected void flush() {
if (curBlockArea != null) {
- TraitSetter.addBackground(curBlockArea,
+ TraitSetter.addBackground(curBlockArea,
getBlockFO().getCommonBorderPaddingBackground(),
this);
super.flush();
@@ -472,9 +472,9 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
protected org.apache.fop.fo.flow.Block getBlockFO() {
return (org.apache.fop.fo.flow.Block) fobj;
}
-
+
// --------- Property Resolution related functions --------- //
-
+
/**
* Returns the IPD of the content area
* @return the IPD of the content area
@@ -485,7 +485,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
}
return super.getContentAreaIPD();
}
-
+
/**
* Returns the BPD of the content area
@@ -497,7 +497,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
}
return -1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -509,13 +509,13 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
public void notifySpace(RelSide side, MinOptMax effectiveLength) {
if (RelSide.BEFORE == side) {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceBefore + "-> " + effectiveLength);
}
this.effSpaceBefore = effectiveLength;
} else {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceAfter + "-> " + effectiveLength);
}
this.effSpaceAfter = effectiveLength;
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java
index b1dd7ef5d..222ce277e 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java
@@ -34,7 +34,7 @@ public interface BlockLevelEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -56,7 +56,7 @@ public interface BlockLevelEventProducer extends EventProducer {
* @event.severity WARN
*/
void rowTooTall(Object source, int row, int effCellBPD, int maxCellBPD, Locator loc);
-
+
/**
* Auto-table layout is not supported, yet.
* @param source the event source
@@ -64,28 +64,28 @@ public interface BlockLevelEventProducer extends EventProducer {
* @event.severity INFO
*/
void tableFixedAutoWidthNotSupported(Object source, Locator loc);
-
+
/**
* An formatting object is too wide.
* @param source the event source
- * @param elementName the formatting object
+ * @param elementName the formatting object
* @param effIPD the effective extent in inline-progression direction of the table contents
* @param maxIPD the maximum extent in inline-progression direction available
* @param loc the location of the error or null
* @event.severity WARN
*/
void objectTooWide(Object source, String elementName, int effIPD, int maxIPD, Locator loc);
-
+
/**
* An overconstrained geometry adjustment rule was triggered (5.3.4, XSL 1.0).
* @param source the event source
- * @param elementName the formatting object
+ * @param elementName the formatting object
* @param amount the amount of the adjustment (in mpt)
* @param loc the location of the error or null
* @event.severity INFO
*/
void overconstrainedAdjustEndIndent(Object source, String elementName, int amount, Locator loc);
-
+
/**
* Contents overflow a viewport.
* @param source the event source
@@ -97,10 +97,10 @@ public interface BlockLevelEventProducer extends EventProducer {
* @throws LayoutException the layout error provoked by the method call
* @event.severity FATAL
*/
- void viewportOverflow(Object source, String elementName,
+ void viewportOverflow(Object source, String elementName,
int amount, boolean clip, boolean canRecover,
Locator loc) throws LayoutException;
-
+
/**
* Contents overflow a region viewport.
* @param source the event source
@@ -117,7 +117,7 @@ public interface BlockLevelEventProducer extends EventProducer {
String page,
int amount, boolean clip, boolean canRecover,
Locator loc) throws LayoutException;
-
+
/**
* Indicates that FOP doesn't support flows that are not mapped to region-body, yet.
* @param source the event source
@@ -129,7 +129,7 @@ public interface BlockLevelEventProducer extends EventProducer {
*/
void flowNotMappingToRegionBody(Object source, String flowName, String masterName,
Locator loc) throws UnsupportedOperationException;
-
+
/**
* A page sequence master is exhausted.
* @param source the event source
@@ -152,7 +152,7 @@ public interface BlockLevelEventProducer extends EventProducer {
*/
void missingSubsequencesInPageSequenceMaster(Object source, String pageSequenceMasterName,
Locator loc) throws PageProductionException;
-
+
/**
* No single-page-master matching in page sequence master.
* @param source the event source
@@ -164,5 +164,5 @@ public interface BlockLevelEventProducer extends EventProducer {
*/
void noMatchingPageMaster(Object source, String pageSequenceMasterName,
String pageMasterName, Locator loc) throws PageProductionException;
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java
index 765bb1086..9163193a2 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
/**
@@ -39,7 +39,7 @@ public interface BlockLevelLayoutManager extends LayoutManager {
int KEEP_AUTO = Integer.MIN_VALUE;
/** The integer value for "always" keep strength */
int KEEP_ALWAYS = Integer.MAX_VALUE;
-
+
int negotiateBPDAdjustment(int adj, KnuthElement lastElement);
void discardSpace(KnuthGlue spaceGlue);
@@ -60,7 +60,7 @@ public interface BlockLevelLayoutManager extends LayoutManager {
* @return the keep-with-previous strength
*/
int getKeepWithPreviousStrength();
-
+
/**
* @return true if this element must be kept with the previous element.
*/
@@ -71,7 +71,7 @@ public interface BlockLevelLayoutManager extends LayoutManager {
* @return the keep-with-next strength
*/
int getKeepWithNextStrength();
-
+
/**
* @return true if this element must be kept with the next element.
*/
diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
index 4360f62e9..1d6662cb2 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -91,7 +91,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
private Position auxiliaryPosition;
private int contentAreaIPD = 0;
-
+
/**
* @param node the fo this LM deals with
*/
@@ -100,7 +100,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
setGeneratesBlockArea(true);
}
- /**
+ /**
* @return current area being filled
*/
protected BlockParent getCurrentArea() {
@@ -181,7 +181,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
return this.auxiliaryPosition;
}
-
+
/**
* @param len length in millipoints to span with bp units
* @return the minimum integer n such that n * bpUnit >= len
@@ -194,7 +194,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* Determines and sets the content area IPD based on available reference area IPD, start- and
* end-indent properties.
* end-indent is adjusted based on overconstrained geometry rules, if necessary.
- *
+ *
* @return the resulting content area IPD
*/
protected int updateContentAreaIPDwithOverconstrainedAdjust() {
@@ -213,9 +213,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
setContentAreaIPD(ipd);
return ipd;
}
-
+
/**
- * Sets the content area IPD by directly supplying the value.
+ * Sets the content area IPD by directly supplying the value.
* end-indent is adjusted based on overconstrained geometry rules, if necessary.
* @param contentIPD the IPD of the content
* @return the resulting content area IPD
@@ -234,7 +234,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
setContentAreaIPD(contentIPD);
return contentIPD;
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
//log.debug("BLM.getNextKnuthElements> keep-together = "
@@ -247,7 +247,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
BlockLevelLayoutManager prevLM = null; // previously active LM
referenceIPD = context.getRefIPD();
-
+
updateContentAreaIPDwithOverconstrainedAdjust();
List returnedList = null;
@@ -268,16 +268,16 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
addKnuthElementsForSpaceBefore(returnList, alignment);
context.updateKeepWithPreviousPending(getKeepWithPreviousStrength());
}
-
+
addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed);
firstVisibleMarkServed = true;
//Spaces, border and padding to be repeated at each break
addPendingMarks(context);
-
+
//Used to indicate a special break-after case when all content has already been generated.
BreakElement forcedBreakAfterLast = null;
-
+
while ((curLM = (BlockLevelLayoutManager) getChildLM()) != null) {
LayoutContext childLC = new LayoutContext(0);
childLC.copyPendingMarksFrom(context);
@@ -314,13 +314,13 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
if (contentList.isEmpty()) {
- // Empty fo:block, zero-length box makes sure the IDs and/or markers
+ // Empty fo:block, zero-length box makes sure the IDs and/or markers
// are registered and borders/padding are painted.
returnList.add(new KnuthBox(0, notifyPos(new Position(this)), false));
}
// a descendant of this block has break-before
contentList.addAll(returnedList);
-
+
/* extension: conversione di tutta la sequenza fin'ora ottenuta */
if (bpUnit > 0) {
storedList = contentList;
@@ -350,7 +350,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// a descendant of this block has break-after
if (curLM.isFinished() && !hasNextChildLM()) {
forcedBreakAfterLast = (BreakElement) ListUtil
- .removeLast(contentList);
+ .removeLast(contentList);
context.clearPendingMarks();
break;
}
@@ -385,15 +385,15 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
if (!contentList.isEmpty()) {
wrapPositionElements(contentList, returnList);
} else if (forcedBreakAfterLast == null) {
- // Empty fo:block, zero-length box makes sure the IDs and/or markers
+ // Empty fo:block, zero-length box makes sure the IDs and/or markers
// are registered.
returnList.add(new KnuthBox(0, notifyPos(new Position(this)), true));
}
addKnuthElementsForBorderPaddingAfter(returnList, true);
addKnuthElementsForSpaceAfter(returnList, alignment);
-
- //All child content is processed. Only break-after can occur now, so...
+
+ //All child content is processed. Only break-after can occur now, so...
context.clearPendingMarks();
if (forcedBreakAfterLast == null) {
addKnuthElementsForBreakAfter(returnList, context);
@@ -403,9 +403,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
forcedBreakAfterLast.clearPendingMarks();
wrapPositionElement(forcedBreakAfterLast, returnList, false);
}
-
+
context.updateKeepWithNextPending(getKeepWithNextStrength());
-
+
setFinished(true);
return returnList;
@@ -419,20 +419,20 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
*/
protected void addInBetweenBreak(List contentList, LayoutContext context,
LayoutContext childLC) {
- if (mustKeepTogether()
+ if (mustKeepTogether()
|| context.isKeepWithNextPending()
|| childLC.isKeepWithPreviousPending()) {
-
+
int strength = getKeepTogetherStrength();
-
+
//Handle pending keep-with-next
strength = Math.max(strength, context.getKeepWithNextPending());
context.clearKeepWithNextPending();
-
+
//Handle pending keep-with-previous from child LM
strength = Math.max(strength, childLC.getKeepWithPreviousPending());
childLC.clearKeepWithPreviousPending();
-
+
int penalty = KeepUtil.getPenaltyForKeep(strength);
// add a penalty to forbid or discourage a break between blocks
@@ -440,7 +440,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
new Position(this), penalty, context));
return;
}
-
+
ListElement last = (ListElement) ListUtil.getLast(contentList);
if (last.isGlue()) {
// the last element in contentList is a glue;
@@ -465,7 +465,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// areas for following Positions. The above test aims at preventing
// such a situation from occurring. add a null penalty to allow a break
// between blocks
-
+
// add a null penalty to allow a break between blocks
contentList.add(new BreakElement(
new Position(this), 0, context));
@@ -473,11 +473,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> " + adj);
-/*LF*/ //log.debug(" lastElement e' " + (lastElement.isPenalty()
+/*LF*/ //log.debug(" lastElement e' " + (lastElement.isPenalty()
// ? "penalty" : (lastElement.isGlue() ? "glue" : "box" )));
/*LF*/ //log.debug(" position e' " + lastElement.getPosition().getClass().getName());
/*LF*/ //log.debug(" " + (bpUnit > 0 ? "unit" : ""));
@@ -497,9 +497,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return adj;
} else if (innerPosition instanceof MappingPosition) {
// this block has block-progression-unit > 0: the adjustment can concern
- // - the space-before or space-after of this block,
+ // - the space-before or space-after of this block,
// - the line number of a descendant of this block
- MappingPosition mappingPos = (MappingPosition)innerPosition;
+ MappingPosition mappingPos = (MappingPosition)innerPosition;
if (lastElement.isGlue()) {
// lastElement is a glue
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> bpunit con glue");
@@ -512,7 +512,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
newAdjustment += ((BlockLevelLayoutManager)storedElement
.getLayoutManager()).negotiateBPDAdjustment(
adj - newAdjustment, storedElement);
-/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> (progressivo) righe: "
+/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> (progressivo) righe: "
// + newAdjustment);
}
}
@@ -530,7 +530,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// the original penalty has width > 0
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> chiamata passata");
return ((BlockLevelLayoutManager)storedPenalty.getLayoutManager())
- .negotiateBPDAdjustment(storedPenalty.getW(),
+ .negotiateBPDAdjustment(storedPenalty.getW(),
(KnuthElement)storedPenalty);
} else {
// the original penalty has width = 0
@@ -586,11 +586,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
/*LF*/ //log.debug("");
-/*LF*/ //log.debug(" BLM.getChangedKnuthElements> inizio: oldList.size() = "
+/*LF*/ //log.debug(" BLM.getChangedKnuthElements> inizio: oldList.size() = "
// + oldList.size());
ListIterator oldListIterator = oldList.listIterator();
KnuthElement returnedElement;
@@ -605,10 +605,10 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
while (oldListIterator.hasNext()) {
oldElement = (KnuthElement)oldListIterator.next();
Position innerPosition = ((NonLeafPosition) oldElement.getPosition()).getPosition();
- //log.debug(" BLM> unwrapping: "
- // + (oldElement.isBox() ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
+ //log.debug(" BLM> unwrapping: "
+ // + (oldElement.isBox() ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
// + " creato da " + oldElement.getLayoutManager().getClass().getName());
- //log.debug(" BLM> unwrapping: "
+ //log.debug(" BLM> unwrapping: "
// + oldElement.getPosition().getClass().getName());
if (innerPosition != null) {
// oldElement was created by a descendant of this BlockLM
@@ -645,18 +645,18 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
int iLast = ((MappingPosition) el.getPosition()).getLastIndex();
- //log-debug(" si usa storedList da " + iFirst + " a " + iLast
+ //log-debug(" si usa storedList da " + iFirst + " a " + iLast
// + " compresi su " + storedList.size() + " elementi totali");
workList = storedList.subList(iFirst, iLast + 1);
}
ListIterator workListIterator = workList.listIterator();
- //log.debug(" BLM.getChangedKnuthElements> workList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> workList.size() = "
// + workList.size() + " da 0 a " + (workList.size() - 1));
while (workListIterator.hasNext()) {
currElement = (KnuthElement) workListIterator.next();
- //log.debug("elemento n. " + workListIterator.previousIndex()
+ //log.debug("elemento n. " + workListIterator.previousIndex()
// + " nella workList");
if (prevElement != null
&& prevElement.getLayoutManager() != currElement.getLayoutManager()) {
@@ -667,8 +667,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
currElement.getLayoutManager();
boolean bSomethingAdded = false;
if (prevLM != this) {
- //log.debug(" BLM.getChangedKnuthElements> chiamata da "
- // + fromIndex + " a " + workListIterator.previousIndex() + " su "
+ //log.debug(" BLM.getChangedKnuthElements> chiamata da "
+ // + fromIndex + " a " + workListIterator.previousIndex() + " su "
// + prevLM.getClass().getName());
returnedList.addAll(prevLM.getChangedKnuthElements(workList.subList(
fromIndex, workListIterator.previousIndex()), alignment));
@@ -677,7 +677,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// prevLM == this
// do nothing
//log.debug(" BLM.getChangedKnuthElements> elementi propri, "
- // + "ignorati, da " + fromIndex + " a " + workListIterator.previousIndex()
+ // + "ignorati, da " + fromIndex + " a " + workListIterator.previousIndex()
// + " su " + prevLM.getClass().getName());
}
fromIndex = workListIterator.previousIndex();
@@ -692,7 +692,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
|| prevLM.mustKeepWithNext()
|| currLM.mustKeepWithPrevious())) {
// add an infinite penalty to forbid a break between blocks
- returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new Position(this), false));
} else if (bSomethingAdded
&& !((KnuthElement) ListUtil.getLast(returnedList))
@@ -707,7 +707,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
BlockLevelLayoutManager currLM = (BlockLevelLayoutManager)
currElement.getLayoutManager();
if (currLM != this) {
- //log.debug(" BLM.getChangedKnuthElements> chiamata da " + fromIndex
+ //log.debug(" BLM.getChangedKnuthElements> chiamata da " + fromIndex
// + " a " + oldList.size() + " su " + currLM.getClass().getName());
returnedList.addAll(currLM.getChangedKnuthElements(
workList.subList(fromIndex, workList.size()), alignment));
@@ -718,7 +718,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
if (!returnedList.isEmpty()) {
ListUtil.removeLast(returnedList);
}
- //log.debug(" BLM.getChangedKnuthElements> elementi propri, ignorati, da "
+ //log.debug(" BLM.getChangedKnuthElements> elementi propri, ignorati, da "
// + fromIndex + " a " + workList.size());
}
}
@@ -747,7 +747,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
}
- //log.debug(" BLM.getChangedKnuthElements> intermedio: returnedList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> intermedio: returnedList.size() = "
// + returnedList.size());
/* estensione: conversione complessiva */
@@ -774,18 +774,18 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
if (bpUnit > 0 || adjustedSpaceAfter != 0) {
if (!spaceAfterIsConditional) {
- returnList.add(new KnuthPenalty(0,
+ returnList.add(new KnuthPenalty(0,
KnuthElement.INFINITE, false,
new NonLeafPosition(this, null), false));
}
if (bpUnit > 0) {
returnList.add(new KnuthGlue(0, 0, 0,
- SPACE_AFTER_ADJUSTMENT,
+ SPACE_AFTER_ADJUSTMENT,
new NonLeafPosition(this, null),
(!spaceAfterIsConditional) ? false : true));
} else {
returnList.add(new KnuthGlue(adjustedSpaceAfter, 0, 0,
- SPACE_AFTER_ADJUSTMENT,
+ SPACE_AFTER_ADJUSTMENT,
new NonLeafPosition(this, null),
(!spaceAfterIsConditional) ? false : true));
}
@@ -795,7 +795,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
}
- //log.debug(" BLM.getChangedKnuthElements> finished: returnList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> finished: returnList.size() = "
// + returnList.size());
return returnList;
}
@@ -807,7 +807,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected int getParentKeepTogetherStrength() {
int strength = KEEP_AUTO;
if (getParent() instanceof BlockLevelLayoutManager) {
- strength = ((BlockLevelLayoutManager)getParent()).getKeepTogetherStrength();
+ strength = ((BlockLevelLayoutManager)getParent()).getKeepTogetherStrength();
} else if (getParent() instanceof InlineLayoutManager) {
if (((InlineLayoutManager) getParent()).mustKeepTogether()) {
strength = KEEP_ALWAYS;
@@ -817,7 +817,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
return strength;
}
-
+
/** {@inheritDoc} */
public boolean mustKeepTogether() {
return getKeepTogetherStrength() > KEEP_AUTO;
@@ -843,7 +843,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
if (borderAndPadding != null) {
if (borderAndPadding.getBorderBeforeWidth(false) > 0) {
context.addPendingBeforeMark(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(
CommonBorderPaddingBackground.BEFORE).getWidth(),
RelSide.BEFORE,
@@ -854,15 +854,15 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
CommonBorderPaddingBackground.BEFORE),
- RelSide.BEFORE,
+ RelSide.BEFORE,
false, false, this));
}
if (borderAndPadding.getBorderAfterWidth(false) > 0) {
context.addPendingAfterMark(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(
CommonBorderPaddingBackground.AFTER).getWidth(),
- RelSide.AFTER,
+ RelSide.AFTER,
false, false, this));
}
if (borderAndPadding.getPaddingAfter(false, this) > 0) {
@@ -870,12 +870,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
CommonBorderPaddingBackground.AFTER),
- RelSide.AFTER,
+ RelSide.AFTER,
false, false, this));
}
}
}
-
+
/** @return the border, padding and background info structure */
private CommonBorderPaddingBackground getBorderPaddingBackground() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -897,7 +897,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return null;
}
}
-
+
/** @return the space-before property */
private SpaceProperty getSpaceBeforeProperty() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -919,7 +919,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return null;
}
}
-
+
/** @return the space-after property */
private SpaceProperty getSpaceAfterProperty() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -941,11 +941,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return null;
}
}
-
+
/**
* Creates Knuth elements for before border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
- * @param isFirst true if this is the first time a layout manager instance needs to generate
+ * @param isFirst true if this is the first time a layout manager instance needs to generate
* border and padding
*/
protected void addKnuthElementsForBorderPaddingBefore(List returnList, boolean isFirst) {
@@ -954,7 +954,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
if (borderAndPadding != null) {
if (borderAndPadding.getBorderBeforeWidth(false) > 0) {
returnList.add(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(CommonBorderPaddingBackground.BEFORE)
.getWidth(),
RelSide.BEFORE, isFirst, false, this));
@@ -963,7 +963,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
returnList.add(new PaddingElement(
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
- CommonBorderPaddingBackground.BEFORE),
+ CommonBorderPaddingBackground.BEFORE),
RelSide.BEFORE, isFirst, false, this));
}
}
@@ -972,7 +972,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
/**
* Creates Knuth elements for after border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
- * @param isLast true if this is the last time a layout manager instance needs to generate
+ * @param isLast true if this is the last time a layout manager instance needs to generate
* border and padding
*/
protected void addKnuthElementsForBorderPaddingAfter(List returnList, boolean isLast) {
@@ -988,7 +988,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
if (borderAndPadding.getBorderAfterWidth(false) > 0) {
returnList.add(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(CommonBorderPaddingBackground.AFTER)
.getWidth(),
RelSide.AFTER, false, isLast, this));
@@ -1002,7 +1002,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* @param context the layout context
* @return true if an element has been added due to a break-before.
*/
- protected boolean addKnuthElementsForBreakBefore(List returnList,
+ protected boolean addKnuthElementsForBreakBefore(List returnList,
LayoutContext context) {
int breakBefore = -1;
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -1017,11 +1017,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
breakBefore = ((org.apache.fop.fo.flow.table.Table) fobj).getBreakBefore();
}
if (breakBefore == EN_PAGE
- || breakBefore == EN_COLUMN
- || breakBefore == EN_EVEN_PAGE
+ || breakBefore == EN_COLUMN
+ || breakBefore == EN_EVEN_PAGE
|| breakBefore == EN_ODD_PAGE) {
// return a penalty element, representing a forced page break
- returnList.add(new BreakElement(getAuxiliaryPosition(),
+ returnList.add(new BreakElement(getAuxiliaryPosition(),
0, -KnuthElement.INFINITE, breakBefore, context));
return true;
} else {
@@ -1035,7 +1035,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* @param context the layout context
* @return true if an element has been added due to a break-after.
*/
- protected boolean addKnuthElementsForBreakAfter(List returnList,
+ protected boolean addKnuthElementsForBreakAfter(List returnList,
LayoutContext context) {
int breakAfter = -1;
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -1054,7 +1054,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
|| breakAfter == EN_EVEN_PAGE
|| breakAfter == EN_ODD_PAGE) {
// add a penalty element, representing a forced page break
- returnList.add(new BreakElement(getAuxiliaryPosition(),
+ returnList.add(new BreakElement(getAuxiliaryPosition(),
0, -KnuthElement.INFINITE, breakAfter, context));
return true;
} else {
@@ -1067,21 +1067,21 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* @param returnList return list to add the additional elements to
* @param alignment vertical alignment
*/
- protected void addKnuthElementsForSpaceBefore(List returnList/*,
+ protected void addKnuthElementsForSpaceBefore(List returnList/*,
Position returnPosition*/, int alignment) {
SpaceProperty spaceBefore = getSpaceBeforeProperty();
// append elements representing space-before
if (spaceBefore != null
- && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
&& spaceBefore.getMaximum(this).getLength().getValue(this) == 0)) {
returnList.add(new SpaceElement(getAuxiliaryPosition(), spaceBefore,
- RelSide.BEFORE,
+ RelSide.BEFORE,
true, false, this));
}
/*
if (bpUnit > 0
|| spaceBefore != null
- && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
&& spaceBefore.getMaximum(this).getLength().getValue(this) == 0)) {
if (spaceBefore != null && !spaceBefore.getSpace().isDiscard()) {
// add elements to prevent the glue to be discarded
@@ -1091,7 +1091,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
if (bpUnit > 0) {
returnList.add(new KnuthGlue(0, 0, 0,
- BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
+ BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
getAuxiliaryPosition(), true));
} else { //if (alignment == EN_JUSTIFY) {
returnList.add(new KnuthGlue(
@@ -1100,11 +1100,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
- spaceBefore.getOptimum(this).getLength().getValue(this),
spaceBefore.getOptimum(this).getLength().getValue(this)
- spaceBefore.getMinimum(this).getLength().getValue(this),
- BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
+ BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
getAuxiliaryPosition(), true));
// } else {
// returnList.add(new KnuthGlue(
-// spaceBefore.getOptimum().getLength().getValue(this),
+// spaceBefore.getOptimum().getLength().getValue(this),
// 0, 0, BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
// returnPosition, true));
}
@@ -1116,28 +1116,28 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* @param returnList return list to add the additional elements to
* @param alignment vertical alignment
*/
- protected void addKnuthElementsForSpaceAfter(List returnList/*, Position returnPosition*/,
+ protected void addKnuthElementsForSpaceAfter(List returnList/*, Position returnPosition*/,
int alignment) {
SpaceProperty spaceAfter = getSpaceAfterProperty();
// append elements representing space-after
if (spaceAfter != null
- && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
&& spaceAfter.getMaximum(this).getLength().getValue(this) == 0)) {
returnList.add(new SpaceElement(getAuxiliaryPosition(), spaceAfter,
- RelSide.AFTER,
+ RelSide.AFTER,
false, true, this));
}
/*
if (bpUnit > 0
|| spaceAfter != null
- && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
&& spaceAfter.getMaximum(this).getLength().getValue(this) == 0)) {
if (spaceAfter != null && !spaceAfter.getSpace().isDiscard()) {
returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE,
false, getAuxiliaryPosition(), false));
}
if (bpUnit > 0) {
- returnList.add(new KnuthGlue(0, 0, 0,
+ returnList.add(new KnuthGlue(0, 0, 0,
BlockLevelLayoutManager.SPACE_AFTER_ADJUSTMENT,
getAuxiliaryPosition(), true));
} else { //if (alignment == EN_JUSTIFY) {
@@ -1162,7 +1162,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
protected List createUnitElements(List oldList) {
- //log.debug("Start conversion: " + oldList.size()
+ //log.debug("Start conversion: " + oldList.size()
// + " elements, space-before.min=" + layoutProps.spaceBefore.getSpace().min
// + " space-after.min=" + layoutProps.spaceAfter.getSpace().min);
// add elements at the beginning and at the end of oldList
@@ -1192,15 +1192,15 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
KnuthElement element = (KnuthElement) oldListIterator.next();
if (element.isBox()) {
totalLength.add(new MinOptMax(element.getW()));
- //log.debug("box " + element.getW());
+ //log.debug("box " + element.getW());
} else if (element.isGlue()) {
totalLength.min -= ((KnuthGlue) element).getZ();
totalLength.max += ((KnuthGlue) element).getY();
//leafValue = ((LeafPosition) element.getPosition()).getLeafPos();
- //log.debug("glue " + element.getW() + " + "
+ //log.debug("glue " + element.getW() + " + "
// + ((KnuthGlue) element).getY() + " - " + ((KnuthGlue) element).getZ());
} else {
- //log.debug((((KnuthPenalty)element).getP() == KnuthElement.INFINITE
+ //log.debug((((KnuthPenalty)element).getP() == KnuthElement.INFINITE
// ? "PENALTY " : "penalty ") + element.getW());
}
}
@@ -1294,12 +1294,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
int uNewShrink = (unitsBeforeBreak.opt - unitsBeforeBreak.min)
- (unsuppressibleUnits.opt - unsuppressibleUnits.min);
- //log.debug("("
- // + unsuppressibleUnits.min + "-" + unsuppressibleUnits.opt + "-"
+ //log.debug("("
+ // + unsuppressibleUnits.min + "-" + unsuppressibleUnits.opt + "-"
// + unsuppressibleUnits.max + ") "
- // + " -> " + unitsBeforeBreak.min + "-" + unitsBeforeBreak.opt + "-"
+ // + " -> " + unitsBeforeBreak.min + "-" + unitsBeforeBreak.opt + "-"
// + unitsBeforeBreak.max
- // + " + " + unitsAfterBreak.min + "-" + unitsAfterBreak.opt + "-"
+ // + " + " + unitsAfterBreak.min + "-" + unitsAfterBreak.opt + "-"
// + unitsAfterBreak.max
// + (uLengthChange != 0 ? " [length " + uLengthChange + "] " : "")
// + (uStretchChange != 0 ? " [stretch " + uStretchChange + "] " : "")
@@ -1332,9 +1332,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// new infinite penalty, glue and box, if necessary
if (uNewStretch - uStretchChange > 0
|| uNewShrink - uShrinkChange > 0) {
- int iStretchUnits = (uNewStretch - uStretchChange > 0
+ int iStretchUnits = (uNewStretch - uStretchChange > 0
? (uNewStretch - uStretchChange) : 0);
- int iShrinkUnits = (uNewShrink - uShrinkChange > 0
+ int iShrinkUnits = (uNewShrink - uShrinkChange > 0
? (uNewShrink - uShrinkChange) : 0);
newList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
mappingPos,
@@ -1381,7 +1381,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
//log.debug(" PENALTY");
//log.debug(" glue 0 " + uStretchChange + " " + uShrinkChange);
//log.debug(" penalty " + uLengthChange + " * unit");
- //log.debug(" glue 0 " + (- uStretchChange) + " "
+ //log.debug(" glue 0 " + (- uStretchChange) + " "
// + (- uShrinkChange));
} else if (oldListIterator.hasNext()) {
// new penalty
@@ -1483,11 +1483,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
StackingIter(Iterator parentIter) {
super(parentIter);
}
-
+
protected LayoutManager getLM(Object nextObj) {
return ((Position) nextObj).getLM();
}
-
+
protected Position getPos(Object nextObj) {
return ((Position) nextObj);
}
@@ -1496,24 +1496,24 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected static class MappingPosition extends Position {
private int iFirstIndex;
private int iLastIndex;
-
+
public MappingPosition(LayoutManager lm, int first, int last) {
super(lm);
iFirstIndex = first;
iLastIndex = last;
}
-
+
public int getFirstIndex() {
return iFirstIndex;
}
-
+
public int getLastIndex() {
return iLastIndex;
}
}
/**
- * "wrap" the Position inside each element moving the elements from
+ * "wrap" the Position inside each element moving the elements from
* SourceList to targetList
* @param sourceList source list
* @param targetList target list receiving the wrapped position elements
@@ -1521,16 +1521,16 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected void wrapPositionElements(List sourceList, List targetList) {
wrapPositionElements(sourceList, targetList, false);
}
-
+
/**
- * "wrap" the Position inside each element moving the elements from
+ * "wrap" the Position inside each element moving the elements from
* SourceList to targetList
* @param sourceList source list
* @param targetList target list receiving the wrapped position elements
* @param force if true, every Position is wrapped regardless of its LM of origin
*/
protected void wrapPositionElements(List sourceList, List targetList, boolean force) {
-
+
ListIterator listIter = sourceList.listIterator();
Object tempElement;
while (listIter.hasNext()) {
@@ -1542,7 +1542,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
force);
} else if (tempElement instanceof List) {
wrapPositionElements(
- (List) tempElement,
+ (List) tempElement,
targetList,
force);
}
@@ -1563,12 +1563,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
targetList.add(el);
}
-
+
/** @return the sum of start-indent and end-indent */
protected int getIPIndents() {
return startIndent + endIndent;
}
-
+
/**
* Returns the IPD of the content area
* @return the IPD of the content area
@@ -1576,7 +1576,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
public int getContentAreaIPD() {
return contentAreaIPD;
}
-
+
/**
* Sets the IPD of the content area
* @param contentAreaIPD the IPD of the content area
@@ -1584,7 +1584,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected void setContentAreaIPD(int contentAreaIPD) {
this.contentAreaIPD = contentAreaIPD;
}
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
@@ -1592,6 +1592,6 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
public int getContentAreaBPD() {
return -1;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BorderElement.java b/src/java/org/apache/fop/layoutmgr/BorderElement.java
index 410ba7ebb..67026a4c0 100644
--- a/src/java/org/apache/fop/layoutmgr/BorderElement.java
+++ b/src/java/org/apache/fop/layoutmgr/BorderElement.java
@@ -42,7 +42,7 @@ public class BorderElement extends BorderOrPaddingElement {
boolean isFirst, boolean isLast, PercentBaseContext context) {
super(position, condLength, side, isFirst, isLast, context);
}
-
+
/** {@inheritDoc} */
public void notifyLayoutManager(MinOptMax effectiveLength) {
LayoutManager lm = getOriginatingLayoutManager();
@@ -54,7 +54,7 @@ public class BorderElement extends BorderOrPaddingElement {
+ lm.getClass().getName());
}
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer("Border[");
@@ -62,5 +62,5 @@ public class BorderElement extends BorderOrPaddingElement {
sb.append("]");
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java b/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java
index d78a92610..28820224a 100644
--- a/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java
+++ b/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java
@@ -41,11 +41,11 @@ public abstract class BorderOrPaddingElement extends UnresolvedListElementWithLe
RelSide side,
boolean isFirst, boolean isLast, PercentBaseContext context) {
super(position,
- new MinOptMax(condLength.getLength().getValue(context)), side,
+ new MinOptMax(condLength.getLength().getValue(context)), side,
condLength.isDiscard(), isFirst, isLast);
}
-
+
/** {@inheritDoc} */
public abstract void notifyLayoutManager(MinOptMax effectiveLength);
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BreakElement.java b/src/java/org/apache/fop/layoutmgr/BreakElement.java
index 3ccfbf616..98e31dbf8 100644
--- a/src/java/org/apache/fop/layoutmgr/BreakElement.java
+++ b/src/java/org/apache/fop/layoutmgr/BreakElement.java
@@ -33,7 +33,7 @@ public class BreakElement extends UnresolvedListElement {
private int breakClass = -1;
private List pendingBeforeMarks;
private List pendingAfterMarks;
-
+
/**
* Main constructor
* @param position the Position instance needed by the addAreas stage of the LMs.
@@ -43,10 +43,10 @@ public class BreakElement extends UnresolvedListElement {
public BreakElement(Position position, int penaltyValue, LayoutContext context) {
this(position, 0, penaltyValue, -1, context);
}
-
+
/**
* Constructor for hard breaks.
- *
+ *
* @param position the Position instance needed by the addAreas stage of the LMs.
* @param penaltyWidth the penalty width
* @param penaltyValue the penalty value for the penalty element to be constructed
@@ -55,7 +55,7 @@ public class BreakElement extends UnresolvedListElement {
* {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE})
* @param context the layout context which contains the pending conditional elements
*/
- public BreakElement(Position position, int penaltyWidth, int penaltyValue,
+ public BreakElement(Position position, int penaltyWidth, int penaltyValue,
int breakClass, LayoutContext context) {
super(position);
this.penaltyWidth = penaltyWidth;
@@ -64,7 +64,7 @@ public class BreakElement extends UnresolvedListElement {
this.pendingBeforeMarks = context.getPendingBeforeMarks();
this.pendingAfterMarks = context.getPendingAfterMarks();
}
-
+
/** {@inheritDoc} */
public boolean isConditional() {
return false; //Does not really apply here
@@ -80,12 +80,12 @@ public class BreakElement extends UnresolvedListElement {
public int getPenaltyWidth() {
return this.penaltyWidth;
}
-
+
/** @return the penalty value */
public int getPenaltyValue() {
return this.penaltyValue;
}
-
+
/**
* Sets the penalty value.
* @param p the new penalty value
@@ -93,15 +93,15 @@ public class BreakElement extends UnresolvedListElement {
public void setPenaltyValue(int p) {
this.penaltyValue = p;
}
-
+
/** {@inheritDoc} */
public boolean isForcedBreak() {
return penaltyValue == -KnuthElement.INFINITE;
}
-
+
/**
* Returns the break class of this penalty.
- *
+ *
* @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
* {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE},
* {@link Constants#EN_ODD_PAGE}
@@ -109,10 +109,10 @@ public class BreakElement extends UnresolvedListElement {
public int getBreakClass() {
return breakClass;
}
-
+
/**
* Sets the break class.
- *
+ *
* @param breakClass one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
* {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE},
* {@link Constants#EN_ODD_PAGE}
@@ -120,17 +120,17 @@ public class BreakElement extends UnresolvedListElement {
public void setBreakClass(int breakClass) {
this.breakClass = breakClass;
}
-
+
/** @return the pending border and padding elements at the before edge */
public List getPendingBeforeMarks() {
return this.pendingBeforeMarks;
}
-
+
/** @return the pending border and padding elements at the after edge */
public List getPendingAfterMarks() {
return this.pendingAfterMarks;
}
-
+
/**
* Clears all pending marks associated with this break element. This is used in break
* cases where we only know very late if the break is actually after all the content
@@ -140,7 +140,7 @@ public class BreakElement extends UnresolvedListElement {
this.pendingBeforeMarks = null;
this.pendingAfterMarks = null;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java
index df4bb1d47..0bf228e7e 100644
--- a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java
+++ b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,24 +26,24 @@ import org.apache.fop.fo.FONode;
/**
* The set of nodes is sorted into lines indexed into activeLines.
- * The nodes in each line are linked together in a single linked list by the
+ * The nodes in each line are linked together in a single linked list by the
* KnuthNode.next field. The activeLines array contains a link to the head of
* the linked list in index 'line*2' and a link to the tail at index 'line*2+1'.
*
* for (int line = startLine; line < endLine; line++) {
* for (KnuthNode node = getNode(line); node != null; node = node.next) {
* // Do something with 'node'
* }
* }
- *
+ *
*/
public abstract class BreakingAlgorithm {
/** the logger for the class */
protected static Log log = LogFactory.getLog(BreakingAlgorithm.class);
-
+
/** Maximum adjustment ration */
protected static final int INFINITE_RATIO = 1000;
@@ -79,7 +79,7 @@ public abstract class BreakingAlgorithm {
* The paragraph of KnuthElements.
*/
protected KnuthSequence par;
-
+
/**
* The width of a line (or height of a column in page-breaking mode).
* -1 indicates that the line widths are different for each line.
@@ -118,12 +118,12 @@ public abstract class BreakingAlgorithm {
* line number l corresponds to the number of the line ending at the node's breakpoint.
*/
protected KnuthNode[] activeLines;
-
+
/**
* The number of active nodes.
*/
protected int activeNodeCount;
-
+
/**
* The lowest available line in the set of active nodes.
*/
@@ -218,7 +218,7 @@ public abstract class BreakingAlgorithm {
/** best node for the preceding breakpoint */
public KnuthNode previous;
- /** next possible node in the same line */
+ /** next possible node in the same line */
public KnuthNode next;
/**
@@ -226,7 +226,7 @@ public abstract class BreakingAlgorithm {
* into a line.
*/
public int fitRecoveryCounter = 0;
-
+
public KnuthNode(int position, int line, int fitness,
int totalWidth, int totalStretch, int totalShrink,
double adjustRatio, int availableShrink, int availableStretch,
@@ -249,7 +249,7 @@ public abstract class BreakingAlgorithm {
return "
*
* @param activeNode
* @param difference
@@ -895,11 +895,11 @@ public abstract class BreakingAlgorithm {
return 0;
}
}
-
+
/**
* Figure out the fitness class of this line (tight, loose,
* very tight or very loose).
- * See the section on "More Bells and Whistles" in Knuth's
+ * See the section on "More Bells and Whistles" in Knuth's
* "Breaking Paragraphs Into Lines".
* @param r
* @return the fitness class
@@ -923,11 +923,11 @@ public abstract class BreakingAlgorithm {
* node and ending at the given element.
* @param activeNode considered preceding line break
* @param element considered current line break
- * @param fitnessClass fitness of the current line
+ * @param fitnessClass fitness of the current line
* @param r adjustment ratio for the current line
* @return the demerit of the current line
*/
- protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
+ protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
int fitnessClass, double r) {
double demerits = 0;
// compute demerits
@@ -942,14 +942,14 @@ public abstract class BreakingAlgorithm {
} else {
demerits = f * f;
}
-
+
if (element.isPenalty() && ((KnuthPenalty) element).isFlagged()
&& getElement(activeNode.position).isPenalty()
&& ((KnuthPenalty) getElement(activeNode.position)).isFlagged()) {
// add demerit for consecutive breaks at flagged penalties
demerits += repeatedFlaggedDemerit;
// there are at least two consecutive lines ending with a flagged penalty;
- // check if the previous line end with a flagged penalty too,
+ // check if the previous line end with a flagged penalty too,
// and if this situation is allowed
int flaggedPenaltiesCount = 2;
for (KnuthNode prevNode = activeNode.previous;
@@ -1084,18 +1084,18 @@ public abstract class BreakingAlgorithm {
*/
protected int getLineWidth(int line) {
if (this.lineWidth < 0) {
- throw new IllegalStateException("lineWidth must be set"
+ throw new IllegalStateException("lineWidth must be set"
+ (this.lineWidth != 0 ? " and positive, but it is: " + this.lineWidth : ""));
} else {
return this.lineWidth;
}
}
-
+
/** @return the constant line/part width or -1 if there is no such value */
protected int getLineWidth() {
return this.lineWidth;
}
-
+
/**
* Creates a string representation of the active nodes. Used for debugging.
* @param prepend a string to prepend on each entry
@@ -1130,7 +1130,7 @@ public abstract class BreakingAlgorithm {
bestActiveNode = bestActiveNode.previous;
}
}
-
+
/** @return the alignment for normal lines/parts */
public int getAlignment() {
return this.alignment;
diff --git a/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java b/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java
index 50fdc54b0..9124cf997 100644
--- a/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java
+++ b/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java
@@ -49,5 +49,5 @@ public interface ConditionalElementListener {
* (null means zero length)
*/
void notifyPadding(RelSide side, MinOptMax effectiveLength);
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/ElementListObserver.java b/src/java/org/apache/fop/layoutmgr/ElementListObserver.java
index d4f23b1ee..73a6d5be4 100644
--- a/src/java/org/apache/fop/layoutmgr/ElementListObserver.java
+++ b/src/java/org/apache/fop/layoutmgr/ElementListObserver.java
@@ -28,9 +28,9 @@ import java.util.List;
* Please see the subclass within the test code.
*/
public class ElementListObserver {
-
+
private static List activeObservers = null;
-
+
/**
* Adds a new Observer to the list.
* @param observer the observer implementation
@@ -41,7 +41,7 @@ public class ElementListObserver {
}
activeObservers.add(observer);
}
-
+
/**
* Removes an Observer from the list. This call simply returns if the observer was not on
* the list and does nothing.
@@ -52,7 +52,7 @@ public class ElementListObserver {
activeObservers.remove(observer);
}
}
-
+
/**
* Notifies all registered observers about the element list.
* @param elementList the Knuth element list
@@ -70,7 +70,7 @@ public class ElementListObserver {
}
}
}
-
+
/** @return true if observation is active, i.e. Observers are registered. */
public static boolean isObservationActive() {
return activeObservers != null;
@@ -80,7 +80,7 @@ public class ElementListObserver {
* Implement this interface to receive notifications on element lists.
*/
public interface Observer {
-
+
/**
* Notifies the observer about the element list.
* @param elementList the Knuth element list
@@ -89,7 +89,7 @@ public class ElementListObserver {
* @param id ID for the element list (may be null)
*/
void observe(List elementList, String category, String id);
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/ElementListUtils.java b/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
index c04d197e4..d7f854a42 100644
--- a/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
+++ b/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
@@ -29,14 +29,14 @@ import org.apache.fop.util.ListUtil;
* Utilities for Knuth element lists.
*/
public final class ElementListUtils {
-
+
private ElementListUtils() {
// Utility class.
}
/**
* Removes legal breaks in an element list. A constraint can be specified to limit the
- * range in which the breaks are removed. Legal breaks occuring before at least
+ * range in which the breaks are removed. Legal breaks occuring before at least
* constraint.opt space is filled will be removed.
* @param elements the element list
* @param constraint min/opt/max value to restrict the range in which the breaks are removed.
@@ -48,7 +48,7 @@ public final class ElementListUtils {
/**
* Removes legal breaks in an element list. A constraint can be specified to limit the
- * range in which the breaks are removed. Legal breaks occuring before at least
+ * range in which the breaks are removed. Legal breaks occuring before at least
* constraint space is filled will be removed.
* @param elements the element list
* @param constraint value to restrict the range in which the breaks are removed.
diff --git a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
index 086d91c31..4dcb5e14c 100644
--- a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
@@ -61,8 +61,8 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
private static Log log = LogFactory.getLog(ExternalDocumentLayoutManager.class);
- private ImageLayout imageLayout;
-
+ private ImageLayout imageLayout;
+
/**
* Constructor
*
@@ -74,7 +74,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
}
/**
- * @return the ExternalDocument being managed by this layout manager
+ * @return the ExternalDocument being managed by this layout manager
*/
protected ExternalDocument getExternalDocument() {
return (ExternalDocument)pageSeq;
@@ -84,24 +84,24 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
public PageSequenceLayoutManager getPSLM() {
throw new IllegalStateException("getPSLM() is illegal for " + getClass().getName());
}
-
+
/** {@inheritDoc} */
public void activateLayout() {
initialize();
FOUserAgent userAgent = pageSeq.getUserAgent();
ImageManager imageManager = userAgent.getFactory().getImageManager();
-
+
String uri = getExternalDocument().getSrc();
Integer firstPageIndex = ImageUtil.getPageIndexFromURI(uri);
boolean hasPageIndex = (firstPageIndex != null);
-
+
try {
ImageInfo info = imageManager.getImageInfo(uri, userAgent.getImageSessionContext());
-
+
Object moreImages = info.getCustomObjects().get(ImageInfo.HAS_MORE_IMAGES);
boolean hasMoreImages = moreImages != null && !Boolean.FALSE.equals(moreImages);
-
+
Dimension intrinsicSize = info.getSize().getDimensionMpt();
ImageLayout layout = new ImageLayout(getExternalDocument(), this, intrinsicSize);
@@ -111,7 +111,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
}
makePageForImage(info, layout);
-
+
if (!hasPageIndex && hasMoreImages) {
if (log.isTraceEnabled()) {
log.trace("Starting multi-page processing...");
@@ -129,16 +129,16 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
}
ImageInfo subinfo = imageManager.getImageInfo(
tempURI.toASCIIString(), userAgent.getImageSessionContext());
-
+
moreImages = subinfo.getCustomObjects().get(ImageInfo.HAS_MORE_IMAGES);
hasMoreImages = moreImages != null && !Boolean.FALSE.equals(moreImages);
-
+
intrinsicSize = subinfo.getSize().getDimensionMpt();
layout = new ImageLayout(
getExternalDocument(), this, intrinsicSize);
-
+
makePageForImage(subinfo, layout);
-
+
pageIndex++;
}
} catch (URISyntaxException e) {
@@ -170,15 +170,15 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
fillPage(info.getOriginalURI());
finishPage();
}
-
+
private void fillPage(String uri) {
Dimension imageSize = this.imageLayout.getViewportSize();
-
+
Block blockArea = new Block();
blockArea.setIPD(imageSize.width);
LineArea lineArea = new LineArea();
-
+
Image imageArea = new Image(uri);
TraitSetter.setProducerID(imageArea, fobj.getId());
transferForeignAttributes(imageArea);
@@ -189,7 +189,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
vp.setBPD(imageSize.height);
vp.setContentPosition(imageLayout.getPlacement());
vp.setOffset(0);
-
+
//Link them all together...
lineArea.addInlineArea(vp);
lineArea.updateExtentsFromChildren();
@@ -197,7 +197,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
curPage.getPageViewport().getCurrentFlow().addBlock(blockArea);
curPage.getPageViewport().getCurrentSpan().notifyFlowsFinished();
}
-
+
/** {@inheritDoc} */
public void finishPageSequence() {
if (pageSeq.hasId()) {
@@ -208,7 +208,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
(currentPageNum - startPageNum) + 1);
areaTreeHandler.notifyPageSequenceFinished(pageSeq,
(currentPageNum - startPageNum) + 1);
-
+
if (log.isDebugEnabled()) {
log.debug("Ending layout");
}
@@ -217,9 +217,9 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
/** {@inheritDoc} */
protected Page createPage(int pageNumber, boolean isBlank) {
String pageNumberString = pageSeq.makeFormattedPageNumber(pageNumber);
-
+
Dimension imageSize = this.imageLayout.getViewportSize();
-
+
// Set up the CTM on the page reference area based on writing-mode
// and reference-orientation
Rectangle referenceRect;
@@ -231,10 +231,10 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
FODimension reldims = new FODimension(0, 0);
CTM pageCTM = CTM.getCTMandRelDims(pageSeq.getReferenceOrientation(),
Constants.EN_LR_TB, referenceRect, reldims);
-
+
Page page = new Page(referenceRect, pageNumber, pageNumberString, isBlank);
-
- PageViewport pv = page.getPageViewport();
+
+ PageViewport pv = page.getPageViewport();
org.apache.fop.area.Page pageArea = new org.apache.fop.area.Page();
pv.setPage(pageArea);
@@ -242,8 +242,8 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
rv.setIPD(referenceRect.width);
rv.setBPD(referenceRect.height);
rv.setClip(true);
-
- BodyRegion body = new BodyRegion(Constants.FO_REGION_BODY,
+
+ BodyRegion body = new BodyRegion(Constants.FO_REGION_BODY,
"fop-image-region", rv, 1, 0);
body.setIPD(imageSize.width);
body.setBPD(imageSize.height);
@@ -256,7 +256,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
//Also creates first normal flow region
pv.createSpan(false);
-
+
return page;
}
diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
index 1c8fb679f..293d6dbe0 100644
--- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,12 +46,12 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
* logging instance
*/
private static Log log = LogFactory.getLog(FlowLayoutManager.class);
-
+
/** Array of areas currently being filled stored by area class */
private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
private int currentSpan = EN_NONE;
-
+
/**
* This is the top level layout manager.
* It is created by the PageSequence FO.
@@ -96,7 +96,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
SpaceResolver.resolveElementList(returnList);
return returnList;
}
-
+
// Set up a LayoutContext
//MinOptMax bpd = context.getStackLimit();
@@ -104,7 +104,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(context.getRefIPD());
childLC.setWritingMode(getCurrentPage().getSimplePageMaster().getWritingMode());
-
+
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
//log.debug("FLM.getNextKnuthElements> returnedList.size() = " + returnedList.size());
@@ -148,7 +148,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
//Propagate and clear
context.updateKeepWithNextPending(childLC.getKeepWithNextPending());
childLC.clearKeepWithNextPending();
-
+
context.updateKeepWithNextPending(getKeepWithNextStrength());
}
@@ -201,7 +201,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
public int getKeepTogetherStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
@@ -211,7 +211,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public List getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/ int alignment) {
ListIterator oldListIterator = oldList.listIterator();
@@ -255,7 +255,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
if (prevLM.mustKeepWithNext()
|| currLM.mustKeepWithPrevious()) {
// add an infinite penalty to forbid a break between blocks
- returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new Position(this), false));
} else if (!((KnuthElement) returnedList.get(returnedList
.size() - 1)).isGlue()) {
@@ -288,7 +288,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) {
AreaAdditionUtil.addAreas(this, parentIter, layoutContext);
@@ -299,7 +299,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
* Add child area to a the correct container, depending on its
* area class. A Flow can fill at most one area container of any class
* at any one time. The actual work is done by BlockStackingLM.
- *
+ *
* @param childArea the area to add
*/
public void addChildArea(Area childArea) {
@@ -314,7 +314,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
public Area getParentArea(Area childArea) {
BlockParent parentArea = null;
int aclass = childArea.getAreaClass();
-
+
if (aclass == Area.CLASS_NORMAL) {
parentArea = getCurrentPV().getCurrentFlow();
} else if (aclass == Area.CLASS_BEFORE_FLOAT) {
@@ -325,7 +325,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
throw new IllegalStateException("(internal error) Invalid "
+ "area class (" + aclass + ") requested.");
}
-
+
this.currentAreas[aclass] = parentArea;
setCurrentArea(parentArea);
return parentArea;
@@ -338,7 +338,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
public int getContentAreaIPD() {
return getCurrentPV().getCurrentSpan().getColumnWidth();
}
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
diff --git a/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
index 34b931c03..791008aec 100644
--- a/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -95,7 +95,7 @@ public class FootnoteBodyLayoutManager extends BlockStackingLayoutManager {
public int getKeepTogetherStrength() {
return getParentKeepTogetherStrength();
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
@@ -105,5 +105,5 @@ public class FootnoteBodyLayoutManager extends BlockStackingLayoutManager {
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
index e9973c14f..6d11a3c24 100644
--- a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
+++ b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
@@ -35,12 +35,12 @@ public class InlineKnuthSequence extends KnuthSequence {
private boolean isClosed = false;
/**
- * Creates a new and empty list.
+ * Creates a new and empty list.
*/
public InlineKnuthSequence() {
super();
}
-
+
/**
* Creates a new list from an existing list.
* @param list The list from which to create the new list.
@@ -84,14 +84,14 @@ public class InlineKnuthSequence extends KnuthSequence {
}
/* (non-Javadoc)
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public boolean appendSequence(KnuthSequence sequence, boolean keepTogether,
BreakElement breakElement) {
return appendSequence(sequence);
}
-
+
/* (non-Javadoc)
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/layoutmgr/KeepUtil.java b/src/java/org/apache/fop/layoutmgr/KeepUtil.java
index 8c80a1b10..5cc33533f 100644
--- a/src/java/org/apache/fop/layoutmgr/KeepUtil.java
+++ b/src/java/org/apache/fop/layoutmgr/KeepUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,7 +46,7 @@ public class KeepUtil {
return keep.getNumber().intValue();
}
}
-
+
/**
* Returns the combined block-level keep strength from a keep property.
*
@@ -90,7 +90,7 @@ public class KeepUtil {
}
return penalty;
}
-
+
/**
* Returns a string representation of a keep strength value.
* @param keepStrength the keep strength
@@ -105,5 +105,5 @@ public class KeepUtil {
return Integer.toString(keepStrength);
}
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java b/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java
index 364c896ad..1aa22ea3e 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ import org.apache.fop.traits.MinOptMax;
* Knuth box used to represent a line in block-progression-dimension (i.e. the width is its height).
*/
public class KnuthBlockBox extends KnuthBox {
-
+
private MinOptMax ipdRange;
/**
* Natural width of the line represented by this box. In addition to ipdRange because
@@ -58,7 +58,7 @@ public class KnuthBlockBox extends KnuthBox {
* Creates a new box.
* @param w block progression dimension of this box
* @param list footnotes cited by elements in this box. The list contains the
- * corresponding FootnoteBodyLayoutManagers
+ * corresponding FootnoteBodyLayoutManagers
* @param pos the Position stored in this box
* @param bAux is this box auxiliary?
*/
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthBox.java b/src/java/org/apache/fop/layoutmgr/KnuthBox.java
index a465ca8da..7c3df61fa 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthBox.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthBox.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,11 +23,11 @@ package org.apache.fop.layoutmgr;
* An instance of this class represents an unbreakable piece of content with
* fixed width: for example an image, a syllable (but only if letter spacing
* is constant), ...
- *
+ *
* A KnuthBox is never a feasible breaking point.
- *
+ *
* The represented piece of content is never suppressed.
- *
+ *
* Besides the inherited methods and attributes, this class has some more
* attributes to store information about the content height and its vertical
* positioning, and the methods used to get them.
@@ -61,5 +61,5 @@ public class KnuthBox extends KnuthElement {
sb.append(getW());
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthElement.java b/src/java/org/apache/fop/layoutmgr/KnuthElement.java
index 71f3b3ce9..41c813010 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthElement.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthElement.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,7 +21,7 @@ package org.apache.fop.layoutmgr;
/**
* This is the super class for KnuthBox, KnuthGlue and KnuthPenalty.
- *
+ *
* It stores information common to all sub classes, and the methods to get it:
* the width, a Position and a boolean marking KnuthElements used for some
* special feature (for example, the additional elements used to represent
@@ -59,21 +59,21 @@ public abstract class KnuthElement extends ListElement {
return width;
}
- /** @return the penalty value of this element, if applicable. */
+ /** @return the penalty value of this element, if applicable. */
public int getP() {
throw new RuntimeException("Element is not a penalty");
}
- /** @return the stretch value of this element, if applicable. */
+ /** @return the stretch value of this element, if applicable. */
public int getY() {
throw new RuntimeException("Element is not a glue");
}
- /** @return the shrink value of this element, if applicable. */
+ /** @return the shrink value of this element, if applicable. */
public int getZ() {
throw new RuntimeException("Element is not a glue");
}
-
+
/** {@inheritDoc} */
public boolean isUnresolvedElement() {
return false;
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthGlue.java b/src/java/org/apache/fop/layoutmgr/KnuthGlue.java
index 0b6706c4b..fbb291f6b 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthGlue.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthGlue.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,16 +20,16 @@
package org.apache.fop.layoutmgr;
/**
- * An instance of this class represents a piece of content with adjustable
+ * An instance of this class represents a piece of content with adjustable
* width: for example a space between words of justified text.
- *
+ *
* A KnuthGlue is a feasible breaking point only if it immediately follows
* a KnuthBox.
- *
+ *
* The represented piece of content is suppressed if either the KnuthGlue
* is a chosen breaking point or there isn't any KnuthBox between the
* previous breaking point and the KnuthGlue itself.
- *
+ *
* So, an unsuppressible piece of content with adjustable width, for example
* a leader or a word with adjustable letter space, cannot be represented
* by a single KnuthGlue; it can be represented using the sequence:
@@ -39,14 +39,14 @@ package org.apache.fop.layoutmgr;
* KnuthBox(width = 0)
* where the infinity penalty avoids choosing the KnuthGlue as a breaking point
* and the 0-width KnuthBoxes prevent suppression.
- *
+ *
* Besides the inherited methods and attributes, this class has two attributes
* used to store the stretchability (difference between max and opt width) and
* the shrinkability (difference between opt and min width), and the methods
* to get these values.
*/
public class KnuthGlue extends KnuthElement {
-
+
private int stretchability;
private int shrinkability;
private int adjustmentClass = -1;
@@ -88,12 +88,12 @@ public class KnuthGlue extends KnuthElement {
public int getZ() {
return shrinkability;
}
-
+
/** @return the adjustment class (or role) of this glue. */
public int getAdjustmentClass() {
return adjustmentClass;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer(64);
@@ -109,5 +109,5 @@ public class KnuthGlue extends KnuthElement {
}
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
index ecaeac627..6c13fba8a 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,15 +24,15 @@ import org.apache.fop.fo.Constants;
/**
* An instance of this class represents information about a feasible
* breaking point; it does not represent any piece of content.
- *
+ *
* A KnuthPenalty is a feasible breaking point unless its value is infinity;
* a KnuthPenalty whose value is -infinity represents a forced break.
- *
+ *
* A KnuthPenalty is suppressed, and its width is ignored, if it is not a
* chosen breaking point; for example, a KnuthPenalty representing a
* hyphenation point has a width (the "-" width), which must be ignored if
* that point is not chosen as a breaking point.
- *
+ *
* Besides the inherited methods and attributes, this class has two more
* attributes and the methods used to get them: the penalty value, which is
* a kind of "aesthetic cost" (the higher the value, the more unsightly the
@@ -45,7 +45,7 @@ public class KnuthPenalty extends KnuthElement {
public static final int FLAGGED_PENALTY = 50;
private int penalty;
- private boolean bFlagged;
+ private boolean bFlagged;
private int breakClass = -1;
/**
@@ -65,7 +65,7 @@ public class KnuthPenalty extends KnuthElement {
/**
* Create a new KnuthPenalty.
- *
+ *
* @param w the width of this penalty
* @param p the penalty value of this penalty
* @param f is this penalty flagged?
@@ -102,7 +102,7 @@ public class KnuthPenalty extends KnuthElement {
public void setP(int p) {
this.penalty = p;
}
-
+
/** @return true is this penalty is a flagged one. */
public boolean isFlagged() {
return bFlagged;
@@ -112,7 +112,7 @@ public class KnuthPenalty extends KnuthElement {
public boolean isForcedBreak() {
return penalty == -KnuthElement.INFINITE;
}
-
+
/**
* @return the break class of this penalty (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE,
* EN_ODD_PAGE)
@@ -120,7 +120,7 @@ public class KnuthPenalty extends KnuthElement {
public int getBreakClass() {
return breakClass;
}
-
+
/**
* Sets the break class for this penalty.
* @param cl the break class (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE, EN_ODD_PAGE)
@@ -128,7 +128,7 @@ public class KnuthPenalty extends KnuthElement {
public void setBreakClass(int cl) {
this.breakClass = cl;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer(64);
@@ -171,5 +171,5 @@ public class KnuthPenalty extends KnuthElement {
}
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java b/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java
index 3f334f4be..e7397babb 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,7 +35,7 @@ public class KnuthPossPosIter extends PositionIterator {
super(elementList.listIterator(startPos));
iterCount = endPos - startPos;
}
-
+
/**
* Auxiliary constructor
* @param elementList List of Knuth elements
@@ -45,7 +45,7 @@ public class KnuthPossPosIter extends PositionIterator {
}
// Check position < endPos
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthSequence.java b/src/java/org/apache/fop/layoutmgr/KnuthSequence.java
index 4467a397b..fe9a01498 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthSequence.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthSequence.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,7 +27,7 @@ import java.util.ListIterator;
* Represents a list of Knuth elements.
*/
/**
- *
+ *
*/
public abstract class KnuthSequence extends ArrayList {
/**
@@ -68,19 +68,19 @@ public abstract class KnuthSequence extends ArrayList {
* Append sequence to this sequence if it can be appended.
* @param sequence The sequence that is to be appended.
* @param keepTogether Whether the two sequences must be kept together.
- * @param breakElement The BreakElement that may be inserted between the two sequences.
+ * @param breakElement The BreakElement that may be inserted between the two sequences.
* @return whether the sequence was succesfully appended to this sequence.
*/
public abstract boolean appendSequence(KnuthSequence sequence, boolean keepTogether,
BreakElement breakElement);
-
+
/**
* Append sequence to this sequence if it can be appended.
* @param sequence The sequence that is to be appended.
* @return whether the sequence was succesfully appended to this sequence.
*/
public abstract boolean appendSequence(KnuthSequence sequence);
-
+
/**
* Append sequence to this sequence if it can be appended.
* If that is not possible, close this sequence.
@@ -95,13 +95,13 @@ public abstract class KnuthSequence extends ArrayList {
return true;
}
}
-
+
/**
* Append sequence to this sequence if it can be appended.
* If that is not possible, close this sequence.
* @param sequence The sequence that is to be appended.
* @param keepTogether Whether the two sequences must be kept together.
- * @param breakElement The BreakElement that may be inserted between the two sequences.
+ * @param breakElement The BreakElement that may be inserted between the two sequences.
* @return whether the sequence was succesfully appended to this sequence.
*/
public boolean appendSequenceOrClose(KnuthSequence sequence, boolean keepTogether,
@@ -113,7 +113,7 @@ public abstract class KnuthSequence extends ArrayList {
return true;
}
}
-
+
/**
* Wrap the Positions of the elements of this sequence in a Position for LayoutManager lm.
* @param lm The LayoutManager for the Positions that will be created.
@@ -127,14 +127,14 @@ public abstract class KnuthSequence extends ArrayList {
(lm.notifyPos(new NonLeafPosition(lm, element.getPosition())));
}
}
-
+
/**
* @return the last element of this sequence.
*/
public ListElement getLast() {
int idx = size();
if (idx == 0) {
- return null;
+ return null;
}
return (ListElement) get(idx - 1);
}
@@ -146,7 +146,7 @@ public abstract class KnuthSequence extends ArrayList {
public ListElement removeLast() {
int idx = size();
if (idx == 0) {
- return null;
+ return null;
}
return (ListElement) remove(idx - 1);
}
diff --git a/src/java/org/apache/fop/layoutmgr/LMiter.java b/src/java/org/apache/fop/layoutmgr/LMiter.java
index 9e812a8b7..4fa5590dc 100644
--- a/src/java/org/apache/fop/layoutmgr/LMiter.java
+++ b/src/java/org/apache/fop/layoutmgr/LMiter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutContext.java b/src/java/org/apache/fop/layoutmgr/LayoutContext.java
index 5ac9808f2..1be89304b 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutContext.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -106,15 +106,15 @@ public class LayoutContext {
/** Current pending space-before or space-start from ancestor areas */
private SpaceSpecifier leadingSpace;
-
+
/**
- * A list of pending marks (border and padding) on the after edge when a page break occurs.
+ * A list of pending marks (border and padding) on the after edge when a page break occurs.
* May be null.
*/
private List pendingAfterMarks;
-
+
/**
- * A list of pending marks (border and padding) on the before edge when a page break occurs.
+ * A list of pending marks (border and padding) on the before edge when a page break occurs.
* May be null.
*/
private List pendingBeforeMarks;
@@ -124,7 +124,7 @@ public class LayoutContext {
/** Alignment in BP direction */
private int bpAlignment = Constants.EN_START;
-
+
/** Stretch or shrink value when making areas. */
private double ipdAdjust = 0.0;
@@ -132,12 +132,12 @@ public class LayoutContext {
private double dSpaceAdjust = 0.0;
private AlignmentContext alignmentContext = null;
-
+
/** Amount of space before / start */
private int spaceBefore = 0;
/** Amount of space after / end */
private int spaceAfter = 0;
-
+
/** Amount of space to reserve at the beginning of each line */
private int lineStartBorderAndPaddingWidth = 0;
/** Amount of space to reserve at the end of each line */
@@ -146,9 +146,9 @@ public class LayoutContext {
private int breakBefore;
private int breakAfter;
- private int pendingKeepWithNext = BlockLevelLayoutManager.KEEP_AUTO;
- private int pendingKeepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
-
+ private int pendingKeepWithNext = BlockLevelLayoutManager.KEEP_AUTO;
+ private int pendingKeepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
+
/**
* Copy constructor for creating child layout contexts.
* @param parentLC the parent layout context to copy from
@@ -188,13 +188,13 @@ public class LayoutContext {
public void copyPendingMarksFrom(LayoutContext source) {
if (source.pendingAfterMarks != null) {
- this.pendingAfterMarks = new java.util.ArrayList(source.pendingAfterMarks);
+ this.pendingAfterMarks = new java.util.ArrayList(source.pendingAfterMarks);
}
if (source.pendingBeforeMarks != null) {
- this.pendingBeforeMarks = new java.util.ArrayList(source.pendingBeforeMarks);
+ this.pendingBeforeMarks = new java.util.ArrayList(source.pendingBeforeMarks);
}
}
-
+
public void setFlags(int flags) {
setFlags(flags, true);
}
@@ -238,7 +238,7 @@ public class LayoutContext {
public int getKeepWithNextPending() {
return this.pendingKeepWithNext;
}
-
+
/**
* Returns the strength of a keep-with-previous currently pending.
* @return the keep-with-previous strength
@@ -246,7 +246,7 @@ public class LayoutContext {
public int getKeepWithPreviousPending() {
return this.pendingKeepWithPrevious;
}
-
+
/**
* Clears any pending keep-with-next strength.
*/
@@ -260,7 +260,7 @@ public class LayoutContext {
public void clearKeepWithPreviousPending() {
this.pendingKeepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
/**
* Clears both keep-with-previous and keep-with-next strengths.
*/
@@ -292,7 +292,7 @@ public class LayoutContext {
public boolean isKeepWithNextPending() {
return getKeepWithNextPending() != BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
/**
* Indicates whether a keep-with-previous constraint is pending.
* @return true if a keep-with-previous constraint is pending
@@ -300,7 +300,7 @@ public class LayoutContext {
public boolean isKeepWithPreviousPending() {
return getKeepWithPreviousPending() != BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
public void setLeadingSpace(SpaceSpecifier space) {
leadingSpace = space;
}
@@ -333,7 +333,7 @@ public class LayoutContext {
}
this.pendingAfterMarks.add(element);
}
-
+
/**
* @return the pending border and padding elements at the after edge
* @see #addPendingAfterMark(UnresolvedListElementWithLength)
@@ -345,7 +345,7 @@ public class LayoutContext {
return null;
}
}
-
+
/**
* Clears all pending marks on the LayoutContext.
*/
@@ -353,7 +353,7 @@ public class LayoutContext {
this.pendingBeforeMarks = null;
this.pendingAfterMarks = null;
}
-
+
/**
* Adds a border or padding element to the pending list which will be used to generate
* the right element list for break possibilities. Conditionality resolution will be done
@@ -366,7 +366,7 @@ public class LayoutContext {
}
this.pendingBeforeMarks.add(element);
}
-
+
/**
* @return the pending border and padding elements at the before edge
* @see #addPendingBeforeMark(UnresolvedListElementWithLength)
@@ -378,7 +378,7 @@ public class LayoutContext {
return null;
}
}
-
+
/**
* Sets the stack limit in block-progression-dimension.
* @param limit the stack limit
@@ -419,7 +419,7 @@ public class LayoutContext {
setStackLimitBP(context.getStackLimitBP());
setStackLimitIP(context.getStackLimitIP());
}
-
+
/**
* Sets the inline-progression-dimension of the nearest ancestor reference area.
*/
@@ -429,7 +429,7 @@ public class LayoutContext {
/**
* Returns the inline-progression-dimension of the nearest ancestor reference area.
- *
+ *
* @return the inline-progression-dimension of the nearest ancestor reference area
*/
public int getRefIPD() {
@@ -455,12 +455,12 @@ public class LayoutContext {
public void setBPAlignment(int alignment) {
this.bpAlignment = alignment;
}
-
+
/** @return the currently applicable alignment in BP direction (EN_START, EN_JUSTIFY...) */
public int getBPAlignment() {
return this.bpAlignment;
}
-
+
public void setSpaceAdjust(double adjust) {
dSpaceAdjust = adjust;
}
@@ -480,7 +480,7 @@ public class LayoutContext {
public void setAlignmentContext(AlignmentContext alignmentContext) {
this.alignmentContext = alignmentContext;
}
-
+
public AlignmentContext getAlignmentContext() {
return this.alignmentContext;
}
@@ -490,7 +490,7 @@ public class LayoutContext {
this.alignmentContext = this.alignmentContext.getParentAlignmentContext();
}
}
-
+
/**
* Get the width to be reserved for border and padding at the start of the line.
* @return the width to be reserved
@@ -498,7 +498,7 @@ public class LayoutContext {
public int getLineStartBorderAndPaddingWidth() {
return lineStartBorderAndPaddingWidth;
}
-
+
/**
* Set the width to be reserved for border and padding at the start of the line.
* @param lineStartBorderAndPaddingWidth the width to be reserved
@@ -506,7 +506,7 @@ public class LayoutContext {
public void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth) {
this.lineStartBorderAndPaddingWidth = lineStartBorderAndPaddingWidth;
}
-
+
/**
* Get the width to be reserved for border and padding at the end of the line.
* @return the width to be reserved
@@ -514,7 +514,7 @@ public class LayoutContext {
public int getLineEndBorderAndPaddingWidth() {
return lineEndBorderAndPaddingWidth;
}
-
+
/**
* Set the width to be reserved for border and padding at the end of the line.
* @param lineEndBorderAndPaddingWidth the width to be reserved
@@ -522,7 +522,7 @@ public class LayoutContext {
public void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth) {
this.lineEndBorderAndPaddingWidth = lineEndBorderAndPaddingWidth;
}
-
+
/**
* @return true if the current element list ends early because of a span change
* in multi-column layout.
@@ -530,7 +530,7 @@ public class LayoutContext {
public int getNextSpan() {
return nextSpan;
}
-
+
/**
* Used to signal the PSLM that the element list ends early because of a span change in
* multi-column layout.
@@ -544,8 +544,8 @@ public class LayoutContext {
+ span);
}
}
-
- /**
+
+ /**
* Get the writing mode of the relevant reference area.
* @return the applicable writing mode
*/
@@ -553,7 +553,7 @@ public class LayoutContext {
return writingMode;
}
- /**
+ /**
* Set the writing mode.
* @param writingMode the writing mode
*/
@@ -597,7 +597,7 @@ public class LayoutContext {
* Returns the value of the break before the element whose
* {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
* called.
- *
+ *
* @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
* {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
* {@link Constants#EN_ODD_PAGE}
@@ -608,7 +608,7 @@ public class LayoutContext {
/**
* Sets the value of the break before the current element.
- *
+ *
* @param breakBefore the value of the break-before
* @see #getBreakBefore()
*/
@@ -620,7 +620,7 @@ public class LayoutContext {
* Returns the value of the break after the element whose
* {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
* called.
- *
+ *
* @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
* {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
* {@link Constants#EN_ODD_PAGE}
@@ -632,7 +632,7 @@ public class LayoutContext {
/**
* Sets the value of the break after the current element.
- *
+ *
* @param breakAfter the value of the break-after
* @see #getBreakAfter()
*/
@@ -650,7 +650,7 @@ public class LayoutContext {
+ "\nTrailing Space: \t"
+ (getTrailingSpace() == null ? "null" : getTrailingSpace().toString())
+ "\nLeading Space: \t"
- + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString())
+ + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString())
+ "\nReference IPD: \t" + getRefIPD()
+ "\nSpace Adjust: \t" + getSpaceAdjust()
+ "\nIPD Adjust: \t" + getIPDAdjust()
@@ -663,7 +663,7 @@ public class LayoutContext {
+ "\nKeeps: \t[keep-with-next=" + KeepUtil.keepStrengthToString(getKeepWithNextPending())
+ "][keep-with-previous="
+ KeepUtil.keepStrengthToString(getKeepWithPreviousPending()) + "] pending"
- + "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
+ + "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
+ (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]";
}
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutException.java b/src/java/org/apache/fop/layoutmgr/LayoutException.java
index 350cc758a..822607020 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutException.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutException.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,13 +28,13 @@ import org.apache.fop.events.EventExceptionManager.ExceptionFactory;
/**
* Exception thrown by FOP if an unrecoverable layout error occurs. An example: An area overflows
* a viewport that has overflow="error-if-overflow".
- *
+ *
* @todo Discuss if this should become a checked exception.
*/
public class LayoutException extends RuntimeException {
private static final long serialVersionUID = 5157080040923740433L;
-
+
private String localizedMessage;
private LayoutManager layoutManager;
@@ -80,7 +80,7 @@ public class LayoutException extends RuntimeException {
public LayoutManager getLayoutManager() {
return this.layoutManager;
}
-
+
/** Exception factory for {@link LayoutException}. */
public static class LayoutExceptionFactory implements ExceptionFactory {
@@ -95,11 +95,11 @@ public class LayoutException extends RuntimeException {
}
return ex;
}
-
+
/** {@inheritDoc} */
public Class getExceptionClass() {
return LayoutException.class;
}
-
- }
+
+ }
}
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManager.java b/src/java/org/apache/fop/layoutmgr/LayoutManager.java
index ad0d9f69c..f19588a77 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
import java.util.List;
@@ -45,11 +45,11 @@ public interface LayoutManager extends PercentBaseContext {
LayoutManager getParent();
/**
- * initialize the layout manager. Allows each layout manager
+ * initialize the layout manager. Allows each layout manager
* to calculate often used values.
*/
void initialize();
-
+
/**
* Get the active PageSequenceLayoutManager instance for this
* layout process.
@@ -130,9 +130,9 @@ public interface LayoutManager extends PercentBaseContext {
void addChildLMs(List newLMs);
/**
- * Get a sequence of KnuthElements representing the content
+ * Get a sequence of KnuthElements representing the content
* of the node assigned to the LM
- *
+ *
* @param context the LayoutContext used to store layout information
* @param alignment the desired text alignment
* @return the list of KnuthElements
@@ -140,54 +140,54 @@ public interface LayoutManager extends PercentBaseContext {
List getNextKnuthElements(LayoutContext context, int alignment);
/**
- * Get a sequence of KnuthElements representing the content
+ * Get a sequence of KnuthElements representing the content
* of the node assigned to the LM, after changes have been applied
*
* In the context of line breaking, this method is called after hyphenation has
- * been performed, in order to receive the sequence of elements representing the
+ * been performed, in order to receive the sequence of elements representing the
* text together with all possible hyphenation points.
* For example, if the text "representation" originates a single box element
* when getNextKnuthElements() is called, it will be now split in syllables
* (rep-re-sen-ta-tion) each one originating a box and divided by additional
* elements allowing a line break.
- *
+ *
* In the context of page breaking, this method is called only if the pages need
* to be "vertically justified" modifying (also) the quantity of lines created by
* the paragraphs, and after a first page breaking has been performed.
* According to the result of the first page breaking, each paragraph now knows
- * how many lines it must create (among the existing layout possibilities) and
+ * how many lines it must create (among the existing layout possibilities) and
* has to create a sequence of elements representing this layout; in particular,
* each box, representing a line, will contain a LineBreakPositions that will be
* used in the addAreas() phase.
- *
+ *
* LMs having children look at the old list of elements in order to know which
* ones they must get the new elements from, as break conditions of preserved
- * linefeeds can divide children into smaller groups (page sequences or
+ * linefeeds can divide children into smaller groups (page sequences or
* paragraphs).
* LMs having no children can simply return the old elements if they have nothing
* to change.
*
* Inline LMs need to know the text alignment because it affects the elements
* representing feasible breaks between syllables.
- *
+ *
* @param oldList the elements to replace
* @param alignment the desired text alignment
* @return the updated list of KnuthElements
*/
List getChangedKnuthElements(List oldList, int alignment);
-
+
/**
* Returns the IPD of the content area
* @return the IPD of the content area
*/
int getContentAreaIPD();
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
*/
int getContentAreaBPD();
-
+
/**
* Returns an indication if the layout manager generates a reference area.
* @return True if the layout manager generates a reference area
@@ -205,13 +205,13 @@ public interface LayoutManager extends PercentBaseContext {
* @return True if the layout manager generates a line area
*/
boolean getGeneratesLineArea();
-
+
/**
* Returns the fo this layout manager is associated with.
* @return The fo for this layout manager or null.
*/
FObj getFObj();
-
+
/**
* Adds a Position to the Position participating in the first|last determination by assigning
* it a unique position index.
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
index abb7f0f04..8efe5ce65 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@ import org.apache.fop.area.Block;
* The interface for all LayoutManager makers
*/
public interface LayoutManagerMaker {
-
+
/**
* Make LayoutManagers for the node and add them to the list lms.
* @param node the FO node for which the LayoutManagers are made
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
index 862c0a4be..26933ee4c 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -145,7 +145,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void makeLayoutManagers(FONode node, List lms) {
Maker maker = (Maker) makers.get(node.getClass());
@@ -175,7 +175,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
} else if (lms.size() > 1) {
throw new IllegalStateException("Duplicate LayoutManagers for class "
+ node.getClass()
- + " found, only one may be declared.");
+ + " found, only one may be declared.");
}
return (LayoutManager) lms.get(0);
}
@@ -186,7 +186,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
}
/*
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public FlowLayoutManager makeFlowLayoutManager(
PageSequenceLayoutManager pslm, Flow flow) {
@@ -194,21 +194,21 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
}
/*
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public ContentLayoutManager makeContentLayoutManager(PageSequenceLayoutManager pslm,
Title title) {
return new ContentLayoutManager(pslm, title);
}
-
+
/*
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public StaticContentLayoutManager makeStaticContentLayoutManager(
PageSequenceLayoutManager pslm, StaticContent sc, SideRegion reg) {
return new StaticContentLayoutManager(pslm, sc, reg);
}
-
+
/** {@inheritDoc} */
public StaticContentLayoutManager makeStaticContentLayoutManager(
PageSequenceLayoutManager pslm, StaticContent sc, org.apache.fop.area.Block block) {
@@ -321,7 +321,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
public static class ListItemLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
lms.add(new ListItemLayoutManager((ListItem) node));
- }
+ }
}
public static class ListBlockLayoutManagerMaker extends Maker {
@@ -353,7 +353,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
lms.add(new PageNumberCitationLastLayoutManager((PageNumberCitationLast) node));
}
}
-
+
public static class TableLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
Table table = (Table) node;
@@ -361,7 +361,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
lms.add(tlm);
}
}
-
+
public class RetrieveMarkerLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
Iterator baseIter;
@@ -373,7 +373,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
FONode child = (FONode) baseIter.next();
makeLayoutManagers(child, lms);
}
- }
+ }
}
public class WrapperLayoutManagerMaker extends Maker {
@@ -390,7 +390,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
FONode child = (FONode) baseIter.next();
makeLayoutManagers(child, lms);
}
- }
+ }
}
public ExternalDocumentLayoutManager makeExternalDocumentLayoutManager(
diff --git a/src/java/org/apache/fop/layoutmgr/LeafPosition.java b/src/java/org/apache/fop/layoutmgr/LeafPosition.java
index c43bb05c0..ed8cc94e2 100644
--- a/src/java/org/apache/fop/layoutmgr/LeafPosition.java
+++ b/src/java/org/apache/fop/layoutmgr/LeafPosition.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
public class LeafPosition extends Position {
@@ -31,11 +31,11 @@ public class LeafPosition extends Position {
public int getLeafPos() {
return iLeafPos;
}
-
+
public boolean generatesAreas() {
return getLM() != null;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/java/org/apache/fop/layoutmgr/ListElement.java b/src/java/org/apache/fop/layoutmgr/ListElement.java
index de08a1e1e..74d8a666b 100644
--- a/src/java/org/apache/fop/layoutmgr/ListElement.java
+++ b/src/java/org/apache/fop/layoutmgr/ListElement.java
@@ -23,12 +23,12 @@ package org.apache.fop.layoutmgr;
* This class is the base class for all kinds of elements that are added to element lists. There
* are basically two kinds of list elements: Knuth elements and unresolved elements like spaces,
* border and padding elements which are converted to Knuth elements prior to the breaking
- * process.
+ * process.
*/
public abstract class ListElement {
private Position position;
-
+
/**
* Main constructor
* @param position the Position instance needed by the addAreas stage of the LMs.
@@ -36,14 +36,14 @@ public abstract class ListElement {
public ListElement(Position position) {
this.position = position;
}
-
+
/**
* @return the Position instance for this element.
*/
public Position getPosition() {
return this.position;
}
-
+
/**
* Change the Position stored in this element.
* @param position the Position instance
@@ -78,14 +78,14 @@ public abstract class ListElement {
return false;
}
- /** @return true if the element is a penalty and represents a forced break. */
+ /** @return true if the element is a penalty and represents a forced break. */
public boolean isForcedBreak() {
return false;
}
- /** @return true if the element is an unresolved element such as a space or a border. */
+ /** @return true if the element is an unresolved element such as a space or a border. */
public boolean isUnresolvedElement() {
return true;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java b/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java
index b58af1cfe..155abcd39 100644
--- a/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java
+++ b/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java
@@ -35,7 +35,7 @@ public class MinOptMaxUtil {
* @param lr restricting source
* @param context Percentage evaluation context
*/
- public static void restrict(MinOptMax mom, LengthRangeProperty lr,
+ public static void restrict(MinOptMax mom, LengthRangeProperty lr,
PercentBaseContext context) {
if (lr.getEnum() != Constants.EN_AUTO) {
if (lr.getMinimum(context).getEnum() != Constants.EN_AUTO) {
@@ -70,7 +70,7 @@ public class MinOptMaxUtil {
/**
* Extends the minimum length to the given length if necessary, and adjusts opt and
* max accordingly.
- *
+ *
* @param mom the min/opt/max trait
* @param len the new minimum length
*/
@@ -81,7 +81,7 @@ public class MinOptMaxUtil {
mom.max = Math.max(mom.opt, mom.max);
}
}
-
+
/**
* After a calculation on a MinOptMax, this can be called to set opt to
* a new effective value.
@@ -95,7 +95,7 @@ public class MinOptMaxUtil {
}
}
}
-
+
/**
* Converts a LengthRangeProperty to a MinOptMax.
* @param prop LengthRangeProperty
@@ -104,14 +104,14 @@ public class MinOptMaxUtil {
*/
public static MinOptMax toMinOptMax(LengthRangeProperty prop, PercentBaseContext context) {
MinOptMax mom = new MinOptMax(
- (prop.getMinimum(context).isAuto()
+ (prop.getMinimum(context).isAuto()
? 0 : prop.getMinimum(context).getLength().getValue(context)),
- (prop.getOptimum(context).isAuto()
+ (prop.getOptimum(context).isAuto()
? 0 : prop.getOptimum(context).getLength().getValue(context)),
- (prop.getMaximum(context).isAuto()
- ? Integer.MAX_VALUE
+ (prop.getMaximum(context).isAuto()
+ ? Integer.MAX_VALUE
: prop.getMaximum(context).getLength().getValue(context)));
return mom;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java b/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java
index 9edb425c1..7089dabda 100644
--- a/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java
+++ b/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
public class NonLeafPosition extends Position {
@@ -31,11 +31,11 @@ public class NonLeafPosition extends Position {
public Position getPosition() {
return subPos;
}
-
+
public boolean generatesAreas() {
return (subPos != null ? subPos.generatesAreas() : false);
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/java/org/apache/fop/layoutmgr/PaddingElement.java b/src/java/org/apache/fop/layoutmgr/PaddingElement.java
index ee0edcc38..3ec0c5054 100644
--- a/src/java/org/apache/fop/layoutmgr/PaddingElement.java
+++ b/src/java/org/apache/fop/layoutmgr/PaddingElement.java
@@ -42,10 +42,10 @@ public class PaddingElement extends BorderOrPaddingElement {
boolean isFirst, boolean isLast, PercentBaseContext context) {
super(position, condLength, side, isFirst, isLast, context);
}
-
+
/** {@inheritDoc} */
public void notifyLayoutManager(MinOptMax effectiveLength) {
- LayoutManager lm = getOriginatingLayoutManager();
+ LayoutManager lm = getOriginatingLayoutManager();
if (lm instanceof ConditionalElementListener) {
((ConditionalElementListener)lm).notifyPadding(
getSide(), effectiveLength);
@@ -62,5 +62,5 @@ public class PaddingElement extends BorderOrPaddingElement {
sb.append("]");
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/Page.java b/src/java/org/apache/fop/layoutmgr/Page.java
index 6d6dbb233..7e22cef67 100644
--- a/src/java/org/apache/fop/layoutmgr/Page.java
+++ b/src/java/org/apache/fop/layoutmgr/Page.java
@@ -34,39 +34,39 @@ public class Page {
private SimplePageMaster spm;
private PageViewport pageViewport;
-
+
/**
* Main constructor
* @param spm the simple-page-master used for this page
* @param pageNumber the page number (as an int)
- * @param pageNumberStr the page number (as a String)
+ * @param pageNumberStr the page number (as a String)
* @param blank true if this is a blank page
*/
public Page(SimplePageMaster spm, int pageNumber, String pageNumberStr, boolean blank) {
this.spm = spm;
this.pageViewport = new PageViewport(spm, pageNumber, pageNumberStr, blank);
}
-
+
/**
* Auxiliary constructor used when there's no SimplePageMaster.
* @param viewArea the view area of the page
* @param pageNumber the page number (as an int)
- * @param pageNumberStr the page number (as a String)
+ * @param pageNumberStr the page number (as a String)
* @param blank true if this is a blank page
*/
public Page(Rectangle2D viewArea, int pageNumber, String pageNumberStr, boolean blank) {
this.spm = null;
this.pageViewport = new PageViewport(viewArea, pageNumber, pageNumberStr, null, blank);
}
-
+
/** @return the simple-page-master that created this page */
public SimplePageMaster getSimplePageMaster() {
return this.spm;
}
-
+
/** @return the page viewport representing this page in the area tree */
public PageViewport getPageViewport() {
return this.pageViewport;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreaker.java b/src/java/org/apache/fop/layoutmgr/PageBreaker.java
index b25e4bd4f..9ff520804 100644
--- a/src/java/org/apache/fop/layoutmgr/PageBreaker.java
+++ b/src/java/org/apache/fop/layoutmgr/PageBreaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,14 +39,14 @@ import org.apache.fop.traits.MinOptMax;
* Handles the breaking of pages in an fo:flow
*/
public class PageBreaker extends AbstractBreaker {
-
+
private PageSequenceLayoutManager pslm;
private boolean firstPart = true;
private boolean pageBreakHandled;
private boolean needColumnBalancing;
private PageProvider pageProvider;
private Block separatorArea;
-
+
/**
* The FlowLayoutManager object, which processes
* the single fo:flow of the fo:page-sequence
@@ -61,23 +61,23 @@ public class PageBreaker extends AbstractBreaker {
this.childFLM = pslm.getLayoutManagerMaker().makeFlowLayoutManager(
pslm, pslm.getPageSequence().getMainFlow());
}
-
+
/** {@inheritDoc} */
protected void updateLayoutContext(LayoutContext context) {
int flowIPD = pslm.getCurrentPV().getCurrentSpan().getColumnWidth();
context.setRefIPD(flowIPD);
}
-
+
/** {@inheritDoc} */
protected LayoutManager getTopLevelLM() {
return pslm;
}
-
+
/** {@inheritDoc} */
protected PageProvider getPageProvider() {
return pslm.getPageProvider();
}
-
+
/** {@inheritDoc} */
protected PageBreakingLayoutListener createLayoutListener() {
return new PageBreakingLayoutListener() {
@@ -98,7 +98,7 @@ public class PageBreaker extends AbstractBreaker {
amount, needClip, canRecover,
body.getLocator());
}
-
+
};
}
@@ -118,7 +118,7 @@ public class PageBreaker extends AbstractBreaker {
}
/** {@inheritDoc} */
- protected int getNextBlockList(LayoutContext childLC,
+ protected int getNextBlockList(LayoutContext childLC,
int nextSequenceStartsOn) {
if (!firstPart) {
// if this is the first page that will be created by
@@ -129,15 +129,15 @@ public class PageBreaker extends AbstractBreaker {
}
firstPart = false;
pageBreakHandled = true;
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
return super.getNextBlockList(childLC, nextSequenceStartsOn);
}
-
+
/** {@inheritDoc} */
protected List getNextKnuthElements(LayoutContext context, int alignment) {
List contentList = null;
-
+
while (!childFLM.isFinished() && contentList == null) {
contentList = childFLM.getNextKnuthElements(context, alignment);
}
@@ -161,7 +161,7 @@ public class PageBreaker extends AbstractBreaker {
// store the lists of elements representing the footnote bodies
// in the box representing the line containing their references
while (footnoteBodyIterator.hasNext()) {
- FootnoteBodyLayoutManager fblm
+ FootnoteBodyLayoutManager fblm
= (FootnoteBodyLayoutManager) footnoteBodyIterator.next();
fblm.setParent(childFLM);
fblm.initialize();
@@ -178,7 +178,7 @@ public class PageBreaker extends AbstractBreaker {
footnoteSeparator = pslm.getPageSequence().getStaticContent("xsl-footnote-separator");
if (footnoteSeparator != null) {
// the footnote separator can contain page-dependent content such as
- // page numbers or retrieve markers, so its areas cannot simply be
+ // page numbers or retrieve markers, so its areas cannot simply be
// obtained now and repeated in each page;
// we need to know in advance the separator bpd: the actual separator
// could be different from page to page, but its bpd would likely be
@@ -199,7 +199,7 @@ public class PageBreaker extends AbstractBreaker {
}
return contentList;
}
-
+
/**
* @return current display alignment
*/
@@ -207,14 +207,14 @@ public class PageBreaker extends AbstractBreaker {
return pslm.getCurrentPage().getSimplePageMaster().getRegion(
Constants.FO_REGION_BODY).getDisplayAlign();
}
-
+
/**
* @return whether or not this flow has more page break opportunities
*/
protected boolean hasMoreContent() {
return !childFLM.isFinished();
}
-
+
/**
* Adds an area to the flow layout manager
* @param posIter the position iterator
@@ -235,18 +235,18 @@ public class PageBreaker extends AbstractBreaker {
footnoteSeparatorLM.doLayout();
}
- childFLM.addAreas(posIter, context);
+ childFLM.addAreas(posIter, context);
}
-
+
/**
* Performs phase 3 operation
- *
+ *
* @param alg page breaking algorithm
* @param partCount part count
* @param originalList the block sequence original list
* @param effectiveList the block sequence effective list
*/
- protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
+ protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
if (needColumnBalancing) {
doPhase3WithColumnBalancing(alg, partCount, originalList, effectiveList);
@@ -261,7 +261,7 @@ public class PageBreaker extends AbstractBreaker {
}
}
- private void doPhase3WithLastPage(PageBreakingAlgorithm alg, int partCount,
+ private void doPhase3WithLastPage(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
int newStartPos;
int restartPoint = pageProvider.getStartingPartIndexForLastPage(partCount);
@@ -281,13 +281,13 @@ public class PageBreaker extends AbstractBreaker {
}
AbstractBreaker.log.debug("Last page handling now!!!");
AbstractBreaker.log.debug("===================================================");
- AbstractBreaker.log.debug("Restarting at " + restartPoint
+ AbstractBreaker.log.debug("Restarting at " + restartPoint
+ ", new start position: " + newStartPos);
pageBreakHandled = true;
//Update so the available BPD is reported correctly
int currentPageNum = pslm.getCurrentPageNum();
- pageProvider.setStartOfNextElementList(currentPageNum,
+ pageProvider.setStartOfNextElementList(currentPageNum,
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
pageProvider.setLastPageIndex(currentPageNum);
@@ -295,7 +295,7 @@ public class PageBreaker extends AbstractBreaker {
PageBreakingAlgorithm algRestart = new PageBreakingAlgorithm(
getTopLevelLM(),
getPageProvider(), createLayoutListener(),
- alg.getAlignment(), alg.getAlignmentLast(),
+ alg.getAlignment(), alg.getAlignmentLast(),
footnoteSeparatorLength,
isPartOverflowRecoveryActivated(), false, false);
//alg.setConstantLineWidth(flowBPD);
@@ -304,8 +304,8 @@ public class PageBreaker extends AbstractBreaker {
1, true, BreakingAlgorithm.ALL_BREAKS);
AbstractBreaker.log.debug("restart: iOptPageCount= " + iOptPageCount
+ " pageBreaks.size()= " + algRestart.getPageBreaks().size());
- boolean replaceLastPage
- = iOptPageCount <= pslm.getCurrentPV().getBodyRegion().getColumnCount();
+ boolean replaceLastPage
+ = iOptPageCount <= pslm.getCurrentPV().getBodyRegion().getColumnCount();
if (replaceLastPage) {
//Replace last page
pslm.setCurrentPage(pageProvider.getPage(false, currentPageNum));
@@ -322,7 +322,7 @@ public class PageBreaker extends AbstractBreaker {
AbstractBreaker.log.debug("===================================================");
}
- private void doPhase3WithColumnBalancing(PageBreakingAlgorithm alg, int partCount,
+ private void doPhase3WithColumnBalancing(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
AbstractBreaker.log.debug("Column balancing now!!!");
AbstractBreaker.log.debug("===================================================");
@@ -342,12 +342,12 @@ public class PageBreaker extends AbstractBreaker {
} else {
newStartPos = 0;
}
- AbstractBreaker.log.debug("Restarting at " + restartPoint
+ AbstractBreaker.log.debug("Restarting at " + restartPoint
+ ", new start position: " + newStartPos);
pageBreakHandled = true;
//Update so the available BPD is reported correctly
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
//Restart last page
@@ -376,15 +376,15 @@ public class PageBreaker extends AbstractBreaker {
addAreas(algRestart, iOptPageCount, originalList, effectiveList);
AbstractBreaker.log.debug("===================================================");
}
-
+
protected void startPart(BlockSequence list, int breakClass) {
AbstractBreaker.log.debug("startPart() breakClass=" + breakClass);
if (pslm.getCurrentPage() == null) {
throw new IllegalStateException("curPage must not be null");
}
if (!pageBreakHandled) {
-
- //firstPart is necessary because we need the first page before we start the
+
+ //firstPart is necessary because we need the first page before we start the
//algorithm so we have a BPD and IPD. This may subject to change later when we
//start handling more complex cases.
if (!firstPart) {
@@ -394,7 +394,7 @@ public class PageBreaker extends AbstractBreaker {
// otherwise, we may simply need a new page
handleBreakTrait(breakClass);
}
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
}
pageBreakHandled = false;
@@ -402,12 +402,12 @@ public class PageBreaker extends AbstractBreaker {
// finish page and add to area tree
firstPart = false;
}
-
+
/** {@inheritDoc} */
protected void handleEmptyContent() {
pslm.getCurrentPV().getPage().fakeNonEmpty();
}
-
+
protected void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp) {
// add footnote areas
if (pbp.footnoteFirstListIndex < pbp.footnoteLastListIndex
@@ -415,16 +415,16 @@ public class PageBreaker extends AbstractBreaker {
// call addAreas() for each FootnoteBodyLM
for (int i = pbp.footnoteFirstListIndex; i <= pbp.footnoteLastListIndex; i++) {
LinkedList elementList = alg.getFootnoteList(i);
- int firstIndex = (i == pbp.footnoteFirstListIndex
+ int firstIndex = (i == pbp.footnoteFirstListIndex
? pbp.footnoteFirstElementIndex : 0);
- int lastIndex = (i == pbp.footnoteLastListIndex
+ int lastIndex = (i == pbp.footnoteLastListIndex
? pbp.footnoteLastElementIndex : elementList.size() - 1);
- SpaceResolver.performConditionalsNotification(elementList,
+ SpaceResolver.performConditionalsNotification(elementList,
firstIndex, lastIndex, -1);
LayoutContext childLC = new LayoutContext(0);
- AreaAdditionUtil.addAreas(null,
- new KnuthPossPosIter(elementList, firstIndex, lastIndex + 1),
+ AreaAdditionUtil.addAreas(null,
+ new KnuthPossPosIter(elementList, firstIndex, lastIndex + 1),
childLC);
}
// set the offset from the top margin
@@ -438,20 +438,20 @@ public class PageBreaker extends AbstractBreaker {
}
pslm.getCurrentPV().getCurrentSpan().notifyFlowsFinished();
}
-
+
/**
* @return the current child flow layout manager
*/
protected LayoutManager getCurrentChildLM() {
return childFLM;
}
-
+
/** {@inheritDoc} */
protected void observeElementList(List elementList) {
- ElementListObserver.observe(elementList, "breaker",
+ ElementListObserver.observe(elementList, "breaker",
((PageSequence)pslm.getFObj()).getId());
}
-
+
/**
* Depending on the kind of break condition, move to next column
* or page. May need to make an empty page if next page would
@@ -471,17 +471,17 @@ public class PageBreaker extends AbstractBreaker {
|| breakVal <= 0
|| breakVal == Constants.EN_AUTO) {
PageViewport pv = curPage.getPageViewport();
-
+
//Check if previous page was spanned
boolean forceNewPageWithSpan = false;
RegionBody rb = (RegionBody)curPage.getSimplePageMaster().getRegion(
Constants.FO_REGION_BODY);
- if (breakVal < 0
- && rb.getColumnCount() > 1
+ if (breakVal < 0
+ && rb.getColumnCount() > 1
&& pv.getCurrentSpan().getColumnCount() == 1) {
forceNewPageWithSpan = true;
}
-
+
if (forceNewPageWithSpan) {
curPage = pslm.makeNewPage(false, false);
curPage.getPageViewport().createSpan(true);
@@ -492,7 +492,7 @@ public class PageBreaker extends AbstractBreaker {
}
return;
}
- log.debug("handling break-before after page " + pslm.getCurrentPageNum()
+ log.debug("handling break-before after page " + pslm.getCurrentPageNum()
+ " breakVal=" + breakVal);
if (needBlankPageBeforeNew(breakVal)) {
curPage = pslm.makeNewPage(true, false);
@@ -501,7 +501,7 @@ public class PageBreaker extends AbstractBreaker {
curPage = pslm.makeNewPage(false, false);
}
}
-
+
/**
* Check if a blank page is needed to accomodate
* desired even or odd page number.
@@ -520,7 +520,7 @@ public class PageBreaker extends AbstractBreaker {
}
}
}
-
+
/**
* See if need to generate a new page
* @param breakVal - value of break-before or break-after trait.
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
index 9e0b42ecb..8095feba1 100644
--- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
+++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
@@ -73,13 +73,13 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
/** Index of the last element of the last footnote inserted on the current page. */
private int footnoteElementIndex = -1;
- // demerits for a page break that splits a footnote
+ // demerits for a page break that splits a footnote
private int splitFootnoteDemerits = 5000;
- // demerits for a page break that defers a whole footnote to the following page
+ // demerits for a page break that defers a whole footnote to the following page
private int deferredFootnoteDemerits = 10000;
private MinOptMax footnoteSeparatorLength = null;
- // the method noBreakBetween(int, int) uses these variables
+ // the method noBreakBetween(int, int) uses these variables
// to store parameters and result of the last call, in order
// to reuse them and take less time
private int storedPrevBreakIndex = -1;
@@ -88,10 +88,10 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
//Controls whether overflows should be warned about or not
private boolean autoHeight = false;
-
+
//Controls whether a single part should be forced if possible (ex. block-container)
private boolean favorSinglePart = false;
-
+
public PageBreakingAlgorithm(LayoutManager topLevelLM,
PageProvider pageProvider,
PageBreakingLayoutListener layoutListener,
@@ -202,7 +202,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
totalWidth, totalStretch, totalShrink,
((BestPageRecords) best).getFootnotesLength(fitness),
((BestPageRecords) best).getFootnoteListIndex(fitness),
- ((BestPageRecords) best).getFootnoteElementIndex(fitness),
+ ((BestPageRecords) best).getFootnoteElementIndex(fitness),
best.getAdjust(fitness), best.getAvailableShrink(fitness),
best.getAvailableStretch(fitness), best.getDifference(fitness),
best.getDemerits(fitness), best.getNode(fitness));
@@ -247,11 +247,11 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
ListIterator elementListsIterator = elementLists.listIterator();
while (elementListsIterator.hasNext()) {
LinkedList noteList = (LinkedList) elementListsIterator.next();
-
- //Space resolution (Note: this does not respect possible stacking constraints
+
+ //Space resolution (Note: this does not respect possible stacking constraints
//between footnotes!)
SpaceResolver.resolveElementList(noteList);
-
+
int noteLength = 0;
footnotesList.add(noteList);
ListIterator noteListIterator = noteList.listIterator();
@@ -261,8 +261,8 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
noteLength += element.getW();
}
}
- int prevLength = (lengthList.size() == 0
- ? 0
+ int prevLength = (lengthList.size() == 0
+ ? 0
: ((Integer) lengthList.get(lengthList.size() - 1)).intValue());
lengthList.add(new Integer(prevLength + noteLength));
totalFootnotesLength += noteLength;
@@ -423,7 +423,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
index < breakIndex;
index++) {
if (par.getElement(index).isGlue() && par.getElement(index - 1).isBox()
- || par.getElement(index).isPenalty()
+ || par.getElement(index).isPenalty()
&& ((KnuthElement) par.getElement(index)).getP() < KnuthElement.INFINITE) {
// break found
break;
@@ -520,7 +520,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
}
// as this method is called only if it is not possible to insert
// all footnotes, at this point listIndex and elementIndex points to
- // an existing element, the next one we will try to insert
+ // an existing element, the next one we will try to insert
}
// try adding a split of the next note
@@ -582,7 +582,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
// prevIndex is -1 if we have added only some whole footnotes
footnoteListIndex = (prevIndex != -1) ? listIndex : listIndex - 1;
footnoteElementIndex = (prevIndex != -1)
- ? prevIndex
+ ? prevIndex
: ((LinkedList) footnotesList.get(footnoteListIndex)).size() - 1;
}
return prevSplitLength;
@@ -618,7 +618,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
}
}
- protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
+ protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
int fitnessClass, double r) {
double demerits = 0;
// compute demerits
@@ -649,11 +649,11 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
if (footnotesPending) {
if (footnoteListIndex < footnotesList.size() - 1) {
// add demerits for the deferred footnotes
- demerits += (footnotesList.size() - 1 - footnoteListIndex)
+ demerits += (footnotesList.size() - 1 - footnoteListIndex)
* deferredFootnoteDemerits;
}
if (footnoteListIndex < footnotesList.size()) {
- if (footnoteElementIndex
+ if (footnoteElementIndex
< ((LinkedList) footnotesList.get(footnoteListIndex)).size() - 1) {
// add demerits for the footnote split between pages
demerits += splitFootnoteDemerits;
@@ -710,7 +710,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
// cannot add any content: create a new node and start again
KnuthPageNode node = (KnuthPageNode)
createNode(lastNode.position, prevNode.line + 1, 1,
- insertedFootnotesLength - prevNode.totalFootnotes,
+ insertedFootnotesLength - prevNode.totalFootnotes,
0, 0,
0, 0, 0,
0, 0, prevNode);
@@ -744,7 +744,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
}
pageBreaks.addFirst(pageBreak);
}
-
+
/**
* Removes all page breaks from the result list. This is used by block-containers and
* static-content when it is only desired to know where there is an overflow but later the
@@ -758,14 +758,14 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
pageBreaks.removeFirst();
}
}
-
+
public void updateData1(int total, double demerits) {
}
public void updateData2(KnuthNode bestActiveNode,
KnuthSequence sequence,
int total) {
- //int difference = (bestActiveNode.line < total)
+ //int difference = (bestActiveNode.line < total)
// ? bestActiveNode.difference : bestActiveNode.difference + fillerMinWidth;
int difference = bestActiveNode.difference;
if (difference + bestActiveNode.availableShrink < 0) {
@@ -818,10 +818,10 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
// add nodes at the beginning of the list, as they are found
// backwards, from the last one to the first one
if (log.isDebugEnabled()) {
- log.debug("BBA> difference=" + difference + " ratio=" + ratio
+ log.debug("BBA> difference=" + difference + " ratio=" + ratio
+ " position=" + bestActiveNode.position);
}
- insertPageBreakAsFirst(new PageBreakPosition(this.topLevelLM,
+ insertPageBreakAsFirst(new PageBreakPosition(this.topLevelLM,
bestActiveNode.position,
firstListIndex, firstElementIndex,
((KnuthPageNode) bestActiveNode).footnoteListIndex,
@@ -834,8 +834,8 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
KnuthNode bestActiveNode = null;
for (int i = startLine; i < endLine; i++) {
for (KnuthNode node = getNode(i); node != null; node = node.next) {
- if (favorSinglePart
- && node.line > 1
+ if (favorSinglePart
+ && node.line > 1
&& bestActiveNode != null
&& Math.abs(bestActiveNode.difference) < bestActiveNode.availableShrink) {
//favor current best node, so just skip the current node because it would
@@ -854,12 +854,12 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
public LinkedList getFootnoteList(int index) {
return (LinkedList) footnotesList.get(index);
}
-
+
/** @return the associated top-level formatting object. */
public FObj getFObj() {
return topLevelLM.getFObj();
}
-
+
/** {@inheritDoc} */
protected int getLineWidth(int line) {
int bpd;
@@ -873,7 +873,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
}
return bpd;
}
-
+
/**
* Interface to notify about layout events during page breaking.
*/
@@ -886,7 +886,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
* @param obj the root FO object where this happens
*/
void notifyOverflow(int part, int amount, FObj obj);
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/PageProvider.java b/src/java/org/apache/fop/layoutmgr/PageProvider.java
index a7918db6e..55c78ba52 100644
--- a/src/java/org/apache/fop/layoutmgr/PageProvider.java
+++ b/src/java/org/apache/fop/layoutmgr/PageProvider.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,38 +35,38 @@ import org.apache.fop.fo.pagination.SimplePageMaster;
*
InlineArea
- *
- * @param hasInlineParent true if the parent is an inline
+
+ /**
+ * Create and initialize an InlineArea
+ *
+ * @param hasInlineParent true if the parent is an inline
* @return the area
*/
protected InlineArea createArea(boolean hasInlineParent) {
@@ -209,7 +209,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
}
return area;
}
-
+
/** {@inheritDoc} */
protected void setTraits(boolean isNotFirst, boolean isNotLast) {
if (borderProps != null) {
@@ -232,7 +232,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
return ((BlockLevelLayoutManager) lm).mustKeepTogether();
} else if (lm instanceof InlineLayoutManager) {
return ((InlineLayoutManager) lm).mustKeepTogether();
- } else {
+ } else {
return mustKeepTogether(lm.getParent());
}
}
@@ -249,12 +249,12 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
KnuthSequence lastSequence = null;
SpaceSpecifier leadingSpace = context.getLeadingSpace();
-
+
if (fobj instanceof Title) {
alignmentContext = new AlignmentContext(font,
lineHeight.getOptimum(this).getLength().getValue(this),
context.getWritingMode());
-
+
} else {
alignmentContext = new AlignmentContext(font
, lineHeight.getOptimum(this).getLength().getValue(this)
@@ -264,7 +264,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
, dominantBaseline
, context.getAlignmentContext());
}
-
+
childLC = new LayoutContext(context);
childLC.setAlignmentContext(alignmentContext);
@@ -300,9 +300,9 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
+ borderProps.getBorderEndWidth(true)
);
}
-
+
while ((curLM = getChildLM()) != null) {
-
+
if (!(curLM instanceof InlineLevelLayoutManager)) {
// A block LM
// Leave room for start/end border and padding
@@ -314,7 +314,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
- borderProps.getBorderEndWidth(hasNextChildLM()));
}
}
-
+
// get KnuthElements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
if (returnList.isEmpty() && childLC.isKeepWithPreviousPending()) {
@@ -326,7 +326,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
// just iterate once more to see if there is another child
continue;
}
-
+
if (curLM instanceof InlineLevelLayoutManager) {
context.clearKeepWithNextPending();
// "wrap" the Position stored in each element of returnedList
@@ -375,31 +375,31 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
lastSequence = (KnuthSequence) ListUtil.getLast(returnList);
lastChildLM = curLM;
}
-
+
if (lastSequence != null) {
addKnuthElementsForBorderPaddingEnd(lastSequence);
}
setFinished(true);
log.trace(trace);
-
+
if (returnList.isEmpty()) {
/*
- * if the FO itself is empty, but has an id specified
+ * if the FO itself is empty, but has an id specified
* or associated fo:markers, then we still need a dummy
* sequence to register its position in the area tree
*/
if (fobj.hasId() || fobj.hasMarkers()) {
InlineKnuthSequence emptySeq = new InlineKnuthSequence();
emptySeq.add(new KnuthInlineBox(
- 0,
- alignmentContext,
- notifyPos(getAuxiliaryPosition()),
+ 0,
+ alignmentContext,
+ notifyPos(getAuxiliaryPosition()),
true));
returnList.add(emptySeq);
}
}
-
+
return returnList.isEmpty() ? null : returnList;
}
@@ -414,7 +414,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
*/
public void addAreas(PositionIterator parentIter,
LayoutContext context) {
-
+
addId();
setChildContext(new LayoutContext(context)); // Store current value
@@ -454,11 +454,11 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
}*/
addMarkersToPage(
- true,
- !areaCreated,
+ true,
+ !areaCreated,
lastPos == null || isLast(lastPos));
-
- InlineArea parent = createArea(lastLM == null
+
+ InlineArea parent = createArea(lastLM == null
|| lastLM instanceof InlineLevelLayoutManager);
parent.setBPD(alignmentContext.getHeight());
if (parent instanceof InlineParent) {
@@ -472,7 +472,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
}
}
setCurrentArea(parent);
-
+
StackingIter childPosIter
= new StackingIter(positionList.listIterator());
@@ -487,7 +487,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
prevLM = childLM;
}
-
+
/* If this LM has a trailing fence, resolve trailing space
* specs from descendants. Otherwise, propagate any trailing
* space specs to the parent LM via the layout context. If
@@ -496,7 +496,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
* must be the last area for the current LM too.
*/
boolean isLast = (getContext().isLastArea() && prevLM == lastChildLM);
-
+
if (hasTrailingFence(isLast)) {
addSpace(getCurrentArea(),
getContext().getTrailingSpace().resolve(false),
@@ -510,17 +510,17 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
if (context.getTrailingSpace() != null && getSpaceEnd() != null) {
context.getTrailingSpace().addSpace(new SpaceVal(getSpaceEnd(), this));
}
-
+
// Not sure if lastPos can legally be null or if that masks a different problem.
// But it seems to fix bug 38053.
setTraits(areaCreated, lastPos == null || !isLast(lastPos));
parentLM.addChildArea(getCurrentArea());
addMarkersToPage(
- false,
- !areaCreated,
+ false,
+ !areaCreated,
lastPos == null || isLast(lastPos));
-
+
context.setFlags(LayoutContext.LAST_AREA, isLast);
areaCreated = true;
checkEndOfLayout(lastPos);
@@ -545,7 +545,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
addKnuthElementsForBorderPaddingEnd(returnedList);
return returnedList;
}
-
+
/**
* Creates Knuth elements for start border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
@@ -604,5 +604,5 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
//}
return this.auxiliaryPosition;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
index 51d2720cb..c9c65e769 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
@@ -33,7 +33,7 @@ public interface InlineLevelEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -52,7 +52,7 @@ public interface InlineLevelEventProducer extends EventProducer {
* @event.severity ERROR
*/
void leaderWithoutContent(Object source, Locator loc);
-
+
/**
* A line overflows.
* @param source the event source
@@ -62,5 +62,5 @@ public interface InlineLevelEventProducer extends EventProducer {
* @event.severity WARN
*/
void lineOverflows(Object source, int line, int overflowLength, Locator loc);
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java
index 80a74ffc4..b080f926b 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.inline;
import java.util.List;
@@ -30,7 +30,7 @@ import org.apache.fop.layoutmgr.Position;
public interface InlineLevelLayoutManager extends LayoutManager {
/**
- * Tell the LM to modify its data, adding a letter space
+ * Tell the LM to modify its data, adding a letter space
* to the word fragment represented by the given elements,
* and returning the corrected elements
*
@@ -40,7 +40,7 @@ public interface InlineLevelLayoutManager extends LayoutManager {
List addALetterSpaceTo(List oldList);
/**
- * Tell the LM to modify its data, removing the word space
+ * Tell the LM to modify its data, removing the word space
* represented by the given elements
*
* @param oldList the elements representing the word space
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
index 81fc7901d..a27fc6516 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -43,7 +43,7 @@ import org.apache.fop.traits.MinOptMax;
* which stack children in the inline direction, such as Inline or
* Line. It should not be instantiated directly.
*/
-public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
+public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
implements InlineLevelLayoutManager {
@@ -103,7 +103,7 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
}
/**
- * Returns the extra IPD needed for any leading or trailing fences for the
+ * Returns the extra IPD needed for any leading or trailing fences for the
* current area.
* @param bNotFirst true if not the first area for this layout manager
* @param bNotLast true if not the last area for this layout manager
@@ -139,7 +139,7 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
protected SpaceProperty getSpaceStart() {
return null;
}
-
+
/**
* Get the space at the end of the inline area.
* @return the space property describing the space
@@ -246,7 +246,7 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
// The last element may not have a layout manager (its position == null);
// this may happen if it is a padding box; see bug 39571.
- InlineLevelLayoutManager LM =
+ InlineLevelLayoutManager LM =
(InlineLevelLayoutManager) element.getLayoutManager();
if (LM != null) {
oldList = LM.addALetterSpaceTo(oldList);
@@ -362,7 +362,7 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
// "unwrap" the Positions stored in the elements
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java b/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java
index 5f9365f83..4a54f582d 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,10 +28,10 @@ import org.apache.fop.fo.flow.InstreamForeignObject;
* LayoutManager for the fo:instream-foreign-object formatting object
*/
public class InstreamForeignObjectLM extends AbstractGraphicsLayoutManager {
-
+
/**
* Constructor.
- *
+ *
* @param node
* the formatting object that creates this area
*/
@@ -48,6 +48,6 @@ public class InstreamForeignObjectLM extends AbstractGraphicsLayoutManager {
return new ForeignObject(doc, ns);
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java b/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java
index 856fab051..6c8c7354b 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,7 +25,7 @@ import org.apache.fop.layoutmgr.KnuthBox;
import org.apache.fop.layoutmgr.Position;
public class KnuthInlineBox extends KnuthBox {
-
+
private FootnoteBodyLayoutManager footnoteBodyLM = null;
private AlignmentContext alignmentContext = null;
@@ -69,8 +69,8 @@ public class KnuthInlineBox extends KnuthBox {
public boolean isAnchor() {
return (footnoteBodyLM != null);
}
-
-
+
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
index 3bb82aa11..1e163bef8 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -51,10 +51,10 @@ import org.apache.fop.traits.MinOptMax;
public class LeaderLayoutManager extends LeafNodeLayoutManager {
private Leader fobj;
private Font font = null;
-
+
private List contentList = null;
private ContentLayoutManager clm = null;
-
+
private int contentAreaIPD = 0;
/**
@@ -66,7 +66,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
super(node);
fobj = node;
}
-
+
/** {@inheritDoc} */
public void initialize() {
FontInfo fi = fobj.getFOEventHandler().getFontInfo();
@@ -117,7 +117,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
if (fobj.getLeaderPattern() == EN_RULE) {
if (fobj.getRuleStyle() != EN_NONE) {
- org.apache.fop.area.inline.Leader leader
+ org.apache.fop.area.inline.Leader leader
= new org.apache.fop.area.inline.Leader();
leader.setRuleStyle(fobj.getRuleStyle());
leader.setRuleThickness(fobj.getRuleThickness().getValue(this));
@@ -167,7 +167,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
// child FOs are assigned to the InlineStackingLM
fobjIter = null;
-
+
// get breaks then add areas to FilledArea
FilledArea fa = new FilledArea();
@@ -262,7 +262,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
curArea.setAdjustingInfo(ipd.max - ipd.opt, ipd.opt - ipd.min, 0);
addKnuthElementsForBorderPaddingStart(seq);
-
+
// node is a fo:Leader
seq.add(new KnuthInlineBox(0, alignmentContext,
new LeafPosition(this, -1), true));
@@ -272,20 +272,20 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
seq.add
(new KnuthGlue(areaInfo.ipdArea.opt,
areaInfo.ipdArea.max - areaInfo.ipdArea.opt,
- areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
+ areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
new LeafPosition(this, 0), false));
} else {
seq.add
(new KnuthGlue(areaInfo.ipdArea.opt,
0,
- 0,
+ 0,
new LeafPosition(this, 0), false));
}
seq.add(new KnuthInlineBox(0, alignmentContext,
new LeafPosition(this, -1), true));
addKnuthElementsForBorderPaddingEnd(seq);
-
+
LinkedList returnList = new LinkedList();
returnList.add(seq);
setFinished(true);
@@ -314,7 +314,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
List returnList = new LinkedList();
addKnuthElementsForBorderPaddingStart(returnList);
-
+
returnList.add(new KnuthInlineBox(0, areaInfo.alignmentContext,
new LeafPosition(this, -1), true));
returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
@@ -323,20 +323,20 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
returnList.add
(new KnuthGlue(areaInfo.ipdArea.opt,
areaInfo.ipdArea.max - areaInfo.ipdArea.opt,
- areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
+ areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
new LeafPosition(this, 0), false));
} else {
returnList.add
(new KnuthGlue(areaInfo.ipdArea.opt,
0,
- 0,
+ 0,
new LeafPosition(this, 0), false));
}
returnList.add(new KnuthInlineBox(0, areaInfo.alignmentContext,
new LeafPosition(this, -1), true));
addKnuthElementsForBorderPaddingEnd(returnList);
-
+
setFinished(true);
return returnList;
}
@@ -353,9 +353,9 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
public int getContentAreaIPD() {
return contentAreaIPD;
}
-
+
private void setContentAreaIPD(int contentAreaIPD) {
this.contentAreaIPD = contentAreaIPD;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java
index 19a8cdf2d..ac501abb7 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -48,7 +48,7 @@ import org.apache.fop.traits.MinOptMax;
* This class can be extended to handle the creation and adding of the
* inline area.
*/
-public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
+public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
implements InlineLevelLayoutManager {
/**
@@ -64,7 +64,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
protected CommonBorderPaddingBackground commonBorderPaddingBackground = null;
/** The alignment context applying to this area */
protected AlignmentContext alignmentContext = null;
-
+
/** Flag to indicate if something was changed as part of the getChangeKnuthElements sequence */
protected boolean isSomethingChanged = false;
/** Our area info for the Knuth elements */
@@ -86,7 +86,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
bHyphenated = bHyph;
this.alignmentContext = alignmentContext;
}
-
+
}
@@ -201,7 +201,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
protected InlineArea getEffectiveArea() {
return curArea;
}
-
+
/**
* Offset this area.
* Offset the inline area in the bpd direction when adding the
@@ -247,18 +247,18 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
area.setIPD(width);
area.setAdjustment(width - areaInfo.ipdArea.opt);
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
curArea = get(context);
-
+
if (curArea == null) {
setFinished(true);
return null;
}
alignmentContext = makeAlignmentContext(context);
-
+
MinOptMax ipd = getAllocationIPD(context.getRefIPD());
// create the AreaInfo object to store the computed values
@@ -269,12 +269,12 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
KnuthSequence seq = new InlineKnuthSequence();
addKnuthElementsForBorderPaddingStart(seq);
-
+
seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, alignmentContext,
notifyPos(new LeafPosition(this, 0)), false));
addKnuthElementsForBorderPaddingEnd(seq);
-
+
LinkedList returnList = new LinkedList();
returnList.add(seq);
@@ -322,18 +322,18 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
LinkedList returnList = new LinkedList();
addKnuthElementsForBorderPaddingStart(returnList);
-
+
// fobj is a fo:ExternalGraphic, fo:InstreamForeignObject,
// fo:PageNumber or fo:PageNumberCitation
- returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.alignmentContext,
+ returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.alignmentContext,
notifyPos(new LeafPosition(this, 0)), true));
addKnuthElementsForBorderPaddingEnd(returnList);
-
+
setFinished(true);
return returnList;
}
-
+
/**
* Creates Knuth elements for start border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
@@ -345,7 +345,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
+ commonBorderPaddingBackground.getPaddingStart(false, this);
if (ipStart > 0) {
// Add a non breakable glue
- returnList.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
+ returnList.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
false, new LeafPosition(this, -1), true));
returnList.add(new KnuthGlue(ipStart, 0, 0, new LeafPosition(this, -1), true));
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
index 87077ee77..3a0672f4e 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -75,7 +75,7 @@ import org.apache.fop.traits.MinOptMax;
* creates a line area to contain the inline areas added by the
* child layout managers.
*/
-public class LineLayoutManager extends InlineStackingLayoutManager
+public class LineLayoutManager extends InlineStackingLayoutManager
implements BlockLevelLayoutManager {
/**
@@ -85,7 +85,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
private Block fobj;
private boolean isFirstInBlock;
-
+
/** {@inheritDoc} */
public void initialize() {
textAlignment = fobj.getTextAlign();
@@ -108,7 +108,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
return textAlignment;
}
}
-
+
/**
* Private class to store information about inline breaks.
* Each value holds the start and end indexes into a List of
@@ -148,7 +148,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
spaceAfter = sa;
baseline = bl;
}
-
+
}
@@ -181,7 +181,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
/**
* this constant is used to create elements when text-align is center:
- * every TextLM descendant of LineLM must use the same value,
+ * every TextLM descendant of LineLM must use the same value,
* otherwise the line breaking algorithm does not find the right
* break point
*/
@@ -205,7 +205,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// this class represents a paragraph
private class Paragraph extends InlineKnuthSequence {
- /** Number of elements to ignore at the beginning of the list. */
+ /** Number of elements to ignore at the beginning of the list. */
private int ignoreAtStart = 0;
/** Number of elements to ignore at the end of the list. */
private int ignoreAtEnd = 0;
@@ -233,11 +233,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// set the minimum amount of empty space at the end of the
// last line
if (textAlignment == EN_CENTER) {
- lineFiller = new MinOptMax(lastLineEndIndent);
+ lineFiller = new MinOptMax(lastLineEndIndent);
} else {
- lineFiller = new MinOptMax(lastLineEndIndent,
- lastLineEndIndent,
- layoutManager.iLineWidth);
+ lineFiller = new MinOptMax(lastLineEndIndent,
+ lastLineEndIndent,
+ layoutManager.iLineWidth);
}
// add auxiliary elements at the beginning of the paragraph
@@ -251,7 +251,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// at the beginning of the first paragraph
if (isFirstInBlock && knuthParagraphs.size() == 0
&& textIndent != 0) {
- this.add(new KnuthInlineBox(textIndent, null,
+ this.add(new KnuthInlineBox(textIndent, null,
null, false));
ignoreAtStart++;
}
@@ -277,10 +277,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// add the elements representing the space
// at the end of the last line
// and the forced break
- this.add(new KnuthPenalty(0, KnuthElement.INFINITE,
+ this.add(new KnuthPenalty(0, KnuthElement.INFINITE,
false, null, false));
- this.add(new KnuthGlue(0,
- lineFiller.max - lineFiller.opt,
+ this.add(new KnuthGlue(0,
+ lineFiller.max - lineFiller.opt,
lineFiller.opt - lineFiller.min, null, false));
this.add(new KnuthPenalty(lineFiller.opt, -KnuthElement.INFINITE,
false, null, false));
@@ -339,7 +339,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
follow = fl;
thisLLM = llm;
activePossibility = -1;
- maxDiff = fobj.getWidows() >= fobj.getOrphans()
+ maxDiff = fobj.getWidows() >= fobj.getOrphans()
? fobj.getWidows()
: fobj.getOrphans();
}
@@ -382,7 +382,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
if (log.isWarnEnabled()) {
- int lack = difference + bestActiveNode.availableShrink;
+ int lack = difference + bestActiveNode.availableShrink;
if (lack < 0) {
InlineLevelEventProducer eventProducer
= InlineLevelEventProducer.Provider.get(
@@ -391,15 +391,15 @@ public class LineLayoutManager extends InlineStackingLayoutManager
-lack, getFObj().getLocator());
}
}
-
- //log.debug("LLM> (" + (lineLayouts.getLineNumber(activePossibility) - addedPositions)
+
+ //log.debug("LLM> (" + (lineLayouts.getLineNumber(activePossibility) - addedPositions)
// + ") difference = " + difference + " ratio = " + ratio);
lineLayouts.addBreakPosition(makeLineBreakPosition(par,
(bestActiveNode.line > 1 ? bestActiveNode.previous.position + 1 : 0),
bestActiveNode.position,
- bestActiveNode.availableShrink - (addedPositions > 0
- ? 0 : ((Paragraph)par).lineFiller.opt - ((Paragraph)par).lineFiller.min),
- bestActiveNode.availableStretch,
+ bestActiveNode.availableShrink - (addedPositions > 0
+ ? 0 : ((Paragraph)par).lineFiller.opt - ((Paragraph)par).lineFiller.min),
+ bestActiveNode.availableStretch,
difference, ratio, indent), activePossibility);
addedPositions++;
}
@@ -413,8 +413,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager
private LineBreakPosition makeLineBreakPosition(KnuthSequence par,
int firstElementIndex,
int lastElementIndex,
- int availableShrink,
- int availableStretch,
+ int availableShrink,
+ int availableStretch,
int difference,
double ratio,
int indent) {
@@ -424,7 +424,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
int spaceAfter = lineHeight - lead - follow - spaceBefore;
// height before the main baseline
int lineLead = lead;
- // maximum follow
+ // maximum follow
int lineFollow = follow;
// true if this line contains only zero-height, auxiliary boxes
// and the actual line width is 0; in this case, the line "collapses"
@@ -492,7 +492,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
firstElementIndex, lastElementIndex,
availableShrink, availableStretch,
difference, ratio, 0, indent,
- lineLead + lineFollow,
+ lineLead + lineFollow,
iLineWidth, spaceBefore, spaceAfter,
lineLead);
}
@@ -501,7 +501,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
public int findBreakingPoints(Paragraph par, /*int lineWidth,*/
double threshold, boolean force,
int allowedBreaks) {
- return super.findBreakingPoints(par, /*lineWidth,*/
+ return super.findBreakingPoints(par, /*lineWidth,*/
threshold, force, allowedBreaks);
}
@@ -548,9 +548,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
}
-
+
private int constantLineHeight = 12000;
-
+
/**
* Create a new Line Layout Manager.
@@ -641,19 +641,19 @@ public class LineLayoutManager extends InlineStackingLayoutManager
*/
private void collectInlineKnuthElements(LayoutContext context) {
LayoutContext inlineLC = new LayoutContext(context);
-
+
InlineLevelLayoutManager curLM;
List returnedList = null;
iLineWidth = context.getStackLimitIP().opt;
-
+
// convert all the text in a sequence of paragraphs made
// of KnuthBox, KnuthGlue and KnuthPenalty objects
boolean bPrevWasKnuthBox = false;
-
+
StringBuffer trace = new StringBuffer("LineLM:");
-
+
Paragraph lastPar = null;
-
+
while ((curLM = (InlineLevelLayoutManager) getChildLM()) != null) {
returnedList = curLM.getNextKnuthElements(inlineLC, effectiveAlignment);
if (returnedList == null
@@ -663,10 +663,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
* so just iterate once more to see if there are other children */
continue;
}
-
+
if (lastPar != null) {
KnuthSequence firstSeq = (KnuthSequence) returnedList.get(0);
-
+
// finish last paragraph before a new block sequence
if (!firstSeq.isInlineSequence()) {
lastPar.endParagraph();
@@ -677,7 +677,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
bPrevWasKnuthBox = false;
}
-
+
// does the first element of the first paragraph add to an existing word?
if (lastPar != null) {
KnuthElement thisElement;
@@ -688,28 +688,28 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
}
}
-
+
// loop over the KnuthSequences (and single KnuthElements) in returnedList
ListIterator iter = returnedList.listIterator();
while (iter.hasNext()) {
KnuthSequence sequence = (KnuthSequence) iter.next();
// the sequence contains inline Knuth elements
if (sequence.isInlineSequence()) {
- // look at the last element
+ // look at the last element
ListElement lastElement = sequence.getLast();
if (lastElement == null) {
throw new NullPointerException(
"Sequence was empty! lastElement is null");
}
- bPrevWasKnuthBox = lastElement.isBox()
- && !((KnuthElement) lastElement).isAuxiliary()
+ bPrevWasKnuthBox = lastElement.isBox()
+ && !((KnuthElement) lastElement).isAuxiliary()
&& ((KnuthElement) lastElement).getW() != 0;
-
+
// if last paragraph is open, add the new elements to the paragraph
// else this is the last paragraph
- if (lastPar == null) {
- lastPar = new Paragraph(this,
- textAlignment, textAlignmentLast,
+ if (lastPar == null) {
+ lastPar = new Paragraph(this,
+ textAlignment, textAlignmentLast,
textIndent.getValue(this),
lastLineEndIndent.getValue(this));
lastPar.startSequence();
@@ -725,7 +725,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
if (log.isTraceEnabled()) {
trace.append(" I");
}
-
+
// finish last paragraph if it was closed with a linefeed
if (lastElement.isPenalty()
&& ((KnuthPenalty) lastElement).getP()
@@ -735,7 +735,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// which forces a line break
lastPar.removeLast();
if (!lastPar.containsBox()) {
- //only a forced linefeed on this line
+ //only a forced linefeed on this line
//-> compensate with an auxiliary glue
lastPar.add(new KnuthGlue(iLineWidth, 0, iLineWidth, null, true));
}
@@ -765,11 +765,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
log.trace(trace);
}
-
+
/**
* Find a set of breaking points.
- * This method is called only once by getNextBreakPoss, and it
- * subsequently calls the other findBreakingPoints() method with
+ * This method is called only once by getNextBreakPoss, and it
+ * subsequently calls the other findBreakingPoints() method with
* different parameters, until a set of breaking points is found.
*
* @param par the list of elements that must be parted
@@ -805,7 +805,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
}
}
-
+
private boolean findBreakingPoints(Paragraph par, int lineWidth,
double threshold, boolean force) {
KnuthParagraph knuthPara = new KnuthParagraph(par);
@@ -813,11 +813,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
if (lines == 0) {
return false;
}
-
+
for (int i = lines-1; i >= 0; i--) {
int line = i+1;
if (log.isTraceEnabled()) {
- log.trace("Making line from " + knuthPara.getStart(i) + " to " +
+ log.trace("Making line from " + knuthPara.getStart(i) + " to " +
knuthPara.getEnd(i));
}
// compute indent and adjustment ratio, according to
@@ -826,7 +826,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
int difference = knuthPara.getDifference(i);
if (line == lines) {
difference += par.lineFillerWidth;
- }
+ }
int textAlign = (line < lines)
? textAlignment : textAlignmentLast;
int indent = (textAlign == EN_CENTER)
@@ -841,7 +841,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
int end = knuthPara.getEnd(i);
makeLineBreakPosition(par, start, end, 0, ratio, indent);
}
- return true;
+ return true;
}
private void makeLineBreakPosition(Paragraph par,
@@ -893,7 +893,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineLead));
}*/
-
+
/**
* Phase 2 of Knuth algorithm: find optimal break points.
* @param alignment alignment in BP direction of the paragraph
@@ -918,9 +918,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
lineLayoutsList.add(0, llPoss);
}
-
+
setFinished(true);
-
+
//Post-process the line breaks found
return postProcessLineBreaks(alignment, context);
}
@@ -944,12 +944,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager
hyphenationLadderCount.getEnum() == EN_NO_LIMIT
? 0 : hyphenationLadderCount.getValue(),
this);
-
- if (hyphenationProperties.hyphenate.getEnum() == EN_TRUE
+
+ if (hyphenationProperties.hyphenate.getEnum() == EN_TRUE
&& fobj.getWrapOption() != EN_NO_WRAP) {
findHyphenationPoints(currPar);
}
-
+
// first try
int allowedBreaks;
if (wrapOption == EN_NO_WRAP) {
@@ -969,7 +969,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// the first try failed
log.debug("No set of breaking points found with maxAdjustment = " + maxAdjustment);
}
-
+
// now try something different
log.debug("Hyphenation possible? " + (hyphenationProperties.hyphenate.getEnum() == EN_TRUE));
if (hyphenationProperties.hyphenate.getEnum() == EN_TRUE
@@ -980,7 +980,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// try with a higher threshold
maxAdjustment = 5;
}
-
+
if ((iBPcount
= alg.findBreakingPoints(currPar,
maxAdjustment, false, allowedBreaks)) == 0) {
@@ -998,12 +998,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager
= alg.findBreakingPoints(currPar,
maxAdjustment, true, allowedBreaks);
}
-
+
// use non-hyphenated breaks, when possible
lineLayouts.restorePossibilities();
-
+
/* extension (not in the XSL FO recommendation): if vertical alignment
- is justify and the paragraph has only one layout, try using
+ is justify and the paragraph has only one layout, try using
shorter or longer lines */
//TODO This code snippet is disabled. Reenable?
if (false && alignment == EN_JUSTIFY && textAlignment == EN_JUSTIFY) {
@@ -1048,9 +1048,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
* @return the newly built element list
*/
private List postProcessLineBreaks(int alignment, LayoutContext context) {
-
+
List returnList = new LinkedList();
-
+
for (int p = 0; p < knuthParagraphs.size(); p++) {
// penalty between paragraphs
if (p > 0) {
@@ -1061,7 +1061,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
new Position(this), penalty, context));
}
}
-
+
LineLayoutPossibilities llPoss;
llPoss = (LineLayoutPossibilities) lineLayoutsList.get(p);
KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(p);
@@ -1078,10 +1078,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
targetList.add(tempElement);
}
- returnList.addAll(targetList);
+ returnList.addAll(targetList);
} else if (seq.isInlineSequence() && alignment == EN_JUSTIFY) {
/* justified vertical alignment (not in the XSL FO recommendation):
- create a multi-layout sequence whose elements will contain
+ create a multi-layout sequence whose elements will contain
a conventional Position */
Position returnPosition = new LeafPosition(this, p);
createElements(returnList, llPoss, returnPosition);
@@ -1107,7 +1107,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
int endIndex
= ((LineBreakPosition) llPoss.getChosenPosition(i)).getLeafPos();
- // create a list of the FootnoteBodyLM handling footnotes
+ // create a list of the FootnoteBodyLM handling footnotes
// whose citations are in this line
List footnoteList = new LinkedList();
ListIterator elementIterator = seq.listIterator(startIndex);
@@ -1138,7 +1138,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
}
}
-
+
return returnList;
}
@@ -1286,7 +1286,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
public int getKeepTogetherStrength() {
return ((BlockLevelLayoutManager) getParent()).getKeepTogetherStrength();
}
-
+
/** {@inheritDoc} */
public boolean mustKeepWithPrevious() {
return getKeepWithPreviousStrength() > KEEP_AUTO;
@@ -1306,7 +1306,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
LeafPosition pos = (LeafPosition)lastElement.getPosition();
@@ -1331,7 +1331,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
List returnList = new LinkedList();
@@ -1354,8 +1354,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager
MinOptMax contentIPD;
if (alignment == EN_JUSTIFY) {
contentIPD = new MinOptMax(
- lbp.lineWidth - lbp.difference - lbp.availableShrink,
- lbp.lineWidth - lbp.difference,
+ lbp.lineWidth - lbp.difference - lbp.availableShrink,
+ lbp.lineWidth - lbp.difference,
lbp.lineWidth - lbp.difference + lbp.availableStretch);
} else if (alignment == EN_CENTER) {
contentIPD = new MinOptMax(lbp.lineWidth - 2 * lbp.startIndent);
@@ -1397,10 +1397,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// find all hyphenation points
while (currParIterator.hasNext()) {
firstElement = (KnuthElement) currParIterator.next();
- //
+ //
if (firstElement.getLayoutManager() != currLM) {
currLM = (InlineLevelLayoutManager) firstElement.getLayoutManager();
- if (currLM != null) {
+ if (currLM != null) {
updateList.add(new Update(currLM, currParIterator.previousIndex()));
} else {
break;
@@ -1409,7 +1409,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
break;
}
//TODO Something's not right here. See block_hyphenation_linefeed_preserve.xml
-
+
// collect word fragments, ignoring auxiliary elements;
// each word fragment was created by a different TextLM
if (firstElement.isBox() && !firstElement.isAuxiliary()) {
@@ -1432,7 +1432,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
} else if (!nextElement.isAuxiliary()) {
// a non-auxiliary non-box KnuthElement: stop
// go back to the last box or auxiliary element
- currParIterator.previous();
+ currParIterator.previous();
break;
} else {
if (currLM != nextElement.getLayoutManager()) {
@@ -1475,7 +1475,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
//int iRemovedElements = 0;
while (updateListIterator.hasNext()) {
- // ask the LMs to apply the changes and return
+ // ask the LMs to apply the changes and return
// the new KnuthElements to replace the old ones
currUpdate = (Update) updateListIterator.next();
int fromIndex = currUpdate.iFirstIndex;
@@ -1584,11 +1584,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
} else if ((pos instanceof NonLeafPosition) && pos.generatesAreas()) {
addBlockArea(context, pos, isLastPosition);
} else {
- /*
+ /*
* pos was the Position inside a penalty item, nothing to do;
* or Pos does not generate an area,
* i.e. it stand for spaces, borders and padding.
- */
+ */
}
}
setCurrentArea(null); // ?? necessary
@@ -1605,14 +1605,14 @@ public class LineLayoutManager extends InlineStackingLayoutManager
KnuthElement tempElement = null;
// the TLM which created the last KnuthElement in this line
LayoutManager lastLM = null;
-
+
LineBreakPosition lbp = (LineBreakPosition) pos;
int iCurrParIndex;
iCurrParIndex = lbp.iParIndex;
KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(iCurrParIndex);
int iStartElement = lbp.iStartIndex;
int iEndElement = lbp.getLeafPos();
-
+
LineArea lineArea
= new LineArea((lbp.getLeafPos() < seq.size() - 1
? textAlignment : textAlignmentLast),
@@ -1625,12 +1625,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineArea.addTrait(Trait.SPACE_BEFORE, new Integer(lbp.spaceBefore));
lineArea.addTrait(Trait.SPACE_AFTER, new Integer(lbp.spaceAfter));
alignmentContext.resizeLine(lbp.lineHeight, lbp.baseline);
-
+
if (seq instanceof Paragraph) {
Paragraph currPar = (Paragraph) seq;
// ignore the first elements added by the LineLayoutManager
iStartElement += (iStartElement == 0) ? currPar.ignoreAtStart : 0;
-
+
// if this is the last line area that for this paragraph,
// ignore the last elements added by the LineLayoutManager and
// subtract the last-line-end-indent from the area ipd
@@ -1639,10 +1639,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineArea.setIPD(lineArea.getIPD() - lastLineEndIndent.getValue(this));
}
}
-
+
// Remove trailing spaces if allowed so
if (whiteSpaceTreament == EN_IGNORE_IF_SURROUNDING_LINEFEED
- || whiteSpaceTreament == EN_IGNORE
+ || whiteSpaceTreament == EN_IGNORE
|| whiteSpaceTreament == EN_IGNORE_IF_BEFORE_LINEFEED) {
// ignore the last element in the line if it is a KnuthGlue object
seqIterator = seq.listIterator(iEndElement);
@@ -1661,10 +1661,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lastLM = tempElement.getLayoutManager();
}
}
-
+
// Remove leading spaces if allowed so
if (whiteSpaceTreament == EN_IGNORE_IF_SURROUNDING_LINEFEED
- || whiteSpaceTreament == EN_IGNORE
+ || whiteSpaceTreament == EN_IGNORE
|| whiteSpaceTreament == EN_IGNORE_IF_AFTER_LINEFEED) {
// ignore KnuthGlue and KnuthPenalty objects
// at the beginning of the line
@@ -1678,13 +1678,13 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// Add the inline areas to lineArea
PositionIterator inlinePosIter
= new KnuthPossPosIter(seq, iStartElement, iEndElement + 1);
-
+
iStartElement = lbp.getLeafPos() + 1;
if (iStartElement == seq.size()) {
// advance to next paragraph
iStartElement = 0;
}
-
+
LayoutContext lc = new LayoutContext(0);
lc.setAlignmentContext(alignmentContext);
lc.setSpaceAdjust(lbp.dAdjust);
@@ -1692,7 +1692,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lc.setLeadingSpace(new SpaceSpecifier(true));
lc.setTrailingSpace(new SpaceSpecifier(false));
lc.setFlags(LayoutContext.RESOLVE_LEADING_SPACE, true);
-
+
/*
* extension (not in the XSL FO recommendation): if the left and right margins
* have been optimized, recompute indents and / or adjust ratio, according
@@ -1718,11 +1718,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent));
} else if (false && textAlignment == EN_END) {
// re-compute indent
- int updatedIndent = lbp.startIndent
+ int updatedIndent = lbp.startIndent
+ (context.getStackLimitIP().opt - lbp.lineWidth);
lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent));
}
-
+
setCurrentArea(lineArea);
setChildContext(lc);
LayoutManager childLM;
@@ -1732,9 +1732,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lc.setLeadingSpace(lc.getTrailingSpace());
lc.setTrailingSpace(new SpaceSpecifier(false));
}
-
+
// when can this be null?
- // if display-align is distribute, add space after
+ // if display-align is distribute, add space after
if (context.getSpaceAfter() > 0
&& (!context.isLastArea() || !isLastPosition)) {
lineArea.setBPD(lineArea.getBPD() + context.getSpaceAfter());
@@ -1742,7 +1742,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineArea.finalise();
parentLM.addChildArea(lineArea);
}
-
+
/**
* Add a line with block content
* @param context the context for adding areas
@@ -1766,13 +1766,13 @@ public class LineLayoutManager extends InlineStackingLayoutManager
if (isLastPosition) {
lastLM = innerPosition.getLM();
}
-
+
LineArea lineArea = new LineArea();
setCurrentArea(lineArea);
LayoutContext lc = new LayoutContext(0);
lc.setAlignmentContext(alignmentContext);
setChildContext(lc);
-
+
PositionIterator childPosIter = new StackingIter(positionList.listIterator());
LayoutContext blocklc = new LayoutContext(0);
blocklc.setLeadingSpace(new SpaceSpecifier(true));
@@ -1810,14 +1810,14 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
// --------- Property Resolution related functions --------- //
-
+
/**
* {@inheritDoc}
*/
public boolean getGeneratesBlockArea() {
return true;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
index 59dd9c3c4..c1b81c4ab 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
@@ -29,7 +29,7 @@ public class LineLayoutPossibilities {
/** logger instance */
protected static Log log = LogFactory.getLog(LineLayoutPossibilities.class);
-
+
private class Possibility {
private int lineCount;
private double demerits;
@@ -50,8 +50,8 @@ public class LineLayoutPossibilities {
}
private void addBreakPosition(Position pos) {
- // Positions are always added with index 0 because
- // they are created backward, from the last one to
+ // Positions are always added with index 0 because
+ // they are created backward, from the last one to
// the first one
breakPositions.add(0, pos);
}
@@ -74,7 +74,7 @@ public class LineLayoutPossibilities {
savedPossibilities = new java.util.ArrayList();
optimumIndex = -1;
}
-
+
public void addPossibility(int ln, double dem) {
possibilitiesList.add(new Possibility(ln, dem));
if (possibilitiesList.size() == 1) {
@@ -145,8 +145,8 @@ public class LineLayoutPossibilities {
} else {
// this should not happen
log.error("LineLayoutPossibilities restorePossibilities(),"
- + " min= " + getMinLineCount()
- + " max= " + getMaxLineCount()
+ + " min= " + getMinLineCount()
+ + " max= " + getMaxLineCount()
+ " restored= " + restoredPossibility.getLineCount());
return;
}
@@ -158,7 +158,7 @@ public class LineLayoutPossibilities {
chosenIndex = optimumIndex;
}
}
- //log.debug(">> minLineCount = " + getMinLineCount()
+ //log.debug(">> minLineCount = " + getMinLineCount()
// + " optLineCount = " + getOptLineCount() + " maxLineCount() = " + getMaxLineCount());
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java
index 331d48b75..d33f2cca1 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -43,13 +43,13 @@ public class PageNumberCitationLastLayoutManager extends AbstractPageNumberCitat
super(node);
fobj = node;
}
-
+
/** {@inheritDoc} */
public InlineArea get(LayoutContext context) {
curArea = getPageNumberCitationLastInlineArea(parentLM);
return curArea;
}
-
+
/**
* if id can be resolved then simply return a word, otherwise
* return a resolvable area
@@ -71,12 +71,12 @@ public class PageNumberCitationLastLayoutManager extends AbstractPageNumberCitat
int width = getStringWidth(str);
text.addWord(str, 0);
text.setIPD(width);
-
+
resolved = true;
}
-
+
updateTextAreaTraits(text);
-
+
return text;
}
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java
index 8e6633ab8..583f73d24 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,13 +41,13 @@ public class PageNumberCitationLayoutManager extends AbstractPageNumberCitationL
public PageNumberCitationLayoutManager(PageNumberCitation node) {
super(node);
}
-
+
/** {@inheritDoc} */
public InlineArea get(LayoutContext context) {
curArea = getPageNumberCitationInlineArea();
return curArea;
}
-
+
/**
* if id can be resolved then simply return a word, otherwise
* return a resolvable area
@@ -71,9 +71,9 @@ public class PageNumberCitationLayoutManager extends AbstractPageNumberCitationL
text.setIPD(width);
}
updateTextAreaTraits(text);
-
+
return text;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java
index 1aaaaf527..6b0e88cbb 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,10 +34,10 @@ import org.apache.fop.traits.MinOptMax;
* LayoutManager for the fo:page-number formatting object
*/
public class PageNumberLayoutManager extends LeafNodeLayoutManager {
-
+
private PageNumber fobj;
private Font font;
-
+
/**
* Constructor
*
@@ -48,7 +48,7 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
super(node);
fobj = node;
}
-
+
/** {@inheritDoc} */
public void initialize() {
FontInfo fi = fobj.getFOEventHandler().getFontInfo();
@@ -84,13 +84,13 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
text.setBPD(font.getAscender() - font.getDescender());
text.setBaselineOffset(font.getAscender());
TraitSetter.addFontTraits(text, font);
- text.addTrait(Trait.COLOR, fobj.getColor());
+ text.addTrait(Trait.COLOR, fobj.getColor());
TraitSetter.addTextDecoration(text, fobj.getTextDecoration());
return text;
}
-
+
/** {@inheritDoc} */
protected InlineArea getEffectiveArea() {
TextArea baseArea = (TextArea)curArea;
@@ -108,7 +108,7 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
updateContent(ta);
return ta;
}
-
+
private void updateContent(TextArea area) {
// get the page number of the page actually being built
area.removeText();
@@ -130,6 +130,6 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
}
return width;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java
index 25bcb7d0e..a2a1dce27 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,19 +23,19 @@ import org.apache.fop.datatypes.Length;
/**
* The FOP specific incarnation of the XSL-FO scaled baseline table.
- * All baseline tables are scaled to the font size of the font they
- * apply to. This interface uses a coordinate system with its origin
+ * All baseline tables are scaled to the font size of the font they
+ * apply to. This interface uses a coordinate system with its origin
* where the dominant baseline intersects the start edge of the box.
* All measurements are in mpt.
*/
public interface ScaledBaselineTable {
-
+
/**
* Return the dominant baseline identifer for this alignment context.
* @return the dominant baseline identifier
*/
int getDominantBaselineIdentifier();
-
+
/**
* Return the writing mode for this aligment context.
* @return the writing mode
@@ -49,7 +49,7 @@ public interface ScaledBaselineTable {
* @return the baseline offset
*/
int getBaseline(int baselineIdentifier);
-
+
/**
* Sets the position of the before and after baselines.
* This is usually only done for line areas. For other
@@ -59,7 +59,7 @@ public interface ScaledBaselineTable {
* @param afterBaseline the offset of the after-edge baseline from the dominant baseline
*/
void setBeforeAndAfterBaselines(int beforeBaseline, int afterBaseline);
-
+
/**
* Return a new baseline table for the given baseline based
* on the current baseline table.
diff --git a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java
index e47f107e3..1536552c4 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,7 +44,7 @@ public class ScaledBaselineTableFactory implements Constants {
return new BasicScaledBaselineTable(font.getAscender(), font.getDescender()
, font.getXHeight(), dominantBaselineIdentifier, writingMode);
}
-
+
/**
* Creates a new instance of BasicScaledBaselineTable for the given
* font and writingmode. It assumes an alphabetic baseline.
@@ -55,7 +55,7 @@ public class ScaledBaselineTableFactory implements Constants {
public static ScaledBaselineTable makeFontScaledBaselineTable(Font font, int writingMode) {
return makeFontScaledBaselineTable(font, EN_ALPHABETIC, writingMode);
}
-
+
/**
* Creates a new instance of BasicScaledBaselineTable for the given
* height, baseline and writingmode. This is used for non font based areas like
@@ -71,5 +71,5 @@ public class ScaledBaselineTableFactory implements Constants {
return new BasicScaledBaselineTable(height, 0, height
, dominantBaselineIdentifier, writingMode);
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
index c6210edce..459bce0e8 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
@@ -203,7 +203,7 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
public void initialize() {
this.foText.resetBuffer();
-
+
this.spaceFont = FontSelector.selectFontForCharacterInText(' ', this.foText, this);
// With CID fonts, space isn't neccesary currentFontState.width(32)
diff --git a/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java
index 342e0a6f1..97f07da54 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,7 @@ import java.util.LinkedList;
* This is the layout manager for the fo:wrapper formatting object.
*/
public class WrapperLayoutManager extends LeafNodeLayoutManager {
-
+
/**
* Creates a new LM for fo:wrapper.
* @param node the fo:wrapper
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
index 11e69970e..1cd3ab9d2 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.list;
import java.util.Iterator;
@@ -48,7 +48,7 @@ import org.apache.fop.traits.SpaceVal;
* A list block contains list items which are stacked within
* the list block area..
*/
-public class ListBlockLayoutManager extends BlockStackingLayoutManager
+public class ListBlockLayoutManager extends BlockStackingLayoutManager
implements ConditionalElementListener {
/**
@@ -102,38 +102,38 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
foSpaceAfter = new SpaceVal(
getListBlockFO().getCommonMarginBlock().spaceAfter, this).getSpace();
startIndent = getListBlockFO().getCommonMarginBlock().startIndent.getValue(this);
- endIndent = getListBlockFO().getCommonMarginBlock().endIndent.getValue(this);
+ endIndent = getListBlockFO().getCommonMarginBlock().endIndent.getValue(this);
}
private void resetSpaces() {
- this.discardBorderBefore = false;
- this.discardBorderAfter = false;
- this.discardPaddingBefore = false;
+ this.discardBorderBefore = false;
+ this.discardBorderAfter = false;
+ this.discardPaddingBefore = false;
this.discardPaddingAfter = false;
this.effSpaceBefore = null;
this.effSpaceAfter = null;
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
- resetSpaces();
+ resetSpaces();
List returnList = super.getNextKnuthElements(context, alignment);
//fox:widow-content-limit
- int widowRowLimit = getListBlockFO().getWidowContentLimit().getValue();
+ int widowRowLimit = getListBlockFO().getWidowContentLimit().getValue();
if (widowRowLimit != 0) {
ElementListUtils.removeLegalBreaks(returnList, widowRowLimit);
}
//fox:orphan-content-limit
- int orphanRowLimit = getListBlockFO().getOrphanContentLimit().getValue();
+ int orphanRowLimit = getListBlockFO().getOrphanContentLimit().getValue();
if (orphanRowLimit != 0) {
ElementListUtils.removeLegalBreaksFromEnd(returnList, orphanRowLimit);
}
return returnList;
}
-
+
/** {@inheritDoc} */
public List getChangedKnuthElements(List oldList, int alignment) {
//log.debug("LBLM.getChangedKnuthElements>");
@@ -169,7 +169,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
Position lastPos = null;
// "unwrap" the NonLeafPositions stored in parentIter
- // and put them in a new list;
+ // and put them in a new list;
LinkedList positionList = new LinkedList();
Position pos;
while (parentIter.hasNext()) {
@@ -208,17 +208,17 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
// We are done with this area add the background
- TraitSetter.addBackground(curBlockArea,
+ TraitSetter.addBackground(curBlockArea,
getListBlockFO().getCommonBorderPaddingBackground(),
this);
- TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
+ TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
effSpaceBefore, effSpaceAfter);
flush();
curBlockArea = null;
resetSpaces();
-
+
checkEndOfLayout(lastPos);
}
@@ -238,30 +238,30 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
public Area getParentArea(Area childArea) {
if (curBlockArea == null) {
curBlockArea = new Block();
-
+
// Set up dimensions
// Must get dimensions from parent area
/*Area parentArea =*/ parentLM.getParentArea(curBlockArea);
// set traits
TraitSetter.setProducerID(curBlockArea, getListBlockFO().getId());
- TraitSetter.addBorders(curBlockArea,
- getListBlockFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addBorders(curBlockArea,
+ getListBlockFO().getCommonBorderPaddingBackground(),
discardBorderBefore, discardBorderAfter, false, false, this);
- TraitSetter.addPadding(curBlockArea,
- getListBlockFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addPadding(curBlockArea,
+ getListBlockFO().getCommonBorderPaddingBackground(),
discardPaddingBefore, discardPaddingAfter, false, false, this);
TraitSetter.addMargins(curBlockArea,
- getListBlockFO().getCommonBorderPaddingBackground(),
+ getListBlockFO().getCommonBorderPaddingBackground(),
getListBlockFO().getCommonMarginBlock(),
this);
- TraitSetter.addBreaks(curBlockArea,
- getListBlockFO().getBreakBefore(),
+ TraitSetter.addBreaks(curBlockArea,
+ getListBlockFO().getBreakBefore(),
getListBlockFO().getBreakAfter());
-
+
int contentIPD = referenceIPD - getIPIndents();
curBlockArea.setIPD(contentIPD);
-
+
setCurrentArea(curBlockArea);
}
return curBlockArea;
@@ -285,7 +285,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KeepUtil.getCombinedBlockLevelKeepStrength(getListBlockFO().getKeepWithNext());
@@ -300,13 +300,13 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
public void notifySpace(RelSide side, MinOptMax effectiveLength) {
if (RelSide.BEFORE == side) {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceBefore + "-> " + effectiveLength);
}
this.effSpaceBefore = effectiveLength;
} else {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceAfter + "-> " + effectiveLength);
}
this.effSpaceAfter = effectiveLength;
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
index 124827976..0a2dec945 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.list;
import java.util.Iterator;
@@ -85,7 +85,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
protected AbstractListItemPart getPartFO() {
return (AbstractListItemPart)fobj;
}
-
+
/**
* Set the x offset of this list item.
* This offset is used to set the absolute position
@@ -114,7 +114,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
public void addAreas(PositionIterator parentIter,
LayoutContext layoutContext) {
getParentArea(null);
-
+
addId();
LayoutManager childLM;
@@ -125,7 +125,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
Position lastPos = null;
// "unwrap" the NonLeafPositions stored in parentIter
- // and put them in a new list;
+ // and put them in a new list;
LinkedList positionList = new LinkedList();
Position pos;
while (parentIter.hasNext()) {
@@ -154,7 +154,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
}
addMarkersToPage(true, isFirst(firstPos), isLast(lastPos));
-
+
StackingIter childPosIter = new StackingIter(positionList.listIterator());
while ((childLM = childPosIter.getNextChildLM()) != null) {
// Add the block areas to Area
@@ -167,11 +167,11 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
}
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
-
+
flush();
curBlockArea = null;
-
+
checkEndOfLayout(lastPos);
}
@@ -198,7 +198,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
//curBlockArea.setHeight();
TraitSetter.setProducerID(curBlockArea, getPartFO().getId());
-
+
// Set up dimensions
Area parentArea = parentLM.getParentArea(curBlockArea);
int referenceIPD = parentArea.getIPD();
@@ -226,7 +226,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
index 37ec4964d..f027922f7 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -59,7 +59,7 @@ import org.apache.fop.traits.SpaceVal;
* LayoutManager for a list-item FO.
* The list item contains a list item label and a list item body.
*/
-public class ListItemLayoutManager extends BlockStackingLayoutManager
+public class ListItemLayoutManager extends BlockStackingLayoutManager
implements ConditionalElementListener {
/**
@@ -81,19 +81,19 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
private boolean discardPaddingAfter;
private MinOptMax effSpaceBefore;
private MinOptMax effSpaceAfter;
-
+
private int keepWithNextPendingOnLabel;
private int keepWithNextPendingOnBody;
private int listItemHeight;
-
+
private class ListItemPosition extends Position {
private int iLabelFirstIndex;
private int iLabelLastIndex;
private int iBodyFirstIndex;
private int iBodyLastIndex;
- public ListItemPosition(LayoutManager lm, int labelFirst, int labelLast,
+ public ListItemPosition(LayoutManager lm, int labelFirst, int labelLast,
int bodyFirst, int bodyLast) {
super(lm);
iLabelFirstIndex = labelFirst;
@@ -101,11 +101,11 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
iBodyFirstIndex = bodyFirst;
iBodyLastIndex = bodyLast;
}
-
+
public int getLabelFirstIndex() {
return iLabelFirstIndex;
}
-
+
public int getLabelLastIndex() {
return iLabelLastIndex;
}
@@ -113,11 +113,11 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
public int getBodyFirstIndex() {
return iBodyFirstIndex;
}
-
+
public int getBodyLastIndex() {
return iBodyLastIndex;
}
-
+
/** {@inheritDoc} */
public boolean generatesAreas() {
return true;
@@ -166,7 +166,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
* @param node the fo:list-item-body FO
*/
public void setBody(ListItemBody node) {
- body = new ListItemContentLayoutManager(node);
+ body = new ListItemContentLayoutManager(node);
body.setParent(this);
}
@@ -177,25 +177,25 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
foSpaceAfter = new SpaceVal(
getListItemFO().getCommonMarginBlock().spaceAfter, this).getSpace();
startIndent = getListItemFO().getCommonMarginBlock().startIndent.getValue(this);
- endIndent = getListItemFO().getCommonMarginBlock().endIndent.getValue(this);
+ endIndent = getListItemFO().getCommonMarginBlock().endIndent.getValue(this);
}
private void resetSpaces() {
- this.discardBorderBefore = false;
- this.discardBorderAfter = false;
- this.discardPaddingBefore = false;
+ this.discardBorderBefore = false;
+ this.discardBorderAfter = false;
+ this.discardPaddingBefore = false;
this.discardPaddingAfter = false;
this.effSpaceBefore = null;
this.effSpaceAfter = null;
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
referenceIPD = context.getRefIPD();
LayoutContext childLC;
-
+
List returnList = new LinkedList();
-
+
if (!breakBeforeServed) {
try {
if (addKnuthElementsForBreakBefore(returnList, context)) {
@@ -207,7 +207,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
addKnuthElementsForSpaceBefore(returnList, alignment);
-
+
addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed);
firstVisibleMarkServed = true;
@@ -219,12 +219,12 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
childLC.setRefIPD(context.getRefIPD());
label.initialize();
labelList = label.getNextKnuthElements(childLC, alignment);
-
+
//Space resolution as if the contents were placed in a new reference area
//(see 6.8.3, XSL 1.0, section on Constraints, last paragraph)
SpaceResolver.resolveElementList(labelList);
ElementListObserver.observe(labelList, "list-item-label", label.getPartFO().getId());
-
+
context.updateKeepWithPreviousPending(childLC.getKeepWithPreviousPending());
this.keepWithNextPendingOnLabel = childLC.getKeepWithNextPending();
@@ -238,7 +238,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
//(see 6.8.3, XSL 1.0, section on Constraints, last paragraph)
SpaceResolver.resolveElementList(bodyList);
ElementListObserver.observe(bodyList, "list-item-body", body.getPartFO().getId());
-
+
context.updateKeepWithPreviousPending(childLC.getKeepWithPreviousPending());
this.keepWithNextPendingOnBody = childLC.getKeepWithNextPending();
@@ -247,7 +247,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
// "wrap" the Position inside each element
wrapPositionElements(returnedList, returnList, true);
-
+
addKnuthElementsForBorderPaddingAfter(returnList, true);
addKnuthElementsForSpaceAfter(returnList, alignment);
addKnuthElementsForBreakAfter(returnList, context);
@@ -280,7 +280,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
LinkedList returnList = new LinkedList();
while ((step = getNextStep(elementLists, start, end, partialHeights)) > 0) {
-
+
if (end[0] + 1 == elementLists[0].size()) {
keepWithNextActive = Math.max(keepWithNextActive, keepWithNextPendingOnLabel);
}
@@ -289,10 +289,10 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
// compute penalty height and box height
- int penaltyHeight = step
- + getMaxRemainingHeight(fullHeights, partialHeights)
+ int penaltyHeight = step
+ + getMaxRemainingHeight(fullHeights, partialHeights)
- totalHeight;
-
+
//Additional penalty height from penalties in the source lists
int additionalPenaltyHeight = 0;
int stepPenalty = 0;
@@ -307,7 +307,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
additionalPenaltyHeight, endEl.getW());
stepPenalty = Math.max(stepPenalty, endEl.getP());
}
-
+
int boxHeight = step - addedBoxHeight - penaltyHeight;
penaltyHeight += additionalPenaltyHeight; //Add AFTER calculating boxHeight!
@@ -330,7 +330,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
// add the new elements
addedBoxHeight += boxHeight;
- ListItemPosition stepPosition = new ListItemPosition(this,
+ ListItemPosition stepPosition = new ListItemPosition(this,
start[0], end[0], start[1], end[1]);
if (footnoteList == null) {
returnList.add(new KnuthBox(boxHeight, stepPosition, false));
@@ -394,7 +394,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
if (seqCount == 0) {
return 0;
}
-
+
// determine next step
int step;
if (backupHeights[0] == 0 && backupHeights[1] == 0) {
@@ -426,7 +426,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
//log.debug(" LILM.getChanged> label");
@@ -441,10 +441,10 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
while (oldListIterator.hasNext()) {
oldElement = (KnuthElement)oldListIterator.next();
Position innerPosition = oldElement.getPosition().getPosition();
- //log.debug(" BLM> unwrapping: " + (oldElement.isBox()
- // ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
+ //log.debug(" BLM> unwrapping: " + (oldElement.isBox()
+ // ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
// + " creato da " + oldElement.getLayoutManager().getClass().getName());
- //log.debug(" BLM> unwrapping: "
+ //log.debug(" BLM> unwrapping: "
// + oldElement.getPosition().getClass().getName());
if (innerPosition != null) {
// oldElement was created by a descendant of this BlockLM
@@ -508,7 +508,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(true, isFirst(firstPos), isLast(lastPos));
- // use the first and the last ListItemPosition to determine the
+ // use the first and the last ListItemPosition to determine the
// corresponding indexes in the original labelList and bodyList
int labelFirstIndex = ((ListItemPosition) positionList.getFirst()).getLabelFirstIndex();
int labelLastIndex = ((ListItemPosition) positionList.getLast()).getLabelLastIndex();
@@ -517,17 +517,17 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
//Determine previous break if any
int previousBreak = ElementListUtils.determinePreviousBreak(labelList, labelFirstIndex);
- SpaceResolver.performConditionalsNotification(labelList,
+ SpaceResolver.performConditionalsNotification(labelList,
labelFirstIndex, labelLastIndex, previousBreak);
//Determine previous break if any
previousBreak = ElementListUtils.determinePreviousBreak(bodyList, bodyFirstIndex);
- SpaceResolver.performConditionalsNotification(bodyList,
+ SpaceResolver.performConditionalsNotification(bodyList,
bodyFirstIndex, bodyLastIndex, previousBreak);
-
+
// add label areas
if (labelFirstIndex <= labelLastIndex) {
- KnuthPossPosIter labelIter = new KnuthPossPosIter(labelList,
+ KnuthPossPosIter labelIter = new KnuthPossPosIter(labelList,
labelFirstIndex, labelLastIndex + 1);
lc.setFlags(LayoutContext.FIRST_AREA, layoutContext.isFirstArea());
lc.setFlags(LayoutContext.LAST_AREA, layoutContext.isLastArea());
@@ -548,7 +548,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
// add body areas
if (bodyFirstIndex <= bodyLastIndex) {
- KnuthPossPosIter bodyIter = new KnuthPossPosIter(bodyList,
+ KnuthPossPosIter bodyIter = new KnuthPossPosIter(bodyList,
bodyFirstIndex, bodyLastIndex + 1);
lc.setFlags(LayoutContext.FIRST_AREA, layoutContext.isFirstArea());
lc.setFlags(LayoutContext.LAST_AREA, layoutContext.isLastArea());
@@ -567,17 +567,17 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
// We are done with this area add the background
- TraitSetter.addBackground(curBlockArea,
+ TraitSetter.addBackground(curBlockArea,
getListItemFO().getCommonBorderPaddingBackground(),
this);
- TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
+ TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
effSpaceBefore, effSpaceAfter);
flush();
curBlockArea = null;
resetSpaces();
-
+
checkEndOfLayout(lastPos);
}
@@ -610,22 +610,22 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
// Set up dimensions
/*Area parentArea =*/ parentLM.getParentArea(curBlockArea);
-
+
// set traits
TraitSetter.setProducerID(curBlockArea, getListItemFO().getId());
- TraitSetter.addBorders(curBlockArea,
- getListItemFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addBorders(curBlockArea,
+ getListItemFO().getCommonBorderPaddingBackground(),
discardBorderBefore, discardBorderAfter, false, false, this);
- TraitSetter.addPadding(curBlockArea,
- getListItemFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addPadding(curBlockArea,
+ getListItemFO().getCommonBorderPaddingBackground(),
discardPaddingBefore, discardPaddingAfter, false, false, this);
TraitSetter.addMargins(curBlockArea,
- getListItemFO().getCommonBorderPaddingBackground(),
+ getListItemFO().getCommonBorderPaddingBackground(),
getListItemFO().getCommonMarginBlock(), this);
- TraitSetter.addBreaks(curBlockArea,
- getListItemFO().getBreakBefore(),
+ TraitSetter.addBreaks(curBlockArea,
+ getListItemFO().getBreakBefore(),
getListItemFO().getBreakAfter());
-
+
int contentIPD = referenceIPD - getIPIndents();
curBlockArea.setIPD(contentIPD);
@@ -669,13 +669,13 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
public void notifySpace(RelSide side, MinOptMax effectiveLength) {
if (RelSide.BEFORE == side) {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceBefore + "-> " + effectiveLength);
}
this.effSpaceBefore = effectiveLength;
} else {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceAfter + "-> " + effectiveLength);
}
this.effSpaceAfter = effectiveLength;
@@ -710,6 +710,6 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
index 4012b0c00..a9da7a3ca 100644
--- a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
+++ b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
@@ -173,7 +173,7 @@ class ActiveCell {
* Returns the actual length of the content represented by the given element. In the
* case where this element is used as a filler to match a row's fixed height, the
* value returned by the getW() method will be higher than the actual content.
- *
+ *
* @param el an element
* @return the actual content length corresponding to the element
*/
@@ -226,7 +226,7 @@ class ActiveCell {
/**
* Modifies the cell's element list by putting filler elements, so that the cell's or
* row's explicit height is always reached.
- *
+ *
* TODO this will work properly only for the first break. Then the limitation
* explained on http://wiki.apache.org/xmlgraphics-fop/TableLayout/KnownProblems
* occurs. The list of elements needs to be re-adjusted after each break.
@@ -269,7 +269,7 @@ class ActiveCell {
/**
* Returns true if this cell ends on the given row.
- *
+ *
* @param rowIndex index of a row in the row-group, zero-based
* @return true if this cell ends on the given row
*/
@@ -280,7 +280,7 @@ class ActiveCell {
/**
* Returns the length of this cell's content not yet included in the steps, plus the
* cell's borders and paddings if applicable.
- *
+ *
* @return the remaining length, zero if the cell is finished
*/
int getRemainingLength() {
@@ -341,12 +341,12 @@ class ActiveCell {
afterNextStep.end = knuthIter.nextIndex() - 1;
afterNextStep.totalLength = bpBeforeNormal
+ afterNextStep.contentLength + afterNextStep.penaltyLength
- + bpAfterTrailing;
+ + bpAfterTrailing;
}
/**
* Returns the minimal step that is needed for this cell to contribute some content.
- *
+ *
* @return the step for this cell's first legal break
*/
int getFirstStep() {
@@ -363,7 +363,7 @@ class ActiveCell {
* infinite penalty, plus the cell's content won't be taken into account since the
* final step will be smaller than the current one (see {@link #signalNextStep(int)}).
* This actually means that the content will be swallowed.
- *
+ *
* @return the length of last step
*/
int getLastStep() {
@@ -377,7 +377,7 @@ class ActiveCell {
/**
* Increases the next step up to the given limit.
- *
+ *
* @param limit the length up to which the next step is allowed to increase
* @see #signalRowFirstStep(int)
* @see #signalRowLastStep(int)
@@ -398,7 +398,7 @@ class ActiveCell {
* Gets the selected first step for the current row. If this cell's first step is
* smaller, then it may be able to add some more of its content, since there will be
* no break before the given step anyway.
- *
+ *
* @param firstStep the current row's first step
*/
void signalRowFirstStep(int firstStep) {
@@ -418,7 +418,7 @@ class ActiveCell {
/**
* Returns the total length up to the next legal break, not yet included in the steps.
- *
+ *
* @return the total length up to the next legal break (-1 signals no further step)
*/
int getNextStep() {
@@ -446,7 +446,7 @@ class ActiveCell {
/**
* Signals the length of the chosen next step, so that this cell determines whether
* its own step may be included or not.
- *
+ *
* @param minStep length of the chosen next step
* @return the break class of the step, if any. One of {@link Constants#EN_AUTO},
* {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE},
@@ -487,7 +487,7 @@ class ActiveCell {
/**
* Receives indication that the current row is ending, and that (collapse) borders
* must be updated accordingly.
- *
+ *
* @param rowIndex the index of the ending row
*/
void endRow(int rowIndex) {
@@ -508,7 +508,7 @@ class ActiveCell {
/**
* Returns true if this cell would be finished after the given step. That is, it would
* be included in the step and the end of its content would be reached.
- *
+ *
* @param step the next step
* @return true if this cell finishes at the given step
*/
@@ -519,7 +519,7 @@ class ActiveCell {
/**
* Creates and returns a CellPart instance for the content of this cell which
* is included in the next step.
- *
+ *
* @return a CellPart instance
*/
CellPart createCellPart() {
@@ -557,7 +557,7 @@ class ActiveCell {
/**
* Adds the footnotes (if any) that are part of the next step, if this cell
* contributes content to the next step.
- *
+ *
* @param footnoteList the list to which this cell must add its footnotes
*/
void addFootnotes(List footnoteList) {
diff --git a/src/java/org/apache/fop/layoutmgr/table/CellPart.java b/src/java/org/apache/fop/layoutmgr/table/CellPart.java
index 560b70344..7dd2bc201 100644
--- a/src/java/org/apache/fop/layoutmgr/table/CellPart.java
+++ b/src/java/org/apache/fop/layoutmgr/table/CellPart.java
@@ -44,7 +44,7 @@ class CellPart {
/**
* Creates a new CellPart.
- *
+ *
* @param pgu Primary grid unit
* @param start starting element
* @param end ending element
diff --git a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java
index c3df74800..ede6210ca 100644
--- a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java
+++ b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java
@@ -131,7 +131,7 @@ public abstract class CollapsingBorderModel {
/**
* Compares the two given styles (see {@link Constants}).
- *
+ *
* @param style1 a style constant
* @param style2 another style constant
* @return a value < 0 if style1 has less priority than style2, 0 if both are
@@ -161,7 +161,7 @@ public abstract class CollapsingBorderModel {
/**
* Compares the two given FO ids ({@link Constants}.FO*) in terms of border
* declaration.
- *
+ *
* @param id1 a FO id ({@link Constants#FO_TABLE}, {@link Constants#FO_TABLE_BODY},
* etc.)
* @param id2 another FO id
@@ -178,7 +178,7 @@ public abstract class CollapsingBorderModel {
* Returns the border which wins the border conflict resolution. In case the two
* borders are equivalent (identical, or only the color is different), null is
* returned.
- *
+ *
* @param border1 a border specification
* @param border2 another border specification
* @param discard true if the .conditionality component of the border width must be
@@ -192,7 +192,7 @@ public abstract class CollapsingBorderModel {
* Returns the border which wins the border conflict resolution. Same as
* {@link #determineWinner(BorderSpecification, BorderSpecification, boolean)
* determineWinner(border1, border2, false)}.
- *
+ *
* @param border1 a border specification
* @param border2 another border specification
* @return the winning border, null if the two borders are equivalent
diff --git a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
index c1a9380a3..7aed158de 100644
--- a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
+++ b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
@@ -26,7 +26,7 @@ import org.apache.fop.fo.properties.CommonBorderPaddingBackground.BorderInfo;
/**
* Implements the normal "collapse" border model defined in 6.7.10 in XSL 1.0.
- *
+ *
* TODO Column groups are not yet checked in this algorithm!
*/
public class CollapsingBorderModelEyeCatching extends CollapsingBorderModel {
diff --git a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
index 9dbd31653..c32c6eb3d 100644
--- a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
+++ b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
@@ -45,9 +45,9 @@ public class ColumnSetup {
private Table table;
private List columns = new java.util.ArrayList();
private List colWidths = new java.util.ArrayList();
-
+
private int maxColIndexReferenced = 0;
-
+
/**
* Main Constructor.
* @param table the table to construct this column setup for
@@ -57,7 +57,7 @@ public class ColumnSetup {
prepareColumns();
initializeColumnWidths();
}
-
+
private void prepareColumns() {
List rawCols = table.getColumns();
if (rawCols != null) {
@@ -124,7 +124,7 @@ public class ColumnSetup {
return (TableColumn) columns.get(index - 1);
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return columns.toString();
@@ -138,15 +138,15 @@ public class ColumnSetup {
return columns.size();
}
}
-
+
/** @return an Iterator over all columns */
public Iterator iterator() {
return this.columns.iterator();
}
-
+
/*
private void createColumnsFromFirstRow() {
- //TODO Create oldColumns from first row here
+ //TODO Create oldColumns from first row here
//--> rule 2 in "fixed table layout", see CSS2, 17.5.2
//Alternative: extend oldColumns on-the-fly, but in this case we need the
//new property evaluation context so proportional-column-width() works
@@ -159,13 +159,13 @@ public class ColumnSetup {
/**
* Initializes the column's widths
- *
+ *
*/
private void initializeColumnWidths() {
-
+
TableColumn col;
Length colWidth;
-
+
for (int i = columns.size(); --i >= 0;) {
if (columns.get(i) != null) {
col = (TableColumn) columns.get(i);
@@ -175,21 +175,21 @@ public class ColumnSetup {
}
colWidths.add(0, null);
}
-
+
/**
* Works out the base unit for resolving proportional-column-width()
* [p-c-w(x) = x * base_unit_ipd]
- *
+ *
* @param tlm the TableLayoutManager
* @return the computed base unit (in millipoint)
*/
protected double computeTableUnit(TableLayoutManager tlm) {
-
+
int sumCols = 0;
float factors = 0;
double unit = 0;
-
- /* calculate the total width (specified absolute/percentages),
+
+ /* calculate the total width (specified absolute/percentages),
* and work out the total number of factors to use to distribute
* the remaining space (if any)
*/
@@ -204,9 +204,9 @@ public class ColumnSetup {
}
}
}
-
- /* distribute the remaining space over the accumulated
- * factors (if any)
+
+ /* distribute the remaining space over the accumulated
+ * factors (if any)
*/
if (factors > 0) {
if (sumCols < tlm.getContentAreaIPD()) {
@@ -215,10 +215,10 @@ public class ColumnSetup {
log.warn("No space remaining to distribute over columns.");
}
}
-
+
return unit;
}
-
+
/**
* @param col column index (1 is first column)
* @param context the context for percentage based calculations
@@ -258,5 +258,5 @@ public class ColumnSetup {
}
return sum;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java
index 7f91808d0..54cb1ebfe 100644
--- a/src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -66,7 +66,7 @@ class RowGroupLayoutManager {
int breakBefore = Constants.EN_AUTO;
TableRow firstRow = rowGroup[0].getTableRow();
if (firstRow != null) {
- breakBefore = firstRow.getBreakBefore();
+ breakBefore = firstRow.getBreakBefore();
}
context.setBreakBefore(BreakUtil.compareBreakClasses(breakBefore,
rowGroup[0].getBreakBefore()));
@@ -74,7 +74,7 @@ class RowGroupLayoutManager {
int breakAfter = Constants.EN_AUTO;
TableRow lastRow = rowGroup[rowGroup.length - 1].getTableRow();
if (lastRow != null) {
- breakAfter = lastRow.getBreakAfter();
+ breakAfter = lastRow.getBreakAfter();
}
context.setBreakAfter(BreakUtil.compareBreakClasses(breakAfter,
rowGroup[rowGroup.length - 1].getBreakAfter()));
@@ -89,7 +89,7 @@ class RowGroupLayoutManager {
* @param bodyType Indicates what kind of body is being processed (BODY, HEADER or FOOTER)
* @param returnList List to received the generated elements
*/
- private void createElementsForRowGroup(LayoutContext context, int alignment,
+ private void createElementsForRowGroup(LayoutContext context, int alignment,
int bodyType, LinkedList returnList) {
log.debug("Handling row group with " + rowGroup.length + " rows...");
EffRow row;
@@ -113,7 +113,7 @@ class RowGroupLayoutManager {
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimitBP(context.getStackLimitBP()); //necessary?
childLC.setRefIPD(spanWidth);
-
+
//Get the element list for the cell contents
List elems = primary.getCellLM().getNextKnuthElements(
childLC, alignment);
@@ -131,7 +131,7 @@ class RowGroupLayoutManager {
/**
* Calculate the heights of the rows in the row group, see CSS21, 17.5.3 Table height
* algorithms.
- *
+ *
* TODO this method will need to be adapted once clarification has been made by the
* W3C regarding whether borders or border-separation must be included or not
*/
@@ -174,7 +174,7 @@ class RowGroupLayoutManager {
int borderWidths = primary.getBeforeAfterBorderWidth();
int padding = 0;
CommonBorderPaddingBackground cbpb = primary.getCell()
- .getCommonBorderPaddingBackground();
+ .getCommonBorderPaddingBackground();
padding += cbpb.getPaddingBefore(false, primary.getCellLM());
padding += cbpb.getPaddingAfter(false, primary.getCellLM());
int effRowHeight = effectiveCellBPD + padding + borderWidths;
@@ -195,13 +195,13 @@ class RowGroupLayoutManager {
// if (maxCellBPD > row.getExplicitHeight().max) {
//old:
// log.warn(FONode.decorateWithContextInfo(
-// "The contents of row " + (row.getIndex() + 1)
+// "The contents of row " + (row.getIndex() + 1)
// + " are taller than they should be (there is a"
// + " block-progression-dimension or height constraint
// + " on the indicated row)."
// + " Due to its contents the row grows"
// + " to " + maxCellBPD + " millipoints, but the row shouldn't get"
-// + " any taller than " + row.getExplicitHeight() + " millipoints.",
+// + " any taller than " + row.getExplicitHeight() + " millipoints.",
// row.getTableRow()));
//new (with events):
// BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Factory.create(
diff --git a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
index 38f1a7b30..b2851c39f 100644
--- a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
+++ b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
@@ -107,7 +107,7 @@ class RowPainter {
/**
* Signals that the end of the current table part is reached.
- *
+ *
* @param lastInBody true if the part is the last table-body element to be displayed
* on the current page. In which case all the cells must be flushed even if they
* aren't finished, plus the proper collapsed borders must be selected (trailing
@@ -118,7 +118,7 @@ class RowPainter {
*/
void endTablePart(boolean lastInBody, boolean lastOnPage) {
addAreasAndFlushRow(lastInBody, lastOnPage);
-
+
if (tablePartBackground != null) {
TableLayoutManager tableLM = tclm.getTableLM();
for (Iterator iter = tablePartBackgroundAreas.iterator(); iter.hasNext();) {
@@ -139,7 +139,7 @@ class RowPainter {
/**
* Records the fragment of row represented by the given position. If it belongs to
* another (grid) row than the current one, that latter is painted and flushed first.
- *
+ *
* @param tcpos a position representing the row fragment
*/
void handleTableContentPosition(TableContentPosition tcpos) {
@@ -173,7 +173,7 @@ class RowPainter {
firstCellParts[colIndex] = cellPart;
cellHeights[colIndex] = cellPart.getBorderPaddingBefore(firstCellOnPage[colIndex]);
} else {
- assert firstCellParts[colIndex].pgu == cellPart.pgu;
+ assert firstCellParts[colIndex].pgu == cellPart.pgu;
cellHeights[colIndex] += cellPart.getConditionalBeforeContentLength();
}
cellHeights[colIndex] += cellPart.getLength();
@@ -185,7 +185,7 @@ class RowPainter {
* Creates the areas corresponding to the last row. That is, an area with background
* for the row, plus areas for all the cells that finish on the row (not spanning over
* further rows).
- *
+ *
* @param lastInPart true if the row is the last from its table part to be displayed
* on the current page. In which case all the cells must be flushed even if they
* aren't finished, plus the proper collapsed borders must be selected (trailing
@@ -204,7 +204,7 @@ class RowPainter {
// Need to compute the actual row height first
int actualRowHeight = 0;
for (int i = 0; i < colCount; i++) {
- GridUnit currentGU = currentRow.getGridUnit(i);
+ GridUnit currentGU = currentRow.getGridUnit(i);
if (!currentGU.isEmpty() && currentGU.getColSpanIndex() == 0
&& (lastInPart || currentGU.isLastGridUnitRowSpan())
&& firstCellParts[i] != null) {
@@ -396,7 +396,7 @@ class RowPainter {
* set when the areas for the cell are created since at that moment this bpd is yet
* unknown. So they will instead be set in
* {@link #addAreasAndFlushRow(boolean, boolean)}.
- *
+ *
* @param backgroundArea the block of the cell's dimensions that will hold the part
* background
*/
@@ -407,7 +407,7 @@ class RowPainter {
/**
* Records the y-offset of the row with the given index.
- *
+ *
* @param rowIndex index of the row
* @param offset y-offset of the row on the page
*/
@@ -419,7 +419,7 @@ class RowPainter {
* considered as finished, since it contains no cell ending on this row. Thus no
* TableContentPosition will be created for this row. Thus its index will never be
* recorded by the #handleTableContentPosition method.
- *
+ *
* The offset of such a row is the same as the next non-empty row. It's needed
* to correctly offset blocks for cells starting on this row. Hence the loop
* below.
@@ -431,7 +431,7 @@ class RowPainter {
/**
* Returns the offset of the row with the given index.
- *
+ *
* @param rowIndex index of the row
* @return its y-offset on the page
*/
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
index c20060723..4cf68b97b 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.table;
import org.apache.fop.area.Area;
@@ -55,7 +55,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager {
public TableAndCaption getTableAndCaptionFO() {
return (TableAndCaption)this.fobj;
}
-
+
/**
* Get the next break possibility.
*
@@ -199,7 +199,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager {
curBlockArea.addBlock((Block) childArea);
}
}
-
+
/** {@inheritDoc} */
public int getKeepTogetherStrength() {
int strength = KEEP_AUTO;
@@ -209,8 +209,8 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager {
*/
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
- }
-
+ }
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
index 615145fa1..071082624 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.table;
import org.apache.fop.area.Area;
@@ -50,7 +50,7 @@ public class TableCaptionLayoutManager extends BlockStackingLayoutManager {
public TableCaption getTableCaptionFO() {
return (TableCaption)this.fobj;
}
-
+
/**
* Get the next break position for the caption.
*
@@ -195,7 +195,7 @@ public class TableCaptionLayoutManager extends BlockStackingLayoutManager {
curBlockArea.addBlock((Block) childArea);
}
}
-
+
/** {@inheritDoc} */
public int getKeepTogetherStrength() {
int strength = KEEP_AUTO;
@@ -208,7 +208,7 @@ public class TableCaptionLayoutManager extends BlockStackingLayoutManager {
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
index 52915c008..ba5e232e9 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -240,7 +240,7 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
/**
* Sets the total height of this cell on the current page. That is, the cell's bpd
* plus before and after borders and paddings, plus the table's border-separation.
- *
+ *
* @param h the height of cell
*/
public void setTotalHeight(int h) {
@@ -250,12 +250,12 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
/**
* Add the areas for the break points. The cell contains block stacking layout
* managers that add block areas.
- *
+ *
*
@@ -61,7 +61,7 @@ public class PDFFilterList { public PDFFilterList() { //nop } - + /** * Use this descriptor if you want to have ASCII filters (such as ASCIIHex * and ASCII85) ignored, for example, when encryption is active. @@ -78,7 +78,7 @@ public class PDFFilterList { public void setDisableAllFilters(boolean value) { this.disableAllFilters = value; } - + /** * Returns true if all filters are disabled. * @return true if all filters are disabled @@ -86,7 +86,7 @@ public class PDFFilterList { public boolean isDisableAllFilters() { return this.disableAllFilters; } - + /** * Indicates whether the filter list is already initialized. * @return true if more there are filters present @@ -111,7 +111,7 @@ public class PDFFilterList { filters.add(filter); } } - + /** * Add a filter for compression of the stream by name. * @param filterType name of the filter to add @@ -211,7 +211,7 @@ public class PDFFilterList { int nonNullParams = populateNamesAndParms(names, parms); // now build up the filter entries for the dictionary - return buildFilterEntries(names) + return buildFilterEntries(names) + (nonNullParams > 0 ? buildDecodeParms(parms) : ""); } return ""; @@ -238,7 +238,7 @@ public class PDFFilterList { putDecodeParams(dict, parms); } } - + private int populateNamesAndParms(List names, List parms) { // run the filters int nonNullParams = 0; @@ -247,7 +247,7 @@ public class PDFFilterList { // place the names in our local vector in reverse order if (filter.getName().length() > 0) { names.add(0, filter.getName()); - PDFObject param = filter.getDecodeParms(); + PDFObject param = filter.getDecodeParms(); if (param != null) { parms.add(0, param); nonNullParams++; @@ -297,7 +297,7 @@ public class PDFFilterList { } } } - + private String buildDecodeParms(List parms) { StringBuffer sb = new StringBuffer(); boolean needParmsEntry = false; @@ -346,9 +346,9 @@ public class PDFFilterList { } } } - + /** - * Applies all registered filters as necessary. The method returns an + * Applies all registered filters as necessary. The method returns an * OutputStream which will receive the filtered contents. * @param stream raw data output stream * @return OutputStream filtered output stream diff --git a/src/java/org/apache/fop/pdf/PDFFont.java b/src/java/org/apache/fop/pdf/PDFFont.java index 1f76f1e11..6ba6ab9a2 100644 --- a/src/java/org/apache/fop/pdf/PDFFont.java +++ b/src/java/org/apache/fop/pdf/PDFFont.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -37,7 +37,7 @@ public class PDFFont extends PDFDictionary { /** Internal F-number for each font (it is not written to the font dict) */ private String fontname; - + /** * create the /Font object * @@ -74,7 +74,7 @@ public class PDFFont extends PDFDictionary { put("Encoding", new PDFName(encoding)); } } - + /** * Sets the Encoding value of the font. * @param encoding the encoding @@ -84,7 +84,7 @@ public class PDFFont extends PDFDictionary { put("Encoding", encoding); } } - + /** * factory method with the basic parameters * @@ -122,7 +122,7 @@ public class PDFFont extends PDFDictionary { public String getName() { return this.fontname; } - + /** * Returns the name of the BaseFont. * @return the BaseFont @@ -158,7 +158,7 @@ public class PDFFont extends PDFDictionary { protected void validate() { if (getDocumentSafely().getProfile().isFontEmbeddingRequired()) { if (this.getClass() == PDFFont.class) { - throw new PDFConformanceException("For " + getDocumentSafely().getProfile() + throw new PDFConformanceException("For " + getDocumentSafely().getProfile() + ", all fonts, even the base 14" + " fonts, have to be embedded! Offending font: " + getBaseFont()); } @@ -170,5 +170,5 @@ public class PDFFont extends PDFDictionary { validate(); return super.output(stream); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFFontDescriptor.java b/src/java/org/apache/fop/pdf/PDFFontDescriptor.java index aa40bc35b..d4b412e4c 100644 --- a/src/java/org/apache/fop/pdf/PDFFontDescriptor.java +++ b/src/java/org/apache/fop/pdf/PDFFontDescriptor.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -59,16 +59,16 @@ public class PDFFontDescriptor extends PDFDictionary { /** * Set the optional metrics. - * @param avgWidth The average width of characters in this font. + * @param avgWidth The average width of characters in this font. * The default value is 0. - * @param maxWidth The maximum width of characters in this font. + * @param maxWidth The maximum width of characters in this font. * The default value is 0. * @param missingWidth missing width - * @param leading the desired spacing between lines of text. + * @param leading the desired spacing between lines of text. * The default value is 0. - * @param stemH The vertical width of the dominant horizontal stems of + * @param stemH The vertical width of the dominant horizontal stems of * glyphs in the font. The default value is 0. - * @param xHeight The y-coordinate of the top of flat non-ascending + * @param xHeight The y-coordinate of the top of flat non-ascending * lowercase letters, measured from the baseline. The default value is 0. */ public void setMetrics(int avgWidth, int maxWidth, int missingWidth, @@ -119,7 +119,7 @@ public class PDFFontDescriptor extends PDFDictionary { } return stream; } - + /** * Sets the CIDSet stream for this font descriptor. (Optional) * @param cidSet the CIDSet stream @@ -127,19 +127,19 @@ public class PDFFontDescriptor extends PDFDictionary { public void setCIDSet(AbstractPDFStream cidSet) { put("CIDSet", cidSet); } - + /** @return the CIDSet stream or null if not applicable */ public AbstractPDFStream getCIDSet() { return (AbstractPDFStream)get("CIDSet"); } - + /** * {@inheritDoc} */ /* public String toPDFString() { StringBuffer p = new StringBuffer(128); - p.append(getObjectID() + p.append(getObjectID() + "<< /Type /FontDescriptor" + "\n/FontName /" + this.basefont); diff --git a/src/java/org/apache/fop/pdf/PDFFontNonBase14.java b/src/java/org/apache/fop/pdf/PDFFontNonBase14.java index b97d5deec..9b6cef618 100644 --- a/src/java/org/apache/fop/pdf/PDFFontNonBase14.java +++ b/src/java/org/apache/fop/pdf/PDFFontNonBase14.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -70,7 +70,7 @@ public abstract class PDFFontNonBase14 extends PDFFont { public PDFFontDescriptor getDescriptor() { return (PDFFontDescriptor)get("FontDescriptor"); } - + /** * Sets a ToUnicode CMap. * @param cmap the ToUnicode character map @@ -78,15 +78,15 @@ public abstract class PDFFontNonBase14 extends PDFFont { public void setToUnicode(PDFCMap cmap) { put("ToUnicode", cmap); } - + /** {@inheritDoc} */ protected void validate() { if (getDocumentSafely().getProfile().isFontEmbeddingRequired()) { if (this.getDescriptor().getFontFile() == null) { - throw new PDFConformanceException("For " + getDocumentSafely().getProfile() + throw new PDFConformanceException("For " + getDocumentSafely().getProfile() + ", all fonts have to be embedded!"); } } } - + } diff --git a/src/java/org/apache/fop/pdf/PDFFontTrueType.java b/src/java/org/apache/fop/pdf/PDFFontTrueType.java index a5636f951..99c9f1c1f 100644 --- a/src/java/org/apache/fop/pdf/PDFFontTrueType.java +++ b/src/java/org/apache/fop/pdf/PDFFontTrueType.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -36,7 +36,7 @@ public class PDFFontTrueType extends PDFFontNonBase14 { * @param basefont the base font name * @param encoding the character encoding schema used by the font */ - public PDFFontTrueType(String fontname, + public PDFFontTrueType(String fontname, String basefont, Object encoding) { super(fontname, FontType.TRUETYPE, basefont, encoding); diff --git a/src/java/org/apache/fop/pdf/PDFFontType0.java b/src/java/org/apache/fop/pdf/PDFFontType0.java index 29d6d1b4f..2f5e037f3 100644 --- a/src/java/org/apache/fop/pdf/PDFFontType0.java +++ b/src/java/org/apache/fop/pdf/PDFFontType0.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -35,7 +35,7 @@ public class PDFFontType0 extends PDFFont { * @param basefont the base font name * @param encoding the character encoding schema used by the font */ - public PDFFontType0(String fontname, + public PDFFontType0(String fontname, String basefont, Object encoding) { super(fontname, FontType.TYPE0, basefont, encoding); @@ -49,9 +49,9 @@ public class PDFFontType0 extends PDFFont { * @param encoding the character encoding schema used by the font * @param descendantFonts the CIDFont upon which this font is based */ - public PDFFontType0(String fontname, + public PDFFontType0(String fontname, String basefont, - Object encoding, + Object encoding, PDFCIDFont descendantFonts) { super(fontname, FontType.TYPE0, basefont, encoding); diff --git a/src/java/org/apache/fop/pdf/PDFFontType1.java b/src/java/org/apache/fop/pdf/PDFFontType1.java index 8c9a7dc4d..884cb3e30 100644 --- a/src/java/org/apache/fop/pdf/PDFFontType1.java +++ b/src/java/org/apache/fop/pdf/PDFFontType1.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -40,7 +40,7 @@ public class PDFFontType1 extends PDFFontNonBase14 { * @param basefont the base font name * @param encoding the character encoding schema used by the font */ - public PDFFontType1(String fontname, + public PDFFontType1(String fontname, String basefont, Object encoding) { diff --git a/src/java/org/apache/fop/pdf/PDFFontType3.java b/src/java/org/apache/fop/pdf/PDFFontType3.java index 96ecb6b5a..03d5469ea 100644 --- a/src/java/org/apache/fop/pdf/PDFFontType3.java +++ b/src/java/org/apache/fop/pdf/PDFFontType3.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -38,7 +38,7 @@ public class PDFFontType3 extends PDFFontNonBase14 { * @param basefont the base font name * @param encoding the character encoding schema used by the font */ - public PDFFontType3(String fontname, + public PDFFontType3(String fontname, String basefont, Object encoding) { super(fontname, FontType.TYPE3, basefont, encoding); @@ -54,7 +54,7 @@ public class PDFFontType3 extends PDFFontNonBase14 { * @param fontMatrix the font's transformation matrix * @param charProcs the glyphs' definitions */ - public PDFFontType3(String fontname, + public PDFFontType3(String fontname, String basefont, Object encoding, PDFRectangle fontBBox, PDFArray fontMatrix, diff --git a/src/java/org/apache/fop/pdf/PDFFormXObject.java b/src/java/org/apache/fop/pdf/PDFFormXObject.java index 6ccf76c6c..5ede9b487 100644 --- a/src/java/org/apache/fop/pdf/PDFFormXObject.java +++ b/src/java/org/apache/fop/pdf/PDFFormXObject.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -32,7 +32,7 @@ import java.io.OutputStream; * dictionary but a stream of image data. */ public class PDFFormXObject extends PDFXObject { - + private PDFStream contents; private PDFReference resRef; @@ -49,7 +49,7 @@ public class PDFFormXObject extends PDFXObject { put("Name", new PDFName("Form" + xnumber)); this.resRef = resources; this.contents = contents; - + put("Type", new PDFName("XObject")); put("Subtype", new PDFName("Form")); put("FormType", new Integer(1)); @@ -76,7 +76,7 @@ public class PDFFormXObject extends PDFXObject { array.set(3, bbox.getHeight()); } } - + /** * Returns the bounding box. * @return the BBox value @@ -95,7 +95,7 @@ public class PDFFormXObject extends PDFXObject { return null; } } - + /** * Sets the Matrix value * @param at the AffineTransform defining the transformation matrix @@ -122,7 +122,7 @@ public class PDFFormXObject extends PDFXObject { array.set(5, m[5]); } } - + /** * Returns the Matrix value. * @return the Matrix @@ -143,7 +143,7 @@ public class PDFFormXObject extends PDFXObject { return null; } } - + /** * Used to set the contents of the PDF stream. * @param data the contents as a byte array @@ -161,7 +161,7 @@ public class PDFFormXObject extends PDFXObject { /** {@inheritDoc} */ protected int output(OutputStream stream) throws IOException { final int len = super.output(stream); - + //Now that the data has been written, it can be discarded. this.contents = null; return len; @@ -175,6 +175,6 @@ public class PDFFormXObject extends PDFXObject { put("Resources", resRef); super.populateStreamDict(lengthEntry); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFFunction.java b/src/java/org/apache/fop/pdf/PDFFunction.java index fdf419a2b..14cc318ba 100644 --- a/src/java/org/apache/fop/pdf/PDFFunction.java +++ b/src/java/org/apache/fop/pdf/PDFFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/pdf/PDFGState.java b/src/java/org/apache/fop/pdf/PDFGState.java index 03608994d..93151149b 100644 --- a/src/java/org/apache/fop/pdf/PDFGState.java +++ b/src/java/org/apache/fop/pdf/PDFGState.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.util.Map; @@ -81,7 +81,7 @@ public class PDFGState extends PDFObject { public static final String GSTATE_ALPHA_SOURCE_FLAG = "AIS"; /** Text Knockout Flag (TK, PDF 1.4) */ public static final String GSTATE_TEXT_KNOCKOUT = "TK"; - + /** Default GState object */ public static final PDFGState DEFAULT; @@ -99,7 +99,7 @@ public class PDFGState extends PDFObject { vals.put(op, Boolean.FALSE); vals.put(OPM, new Integer(1)); vals.put(Font, "");*/ - + vals.put(GSTATE_ALPHA_STROKE, new Float(1.0)); vals.put(GSTATE_ALPHA_NONSTROKE, new Float(1.0)); } @@ -117,7 +117,7 @@ public class PDFGState extends PDFObject { /** * Sets the alpha value. * @param val alpha value (0.0 - 1.0) - * @param fill True if alpha should be set for non-stroking operations, + * @param fill True if alpha should be set for non-stroking operations, * False if for stroking operations */ public void setAlpha(float val, boolean fill) { diff --git a/src/java/org/apache/fop/pdf/PDFGoTo.java b/src/java/org/apache/fop/pdf/PDFGoTo.java index ae35928d2..b3ff6bcdc 100644 --- a/src/java/org/apache/fop/pdf/PDFGoTo.java +++ b/src/java/org/apache/fop/pdf/PDFGoTo.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.awt.geom.Point2D; @@ -128,7 +128,7 @@ public class PDFGoTo extends PDFAction { } else { dest = "/D [" + this.pageReference + " " + destination + "]\n"; } - return getObjectID() + return getObjectID() + "<< /Type /Action\n/S /GoTo\n" + dest + ">>\nendobj\n"; } diff --git a/src/java/org/apache/fop/pdf/PDFGoToRemote.java b/src/java/org/apache/fop/pdf/PDFGoToRemote.java index 2cd937df3..e04a1668f 100644 --- a/src/java/org/apache/fop/pdf/PDFGoToRemote.java +++ b/src/java/org/apache/fop/pdf/PDFGoToRemote.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java b/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java index e0cac0746..66753f37f 100644 --- a/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java +++ b/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java @@ -33,7 +33,7 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace { private PDFICCStream iccStream; private String explicitName; - + /** * Constructs a the ICCBased color space with an explicit name (ex. "DefaultRGB"). * @param explicitName an explicit name or null if a name should be generated @@ -43,7 +43,7 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace { this.explicitName = explicitName; this.iccStream = iccStream; } - + /** * Constructs a the ICCBased color space. * @param iccStream the ICC stream to associate with this color space @@ -51,12 +51,12 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace { public PDFICCBasedColorSpace(PDFICCStream iccStream) { this(null, iccStream); } - + /** @return the ICC stream associated with this color space */ public PDFICCStream getICCStream() { return this.iccStream; } - + /** {@inheritDoc} */ public int getNumComponents() { return iccStream.getICCProfile().getNumComponents(); @@ -151,5 +151,5 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace { sRGBProfile.setColorSpace(profile, null); return sRGBProfile; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFICCStream.java b/src/java/org/apache/fop/pdf/PDFICCStream.java index f242c0cae..b70ed017a 100644 --- a/src/java/org/apache/fop/pdf/PDFICCStream.java +++ b/src/java/org/apache/fop/pdf/PDFICCStream.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.awt.color.ICC_Profile; @@ -27,7 +27,7 @@ import java.io.OutputStream; * Special PDFStream for ICC profiles (color profiles). */ public class PDFICCStream extends PDFStream { - + private ICC_Profile cp; private PDFDeviceColorSpace pdfColorSpace; @@ -53,7 +53,7 @@ public class PDFICCStream extends PDFStream { public ICC_Profile getICCProfile() { return this.cp; } - + /** * overload the base object method so we don't have to copy * byte arrays around so much @@ -65,12 +65,12 @@ public class PDFICCStream extends PDFStream { this.cp = null; //Free ICC stream when it's not used anymore return length; } - + /** {@inheritDoc} */ protected void outputRawStreamData(OutputStream out) throws IOException { cp.write(out); } - + /** {@inheritDoc} */ protected void populateStreamDict(Object lengthEntry) { put("N", cp.getNumComponents()); diff --git a/src/java/org/apache/fop/pdf/PDFImage.java b/src/java/org/apache/fop/pdf/PDFImage.java index e0aaa44fa..e2b9e521c 100644 --- a/src/java/org/apache/fop/pdf/PDFImage.java +++ b/src/java/org/apache/fop/pdf/PDFImage.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -111,14 +111,14 @@ public interface PDFImage { /** @return true for CMYK images generated by Adobe Photoshop */ boolean isInverted(); - + /** * Get the PDF Filter to be applied to the image. * * @return the PDF Filter or null */ PDFFilter getPDFFilter(); - + // get the image bytes, and bytes properties /** @@ -132,11 +132,11 @@ public interface PDFImage { /** * Populates the XObject's dictionary with additional values. The values are added to the * dictionary after all the values obtained from other methods from this interface have - * been put into the dictionary. That allows to override certain values. + * been put into the dictionary. That allows to override certain values. * @param dict the dictionary to fill */ void populateXObjectDictionary(PDFDictionary dict); - + /** * Get the ICC stream for this image. * diff --git a/src/java/org/apache/fop/pdf/PDFImageXObject.java b/src/java/org/apache/fop/pdf/PDFImageXObject.java index 14fbeed4d..7104422e7 100644 --- a/src/java/org/apache/fop/pdf/PDFImageXObject.java +++ b/src/java/org/apache/fop/pdf/PDFImageXObject.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -37,7 +37,7 @@ import java.io.OutputStream; * document in another place. */ public class PDFImageXObject extends PDFXObject { - + private PDFImage pdfimage; /** @@ -63,7 +63,7 @@ public class PDFImageXObject extends PDFXObject { */ protected int output(OutputStream stream) throws IOException { int length = super.output(stream); - + // let it gc // this object is retained as a reference to inserting // the same image but the image data is no longer needed @@ -80,7 +80,7 @@ public class PDFImageXObject extends PDFXObject { populateDictionaryFromImage(); } } - + private void populateDictionaryFromPS() { getDocumentSafely().getProfile().verifyPSXObjectsAllowed(); put("Subtype", new PDFName("PS")); @@ -139,7 +139,7 @@ public class PDFImageXObject extends PDFXObject { //Important: do this at the end so previous values can be overwritten. pdfimage.populateXObjectDictionary(this); } - + /** {@inheritDoc} */ protected void outputRawStreamData(OutputStream out) throws IOException { pdfimage.outputContents(out); @@ -157,7 +157,7 @@ public class PDFImageXObject extends PDFXObject { getFilterList().ensureFilterInPlace(pdfFilter); } } - + /** * This sets up the default filters for XObjects. It uses the PDFImage * instance to determine what default filters to apply. @@ -166,11 +166,11 @@ public class PDFImageXObject extends PDFXObject { protected void setupFilterList() { if (!getFilterList().isInitialized()) { getFilterList().addDefaultFilters( - getDocumentSafely().getFilterMap(), + getDocumentSafely().getFilterMap(), pdfimage.getFilterHint()); } super.setupFilterList(); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFInfo.java b/src/java/org/apache/fop/pdf/PDFInfo.java index 888fdb2c6..14937bfd7 100644 --- a/src/java/org/apache/fop/pdf/PDFInfo.java +++ b/src/java/org/apache/fop/pdf/PDFInfo.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.util.Date; @@ -50,7 +50,7 @@ public class PDFInfo extends PDFObject { public String getProducer() { return this.producer; } - + /** * set the producer string * @@ -64,7 +64,7 @@ public class PDFInfo extends PDFObject { public String getCreator() { return this.creator; } - + /** * set the creator string * @@ -92,7 +92,7 @@ public class PDFInfo extends PDFObject { public String getAuthor() { return this.author; } - + /** * set the author string * @@ -106,7 +106,7 @@ public class PDFInfo extends PDFObject { public String getSubject() { return this.subject; } - + /** * set the subject string * @@ -120,7 +120,7 @@ public class PDFInfo extends PDFObject { public String getKeywords() { return this.keywords; } - + /** * set the keywords string * @@ -162,7 +162,7 @@ public class PDFInfo extends PDFObject { * {@inheritDoc} */ public byte[] toPDF() { - PDFProfile profile = getDocumentSafely().getProfile(); + PDFProfile profile = getDocumentSafely().getProfile(); ByteArrayOutputStream bout = new ByteArrayOutputStream(128); try { bout.write(encode(getObjectID())); @@ -189,17 +189,17 @@ public class PDFInfo extends PDFObject { bout.write(encodeText(this.keywords)); bout.write(encode("\n")); } - + if (creator != null) { bout.write(encode("/Creator ")); bout.write(encodeText(this.creator)); bout.write(encode("\n")); } - + bout.write(encode("/Producer ")); bout.write(encodeText(this.producer)); bout.write(encode("\n")); - + // creation date in form (D:YYYYMMDDHHmmSSOHH'mm') if (creationDate == null) { creationDate = new Date(); @@ -207,7 +207,7 @@ public class PDFInfo extends PDFObject { bout.write(encode("/CreationDate ")); bout.write(encodeString(formatDateTime(creationDate))); bout.write(encode("\n")); - + if (profile.isModDateRequired() && this.modDate == null) { this.modDate = this.creationDate; } @@ -224,7 +224,7 @@ public class PDFInfo extends PDFObject { if (profile.isTrappedEntryRequired()) { bout.write(encode("/Trapped /False\n")); } - + bout.write(encode(">>\nendobj\n")); } catch (IOException ioe) { log.error("Ignored I/O exception", ioe); diff --git a/src/java/org/apache/fop/pdf/PDFInternalLink.java b/src/java/org/apache/fop/pdf/PDFInternalLink.java index fcdc2e1bc..faa6070a1 100644 --- a/src/java/org/apache/fop/pdf/PDFInternalLink.java +++ b/src/java/org/apache/fop/pdf/PDFInternalLink.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFLink.java b/src/java/org/apache/fop/pdf/PDFLink.java index fb8544f6b..a7c4c6548 100644 --- a/src/java/org/apache/fop/pdf/PDFLink.java +++ b/src/java/org/apache/fop/pdf/PDFLink.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java diff --git a/src/java/org/apache/fop/pdf/PDFMetadata.java b/src/java/org/apache/fop/pdf/PDFMetadata.java index e0833a30f..6d15a67d4 100644 --- a/src/java/org/apache/fop/pdf/PDFMetadata.java +++ b/src/java/org/apache/fop/pdf/PDFMetadata.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -43,7 +43,7 @@ import org.apache.xmlgraphics.xmp.schemas.pdf.PDFAXMPSchema; * @since PDF 1.4 */ public class PDFMetadata extends PDFStream { - + private Metadata xmpMetadata; private boolean readOnly = true; @@ -62,7 +62,7 @@ public class PDFMetadata extends PDFStream { protected void setupFilterList() { if (!getFilterList().isInitialized()) { getFilterList().addDefaultFilters( - getDocumentSafely().getFilterMap(), + getDocumentSafely().getFilterMap(), PDFFilterList.METADATA_FILTER); } super.setupFilterList(); @@ -74,7 +74,7 @@ public class PDFMetadata extends PDFStream { public Metadata getMetadata() { return this.xmpMetadata; } - + /** * overload the base object method so we don't have to copy * byte arrays around so much @@ -86,24 +86,24 @@ public class PDFMetadata extends PDFStream { this.xmpMetadata = null; //Release DOM when it's not used anymore return length; } - + /** {@inheritDoc} */ protected void outputRawStreamData(OutputStream out) throws IOException { try { XMPSerializer.writeXMPPacket(xmpMetadata, out, this.readOnly); } catch (TransformerConfigurationException tce) { - throw new IOException("Error setting up Transformer for XMP stream serialization: " + throw new IOException("Error setting up Transformer for XMP stream serialization: " + tce.getMessage()); } catch (SAXException saxe) { - throw new IOException("Error while serializing XMP stream: " + throw new IOException("Error while serializing XMP stream: " + saxe.getMessage()); } } - + /** {@inheritDoc} */ protected void populateStreamDict(Object lengthEntry) { final String filterEntry = getFilterList().buildFilterDictEntries(); - if (getDocumentSafely().getProfile().getPDFAMode().isPDFA1LevelB() + if (getDocumentSafely().getProfile().getPDFAMode().isPDFA1LevelB() && filterEntry != null && filterEntry.length() > 0) { throw new PDFConformanceException( "The Filter key is prohibited when PDF/A-1 is active"); @@ -112,7 +112,7 @@ public class PDFMetadata extends PDFStream { put("Subtype", new PDFName("XML")); super.populateStreamDict(lengthEntry); } - + /** * Creates an XMP document based on the settings on the PDF Document. * @param pdfDoc the PDF Document @@ -120,7 +120,7 @@ public class PDFMetadata extends PDFStream { */ public static Metadata createXMPFromPDFDocument(PDFDocument pdfDoc) { Metadata meta = new Metadata(); - + PDFInfo info = pdfDoc.getInfo(); PDFRoot root = pdfDoc.getRoot(); @@ -129,7 +129,7 @@ public class PDFMetadata extends PDFStream { Date d = new Date(); info.setCreationDate(d); } - + //Important: Acrobat 7's preflight check for PDF/A-1b wants the creation date in the Info //object and in the XMP metadata to have the same timezone or else it shows a validation //error even if the times are essentially equal. @@ -153,7 +153,7 @@ public class PDFMetadata extends PDFStream { dc.addDate(info.getCreationDate()); //PDF/A identification - PDFAMode pdfaMode = pdfDoc.getProfile().getPDFAMode(); + PDFAMode pdfaMode = pdfDoc.getProfile().getPDFAMode(); if (pdfaMode.isPDFA1LevelB()) { PDFAAdapter pdfa = PDFAXMPSchema.getAdapter(meta); pdfa.setPart(1); @@ -163,7 +163,7 @@ public class PDFMetadata extends PDFStream { pdfa.setConformance("B"); //PDF/A-1b } } - + //XMP Basic Schema XMPBasicAdapter xmpBasic = XMPBasicSchema.getAdapter(meta); xmpBasic.setCreateDate(info.getCreationDate()); @@ -186,8 +186,8 @@ public class PDFMetadata extends PDFStream { adobePDF.setProducer(info.getProducer()); } adobePDF.setPDFVersion(pdfDoc.getPDFVersionString()); - - + + return meta; } @@ -206,14 +206,14 @@ public class PDFMetadata extends PDFStream { } else { info.setAuthor(null); } - + //dc:description["x-default"] maps to Subject as per ISO-19005-1:2005/Cor.1:2007 info.setSubject(dc.getDescription()); - + AdobePDFAdapter pdf = AdobePDFSchema.getAdapter(meta); info.setKeywords(pdf.getKeywords()); info.setProducer(pdf.getProducer()); - + XMPBasicAdapter xmpBasic = XMPBasicSchema.getAdapter(meta); info.setCreator(xmpBasic.getCreatorTool()); Date d; diff --git a/src/java/org/apache/fop/pdf/PDFName.java b/src/java/org/apache/fop/pdf/PDFName.java index 26d449591..6dabc3ac4 100644 --- a/src/java/org/apache/fop/pdf/PDFName.java +++ b/src/java/org/apache/fop/pdf/PDFName.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -29,9 +29,9 @@ import org.apache.commons.io.output.CountingOutputStream; * Class representing a PDF name object. */ public class PDFName extends PDFObject { - + private String name; - + /** * Creates a new PDF name object. * @param name the name value @@ -58,8 +58,8 @@ public class PDFName extends PDFObject { } return sb.toString(); } - - private static final char[] DIGITS + + private static final char[] DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; @@ -71,7 +71,7 @@ public class PDFName extends PDFObject { sb.append(DIGITS[ch >>> 4 & 0x0F]); sb.append(DIGITS[ch & 0x0F]); } - + /** {@inheritDoc} */ public String toString() { return this.name; @@ -86,15 +86,15 @@ public class PDFName extends PDFObject { } writer.write(toString()); - + if (hasObjectNumber()) { writer.write("\nendobj\n"); } - + writer.flush(); return cout.getCount(); } - + /** {@inheritDoc} */ public void outputInline(OutputStream out, Writer writer) throws IOException { if (hasObjectNumber()) { @@ -103,5 +103,5 @@ public class PDFName extends PDFObject { writer.write(toString()); } } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNameTreeNode.java b/src/java/org/apache/fop/pdf/PDFNameTreeNode.java index 4dcf0e03e..4bc00ef9c 100644 --- a/src/java/org/apache/fop/pdf/PDFNameTreeNode.java +++ b/src/java/org/apache/fop/pdf/PDFNameTreeNode.java @@ -43,7 +43,7 @@ public class PDFNameTreeNode extends PDFDictionary { public void setKids(PDFArray kids) { put(KIDS, kids); } - + /** * Returns the Kids array. * @return the Kids array @@ -51,7 +51,7 @@ public class PDFNameTreeNode extends PDFDictionary { public PDFArray getKids() { return (PDFArray)get(KIDS); } - + /** * Sets the Names array. * @param names the Names array @@ -59,7 +59,7 @@ public class PDFNameTreeNode extends PDFDictionary { public void setNames(PDFArray names) { put(NAMES, names); } - + /** * Returns the Names array. * @return the Names array @@ -67,7 +67,7 @@ public class PDFNameTreeNode extends PDFDictionary { public PDFArray getNames() { return (PDFArray)get(NAMES); } - + /** * Sets the lower limit value of the Limits array. * @param key the lower limit value @@ -116,6 +116,6 @@ public class PDFNameTreeNode extends PDFDictionary { } return limits; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNames.java b/src/java/org/apache/fop/pdf/PDFNames.java index d2d895771..4253dd6d1 100644 --- a/src/java/org/apache/fop/pdf/PDFNames.java +++ b/src/java/org/apache/fop/pdf/PDFNames.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,14 +16,14 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** * Class representing a PDF Names object */ public class PDFNames extends PDFDictionary { - + /** * Create the Names object */ @@ -39,7 +39,7 @@ public class PDFNames extends PDFDictionary { public PDFDests getDests() { return (PDFDests)get("Dests"); } - + /** * Set the Dests object * @param dests the Dests object @@ -47,5 +47,5 @@ public class PDFNames extends PDFDictionary { public void setDests(PDFDests dests) { put("Dests", dests); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNull.java b/src/java/org/apache/fop/pdf/PDFNull.java index b1af30dc0..01ec7898c 100644 --- a/src/java/org/apache/fop/pdf/PDFNull.java +++ b/src/java/org/apache/fop/pdf/PDFNull.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -27,10 +27,10 @@ import java.io.Writer; * Class representing a PDF name object. */ public final class PDFNull implements PDFWritable { - + /** Instance for the "null" object. */ public static final PDFNull INSTANCE = new PDFNull(); - + /** * Creates a new PDF name object. * @param name the name value @@ -42,10 +42,10 @@ public final class PDFNull implements PDFWritable { public String toString() { return "null"; } - + /** {@inheritDoc} */ public void outputInline(OutputStream out, Writer writer) throws IOException { writer.write(toString()); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNumber.java b/src/java/org/apache/fop/pdf/PDFNumber.java index 2a8d6c472..55834f529 100644 --- a/src/java/org/apache/fop/pdf/PDFNumber.java +++ b/src/java/org/apache/fop/pdf/PDFNumber.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.text.DecimalFormat; @@ -24,7 +24,7 @@ import java.text.DecimalFormatSymbols; import java.util.Locale; /** - * This class represents a simple number object. It also contains contains some + * This class represents a simple number object. It also contains contains some * utility methods for outputing numbers to PDF. */ public class PDFNumber extends PDFObject { @@ -38,7 +38,7 @@ public class PDFNumber extends PDFObject { public Number getNumber() { return this.number; } - + /** * Sets the number. * @param number the number @@ -69,9 +69,9 @@ public class PDFNumber extends PDFObject { // Static cache. Possible concurrency implications. See comment in doubleOut(double, int). private static DecimalFormat[] decimalFormatCache = new DecimalFormat[17]; - + private static final String BASE_FORMAT = "0.################"; - + /** * Output a double value to a string suitable for PDF. * In this method it is possible to set the maximum @@ -83,7 +83,7 @@ public class PDFNumber extends PDFObject { */ public static String doubleOut(double doubleDown, int dec) { if (dec < 0 || dec >= decimalFormatCache.length) { - throw new IllegalArgumentException("Parameter dec must be between 1 and " + throw new IllegalArgumentException("Parameter dec must be between 1 and " + (decimalFormatCache.length + 1)); } if (decimalFormatCache[dec] == null) { diff --git a/src/java/org/apache/fop/pdf/PDFNumberTreeNode.java b/src/java/org/apache/fop/pdf/PDFNumberTreeNode.java index ef1ccb452..72fbcd1c6 100644 --- a/src/java/org/apache/fop/pdf/PDFNumberTreeNode.java +++ b/src/java/org/apache/fop/pdf/PDFNumberTreeNode.java @@ -43,7 +43,7 @@ public class PDFNumberTreeNode extends PDFDictionary { public void setKids(PDFArray kids) { put(KIDS, kids); } - + /** * Returns the Kids array. * @return the Kids array @@ -51,7 +51,7 @@ public class PDFNumberTreeNode extends PDFDictionary { public PDFArray getKids() { return (PDFArray)get(KIDS); } - + /** * Sets the Nums array. * @param nums the Nums array @@ -59,7 +59,7 @@ public class PDFNumberTreeNode extends PDFDictionary { public void setNums(PDFNumsArray nums) { put(NUMS, nums); } - + /** * Returns the Nums array. * @return the Nums array @@ -67,7 +67,7 @@ public class PDFNumberTreeNode extends PDFDictionary { public PDFNumsArray getNums() { return (PDFNumsArray)get(NUMS); } - + /** * Sets the lower limit value of the Limits array. * @param key the lower limit value @@ -116,6 +116,6 @@ public class PDFNumberTreeNode extends PDFDictionary { } return limits; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNumsArray.java b/src/java/org/apache/fop/pdf/PDFNumsArray.java index 0a86754e8..e1c38dd48 100644 --- a/src/java/org/apache/fop/pdf/PDFNumsArray.java +++ b/src/java/org/apache/fop/pdf/PDFNumsArray.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -32,7 +32,7 @@ import org.apache.commons.io.output.CountingOutputStream; * Class representing an "Nums" array object (for Number Trees). */ public class PDFNumsArray extends PDFObject { - + /** Sorted Map holding the values of this array. */ protected SortedMap map = new java.util.TreeMap(); @@ -51,7 +51,7 @@ public class PDFNumsArray extends PDFObject { public int length() { return this.map.size(); } - + /** * Sets an entry. * @param key the key of the value to set @@ -60,7 +60,7 @@ public class PDFNumsArray extends PDFObject { public void put(int key, Object obj) { this.map.put(new Integer(key), obj); } - + /** * Gets an entry. * @param key the key of requested value @@ -69,7 +69,7 @@ public class PDFNumsArray extends PDFObject { public Object get(int key) { return this.map.get(new Integer(key)); } - + /** {@inheritDoc} */ protected int output(OutputStream stream) throws IOException { CountingOutputStream cout = new CountingOutputStream(stream); @@ -77,7 +77,7 @@ public class PDFNumsArray extends PDFObject { if (hasObjectNumber()) { writer.write(getObjectID()); } - + writer.write('['); boolean first = true; Iterator iter = this.map.entrySet().iterator(); @@ -92,13 +92,13 @@ public class PDFNumsArray extends PDFObject { formatObject(entry.getValue(), cout, writer); } writer.write(']'); - + if (hasObjectNumber()) { writer.write("\nendobj\n"); } - + writer.flush(); return cout.getCount(); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFObject.java b/src/java/org/apache/fop/pdf/PDFObject.java index 8dc4d8794..97e9f4976 100644 --- a/src/java/org/apache/fop/pdf/PDFObject.java +++ b/src/java/org/apache/fop/pdf/PDFObject.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -61,7 +61,7 @@ public abstract class PDFObject implements PDFWritable { /** the parent PDFObject (may be null and may not always be set, needed for encryption) */ private PDFObject parent; - + /** * Returns the object's number. * @return the PDF Object number @@ -72,14 +72,14 @@ public abstract class PDFObject implements PDFWritable { } return this.objnum; } - + /** * Default constructor. */ public PDFObject() { //nop } - + /** * Constructor for direct objects. * @param parent the containing PDFObject instance @@ -87,9 +87,9 @@ public abstract class PDFObject implements PDFWritable { public PDFObject(PDFObject parent) { setParent(parent); } - + /** - * Indicates whether this PDFObject has already been assigned an + * Indicates whether this PDFObject has already been assigned an * object number. * @return True if it has an object number */ @@ -164,7 +164,7 @@ public abstract class PDFObject implements PDFWritable { public PDFObject getParent() { return this.parent; } - + /** * Sets the direct parent object. * @param parent the direct parent @@ -201,7 +201,7 @@ public abstract class PDFObject implements PDFWritable { public PDFReference makeReference() { return new PDFReference(this); } - + /** * Write the PDF represention of this object * @@ -224,7 +224,7 @@ public abstract class PDFObject implements PDFWritable { output(out); } } - + /** * Encodes the object as a byte array for output to a PDF file. * @@ -233,12 +233,12 @@ public abstract class PDFObject implements PDFWritable { protected byte[] toPDF() { return encode(toPDFString()); } - - + + /** * This method returns a String representation of the PDF object. The result - * is normally converted/encoded to a byte array by toPDF(). Only use - * this method to implement the serialization if the object can be fully + * is normally converted/encoded to a byte array by toPDF(). Only use + * this method to implement the serialization if the object can be fully * represented as text. If the PDF representation of the object contains * binary content use toPDF() or output(OutputStream) instead. This applies * to any object potentially containing a string object because string object @@ -249,7 +249,7 @@ public abstract class PDFObject implements PDFWritable { throw new UnsupportedOperationException("Not implemented. " + "Use output(OutputStream) instead."); } - + /** * Converts text to a byte array for writing to a PDF file. * @param text text to convert/encode @@ -258,7 +258,7 @@ public abstract class PDFObject implements PDFWritable { public static final byte[] encode(String text) { return PDFDocument.encode(text); } - + /** * Encodes a Text String (3.8.1 in PDF 1.4 specs) * @param text the text to encode @@ -273,7 +273,7 @@ public abstract class PDFObject implements PDFWritable { return encode(PDFText.escapeText(text, false)); } } - + /** * Encodes a String (3.2.3 in PDF 1.4 specs) * @param string the string to encode @@ -282,7 +282,7 @@ public abstract class PDFObject implements PDFWritable { protected byte[] encodeString(String string) { return encodeText(string); } - + /** * Encodes binary data as hexadecimal string object. * @param data the binary data @@ -299,7 +299,7 @@ public abstract class PDFObject implements PDFWritable { out.write(encoded); out.write('>'); } - + /** * Formats an object for serialization to PDF. * @param obj the object @@ -329,7 +329,7 @@ public abstract class PDFObject implements PDFWritable { out.write(encodeText(obj.toString())); } } - + /** Formatting pattern for PDF date */ protected static final SimpleDateFormat DATE_FORMAT; @@ -337,9 +337,9 @@ public abstract class PDFObject implements PDFWritable { DATE_FORMAT = new SimpleDateFormat("'D:'yyyyMMddHHmmss", Locale.ENGLISH); DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT")); } - + /** - * Formats a date/time according to the PDF specification + * Formats a date/time according to the PDF specification * (D:YYYYMMDDHHmmSSOHH'mm'). * @param time date/time value to format * @param tz the time zone @@ -348,17 +348,17 @@ public abstract class PDFObject implements PDFWritable { protected String formatDateTime(Date time, TimeZone tz) { Calendar cal = Calendar.getInstance(tz, Locale.ENGLISH); cal.setTime(time); - + int offset = cal.get(Calendar.ZONE_OFFSET); offset += cal.get(Calendar.DST_OFFSET); - + //DateFormat is operating on GMT so adjust for time zone offset Date dt1 = new Date(time.getTime() + offset); StringBuffer sb = new StringBuffer(); sb.append(DATE_FORMAT.format(dt1)); - + offset /= (1000 * 60); //Convert to minutes - + if (offset == 0) { sb.append('Z'); } else { @@ -392,5 +392,5 @@ public abstract class PDFObject implements PDFWritable { protected String formatDateTime(Date time) { return formatDateTime(time, TimeZone.getDefault()); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFOutline.java b/src/java/org/apache/fop/pdf/PDFOutline.java index b4b7cb6be..57e210a7a 100644 --- a/src/java/org/apache/fop/pdf/PDFOutline.java +++ b/src/java/org/apache/fop/pdf/PDFOutline.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.ByteArrayOutputStream; @@ -50,10 +50,10 @@ public class PDFOutline extends PDFObject { private PDFOutline last; private int count; - + // whether to show this outline item's child outline items private boolean openItem = false; - + /** * title to display for the bookmark entry */ @@ -158,7 +158,7 @@ public class PDFOutline extends PDFObject { bout.write(encode(" /Last " + last.referencePDF() + "\n")); } if (count > 0) { - bout.write(encode(" /Count " + (openItem ? "" : "-") + bout.write(encode(" /Count " + (openItem ? "" : "-") + count + "\n")); } if (actionRef != null) { diff --git a/src/java/org/apache/fop/pdf/PDFOutputIntent.java b/src/java/org/apache/fop/pdf/PDFOutputIntent.java index 17badfd5a..ea073829b 100644 --- a/src/java/org/apache/fop/pdf/PDFOutputIntent.java +++ b/src/java/org/apache/fop/pdf/PDFOutputIntent.java @@ -33,14 +33,14 @@ public class PDFOutputIntent extends PDFObject { public static final String GTS_PDFX = "GTS_PDFX"; /** Subtype for PDF/A-1 output intents */ public static final String GTS_PDFA1 = "GTS_PDFA1"; - + private String subtype; //S in the PDF spec private String outputCondition; private String outputConditionIdentifier; private String registryName; private String info; private PDFICCStream destOutputProfile; - + /** @return the output intent subtype. */ public String getSubtype() { @@ -119,7 +119,7 @@ public class PDFOutputIntent extends PDFObject { /** * Sets the destination ICC profile. - * @param destOutputProfile An ICC profile stream defining the transformation from the PDF + * @param destOutputProfile An ICC profile stream defining the transformation from the PDF * document's source colors to output device colorants. */ public void setDestOutputProfile(PDFICCStream destOutputProfile) { @@ -137,33 +137,33 @@ public class PDFOutputIntent extends PDFObject { bout.write(encode("/S /")); bout.write(encode(this.subtype)); bout.write(encode("\n")); - + if (outputCondition != null) { bout.write(encode("/OutputCondition ")); bout.write(encodeText(this.outputCondition)); bout.write(encode("\n")); } - + bout.write(encode("/OutputConditionIdentifier ")); bout.write(encodeText(this.outputConditionIdentifier)); bout.write(encode("\n")); - + if (registryName != null) { bout.write(encode("/RegistryName ")); bout.write(encodeText(this.registryName)); bout.write(encode("\n")); } - + if (info != null) { bout.write(encode("/Info ")); bout.write(encodeText(this.info)); bout.write(encode("\n")); } - + if (destOutputProfile != null) { bout.write(encode("/DestOutputProfile " + destOutputProfile.referencePDF() + "\n")); } - + bout.write(encode(">>\nendobj\n")); } catch (IOException ioe) { log.error("Ignored I/O exception", ioe); @@ -171,5 +171,5 @@ public class PDFOutputIntent extends PDFObject { return bout.toByteArray(); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFPage.java b/src/java/org/apache/fop/pdf/PDFPage.java index ee105f39b..d1472e154 100644 --- a/src/java/org/apache/fop/pdf/PDFPage.java +++ b/src/java/org/apache/fop/pdf/PDFPage.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.awt.geom.Rectangle2D; @@ -33,7 +33,7 @@ public class PDFPage extends PDFResourceContext { /** the page index (zero-based) */ protected int pageIndex; - + /** * Create a /Page object * @@ -75,12 +75,12 @@ public class PDFPage extends PDFResourceContext { setBleedBox(box); //Recommended by PDF/X setTrimBox(box); //Needed for PDF/X } - + private PDFArray toPDFArray(Rectangle2D box) { return new PDFArray(this, new double[] { box.getX(), box.getY(), box.getMaxX(), box.getMaxY()}); } - + /** * Sets the "MediaBox" entry * @param box the media rectangle @@ -88,7 +88,7 @@ public class PDFPage extends PDFResourceContext { public void setMediaBox(Rectangle2D box) { put("MediaBox", toPDFArray(box)); } - + /** * Sets the "TrimBox" entry * @param box the trim rectangle @@ -96,7 +96,7 @@ public class PDFPage extends PDFResourceContext { public void setTrimBox(Rectangle2D box) { put("TrimBox", toPDFArray(box)); } - + /** * Sets the "BleedBox" entry * @param box the bleed rectangle @@ -104,7 +104,7 @@ public class PDFPage extends PDFResourceContext { public void setBleedBox(Rectangle2D box) { put("BleedBox", toPDFArray(box)); } - + /** * set this page contents * diff --git a/src/java/org/apache/fop/pdf/PDFPageLabels.java b/src/java/org/apache/fop/pdf/PDFPageLabels.java index 1a51c4155..2c1a977b4 100644 --- a/src/java/org/apache/fop/pdf/PDFPageLabels.java +++ b/src/java/org/apache/fop/pdf/PDFPageLabels.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,14 +16,14 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** * Class representing a PDF /PageLabels dictionary. */ public class PDFPageLabels extends PDFNumberTreeNode { - + /** * Create the /PageLabels dictionary */ @@ -44,5 +44,5 @@ public class PDFPageLabels extends PDFNumberTreeNode { } return nums; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFPages.java b/src/java/org/apache/fop/pdf/PDFPages.java index 37a2394db..bef4bdbc4 100644 --- a/src/java/org/apache/fop/pdf/PDFPages.java +++ b/src/java/org/apache/fop/pdf/PDFPages.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -67,7 +67,7 @@ public class PDFPages extends PDFObject { page.setParent(this); this.incrementCount(); } - + /** * Use this method to notify the PDFPages object that a child page * @param page the child page @@ -79,7 +79,7 @@ public class PDFPages extends PDFObject { this.kids.add(null); } if (this.kids.get(idx) != null) { - throw new IllegalStateException("A page already exists at index " + throw new IllegalStateException("A page already exists at index " + idx + " (zero-based)."); } this.kids.set(idx, page.referencePDF()); diff --git a/src/java/org/apache/fop/pdf/PDFPathPaint.java b/src/java/org/apache/fop/pdf/PDFPathPaint.java index 0bcb19a7e..5133e54a4 100644 --- a/src/java/org/apache/fop/pdf/PDFPathPaint.java +++ b/src/java/org/apache/fop/pdf/PDFPathPaint.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFPattern.java b/src/java/org/apache/fop/pdf/PDFPattern.java index 3bb190c48..4e862c3f2 100644 --- a/src/java/org/apache/fop/pdf/PDFPattern.java +++ b/src/java/org/apache/fop/pdf/PDFPattern.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -118,8 +118,8 @@ public class PDFPattern extends PDFPathPaint { * @param thePatternDataStream The stream of pattern data to be tiled. */ public PDFPattern(PDFResources theResources, int thePatternType, // 1 - int thePaintType, int theTilingType, List theBBox, - double theXStep, double theYStep, + int thePaintType, int theTilingType, List theBBox, + double theXStep, double theYStep, List theMatrix, List theXUID, StringBuffer thePatternDataStream) { super(); @@ -272,9 +272,9 @@ public class PDFPattern extends PDFPathPaint { pdfStream.setDocument(getDocumentSafely()); pdfStream.add(this.patternDataStream.toString()); pdfStream.getFilterList().addDefaultFilters( - getDocument().getFilterMap(), + getDocument().getFilterMap(), PDFFilterList.CONTENT_FILTER); - encodedStream = pdfStream.encodeStream(); + encodedStream = pdfStream.encodeStream(); p.append(pdfStream.getFilterList().buildFilterDictEntries()); p.append("/Length " + (encodedStream.getSize() + 1) + " \n"); diff --git a/src/java/org/apache/fop/pdf/PDFProfile.java b/src/java/org/apache/fop/pdf/PDFProfile.java index 3264e1f44..20af4e212 100644 --- a/src/java/org/apache/fop/pdf/PDFProfile.java +++ b/src/java/org/apache/fop/pdf/PDFProfile.java @@ -26,25 +26,25 @@ import java.text.MessageFormat; * the libarary and its users to enable the generation of PDFs conforming to the enabled PDF * profiles. *
- * Some profile from PDF/X and PDF/A can be active simultaneously (example: PDF/A-1 and
+ * Some profile from PDF/X and PDF/A can be active simultaneously (example: PDF/A-1 and
* PDF/X-3:2003).
*/
public class PDFProfile {
/**
- * Indicates the PDF/A mode currently active. Defaults to "no restrictions", i.e.
+ * Indicates the PDF/A mode currently active. Defaults to "no restrictions", i.e.
* PDF/A not active.
*/
protected PDFAMode pdfAMode = PDFAMode.DISABLED;
-
+
/**
- * Indicates the PDF/X mode currently active. Defaults to "no restrictions", i.e.
+ * Indicates the PDF/X mode currently active. Defaults to "no restrictions", i.e.
* PDF/X not active.
*/
protected PDFXMode pdfXMode = PDFXMode.DISABLED;
-
+
private PDFDocument doc;
-
+
/**
* Main constructor
* @param doc the PDF document
@@ -52,7 +52,7 @@ public class PDFProfile {
public PDFProfile(PDFDocument doc) {
this.doc = doc;
}
-
+
/**
* Validates if the requested profile combination is compatible.
*/
@@ -69,22 +69,22 @@ public class PDFProfile {
}
}
}
-
+
/** @return the PDFDocument this profile is attached to */
public PDFDocument getDocument() {
return this.doc;
}
-
+
/** @return the PDF/A mode */
public PDFAMode getPDFAMode() {
return this.pdfAMode;
}
-
+
/** @return true if any PDF/A mode is active */
public boolean isPDFAActive() {
return getPDFAMode() != PDFAMode.DISABLED;
}
-
+
/**
* Sets the PDF/A mode
* @param mode the PDF/A mode
@@ -96,17 +96,17 @@ public class PDFProfile {
this.pdfAMode = mode;
validateProfileCombination();
}
-
+
/** @return the PDF/X mode */
public PDFXMode getPDFXMode() {
return this.pdfXMode;
}
-
+
/** @return true if any PDF/X mode is active */
public boolean isPDFXActive() {
return getPDFXMode() != PDFXMode.DISABLED;
}
-
+
/**
* Sets the PDF/X mode
* @param mode the PDF/X mode
@@ -133,13 +133,13 @@ public class PDFProfile {
}
return sb.toString();
}
-
+
//---------=== Info and validation methods ===---------
-
+
private String format(String pattern, Object arg) {
return MessageFormat.format(pattern, new Object[] {arg});
}
-
+
/** Checks if encryption is allowed. */
public void verifyEncryptionAllowed() {
final String err = "{0} doesn't allow encrypted PDFs";
@@ -170,11 +170,11 @@ public class PDFProfile {
public void verifyTransparencyAllowed(String context) {
final String err = "{0} does not allow the use of transparency. ({1})";
if (isPDFAActive()) {
- throw new PDFConformanceException(MessageFormat.format(err,
+ throw new PDFConformanceException(MessageFormat.format(err,
new Object[] {getPDFAMode(), context}));
}
if (isPDFXActive()) {
- throw new PDFConformanceException(MessageFormat.format(err,
+ throw new PDFConformanceException(MessageFormat.format(err,
new Object[] {getPDFXMode(), context}));
}
}
@@ -182,16 +182,16 @@ public class PDFProfile {
/** Checks if the right PDF version is set. */
public void verifyPDFVersion() {
final String err = "PDF version must be 1.4 for {0}";
- if (getPDFAMode().isPDFA1LevelB()
+ if (getPDFAMode().isPDFA1LevelB()
&& getDocument().getPDFVersion() != PDFDocument.PDF_VERSION_1_4) {
throw new PDFConformanceException(format(err, getPDFAMode()));
}
- if (getPDFXMode() == PDFXMode.PDFX_3_2003
+ if (getPDFXMode() == PDFXMode.PDFX_3_2003
&& getDocument().getPDFVersion() != PDFDocument.PDF_VERSION_1_4) {
throw new PDFConformanceException(format(err, getPDFXMode()));
}
}
-
+
/** @return true if the ID entry must be present in the trailer. */
public boolean isIDEntryRequired() {
return isPDFAActive() || isPDFXActive();
@@ -224,7 +224,7 @@ public class PDFProfile {
public boolean isAnnotationAllowed() {
return !isPDFXActive();
}
-
+
/** Checks if annotations are allowed. */
public void verifyAnnotAllowed() {
if (!isAnnotationAllowed()) {
diff --git a/src/java/org/apache/fop/pdf/PDFRectangle.java b/src/java/org/apache/fop/pdf/PDFRectangle.java
index ca97c2474..ce5b46440 100644
--- a/src/java/org/apache/fop/pdf/PDFRectangle.java
+++ b/src/java/org/apache/fop/pdf/PDFRectangle.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
diff --git a/src/java/org/apache/fop/pdf/PDFReference.java b/src/java/org/apache/fop/pdf/PDFReference.java
index da388d368..5c3bdf3dc 100644
--- a/src/java/org/apache/fop/pdf/PDFReference.java
+++ b/src/java/org/apache/fop/pdf/PDFReference.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -32,11 +32,11 @@ import java.lang.ref.SoftReference;
* PDF file.
*/
public class PDFReference implements PDFWritable {
-
+
private String indirectReference;
-
+
private Reference objReference;
-
+
/**
* Creates a new PDF reference.
* @param obj the object to be referenced
@@ -45,7 +45,7 @@ public class PDFReference implements PDFWritable {
this.indirectReference = obj.referencePDF();
this.objReference = new SoftReference(obj);
}
-
+
/**
* Creates a new PDF reference, but without a reference to the original object.
* @param ref an object reference
@@ -72,15 +72,15 @@ public class PDFReference implements PDFWritable {
return null;
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return this.indirectReference;
}
-
+
/** {@inheritDoc} */
public void outputInline(OutputStream out, Writer writer) throws IOException {
writer.write(toString());
}
-
+
}
diff --git a/src/java/org/apache/fop/pdf/PDFResourceContext.java b/src/java/org/apache/fop/pdf/PDFResourceContext.java
index 6be18ce9d..16c1976db 100644
--- a/src/java/org/apache/fop/pdf/PDFResourceContext.java
+++ b/src/java/org/apache/fop/pdf/PDFResourceContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
diff --git a/src/java/org/apache/fop/pdf/PDFResources.java b/src/java/org/apache/fop/pdf/PDFResources.java
index da213bb87..cbfc9d53a 100644
--- a/src/java/org/apache/fop/pdf/PDFResources.java
+++ b/src/java/org/apache/fop/pdf/PDFResources.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.util.HashMap;
@@ -67,10 +67,10 @@ public class PDFResources extends PDFObject {
/** Map of color spaces (key: color space name) */
protected Map colorSpaces = new HashMap();
-
+
/** Map of ICC color spaces (key: ICC profile description) */
protected Map iccColorSpaces = new HashMap();
-
+
/**
* create a /Resources object.
*
@@ -93,7 +93,7 @@ public class PDFResources extends PDFObject {
/**
* Add the fonts in the font info to this PDF document's Font Resources.
- *
+ *
* @param doc PDF document to add fonts to
* @param fontInfo font info object to get font information from
*/
@@ -103,7 +103,7 @@ public class PDFResources extends PDFObject {
while (e.hasNext()) {
String f = (String)e.next();
Typeface font = (Typeface)usedFonts.get(f);
-
+
//Check if the font actually had any mapping operations. If not, it is an indication
//that it has never actually been used and therefore doesn't have to be embedded.
if (font.hadMappingOperations()) {
@@ -159,7 +159,7 @@ public class PDFResources extends PDFObject {
/**
* Add a ColorSpace dictionary to the resources.
- * @param colorSpace the color space
+ * @param colorSpace the color space
*/
public void addColorSpace(PDFICCBasedColorSpace colorSpace) {
this.colorSpaces.put(colorSpace.getName(), colorSpace);
diff --git a/src/java/org/apache/fop/pdf/PDFRoot.java b/src/java/org/apache/fop/pdf/PDFRoot.java
index 0dd9b890c..1ea316390 100644
--- a/src/java/org/apache/fop/pdf/PDFRoot.java
+++ b/src/java/org/apache/fop/pdf/PDFRoot.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
@@ -50,7 +50,7 @@ public class PDFRoot extends PDFDictionary {
new PDFName("UseThumbs"),
new PDFName("FullScreen"),
};
-
+
/**
* create a Root (/Catalog) object. NOTE: The PDFRoot
* object must be created before the PDF document is
@@ -94,7 +94,7 @@ public class PDFRoot extends PDFDictionary {
return PAGEMODE_USENONE;
}
}
-
+
/**
* add a /Page object to the root /Pages object
*
@@ -123,7 +123,7 @@ public class PDFRoot extends PDFDictionary {
PDFReference ref = (PDFReference)get("Pages");
return (ref != null ? (PDFPages)ref.getObject() : null);
}
-
+
/**
* Sets the /PageLabels object.
* @param pageLabels the /PageLabels object
@@ -131,7 +131,7 @@ public class PDFRoot extends PDFDictionary {
public void setPageLabels(PDFPageLabels pageLabels) {
put("PageLabels", pageLabels.makeReference());
}
-
+
/**
* Returns the /PageLabels object.
* @return the /PageLabels object if set, null otherwise.
@@ -141,7 +141,7 @@ public class PDFRoot extends PDFDictionary {
PDFReference ref = (PDFReference)get("PageLabels");
return (ref != null ? (PDFPageLabels)ref.getObject() : null);
}
-
+
/**
* Set the root outline for the PDF document.
*
@@ -149,7 +149,7 @@ public class PDFRoot extends PDFDictionary {
*/
public void setRootOutline(PDFOutline out) {
put("Outlines", out.makeReference());
-
+
//Set /PageMode to /UseOutlines by default if no other mode has been set
PDFName mode = (PDFName)get("PageMode");
if (mode == null) {
@@ -166,7 +166,7 @@ public class PDFRoot extends PDFDictionary {
PDFReference ref = (PDFReference)get("Outlines");
return (ref != null ? (PDFOutline)ref.getObject() : null);
}
-
+
/**
* Set the /Names object.
* @param names the Names object
@@ -175,7 +175,7 @@ public class PDFRoot extends PDFDictionary {
public void setNames(PDFNames names) {
put("Names", names.makeReference());
}
-
+
/**
* Returns the /Names object.
* @return the Names object if set, null otherwise.
@@ -185,7 +185,7 @@ public class PDFRoot extends PDFDictionary {
PDFReference ref = (PDFReference)get("Names");
return (ref != null ? (PDFNames)ref.getObject() : null);
}
-
+
/**
* Set the optional Metadata object.
* @param meta the Metadata object
@@ -196,7 +196,7 @@ public class PDFRoot extends PDFDictionary {
put("Metadata", meta.makeReference());
}
}
-
+
/**
* Returns the /Metadata object
* @return the /Metadata object if set, null otherwise.
@@ -215,7 +215,7 @@ public class PDFRoot extends PDFDictionary {
public PDFArray getOutputIntents() {
return (PDFArray)get("OutputIntents");
}
-
+
/**
* Adds an OutputIntent to the PDF
* @param outputIntent the OutputIntent dictionary
@@ -223,7 +223,7 @@ public class PDFRoot extends PDFDictionary {
*/
public void addOutputIntent(PDFOutputIntent outputIntent) {
if (getDocumentSafely().getPDFVersion() >= PDFDocument.PDF_VERSION_1_4) {
- PDFArray outputIntents = getOutputIntents();
+ PDFArray outputIntents = getOutputIntents();
if (outputIntents == null) {
outputIntents = new PDFArray(this);
put("OutputIntents", outputIntents);
@@ -231,7 +231,7 @@ public class PDFRoot extends PDFDictionary {
outputIntents.add(outputIntent);
}
}
-
+
/**
* Returns the language identifier of the document.
* @return the language identifier of the document (or null if not set or undefined)
@@ -240,7 +240,7 @@ public class PDFRoot extends PDFDictionary {
public String getLanguage() {
return (String)get("Lang");
}
-
+
/**
* Sets the language identifier of the document.
* @param lang the language identifier of the document.
@@ -251,5 +251,5 @@ public class PDFRoot extends PDFDictionary {
}
put("Lang", lang);
}
-
+
}
diff --git a/src/java/org/apache/fop/pdf/PDFShading.java b/src/java/org/apache/fop/pdf/PDFShading.java
index a782eaf36..5ac7245c9 100644
--- a/src/java/org/apache/fop/pdf/PDFShading.java
+++ b/src/java/org/apache/fop/pdf/PDFShading.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// Java...
@@ -338,7 +338,7 @@ public class PDFShading extends PDFObject {
int vectorSize;
int tempInt;
StringBuffer p = new StringBuffer(128);
- p.append(getObjectID()
+ p.append(getObjectID()
+ "<< \n/ShadingType " + this.shadingType + " \n");
if (this.colorSpace != null) {
p.append("/ColorSpace /"
diff --git a/src/java/org/apache/fop/pdf/PDFState.java b/src/java/org/apache/fop/pdf/PDFState.java
index 4f7b23a80..241bfce3f 100644
--- a/src/java/org/apache/fop/pdf/PDFState.java
+++ b/src/java/org/apache/fop/pdf/PDFState.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.util.Iterator;
@@ -150,9 +150,9 @@ public class PDFState extends org.apache.fop.render.AbstractState {
}
return newState;
}
-
+
private class PDFData extends org.apache.fop.render.AbstractState.AbstractData {
-
+
private static final long serialVersionUID = 3527950647293177764L;
private Paint paint = null;
@@ -179,7 +179,7 @@ public class PDFState extends org.apache.fop.render.AbstractState {
obj.gstate = this.gstate;
return obj;
}
-
+
/** {@inheritDoc} */
public String toString() {
return super.toString()
diff --git a/src/java/org/apache/fop/pdf/PDFStream.java b/src/java/org/apache/fop/pdf/PDFStream.java
index a213340e3..5f74a2613 100644
--- a/src/java/org/apache/fop/pdf/PDFStream.java
+++ b/src/java/org/apache/fop/pdf/PDFStream.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -32,14 +32,14 @@ import java.io.Writer;
* length.
*/
public class PDFStream extends AbstractPDFStream {
-
+
/**
* The stream of PDF commands
*/
protected StreamCache data;
private transient Writer streamWriter;
-
+
/**
* Create an empty stream object
*/
@@ -70,11 +70,11 @@ public class PDFStream extends AbstractPDFStream {
ex.printStackTrace();
}
}
-
+
private void flush() throws IOException {
this.streamWriter.flush();
}
-
+
/**
* Returns a Writer that writes to the OutputStream of the buffer.
* @return the Writer
@@ -95,7 +95,7 @@ public class PDFStream extends AbstractPDFStream {
}
return this.data.getOutputStream();
}
-
+
/**
* Used to set the contents of the PDF stream.
* @param data the contents as a byte array
@@ -138,7 +138,7 @@ public class PDFStream extends AbstractPDFStream {
*/
protected int output(OutputStream stream) throws IOException {
final int len = super.output(stream);
-
+
//Now that the data has been written, it can be discarded.
this.data = null;
return len;
diff --git a/src/java/org/apache/fop/pdf/PDFT1Stream.java b/src/java/org/apache/fop/pdf/PDFT1Stream.java
index d122743b0..8181287b5 100644
--- a/src/java/org/apache/fop/pdf/PDFT1Stream.java
+++ b/src/java/org/apache/fop/pdf/PDFT1Stream.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// Java
@@ -29,7 +29,7 @@ import org.apache.fop.fonts.type1.PFBData;
* Special PDFStream for embedding Type 1 fonts.
*/
public class PDFT1Stream extends AbstractPDFStream {
-
+
private PFBData pfb;
/**
@@ -76,9 +76,9 @@ public class PDFT1Stream extends AbstractPDFStream {
protected void outputRawStreamData(OutputStream out) throws IOException {
this.pfb.outputAllParts(out);
}
-
+
/**
- * Used to set the PFBData object that represents the embeddable Type 1
+ * Used to set the PFBData object that represents the embeddable Type 1
* font.
* @param pfb The PFB file
* @throws IOException in case of an I/O problem
diff --git a/src/java/org/apache/fop/pdf/PDFTTFStream.java b/src/java/org/apache/fop/pdf/PDFTTFStream.java
index 5570c62f3..6c68ea8bf 100644
--- a/src/java/org/apache/fop/pdf/PDFTTFStream.java
+++ b/src/java/org/apache/fop/pdf/PDFTTFStream.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -25,7 +25,7 @@ import java.io.IOException;
* Special PDFStream for embeddable TrueType fonts.
*/
public class PDFTTFStream extends PDFStream {
-
+
private int origLength;
/**
@@ -58,7 +58,7 @@ public class PDFTTFStream extends PDFStream {
put("Length1", origLength);
super.populateStreamDict(lengthEntry);
}
-
+
/**
* Sets the TrueType font data.
* @param data the font payload
diff --git a/src/java/org/apache/fop/pdf/PDFText.java b/src/java/org/apache/fop/pdf/PDFText.java
index d380ac8dd..02f845266 100644
--- a/src/java/org/apache/fop/pdf/PDFText.java
+++ b/src/java/org/apache/fop/pdf/PDFText.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.ByteArrayOutputStream;
@@ -24,15 +24,15 @@ import java.io.ByteArrayOutputStream;
import org.apache.avalon.framework.CascadingRuntimeException;
/**
- * This class represents a simple number object. It also contains contains some
+ * This class represents a simple number object. It also contains contains some
* utility methods for outputting numbers to PDF.
*/
public class PDFText extends PDFObject {
- private static final char[] DIGITS
+ private static final char[] DIGITS
= {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
-
+
private String text;
/**
@@ -42,7 +42,7 @@ public class PDFText extends PDFObject {
public String getText() {
return this.text;
}
-
+
/**
* Sets the text.
* @param text the text
@@ -97,7 +97,7 @@ public class PDFText extends PDFObject {
}
}
}
-
+
if (hexMode) {
final byte[] uniBytes;
try {
@@ -114,7 +114,7 @@ public class PDFText extends PDFObject {
if (unicode) {
// byte order marker (0xfeff)
result.append("\\376\\377");
-
+
for (int i = 0; i < l; i++) {
final char ch = text.charAt(i);
final int high = (ch & 0xff00) >>> 8;
@@ -162,7 +162,7 @@ public class PDFText extends PDFObject {
}
return sb.toString();
}
-
+
/**
* Converts a byte array to a Hexadecimal String (3.2.3 in PDF 1.4 specs)
* @param data the data to encode
@@ -171,7 +171,7 @@ public class PDFText extends PDFObject {
public static final String toHex(byte[] data) {
return toHex(data, true);
}
-
+
/**
* Converts a String to UTF-16 (big endian).
* @param text text to convert
@@ -206,7 +206,7 @@ public class PDFText extends PDFObject {
}
return buf.toString();
}
-
+
/**
* Escaped a String as described in section 4.4 in the PDF 1.3 specs.
* @param s String to escape
diff --git a/src/java/org/apache/fop/pdf/PDFTextUtil.java b/src/java/org/apache/fop/pdf/PDFTextUtil.java
index 224bb6a1d..735a7894d 100644
--- a/src/java/org/apache/fop/pdf/PDFTextUtil.java
+++ b/src/java/org/apache/fop/pdf/PDFTextUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,9 +27,9 @@ import java.awt.geom.AffineTransform;
*/
public abstract class PDFTextUtil {
- /** The number of decimal places. */
+ /** The number of decimal places. */
private static final int DEC = 8;
-
+
/** PDF text rendering mode: Fill text */
public static final int TR_FILL = 0;
/** PDF text rendering mode: Stroke text */
@@ -46,30 +46,30 @@ public abstract class PDFTextUtil {
public static final int TR_FILL_STROKE_CLIP = 6;
/** PDF text rendering mode: Add text to path for clipping */
public static final int TR_CLIP = 7;
-
+
private boolean inTextObject = false;
private String startText;
private String endText;
private boolean useMultiByte;
private StringBuffer bufTJ;
private int textRenderingMode = TR_FILL;
-
+
private String currentFontName;
private double currentFontSize;
-
+
/**
* Main constructor.
*/
public PDFTextUtil() {
//nop
}
-
+
/**
* Writes PDF code.
* @param code the PDF code to write
*/
protected abstract void write(String code);
-
+
private void writeAffineTransform(AffineTransform at, StringBuffer sb) {
double[] lt = new double[6];
at.getMatrix(lt);
@@ -100,13 +100,13 @@ public abstract class PDFTextUtil {
sb.append(PDFText.toUnicodeHex(ch));
}
}
-
+
private void checkInTextObject() {
if (!inTextObject) {
throw new IllegalStateException("Not in text object");
}
}
-
+
/**
* Indicates whether we are in a text object or not.
* @return true if we are in a text object
@@ -114,7 +114,7 @@ public abstract class PDFTextUtil {
public boolean isInTextObject() {
return inTextObject;
}
-
+
/**
* Called when a new text object should be started. Be sure to call setFont() before
* issuing any text painting commands.
@@ -126,7 +126,7 @@ public abstract class PDFTextUtil {
write("BT\n");
this.inTextObject = true;
}
-
+
/**
* Called when a text object should be ended.
*/
@@ -136,7 +136,7 @@ public abstract class PDFTextUtil {
this.inTextObject = false;
initValues();
}
-
+
/**
* Resets the state fields.
*/
@@ -145,14 +145,14 @@ public abstract class PDFTextUtil {
this.currentFontSize = 0.0;
this.textRenderingMode = TR_FILL;
}
-
+
/**
* Creates a "q" command, pushing a copy of the entire graphics state onto the stack.
*/
public void saveGraphicsState() {
write("q\n");
}
-
+
/**
* Creates a "Q" command, restoring the entire graphics state to its former value by popping
* it from the stack.
@@ -160,7 +160,7 @@ public abstract class PDFTextUtil {
public void restoreGraphicsState() {
write("Q\n");
}
-
+
/**
* Creates a "cm" command.
* @param at the transformation matrix
@@ -174,7 +174,7 @@ public abstract class PDFTextUtil {
write(sb.toString());
}
}
-
+
/**
* Writes a "Tf" command, setting a new current font.
* @param fontName the name of the font to select
@@ -183,7 +183,7 @@ public abstract class PDFTextUtil {
public void writeTf(String fontName, double fontSize) {
checkInTextObject();
write("/" + fontName + " " + PDFNumber.doubleOut(fontSize) + " Tf\n");
-
+
this.startText = useMultiByte ? "<" : "(";
this.endText = useMultiByte ? ">" : ")";
}
@@ -220,7 +220,7 @@ public abstract class PDFTextUtil {
write(this.textRenderingMode + " Tr\n");
}
}
-
+
/**
* Sets the text rendering mode.
* @param fill true if the text should be filled
@@ -239,7 +239,7 @@ public abstract class PDFTextUtil {
}
setTextRenderingMode(mode);
}
-
+
/**
* Writes a "Tm" command, setting a new text transformation matrix.
* @param localTransform the new text transformation matrix
diff --git a/src/java/org/apache/fop/pdf/PDFToUnicodeCMap.java b/src/java/org/apache/fop/pdf/PDFToUnicodeCMap.java
index 3d25e28cb..b70430af4 100644
--- a/src/java/org/apache/fop/pdf/PDFToUnicodeCMap.java
+++ b/src/java/org/apache/fop/pdf/PDFToUnicodeCMap.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -61,9 +61,9 @@ public class PDFToUnicodeCMap extends PDFCMap {
protected CMapBuilder createCMapBuilder(Writer writer) {
return new ToUnicodeCMapBuilder(writer);
}
-
+
class ToUnicodeCMapBuilder extends CMapBuilder {
-
+
public ToUnicodeCMapBuilder(Writer writer) {
super(writer, null);
}
@@ -82,7 +82,7 @@ public class PDFToUnicodeCMap extends PDFCMap {
writeBFEntries();
writeWrapUp();
}
-
+
/**
* Writes the character mappings for this font.
* @param p StingBuffer to write to
@@ -99,7 +99,7 @@ public class PDFToUnicodeCMap extends PDFCMap {
* expressed as part of a character range).
* @param p StringBuffer to write to
* @param charArray all the characters to map
- * @throws IOException
+ * @throws IOException
*/
protected void writeBFCharEntries(char[] charArray) throws IOException {
int totalEntries = 0;
@@ -136,7 +136,7 @@ public class PDFToUnicodeCMap extends PDFCMap {
* Writes the entries for character ranges for a base font.
* @param p StringBuffer to write to
* @param charArray all the characters to map
- * @throws IOException
+ * @throws IOException
*/
protected void writeBFRangeEntries(char[] charArray) throws IOException {
int totalEntries = 0;
@@ -283,6 +283,6 @@ public class PDFToUnicodeCMap extends PDFCMap {
return returnString.toString();
}
- }
-
+ }
+
}
diff --git a/src/java/org/apache/fop/pdf/PDFUri.java b/src/java/org/apache/fop/pdf/PDFUri.java
index 19617e368..296e38945 100644
--- a/src/java/org/apache/fop/pdf/PDFUri.java
+++ b/src/java/org/apache/fop/pdf/PDFUri.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
diff --git a/src/java/org/apache/fop/pdf/PDFWArray.java b/src/java/org/apache/fop/pdf/PDFWArray.java
index 04351c77d..ad6d2ac29 100644
--- a/src/java/org/apache/fop/pdf/PDFWArray.java
+++ b/src/java/org/apache/fop/pdf/PDFWArray.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.util.List;
@@ -31,12 +31,12 @@ public class PDFWArray {
*/
private List entries = new java.util.ArrayList();
- /**
- * Default constructor
+ /**
+ * Default constructor
*/
public PDFWArray() {
}
-
+
/**
* Convenience constructor
* @param metrics the metrics array to initially add
diff --git a/src/java/org/apache/fop/pdf/PDFWritable.java b/src/java/org/apache/fop/pdf/PDFWritable.java
index 4f024fb92..6e71dc7d8 100644
--- a/src/java/org/apache/fop/pdf/PDFWritable.java
+++ b/src/java/org/apache/fop/pdf/PDFWritable.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -28,7 +28,7 @@ import java.io.Writer;
* serializing the object or by writing a indirect reference to the actual object.
*/
public interface PDFWritable {
-
+
/**
* Writes a "direct object" (inline object) representation to the stream. A Writer is given
* for optimized encoding of text content. Since the Writer is buffered, make sure
@@ -38,5 +38,5 @@ public interface PDFWritable {
* @throws IOException if an I/O error occurs
*/
void outputInline(OutputStream out, Writer writer) throws IOException;
-
+
}
diff --git a/src/java/org/apache/fop/pdf/PDFXMode.java b/src/java/org/apache/fop/pdf/PDFXMode.java
index 05df3e32a..03813273b 100644
--- a/src/java/org/apache/fop/pdf/PDFXMode.java
+++ b/src/java/org/apache/fop/pdf/PDFXMode.java
@@ -26,7 +26,7 @@ public final class PDFXMode {
public static final PDFXMode DISABLED = new PDFXMode("PDF/X disabled");
/** PDF/X-3:2003 enabled */
public static final PDFXMode PDFX_3_2003 = new PDFXMode("PDF/X-3:2003");
-
+
private String name;
/**
@@ -41,7 +41,7 @@ public final class PDFXMode {
public String getName() {
return this.name;
}
-
+
/**
* Returns the mode enum object given a String.
* @param s the string
@@ -54,10 +54,10 @@ public final class PDFXMode {
return DISABLED;
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return name;
}
-
+
}
diff --git a/src/java/org/apache/fop/pdf/PDFXObject.java b/src/java/org/apache/fop/pdf/PDFXObject.java
index d0115fe66..d1ce6d75e 100644
--- a/src/java/org/apache/fop/pdf/PDFXObject.java
+++ b/src/java/org/apache/fop/pdf/PDFXObject.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// Java
@@ -33,7 +33,7 @@ import java.io.IOException;
* document in another place.
*/
public abstract class PDFXObject extends AbstractPDFStream {
-
+
/**
* Create an XObject with the given number.
*/
@@ -48,13 +48,13 @@ public abstract class PDFXObject extends AbstractPDFStream {
public PDFName getName() {
return (PDFName)get("Name");
}
-
+
/** {@inheritDoc} */
protected void populateStreamDict(Object lengthEntry) {
put("Type", new PDFName("XObject"));
super.populateStreamDict(lengthEntry);
}
-
+
/** {@inheritDoc} */
protected int getSizeHint() throws IOException {
return 0;
diff --git a/src/java/org/apache/fop/pdf/StreamCache.java b/src/java/org/apache/fop/pdf/StreamCache.java
index 8ac6e13e1..95d21ab80 100644
--- a/src/java/org/apache/fop/pdf/StreamCache.java
+++ b/src/java/org/apache/fop/pdf/StreamCache.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.OutputStream;
diff --git a/src/java/org/apache/fop/pdf/StreamCacheFactory.java b/src/java/org/apache/fop/pdf/StreamCacheFactory.java
index 00cfe933e..4e2d12eb2 100644
--- a/src/java/org/apache/fop/pdf/StreamCacheFactory.java
+++ b/src/java/org/apache/fop/pdf/StreamCacheFactory.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
import java.io.IOException;
@@ -31,7 +31,7 @@ public class StreamCacheFactory {
private static StreamCacheFactory memoryInstance = null;
private boolean cacheToFile = false;
-
+
/**
* Returns an instance of a StreamCacheFactory with the requested features.
* @param cacheToFile True if file shall be cached using a temporary file
@@ -50,7 +50,7 @@ public class StreamCacheFactory {
return memoryInstance;
}
}
-
+
/**
* Returns an instance of a StreamCacheFactory depending on the default
* setting for cacheToFile.
@@ -59,7 +59,7 @@ public class StreamCacheFactory {
public static StreamCacheFactory getInstance() {
return getInstance(defaultCacheToFile);
}
-
+
/**
* Sets the global default for cacheToFile
* @param cacheToFile True if stream caches should be held in files.
@@ -75,7 +75,7 @@ public class StreamCacheFactory {
public StreamCacheFactory(boolean cacheToFile) {
this.cacheToFile = cacheToFile;
}
-
+
/**
* Get the correct implementation (based on cacheToFile) of
* StreamCache.
@@ -89,7 +89,7 @@ public class StreamCacheFactory {
return new InMemoryStreamCache();
}
}
-
+
/**
* Get the correct implementation (based on cacheToFile) of
* StreamCache.
@@ -104,7 +104,7 @@ public class StreamCacheFactory {
return new InMemoryStreamCache(hintSize);
}
}
-
+
/**
* Get the value of the global cacheToFile flag.
* @return the current cache to file flag
@@ -112,6 +112,6 @@ public class StreamCacheFactory {
public boolean getCacheToFile() {
return this.cacheToFile;
}
-
+
}
diff --git a/src/java/org/apache/fop/pdf/TempFileStreamCache.java b/src/java/org/apache/fop/pdf/TempFileStreamCache.java
index e29595989..9920a334d 100644
--- a/src/java/org/apache/fop/pdf/TempFileStreamCache.java
+++ b/src/java/org/apache/fop/pdf/TempFileStreamCache.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
// Java
@@ -75,7 +75,7 @@ public class TempFileStreamCache implements StreamCache {
public void write(byte[] data) throws IOException {
getOutputStream().write(data);
}
-
+
/**
* Outputs the cached bytes to the given stream.
*
diff --git a/src/java/org/apache/fop/pdf/TransitionDictionary.java b/src/java/org/apache/fop/pdf/TransitionDictionary.java
index 5c779d8fe..6711c9508 100644
--- a/src/java/org/apache/fop/pdf/TransitionDictionary.java
+++ b/src/java/org/apache/fop/pdf/TransitionDictionary.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.pdf;
/**
diff --git a/src/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java b/src/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java
index b122db56f..0d891efe9 100644
--- a/src/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java
+++ b/src/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,7 +30,7 @@ import org.apache.fop.fo.FOEventHandler;
* about them.
*/
public abstract class AbstractFOEventHandlerMaker {
-
+
/**
* Instantiates a new FOEventHandler.
* @param ua the user agent
@@ -45,7 +45,7 @@ public abstract class AbstractFOEventHandlerMaker {
* @return Indicates whether this renderer requires an OutputStream to work with.
*/
public abstract boolean needsOutputStream();
-
+
/**
* @return an array of MIME types the renderer supports.
*/
@@ -65,5 +65,5 @@ public abstract class AbstractFOEventHandlerMaker {
}
return false;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
index a06bd0f97..8691e3cbe 100644
--- a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
+++ b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -54,7 +54,7 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC
protected static Log log = LogFactory.getLog(AbstractGenericSVGHandler.class);
/** {@inheritDoc} */
- public void handleXML(RendererContext context,
+ public void handleXML(RendererContext context,
Document doc, String ns) throws Exception {
if (SVGDOMImplementation.SVG_NAMESPACE_URI.equals(ns)) {
@@ -118,8 +118,8 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC
//Let the painter paint the SVG on the Graphics2D instance
Graphics2DAdapter adapter = context.getRenderer().getGraphics2DAdapter();
- adapter.paintImage(painter, context,
- x, y, wrappedContext.getWidth(), wrappedContext.getHeight());
+ adapter.paintImage(painter, context,
+ x, y, wrappedContext.getWidth(), wrappedContext.getHeight());
}
/**
@@ -136,7 +136,7 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC
}
return docURI;
}
-
+
/**
* Override this method to update the renderer context if it needs special settings for
* certain conditions.
diff --git a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java
index 19796eada..4f3bb98a5 100644
--- a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
import java.awt.Color;
@@ -52,7 +52,7 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter {
* @return the generated BufferedImage
*/
protected BufferedImage paintToBufferedImage(
- org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
+ org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
RendererContextWrapper context, int resolution, boolean gray, boolean withAlpha) {
int bmw = (int)Math.ceil(UnitConv.mpt2px(context.getWidth(), resolution));
int bmh = (int)Math.ceil(UnitConv.mpt2px(context.getHeight(), resolution));
@@ -72,10 +72,10 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter {
}
Graphics2D g2d = bi.createGraphics();
try {
- g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+ g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
setRenderingHintsForBufferedImage(g2d);
-
+
g2d.setBackground(Color.white);
g2d.setColor(Color.black);
if (!withAlpha) {
@@ -130,17 +130,17 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter {
* @param g2d the Graphics2D instance
*/
protected void setRenderingHintsForBufferedImage(Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
- g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+ g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
}
/** {@inheritDoc} */
- public void paintImage(Graphics2DImagePainter painter,
+ public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
paintImage((org.apache.xmlgraphics.java2d.Graphics2DImagePainter)painter,
context, x, y, width, height);
}
-
+
}
diff --git a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
index b02afdc0e..7bd470915 100644
--- a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
+++ b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
@@ -66,7 +66,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
protected void handleBlockTraits(Block block) {
int borderPaddingStart = block.getBorderAndPaddingWidthStart();
int borderPaddingBefore = block.getBorderAndPaddingWidthBefore();
-
+
float startx = currentIPPosition / 1000f;
float starty = currentBPPosition / 1000f;
float width = block.getIPD() / 1000f;
@@ -151,10 +151,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
BorderProps bpsEnd = (BorderProps)borderArea.getTrait(Trait.BORDER_END);
drawBackground(startx, starty, width, height,
- (Trait.Background) backgroundArea.getTrait(Trait.BACKGROUND),
+ (Trait.Background) backgroundArea.getTrait(Trait.BACKGROUND),
bpsBefore, bpsAfter, bpsStart, bpsEnd);
drawBorders(startx, starty, width, height,
- bpsBefore, bpsAfter, bpsStart, bpsEnd);
+ bpsBefore, bpsAfter, bpsStart, bpsEnd);
}
/**
@@ -204,13 +204,13 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
fillRect(sx, sy, paddRectWidth, paddRectHeight);
}
if (back.getImageInfo() != null) {
- ImageSize imageSize = back.getImageInfo().getSize();
+ ImageSize imageSize = back.getImageInfo().getSize();
saveGraphicsState();
clipRect(sx, sy, paddRectWidth, paddRectHeight);
- int horzCount = (int)((paddRectWidth
- * 1000 / imageSize.getWidthMpt()) + 1.0f);
- int vertCount = (int)((paddRectHeight
- * 1000 / imageSize.getHeightMpt()) + 1.0f);
+ int horzCount = (int)((paddRectWidth
+ * 1000 / imageSize.getWidthMpt()) + 1.0f);
+ int vertCount = (int)((paddRectHeight
+ * 1000 / imageSize.getHeightMpt()) + 1.0f);
if (back.getRepeat() == EN_NOREPEAT) {
horzCount = 1;
vertCount = 1;
@@ -233,7 +233,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
// place once
Rectangle2D pos;
// Image positions are relative to the currentIP/BP
- pos = new Rectangle2D.Float(sx - currentIPPosition
+ pos = new Rectangle2D.Float(sx - currentIPPosition
+ (x * imageSize.getWidthMpt()),
sy - currentBPPosition
+ (y * imageSize.getHeightMpt()),
@@ -242,7 +242,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
drawImage(back.getURL(), pos);
}
}
-
+
restoreGraphicsState();
}
}
@@ -282,7 +282,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
* @param bpsStart the border specification on the start side
* @param bpsEnd the border specification on the end side
*/
- protected void drawBorders(Rectangle2D.Float borderRect,
+ protected void drawBorders(Rectangle2D.Float borderRect,
BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd) {
//TODO generalize each of the four conditions into using a parameterized drawBorder()
boolean[] border = new boolean[] {
@@ -298,9 +298,9 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
(border[AFTER] ? bpsAfter.width / 1000f : 0.0f),
(border[START] ? bpsStart.width / 1000f : 0.0f)};
float[] clipw = new float[] {
- BorderProps.getClippedWidth(bpsBefore) / 1000f,
- BorderProps.getClippedWidth(bpsEnd) / 1000f,
- BorderProps.getClippedWidth(bpsAfter) / 1000f,
+ BorderProps.getClippedWidth(bpsBefore) / 1000f,
+ BorderProps.getClippedWidth(bpsEnd) / 1000f,
+ BorderProps.getClippedWidth(bpsAfter) / 1000f,
BorderProps.getClippedWidth(bpsStart) / 1000f};
starty += clipw[BEFORE];
height -= clipw[BEFORE];
@@ -308,7 +308,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
startx += clipw[START];
width -= clipw[START];
width -= clipw[END];
-
+
boolean[] slant = new boolean[] {
(border[START] && border[BEFORE]),
(border[BEFORE] && border[END]),
@@ -344,7 +344,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
lineTo(sx2, innery);
closePath();
clip();
- drawBorderLine(sx1a, outery, ex1a, innery, true, true,
+ drawBorderLine(sx1a, outery, ex1a, innery, true, true,
bpsBefore.style, bpsBefore.color);
restoreGraphicsState();
}
@@ -358,7 +358,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
float outerx = startx + width + clipw[END];
float clipx = outerx - clipw[END];
float innerx = outerx - borderWidth[END];
-
+
saveGraphicsState();
moveTo(clipx, sy1);
float sy1a = sy1;
@@ -448,8 +448,8 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
restoreGraphicsState();
}
}
-
- /**
+
+ /**
* Common method to render the background and borders for any inline area.
* The all borders and padding are drawn outside the specified area.
* @param area the inline area for which the background, border and padding is to be
@@ -458,11 +458,11 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
protected void renderInlineAreaBackAndBorders(InlineArea area) {
float borderPaddingStart = area.getBorderAndPaddingWidthStart() / 1000f;
float borderPaddingBefore = area.getBorderAndPaddingWidthBefore() / 1000f;
- float bpwidth = borderPaddingStart
+ float bpwidth = borderPaddingStart
+ (area.getBorderAndPaddingWidthEnd() / 1000f);
float bpheight = borderPaddingBefore
+ (area.getBorderAndPaddingWidthAfter() / 1000f);
-
+
float height = area.getBPD() / 1000f;
if (height != 0.0f || bpheight != 0.0f && bpwidth != 0.0f) {
float x = currentIPPosition / 1000f;
@@ -473,10 +473,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
, height + bpheight);
}
}
-
+
private static final QName FOX_TRANSFORM
= new QName(ExtensionElementMapping.URI, "fox:transform");
-
+
/** {@inheritDoc} */
protected void renderBlockViewport(BlockViewport bv, List children) {
// clip and position viewport if necessary
@@ -502,10 +502,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
if (bv.getPositioning() == Block.FIXED) {
breakOutList = breakOutOfStateStack();
}
-
+
AffineTransform positionTransform = new AffineTransform();
positionTransform.translate(bv.getXOffset(), bv.getYOffset());
-
+
//"left/"top" (bv.getX/YOffset()) specify the position of the content rectangle
positionTransform.translate(-borderPaddingStart, -borderPaddingBefore);
@@ -520,7 +520,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
saveGraphicsState();
//Viewport position
concatenateTransformationMatrix(mptToPt(positionTransform));
-
+
//Background and borders
float bpwidth = (borderPaddingStart + bv.getBorderAndPaddingWidthEnd()) / 1000f;
float bpheight = (borderPaddingBefore + bv.getBorderAndPaddingWidthAfter()) / 1000f;
@@ -530,7 +530,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
AffineTransform contentRectTransform = new AffineTransform();
contentRectTransform.translate(borderPaddingStart, borderPaddingBefore);
concatenateTransformationMatrix(mptToPt(contentRectTransform));
-
+
//Clipping
if (bv.getClip()) {
clipRect(0f, 0f, width, height);
@@ -540,18 +540,18 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
//Set up coordinate system for content rectangle
AffineTransform contentTransform = ctm.toAffineTransform();
concatenateTransformationMatrix(mptToPt(contentTransform));
-
+
currentIPPosition = 0;
currentBPPosition = 0;
renderBlocks(bv, children);
restoreGraphicsState();
restoreGraphicsState();
-
+
if (breakOutList != null) {
restoreStateStackAfterBreakOut(breakOutList);
}
-
+
currentIPPosition = saveIP;
currentBPPosition = saveBP;
} else {
@@ -566,16 +566,16 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
CTM tempctm = new CTM(containingIPPosition, currentBPPosition);
ctm = tempctm.multiply(ctm);
-
+
//Now adjust for border/padding
currentBPPosition += borderPaddingBefore;
Rectangle2D clippingRect = null;
if (bv.getClip()) {
- clippingRect = new Rectangle(currentIPPosition, currentBPPosition,
+ clippingRect = new Rectangle(currentIPPosition, currentBPPosition,
bv.getIPD(), bv.getBPD());
}
-
+
startVParea(ctm, clippingRect);
currentIPPosition = 0;
currentBPPosition = 0;
@@ -584,7 +584,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
currentIPPosition = saveIP;
currentBPPosition = saveBP;
-
+
currentBPPosition += (int)(bv.getAllocBPD());
}
}
@@ -600,7 +600,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
at.translate(currentIPPosition, currentBPPosition);
at.translate(block.getXOffset(), block.getYOffset());
at.translate(0, block.getSpaceBefore());
-
+
if (!at.isIdentity()) {
saveGraphicsState();
concatenateTransformationMatrix(mptToPt(at));
@@ -618,12 +618,12 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
if (!at.isIdentity()) {
restoreGraphicsState();
}
-
+
// stacked and relative blocks effect stacking
currentIPPosition = saveIP;
currentBPPosition = saveBP;
}
-
+
/** {@inheritDoc} */
protected void renderFlow(NormalFlow flow) {
// save position and offset
@@ -633,7 +633,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
//Establish a new coordinate system
AffineTransform at = new AffineTransform();
at.translate(currentIPPosition, currentBPPosition);
-
+
if (!at.isIdentity()) {
saveGraphicsState();
concatenateTransformationMatrix(mptToPt(at));
@@ -642,23 +642,23 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
currentIPPosition = 0;
currentBPPosition = 0;
super.renderFlow(flow);
-
+
if (!at.isIdentity()) {
restoreGraphicsState();
}
-
+
// stacked and relative blocks effect stacking
currentIPPosition = saveIP;
currentBPPosition = saveBP;
}
-
+
/**
* Concatenates the current transformation matrix with the given one, therefore establishing
* a new coordinate system.
* @param at the transformation matrix to process (coordinates in points)
*/
protected abstract void concatenateTransformationMatrix(AffineTransform at);
-
+
/**
* Render an inline viewport.
* This renders an inline viewport by clipping if necessary.
@@ -670,10 +670,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
float y = (currentBPPosition + viewport.getOffset()) / 1000f;
float width = viewport.getIPD() / 1000f;
float height = viewport.getBPD() / 1000f;
- // TODO: Calculate the border rect correctly.
+ // TODO: Calculate the border rect correctly.
float borderPaddingStart = viewport.getBorderAndPaddingWidthStart() / 1000f;
float borderPaddingBefore = viewport.getBorderAndPaddingWidthBefore() / 1000f;
- float bpwidth = borderPaddingStart
+ float bpwidth = borderPaddingStart
+ (viewport.getBorderAndPaddingWidthEnd() / 1000f);
float bpheight = borderPaddingBefore
+ (viewport.getBorderAndPaddingWidthAfter() / 1000f);
@@ -697,7 +697,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
* @param breakOutList the state stack to restore.
*/
protected abstract void restoreStateStackAfterBreakOut(List breakOutList);
-
+
/**
* Breaks out of the state stack to handle fixed block-containers.
* @return the saved state stack to recreate later
@@ -706,16 +706,16 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
/** Saves the graphics state of the rendering engine. */
protected abstract void saveGraphicsState();
-
+
/** Restores the last graphics state of the rendering engine. */
protected abstract void restoreGraphicsState();
/** Indicates the beginning of a text object. */
protected abstract void beginTextObject();
-
+
/** Indicates the end of a text object. */
protected abstract void endTextObject();
-
+
/**
* Paints the text decoration marks.
* @param fm Current typeface
@@ -724,10 +724,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
* @param baseline position of the baseline
* @param startx start IPD
*/
- protected void renderTextDecoration(FontMetrics fm, int fontsize, InlineArea inline,
+ protected void renderTextDecoration(FontMetrics fm, int fontsize, InlineArea inline,
int baseline, int startx) {
- boolean hasTextDeco = inline.hasUnderline()
- || inline.hasOverline()
+ boolean hasTextDeco = inline.hasUnderline()
+ || inline.hasOverline()
|| inline.hasLineThrough();
if (hasTextDeco) {
endTextObject();
@@ -738,22 +738,22 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
if (inline.hasUnderline()) {
Color ct = (Color) inline.getTrait(Trait.UNDERLINE_COLOR);
float y = baseline - descender / 2f;
- drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
- endx, (y + halfLineWidth) / 1000f,
+ drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
+ endx, (y + halfLineWidth) / 1000f,
true, true, Constants.EN_SOLID, ct);
}
if (inline.hasOverline()) {
Color ct = (Color) inline.getTrait(Trait.OVERLINE_COLOR);
float y = (float)(baseline - (1.1 * capHeight));
- drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
- endx, (y + halfLineWidth) / 1000f,
+ drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
+ endx, (y + halfLineWidth) / 1000f,
true, true, Constants.EN_SOLID, ct);
}
if (inline.hasLineThrough()) {
Color ct = (Color) inline.getTrait(Trait.LINETHROUGH_COLOR);
float y = (float)(baseline - (0.45 * capHeight));
- drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
- endx, (y + halfLineWidth) / 1000f,
+ drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
+ endx, (y + halfLineWidth) / 1000f,
true, true, Constants.EN_SOLID, ct);
}
}
@@ -761,7 +761,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
/** Clip using the current path. */
protected abstract void clip();
-
+
/**
* Clip using a rectangular area.
* @param x the x coordinate (in points)
@@ -770,28 +770,28 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
* @param height the height of the rectangle (in points)
*/
protected abstract void clipRect(float x, float y, float width, float height);
-
+
/**
- * Moves the current point to (x, y), omitting any connecting line segment.
+ * Moves the current point to (x, y), omitting any connecting line segment.
* @param x x coordinate
* @param y y coordinate
*/
protected abstract void moveTo(float x, float y);
-
+
/**
- * Appends a straight line segment from the current point to (x, y). The
- * new current point is (x, y).
+ * Appends a straight line segment from the current point to (x, y). The
+ * new current point is (x, y).
* @param x x coordinate
* @param y y coordinate
*/
protected abstract void lineTo(float x, float y);
-
+
/**
- * Closes the current subpath by appending a straight line segment from
+ * Closes the current subpath by appending a straight line segment from
* the current point to the starting point of the subpath.
*/
protected abstract void closePath();
-
+
/**
* Fill a rectangular area.
* @param x the x coordinate
@@ -807,7 +807,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
* @param fill true to set the fill color, false for the foreground color
*/
protected abstract void updateColor(Color col, boolean fill);
-
+
/**
* Draw an image at the indicated location.
* @param url the URI/URL of the image
@@ -815,7 +815,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
* @param foreignAttributes an optional Map with foreign attributes, may be null
*/
protected abstract void drawImage(String url, Rectangle2D pos, Map foreignAttributes);
-
+
/**
* Draw an image at the indicated location.
* @param url the URI/URL of the image
@@ -824,7 +824,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
protected final void drawImage(String url, Rectangle2D pos) {
drawImage(url, pos, null);
}
-
+
/**
* Draw a border segment of an XSL-FO style border.
* @param x1 starting x coordinate
@@ -832,12 +832,12 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
* @param x2 ending x coordinate
* @param y2 ending y coordinate
* @param horz true for horizontal border segments, false for vertical border segments
- * @param startOrBefore true for border segments on the start or before edge,
+ * @param startOrBefore true for border segments on the start or before edge,
* false for end or after.
* @param style the border style (one of Constants.EN_DASHED etc.)
* @param col the color for the border segment
*/
- protected abstract void drawBorderLine(float x1, float y1, float x2, float y2,
+ protected abstract void drawBorderLine(float x1, float y1, float x2, float y2,
boolean horz, boolean startOrBefore, int style, Color col);
/** {@inheritDoc} */
@@ -847,5 +847,5 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
String ns = fo.getNameSpace();
renderDocument(doc, ns, pos, fo.getForeignAttributes());
}
-
+
}
diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java
index ebff5323b..e80775890 100644
--- a/src/java/org/apache/fop/render/AbstractRenderer.java
+++ b/src/java/org/apache/fop/render/AbstractRenderer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -75,12 +75,12 @@ import org.apache.fop.fonts.FontInfo;
* top level processing of the area tree and adds some abstract methods to
* handle viewports. This keeps track of the current block and inline position.
*/
-public abstract class AbstractRenderer
+public abstract class AbstractRenderer
implements Renderer, Constants {
/** logging instance */
protected static Log log = LogFactory.getLog("org.apache.fop.render");
-
+
/**
* user agent
*/
@@ -110,9 +110,9 @@ public abstract class AbstractRenderer
/** the currently active PageViewport */
protected PageViewport currentPageViewport;
-
+
private Set warnedXMLHandlers;
-
+
/** {@inheritDoc} */
public abstract void setupFontInfo(FontInfo fontInfo);
@@ -153,7 +153,7 @@ public abstract class AbstractRenderer
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void processOffDocumentItem(OffDocumentItem odi) { }
@@ -161,17 +161,17 @@ public abstract class AbstractRenderer
public Graphics2DAdapter getGraphics2DAdapter() {
return null;
}
-
+
/** {@inheritDoc} */
public ImageAdapter getImageAdapter() {
return null;
}
-
+
/** @return the current PageViewport or null, if none is active */
protected PageViewport getCurrentPageViewport() {
return this.currentPageViewport;
}
-
+
/** {@inheritDoc} */
public void preparePage(PageViewport page) { }
@@ -212,7 +212,7 @@ public abstract class AbstractRenderer
public void startPageSequence(LineArea seqTitle) {
//do nothing
}
-
+
/** {@inheritDoc} */
public void startPageSequence(PageSequence pageSequence) {
startPageSequence(pageSequence.getTitle());
@@ -300,7 +300,7 @@ public abstract class AbstractRenderer
* Establishes a new viewport area.
*
* @param ctm the coordinate transformation matrix to use
- * @param clippingRect the clipping rectangle if the viewport should be clipping,
+ * @param clippingRect the clipping rectangle if the viewport should be clipping,
* null if no clipping is performed.
*/
protected abstract void startVParea(CTM ctm, Rectangle2D clippingRect);
@@ -462,7 +462,7 @@ public abstract class AbstractRenderer
if (bv.getClip()) {
clippingRect = new Rectangle(saveIP, saveBP, bv.getIPD(), bv.getBPD());
}
-
+
CTM ctm = bv.getCTM();
currentIPPosition = 0;
currentBPPosition = 0;
@@ -495,12 +495,12 @@ public abstract class AbstractRenderer
* @param block the block area
*/
protected abstract void renderReferenceArea(Block block);
-
+
/**
* Renders a list of block areas.
*
* @param parent the parent block if the parent is a block, otherwise
- * a null value.
+ * a null value.
* @param blocks The block areas
*/
protected void renderBlocks(Block parent, List blocks) {
@@ -517,7 +517,7 @@ public abstract class AbstractRenderer
currentIPPosition += spaceStart.intValue();
}*/
}
-
+
// the position of the containing block is used for
// absolutely positioned areas
int contBP = currentBPPosition;
@@ -538,8 +538,8 @@ public abstract class AbstractRenderer
// a line area is rendered from the top left position
// of the line, each inline object is offset from there
LineArea line = (LineArea) obj;
- currentIPPosition = contIP
- + parent.getStartIndent()
+ currentIPPosition = contIP
+ + parent.getStartIndent()
+ line.getStartIndent();
renderLineArea(line);
//InlineArea child = (InlineArea) line.getInlineAreas().get(0);
@@ -637,14 +637,14 @@ public abstract class AbstractRenderer
}
}
- /**
+ /**
* Common method to render the background and borders for any inline area.
* The all borders and padding are drawn outside the specified area.
* @param area the inline area for which the background, border and padding is to be
* rendered
*/
protected abstract void renderInlineAreaBackAndBorders(InlineArea area);
-
+
/**
* Render the given Space.
* @param space the space to render
@@ -676,7 +676,7 @@ public abstract class AbstractRenderer
int saveBP = currentBPPosition;
Iterator iter = text.getChildAreas().iterator();
while (iter.hasNext()) {
- renderInlineArea((InlineArea) iter.next());
+ renderInlineArea((InlineArea) iter.next());
}
currentIPPosition = saveIP + text.getAllocIPD();
}
@@ -709,7 +709,7 @@ public abstract class AbstractRenderer
currentBPPosition += ip.getOffset();
Iterator iter = ip.getChildAreas().iterator();
while (iter.hasNext()) {
- renderInlineArea((InlineArea) iter.next());
+ renderInlineArea((InlineArea) iter.next());
}
currentIPPosition = saveIP + ip.getAllocIPD();
currentBPPosition = saveBP;
@@ -809,7 +809,7 @@ public abstract class AbstractRenderer
handler.handleXML(ctx, doc, namespace);
} catch (Exception e) {
// could not handle document
- ResourceEventProducer eventProducer
+ ResourceEventProducer eventProducer
= ResourceEventProducer.Provider.get(
ctx.getUserAgent().getEventBroadcaster());
eventProducer.foreignXMLProcessingError(this, doc, namespace, e);
@@ -830,7 +830,7 @@ public abstract class AbstractRenderer
/**
* Get the MIME type of the renderer.
- *
+ *
* @return The MIME type of the renderer
*/
public String getMimeType() {
diff --git a/src/java/org/apache/fop/render/AbstractRendererConfigurator.java b/src/java/org/apache/fop/render/AbstractRendererConfigurator.java
index 982b23f05..33d5a3bcf 100644
--- a/src/java/org/apache/fop/render/AbstractRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/AbstractRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/AbstractRendererMaker.java b/src/java/org/apache/fop/render/AbstractRendererMaker.java
index 381d2e134..fadfda94d 100644
--- a/src/java/org/apache/fop/render/AbstractRendererMaker.java
+++ b/src/java/org/apache/fop/render/AbstractRendererMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@ import org.apache.fop.apps.FOUserAgent;
* about them.
*/
public abstract class AbstractRendererMaker {
-
+
/**
* Instantiates a new renderer.
* @param userAgent the user agent
@@ -38,7 +38,7 @@ public abstract class AbstractRendererMaker {
* @return Indicates whether this renderer requires an OutputStream to work with.
*/
public abstract boolean needsOutputStream();
-
+
/**
* @return an array of MIME types the renderer supports.
*/
diff --git a/src/java/org/apache/fop/render/DefaultFontResolver.java b/src/java/org/apache/fop/render/DefaultFontResolver.java
index d25328b9f..6fb7e0f01 100644
--- a/src/java/org/apache/fop/render/DefaultFontResolver.java
+++ b/src/java/org/apache/fop/render/DefaultFontResolver.java
@@ -30,7 +30,7 @@ import org.apache.fop.fonts.FontResolver;
public class DefaultFontResolver implements FontResolver {
private FOUserAgent userAgent;
-
+
/**
* Main constructor.
* @param userAgent the user agent
@@ -38,10 +38,10 @@ public class DefaultFontResolver implements FontResolver {
public DefaultFontResolver(FOUserAgent userAgent) {
this.userAgent = userAgent;
}
-
+
/** {@inheritDoc} */
public Source resolve(String href) {
return userAgent.resolveURI(href, userAgent.getFontBaseURL());
}
-
+
}
diff --git a/src/java/org/apache/fop/render/Graphics2DAdapter.java b/src/java/org/apache/fop/render/Graphics2DAdapter.java
index 4fbdbe09a..6c389d0ec 100644
--- a/src/java/org/apache/fop/render/Graphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/Graphics2DAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
import java.io.IOException;
@@ -43,10 +43,10 @@ public interface Graphics2DAdapter {
* @param height height of the image
* @throws IOException In case of an I/O error while writing the output format
*/
- void paintImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
+ void paintImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException;
-
+
/**
* Paints an arbitrary images on a given Graphics2D instance. The renderer
* providing this functionality must set up a Graphics2D instance so that
@@ -62,8 +62,8 @@ public interface Graphics2DAdapter {
* @throws IOException In case of an I/O error while writing the output format
* @deprecated Use the variant with the Graphics2DImagePainter from XML Graphics Commons instead
*/
- void paintImage(Graphics2DImagePainter painter,
+ void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException;
-
+
}
diff --git a/src/java/org/apache/fop/render/Graphics2DImagePainter.java b/src/java/org/apache/fop/render/Graphics2DImagePainter.java
index 0167417fe..da802418c 100644
--- a/src/java/org/apache/fop/render/Graphics2DImagePainter.java
+++ b/src/java/org/apache/fop/render/Graphics2DImagePainter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
/**
diff --git a/src/java/org/apache/fop/render/ImageAdapter.java b/src/java/org/apache/fop/render/ImageAdapter.java
index 1984cfa96..a67d43bdc 100644
--- a/src/java/org/apache/fop/render/ImageAdapter.java
+++ b/src/java/org/apache/fop/render/ImageAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
import java.awt.image.RenderedImage;
@@ -40,8 +40,8 @@ public interface ImageAdapter {
* @param height height of the image
* @throws IOException In case of an I/O error while writing the output format
*/
- void paintImage(RenderedImage image,
+ void paintImage(RenderedImage image,
RendererContext context,
int x, int y, int width, int height) throws IOException;
-
+
}
diff --git a/src/java/org/apache/fop/render/PrintRendererConfigurator.java b/src/java/org/apache/fop/render/PrintRendererConfigurator.java
index 6849f867f..4409c62b8 100644
--- a/src/java/org/apache/fop/render/PrintRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/PrintRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -71,7 +71,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
/**
* Builds a list of EmbedFontInfo objects for use with the setup() method.
- *
+ *
* @param renderer print renderer
* @throws FOPException if something's wrong with the config data
*/
@@ -105,7 +105,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
/**
* Builds a list of EmbedFontInfo objects for use with the setup() method.
- *
+ *
* @param cfg Configuration object
* @param fontResolver the FontResolver to use
* @param strict true if an Exception should be thrown if an error is found.
@@ -285,7 +285,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
/**
* Creates a new FontTriplet given a triple Configuration
- *
+ *
* @param tripletCfg a triplet configuration
* @param strict use strict validation
* @return a font triplet font key
@@ -323,7 +323,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
/**
* Returns a font info from a font node Configuration definition
- *
+ *
* @param fontCfg Configuration object (font node)
* @param fontResolver font resolver used to resolve font
* @param strict validate configuration strictly
diff --git a/src/java/org/apache/fop/render/Renderer.java b/src/java/org/apache/fop/render/Renderer.java
index 03b4582f7..0ff37db0e 100644
--- a/src/java/org/apache/fop/render/Renderer.java
+++ b/src/java/org/apache/fop/render/Renderer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -54,7 +54,7 @@ public interface Renderer {
/**
* Get the MIME type of the renderer.
- *
+ *
* @return The MIME type of the renderer, may return null if not applicable.
*/
String getMimeType();
@@ -93,7 +93,7 @@ public interface Renderer {
* @return the user agent
*/
FOUserAgent getUserAgent();
-
+
/**
* Set up the given FontInfo.
*
@@ -115,7 +115,7 @@ public interface Renderer {
boolean supportsOutOfOrder();
/**
- * Tells the renderer to process an item not explicitly placed on the
+ * Tells the renderer to process an item not explicitly placed on the
* document (e.g., PDF bookmarks). Note - not all renderers will process
* all off-document items.
*
@@ -127,12 +127,12 @@ public interface Renderer {
* @return the adapter for painting Java2D images (or null if not supported)
*/
Graphics2DAdapter getGraphics2DAdapter();
-
+
/**
* @return the adapter for painting RenderedImages (or null if not supported)
*/
ImageAdapter getImageAdapter();
-
+
/**
* This is called if the renderer supports out of order rendering. The
* renderer should prepare the page so that a page further on in the set of
diff --git a/src/java/org/apache/fop/render/RendererConfigurator.java b/src/java/org/apache/fop/render/RendererConfigurator.java
index 028a4863b..6dceeb74d 100644
--- a/src/java/org/apache/fop/render/RendererConfigurator.java
+++ b/src/java/org/apache/fop/render/RendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/RendererContext.java b/src/java/org/apache/fop/render/RendererContext.java
index feffc05ed..08ca76957 100644
--- a/src/java/org/apache/fop/render/RendererContext.java
+++ b/src/java/org/apache/fop/render/RendererContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
//Java
@@ -54,7 +54,7 @@ public class RendererContext {
public AbstractRenderer getRenderer() {
return renderer;
}
-
+
/**
* Returns the MIME type associated with this RendererContext.
*
@@ -121,7 +121,7 @@ public class RendererContext {
/** The wrapped RendererContext */
protected RendererContext context;
-
+
/**
* Main constructor
* @param context the RendererContent instance
@@ -129,7 +129,7 @@ public class RendererContext {
public RendererContextWrapper(RendererContext context) {
this.context = context;
}
-
+
/** @return the user agent */
public FOUserAgent getUserAgent() {
return context.getUserAgent();
@@ -158,7 +158,7 @@ public class RendererContext {
/** @return the foreign attributes */
public Map getForeignAttributes() {
return (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES);
- }
- }
+ }
+ }
}
diff --git a/src/java/org/apache/fop/render/RendererContextConstants.java b/src/java/org/apache/fop/render/RendererContextConstants.java
index ff7f1f6af..05d802e54 100644
--- a/src/java/org/apache/fop/render/RendererContextConstants.java
+++ b/src/java/org/apache/fop/render/RendererContextConstants.java
@@ -26,10 +26,10 @@ public interface RendererContextConstants {
/** The output stream that the document is being sent to. */
String OUTPUT_STREAM = "outputStream";
-
+
/** The current PageViewport being rendered. */
String PAGE_VIEWPORT = "pageViewport";
-
+
/** The target width of the image being painted. */
String WIDTH = "width";
@@ -44,11 +44,11 @@ public interface RendererContextConstants {
/** The configuration for the XMLHandler. */
String HANDLER_CONFIGURATION = "cfg";
-
+
/**
- * An optional Map (keys: QName, values: String) with attributes containing additional hints
+ * An optional Map (keys: QName, values: String) with attributes containing additional hints
* for rendering.
*/
String FOREIGN_ATTRIBUTES = "foreign-attributes";
-
+
}
diff --git a/src/java/org/apache/fop/render/RendererEventProducer.java b/src/java/org/apache/fop/render/RendererEventProducer.java
index 365c8f430..c61e4a8ee 100644
--- a/src/java/org/apache/fop/render/RendererEventProducer.java
+++ b/src/java/org/apache/fop/render/RendererEventProducer.java
@@ -31,7 +31,7 @@ public interface RendererEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
diff --git a/src/java/org/apache/fop/render/RendererFactory.java b/src/java/org/apache/fop/render/RendererFactory.java
index d81f900e0..a77ee6a03 100644
--- a/src/java/org/apache/fop/render/RendererFactory.java
+++ b/src/java/org/apache/fop/render/RendererFactory.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
import java.io.OutputStream;
@@ -39,14 +39,14 @@ import org.apache.fop.fo.FOEventHandler;
* Factory for FOEventHandlers and Renderers.
*/
public class RendererFactory {
-
+
/** the logger */
private static Log log = LogFactory.getLog(RendererFactory.class);
private Map rendererMakerMapping = new java.util.HashMap();
private Map eventHandlerMakerMapping = new java.util.HashMap();
-
-
+
+
/**
* Main constructor.
*/
@@ -54,7 +54,7 @@ public class RendererFactory {
discoverRenderers();
discoverFOEventHandlers();
}
-
+
/**
* Add a new RendererMaker. If another maker has already been registered for a
* particular MIME type, this call overwrites the existing one.
@@ -65,13 +65,13 @@ public class RendererFactory {
for (int i = 0; i < mimes.length; i++) {
//This overrides any renderer previously set for a MIME type
if (rendererMakerMapping.get(mimes[i]) != null) {
- log.trace("Overriding renderer for " + mimes[i]
+ log.trace("Overriding renderer for " + mimes[i]
+ " with " + maker.getClass().getName());
}
rendererMakerMapping.put(mimes[i], maker);
}
}
-
+
/**
* Add a new FOEventHandlerMaker. If another maker has already been registered for a
* particular MIME type, this call overwrites the existing one.
@@ -82,13 +82,13 @@ public class RendererFactory {
for (int i = 0; i < mimes.length; i++) {
//This overrides any event handler previously set for a MIME type
if (eventHandlerMakerMapping.get(mimes[i]) != null) {
- log.trace("Overriding FOEventHandler for " + mimes[i]
+ log.trace("Overriding FOEventHandler for " + mimes[i]
+ " with " + maker.getClass().getName());
}
eventHandlerMakerMapping.put(mimes[i], maker);
}
}
-
+
/**
* Add a new RendererMaker. If another maker has already been registered for a
* particular MIME type, this call overwrites the existing one.
@@ -114,7 +114,7 @@ public class RendererFactory {
+ AbstractRendererMaker.class.getName());
}
}
-
+
/**
* Add a new FOEventHandlerMaker. If another maker has already been registered for a
* particular MIME type, this call overwrites the existing one.
@@ -140,7 +140,7 @@ public class RendererFactory {
+ AbstractFOEventHandlerMaker.class.getName());
}
}
-
+
/**
* Returns a RendererMaker which handles the given MIME type.
* @param mime the requested output format
@@ -151,7 +151,7 @@ public class RendererFactory {
= (AbstractRendererMaker)rendererMakerMapping.get(mime);
return maker;
}
-
+
/**
* Returns a FOEventHandlerMaker which handles the given MIME type.
* @param mime the requested output format
@@ -162,7 +162,7 @@ public class RendererFactory {
= (AbstractFOEventHandlerMaker)eventHandlerMakerMapping.get(mime);
return maker;
}
-
+
/**
* Creates a Renderer object based on render-type desired
* @param userAgent the user agent for access to configuration
@@ -170,7 +170,7 @@ public class RendererFactory {
* @return the new Renderer instance
* @throws FOPException if the renderer cannot be properly constructed
*/
- public Renderer createRenderer(FOUserAgent userAgent, String outputFormat)
+ public Renderer createRenderer(FOUserAgent userAgent, String outputFormat)
throws FOPException {
if (userAgent.getRendererOverride() != null) {
return userAgent.getRendererOverride();
@@ -189,8 +189,8 @@ public class RendererFactory {
return rend;
}
}
-
-
+
+
/**
* Creates FOEventHandler instances based on the desired output.
* @param userAgent the user agent for access to configuration
@@ -199,7 +199,7 @@ public class RendererFactory {
* @return the newly constructed FOEventHandler
* @throws FOPException if the FOEventHandler cannot be properly constructed
*/
- public FOEventHandler createFOEventHandler(FOUserAgent userAgent,
+ public FOEventHandler createFOEventHandler(FOUserAgent userAgent,
String outputFormat, OutputStream out) throws FOPException {
if (userAgent.getFOEventHandlerOverride() != null) {
@@ -214,8 +214,8 @@ public class RendererFactory {
+ " Neither an FOEventHandler, nor a Renderer could be found"
+ " for this output format.");
} else {
- if (out == null
- && userAgent.getRendererOverride() == null
+ if (out == null
+ && userAgent.getRendererOverride() == null
&& rendMaker.needsOutputStream()) {
throw new FOPException(
"OutputStream has not been set");
@@ -228,7 +228,7 @@ public class RendererFactory {
}
}
}
-
+
/**
* @return an array of all supported MIME types
*/
@@ -245,7 +245,7 @@ public class RendererFactory {
Collections.sort(lst);
return (String[])lst.toArray(new String[lst.size()]);
}
-
+
/**
* Discovers Renderer implementations through the classpath and dynamically
* registers them.
@@ -259,7 +259,7 @@ public class RendererFactory {
AbstractRendererMaker maker = (AbstractRendererMaker)providers.next();
try {
if (log.isDebugEnabled()) {
- log.debug("Dynamically adding maker for Renderer: "
+ log.debug("Dynamically adding maker for Renderer: "
+ maker.getClass().getName());
}
addRendererMaker(maker);
@@ -270,7 +270,7 @@ public class RendererFactory {
}
}
}
-
+
/**
* Discovers FOEventHandler implementations through the classpath and dynamically
* registers them.
@@ -284,7 +284,7 @@ public class RendererFactory {
AbstractFOEventHandlerMaker maker = (AbstractFOEventHandlerMaker)providers.next();
try {
if (log.isDebugEnabled()) {
- log.debug("Dynamically adding maker for FOEventHandler: "
+ log.debug("Dynamically adding maker for FOEventHandler: "
+ maker.getClass().getName());
}
addFOEventHandlerMaker(maker);
@@ -295,5 +295,5 @@ public class RendererFactory {
}
}
}
-
+
}
diff --git a/src/java/org/apache/fop/render/XMLHandler.java b/src/java/org/apache/fop/render/XMLHandler.java
index 7966b3b06..f8152fcbf 100644
--- a/src/java/org/apache/fop/render/XMLHandler.java
+++ b/src/java/org/apache/fop/render/XMLHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render;
import org.w3c.dom.Document;
@@ -46,9 +46,9 @@ public interface XMLHandler {
* @param ns The Namespace of the foreign object
* @exception Exception If an error occurs during processing.
*/
- void handleXML(RendererContext context,
+ void handleXML(RendererContext context,
Document doc, String ns) throws Exception;
-
+
/**
* Checks if this XMLHandler supports handling an XML namespace for a particular renderer.
* @param renderer the renderer for which to check.
@@ -57,7 +57,7 @@ public interface XMLHandler {
boolean supportsRenderer(Renderer renderer);
/**
- * @return the XML namespace for the XML dialect this XMLHandler supports,
+ * @return the XML namespace for the XML dialect this XMLHandler supports,
* null if all XML content is handled by this instance.
*/
String getNamespace();
diff --git a/src/java/org/apache/fop/render/XMLHandlerConfigurator.java b/src/java/org/apache/fop/render/XMLHandlerConfigurator.java
index 78822e9c0..fb2420572 100644
--- a/src/java/org/apache/fop/render/XMLHandlerConfigurator.java
+++ b/src/java/org/apache/fop/render/XMLHandlerConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,13 +27,13 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
/**
- * Configurator for XMLHandler objects.
+ * Configurator for XMLHandler objects.
*/
public class XMLHandlerConfigurator extends AbstractRendererConfigurator {
/** logger instance */
protected static Log log = LogFactory.getLog(XMLHandlerConfigurator.class);
-
+
/**
* Default constructor
* @param userAgent the user agent
diff --git a/src/java/org/apache/fop/render/XMLHandlerRegistry.java b/src/java/org/apache/fop/render/XMLHandlerRegistry.java
index 533534c4c..81d9fcc93 100644
--- a/src/java/org/apache/fop/render/XMLHandlerRegistry.java
+++ b/src/java/org/apache/fop/render/XMLHandlerRegistry.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,17 +37,17 @@ public class XMLHandlerRegistry {
/** the logger */
private static Log log = LogFactory.getLog(XMLHandlerRegistry.class);
-
+
/** Map containing XML handlers for various document types */
private Map handlers = new java.util.HashMap();
-
+
/**
* Default constructor.
*/
public XMLHandlerRegistry() {
discoverXMLHandlers();
}
-
+
/**
* Add a default XML handler which is able to handle any namespace.
* @param handler XMLHandler to use
@@ -55,7 +55,7 @@ public class XMLHandlerRegistry {
private void setDefaultXMLHandler(XMLHandler handler) {
addXMLHandler(XMLHandler.HANDLE_ALL, handler);
}
-
+
/**
* Add an XML handler. The handler itself is inspected to find out what it supports.
* @param classname the fully qualified class name
@@ -75,11 +75,11 @@ public class XMLHandlerRegistry {
+ classname);
} catch (ClassCastException e) {
throw new IllegalArgumentException(classname
- + " is not an "
+ + " is not an "
+ XMLHandler.class.getName());
}
}
-
+
/**
* Add an XML handler. The handler itself is inspected to find out what it supports.
* @param handler the XMLHandler instance
@@ -92,7 +92,7 @@ public class XMLHandlerRegistry {
addXMLHandler(ns, handler);
}
}
-
+
/**
* Add an XML handler for the given MIME type and XML namespace.
* @param ns Namespace URI
@@ -107,7 +107,7 @@ public class XMLHandlerRegistry {
}
lst.add(handler);
}
-
+
/**
* Returns an XMLHandler which handles an XML dialect of the given namespace and for
* a specified output format defined by its MIME type.
@@ -140,7 +140,7 @@ public class XMLHandlerRegistry {
}
return null; //No handler found
}
-
+
/**
* Discovers XMLHandler implementations through the classpath and dynamically
* registers them.
diff --git a/src/java/org/apache/fop/render/afp/AFPEventProducer.java b/src/java/org/apache/fop/render/afp/AFPEventProducer.java
index 615c54c32..08641b20e 100644
--- a/src/java/org/apache/fop/render/afp/AFPEventProducer.java
+++ b/src/java/org/apache/fop/render/afp/AFPEventProducer.java
@@ -31,7 +31,7 @@ public interface AFPEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,14 +50,14 @@ public interface AFPEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* Warn about using default font setup.
* @param source the event source
* @event.severity WARN
*/
void warnDefaultFontSetup(Object source);
-
+
}
diff --git a/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java b/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java
index 320e0e6be..dcd5c7dd5 100644
--- a/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.afp;
import java.awt.Dimension;
@@ -46,12 +46,12 @@ public class AFPGraphics2DAdapter extends AbstractGraphics2DAdapter {
*/
public AFPGraphics2DAdapter() {
}
-
+
/** {@inheritDoc} */
- public void paintImage(Graphics2DImagePainter painter,
+ public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
-
+
AFPInfo afpInfo = AFPSVGHandler.getAFPInfo(context);
final boolean textAsShapes = false;
diff --git a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
index 1723802f9..b843ccefb 100644
--- a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,10 +40,10 @@ import org.apache.fop.render.afp.modca.AFPDataStream;
import org.apache.fop.util.LogUtil;
/**
- * AFP Renderer configurator
+ * AFP Renderer configurator
*/
public class AFPRendererConfigurator extends PrintRendererConfigurator {
-
+
/**
* Default constructor
*
@@ -181,7 +181,7 @@ public class AFPRendererConfigurator extends PrintRendererConfigurator {
}
return null;
}
-
+
/**
* Builds a list of AFPFontInfo objects for use with the setup() method.
*
@@ -238,7 +238,7 @@ public class AFPRendererConfigurator extends PrintRendererConfigurator {
} else {
afpRenderer.setColorImages(true);
}
-
+
// renderer resolution
Configuration rendererResolutionCfg = cfg.getChild("renderer-resolution", false);
if (rendererResolutionCfg != null) {
diff --git a/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java b/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
index 360132863..d12c5f2c3 100644
--- a/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
@@ -27,7 +27,7 @@ import org.apache.fop.render.RendererContextConstants;
public interface AFPRendererContextConstants extends RendererContextConstants {
/**
- * Key for a Boolean value that enables grayscale processing instead of color
+ * Key for a Boolean value that enables grayscale processing instead of color
* processing.
*/
String AFP_GRAYSCALE = "afpGrayscale";
diff --git a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
index 5142c17d3..45588952a 100644
--- a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
+++ b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -216,7 +216,7 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler {
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof AFPRenderer);
}
-
+
/** {@inheritDoc} */
protected void updateRendererContext(RendererContext context) {
//Work around a problem in Batik: Gradients cannot be done in ColorSpace.CS_GRAY
diff --git a/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java b/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java
index 2a5eb6d5f..070e631dc 100644
--- a/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java
+++ b/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java
@@ -30,10 +30,10 @@ import java.io.PrintWriter;
*
*/
public abstract class NestedRuntimeException extends RuntimeException {
-
+
/** Root cause of this nested exception */
private Throwable underlyingException;
-
+
/**
* Construct a NestedRuntimeException
with the specified detail message.
* @param msg The detail message.
@@ -41,7 +41,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
public NestedRuntimeException(String msg) {
super(msg);
}
-
+
/**
* Construct a NestedRuntimeException
with the specified
* detail message and nested exception.
@@ -51,26 +51,26 @@ public abstract class NestedRuntimeException extends RuntimeException {
public NestedRuntimeException(String msg, Throwable t) {
super(msg);
underlyingException = t;
-
+
}
-
+
/**
* Gets the original triggering exception
* @return The original exception as a throwable.
*/
public Throwable getUnderlyingException() {
-
+
return underlyingException;
-
+
}
-
+
/**
* Return the detail message, including the message from the nested
* exception if there is one.
* @return The detail message.
*/
public String getMessage() {
-
+
if (underlyingException == null) {
return super.getMessage();
} else {
@@ -78,9 +78,9 @@ public abstract class NestedRuntimeException extends RuntimeException {
+ "; nested exception is "
+ underlyingException.getClass().getName();
}
-
+
}
-
+
/**
* Print the composite message and the embedded stack trace to the specified stream.
* @param ps the print stream
@@ -93,7 +93,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
underlyingException.printStackTrace(ps);
}
}
-
+
/**
* Print the composite message and the embedded stack trace to the specified writer.
* @param pw the print writer
@@ -106,5 +106,5 @@ public abstract class NestedRuntimeException extends RuntimeException {
underlyingException.printStackTrace(pw);
}
}
-
+
}
diff --git a/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java b/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java
index 3cec455a0..fe9ec87c0 100644
--- a/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java
+++ b/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java
@@ -24,7 +24,7 @@ package org.apache.fop.render.afp.exceptions;
*
Use PreviewPanel when you want to embed a preview in your own application * with your own controls. Use PreviewDialog when you want to use the standard * Fop controls. - *
+ * *In order to embed a PreviewPanel in your own app, create your own renderer, * and your own agent. In order to support reloads, you may also implement your * own Renderable extension or the default InputHandler. Setting the Renderable @@ -109,7 +109,7 @@ public class PreviewPanel extends JPanel { /** The FOUserAgent associated with this panel - often shared with PreviewDialog */ protected FOUserAgent foUserAgent; /** - * Renderable instance that can be used to reload and re-render a document after + * Renderable instance that can be used to reload and re-render a document after * modifications. */ protected Renderable renderable; @@ -142,7 +142,7 @@ public class PreviewPanel extends JPanel { */ private ViewportScroller scroller; - + /** * Creates a new PreviewPanel instance. * @param foUserAgent the user agent @@ -170,7 +170,7 @@ public class PreviewPanel extends JPanel { previewArea.setMinimumSize(new Dimension(50, 50)); add(previewArea); } - + /** * @return the currently visible page */ @@ -242,12 +242,12 @@ public class PreviewPanel extends JPanel { private int startPosX = 0; /** Starting position of a mouse drag - Y co-ordinate */ private int startPosY = 0; - + ViewportScroller(JViewport vp) { viewport = vp; } - // ***** MouseMotionListener ***** + // ***** MouseMotionListener ***** public synchronized void mouseDragged(MouseEvent e) { if (viewport == null) { @@ -261,7 +261,7 @@ public class PreviewPanel extends JPanel { int viewHeight = viewport.getExtentSize().height; int imageWidth = viewport.getViewSize().width; int imageHeight = viewport.getViewSize().height; - + Point viewPoint = viewport.getViewPosition(); int viewX = Math.max(0, Math.min(imageWidth - viewWidth, viewPoint.x - xmove)); int viewY = Math.max(0, Math.min(imageHeight - viewHeight, viewPoint.y - ymove)); diff --git a/src/java/org/apache/fop/render/awt/viewer/Renderable.java b/src/java/org/apache/fop/render/awt/viewer/Renderable.java index 5324ff8d7..c40272220 100644 --- a/src/java/org/apache/fop/render/awt/viewer/Renderable.java +++ b/src/java/org/apache/fop/render/awt/viewer/Renderable.java @@ -35,5 +35,5 @@ public interface Renderable { */ void renderTo(FOUserAgent userAgent, String outputFormat) throws FOPException; - + } diff --git a/src/java/org/apache/fop/render/awt/viewer/StatusListener.java b/src/java/org/apache/fop/render/awt/viewer/StatusListener.java index 6a7cf7d9b..d145d7718 100644 --- a/src/java/org/apache/fop/render/awt/viewer/StatusListener.java +++ b/src/java/org/apache/fop/render/awt/viewer/StatusListener.java @@ -26,9 +26,9 @@ public interface StatusListener { /** Called when a page has been renderered. */ void notifyPageRendered(); - + /** Called when the renderer has stopped. */ void notifyRendererStopped(); - + } diff --git a/src/java/org/apache/fop/render/awt/viewer/Translator.java b/src/java/org/apache/fop/render/awt/viewer/Translator.java index 6ae76be5b..df07a987f 100644 --- a/src/java/org/apache/fop/render/awt/viewer/Translator.java +++ b/src/java/org/apache/fop/render/awt/viewer/Translator.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render.awt.viewer; //Java @@ -29,7 +29,7 @@ import java.util.Locale; * Stanislav.Gorkhover@jCatalog.com */ public class Translator { - + private ResourceBundle bundle; private static String bundleBaseName = "org/apache/fop/render/awt/viewer/resources/Viewer"; diff --git a/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java b/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java index 7b26d0771..6688e40ea 100644 --- a/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java +++ b/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java @@ -33,7 +33,7 @@ public interface BitmapRendererEventProducer extends EventProducer { /** Provider class for the event producer. */ class Provider { - + /** * Returns an event producer. * @param broadcaster the event broadcaster to use @@ -52,23 +52,23 @@ public interface BitmapRendererEventProducer extends EventProducer { public EventModel createEventModel() { return loadModel(getClass(), "event-model.xml"); } - + } - + /** * No filename information available. Stopping early after the first page. * @param source the event source * @event.severity WARN */ void stoppingAfterFirstPageNoFilename(Object source); - + /** * Image writer does not support multiple images. Only the first page has been produced. * @param source the event source * @event.severity WARN */ void stoppingAfterFirstPageNoMultiWriter(Object source); - + /** * No ImageWriter found. * @param source the event source diff --git a/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java b/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java index 7c1c4ee31..1e3770542 100644 --- a/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java +++ b/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java @@ -7,7 +7,7 @@ import java.io.IOException; import java.io.OutputStream; /** - * This utility class helps renderers who generate one file per page, + * This utility class helps renderers who generate one file per page, * like the PNG renderer. */ public class MultiFileRenderingUtil { @@ -16,10 +16,10 @@ public class MultiFileRenderingUtil { private String filePrefix; private String fileExtension; - + /** The output directory where images are to be written */ private File outputDir; - + /** * Creates a new instance. *
@@ -60,7 +60,7 @@ public class MultiFileRenderingUtil {
filePrefix = s.substring(0, i);
}
}
-
+
public OutputStream createOutputStream(int pageNumber) throws IOException {
if (filePrefix == null) {
return null;
@@ -71,5 +71,5 @@ public class MultiFileRenderingUtil {
return os;
}
}
-
+
}
diff --git a/src/java/org/apache/fop/render/bitmap/PNGRenderer.java b/src/java/org/apache/fop/render/bitmap/PNGRenderer.java
index 8613ef7b8..3733bf2f2 100644
--- a/src/java/org/apache/fop/render/bitmap/PNGRenderer.java
+++ b/src/java/org/apache/fop/render/bitmap/PNGRenderer.java
@@ -48,7 +48,7 @@ public class PNGRenderer extends Java2DRenderer {
/** The OutputStream for the first Image */
private OutputStream firstOutputStream;
-
+
/** Helper class for generating multiple files */
private MultiFileRenderingUtil multiFileUtil;
@@ -60,7 +60,7 @@ public class PNGRenderer extends Java2DRenderer {
/** {@inheritDoc} */
public void startRenderer(OutputStream outputStream) throws IOException {
log.info("rendering areas to PNG");
- multiFileUtil = new MultiFileRenderingUtil(PNG_FILE_EXTENSION,
+ multiFileUtil = new MultiFileRenderingUtil(PNG_FILE_EXTENSION,
getUserAgent().getOutputFile());
this.firstOutputStream = outputStream;
}
@@ -84,7 +84,7 @@ public class PNGRenderer extends Java2DRenderer {
// Do the rendering: get the image for this page
PageViewport pv = (PageViewport)pageViewportList.get(i);
RenderedImage image = (RenderedImage)getPageImage(pv);
-
+
// Encode this image
if (log.isDebugEnabled()) {
log.debug("Encoding page " + (i + 1));
@@ -102,7 +102,7 @@ public class PNGRenderer extends Java2DRenderer {
private void writeImage(OutputStream os, RenderedImage image) throws IOException {
ImageWriterParams params = new ImageWriterParams();
params.setResolution(Math.round(userAgent.getTargetResolution()));
-
+
// Encode PNG image
ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor(getMimeType());
if (writer == null) {
diff --git a/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java b/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java
index 0f4c4c4fb..7d321791a 100644
--- a/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java
+++ b/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,8 +32,8 @@ import org.apache.fop.render.java2d.Java2DRendererConfigurator;
public class PNGRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_PNG};
-
-
+
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent ua) {
return new PNGRenderer();
diff --git a/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java b/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java
index 36dd093b2..a6a6e8dfe 100644
--- a/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java
+++ b/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java
@@ -96,7 +96,7 @@ public class PNGRenderer_onthefly extends Java2DRenderer {
fileSyntax = s.substring(0, i);
}
- /**
+ /**
* {@inheritDoc}
*/
public void renderPage(PageViewport pageViewport) throws IOException {
diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
index 9291427d2..fea831a9b 100644
--- a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
+++ b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
@@ -80,13 +80,13 @@ public class TIFFRenderer extends Java2DRenderer {
//private static final String COMPRESSION_ZLIB = "ZLib";
public static final String COMPRESSION_CCITT_T6 = "CCITT T.6"; //CCITT Group 4
public static final String COMPRESSION_CCITT_T4 = "CCITT T.4"; //CCITT Group 3
-
+
/** ImageWriter parameters */
private ImageWriterParams writerParams;
-
+
/** Image Type as parameter for the BufferedImage constructor (see BufferedImage.TYPE_*) */
private int bufferedImageType = BufferedImage.TYPE_INT_ARGB;
-
+
private OutputStream outputStream;
/** {@inheritDoc} */
@@ -160,7 +160,7 @@ public class TIFFRenderer extends Java2DRenderer {
clearViewportList();
log.debug("TIFF encoding done.");
}
-
+
/** {@inheritDoc} */
protected BufferedImage getBufferedImage(int bitmapWidth, int bitmapHeight) {
return new BufferedImage(bitmapWidth, bitmapHeight, bufferedImageType);
@@ -210,7 +210,7 @@ public class TIFFRenderer extends Java2DRenderer {
//Decorate the image with a packed sample model for encoding by the codec
SinglePixelPackedSampleModel sppsm;
sppsm = (SinglePixelPackedSampleModel)pageImage.getSampleModel();
-
+
int bands = sppsm.getNumBands();
int[] off = new int[bands];
int w = pageImage.getWidth();
@@ -220,7 +220,7 @@ public class TIFFRenderer extends Java2DRenderer {
}
SampleModel sm = new PixelInterleavedSampleModel(
DataBuffer.TYPE_BYTE, w, h, bands, w * bands, off);
-
+
RenderedImage rimg = new FormatRed(GraphicsUtil.wrap(pageImage), sm);
return rimg;
}
diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java b/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java
index 71ad0b286..ff5e22ceb 100644
--- a/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ import org.apache.fop.render.PrintRendererConfigurator;
import org.apache.fop.render.Renderer;
/**
- * TIFF Renderer configurator
+ * TIFF Renderer configurator
*/
public class TIFFRendererConfigurator extends PrintRendererConfigurator {
@@ -47,7 +47,7 @@ public class TIFFRendererConfigurator extends PrintRendererConfigurator {
* @throws FOPException fop exception
* {@inheritDoc}
*/
- public void configure(Renderer renderer) throws FOPException {
+ public void configure(Renderer renderer) throws FOPException {
Configuration cfg = super.getRendererConfig(renderer);
if (cfg != null) {
TIFFRenderer tiffRenderer = (TIFFRenderer)renderer;
diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java b/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java
index 69463d127..e3c567995 100644
--- a/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java
+++ b/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.fop.render.RendererConfigurator;
public class TIFFRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_TIFF};
-
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new TIFFRenderer();
diff --git a/src/java/org/apache/fop/render/java2d/Base14FontCollection.java b/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
index ca4a4bce3..29e80dc2f 100644
--- a/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
+++ b/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
index 3a773a2db..63b04da32 100644
--- a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
index ff246af2b..2f87b62ea 100644
--- a/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,5 +34,5 @@ public interface FontMetricsMapper extends FontMetrics {
* @return font with the desired characteristics.
*/
java.awt.Font getFont(int size);
-
+
}
diff --git a/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java b/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
index 4eac922e8..fe4e04766 100644
--- a/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
+++ b/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -61,7 +61,7 @@ public class InstalledFontCollection implements FontCollection {
/**
* Main constructor
- *
+ *
* @param graphics2D a graphics 2D
*/
public InstalledFontCollection(Graphics2D graphics2D) {
diff --git a/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java b/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
index 64e329c62..10af3aa86 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
// Java
@@ -63,17 +63,17 @@ public class Java2DFontMetrics {
* The typical height of a small cap latter (often derived from "x", value in mpt)
*/
private int xHeight = 0;
-
+
/**
* The highest point of the font above the baseline (usually derived from "d", value in mpt)
*/
private int ascender = 0;
-
+
/**
* The lowest point of the font under the baseline (usually derived from "p", value in mpt)
*/
private int descender = 0;
-
+
/**
* Buffered font.
* f1 is bufferd for metric measurements during layout.
@@ -103,7 +103,7 @@ public class Java2DFontMetrics {
/** A LineMetrics to access high-resolution metrics information. */
private LineMetrics lineMetrics;
-
+
/**
* Temp graphics object needed to get the font metrics
*/
@@ -130,7 +130,7 @@ public class Java2DFontMetrics {
setFont(family, style, size);
return Math.round(lineMetrics.getAscent() * FONT_FACTOR);
}
-
+
/**
* Determines the font ascent of the Font described by this
* FontMetrics object
@@ -159,7 +159,7 @@ public class Java2DFontMetrics {
* Rectangle FontMetrics.getStringBounds(..) method can be called.
* The y value of the rectangle is the offset from the origin
* (baseline) apparently needed by the sample test program
- *
+ *
* xxxxx@xxxxx 2001-05-15
*/
/* I don't think this is right.
@@ -231,7 +231,7 @@ public class Java2DFontMetrics {
Rectangle2D rect = fmt.getStringBounds(ch, 0, 1, this.graphics);
return (int)Math.round(rect.getWidth() * 1000);
}
-
+
/**
* Return widths (in 1/1000ths of point size) of all
* characters
@@ -265,7 +265,7 @@ public class Java2DFontMetrics {
atts.put(TextAttribute.SIZE, new Float(size)); //size in pt
return new Font(atts);
}
-
+
/**
* Checks whether the font for which values are
* requested is the one used immediately before or
@@ -301,17 +301,17 @@ public class Java2DFontMetrics {
TextLayout layout = new TextLayout("x", f1, graphics.getFontRenderContext());
Rectangle2D rect = layout.getBounds();
xHeight = (int)Math.round(-rect.getY() * 1000);
-
+
//PostScript-compatible ascent
layout = new TextLayout("d", f1, graphics.getFontRenderContext());
rect = layout.getBounds();
ascender = (int)Math.round(-rect.getY() * 1000);
-
+
//PostScript-compatible descent
layout = new TextLayout("p", f1, graphics.getFontRenderContext());
rect = layout.getBounds();
descender = (int)Math.round((rect.getY() + rect.getHeight()) * -1000);
-
+
//Alternative way to get metrics but the ascender is again wrong for our purposes
lineMetrics = f1.getLineMetrics("", graphics.getFontRenderContext());
}
diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java b/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
index b29378a96..8fe93d051 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
import java.awt.Color;
@@ -40,12 +40,12 @@ public class Java2DGraphics2DAdapter extends AbstractGraphics2DAdapter {
public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
-
+
float fwidth = width / 1000f;
float fheight = height / 1000f;
float fx = x / 1000f;
float fy = y / 1000f;
-
+
// get the 'width' and 'height' attributes of the SVG document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth() / 1000f;
@@ -56,12 +56,12 @@ public class Java2DGraphics2DAdapter extends AbstractGraphics2DAdapter {
Java2DRenderer renderer = (Java2DRenderer)context.getRenderer();
Java2DGraphicsState state = renderer.state;
-
+
//Create copy and paint on that
Graphics2D g2d = (Graphics2D)state.getGraph().create();
g2d.setColor(Color.black);
g2d.setBackground(Color.black);
-
+
//TODO Clip to the image area.
// transform so that the coordinates (0,0) is from the top left
diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java b/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
index 31da90c95..1c5fa8427 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
@@ -73,14 +73,14 @@ public class Java2DGraphicsState {
* @param org the instance to copy
*/
public Java2DGraphicsState(Java2DGraphicsState org) {
- this.currentGraphics = (Graphics2D)org.currentGraphics.create();
+ this.currentGraphics = (Graphics2D)org.currentGraphics.create();
this.fontInfo = org.fontInfo;
this.initialTransform = org.initialTransform;
this.currentStroke = org.currentStroke;
this.currentStrokeStyle = org.currentStrokeStyle;
this.currentStrokeWidth = org.currentStrokeWidth;
}
-
+
/**
* @return the currently valid state
*/
@@ -92,7 +92,7 @@ public class Java2DGraphicsState {
public void dispose() {
this.currentGraphics.dispose();
this.currentGraphics = null;
-
+
}
/**
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java b/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
index a18f71cc0..0709d4ea9 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java b/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
index 0fd87f910..0157b7411 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
@@ -29,5 +29,5 @@ public interface Java2DRendererContextConstants extends
/** The current Java2DGraphicsState. */
String JAVA2D_STATE = "state";
-
+
}
diff --git a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
index 64ac823fc..12b269a44 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -94,7 +94,7 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
+ "currentYPosition = " + currentYPosition + "}";
}
}
-
+
/** {@inheritDoc} */
protected void renderSVGDocument(RendererContext context,
Document doc) {
@@ -105,12 +105,12 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
int x = info.currentXPosition;
int y = info.currentYPosition;
-
+
SVGUserAgent ua = new SVGUserAgent(context.getUserAgent(), new AffineTransform());
-
+
GVTBuilder builder = new GVTBuilder();
BridgeContext ctx = new BridgeContext(ua);
-
+
GraphicsNode root;
try {
root = builder.build(ctx, doc);
@@ -120,20 +120,20 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
eventProducer.svgNotBuilt(this, e, getDocumentURI(doc));
return;
}
-
+
// If no viewbox is defined in the svg file, a viewbox of 100x100 is
// assumed, as defined in SVGUserAgent.getViewportSize()
float iw = (float) ctx.getDocumentSize().getWidth() * 1000f;
float ih = (float) ctx.getDocumentSize().getHeight() * 1000f;
-
+
float w = (float) info.width;
float h = (float) info.height;
AffineTransform origTransform = info.state.getGraph().getTransform();
-
+
// correct integer roundoff
info.state.getGraph().translate(x / 1000f, y / 1000f);
-
+
//SVGSVGElement svg = ((SVGDocument) doc).getRootElement();
// Aspect ratio preserved by layout engine, not here
AffineTransform at = AffineTransform.getScaleInstance(w / iw, h / ih);
@@ -148,10 +148,10 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
context.getUserAgent().getEventBroadcaster());
eventProducer.svgRenderingError(this, e, getDocumentURI(doc));
}
-
+
info.state.getGraph().setTransform(origTransform);
}
-
+
/** {@inheritDoc} */
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof Java2DRenderer);
diff --git a/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
index 19e9a4d1d..afcf088cc 100644
--- a/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
// Java
diff --git a/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java b/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java
index 10fcfde3d..418810401 100644
--- a/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java
+++ b/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java
@@ -36,10 +36,10 @@ public class DefaultMonochromeBitmapConverter implements
public void setHint(String name, String value) {
//ignore, not supported
}
-
+
/** {@inheritDoc} */
public RenderedImage convertToMonochrome(BufferedImage img) {
- BufferedImage buf = new BufferedImage(img.getWidth(), img.getHeight(),
+ BufferedImage buf = new BufferedImage(img.getWidth(), img.getHeight(),
BufferedImage.TYPE_BYTE_BINARY);
RenderingHints hints = new RenderingHints(null);
//This hint doesn't seem to make a difference :-(
diff --git a/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java b/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java
index 89e54b917..e9611edac 100644
--- a/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java
+++ b/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java
@@ -46,20 +46,20 @@ public class JAIMonochromeBitmapConverter implements
MonochromeBitmapConverter {
private boolean isErrorDiffusion = false;
-
+
/** {@inheritDoc} */
public void setHint(String name, String value) {
if ("quality".equalsIgnoreCase(name)) {
isErrorDiffusion = "true".equalsIgnoreCase(value);
}
}
-
+
/** {@inheritDoc} */
public RenderedImage convertToMonochrome(BufferedImage img) {
if (img.getColorModel().getColorSpace().getNumComponents() != 1) {
throw new IllegalArgumentException("Source image must be a grayscale image!");
}
-
+
// Load the ParameterBlock for the dithering operation
// and set the operation name.
ParameterBlock pb = new ParameterBlock();
@@ -78,7 +78,7 @@ public class JAIMonochromeBitmapConverter implements
pb.add(colorMap);
pb.add(KernelJAI.DITHER_MASK_441);
}
-
+
//Create an image layout for a monochrome b/w image
ImageLayout layout = new ImageLayout();
byte[] map = new byte[] {(byte)0x00, (byte)0xff};
@@ -89,8 +89,8 @@ public class JAIMonochromeBitmapConverter implements
RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);
// Dither the image.
- PlanarImage dst = JAI.create(opName, pb, hints);
-
+ PlanarImage dst = JAI.create(opName, pb, hints);
+
//Convert it to a BufferedImage
return dst.getAsBufferedImage();
}
diff --git a/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java b/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java
index aae0b90ce..9a960f871 100644
--- a/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java
+++ b/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java
@@ -33,12 +33,12 @@ public interface MonochromeBitmapConverter {
* @param value the value
*/
void setHint(String name, String value);
-
+
/**
- * Converts a grayscale bitmap image to a monochrome (1-bit) b/w bitmap image.
+ * Converts a grayscale bitmap image to a monochrome (1-bit) b/w bitmap image.
* @param img the grayscale image
* @return the converted monochrome image
*/
RenderedImage convertToMonochrome(BufferedImage img);
-
+
}
diff --git a/src/java/org/apache/fop/render/pcl/PCLEventProducer.java b/src/java/org/apache/fop/render/pcl/PCLEventProducer.java
index 3e72de293..3e95bd4f9 100644
--- a/src/java/org/apache/fop/render/pcl/PCLEventProducer.java
+++ b/src/java/org/apache/fop/render/pcl/PCLEventProducer.java
@@ -31,7 +31,7 @@ public interface PCLEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,9 +50,9 @@ public interface PCLEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* Paper type could not be determined. Falling back to another.
* @param source the event source
@@ -62,5 +62,5 @@ public interface PCLEventProducer extends EventProducer {
* @event.severity WARN
*/
void paperTypeUnavailable(Object source, long pageWidth, long pageHeight, String fallbackPaper);
-
+
}
diff --git a/src/java/org/apache/fop/render/pcl/PCLGenerator.java b/src/java/org/apache/fop/render/pcl/PCLGenerator.java
index 6a4425012..d1b6f6578 100644
--- a/src/java/org/apache/fop/render/pcl/PCLGenerator.java
+++ b/src/java/org/apache/fop/render/pcl/PCLGenerator.java
@@ -55,24 +55,24 @@ public class PCLGenerator {
/** The ESC (escape) character */
public static final char ESC = '\033';
-
+
/** A list of all supported resolutions in PCL (values in dpi) */
public static final int[] PCL_RESOLUTIONS = new int[] {75, 100, 150, 200, 300, 600};
-
+
/** Selects a 4x4 Bayer dither matrix (17 grayscales) */
public static final int DITHER_MATRIX_4X4 = 4;
/** Selects a 8x8 Bayer dither matrix (65 grayscales) */
public static final int DITHER_MATRIX_8X8 = 8;
-
- private final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
+
+ private final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
private final DecimalFormat df2 = new DecimalFormat("0.##", symbols);
private final DecimalFormat df4 = new DecimalFormat("0.####", symbols);
-
+
private OutputStream out;
-
+
private boolean currentSourceTransparency = true;
private boolean currentPatternTransparency = true;
-
+
private int maxBitmapResolution = PCL_RESOLUTIONS[PCL_RESOLUTIONS.length - 1];
/**
@@ -80,7 +80,7 @@ public class PCLGenerator {
* to create custom dither patterns for better grayscale quality.
*/
private boolean usePCLShades = false;
-
+
/**
* Main constructor.
* @param out the OutputStream to write the PCL stream to
@@ -88,7 +88,7 @@ public class PCLGenerator {
public PCLGenerator(OutputStream out) {
this.out = out;
}
-
+
/**
* Main constructor.
* @param out the OutputStream to write the PCL stream to
@@ -108,17 +108,17 @@ public class PCLGenerator {
}
this.maxBitmapResolution = maxResolution;
}
-
+
/** @return the OutputStream that this generator writes to */
public OutputStream getOutputStream() {
return this.out;
}
-
+
/** @return the maximum resolution to encode bitmap images at */
public int getMaximumBitmapResolution() {
return this.maxBitmapResolution;
}
-
+
/**
* Writes a PCL escape command to the output stream.
* @param cmd the command (without the ESCAPE character)
@@ -128,7 +128,7 @@ public class PCLGenerator {
out.write(27); //ESC
out.write(cmd.getBytes("US-ASCII"));
}
-
+
/**
* Writes raw text (in ISO-8859-1 encoding) to the output stream.
* @param s the text
@@ -140,7 +140,7 @@ public class PCLGenerator {
/**
* Formats a double value with two decimal positions for PCL output.
- *
+ *
* @param value value to format
* @return the formatted value
*/
@@ -150,7 +150,7 @@ public class PCLGenerator {
/**
* Formats a double value with four decimal positions for PCL output.
- *
+ *
* @param value value to format
* @return the formatted value
*/
@@ -165,7 +165,7 @@ public class PCLGenerator {
public void universalEndOfLanguage() throws IOException {
writeCommand("%-12345X");
}
-
+
/**
* Resets the printer and restores the user default environment.
* @throws IOException In case of an I/O error
@@ -173,7 +173,7 @@ public class PCLGenerator {
public void resetPrinter() throws IOException {
writeCommand("E");
}
-
+
/**
* Sends the job separation command.
* @throws IOException In case of an I/O error
@@ -181,7 +181,7 @@ public class PCLGenerator {
public void separateJobs() throws IOException {
writeCommand("&l1T");
}
-
+
/**
* Sends the form feed character.
* @throws IOException In case of an I/O error
@@ -198,7 +198,7 @@ public class PCLGenerator {
public void setUnitOfMeasure(int value) throws IOException {
writeCommand("&u" + value + "D");
}
-
+
/**
* Sets the raster graphics resolution
* @param value the resolution value (units per inch)
@@ -207,7 +207,7 @@ public class PCLGenerator {
public void setRasterGraphicsResolution(int value) throws IOException {
writeCommand("*t" + value + "R");
}
-
+
/**
* Selects the page size.
* @param selector the integer representing the page size
@@ -218,7 +218,7 @@ public class PCLGenerator {
}
/**
- * Selects the paper source. The parameter is usually printer-specific. Usually, "1" is the
+ * Selects the paper source. The parameter is usually printer-specific. Usually, "1" is the
* default tray, "2" is the manual paper feed, "3" is the manual envelope feed, "4" is the
* "lower" tray and "7" is "auto-select". Consult the technical reference for your printer
* for all available values.
@@ -230,8 +230,8 @@ public class PCLGenerator {
}
/**
- * Selects the duplexing mode for the page.
- * The parameter is usually printer-specific.
+ * Selects the duplexing mode for the page.
+ * The parameter is usually printer-specific.
* "0" means Simplex,
* "1" means Duplex, Long-Edge Binding,
* "2" means Duplex, Short-Edge Binding.
@@ -249,7 +249,7 @@ public class PCLGenerator {
public void clearHorizontalMargins() throws IOException {
writeCommand("9");
}
-
+
/**
* The Top Margin command designates the number of lines between
* the top of the logical page and the top of the text area.
@@ -303,7 +303,7 @@ public class PCLGenerator {
public void pushCursorPos() throws IOException {
writeCommand("&f0S");
}
-
+
/**
* Pops the current cursor position from the stack.
* @throws IOException In case of an I/O error
@@ -311,7 +311,7 @@ public class PCLGenerator {
public void popCursorPos() throws IOException {
writeCommand("&f1S");
}
-
+
/**
* Changes the current print direction while maintaining the current cursor position.
* @param rotate the rotation angle (counterclockwise), one of 0, 90, 180 and 270.
@@ -320,10 +320,10 @@ public class PCLGenerator {
public void changePrintDirection(int rotate) throws IOException {
writeCommand("&a" + rotate + "P");
}
-
+
/**
* Enters the HP GL/2 mode.
- * @param restorePreviousHPGL2Cursor true if the previous HP GL/2 pen position should be
+ * @param restorePreviousHPGL2Cursor true if the previous HP GL/2 pen position should be
* restored, false if the current position is maintained
* @throws IOException In case of an I/O error
*/
@@ -334,7 +334,7 @@ public class PCLGenerator {
writeCommand("%1B");
}
}
-
+
/**
* Enters the PCL mode.
* @param restorePreviousPCLCursor true if the previous PCL cursor position should be restored,
@@ -348,7 +348,7 @@ public class PCLGenerator {
writeCommand("%1A");
}
}
-
+
/**
* Generate a filled rectangle at the current cursor position.
*
@@ -367,10 +367,10 @@ public class PCLGenerator {
//y += h;
}
setPatternTransparencyMode(false);
- if (usePCLShades
+ if (usePCLShades
|| Color.black.equals(col)
|| Color.white.equals(col)) {
- writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ formatDouble4(h / 100.0) + "V");
int lineshade = convertToPCLShade(col);
writeCommand("*c" + lineshade + "G");
@@ -378,7 +378,7 @@ public class PCLGenerator {
} else {
defineGrayscalePattern(col, 32, DITHER_MATRIX_4X4);
- writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ formatDouble4(h / 100.0) + "V");
writeCommand("*c32G");
writeCommand("*c4P"); //User-defined pattern
@@ -391,19 +391,19 @@ public class PCLGenerator {
private static final int[] BAYER_D2 = new int[] {0, 2, 3, 1};
private static final int[] BAYER_D4;
private static final int[] BAYER_D8;
-
+
static {
BAYER_D4 = deriveBayerMatrix(BAYER_D2);
BAYER_D8 = deriveBayerMatrix(BAYER_D4);
}
-
+
private static void setValueInMatrix(int[] dn, int half, int part, int idx, int value) {
int xoff = (part & 1) * half;
int yoff = (part & 2) * half * half;
int matrixIndex = yoff + ((int)(idx / half) * half * 2) + (idx % half) + xoff;
dn[matrixIndex] = value;
}
-
+
private static int[] deriveBayerMatrix(int[] d) {
int[] dn = new int[d.length * 4];
int half = (int)Math.sqrt(d.length);
@@ -414,7 +414,7 @@ public class PCLGenerator {
}
return dn;
}
-
+
/**
* Generates a user-defined pattern for a dithering pattern matching the grayscale value
* of the color given.
@@ -423,7 +423,7 @@ public class PCLGenerator {
* @param ditherMatrixSize the size of the Bayer dither matrix to use (4 or 8 supported)
* @throws IOException In case of an I/O error
*/
- public void defineGrayscalePattern(Color col, int patternID, int ditherMatrixSize)
+ public void defineGrayscalePattern(Color col, int patternID, int ditherMatrixSize)
throws IOException {
ByteArrayOutputStream baout = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream(baout);
@@ -436,36 +436,36 @@ public class PCLGenerator {
//data.writeShort(600); //X Resolution (didn't manage to get that to work)
//data.writeShort(600); //Y Resolution
int gray255 = convertToGray(col.getRed(), col.getGreen(), col.getBlue());
-
+
byte[] pattern;
if (ditherMatrixSize == 8) {
int gray65 = gray255 * 65 / 255;
-
+
pattern = new byte[BAYER_D8.length / 8];
-
+
for (int i = 0, c = BAYER_D8.length; i < c; i++) {
boolean dot = !(BAYER_D8[i] < gray65 - 1);
if (dot) {
int byteIdx = i / 8;
- pattern[byteIdx] |= 1 << (i % 8);
+ pattern[byteIdx] |= 1 << (i % 8);
}
}
} else {
int gray17 = gray255 * 17 / 255;
-
- //Since a 4x4 pattern did not work, the 4x4 pattern is applied 4 times to an
- //8x8 pattern. Maybe this could be changed to use an 8x8 bayer dither pattern
+
+ //Since a 4x4 pattern did not work, the 4x4 pattern is applied 4 times to an
+ //8x8 pattern. Maybe this could be changed to use an 8x8 bayer dither pattern
//instead of the 4x4 one.
pattern = new byte[BAYER_D4.length / 8 * 4];
-
+
for (int i = 0, c = BAYER_D4.length; i < c; i++) {
boolean dot = !(BAYER_D4[i] < gray17 - 1);
if (dot) {
int byteIdx = i / 4;
- pattern[byteIdx] |= 1 << (i % 4);
- pattern[byteIdx] |= 1 << ((i % 4) + 4);
- pattern[byteIdx + 4] |= 1 << (i % 4);
- pattern[byteIdx + 4] |= 1 << ((i % 4) + 4);
+ pattern[byteIdx] |= 1 << (i % 4);
+ pattern[byteIdx] |= 1 << ((i % 4) + 4);
+ pattern[byteIdx + 4] |= 1 << (i % 4);
+ pattern[byteIdx + 4] |= 1 << ((i % 4) + 4);
}
}
}
@@ -525,7 +525,7 @@ public class PCLGenerator {
public final int convertToGray(int r, int g, int b) {
return (r * 30 + g * 59 + b * 11) / 100;
}
-
+
/**
* Convert a Color value to a PCL shade value (0-100).
* @param col the color
@@ -535,7 +535,7 @@ public class PCLGenerator {
float gray = convertToGray(col.getRed(), col.getGreen(), col.getBlue()) / 255f;
return (int)(100 - (gray * 100f));
}
-
+
/**
* Selects the current grayscale color (the given color is converted to grayscales).
* @param col the color
@@ -555,7 +555,7 @@ public class PCLGenerator {
}
}
}
-
+
/**
* Select the current pattern
* @param patternID the pattern ID ( Converts the sourceMatrix to a string for use in the PDFRenderer cm operations. For example:
* Converts the AffineTransform instance to a string for use in the PDFRenderer
+ * Converts the AffineTransform instance to a string for use in the PDFRenderer
* cm operations. Creates a new CTM based in the sourceMatrix. For example:
* Creates an array of six doubles from the source CTM. For example:
*
* Set this value to false if you experience unwanted blank pages in your
* postscript output.
* @param dscCompliant boolean value (default is true)
*/
public void setDSCCompliant(boolean dscCompliant) {
- this.dscCompliant = dscCompliant;
+ this.dscCompliant = dscCompliant;
}
}
diff --git a/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java b/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
index 3ce9751b5..867888ea5 100644
--- a/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,7 +27,7 @@ import org.apache.fop.render.Renderer;
import org.apache.xmlgraphics.ps.PSGenerator;
/**
- * Postscript renderer config
+ * Postscript renderer config
*/
public class PSRendererConfigurator extends PrintRendererConfigurator {
@@ -50,7 +50,7 @@ public class PSRendererConfigurator extends PrintRendererConfigurator {
super.configure(renderer);
PSRenderer psRenderer = (PSRenderer)renderer;
-
+
psRenderer.setAutoRotateLandscape(
cfg.getChild("auto-rotate-landscape").getValueAsBoolean(false));
Configuration child;
diff --git a/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java b/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java
index f5a5cc89f..433f2ce7c 100644
--- a/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java
@@ -32,5 +32,5 @@ public interface PSRendererContextConstants extends RendererContextConstants {
/** The font information for the PostScript renderer. */
public static final String PS_FONT_INFO = "psFontInfo";
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSRendererMaker.java b/src/java/org/apache/fop/render/ps/PSRendererMaker.java
index 657a65f70..8c64f2806 100644
--- a/src/java/org/apache/fop/render/ps/PSRendererMaker.java
+++ b/src/java/org/apache/fop/render/ps/PSRendererMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.fop.render.RendererConfigurator;
public class PSRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_POSTSCRIPT};
-
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new PSRenderer();
diff --git a/src/java/org/apache/fop/render/ps/PSSVGHandler.java b/src/java/org/apache/fop/render/ps/PSSVGHandler.java
index ebe098282..1d293fa71 100644
--- a/src/java/org/apache/fop/render/ps/PSSVGHandler.java
+++ b/src/java/org/apache/fop/render/ps/PSSVGHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -246,7 +246,7 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
nativeTextHandler = new NativeTextHandler(graphics, psInfo.getFontInfo());
graphics.setCustomTextHandler(nativeTextHandler);
PSTextPainter textPainter = new PSTextPainter(nativeTextHandler);
- ctx.setTextPainter(textPainter);
+ ctx.setTextPainter(textPainter);
PSTextElementBridge tBridge = new PSTextElementBridge(textPainter);
ctx.putBridge(tBridge);
}
@@ -279,10 +279,10 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
* an fo:block-container
*/
gen.writeln("newpath");
- gen.defineRect(xOffset / 1000f, yOffset / 1000f,
+ gen.defineRect(xOffset / 1000f, yOffset / 1000f,
psInfo.getWidth() / 1000f, psInfo.getHeight() / 1000f);
gen.writeln("clip");
-
+
// transform so that the coordinates (0,0) is from the top left
// and positive is down and to the right. (0,0) is where the
// viewBox puts it.
@@ -323,6 +323,6 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof PSRenderer);
}
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSSupportedFlavors.java b/src/java/org/apache/fop/render/ps/PSSupportedFlavors.java
index 8ccfa8e26..b5c42c99e 100644
--- a/src/java/org/apache/fop/render/ps/PSSupportedFlavors.java
+++ b/src/java/org/apache/fop/render/ps/PSSupportedFlavors.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps;
import org.apache.xmlgraphics.image.loader.ImageFlavor;
@@ -31,8 +31,8 @@ public interface PSSupportedFlavors {
{ImageFlavor.RAW_EPS,
ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE,
ImageFlavor.XML_DOM};
/** The flavors supported inline with PostScript level 3 and higher. */
@@ -41,17 +41,17 @@ public interface PSSupportedFlavors {
ImageFlavor.RAW_JPEG,
ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE,
ImageFlavor.XML_DOM};
-
+
/** The flavors supported as forms with PostScript level 2. */
ImageFlavor[] LEVEL_2_FLAVORS_FORM = new ImageFlavor[]
{//ImageFlavor.RAW_EPS,
ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE/*,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE/*,
ImageFlavor.XML_DOM*/};
/** The flavors supported as forms with PostScript level 3 or higher. */
@@ -60,8 +60,8 @@ public interface PSSupportedFlavors {
ImageFlavor.RAW_JPEG,
ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE/*,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE/*,
ImageFlavor.XML_DOM*/};
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSTextElementBridge.java b/src/java/org/apache/fop/render/ps/PSTextElementBridge.java
index 0f41ca525..ab0c2d723 100644
--- a/src/java/org/apache/fop/render/ps/PSTextElementBridge.java
+++ b/src/java/org/apache/fop/render/ps/PSTextElementBridge.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@ import org.w3c.dom.Node;
* @version $Id$
*/
public class PSTextElementBridge extends SVGTextElementBridge {
-
+
private PSTextPainter textPainter;
/**
diff --git a/src/java/org/apache/fop/render/ps/PSTextPainter.java b/src/java/org/apache/fop/render/ps/PSTextPainter.java
index 08cea6517..31cb4b605 100644
--- a/src/java/org/apache/fop/render/ps/PSTextPainter.java
+++ b/src/java/org/apache/fop/render/ps/PSTextPainter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -70,10 +70,10 @@ import org.apache.fop.fonts.FontTriplet;
* @version $Id$
*/
public class PSTextPainter implements TextPainter {
-
+
/** the logger for this class */
protected Log log = LogFactory.getLog(PSTextPainter.class);
-
+
private NativeTextHandler nativeTextHandler;
private FontInfo fontInfo;
@@ -81,7 +81,7 @@ public class PSTextPainter implements TextPainter {
* Use the stroking text painter to get the bounds and shape.
* Also used as a fallback to draw the string with strokes.
*/
- protected static final TextPainter
+ protected static final TextPainter
PROXY_PAINTER = StrokingTextPainter.getInstance();
/**
@@ -102,19 +102,19 @@ public class PSTextPainter implements TextPainter {
public void paint(TextNode node, Graphics2D g2d) {
String txt = node.getText();
Point2D loc = node.getLocation();
-
+
if (hasUnsupportedAttributes(node)) {
PROXY_PAINTER.paint(node, g2d);
} else {
paintTextRuns(node.getTextRuns(), g2d, loc);
}
}
-
-
+
+
private boolean hasUnsupportedAttributes(TextNode node) {
Iterator i = node.getTextRuns().iterator();
while (i.hasNext()) {
- StrokingTextPainter.TextRun
+ StrokingTextPainter.TextRun
run = (StrokingTextPainter.TextRun)i.next();
AttributedCharacterIterator aci = run.getACI();
boolean hasUnsupported = hasUnsupportedAttributes(aci);
@@ -127,17 +127,17 @@ public class PSTextPainter implements TextPainter {
private boolean hasUnsupportedAttributes(AttributedCharacterIterator aci) {
boolean hasunsupported = false;
-
+
String text = getText(aci);
Font font = makeFont(aci);
if (hasUnsupportedGlyphs(text, font)) {
log.trace("-> Unsupported glyphs found");
hasunsupported = true;
}
-
+
TextPaintInfo tpi = (TextPaintInfo) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO);
- if ((tpi != null)
+ if ((tpi != null)
&& ((tpi.strokeStroke != null && tpi.strokePaint != null)
|| (tpi.strikethroughStroke != null)
|| (tpi.underlineStroke != null)
@@ -169,7 +169,7 @@ public class PSTextPainter implements TextPainter {
log.trace("-> word spacing found");
hasunsupported = true;
}
-
+
Object lengthAdjust = aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.LENGTH_ADJUST);
if (lengthAdjust != null) {
@@ -179,7 +179,7 @@ public class PSTextPainter implements TextPainter {
Object writeMod = aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.WRITING_MODE);
- if (writeMod != null
+ if (writeMod != null
&& !GVTAttributedCharacterIterator.TextAttribute.WRITING_MODE_LTR.equals(
writeMod)) {
log.trace("-> Unsupported writing modes found");
@@ -193,7 +193,7 @@ public class PSTextPainter implements TextPainter {
log.trace("-> vertical orientation found");
hasunsupported = true;
}
-
+
Object rcDel = aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.TEXT_COMPOUND_DELIMITER);
//Batik 1.6 returns null here which makes it impossible to determine whether this can
@@ -202,7 +202,7 @@ public class PSTextPainter implements TextPainter {
log.trace("-> spans found");
hasunsupported = true; //Filter spans
}
-
+
if (hasunsupported) {
log.trace("Unsupported attributes found in ACI, using StrokingTextPainter");
}
@@ -219,7 +219,7 @@ public class PSTextPainter implements TextPainter {
Point2D currentloc = loc;
Iterator i = textRuns.iterator();
while (i.hasNext()) {
- StrokingTextPainter.TextRun
+ StrokingTextPainter.TextRun
run = (StrokingTextPainter.TextRun)i.next();
currentloc = paintTextRun(run, g2d, currentloc);
}
@@ -251,7 +251,7 @@ public class PSTextPainter implements TextPainter {
}
/**
- * Paint an ACI on a Graphics2D at a given location. The method has to
+ * Paint an ACI on a Graphics2D at a given location. The method has to
* update the location after painting.
* @param aci ACI to paint
* @param g2d Graphics2D to paint on
@@ -260,18 +260,18 @@ public class PSTextPainter implements TextPainter {
*/
protected Point2D paintACI(AttributedCharacterIterator aci, Graphics2D g2d, Point2D loc) {
//ACIUtils.dumpAttrs(aci);
-
+
aci.first();
updateLocationFromACI(aci, loc);
TextPaintInfo tpi = (TextPaintInfo) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO);
-
+
if (tpi == null) {
return loc;
}
-
+
TextNode.Anchor anchor = (TextNode.Anchor)aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.ANCHOR_TYPE);
@@ -315,7 +315,7 @@ public class PSTextPainter implements TextPainter {
default: //nop
}
}
-
+
drawPrimitiveString(g2d, loc, font, txt, tx);
loc.setLocation(loc.getX() + (double)advance, loc.getY());
return loc;
@@ -354,25 +354,25 @@ public class PSTextPainter implements TextPainter {
}
if (ypos != null) {
loc.setLocation(loc.getX(), ypos.doubleValue());
- }
+ }
if (dxpos != null) {
loc.setLocation(loc.getX() + dxpos.doubleValue(), loc.getY());
- }
+ }
if (dypos != null) {
loc.setLocation(loc.getX(), loc.getY() + dypos.doubleValue());
- }
+ }
}
private String getStyle(AttributedCharacterIterator aci) {
Float posture = (Float)aci.getAttribute(TextAttribute.POSTURE);
return ((posture != null) && (posture.floatValue() > 0.0))
- ? "italic"
+ ? "italic"
: "normal";
}
private int getWeight(AttributedCharacterIterator aci) {
Float taWeight = (Float)aci.getAttribute(TextAttribute.WEIGHT);
- return ((taWeight != null) && (taWeight.floatValue() > 1.0))
+ return ((taWeight != null) && (taWeight.floatValue() > 1.0))
? Font.WEIGHT_BOLD
: Font.WEIGHT_NORMAL;
}
@@ -479,8 +479,8 @@ public class PSTextPainter implements TextPainter {
* @return the bounds of the text
*/
public Rectangle2D getBounds2D(TextNode node) {
- /* (todo) getBounds2D() is too slow
- * because it uses the StrokingTextPainter. We should implement this
+ /* (todo) getBounds2D() is too slow
+ * because it uses the StrokingTextPainter. We should implement this
* method ourselves. */
return PROXY_PAINTER.getBounds2D(node);
}
diff --git a/src/java/org/apache/fop/render/ps/PSTranscoder.java b/src/java/org/apache/fop/render/ps/PSTranscoder.java
index fd252b447..3585ab2f8 100644
--- a/src/java/org/apache/fop/render/ps/PSTranscoder.java
+++ b/src/java/org/apache/fop/render/ps/PSTranscoder.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/ps/ResourceHandler.java b/src/java/org/apache/fop/render/ps/ResourceHandler.java
index 1a363c90e..bdd305164 100644
--- a/src/java/org/apache/fop/render/ps/ResourceHandler.java
+++ b/src/java/org/apache/fop/render/ps/ResourceHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -94,18 +94,18 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
* @throws DSCException If there's an error in the DSC structure of the PS file
* @throws IOException In case of an I/O error
*/
- public static void process(FOUserAgent userAgent, InputStream in, OutputStream out,
+ public static void process(FOUserAgent userAgent, InputStream in, OutputStream out,
FontInfo fontInfo, ResourceTracker resTracker, Map formResources,
int pageCount, Rectangle2D documentBoundingBox)
throws DSCException, IOException {
DSCParser parser = new DSCParser(in);
PSGenerator gen = new PSGenerator(out);
parser.setNestedDocumentHandler(new DefaultNestedDocumentHandler(gen));
-
+
//Skip DSC header
DSCHeaderComment header = DSCTools.checkAndSkipDSC30Header(parser);
header.generate(gen);
-
+
parser.setFilter(new DSCFilter() {
private final Set filtered = new java.util.HashSet();
{
@@ -141,15 +141,15 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
PSFontUtils.determineSuppliedFonts(resTracker, fontInfo, fontInfo.getUsedFonts());
registerSuppliedForms(resTracker, formResources);
-
+
//Supplied Resources
- DSCCommentDocumentSuppliedResources supplied
+ DSCCommentDocumentSuppliedResources supplied
= new DSCCommentDocumentSuppliedResources(
resTracker.getDocumentSuppliedResources());
supplied.generate(gen);
-
+
//Needed Resources
- DSCCommentDocumentNeededResources needed
+ DSCCommentDocumentNeededResources needed
= new DSCCommentDocumentNeededResources(
resTracker.getDocumentNeededResources());
needed.generate(gen);
@@ -167,7 +167,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
}
event.generate(gen);
}
-
+
//Skip to the FOPFontSetup
PostScriptComment fontSetupPlaceholder = parser.nextPSComment("FOPFontSetup", gen);
if (fontSetupPlaceholder == null) {
@@ -181,7 +181,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
if (pageOrTrailer == null) {
throw new DSCException("Page expected, but none found");
}
-
+
//Process individual pages (and skip as necessary)
while (true) {
DSCCommentPage page = (DSCCommentPage)pageOrTrailer;
@@ -194,7 +194,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
break;
}
}
-
+
//Write the rest
while (parser.hasNext()) {
DSCEvent event = parser.nextEvent();
@@ -218,7 +218,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
}
}
- private static void generateForms(ResourceTracker resTracker, FOUserAgent userAgent,
+ private static void generateForms(ResourceTracker resTracker, FOUserAgent userAgent,
Map formResources, PSGenerator gen) throws IOException {
if (formResources == null) {
return;
@@ -227,13 +227,13 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
while (iter.hasNext()) {
PSImageFormResource form = (PSImageFormResource)iter.next();
final String uri = form.getImageURI();
-
+
ImageManager manager = userAgent.getFactory().getImageManager();
ImageInfo info = null;
try {
ImageSessionContext sessionContext = userAgent.getImageSessionContext();
info = manager.getImageInfo(uri, sessionContext);
-
+
ImageFlavor[] flavors;
if (gen.getPSLevel() >= 3) {
flavors = LEVEL_3_FLAVORS_FORM;
@@ -243,7 +243,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, flavors, hints, sessionContext);
-
+
String imageDescription = info.getMimeType() + " " + info.getOriginalURI();
final Dimension2D dimensionsPt = info.getSize().getDimensionPt();
final Dimension2D dimensionsMpt = info.getSize().getDimensionMpt();
@@ -261,12 +261,12 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
PSGraphics2DAdapter adapter = new PSGraphics2DAdapter(gen, false);
adapter.paintImage(imageG2D.getGraphics2DImagePainter(),
null,
- 0, 0,
+ 0, 0,
(int)Math.round(dimensionsMpt.getWidth()),
(int)Math.round(dimensionsMpt.getHeight()));
gen.writeln("EndEPSF");
}
-
+
};
formGen.generate(gen);
} else if (img instanceof ImageRendered) {
@@ -349,9 +349,9 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
gen.writeln("1 0 lineto");
gen.writeln("stroke");
}
-
+
};
return formGen;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java b/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java
index 1eb1d9d13..a8bab26b6 100644
--- a/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java
@@ -30,17 +30,17 @@ public abstract class AbstractPSCommentElement extends AbstractPSExtensionElemen
/**
* Default constructor
- *
+ *
* @param parent parent of this node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public AbstractPSCommentElement(FONode parent) {
super(parent);
- }
-
+ }
+
/**
* @throws FOPException if there's a problem during processing
- * @see org.apache.fop.fo.FONode#startOfNode()
+ * @see org.apache.fop.fo.FONode#startOfNode()
*/
protected void startOfNode() throws FOPException {
if (parent.getNameId() != Constants.FO_DECLARATIONS
diff --git a/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java b/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java
index 31e44d2d2..14865a8c9 100644
--- a/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps.extensions;
// FOP
@@ -37,10 +37,10 @@ public abstract class AbstractPSExtensionElement extends FONode {
* extension attachment
*/
protected PSExtensionAttachment attachment;
-
+
/**
* Default constructor
- *
+ *
* @param parent parent of this node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
@@ -50,14 +50,14 @@ public abstract class AbstractPSExtensionElement extends FONode {
/**
* Blocks XSL FO's from having non-FO parents.
- *
+ *
* @param loc location in the FO source file
* @param nsURI namespace of incoming node
* @param localName (e.g. "table" for "fo:table")
* @throws ValidationException if incoming node not valid for parent
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -69,7 +69,7 @@ public abstract class AbstractPSExtensionElement extends FONode {
* @param data array of characters containing text to be added
* @param start starting array element to add
* @param length of data array to add
- * @param pList currently applicable PropertyList
+ * @param pList currently applicable PropertyList
* @param locator location in fo source file.
* @see org.apache.fop.fo.FONode#addCharacters(char[], int, int, PropertyList, Locator)
*/
@@ -92,7 +92,7 @@ public abstract class AbstractPSExtensionElement extends FONode {
public String getNamespaceURI() {
return PSExtensionElementMapping.NAMESPACE;
}
-
+
/**
* @return a String representation of this object
* @see org.apache.fop.fo.FONode#getNormalNamespacePrefix()
@@ -112,7 +112,7 @@ public abstract class AbstractPSExtensionElement extends FONode {
missingChildElementError("#PCDATA");
}
}
-
+
/**
* @return the extension attachment if one is created by the extension element, null otherwise.
* @see org.apache.fop.fo.FONode#getExtensionAttachment()
@@ -123,7 +123,7 @@ public abstract class AbstractPSExtensionElement extends FONode {
}
return this.attachment;
}
-
+
/**
* Instantiates extension attachment object
* @return extension attachment
diff --git a/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java b/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java
index 78b2f91eb..92108b551 100644
--- a/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java
+++ b/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps.extensions;
// FOP
@@ -35,7 +35,7 @@ import org.apache.fop.fo.extensions.ExtensionAttachment;
public abstract class AbstractPSExtensionObject extends FONode {
private PSSetupCode setupCode = new PSSetupCode();
-
+
/**
* Main constructor.
* @param parent the parent node
@@ -46,7 +46,7 @@ public abstract class AbstractPSExtensionObject extends FONode {
}
/** {@inheritDoc} */
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -69,14 +69,14 @@ public abstract class AbstractPSExtensionObject extends FONode {
public String getNamespaceURI() {
return PSExtensionElementMapping.NAMESPACE;
}
-
+
/**{@inheritDoc} */
public String getNormalNamespacePrefix() {
return "ps";
}
/** {@inheritDoc} */
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList)
throws FOPException {
String name = attlist.getValue("name");
@@ -88,12 +88,12 @@ public abstract class AbstractPSExtensionObject extends FONode {
/** {@inheritDoc} */
protected void endOfNode() throws FOPException {
super.endOfNode();
- String s = setupCode.getContent();
+ String s = setupCode.getContent();
if (s == null || s.length() == 0) {
missingChildElementError("#PCDATA");
}
}
-
+
/** {@inheritDoc} */
public ExtensionAttachment getExtensionAttachment() {
return this.setupCode;
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java b/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java
index d03a0220c..eb0f4d833 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,7 +39,7 @@ public class PSCommentAfterElement extends AbstractPSCommentElement {
}
/**
- * @return local name
+ * @return local name
* @see org.apache.fop.fo.FONode#getLocalName()
*/
public String getLocalName() {
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java b/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java
index d74d3a194..951e685b3 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -51,5 +51,5 @@ public class PSCommentBeforeElement extends AbstractPSCommentElement {
*/
protected ExtensionAttachment instantiateExtensionAttachment() {
return new PSCommentBefore();
- }
+ }
}
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionAttachment.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionAttachment.java
index 9da2b0911..efee86aa8 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionAttachment.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionAttachment.java
@@ -31,7 +31,7 @@ import org.apache.fop.fo.extensions.ExtensionAttachment;
* This is the pass-through value object for the PostScript extension.
*/
public abstract class PSExtensionAttachment implements ExtensionAttachment, XMLizable {
-
+
/** extension node content */
protected String content;
@@ -59,12 +59,12 @@ public abstract class PSExtensionAttachment implements ExtensionAttachment, XMLi
public String getCategory() {
return CATEGORY;
}
-
+
/** @return the content */
public String getContent() {
return content;
}
-
+
/**
* Sets the content for the setup code object.
* @param content The content to set.
@@ -72,10 +72,10 @@ public abstract class PSExtensionAttachment implements ExtensionAttachment, XMLi
public void setContent(String content) {
this.content = content;
}
-
+
/**
* Generates SAX events representing the object's state.
- *
+ *
* @param handler ContentHandler instance to send the SAX events to
* @throws SAXException if there's a problem generating the SAX events
* @see org.apache.xmlgraphics.util.XMLizable#toSAX(org.xml.sax.ContentHandler)
@@ -96,7 +96,7 @@ public abstract class PSExtensionAttachment implements ExtensionAttachment, XMLi
String className = getClass().getName();
return className.substring(className.lastIndexOf('.') + 3);
}
-
+
/**
* @return a string representation of this object
* @see java.lang.Object#toString()
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
index b23ff54da..2044385a8 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps.extensions;
import org.apache.fop.fo.FONode;
@@ -28,7 +28,7 @@ import org.apache.fop.fo.ElementMapping;
public class PSExtensionElementMapping extends ElementMapping {
/** Namespace for the extension */
- public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/postscript";
+ public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/postscript";
/** Main constructor */
public PSExtensionElementMapping() {
@@ -64,7 +64,7 @@ public class PSExtensionElementMapping extends ElementMapping {
return new PSSetPageDeviceElement(parent);
}
}
-
+
static class PSCommentBeforeMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PSCommentBeforeElement(parent);
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
index e69500736..dee918f19 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
@@ -32,7 +32,7 @@ import org.apache.fop.util.ContentHandlerFactory.ObjectBuiltListener;
/**
* ContentHandler (parser) for restoring PSExtension objects from XML.
*/
-public class PSExtensionHandler extends DefaultHandler
+public class PSExtensionHandler extends DefaultHandler
implements ContentHandlerFactory.ObjectSource {
/** Logger instance */
@@ -40,12 +40,12 @@ public class PSExtensionHandler extends DefaultHandler
private StringBuffer content = new StringBuffer();
private Attributes lastAttributes;
-
+
private PSExtensionAttachment returnedObject;
private ObjectBuiltListener listener;
-
+
/** {@inheritDoc} */
- public void startElement(String uri, String localName, String qName, Attributes attributes)
+ public void startElement(String uri, String localName, String qName, Attributes attributes)
throws SAXException {
boolean handled = false;
if (PSExtensionAttachment.CATEGORY.equals(uri)) {
@@ -61,10 +61,10 @@ public class PSExtensionHandler extends DefaultHandler
}
if (!handled) {
if (PSExtensionAttachment.CATEGORY.equals(uri)) {
- throw new SAXException("Unhandled element " + localName
+ throw new SAXException("Unhandled element " + localName
+ " in namespace: " + uri);
} else {
- log.warn("Unhandled element " + localName
+ log.warn("Unhandled element " + localName
+ " in namespace: " + uri);
}
}
@@ -78,13 +78,13 @@ public class PSExtensionHandler extends DefaultHandler
this.returnedObject = new PSSetupCode(name, content.toString());
} else if (PSSetPageDevice.ELEMENT.equals(localName)) {
String name = lastAttributes.getValue("name");
- this.returnedObject = new PSSetPageDevice(name, content.toString());
+ this.returnedObject = new PSSetPageDevice(name, content.toString());
} else if (PSCommentBefore.ELEMENT.equals(localName)) {
- this.returnedObject = new PSCommentBefore(content.toString());
+ this.returnedObject = new PSCommentBefore(content.toString());
} else if (PSCommentAfter.ELEMENT.equals(localName)) {
this.returnedObject = new PSCommentAfter(content.toString());
}
- }
+ }
content.setLength(0); //Reset text buffer (see characters())
}
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java
index 655c96260..d94e236f7 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java
@@ -28,7 +28,7 @@ import org.xml.sax.ContentHandler;
public class PSExtensionHandlerFactory implements ContentHandlerFactory {
private static final String[] NAMESPACES = new String[] {PSSetupCode.CATEGORY};
-
+
/** {@inheritDoc} */
public String[] getSupportedNamespaces() {
return NAMESPACES;
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java b/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
index 207c11e76..686667c3d 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
@@ -24,13 +24,13 @@ import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
/**
- * Extension element for fox:ps-page-setup-code.
+ * Extension element for fox:ps-page-setup-code.
*/
public class PSPageSetupCodeElement extends AbstractPSExtensionObject {
/** The element name */
protected static final String ELEMENT = "ps-page-setup-code";
-
+
/**
* Main constructor
* @param parent parent FO node
@@ -47,7 +47,7 @@ public class PSPageSetupCodeElement extends AbstractPSExtensionObject {
"rule.childOfSPM");
}
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return ELEMENT;
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java
index 28ea3c24c..8bdb2adc0 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java
@@ -62,12 +62,12 @@ public class PSSetPageDevice extends PSExtensionAttachment {
*/
public PSSetPageDevice() {
}
-
+
/** @return the name */
public String getName() {
return name;
}
-
+
/**
* Sets the name of the setup code object.
* @param name The name to set.
@@ -77,7 +77,7 @@ public class PSSetPageDevice extends PSExtensionAttachment {
}
/**
- * @return a string representation of this object
+ * @return a string representation of this object
* @see java.lang.Object#toString()
*/
public String toString() {
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java
index 21acc8001..6cdd1c60c 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java
@@ -29,7 +29,7 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.extensions.ExtensionAttachment;
/**
- * Extension element for ps:ps-setpagedevice.
+ * Extension element for ps:ps-setpagedevice.
*/
public class PSSetPageDeviceElement extends AbstractPSExtensionElement {
@@ -69,7 +69,7 @@ public class PSSetPageDeviceElement extends AbstractPSExtensionElement {
* @throws FOPException if there's a problem during processing
* @see org.apache.fop.fo.FONode#processNode
*/
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList)
throws FOPException {
String name = attlist.getValue("name");
@@ -79,7 +79,7 @@ public class PSSetPageDeviceElement extends AbstractPSExtensionElement {
}
/**
- * @return local name
+ * @return local name
* @see org.apache.fop.fo.FONode#getLocalName() */
public String getLocalName() {
return ELEMENT;
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java b/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
index eb3ed0e39..e2236629c 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
@@ -31,7 +31,7 @@ public class PSSetupCode extends PSExtensionAttachment {
* element name
*/
protected static final String ELEMENT = "ps-setup-code";
-
+
private static final String ATT_NAME = "name";
/**
@@ -44,7 +44,7 @@ public class PSSetupCode extends PSExtensionAttachment {
*/
public PSSetupCode() {
}
-
+
/**
* Default constructor.
* @param name the name of the setup code object, may be null
@@ -54,12 +54,12 @@ public class PSSetupCode extends PSExtensionAttachment {
super(content);
this.name = name;
}
-
+
/** @return the name */
public String getName() {
return name;
}
-
+
/**
* Sets the name of the setup code object.
* @param name The name to set.
@@ -72,7 +72,7 @@ public class PSSetupCode extends PSExtensionAttachment {
public String getCategory() {
return CATEGORY;
}
-
+
/** {@inheritDoc} */
public String toString() {
return "PSSetupCode(name=" + getName() + ", content='" + getContent() + "')";
@@ -85,7 +85,7 @@ public class PSSetupCode extends PSExtensionAttachment {
protected String getElement() {
return ELEMENT;
}
-
+
/** {@inheritDoc} */
public void toSAX(ContentHandler handler) throws SAXException {
AttributesImpl atts = new AttributesImpl();
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java b/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
index e76dfeb64..4ac0af2b7 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
@@ -24,13 +24,13 @@ import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
/**
- * Extension element for fox:ps-setup-code.
+ * Extension element for fox:ps-setup-code.
*/
public class PSSetupCodeElement extends AbstractPSExtensionObject {
/** The element name */
protected static final String ELEMENT = "ps-setup-code";
-
+
/**
* Main constructor
* @param parent parent FO node
@@ -38,7 +38,7 @@ public class PSSetupCodeElement extends AbstractPSExtensionObject {
public PSSetupCodeElement(FONode parent) {
super(parent);
}
-
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
@@ -47,10 +47,10 @@ public class PSSetupCodeElement extends AbstractPSExtensionObject {
"rule.childOfDeclarations");
}
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return ELEMENT;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java b/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
index 5d6a7f64e..216802c8f 100644
--- a/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,12 +42,12 @@ public final class BorderAttributesConverter {
*/
private BorderAttributesConverter() {
}
-
+
/**
- * Create a border control word in attributes, with border properties
+ * Create a border control word in attributes, with border properties
* as specified in color, style and width.
* @param border The CommonBorderPaddingBackground object.
- * @param side The START, END, BEFORE, AFTER enum from CommonBorderPaddingBackground.
+ * @param side The START, END, BEFORE, AFTER enum from CommonBorderPaddingBackground.
* @param attributes The attributes list to set the border control word.
* @param controlWord The border control word.
*/
@@ -61,18 +61,18 @@ public final class BorderAttributesConverter {
//division by 50 to convert millipoints to twips
attrs.set(IBorderAttributes.BORDER_WIDTH, border.getBorderWidth(side, false) / 50);
attributes.set(controlWord, attrs);
- //Don't set BORDER_SPACE, because it makes the table look quite broken:
+ //Don't set BORDER_SPACE, because it makes the table look quite broken:
//vertical and horizontal borders don't meet at corners.
//attrs.setTwips(IBorderAttributes.BORDER_SPACE, border.getPadding(side, false, null));
//attributes.set(controlWord, attrs);
} else {
// Here padding specified, but corresponding border is not available
-
+
// Padding in millipoints
double paddingPt = border.getPadding(side, false, null) / 1000.0;
// Padding in twips
int padding = (int) Math.round(paddingPt * FoUnitsConverter.POINT_TO_TWIPS);
-
+
// Add padding to corresponding space (space-before or space-after)
// if side == START or END, do nothing
if (side == CommonBorderPaddingBackground.BEFORE) {
diff --git a/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java b/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java
index 20100fb7d..0cfa3e0fe 100755
--- a/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable;
/**
- * A RtfAttributes subclass that adds some helper set methods.
+ * A RtfAttributes subclass that adds some helper set methods.
*/
public class FOPRtfAttributes extends RtfAttributes {
@@ -83,16 +83,16 @@ public class FOPRtfAttributes extends RtfAttributes {
}
private static class DummyPercentBaseContext implements PercentBaseContext {
-
+
static DummyPercentBaseContext singleton = new DummyPercentBaseContext();
-
+
private DummyPercentBaseContext() {
// noop
}
-
+
public int getBaseLength(int lengthBase, FObj fo) {
return 0;
}
}
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java b/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
index fa95b8502..caf11323f 100644
--- a/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
+++ b/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java b/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java
index 4131b814d..e778c902b 100644
--- a/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,13 +38,13 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
* Provides methods to convert list attributes to RtfAttributes.
*/
public final class ListAttributesConverter {
-
+
/**
* Constructor is private, because it's just a utility class.
*/
private ListAttributesConverter() {
}
-
+
/**
* Reads an FO object's properties and adds returns them as RtfAttributes.
* @param fobj FO object
@@ -53,12 +53,12 @@ public final class ListAttributesConverter {
*/
static RtfAttributes convertAttributes(ListBlock fobj)
throws FOPException {
-
+
FOPRtfAttributes attrib = new FOPRtfAttributes();
-
+
attrib.setTwips(RtfListTable.LIST_INDENT, fobj.getCommonMarginBlock().startIndent);
attrib.setTwips(RtfText.LEFT_INDENT_BODY, fobj.getCommonMarginBlock().endIndent);
-
+
/*
* set list table defaults
*/
@@ -67,7 +67,7 @@ public final class ListAttributesConverter {
attrib.set(RtfListTable.LIST, "simple");
//set following char as tab
attrib.set(RtfListTable.LIST_FOLLOWING_CHAR, 0);
-
+
return attrib;
}
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java b/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
index 50355e145..c7f97ef4f 100644
--- a/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,19 +46,19 @@ final class PageAttributesConverter {
*/
private PageAttributesConverter() {
}
-
+
/** convert xsl:fo attributes to RTF text attributes */
static RtfAttributes convertPageAttributes(SimplePageMaster pagemaster) {
FOPRtfAttributes attrib = new FOPRtfAttributes();
-
+
try {
RegionBA before = (RegionBA) pagemaster.getRegion(Constants.FO_REGION_BEFORE);
RegionBody body = (RegionBody) pagemaster.getRegion(Constants.FO_REGION_BODY);
RegionBA after = (RegionBA) pagemaster.getRegion(Constants.FO_REGION_AFTER);
-
+
attrib.setTwips(RtfPage.PAGE_WIDTH, pagemaster.getPageWidth());
attrib.setTwips(RtfPage.PAGE_HEIGHT, pagemaster.getPageHeight());
-
+
Object widthRaw = attrib.getValue(RtfPage.PAGE_WIDTH);
Object heightRaw = attrib.getValue(RtfPage.PAGE_HEIGHT);
if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer)
@@ -84,7 +84,7 @@ final class PageAttributesConverter {
bodyLeft = (Length) NumericOp.addition(pageLeft, bodyMargin.marginLeft);
bodyRight = (Length) NumericOp.addition(pageRight, bodyMargin.marginRight);
}
-
+
attrib.setTwips(RtfPage.MARGIN_TOP, bodyTop);
attrib.setTwips(RtfPage.MARGIN_BOTTOM, bodyBottom);
attrib.setTwips(RtfPage.MARGIN_LEFT, bodyLeft);
@@ -104,7 +104,7 @@ final class PageAttributesConverter {
}
attrib.setTwips(RtfPage.FOOTERY, beforeTop);
} catch (Exception e) {
- log.error("Exception in convertPageAttributes: "
+ log.error("Exception in convertPageAttributes: "
+ e.getMessage() + "- page attributes ignored");
attrib = new FOPRtfAttributes();
}
diff --git a/src/java/org/apache/fop/render/rtf/RTFEventProducer.java b/src/java/org/apache/fop/render/rtf/RTFEventProducer.java
index a2646af46..69058501f 100644
--- a/src/java/org/apache/fop/render/rtf/RTFEventProducer.java
+++ b/src/java/org/apache/fop/render/rtf/RTFEventProducer.java
@@ -34,7 +34,7 @@ public interface RTFEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -53,9 +53,9 @@ public interface RTFEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* The RTF handler only supports simple-page-masters.
* @param source the event source
@@ -64,7 +64,7 @@ public interface RTFEventProducer extends EventProducer {
* @event.severity WARN
*/
void onlySPMSupported(Object source, String masterReference, Locator loc);
-
+
/**
* No simple-page-master could be determined-
* @param source the event source
@@ -72,7 +72,7 @@ public interface RTFEventProducer extends EventProducer {
* @event.severity WARN
*/
void noSPMFound(Object source, Locator loc);
-
+
/**
* The RTF handler requires explicit table-columns for now.
* @param source the event source
@@ -80,7 +80,7 @@ public interface RTFEventProducer extends EventProducer {
* @event.severity WARN
*/
void explicitTableColumnsRequired(Object source, Locator loc);
-
+
/**
* The RTF handler ignored some deferred event (i.e. an unsupported element).
* @param source the event source
@@ -90,5 +90,5 @@ public interface RTFEventProducer extends EventProducer {
* @event.severity WARN
*/
void ignoredDeferredEvent(Object source, FONode node, boolean start, Locator loc);
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/RTFFOEventHandlerMaker.java b/src/java/org/apache/fop/render/rtf/RTFFOEventHandlerMaker.java
index a15d206ee..afcfbf702 100644
--- a/src/java/org/apache/fop/render/rtf/RTFFOEventHandlerMaker.java
+++ b/src/java/org/apache/fop/render/rtf/RTFFOEventHandlerMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,8 +35,8 @@ public class RTFFOEventHandlerMaker extends AbstractFOEventHandlerMaker {
MimeConstants.MIME_RTF,
MimeConstants.MIME_RTF_ALT1,
MimeConstants.MIME_RTF_ALT2};
-
-
+
+
/**
* {@inheritDoc}
* @param ua FOUserAgent
diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java
index 6171e68b4..1adba9e2b 100644
--- a/src/java/org/apache/fop/render/rtf/RTFHandler.java
+++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java
@@ -213,7 +213,7 @@ public class RTFHandler extends FOEventHandler {
RTFEventProducer eventProducer = RTFEventProducer.Provider.get(
getUserAgent().getEventBroadcaster());
eventProducer.onlySPMSupported(this, reference, pageSeq.getLocator());
- PageSequenceMaster master
+ PageSequenceMaster master
= pageSeq.getRoot().getLayoutMasterSet().getPageSequenceMaster(reference);
this.pagemaster = master.getNextSimplePageMaster(
false, false, false, false, false);
@@ -306,7 +306,7 @@ public class RTFHandler extends FOEventHandler {
contAfter.newAfter(attr);
}
handled = true;
- } else if (regionBefore != null
+ } else if (regionBefore != null
&& fl.getFlowName().equals(regionBefore.getRegionName())) {
bHeaderSpecified = true;
bPrevHeaderSpecified = true;
@@ -325,7 +325,7 @@ public class RTFHandler extends FOEventHandler {
RtfBefore before = c.newBefore(beforeAttributes);
builderContext.pushContainer(before);
handled = true;
- } else if (regionAfter != null
+ } else if (regionAfter != null
&& fl.getFlowName().equals(regionAfter.getRegionName())) {
bFooterSpecified = true;
bPrevFooterSpecified = true;
@@ -371,10 +371,10 @@ public class RTFHandler extends FOEventHandler {
Region regionAfter = pagemaster.getRegion(Constants.FO_REGION_AFTER);
if (fl.getFlowName().equals(regionBody.getRegionName())) {
//just do nothing
- } else if (regionBefore != null
+ } else if (regionBefore != null
&& fl.getFlowName().equals(regionBefore.getRegionName())) {
builderContext.popContainer();
- } else if (regionAfter != null
+ } else if (regionAfter != null
&& fl.getFlowName().equals(regionAfter.getRegionName())) {
builderContext.popContainer();
}
@@ -514,15 +514,15 @@ public class RTFHandler extends FOEventHandler {
final IRtfTableContainer tc
= (IRtfTableContainer)builderContext.getContainer(
IRtfTableContainer.class, true, null);
-
+
RtfAttributes atts
= TableAttributesConverter.convertTableAttributes(tbl);
-
+
RtfTable table = tc.newTable(atts, tableContext);
-
+
CommonBorderPaddingBackground border = tbl.getCommonBorderPaddingBackground();
RtfAttributes borderAttributes = new RtfAttributes();
-
+
BorderAttributesConverter.makeBorder(border, CommonBorderPaddingBackground.BEFORE,
borderAttributes, ITableAttributes.CELL_BORDER_TOP);
BorderAttributesConverter.makeBorder(border, CommonBorderPaddingBackground.AFTER,
@@ -531,9 +531,9 @@ public class RTFHandler extends FOEventHandler {
borderAttributes, ITableAttributes.CELL_BORDER_LEFT);
BorderAttributesConverter.makeBorder(border, CommonBorderPaddingBackground.END,
borderAttributes, ITableAttributes.CELL_BORDER_RIGHT);
-
+
table.setBorderAttributes(borderAttributes);
-
+
builderContext.pushContainer(table);
} catch (IOException ioe) {
handleIOTrouble(ioe);
@@ -576,16 +576,16 @@ public class RTFHandler extends FOEventHandler {
* rest of the document will be rendered. Usage of the
* TableLayoutManager is not welcome due to design reasons and
* it also does not provide the correct values.
- * TODO: Make proportional-column-width working for rtf output
+ * TODO: Make proportional-column-width working for rtf output
*/
SimplePercentBaseContext context
= new SimplePercentBaseContext(null,
LengthBase.TABLE_UNITS,
100000);
-
+
Integer iWidth
= new Integer(tc.getColumnWidth().getValue(context) / 1000);
-
+
String strWidth = iWidth.toString() + FixedLength.POINT;
Float width = new Float(
FoUnitsConverter.getInstance().convertToTwips(strWidth));
@@ -708,7 +708,7 @@ public class RTFHandler extends FOEventHandler {
} catch (Exception e) {
log.error("startPart: " + e.getMessage());
throw new RuntimeException(e.getMessage());
- }
+ }
}
private void endPart(TablePart tb) {
@@ -724,10 +724,10 @@ public class RTFHandler extends FOEventHandler {
} catch (Exception e) {
log.error("endPart: " + e.getMessage());
throw new RuntimeException(e.getMessage());
- }
+ }
}
-
+
/**
* {@inheritDoc}
*/
@@ -735,7 +735,7 @@ public class RTFHandler extends FOEventHandler {
startPart(body);
}
-
+
/**
* {@inheritDoc}
*/
@@ -782,7 +782,7 @@ public class RTFHandler extends FOEventHandler {
if (bDefer) {
return;
}
-
+
try {
TableContext tctx = builderContext.getTableContext();
final RtfTableRow row = (RtfTableRow)builderContext.getContainer(RtfTableRow.class,
@@ -795,11 +795,11 @@ public class RTFHandler extends FOEventHandler {
RtfTableCell vCell = row.newTableCellMergedVertically(
(int)tctx.getColumnWidth(),
tctx.getColumnRowSpanningAttrs());
-
+
if (!tctx.getFirstSpanningCol()) {
vCell.setHMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
}
-
+
tctx.selectNextColumn();
}
} catch (IOException ioe) {
@@ -837,11 +837,11 @@ public class RTFHandler extends FOEventHandler {
RtfTableCell vCell = row.newTableCellMergedVertically(
(int)tctx.getColumnWidth(),
tctx.getColumnRowSpanningAttrs());
-
+
if (!tctx.getFirstSpanningCol()) {
vCell.setHMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
}
-
+
tctx.selectNextColumn();
}
@@ -851,14 +851,14 @@ public class RTFHandler extends FOEventHandler {
// create an RtfTableCell in the current RtfTableRow
RtfAttributes atts = TableAttributesConverter.convertCellAttributes(tc);
RtfTableCell cell = row.newTableCell((int)width, atts);
-
+
//process number-rows-spanned attribute
if (numberRowsSpanned > 1) {
// Start vertical merge
cell.setVMerge(RtfTableCell.MERGE_START);
// set the number of rows spanned
- tctx.setCurrentColumnRowSpanning(new Integer(numberRowsSpanned),
+ tctx.setCurrentColumnRowSpanning(new Integer(numberRowsSpanned),
cell.getRtfAttributes());
} else {
tctx.setCurrentColumnRowSpanning(
@@ -870,23 +870,23 @@ public class RTFHandler extends FOEventHandler {
// Get the number of columns spanned
RtfTable table = row.getTable();
tctx.setCurrentFirstSpanningCol(true);
-
+
// We widthdraw one cell because the first cell is already created
// (it's the current cell) !
for (int i = 0; i < numberColumnsSpanned - 1; ++i) {
tctx.selectNextColumn();
-
+
tctx.setCurrentFirstSpanningCol(false);
RtfTableCell hCell = row.newTableCellMergedHorizontally(
0, null);
-
+
if (numberRowsSpanned > 1) {
// Start vertical merge
hCell.setVMerge(RtfTableCell.MERGE_START);
// set the number of rows spanned
tctx.setCurrentColumnRowSpanning(
- new Integer(numberRowsSpanned),
+ new Integer(numberRowsSpanned),
cell.getRtfAttributes());
} else {
tctx.setCurrentColumnRowSpanning(
@@ -894,7 +894,7 @@ public class RTFHandler extends FOEventHandler {
}
}
}
-
+
builderContext.pushContainer(cell);
} catch (IOException ioe) {
handleIOTrouble(ioe);
@@ -962,12 +962,12 @@ public class RTFHandler extends FOEventHandler {
if (bDefer) {
return;
}
-
+
// create an RtfListItem in the current RtfList
try {
RtfList list = (RtfList)builderContext.getContainer(
RtfList.class, true, this);
-
+
/**
* If the current list already contains a list item, then close the
* list and open a new one, so every single list item gets its own
@@ -981,11 +981,11 @@ public class RTFHandler extends FOEventHandler {
this.endList((ListBlock) li.getParent());
this.startList((ListBlock) li.getParent());
this.startListBody();
-
+
list = (RtfList)builderContext.getContainer(
RtfList.class, true, this);
- }
-
+ }
+
builderContext.pushContainer(list.newListItem());
} catch (IOException ioe) {
handleIOTrouble(ioe);
@@ -1136,7 +1136,7 @@ public class RTFHandler extends FOEventHandler {
FOUserAgent userAgent = eg.getUserAgent();
ImageManager manager = userAgent.getFactory().getImageManager();
info = manager.getImageInfo(uri, userAgent.getImageSessionContext());
-
+
putGraphic(eg, info);
} catch (ImageException ie) {
ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
@@ -1160,18 +1160,18 @@ public class RTFHandler extends FOEventHandler {
if (bDefer) {
return;
}
-
+
try {
XMLObj child = (XMLObj) ifo.getChildXMLObj();
Document doc = child.getDOMDocument();
String ns = child.getNamespaceURI();
-
+
ImageInfo info = new ImageInfo(null, null);
// Set the resolution to that of the FOUserAgent
FOUserAgent ua = ifo.getUserAgent();
ImageSize size = new ImageSize();
size.setResolution(ua.getSourceResolution());
-
+
// Set the image size to the size of the svg.
Point2D csize = new Point2D.Float(-1, -1);
Point2D intrinsicDimensions = child.getDimension(csize);
@@ -1188,12 +1188,12 @@ public class RTFHandler extends FOEventHandler {
info.setSize(size);
ImageXMLDOM image = new ImageXMLDOM(info, doc, ns);
-
+
FOUserAgent userAgent = ifo.getUserAgent();
ImageManager manager = userAgent.getFactory().getImageManager();
Image converted = manager.convertImage(image, FLAVORS);
putGraphic(ifo, converted);
-
+
} catch (ImageException ie) {
ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
getUserAgent().getEventBroadcaster());
@@ -1208,14 +1208,14 @@ public class RTFHandler extends FOEventHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_EMF, ImageFlavor.RAW_PNG, ImageFlavor.RAW_JPEG
};
-
+
/**
* Puts a graphic/image into the generated RTF file.
* @param abstractGraphic the graphic (external-graphic or instream-foreign-object)
* @param info the image info object
* @throws IOException In case of an I/O error
*/
- private void putGraphic(AbstractGraphics abstractGraphic, ImageInfo info)
+ private void putGraphic(AbstractGraphics abstractGraphic, ImageInfo info)
throws IOException {
try {
FOUserAgent userAgent = abstractGraphic.getUserAgent();
@@ -1231,17 +1231,17 @@ public class RTFHandler extends FOEventHandler {
eventProducer.imageError(this, null, ie, null);
}
}
-
+
/**
* Puts a graphic/image into the generated RTF file.
* @param abstractGraphic the graphic (external-graphic or instream-foreign-object)
* @param image the image
* @throws IOException In case of an I/O error
*/
- private void putGraphic(AbstractGraphics abstractGraphic, Image image)
+ private void putGraphic(AbstractGraphics abstractGraphic, Image image)
throws IOException {
byte[] rawData = null;
-
+
ImageInfo info = image.getInfo();
if (image instanceof ImageRawStream) {
@@ -1266,7 +1266,7 @@ public class RTFHandler extends FOEventHandler {
IRtfTextrunContainer.class, true, this);
final RtfExternalGraphic rtfGraphic = c.getTextrun().newImage();
-
+
//set URL
if (info.getOriginalURI() != null) {
rtfGraphic.setURL(info.getOriginalURI());
@@ -1341,7 +1341,7 @@ public class RTFHandler extends FOEventHandler {
}
}
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
index a28d91d36..764c2c93e 100644
--- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -64,7 +64,7 @@ public final class TableAttributesConverter {
//////////////////////////////////////////////////
/**
* Converts table-only attributes to rtf attributes.
- *
+ *
* @param attrs Given attributes
* @param defaultAttributes Default rtf attributes
*
@@ -75,14 +75,14 @@ public final class TableAttributesConverter {
static RtfAttributes convertTableAttributes(Table fobj)
throws FOPException {
FOPRtfAttributes attrib = new FOPRtfAttributes();
- attrib.setTwips(ITableAttributes.ATTR_ROW_LEFT_INDENT,
+ attrib.setTwips(ITableAttributes.ATTR_ROW_LEFT_INDENT,
fobj.getCommonMarginBlock().marginLeft);
return attrib;
}
/**
* Converts table-only attributes to rtf attributes.
- *
+ *
* @param attrs Given attributes
* @param defaultAttributes Default rtf attributes
*
@@ -109,7 +109,7 @@ public final class TableAttributesConverter {
//Property p;
//RtfColorTable colorTable = RtfColorTable.getInstance();
-
+
FOPRtfAttributes attrib = new FOPRtfAttributes();
//boolean isBorderPresent = false;
@@ -121,7 +121,7 @@ public final class TableAttributesConverter {
//If there is no background-color specified for the cell,
//then try to read it from table-row or table-header.
CommonBorderPaddingBackground brd = null;
-
+
if (fobj.getParent() instanceof TableRow) {
TableRow parentRow = (TableRow)fobj.getParent();
brd = parentRow.getCommonBorderPaddingBackground();
@@ -131,20 +131,20 @@ public final class TableAttributesConverter {
brd = parentHeader.getCommonBorderPaddingBackground();
color = brd.backgroundColor;
}
-
+
if (color == null
- && fobj.getParent() != null
- && fobj.getParent().getParent() != null
+ && fobj.getParent() != null
+ && fobj.getParent().getParent() != null
&& fobj.getParent().getParent().getParent() instanceof Table) {
Table table = (Table)fobj.getParent().getParent().getParent();
brd = table.getCommonBorderPaddingBackground();
color = brd.backgroundColor;
}
-
-
+
+
}
- if ((color != null)
+ if ((color != null)
&& (color.getAlpha() != 0
|| color.getRed() != 0
|| color.getGreen() != 0
@@ -198,13 +198,13 @@ public final class TableAttributesConverter {
attrib.setTwips(ITableAttributes.ATTR_CELL_PADDING_BOTTOM, padding);
attrib.set(ITableAttributes.ATTR_CELL_U_PADDING_BOTTOM, 3 /*=twips*/);
}
-
+
int n = fobj.getNumberColumnsSpanned();
// Column spanning :
if (n > 1) {
attrib.set(ITableAttributes.COLUMN_SPAN, n);
}
-
+
switch (fobj.getDisplayAlign()) {
case Constants.EN_BEFORE:
attrib.set(ITableAttributes.ATTR_CELL_VERT_ALIGN_TOP);
@@ -328,7 +328,7 @@ public final class TableAttributesConverter {
isBorderPresent = true;
}
- //Currently there is only one border width supported in each cell.
+ //Currently there is only one border width supported in each cell.
p = fobj.getProperty(Constants.PR_BORDER_LEFT_WIDTH);
if(p == null) {
p = fobj.getProperty(Constants.PR_BORDER_RIGHT_WIDTH);
diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
index d40c6a826..792193b15 100644
--- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,13 +52,13 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
* @author rmarra
*/
final class TextAttributesConverter {
-
+
/**
* Constructor is private, because it's just a utility class.
*/
private TextAttributesConverter() {
}
-
+
/**
* Converts all known text FO properties to RtfAttributes
* @param props list of FO properites, which are to be converted
@@ -106,7 +106,7 @@ final class TextAttributesConverter {
attrBaseLineShift(fobj.getBaseLineShift(), attrib);
return attrib;
}
-
+
/**
* Converts all character related FO properties to RtfAttributes.
* @param fobj FObj whose properties are to be converted
@@ -150,7 +150,7 @@ final class TextAttributesConverter {
} else {
rtfAttr.set("b", 0);
}
-
+
if (font.getFontStyle() == Constants.EN_ITALIC) {
rtfAttr.set(RtfText.ATTR_ITALIC, 1);
} else {
@@ -176,20 +176,20 @@ final class TextAttributesConverter {
- private static void attrTextDecoration(CommonTextDecoration textDecoration,
+ private static void attrTextDecoration(CommonTextDecoration textDecoration,
RtfAttributes rtfAttr) {
if (textDecoration == null) {
rtfAttr.set(RtfText.ATTR_UNDERLINE, 0);
rtfAttr.set(RtfText.ATTR_STRIKETHROUGH, 0);
return;
}
-
+
if (textDecoration.hasUnderline()) {
rtfAttr.set(RtfText.ATTR_UNDERLINE, 1);
} else {
rtfAttr.set(RtfText.ATTR_UNDERLINE, 0);
}
-
+
if (textDecoration.hasLineThrough()) {
rtfAttr.set(RtfText.ATTR_STRIKETHROUGH, 1);
} else {
@@ -198,9 +198,9 @@ final class TextAttributesConverter {
}
private static void attrBlockMargin(CommonMarginBlock cmb, FOPRtfAttributes rtfAttr) {
- rtfAttr.setTwips(RtfText.SPACE_BEFORE,
+ rtfAttr.setTwips(RtfText.SPACE_BEFORE,
cmb.spaceBefore.getOptimum(null).getLength());
- rtfAttr.setTwips(RtfText.SPACE_AFTER,
+ rtfAttr.setTwips(RtfText.SPACE_AFTER,
cmb.spaceAfter.getOptimum(null).getLength());
rtfAttr.setTwips(RtfText.LEFT_INDENT_BODY, cmb.startIndent);
rtfAttr.setTwips(RtfText.RIGHT_INDENT_BODY, cmb.endIndent);
@@ -283,20 +283,20 @@ final class TextAttributesConverter {
CommonBorderPaddingBackground commonBorderPaddingBackground = null;
if (node instanceof Block) {
Block block = (Block) node;
- commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
- } else if (node instanceof BlockContainer) {
+ commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
+ } else if (node instanceof BlockContainer) {
BlockContainer container = (BlockContainer) node;
commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
- }
+ }
- if (commonBorderPaddingBackground != null
+ if (commonBorderPaddingBackground != null
&& commonBorderPaddingBackground.hasBorder()) {
return true;
}
node = node.getParent();
}
- return false;
+ return false;
}
/** Adds inline border information from
* Chars of string map in turn.
- *
+ *
* @param row x coordinate
* @param col y coordinate
* @param s string to add
@@ -181,7 +181,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Render TextArea to Text.
- *
+ *
* @param area inline area to render
*/
protected void renderText(TextArea area) {
@@ -211,7 +211,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
pageWidth = Helper.ceilPosition((int) width, CHAR_WIDTH);
pageHeight = Helper.ceilPosition((int) height, CHAR_HEIGHT);
-
+
// init buffers
charData = new StringBuffer[pageHeight];
decoData = new StringBuffer[pageHeight];
@@ -229,8 +229,8 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Projects current page borders (i.e. KEY_AUTO_FONTS to disable the auto-detection of fonts installed in the system.
* The PDF Transcoder cannot use AWT's font subsystem and that's why the fonts have to be
* configured differently. By default, font auto-detection is enabled to match the behaviour
@@ -93,25 +93,25 @@ public class PDFTranscoder extends AbstractFOPTranscoder
/**
* The key is used to specify the resolution for on-the-fly images generated
- * due to complex effects like gradients and filters.
+ * due to complex effects like gradients and filters.
*/
public static final TranscodingHints.Key KEY_DEVICE_RESOLUTION = new FloatKey();
/**
* The key is used to specify whether the available fonts should be automatically
* detected. The alternative is to configure the transcoder manually using a configuration
- * file.
+ * file.
*/
public static final TranscodingHints.Key KEY_AUTO_FONTS = new BooleanKey();
private Configuration cfg = null;
-
+
/** Graphics2D instance that is used to paint to */
protected PDFDocumentGraphics2D graphics = null;
private ImageManager imageManager;
private ImageSessionContext imageSessionContext;
-
+
/**
* Constructs a new PDFTranscoder.
*/
@@ -132,7 +132,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder
}
};
}
-
+
/** {@inheritDoc} */
public void configure(Configuration cfg) throws ConfigurationException {
this.cfg = cfg;
@@ -147,21 +147,21 @@ public class PDFTranscoder extends AbstractFOPTranscoder
* @exception TranscoderException if an error occured while transcoding
*/
protected void transcode(Document document, String uri,
- TranscoderOutput output)
+ TranscoderOutput output)
throws TranscoderException {
graphics = new PDFDocumentGraphics2D(isTextStroked());
- graphics.getPDFDocument().getInfo().setProducer("Apache FOP Version "
- + Version.getVersion()
+ graphics.getPDFDocument().getInfo().setProducer("Apache FOP Version "
+ + Version.getVersion()
+ ": PDF Transcoder for Batik");
if (hints.containsKey(KEY_DEVICE_RESOLUTION)) {
graphics.setDeviceDPI(((Float)hints.get(KEY_DEVICE_RESOLUTION)).floatValue());
}
-
+
setupImageInfrastructure(uri);
-
+
try {
- Configuration effCfg = this.cfg;
+ Configuration effCfg = this.cfg;
if (effCfg == null) {
//By default, enable font auto-detection if no cfg is given
boolean autoFonts = true;
@@ -177,7 +177,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder
effCfg = c;
}
}
-
+
if (effCfg != null) {
PDFDocumentGraphics2DConfigurator configurator
= new PDFDocumentGraphics2DConfigurator();
@@ -195,14 +195,14 @@ public class PDFTranscoder extends AbstractFOPTranscoder
if (getLogger().isTraceEnabled()) {
getLogger().trace("document size: " + width + " x " + height);
}
-
+
// prepare the image to be painted
- UnitProcessor.Context uctx = UnitProcessor.createContext(ctx,
+ UnitProcessor.Context uctx = UnitProcessor.createContext(ctx,
document.getDocumentElement());
- float widthInPt = UnitProcessor.userSpaceToSVG(width, SVGLength.SVG_LENGTHTYPE_PT,
+ float widthInPt = UnitProcessor.userSpaceToSVG(width, SVGLength.SVG_LENGTHTYPE_PT,
UnitProcessor.HORIZONTAL_LENGTH, uctx);
int w = (int)(widthInPt + 0.5);
- float heightInPt = UnitProcessor.userSpaceToSVG(height, SVGLength.SVG_LENGTHTYPE_PT,
+ float heightInPt = UnitProcessor.userSpaceToSVG(height, SVGLength.SVG_LENGTHTYPE_PT,
UnitProcessor.HORIZONTAL_LENGTH, uctx);
int h = (int)(heightInPt + 0.5);
if (getLogger().isTraceEnabled()) {
@@ -271,7 +271,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder
return null;
}
}
-
+
};
}
@@ -291,5 +291,5 @@ public class PDFTranscoder extends AbstractFOPTranscoder
this.imageManager, this.imageSessionContext);
return ctx;
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/SVGEventProducer.java b/src/java/org/apache/fop/svg/SVGEventProducer.java
index 8894f3f58..27d7da215 100644
--- a/src/java/org/apache/fop/svg/SVGEventProducer.java
+++ b/src/java/org/apache/fop/svg/SVGEventProducer.java
@@ -31,7 +31,7 @@ public interface SVGEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -51,7 +51,7 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity ERROR
*/
void error(Object source, String message, Exception e);
-
+
/**
* Alert during SVG processing.
* @param source the event source
@@ -59,7 +59,7 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity WARN
*/
void alert(Object source, String message);
-
+
/**
* Info during SVG processing.
* @param source the event source
@@ -67,7 +67,7 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity INFO
*/
void info(Object source, String message);
-
+
/**
* SVG graphic could not be built due to an exception.
* @param source the event source
@@ -76,7 +76,7 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity ERROR
*/
void svgNotBuilt(Object source, Exception e, String uri);
-
+
/**
* SVG graphic could not be rendered due to an exception.
* @param source the event source
@@ -85,5 +85,5 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity ERROR
*/
void svgRenderingError(Object source, Exception e, String uri);
-
+
}
diff --git a/src/java/org/apache/fop/svg/SVGUserAgent.java b/src/java/org/apache/fop/svg/SVGUserAgent.java
index 8d7754fcb..65a581776 100644
--- a/src/java/org/apache/fop/svg/SVGUserAgent.java
+++ b/src/java/org/apache/fop/svg/SVGUserAgent.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.geom.AffineTransform;
@@ -27,7 +27,7 @@ import org.apache.fop.apps.FOUserAgent;
* The SVG user agent. This is an implementation of the Batik SVG user agent.
*/
public class SVGUserAgent extends SimpleSVGUserAgent {
-
+
private SVGEventProducer eventProducer;
private Exception lastException;
@@ -48,7 +48,7 @@ public class SVGUserAgent extends SimpleSVGUserAgent {
public SVGUserAgent(FOUserAgent foUserAgent) {
this(foUserAgent, new AffineTransform());
}
-
+
/**
* Returns the last exception sent to the {@link #displayError(Exception)} method.
* @return the last exception or null if no exception occurred
diff --git a/src/java/org/apache/fop/svg/SVGUtilities.java b/src/java/org/apache/fop/svg/SVGUtilities.java
index 1ea11465b..cb07ab1f1 100644
--- a/src/java/org/apache/fop/svg/SVGUtilities.java
+++ b/src/java/org/apache/fop/svg/SVGUtilities.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java b/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java
index 4df1af34e..2b27945a4 100644
--- a/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java
+++ b/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.Dimension;
@@ -33,7 +33,7 @@ import org.apache.batik.bridge.UserAgentAdapter;
* by Batik.
*/
public class SimpleSVGUserAgent extends UserAgentAdapter {
-
+
private AffineTransform currentTransform = null;
private float pixelUnitToMillimeter = 0.0f;
@@ -46,7 +46,7 @@ public class SimpleSVGUserAgent extends UserAgentAdapter {
pixelUnitToMillimeter = pixelUnitToMM;
currentTransform = at;
}
-
+
/**
* Returns a customized the pixel to mm factor.
* @return the pixel unit to millimeter conversion factor
diff --git a/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java b/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java
index 94e018c75..15f3434d9 100644
--- a/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java
+++ b/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java
@@ -1,13 +1,13 @@
-/*
+/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -48,8 +48,8 @@ public class LineBreakStatus {
public LineBreakStatus() {
reset();
}
-
-
+
+
/**
* Reset the status.
* This method will reset the status to the initial state. It is meant
@@ -63,44 +63,44 @@ public class LineBreakStatus {
/**
* Check whether a line break may happen according to the rules described in
* the Unicode Line Breaking Algorithm.
- * The function returns the line breaking status of the point before the given character.
- * The algorithm is the table-driven algorithm, as described in
+ * The function returns the line breaking status of the point before the given character.
+ * The algorithm is the table-driven algorithm, as described in
*
* Unicode Technical Report #14.
* The pair table is taken from {@link LineBreakUtils}.
- *
+ *
* TODO: Better handling for AI, SA, SG and XX line break classes.
- *
+ *
* @param c the character to check
* @return the break action to be taken
- * one of: {@link #DIRECT_BREAK},
- * {@link #INDIRECT_BREAK},
- * {@link #COMBINING_INDIRECT_BREAK},
+ * one of: {@link #DIRECT_BREAK},
+ * {@link #INDIRECT_BREAK},
+ * {@link #COMBINING_INDIRECT_BREAK},
* {@link #COMBINING_PROHIBITED_BREAK},
* {@link #PROHIBITED_BREAK},
* {@link #EXPLICIT_BREAK}
*/
public byte nextChar(char c) {
-
+
byte currentClass = LineBreakUtils.getLineBreakProperty(c);
-
+
/* Initial conversions */
switch (currentClass) {
case LineBreakUtils.LINE_BREAK_PROPERTY_AI:
case LineBreakUtils.LINE_BREAK_PROPERTY_SG:
case LineBreakUtils.LINE_BREAK_PROPERTY_XX:
- // LB 1: Resolve AI, ... SG and XX into other line breaking classes
+ // LB 1: Resolve AI, ... SG and XX into other line breaking classes
// depending on criteria outside the scope of this algorithm.
- // In the absence of such criteria, it is recommended that
+ // In the absence of such criteria, it is recommended that
// classes AI, ... SG and XX be resolved to AL
currentClass = LineBreakUtils.LINE_BREAK_PROPERTY_AL;
break;
-
+
case LineBreakUtils.LINE_BREAK_PROPERTY_SA:
- // LB 1: Resolve ... SA ... into other line breaking classes
+ // LB 1: Resolve ... SA ... into other line breaking classes
// depending on criteria outside the scope of this algorithm.
- // In the absence of such criteria, it is recommended that
- // ... SA be resolved to AL, except that characters of
+ // In the absence of such criteria, it is recommended that
+ // ... SA be resolved to AL, except that characters of
// class SA that have General_Category Mn or Mc be resolved to CM
switch (Character.getType(c)) {
case Character.COMBINING_SPACING_MARK: //General_Category "Mc"
@@ -110,11 +110,11 @@ public class LineBreakStatus {
default:
currentClass = LineBreakUtils.LINE_BREAK_PROPERTY_AL;
}
-
+
default:
//nop
}
-
+
/* Check 1: First character or initial character after a reset/mandatory break? */
switch (leftClass) {
case -1:
@@ -126,7 +126,7 @@ public class LineBreakStatus {
}
// LB 2: Never break at the start of text
return PROHIBITED_BREAK;
-
+
case LineBreakUtils.LINE_BREAK_PROPERTY_BK:
case LineBreakUtils.LINE_BREAK_PROPERTY_LF:
case LineBreakUtils.LINE_BREAK_PROPERTY_NL:
@@ -136,9 +136,9 @@ public class LineBreakStatus {
reset();
leftClass = currentClass;
return EXPLICIT_BREAK;
-
+
case LineBreakUtils.LINE_BREAK_PROPERTY_CR:
- //first character after a carriage return:
+ //first character after a carriage return:
// LB 5: Treat CR followed by LF, as well as CR ... as hard line breaks
// If current is LF, then fall through to Check 2 (see below),
// and the hard break will be signaled for the character after LF (see above)
@@ -147,11 +147,11 @@ public class LineBreakStatus {
leftClass = currentClass;
return EXPLICIT_BREAK;
}
-
+
default:
//nop
}
-
+
/* Check 2: current is a mandatory break or space? */
switch (currentClass) {
case LineBreakUtils.LINE_BREAK_PROPERTY_BK:
@@ -161,17 +161,17 @@ public class LineBreakStatus {
// LB 6: Do not break before a hard break
leftClass = currentClass;
return PROHIBITED_BREAK;
-
+
case LineBreakUtils.LINE_BREAK_PROPERTY_SP:
// LB 7: Do not break before spaces ...
// Zero-width spaces are in the pair-table (see below)
hadSpace = true;
return PROHIBITED_BREAK;
-
+
default:
//nop
}
-
+
/* Normal treatment, if the first two checks did not return */
boolean savedHadSpace = hadSpace;
hadSpace = false;
@@ -181,7 +181,7 @@ public class LineBreakStatus {
case DIRECT_BREAK:
leftClass = currentClass;
return breakAction;
-
+
case INDIRECT_BREAK:
leftClass = currentClass;
if (savedHadSpace) {
@@ -189,7 +189,7 @@ public class LineBreakStatus {
} else {
return PROHIBITED_BREAK;
}
-
+
case COMBINING_INDIRECT_BREAK:
if (savedHadSpace) {
leftClass = currentClass;
@@ -197,19 +197,19 @@ public class LineBreakStatus {
} else {
return PROHIBITED_BREAK;
}
-
+
case COMBINING_PROHIBITED_BREAK:
if (savedHadSpace) {
leftClass = currentClass;
}
return COMBINING_PROHIBITED_BREAK;
-
+
default:
assert false;
return breakAction;
}
}
-
+
/**
* for debugging only
*/
diff --git a/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java b/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java
index 5e84e1004..49557a6c9 100644
--- a/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java
+++ b/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,10 +19,10 @@
package org.apache.fop.text.linebreak;
-/*
- * !!! THIS IS A GENERATED FILE !!!
+/*
+ * !!! THIS IS A GENERATED FILE !!!
* If updates to the source are needed, then:
- * - apply the necessary modifications to
+ * - apply the necessary modifications to
* 'src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java'
* - run 'ant codegen-unicode', which will generate a new LineBreakUtils.java
* in 'src/java/org/apache/fop/text/linebreak'
@@ -45,41 +45,41 @@ public final class LineBreakUtils {
public static final byte EXPLICIT_BREAK = 5;
private static final byte PAIR_TABLE[][] = {
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 4, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 4, 1, 0, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 0, 1, 4, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 4, 4, 4, 4, 0, 0, 4, 3, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 4, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 4, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 4, 1, 0, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 0, 1, 4, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 4, 4, 4, 4, 0, 0, 4, 3, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 4, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}};
private static byte lineBreakProperties[][] = new byte[512][];
@@ -680,8 +680,8 @@ public final class LineBreakUtils {
/** Linebreak property constant */
public static final byte LINE_BREAK_PROPERTY_ZW = 36;
- private static String lineBreakPropertyShortNames[] = {"AI", "AL", "B2", "BA", "BB", "BK", "CB", "CL", "CM", "CR", "EX",
- "GL", "H2", "H3", "HY", "ID", "IN", "IS", "JL", "JT", "JV", "LF", "NL", "NS", "NU", "OP", "PO", "PR", "QU", "SA", "SG", "SP",
+ private static String lineBreakPropertyShortNames[] = {"AI", "AL", "B2", "BA", "BB", "BK", "CB", "CL", "CM", "CR", "EX",
+ "GL", "H2", "H3", "HY", "ID", "IN", "IS", "JL", "JT", "JV", "LF", "NL", "NS", "NU", "OP", "PO", "PR", "QU", "SA", "SG", "SP",
"SY", "WJ", "XX", "ZW"};
private static String lineBreakPropertyLongNames[] = {"Ambiguous","Alphabetic","Break_Both","Break_After","Break_Before",
@@ -691,7 +691,7 @@ public final class LineBreakUtils {
"Surrogate","Space","Break_Symbols","Word_Joiner","Unknown","ZWSpace"};
/**
- * Return the short name for the linebreak property corresponding
+ * Return the short name for the linebreak property corresponding
* to the given symbolic constant.
*
* @param i the numeric value of the linebreak property
@@ -706,7 +706,7 @@ public final class LineBreakUtils {
}
/**
- * Return the long name for the linebreak property corresponding
+ * Return the long name for the linebreak property corresponding
* to the given symbolic constant.
*
* @param i the numeric value of the linebreak property
@@ -731,7 +731,7 @@ public final class LineBreakUtils {
}
/**
- * Return the break class constant for the given pair of linebreak
+ * Return the break class constant for the given pair of linebreak
* property constants.
*
* @param lineBreakPropertyBefore the linebreak property for the first character
diff --git a/src/java/org/apache/fop/tools/TestConverter.java b/src/java/org/apache/fop/tools/TestConverter.java
index 5cbd3c095..0c6e09bd0 100644
--- a/src/java/org/apache/fop/tools/TestConverter.java
+++ b/src/java/org/apache/fop/tools/TestConverter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.tools;
import java.io.File;
@@ -48,10 +48,10 @@ import org.apache.commons.logging.impl.SimpleLog;
* pdf rendering.
*/
public class TestConverter {
-
+
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
-
+
private boolean failOnly = false;
private String outputFormat = MimeConstants.MIME_FOP_AREA_TREE;
private File destdir;
@@ -126,7 +126,7 @@ public class TestConverter {
}
/**
- * Controls whether to process only the tests which are specified as fail
+ * Controls whether to process only the tests which are specified as fail
* in the test results.
* @param fail True if only fail tests should be processed
*/
@@ -262,7 +262,7 @@ public class TestConverter {
if (xslNode != null) {
xsl = xslNode.getNodeValue();
}
- logger.debug("converting xml:" + xml + " and xsl:"
+ logger.debug("converting xml:" + xml + " and xsl:"
+ xsl + " to area tree");
String res = xml;
@@ -299,7 +299,7 @@ public class TestConverter {
if (outname.endsWith(".xml") || outname.endsWith(".pdf")) {
outname = outname.substring(0, outname.length() - 4);
}
- File outputFile = new File(destdir,
+ File outputFile = new File(destdir,
outname + makeResultExtension());
outputFile.getParentFile().mkdirs();
diff --git a/src/java/org/apache/fop/tools/anttasks/FileCompare.java b/src/java/org/apache/fop/tools/anttasks/FileCompare.java
index 5deaa7da2..d9b64226a 100644
--- a/src/java/org/apache/fop/tools/anttasks/FileCompare.java
+++ b/src/java/org/apache/fop/tools/anttasks/FileCompare.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.tools.anttasks;
import java.util.Date;
@@ -37,7 +37,7 @@ import java.text.DateFormat;
*/
public class FileCompare {
-
+
private String referenceDirectory, testDirectory;
private String[] filenameList;
private String filenames;
diff --git a/src/java/org/apache/fop/tools/anttasks/RunTest.java b/src/java/org/apache/fop/tools/anttasks/RunTest.java
index 2bc13e8b2..1e1a959ed 100644
--- a/src/java/org/apache/fop/tools/anttasks/RunTest.java
+++ b/src/java/org/apache/fop/tools/anttasks/RunTest.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.tools.anttasks;
// Ant
@@ -42,7 +42,7 @@ import java.util.Map;
* to run the tests and check the results.
*/
public class RunTest extends Task {
-
+
private String basedir;
private String testsuite = "";
private String referenceJar = "";
@@ -218,7 +218,7 @@ public class RunTest extends Task {
}
/**
- * Return a list of URL's with the specified URL first and followed
+ * Return a list of URL's with the specified URL first and followed
* by all the jar files from lib/.
* @return a list of urls to the runtime jar files.
*/
diff --git a/src/java/org/apache/fop/tools/anttasks/SerializeHyphPattern.java b/src/java/org/apache/fop/tools/anttasks/SerializeHyphPattern.java
index 0aefb8422..778c39f9a 100644
--- a/src/java/org/apache/fop/tools/anttasks/SerializeHyphPattern.java
+++ b/src/java/org/apache/fop/tools/anttasks/SerializeHyphPattern.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.tools.anttasks;
// Java
diff --git a/src/java/org/apache/fop/traits/BlockProps.java b/src/java/org/apache/fop/traits/BlockProps.java
index 27417d897..370a97982 100644
--- a/src/java/org/apache/fop/traits/BlockProps.java
+++ b/src/java/org/apache/fop/traits/BlockProps.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
import org.apache.fop.datatypes.Length;
@@ -26,7 +26,7 @@ import org.apache.fop.datatypes.Length;
* Public "structure" allows direct member access.
*/
public class BlockProps {
-
+
public Length firstIndent; // text-indent
public int lastIndent; // last-line-indent
public int textAlign;
diff --git a/src/java/org/apache/fop/traits/BorderProps.java b/src/java/org/apache/fop/traits/BorderProps.java
index d00bdb09d..20e362674 100644
--- a/src/java/org/apache/fop/traits/BorderProps.java
+++ b/src/java/org/apache/fop/traits/BorderProps.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
import java.awt.Color;
@@ -33,14 +33,14 @@ import org.apache.fop.util.ColorUtil;
* Class to store border trait propties for the area tree.
*/
public class BorderProps implements Serializable {
-
+
/** Separate border model */
public static final int SEPARATE = 0;
/** Collapsing border model, for borders inside a table */
public static final int COLLAPSE_INNER = 1;
/** Collapsing border model, for borders at the table's outer border */
public static final int COLLAPSE_OUTER = 2;
-
+
/** Border style (one of EN_*) */
public int style; // Enum for border style
/** Border color */
@@ -86,7 +86,7 @@ public class BorderProps implements Serializable {
return 0;
}
}
-
+
private String getStyleString() {
switch (style) {
case Constants.EN_NONE: return "none";
@@ -102,7 +102,7 @@ public class BorderProps implements Serializable {
default: throw new IllegalStateException("Illegal border style: " + style);
}
}
-
+
private static int getConstantForStyle(String style) {
if ("none".equalsIgnoreCase(style)) {
return Constants.EN_NONE;
@@ -128,7 +128,7 @@ public class BorderProps implements Serializable {
throw new IllegalStateException("Illegal border style: " + style);
}
}
-
+
/** {@inheritDoc} */
public int hashCode() {
return toString().hashCode();
@@ -144,7 +144,7 @@ public class BorderProps implements Serializable {
if (obj instanceof BorderProps) {
BorderProps other = (BorderProps)obj;
return (style == other.style)
- && color.equals(other.color)
+ && color.equals(other.color)
&& width == other.width
&& mode == other.mode;
}
@@ -153,7 +153,7 @@ public class BorderProps implements Serializable {
}
/**
- * Returns a BorderProps represtation of a string of the format as written by
+ * Returns a BorderProps represtation of a string of the format as written by
* BorderProps.toString().
* @param foUserAgent FOP user agent caching ICC profiles
* @param s the string
@@ -180,8 +180,8 @@ public class BorderProps implements Serializable {
c = ColorUtil.parseColorString(foUserAgent, color);
} catch (PropertyException e) {
throw new IllegalArgumentException(e.getMessage());
- }
-
+ }
+
return new BorderProps(style, width, c, mode);
} else {
throw new IllegalArgumentException("BorderProps must be surrounded by parentheses");
diff --git a/src/java/org/apache/fop/traits/InlineProps.java b/src/java/org/apache/fop/traits/InlineProps.java
index 735ebc0ca..06ca2553d 100644
--- a/src/java/org/apache/fop/traits/InlineProps.java
+++ b/src/java/org/apache/fop/traits/InlineProps.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
/**
diff --git a/src/java/org/apache/fop/traits/LayoutProps.java b/src/java/org/apache/fop/traits/LayoutProps.java
index f93470720..eff218b37 100644
--- a/src/java/org/apache/fop/traits/LayoutProps.java
+++ b/src/java/org/apache/fop/traits/LayoutProps.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
import org.apache.fop.datatypes.KeepValue;
diff --git a/src/java/org/apache/fop/traits/MinOptMax.java b/src/java/org/apache/fop/traits/MinOptMax.java
index 33d10a8a5..a4719f896 100644
--- a/src/java/org/apache/fop/traits/MinOptMax.java
+++ b/src/java/org/apache/fop/traits/MinOptMax.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
/**
@@ -163,7 +163,7 @@ public class MinOptMax implements java.io.Serializable, Cloneable {
opt -= op.opt;
max -= op.min;
}
-
+
/** @return true if this instance represents a zero-width length (min=opt=max=0) */
public boolean isNonZero() {
return (min != 0 || max != 0);
@@ -173,7 +173,7 @@ public class MinOptMax implements java.io.Serializable, Cloneable {
public boolean isElastic() {
return (min != opt || opt != max);
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/java/org/apache/fop/traits/SpaceVal.java b/src/java/org/apache/fop/traits/SpaceVal.java
index 0dae92193..e2ac6fb1c 100644
--- a/src/java/org/apache/fop/traits/SpaceVal.java
+++ b/src/java/org/apache/fop/traits/SpaceVal.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -30,7 +30,7 @@ import org.apache.fop.fonts.Font;
* Length values resolved. See section 4.3 in the specs.
*/
public class SpaceVal {
-
+
private final MinOptMax space;
private final boolean bConditional;
private final boolean bForcing;
@@ -45,7 +45,7 @@ public class SpaceVal {
space = new MinOptMax(spaceprop.getMinimum(context).getLength().getValue(context),
spaceprop.getOptimum(context).getLength().getValue(context),
spaceprop.getMaximum(context).getLength().getValue(context));
- bConditional =
+ bConditional =
(spaceprop.getConditionality().getEnum() == Constants.EN_DISCARD);
Property precProp = spaceprop.getPrecedence();
if (precProp.getNumber() != null) {
@@ -72,8 +72,8 @@ public class SpaceVal {
this.iPrecedence = iPrecedence;
}
- static public SpaceVal makeWordSpacing(Property wordSpacing,
- SpaceVal letterSpacing,
+ static public SpaceVal makeWordSpacing(Property wordSpacing,
+ SpaceVal letterSpacing,
Font fs) {
if (wordSpacing.getEnum() == Constants.EN_NORMAL) {
// give word spaces the possibility to shrink by a third,
@@ -87,7 +87,7 @@ public class SpaceVal {
true, true, 0);
} else {
return new SpaceVal(wordSpacing.getSpace(), null);
- }
+ }
}
static public SpaceVal makeLetterSpacing(Property letterSpacing) {
diff --git a/src/java/org/apache/fop/util/BreakUtil.java b/src/java/org/apache/fop/util/BreakUtil.java
index c0528464d..0e419016e 100644
--- a/src/java/org/apache/fop/util/BreakUtil.java
+++ b/src/java/org/apache/fop/util/BreakUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,7 +44,7 @@ public final class BreakUtil {
* Compares the given break classes and return the one that wins. even-page and
* odd-page win over page, which wins over column, which wins over auto. If even-page
* and odd-page are compared to each other, which one will be returned is undefined.
- *
+ *
* @param break1 a break class, one of {@link Constants#EN_AUTO},
* {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE},
* {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE}
diff --git a/src/java/org/apache/fop/util/CMYKColorSpace.java b/src/java/org/apache/fop/util/CMYKColorSpace.java
index 26de8aa97..593c65cea 100644
--- a/src/java/org/apache/fop/util/CMYKColorSpace.java
+++ b/src/java/org/apache/fop/util/CMYKColorSpace.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.util;
import java.awt.color.ColorSpace;
diff --git a/src/java/org/apache/fop/util/CharUtilities.java b/src/java/org/apache/fop/util/CharUtilities.java
index eb56cd331..7786552ff 100644
--- a/src/java/org/apache/fop/util/CharUtilities.java
+++ b/src/java/org/apache/fop/util/CharUtilities.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -89,7 +89,7 @@ public class CharUtilities {
/** Unicode value indicating the the character is "not a character". */
public static final char NOT_A_CHARACTER = '\uFFFF';
-
+
/**
* Utility class: Constructor prevents instantiating when subclassed.
*/
@@ -147,7 +147,7 @@ public class CharUtilities {
* @return true if the character has a fixed-width
*/
public static boolean isFixedWidthSpace(char c) {
- return (c >= '\u2000' && c <= '\u200B')
+ return (c >= '\u2000' && c <= '\u200B')
|| c == '\u3000';
// c == '\u2000' // en quad
// c == '\u2001' // em quad
@@ -191,7 +191,7 @@ public class CharUtilities {
(c == '\u0020' // normal space
|| c == NBSPACE); // no-break space
}
-
+
/**
* Determines if the character represents any kind of space.
* @param c character to check
@@ -200,7 +200,7 @@ public class CharUtilities {
public static boolean isAnySpace(char c) {
return (isBreakableSpace(c) || isNonBreakableSpace(c));
}
-
+
/**
* Indicates whether a character is classified as "Alphabetic" by the Unicode standard.
* @param ch the character
diff --git a/src/java/org/apache/fop/util/CloseBlockerOutputStream.java b/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
index c0db8c8b7..eae1cc09d 100644
--- a/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
+++ b/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.util;
import java.io.IOException;
diff --git a/src/java/org/apache/fop/util/ColorExt.java b/src/java/org/apache/fop/util/ColorExt.java
index bd2c95a33..d2e73d227 100644
--- a/src/java/org/apache/fop/util/ColorExt.java
+++ b/src/java/org/apache/fop/util/ColorExt.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,11 +36,11 @@ public final class ColorExt extends Color {
private float rgbReplacementRed;
private float rgbReplacementGreen;
private float rgbReplacementBlue;
-
+
private String iccProfileName;
private String iccProfileSrc;
private ColorSpace colorSpace;
-
+
private float[] colorValues;
/*
@@ -59,7 +59,7 @@ public final class ColorExt extends Color {
/**
* Create ColorExt object backup up FO's rgb-icc color function
- *
+ *
* @param redReplacement
* Red part of RGB replacement color that will be used when ICC
* profile can not be loaded
@@ -95,7 +95,7 @@ public final class ColorExt extends Color {
/**
* Create ColorExt object backing up SVG's icc-color function.
- *
+ *
* @param red
* Red value resulting from the conversion from the user provided
* (icc) color values to the batik (rgb) color space
@@ -134,7 +134,7 @@ public final class ColorExt extends Color {
/**
* Get ICC profile name
- *
+ *
* @return ICC profile name
*/
public String getIccProfileName() {
@@ -143,7 +143,7 @@ public final class ColorExt extends Color {
/**
* Get ICC profile source
- *
+ *
* @return ICC profile source
*/
public String getIccProfileSrc() {
diff --git a/src/java/org/apache/fop/util/ColorProfileUtil.java b/src/java/org/apache/fop/util/ColorProfileUtil.java
index 6a849a031..f234dde66 100644
--- a/src/java/org/apache/fop/util/ColorProfileUtil.java
+++ b/src/java/org/apache/fop/util/ColorProfileUtil.java
@@ -49,7 +49,7 @@ public class ColorProfileUtil {
}
}
}
-
+
/**
* Indicates whether a given color profile is identical to the default sRGB profile
* provided by the Java class library.
@@ -64,5 +64,5 @@ public class ColorProfileUtil {
}
return profile == sRGBProfile;
}
-
+
}
diff --git a/src/java/org/apache/fop/util/ColorSpaceCache.java b/src/java/org/apache/fop/util/ColorSpaceCache.java
index 92dcf8d55..7b3f409e0 100644
--- a/src/java/org/apache/fop/util/ColorSpaceCache.java
+++ b/src/java/org/apache/fop/util/ColorSpaceCache.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -49,19 +49,19 @@ public class ColorSpaceCache {
public ColorSpaceCache(URIResolver resolver) {
this.resolver = resolver;
}
-
+
/**
* Create (if needed) and return an ICC ColorSpace instance.
- *
+ *
* The ICC profile source is taken from the src attribute of the color-profile FO element.
* If the ICC ColorSpace is not yet in the cache a new one is created and stored in the cache.
- *
- * The FOP URI resolver is used to try and locate the ICC file.
+ *
+ * The FOP URI resolver is used to try and locate the ICC file.
* If that fails null is returned.
- *
+ *
* @param base a base URI to resolve relative URIs
* @param iccProfileSrc ICC Profile source to return a ColorSpace for
- * @return ICC ColorSpace object or null if ColorSpace could not be created
+ * @return ICC ColorSpace object or null if ColorSpace could not be created
*/
public ColorSpace get(String base, String iccProfileSrc) {
ColorSpace colorSpace = null;
@@ -80,7 +80,7 @@ public class ColorSpaceCache {
// TODO - Would it make sense to fall back on VM ICC
// resolution
// Problem is the cache might be more difficult to maintain
- //
+ //
// FOP URI resolver did not find ICC profile - perhaps the
// Java VM can find it?
// iccProfile = ICC_Profile.getInstance(iccProfileSrc);
@@ -106,5 +106,5 @@ public class ColorSpaceCache {
+ iccProfileSrc);
}
return colorSpace;
- }
+ }
}
diff --git a/src/java/org/apache/fop/util/ColorUtil.java b/src/java/org/apache/fop/util/ColorUtil.java
index fbfc68c36..b85b0c017 100644
--- a/src/java/org/apache/fop/util/ColorUtil.java
+++ b/src/java/org/apache/fop/util/ColorUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -39,21 +39,21 @@ import org.apache.fop.fo.expr.PropertyException;
public final class ColorUtil {
/**
- *
+ *
* keeps all the predefined and parsed colors.
*
* This map is used to predefine given colors, as well as speeding up
* parsing of already parsed colors.
*/
private static Map colorMap = null;
-
+
/** Logger instance */
protected static Log log = LogFactory.getLog(ColorUtil.class);
-
+
static {
initializeColorMap();
}
-
+
/**
* Private constructor since this is an utility class.
*/
@@ -77,8 +77,8 @@ public final class ColorUtil {
*
* First, the color will be converted into the sRGB colorspace. It will then
* be printed as #rrggbb, or as #rrrggbbaa if an alpha value is present.
- *
+ *
* @param color
* the color to represent.
* @return a re-parsable string representadion.
diff --git a/src/java/org/apache/fop/util/CommandLineLogger.java b/src/java/org/apache/fop/util/CommandLineLogger.java
index beb82ab03..0da112e5c 100644
--- a/src/java/org/apache/fop/util/CommandLineLogger.java
+++ b/src/java/org/apache/fop/util/CommandLineLogger.java
@@ -4,9 +4,9 @@
/* The ASF licenses this file to You under the Apache License, Version 2.0
/* (the "License"); you may not use this file except in compliance with
/* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,17 +40,17 @@ public class CommandLineLogger implements Log {
private int logLevel;
private String logName;
-
+
/**
- * Construct the logger with a default log level taken from the LogFactory
- * attribute "level".
+ * Construct the logger with a default log level taken from the LogFactory
+ * attribute "level".
* @param logName the logger name.
*/
public CommandLineLogger(String logName) {
this.logName = logName;
setLogLevel((String) LogFactory.getFactory().getAttribute("level"));
}
-
+
/**
* Set a log level for the logger.
* @param level the log level
@@ -72,7 +72,7 @@ public class CommandLineLogger implements Log {
logLevel = LOG_LEVEL_INFO;
}
}
-
+
/**
* {@inheritDoc}
*/
@@ -93,7 +93,7 @@ public class CommandLineLogger implements Log {
public final boolean isInfoEnabled() {
return logLevel <= LOG_LEVEL_INFO;
}
-
+
/**
* {@inheritDoc}
*/
@@ -114,7 +114,7 @@ public class CommandLineLogger implements Log {
public final boolean isFatalEnabled() {
return logLevel <= LOG_LEVEL_FATAL;
}
-
+
/**
* {@inheritDoc}
*/
@@ -222,7 +222,7 @@ public class CommandLineLogger implements Log {
log(LOG_LEVEL_FATAL, message, t);
}
}
-
+
/**
* Do the actual logging.
* This method assembles the message and prints it to
diff --git a/src/java/org/apache/fop/util/ContentHandlerFactory.java b/src/java/org/apache/fop/util/ContentHandlerFactory.java
index 30ab2374a..7eca0bf95 100644
--- a/src/java/org/apache/fop/util/ContentHandlerFactory.java
+++ b/src/java/org/apache/fop/util/ContentHandlerFactory.java
@@ -34,43 +34,43 @@ public interface ContentHandlerFactory {
* @return an array of supported namespaces.
*/
String[] getSupportedNamespaces();
-
+
/**
* @return a new ContentHandler to handle a SAX stream
* @throws SAXException if there's an error while preparing the ContentHandler
*/
ContentHandler createContentHandler() throws SAXException;
-
+
/**
* Interface that ContentHandler implementations that parse Java objects from XML can implement
* to return these objects.
*/
public interface ObjectSource {
-
+
/**
* @return the object parsed from the SAX stream (call valid after parsing)
*/
Object getObject();
-
+
/**
* Set a listener which gets notified when the object is fully built.
* @param listener the listener which gets notified
*/
void setObjectBuiltListener(ObjectBuiltListener listener);
}
-
+
/**
* EventListener interface for objects which want to get notified when ContentHandler
* implementing the ObjectSource interface has finished parsing.
*/
public interface ObjectBuiltListener extends EventListener {
-
+
/**
* Notifies the listener when the object is fully built.
* @param obj the newly built object
*/
void notifyObjectBuilt(Object obj);
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java b/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
index 3d8ef8296..ceedf9f12 100644
--- a/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
+++ b/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,24 +36,24 @@ public class ContentHandlerFactoryRegistry {
/** the logger */
private static Log log = LogFactory.getLog(ContentHandlerFactoryRegistry.class);
-
+
/** Map from namespace URIs to ContentHandlerFactories */
private Map factories = new java.util.HashMap();
-
+
/**
* Default constructor.
*/
public ContentHandlerFactoryRegistry() {
discover();
}
-
+
/**
* Add an XML handler. The handler itself is inspected to find out what it supports.
* @param classname the fully qualified class name
*/
public void addContentHandlerFactory(String classname) {
try {
- ContentHandlerFactory factory
+ ContentHandlerFactory factory
= (ContentHandlerFactory)Class.forName(classname).newInstance();
addContentHandlerFactory(factory);
} catch (ClassNotFoundException e) {
@@ -67,11 +67,11 @@ public class ContentHandlerFactoryRegistry {
+ classname);
} catch (ClassCastException e) {
throw new IllegalArgumentException(classname
- + " is not an "
+ + " is not an "
+ ContentHandlerFactory.class.getName());
}
}
-
+
/**
* Add an ContentHandlerFactory. The instance is inspected to find out what it supports.
* @param factory the ContentHandlerFactory instance
@@ -82,7 +82,7 @@ public class ContentHandlerFactoryRegistry {
factories.put(ns[i], factory);
}
}
-
+
/**
* Retrieves a ContentHandlerFactory instance of a given namespace URI.
* @param namespaceURI the namespace to be handled.
@@ -92,7 +92,7 @@ public class ContentHandlerFactoryRegistry {
ContentHandlerFactory factory = (ContentHandlerFactory)factories.get(namespaceURI);
return factory;
}
-
+
/**
* Discovers ContentHandlerFactory implementations through the classpath and dynamically
* registers them.
@@ -105,7 +105,7 @@ public class ContentHandlerFactoryRegistry {
ContentHandlerFactory factory = (ContentHandlerFactory)providers.next();
try {
if (log.isDebugEnabled()) {
- log.debug("Dynamically adding ContentHandlerFactory: "
+ log.debug("Dynamically adding ContentHandlerFactory: "
+ factory.getClass().getName());
}
addContentHandlerFactory(factory);
diff --git a/src/java/org/apache/fop/util/ConversionUtils.java b/src/java/org/apache/fop/util/ConversionUtils.java
index e2d93fbd3..82d06ba32 100644
--- a/src/java/org/apache/fop/util/ConversionUtils.java
+++ b/src/java/org/apache/fop/util/ConversionUtils.java
@@ -5,7 +5,7 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
-
+
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@@ -27,84 +27,84 @@ public final class ConversionUtils {
* Converts the given base
- * Part of the code here copied and adapted from Apache Xalan-J,
+ * Part of the code here copied and adapted from Apache Xalan-J,
* src/org/apache/xalan/xsltc/trax/DOM2SAX.java
*/
public class DOM2SAX {
@@ -45,9 +45,9 @@ public class DOM2SAX {
private ContentHandler contentHandler;
private LexicalHandler lexicalHandler;
-
+
private Map prefixes = new java.util.HashMap();
-
+
/**
* Main constructor
* @param handler the ContentHandler to send SAX events to
@@ -58,7 +58,7 @@ public class DOM2SAX {
this.lexicalHandler = (LexicalHandler)handler;
}
}
-
+
/**
* Writes the given document using the given ContentHandler.
* @param doc DOM document
@@ -143,7 +143,7 @@ public class DOM2SAX {
* @param node node to serialize
* @throws SAXException In case of a problem while writing XML
*/
- private void writeNode(Node node)
+ private void writeNode(Node node)
throws SAXException {
if (node == null) {
return;
@@ -284,5 +284,5 @@ public class DOM2SAX {
}
}
-
+
}
diff --git a/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java b/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java
index 5ad127021..6117c436d 100644
--- a/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java
+++ b/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java
@@ -35,23 +35,23 @@ import org.xml.sax.SAXException;
*/
public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
- private static SAXTransformerFactory tFactory
+ private static SAXTransformerFactory tFactory
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
private String namespaceURI;
private DOMImplementation domImplementation;
-
+
/**
* Main Constructor
- * @param namespaceURI the main namespace URI for the DOM to be parsed
+ * @param namespaceURI the main namespace URI for the DOM to be parsed
* @param domImplementation the DOMImplementation to use for build the DOM
*/
- public DOMBuilderContentHandlerFactory(String namespaceURI,
+ public DOMBuilderContentHandlerFactory(String namespaceURI,
DOMImplementation domImplementation) {
this.namespaceURI = namespaceURI;
this.domImplementation = domImplementation;
}
-
+
/** {@inheritDoc} */
public String[] getSupportedNamespaces() {
return new String[] {namespaceURI};
@@ -61,13 +61,13 @@ public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
public ContentHandler createContentHandler() throws SAXException {
return new Handler();
}
-
+
private class Handler extends DelegatingContentHandler
implements ContentHandlerFactory.ObjectSource {
-
+
private Document doc;
private ObjectBuiltListener obListener;
-
+
public Handler() throws SAXException {
super();
}
@@ -75,7 +75,7 @@ public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
public Document getDocument() {
return this.doc;
}
-
+
/**
* {@inheritDoc}
*/
@@ -89,7 +89,7 @@ public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
public void setObjectBuiltListener(ObjectBuiltListener listener) {
this.obListener = listener;
}
-
+
/**
* {@inheritDoc}
*/
@@ -103,7 +103,7 @@ public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
/**
* {@inheritDoc}
*/
- public void startElement(String uri, String localName, String qName, Attributes atts)
+ public void startElement(String uri, String localName, String qName, Attributes atts)
throws SAXException {
if (doc == null) {
TransformerHandler handler;
diff --git a/src/java/org/apache/fop/util/DataURIResolver.java b/src/java/org/apache/fop/util/DataURIResolver.java
index 699659f7e..89db6dc9d 100644
--- a/src/java/org/apache/fop/util/DataURIResolver.java
+++ b/src/java/org/apache/fop/util/DataURIResolver.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.xmlgraphics.util.io.Base64DecodeStream;
/**
* Resolves data URLs (described in RFC 2397) returning its data as a StreamSource.
- *
+ *
* @see javax.xml.transform.URIResolver
* @see RFC 2397
*/
@@ -51,7 +51,7 @@ public class DataURIResolver implements URIResolver {
/**
* Parses inline data URIs as generated by MS Word's XML export and FO
* stylesheet.
- *
+ *
* @see RFC 2397
*/
private Source parseDataURI(String href) {
diff --git a/src/java/org/apache/fop/util/DataURLUtil.java b/src/java/org/apache/fop/util/DataURLUtil.java
index 03236dd45..d8f7f17bf 100644
--- a/src/java/org/apache/fop/util/DataURLUtil.java
+++ b/src/java/org/apache/fop/util/DataURLUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,7 +44,7 @@ public class DataURLUtil {
writeDataURL(in, mediatype, writer);
return writer.toString();
}
-
+
/**
* Generates a data URL and writes it to a Writer.
* @param in the InputStream to read the data from
diff --git a/src/java/org/apache/fop/util/DefaultErrorListener.java b/src/java/org/apache/fop/util/DefaultErrorListener.java
index 3717d3192..1d17b86fd 100644
--- a/src/java/org/apache/fop/util/DefaultErrorListener.java
+++ b/src/java/org/apache/fop/util/DefaultErrorListener.java
@@ -31,7 +31,7 @@ import org.apache.commons.logging.Log;
public class DefaultErrorListener implements ErrorListener {
private Log log;
-
+
/**
* Main constructor
* @param log the log instance to send log events to
@@ -39,7 +39,7 @@ public class DefaultErrorListener implements ErrorListener {
public DefaultErrorListener(Log log) {
this.log = log;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/util/DelegatingContentHandler.java b/src/java/org/apache/fop/util/DelegatingContentHandler.java
index 0b371483f..0db1105ce 100644
--- a/src/java/org/apache/fop/util/DelegatingContentHandler.java
+++ b/src/java/org/apache/fop/util/DelegatingContentHandler.java
@@ -38,9 +38,9 @@ import org.xml.sax.ext.LexicalHandler;
*
* The ContentHandler is the only instance that is required. All others (DTDHandler,
* EntityResolver, LexicalHandler and ErrorHandler) may be ignored.
- *
+ *
*/
-public class DelegatingContentHandler
+public class DelegatingContentHandler
implements EntityResolver, DTDHandler, ContentHandler, LexicalHandler, ErrorHandler {
private ContentHandler delegate;
@@ -48,7 +48,7 @@ public class DelegatingContentHandler
private DTDHandler dtdHandler;
private LexicalHandler lexicalHandler;
private ErrorHandler errorHandler;
-
+
/**
* Main constructor.
*/
@@ -62,7 +62,7 @@ public class DelegatingContentHandler
public ContentHandler getDelegateContentHandler() {
return this.delegate;
}
-
+
/**
* Sets the delegate ContentHandler that all events are forwarded to.
* @param handler the delegate instance
@@ -70,7 +70,7 @@ public class DelegatingContentHandler
public void setDelegateContentHandler(ContentHandler handler) {
this.delegate = handler;
}
-
+
/**
* Sets the delegate EntityResolver.
* @param resolver the delegate instance
@@ -78,7 +78,7 @@ public class DelegatingContentHandler
public void setDelegateEntityResolver(EntityResolver resolver) {
this.entityResolver = resolver;
}
-
+
/**
* Sets the delegate DTDHandler.
* @param handler the delegate instance
@@ -86,7 +86,7 @@ public class DelegatingContentHandler
public void setDelegateDTDHandler(DTDHandler handler) {
this.dtdHandler = handler;
}
-
+
/**
* Sets the delegate LexicalHandler.
* @param handler the delegate instance
@@ -94,7 +94,7 @@ public class DelegatingContentHandler
public void setDelegateLexicalHandler(LexicalHandler handler) {
this.lexicalHandler = handler;
}
-
+
/**
* Sets the delegate ErrorHandler.
* @param handler the delegate instance
@@ -102,9 +102,9 @@ public class DelegatingContentHandler
public void setDelegateErrorHandler(ErrorHandler handler) {
this.errorHandler = handler;
}
-
+
// ==== EntityResolver
-
+
/**
* {@inheritDoc}
*/
@@ -130,7 +130,7 @@ public class DelegatingContentHandler
/**
* {@inheritDoc}
*/
- public void unparsedEntityDecl(String name, String publicId, String systemId,
+ public void unparsedEntityDecl(String name, String publicId, String systemId,
String notationName) throws SAXException {
if (dtdHandler != null) {
dtdHandler.unparsedEntityDecl(name, publicId, systemId, notationName);
@@ -138,7 +138,7 @@ public class DelegatingContentHandler
}
// ==== ContentHandler
-
+
/**
* {@inheritDoc}
*/
@@ -177,7 +177,7 @@ public class DelegatingContentHandler
/**
* {@inheritDoc}
*/
- public void startElement(String uri, String localName, String qName,
+ public void startElement(String uri, String localName, String qName,
Attributes atts) throws SAXException {
delegate.startElement(uri, localName, qName, atts);
}
@@ -218,7 +218,7 @@ public class DelegatingContentHandler
}
// ==== LexicalHandler
-
+
/**
* {@inheritDoc}
*/
@@ -226,7 +226,7 @@ public class DelegatingContentHandler
if (lexicalHandler != null) {
lexicalHandler.startDTD(name, publicId, systemId);
}
-
+
}
/**
@@ -275,14 +275,14 @@ public class DelegatingContentHandler
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void comment(char[] ch, int start, int length) throws SAXException {
if (lexicalHandler != null) {
lexicalHandler.comment(ch, start, length);
}
}
-
+
// ==== ErrorHandler
/**
diff --git a/src/java/org/apache/fop/util/ListUtil.java b/src/java/org/apache/fop/util/ListUtil.java
index a6b8d490c..d97457510 100644
--- a/src/java/org/apache/fop/util/ListUtil.java
+++ b/src/java/org/apache/fop/util/ListUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,7 +23,7 @@ import java.util.List;
/**
* Provides helper functions for {@link java.util.List}.
- *
+ *
*/
public final class ListUtil {
@@ -33,7 +33,7 @@ public final class ListUtil {
/**
* Retrieve the last element from a list.
- *
+ *
* @param list
* The list to work on
* @return last element
@@ -44,7 +44,7 @@ public final class ListUtil {
/**
* Retrieve and remove the last element from a list.
- *
+ *
* @param list
* The list to work on
* @return previous last element
diff --git a/src/java/org/apache/fop/util/LogUtil.java b/src/java/org/apache/fop/util/LogUtil.java
index e33397fcb..23f275644 100644
--- a/src/java/org/apache/fop/util/LogUtil.java
+++ b/src/java/org/apache/fop/util/LogUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,7 +23,7 @@ import org.apache.commons.logging.Log;
import org.apache.fop.apps.FOPException;
/**
- * Convenience Logging utility methods used in FOP
+ * Convenience Logging utility methods used in FOP
*/
public class LogUtil {
diff --git a/src/java/org/apache/fop/util/QName.java b/src/java/org/apache/fop/util/QName.java
index 132f5b4dc..1b0708a89 100644
--- a/src/java/org/apache/fop/util/QName.java
+++ b/src/java/org/apache/fop/util/QName.java
@@ -22,14 +22,14 @@ package org.apache.fop.util;
/**
* Represents a qualified name of an XML element or an XML attribute.
*
- * Note: This class allows to carry a namespace prefix but it is not used in the equals() and
+ * Note: This class allows to carry a namespace prefix but it is not used in the equals() and
* hashCode() methods.
* @deprecated Use the XML Graphics Commons variant instead!
*/
public class QName extends org.apache.xmlgraphics.util.QName {
private static final long serialVersionUID = -5225376740044770690L;
-
+
/**
* Main constructor.
* @param namespaceURI the namespace URI
@@ -39,7 +39,7 @@ public class QName extends org.apache.xmlgraphics.util.QName {
public QName(String namespaceURI, String prefix, String localName) {
super(namespaceURI, prefix, localName);
}
-
+
/**
* Main constructor.
* @param namespaceURI the namespace URI
@@ -48,5 +48,5 @@ public class QName extends org.apache.xmlgraphics.util.QName {
public QName(String namespaceURI, String qName) {
super(namespaceURI, qName);
}
-
+
}
diff --git a/src/java/org/apache/fop/util/UnclosableInputStream.java b/src/java/org/apache/fop/util/UnclosableInputStream.java
index 0384a62ff..7d06a5ac7 100644
--- a/src/java/org/apache/fop/util/UnclosableInputStream.java
+++ b/src/java/org/apache/fop/util/UnclosableInputStream.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,7 +29,7 @@ public class UnclosableInputStream extends FilterInputStream {
/**
* Default constructor.
- *
+ *
* @param in the Stream to filter.
*/
public UnclosableInputStream(InputStream in) {
diff --git a/src/java/org/apache/fop/util/UnitConv.java b/src/java/org/apache/fop/util/UnitConv.java
index cd3276b9f..8bf7274eb 100644
--- a/src/java/org/apache/fop/util/UnitConv.java
+++ b/src/java/org/apache/fop/util/UnitConv.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,13 +26,13 @@ public final class UnitConv {
/** conversion factory from millimeters to inches. */
public static final float IN2MM = 25.4f;
-
+
/** conversion factory from centimeters to inches. */
public static final float IN2CM = 2.54f;
-
+
/** conversion factory from inches to points. */
public static final int IN2PT = 72;
-
+
/**
* Converts millimeters (mm) to points (pt)
* @param mm the value in mm
@@ -59,7 +59,7 @@ public final class UnitConv {
public static double pt2mm(double pt) {
return pt * IN2MM / IN2PT;
}
-
+
/**
* Converts millimeters (mm) to inches (in)
* @param mm the value in mm
@@ -68,7 +68,7 @@ public final class UnitConv {
public static double mm2in(double mm) {
return mm / IN2MM;
}
-
+
/**
* Converts inches (in) to millimeters (mm)
* @param in the value in inches
@@ -77,7 +77,7 @@ public final class UnitConv {
public static double in2mm(double in) {
return in * IN2MM;
}
-
+
/**
* Converts inches (in) to millipoints (mpt)
* @param in the value in inches
@@ -86,7 +86,7 @@ public final class UnitConv {
public static double in2mpt(double in) {
return in * IN2PT * 1000;
}
-
+
/**
* Converts inches (in) to points (pt)
* @param in the value in inches
@@ -95,16 +95,16 @@ public final class UnitConv {
public static double in2pt(double in) {
return in * IN2PT;
}
-
+
/**
- * Converts millipoints (mpt) to inches (in)
+ * Converts millipoints (mpt) to inches (in)
* @param mpt the value in mpt
* @return the value in inches
*/
public static double mpt2in(double mpt) {
return mpt / IN2PT / 1000;
}
-
+
/**
* Converts millimeters (mm) to pixels (px)
* @param mm the value in mm
diff --git a/src/java/org/apache/fop/util/WriterOutputStream.java b/src/java/org/apache/fop/util/WriterOutputStream.java
index d399b60dc..fb6875498 100644
--- a/src/java/org/apache/fop/util/WriterOutputStream.java
+++ b/src/java/org/apache/fop/util/WriterOutputStream.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,7 +24,7 @@ import java.io.OutputStream;
import java.io.Writer;
/**
- * An OutputStream wrapper for a Writer.
+ * An OutputStream wrapper for a Writer.
*/
public class WriterOutputStream extends OutputStream {
diff --git a/src/java/org/apache/fop/util/XMLResourceBundle.java b/src/java/org/apache/fop/util/XMLResourceBundle.java
index 1b320816b..268ce1eed 100644
--- a/src/java/org/apache/fop/util/XMLResourceBundle.java
+++ b/src/java/org/apache/fop/util/XMLResourceBundle.java
@@ -1,4 +1,4 @@
-/*
+/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -61,12 +61,12 @@ import org.apache.xmlgraphics.util.QName;
public class XMLResourceBundle extends ResourceBundle {
//Note: Some code here has been copied and adapted from Apache Harmony!
-
+
private Properties resources = new Properties();
private Locale locale;
-
- private static SAXTransformerFactory tFactory
+
+ private static SAXTransformerFactory tFactory
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
/**
@@ -84,7 +84,7 @@ public class XMLResourceBundle extends ResourceBundle {
throw new IOException("Error while parsing XML resource bundle: " + e.getMessage());
}
}
-
+
/**
* Gets a resource bundle using the specified base name, default locale, and class loader.
* @param baseName the base name of the resource bundle, a fully qualified class name
@@ -98,7 +98,7 @@ public class XMLResourceBundle extends ResourceBundle {
throws MissingResourceException {
return getXMLBundle(baseName, Locale.getDefault(), loader);
}
-
+
/**
* Gets a resource bundle using the specified base name, locale, and class loader.
* @param baseName the base name of the resource bundle, a fully qualified class name
@@ -117,7 +117,7 @@ public class XMLResourceBundle extends ResourceBundle {
if (baseName == null) {
throw new NullPointerException("baseName must not be null");
}
-
+
ResourceBundle bundle;
if (!locale.equals(Locale.getDefault())) {
bundle = handleGetXMLBundle(baseName, "_" + locale, false, loader);
@@ -145,10 +145,10 @@ public class XMLResourceBundle extends ResourceBundle {
private static final ResourceBundle MISSING = new MissingBundle();
private static final ResourceBundle MISSINGBASE = new MissingBundle();
-
+
private static Map cache = new java.util.WeakHashMap();
//
- * org.apache.fop.area.CTM ctm =
+ * org.apache.fop.area.CTM ctm =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
* String pdfMatrix = org.apache.fop.render.pdf.CTMHelper.toPDFString(ctm);
*
@@ -58,7 +58,7 @@ public final class CTMHelper {
}
/**
- *
- * org.apache.fop.area.CTM inCTM =
+ * org.apache.fop.area.CTM inCTM =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
- * org.apache.fop.area.CTM outCTM =
+ * org.apache.fop.area.CTM outCTM =
* org.apache.fop.render.pdf.CTMHelper.toPDFCTM(ctm);
*
* will return a new CTM where a == 1.0, b == 0.0, c == 0.0, d == 1.0, e == 1.0 and f == 1.0.
@@ -121,7 +121,7 @@ public final class CTMHelper {
*
- * org.apache.fop.area.CTM inCTM =
+ * org.apache.fop.area.CTM inCTM =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
* double matrix[] = org.apache.fop.render.pdf.CTMHelper.toPDFArray(ctm);
*
diff --git a/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java
index b80e2c03e..f158f6a14 100644
--- a/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -55,7 +55,7 @@ public class ImageRawCCITTFaxAdapter extends AbstractImageAdapter {
public ImageRawCCITTFax getImage() {
return ((ImageRawCCITTFax)this.image);
}
-
+
/** {@inheritDoc} */
public void setup(PDFDocument doc) {
pdfFilter = new CCFFilter();
@@ -95,7 +95,7 @@ public class ImageRawCCITTFaxAdapter extends AbstractImageAdapter {
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
getImage().writeTo(out);
diff --git a/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
index 1e505daed..a60c9e92c 100644
--- a/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -64,7 +64,7 @@ public class ImageRawJPEGAdapter extends AbstractImageAdapter {
public ImageRawJPEG getImage() {
return ((ImageRawJPEG)this.image);
}
-
+
/** {@inheritDoc} */
public void setup(PDFDocument doc) {
pdfFilter = new DCTFilter();
@@ -88,12 +88,12 @@ public class ImageRawJPEGAdapter extends AbstractImageAdapter {
public boolean isInverted() {
return getImage().isInverted();
}
-
+
/** {@inheritDoc} */
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
InputStream in = getImage().createInputStream();
@@ -101,7 +101,7 @@ public class ImageRawJPEGAdapter extends AbstractImageAdapter {
try {
JPEGFile jpeg = new JPEGFile(in);
DataInput din = jpeg.getDataInput();
-
+
//Copy the whole JPEG file except:
// - the ICC profile
//TODO Thumbnails could safely be skipped, too.
@@ -149,7 +149,7 @@ public class ImageRawJPEGAdapter extends AbstractImageAdapter {
default:
out.write(0xFF);
out.write(segID);
-
+
reclen = jpeg.readSegmentLength();
//write short
out.write((reclen >>> 8) & 0xFF);
diff --git a/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
index 62e83da81..e8988244f 100644
--- a/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,7 +52,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
private static Log log = LogFactory.getLog(ImageRenderedAdapter.class);
private ImageEncodingHelper encodingHelper;
-
+
private PDFFilter pdfFilter = null;
private String maskRef;
private PDFReference softMask;
@@ -74,11 +74,11 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
public ImageRendered getImage() {
return ((ImageRendered)this.image);
}
-
+
private ColorModel getEffectiveColorModel() {
return encodingHelper.getEncodedColorModel();
}
-
+
/** {@inheritDoc} */
protected ColorSpace getImageColorSpace() {
return getEffectiveColorModel().getColorSpace();
@@ -90,14 +90,14 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
ColorModel cm = getEffectiveColorModel();
super.setup(doc);
-
+
//Handle transparency mask if applicable
- ColorModel orgcm = ri.getColorModel();
+ ColorModel orgcm = ri.getColorModel();
if (orgcm.hasAlpha() && orgcm.getTransparency() == ColorModel.TRANSLUCENT) {
doc.getProfile().verifyTransparencyAllowed(image.getInfo().getOriginalURI());
//TODO Implement code to combine image with background color if transparency is not
//allowed (need BufferedImage support for that)
-
+
AlphaRasterImage alphaImage = new AlphaRasterImage("Mask:" + getKey(), ri);
this.softMask = doc.addImage(null, alphaImage).makeReference();
}
@@ -130,7 +130,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
}
return (getImage().getTransparentColor() != null);
}
-
+
private static Integer getIndexOfFirstTransparentColorInPalette(RenderedImage image) {
ColorModel cm = image.getColorModel();
if (cm instanceof IndexColorModel) {
@@ -180,19 +180,19 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
public PDFReference getSoftMaskReference() {
return softMask;
}
-
+
/** {@inheritDoc} */
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
encodingHelper.encode(out);
}
private static final int MAX_HIVAL = 255;
-
+
/** {@inheritDoc} */
public void populateXObjectDictionary(PDFDictionary dict) {
ColorModel cm = getEffectiveColorModel();
@@ -200,11 +200,11 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
IndexColorModel icm = (IndexColorModel)cm;
PDFArray indexed = new PDFArray(dict);
indexed.add(new PDFName("Indexed"));
-
+
if (icm.getColorSpace().getType() != ColorSpace.TYPE_RGB) {
log.warn("Indexed color space is not using RGB as base color space."
+ " The image may not be handled correctly."
- + " Base color space: " + icm.getColorSpace()
+ + " Base color space: " + icm.getColorSpace()
+ " Image: " + image.getInfo());
}
indexed.add(new PDFName(toPDFColorSpace(icm.getColorSpace()).getName()));
@@ -229,7 +229,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
dict.put("ColorSpace", indexed);
dict.put("BitsPerComponent", icm.getPixelSize());
-
+
Integer index = getIndexOfFirstTransparentColorInPalette(getImage().getRenderedImage());
if (index != null) {
PDFArray mask = new PDFArray(dict);
@@ -239,7 +239,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
}
}
}
-
+
/** {@inheritDoc} */
public String getFilterHint() {
return PDFFilterList.IMAGE_FILTER;
diff --git a/src/java/org/apache/fop/render/pdf/PDFEventProducer.java b/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
index f8b1bbb33..2c3be9736 100644
--- a/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
@@ -31,7 +31,7 @@ public interface PDFEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,9 +50,9 @@ public interface PDFEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* Some link targets haven't been fully resolved.
* @param source the event source
@@ -60,5 +60,5 @@ public interface PDFEventProducer extends EventProducer {
* @event.severity WARN
*/
void nonFullyResolvedLinkTargets(Object source, int count);
-
+
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java b/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
index c47b944d0..b61ebc346 100644
--- a/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.pdf;
import java.awt.Color;
@@ -49,18 +49,18 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
public PDFGraphics2DAdapter(PDFRenderer renderer) {
this.renderer = renderer;
}
-
+
/** {@inheritDoc} */
public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
-
+
PDFSVGHandler.PDFInfo pdfInfo = PDFSVGHandler.getPDFInfo(context);
float fwidth = width / 1000f;
float fheight = height / 1000f;
float fx = x / 1000f;
float fy = y / 1000f;
-
+
// get the 'width' and 'height' attributes of the SVG document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth() / 1000f;
@@ -72,7 +72,7 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
renderer.saveGraphicsState();
renderer.setColor(Color.black, false, null);
renderer.setColor(Color.black, true, null);
-
+
//TODO Clip to the image area.
// transform so that the coordinates (0,0) is from the top left
@@ -86,13 +86,13 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
if (pdfInfo.pdfContext == null) {
pdfInfo.pdfContext = pdfInfo.pdfPage;
}
- PDFGraphics2D graphics = new PDFGraphics2D(textAsShapes,
+ PDFGraphics2D graphics = new PDFGraphics2D(textAsShapes,
pdfInfo.fi, pdfInfo.pdfDoc,
pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
pdfInfo.currentFontName,
pdfInfo.currentFontSize);
graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
-
+
AffineTransform transform = new AffineTransform();
transform.translate(fx, fy);
pdfInfo.pdfState.concatenate(transform);
@@ -105,7 +105,7 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
RendererContextWrapper ctx = RendererContext.wrapRendererContext(context);
BufferedImage bi = paintToBufferedImage(painter, ctx, resolution, false, false);
- float scale = PDFRenderer.NORMAL_PDF_RESOLUTION
+ float scale = PDFRenderer.NORMAL_PDF_RESOLUTION
/ context.getUserAgent().getTargetResolution();
graphics.drawImage(bi, new AffineTransform(scale, 0, 0, scale, 0, 0), null);
} else {
@@ -121,9 +121,9 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
/** {@inheritDoc} */
protected void setRenderingHintsForBufferedImage(Graphics2D g2d) {
super.setRenderingHintsForBufferedImage(g2d);
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+ g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandler.java b/src/java/org/apache/fop/render/pdf/PDFImageHandler.java
index d62dcbc5b..f93ee5a97 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandler.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,19 +41,19 @@ public interface PDFImageHandler {
* @return a positive integer (>0) indicating the priority
*/
int getPriority();
-
+
/**
* Returns the {@link ImageFlavor}s supported by this instance
* @return the supported image flavors
*/
ImageFlavor[] getSupportedImageFlavors();
-
+
/**
* Returns the {@link Image} subclass supported by this instance.
* @return the Image type
*/
Class getSupportedImageClass();
-
+
/**
* Generates the PDF objects for the given {@link Image} instance. If the handler generates
* an XObject, it shall return it or otherwise return null. A generated XObject shall be
@@ -66,7 +66,7 @@ public interface PDFImageHandler {
* @return the generated XObject or null if no XObject was generated
* @throws IOException if an I/O error occurs
*/
- PDFXObject generateImage(RendererContext context, Image image,
+ PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos) throws IOException;
-
+
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java
index f1825297e..a58fe5922 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java
@@ -38,9 +38,9 @@ public class PDFImageHandlerGraphics2D implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.GRAPHICS2D,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java
index 65142878a..9f56ebfea 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java
@@ -41,9 +41,9 @@ public class PDFImageHandlerRawCCITTFax implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_CCITTFAX,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -52,7 +52,7 @@ public class PDFImageHandlerRawCCITTFax implements PDFImageHandler {
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRawCCITTFaxAdapter(ccitt, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -61,7 +61,7 @@ public class PDFImageHandlerRawCCITTFax implements PDFImageHandler {
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java
index 58c9f1f53..f971a49ae 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java
@@ -41,9 +41,9 @@ public class PDFImageHandlerRawJPEG implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_JPEG,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -52,7 +52,7 @@ public class PDFImageHandlerRawJPEG implements PDFImageHandler {
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRawJPEGAdapter(jpeg, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -61,7 +61,7 @@ public class PDFImageHandlerRawJPEG implements PDFImageHandler {
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java
index 536fc19b0..b664a0a24 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -41,7 +41,7 @@ public class PDFImageHandlerRegistry {
/** the logger */
private static Log log = LogFactory.getLog(PDFImageHandlerRegistry.class);
-
+
private static final Comparator HANDLER_COMPARATOR = new Comparator() {
public int compare(Object o1, Object o2) {
PDFImageHandler h1 = (PDFImageHandler)o1;
@@ -54,19 +54,19 @@ public class PDFImageHandlerRegistry {
private Map handlers = new java.util.HashMap();
/** List containing the same handlers as above but ordered by priority */
private List handlerList = new java.util.LinkedList();
-
+
/** Sorted Set of registered handlers */
private ImageFlavor[] supportedFlavors = new ImageFlavor[0];
private int handlerRegistrations;
private int lastSync;
-
+
/**
* Default constructor.
*/
public PDFImageHandlerRegistry() {
discoverHandlers();
}
-
+
/**
* Add an PDFImageHandler. The handler itself is inspected to find out what it supports.
* @param classname the fully qualified class name
@@ -87,11 +87,11 @@ public class PDFImageHandlerRegistry {
+ classname);
} catch (ClassCastException e) {
throw new IllegalArgumentException(classname
- + " is not an "
+ + " is not an "
+ PDFImageHandler.class.getName());
}
}
-
+
/**
* Add an image handler. The handler itself is inspected to find out what it supports.
* @param handler the PDFImageHandler instance
@@ -99,7 +99,7 @@ public class PDFImageHandlerRegistry {
public synchronized void addHandler(PDFImageHandler handler) {
Class imageClass = handler.getSupportedImageClass();
this.handlers.put(imageClass, handler);
-
+
//Sorted insert
ListIterator iter = this.handlerList.listIterator();
while (iter.hasNext()) {
@@ -112,7 +112,7 @@ public class PDFImageHandlerRegistry {
iter.add(handler);
this.handlerRegistrations++;
}
-
+
/**
* Returns an PDFImageHandler which handles an specific image type given the MIME type
* of the image.
@@ -143,7 +143,7 @@ public class PDFImageHandlerRegistry {
}
/**
- * Returns the ordered array of supported image flavors.
+ * Returns the ordered array of supported image flavors.
* @return the array of image flavors
*/
public synchronized ImageFlavor[] getSupportedFlavors() {
@@ -162,7 +162,7 @@ public class PDFImageHandlerRegistry {
}
return this.supportedFlavors;
}
-
+
/**
* Discovers PDFImageHandler implementations through the classpath and dynamically
* registers them.
@@ -175,7 +175,7 @@ public class PDFImageHandlerRegistry {
PDFImageHandler handler = (PDFImageHandler)providers.next();
try {
if (log.isDebugEnabled()) {
- log.debug("Dynamically adding PDFImageHandler: "
+ log.debug("Dynamically adding PDFImageHandler: "
+ handler.getClass().getName());
}
addHandler(handler);
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java
index 628883b9f..783cb225c 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java
@@ -40,11 +40,11 @@ public class PDFImageHandlerRenderedImage implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE
+ ImageFlavor.RENDERED_IMAGE
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -53,7 +53,7 @@ public class PDFImageHandlerRenderedImage implements PDFImageHandler {
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRenderedAdapter(imageRend, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -62,7 +62,7 @@ public class PDFImageHandlerRenderedImage implements PDFImageHandler {
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java
index ba47cce69..d111e733f 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java
@@ -41,9 +41,9 @@ public class PDFImageHandlerXML implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.XML_DOM,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index c3e4a9657..27caf86b4 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -122,7 +122,7 @@ import org.apache.fop.util.ColorProfileUtil;
* Renderer that renders areas to PDF.
*/
public class PDFRenderer extends AbstractPathOrientedRenderer {
-
+
/**
* The mime type for pdf
*/
@@ -130,7 +130,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/** Normal PDF resolution (72dpi) */
public static final int NORMAL_PDF_RESOLUTION = 72;
-
+
/** PDF encryption parameter: all parameters as object, datatype: PDFEncryptionParams */
public static final String ENCRYPTION_PARAMS = "encryption-params";
/** PDF encryption parameter: user password, datatype: String */
@@ -159,7 +159,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/** Controls whether comments are written to the PDF stream. */
protected static final boolean WRITE_COMMENTS = true;
-
+
/**
* the PDF Document being created
*/
@@ -167,10 +167,10 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/** the PDF/A mode (Default: disabled) */
protected PDFAMode pdfAMode = PDFAMode.DISABLED;
-
+
/** the PDF/X mode (Default: disabled) */
protected PDFXMode pdfXMode = PDFXMode.DISABLED;
-
+
/**
* Map of pages using the PageViewport as the key
* this is used for prepared pages that cannot be immediately
@@ -246,10 +246,10 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
protected PDFICCBasedColorSpace sRGBColorSpace;
/** controls whether the sRGB color space should be installed */
protected boolean disableSRGBColorSpace = false;
-
+
/** Optional URI to an output profile to be used. */
- protected String outputProfileURI;
-
+ protected String outputProfileURI;
+
/** drawing state */
protected PDFState currentState = null;
@@ -263,7 +263,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/** Image handler registry */
private PDFImageHandlerRegistry imageHandlerRegistry = new PDFImageHandlerRegistry();
-
+
/**
* create the PDF renderer
*/
@@ -279,13 +279,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected.");
}
}
-
+
/**
* {@inheritDoc}
*/
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
- PDFEncryptionParams params
+ PDFEncryptionParams params
= (PDFEncryptionParams)agent.getRendererOptions().get(ENCRYPTION_PARAMS);
if (params != null) {
this.encryptionParams = params; //overwrite if available
@@ -381,7 +381,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
if (pdfXMode != PDFXMode.DISABLED) {
log.debug(pdfXMode + " is active.");
- log.warn("Note: " + pdfXMode
+ log.warn("Note: " + pdfXMode
+ " support is work-in-progress and not fully implemented, yet!");
addPDFXOutputIntent();
}
@@ -389,7 +389,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
log.debug("PDF/A is active. Conformance Level: " + pdfAMode);
addPDFA1OutputIntent();
}
-
+
}
private void addsRGBColorSpace() throws IOException {
@@ -409,7 +409,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
this.sRGBColorSpace = PDFICCBasedColorSpace.setupsRGBAsDefaultRGBColorSpace(pdfDoc);
}
}
-
+
private void addDefaultOutputProfile() throws IOException {
if (this.outputProfile != null) {
return;
@@ -438,7 +438,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
outputProfile = sRGBColorSpace.getICCStream();
}
}
-
+
/**
* Adds an OutputIntent to the PDF as mandated by PDF/A-1 when uncalibrated color spaces
* are used (which is true if we use DeviceRGB to represent sRGB colors).
@@ -446,7 +446,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
*/
private void addPDFA1OutputIntent() throws IOException {
addDefaultOutputProfile();
-
+
String desc = ColorProfileUtil.getICCProfileDescription(this.outputProfile.getICCProfile());
PDFOutputIntent outputIntent = pdfDoc.getFactory().makeOutputIntent();
outputIntent.setSubtype(PDFOutputIntent.GTS_PDFA1);
@@ -463,7 +463,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
*/
private void addPDFXOutputIntent() throws IOException {
addDefaultOutputProfile();
-
+
String desc = ColorProfileUtil.getICCProfileDescription(this.outputProfile.getICCProfile());
int deviceClass = this.outputProfile.getICCProfile().getProfileClass();
if (deviceClass != ICC_Profile.CLASS_OUTPUT) {
@@ -627,7 +627,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
return new PDFGraphics2DAdapter(this);
}
- /**
+ /**
* writes out a comment.
* @param text text for the comment
*/
@@ -738,7 +738,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
page.getPageIndex());
pageReferences.put(page.getKey(), currentPage.referencePDF());
pvReferences.put(page.getKey(), page);
-
+
//Produce page labels
PDFPageLabels pageLabels = this.pdfDoc.getRoot().getPageLabels();
if (pageLabels == null) {
@@ -746,14 +746,14 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
pageLabels = this.pdfDoc.getFactory().makePageLabels();
this.pdfDoc.getRoot().setPageLabels(pageLabels);
}
- PDFNumsArray nums = pageLabels.getNums();
+ PDFNumsArray nums = pageLabels.getNums();
PDFDictionary dict = new PDFDictionary(nums);
dict.put("P", page.getPageNumberString());
//TODO If the sequence of generated page numbers were inspected, this could be
//expressed in a more space-efficient way
nums.put(page.getPageIndex(), dict);
}
-
+
/**
* This method creates a pdf stream for the current page
* uses it as the contents of a new page. The page is written
@@ -789,7 +789,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
pageHeight / 1000f);
currentState.concatenate(basicPageTransform);
currentStream.add(CTMHelper.toPDFString(basicPageTransform, false) + " cm\n");
-
+
super.renderPage(page);
this.pdfDoc.registerObject(currentStream);
@@ -811,9 +811,9 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
new AffineTransform(CTMHelper.toPDFArray(ctm)));
if (clippingRect != null) {
- clipRect((float)clippingRect.getX() / 1000f,
- (float)clippingRect.getY() / 1000f,
- (float)clippingRect.getWidth() / 1000f,
+ clipRect((float)clippingRect.getX() / 1000f,
+ (float)clippingRect.getY() / 1000f,
+ (float)clippingRect.getWidth() / 1000f,
(float)clippingRect.getHeight() / 1000f);
}
// multiply with current CTM
@@ -832,7 +832,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(CTMHelper.toPDFString(at, false) + " cm\n");
}
}
-
+
/**
* Formats a float value (normally coordinates) as Strings.
* @param value the value
@@ -841,9 +841,9 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
protected static String format(float value) {
return PDFNumber.doubleOut(value);
}
-
+
/** {@inheritDoc} */
- protected void drawBorderLine(float x1, float y1, float x2, float y2,
+ protected void drawBorderLine(float x1, float y1, float x2, float y2,
boolean horz, boolean startOrBefore, int style, Color col) {
float w = x2 - x1;
float h = y2 - y1;
@@ -853,7 +853,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
return;
}
switch (style) {
- case Constants.EN_DASHED:
+ case Constants.EN_DASHED:
setColor(col, false, null);
if (horz) {
float unit = Math.abs(2 * h);
@@ -865,7 +865,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[" + format(unit) + "] 0 d ");
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
float unit = Math.abs(2 * w);
@@ -877,7 +877,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[" + format(unit) + "] 0 d ");
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
break;
@@ -894,7 +894,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[0 " + format(unit) + "] 0 d ");
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
float unit = Math.abs(2 * w);
@@ -906,7 +906,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[0 " + format(unit) + " ] 0 d ");
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
break;
@@ -918,18 +918,18 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(h3) + " w\n");
float ym1 = y1 + (h3 / 2);
float ym2 = ym1 + h3 + h3;
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
- currentStream.add(format(x1) + " " + format(ym2) + " m "
+ currentStream.add(format(x1) + " " + format(ym2) + " m "
+ format(x2) + " " + format(ym2) + " l S\n");
} else {
float w3 = w / 3;
currentStream.add(format(w3) + " w\n");
float xm1 = x1 + (w3 / 2);
float xm2 = xm1 + w3 + w3;
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
- currentStream.add(format(xm2) + " " + format(y1) + " m "
+ currentStream.add(format(xm2) + " " + format(y1) + " m "
+ format(xm2) + " " + format(y2) + " l S\n");
}
break;
@@ -945,13 +945,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(h3) + " w\n");
float ym1 = y1 + (h3 / 2);
setColor(uppercol, false, null);
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
setColor(col, false, null);
- currentStream.add(format(x1) + " " + format(ym1 + h3) + " m "
+ currentStream.add(format(x1) + " " + format(ym1 + h3) + " m "
+ format(x2) + " " + format(ym1 + h3) + " l S\n");
setColor(lowercol, false, null);
- currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m "
+ currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m "
+ format(x2) + " " + format(ym1 + h3 + h3) + " l S\n");
} else {
Color leftcol = lightenColor(col, -colFactor);
@@ -960,13 +960,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(w3) + " w\n");
float xm1 = x1 + (w3 / 2);
setColor(leftcol, false, null);
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
setColor(col, false, null);
- currentStream.add(format(xm1 + w3) + " " + format(y1) + " m "
+ currentStream.add(format(xm1 + w3) + " " + format(y1) + " m "
+ format(xm1 + w3) + " " + format(y2) + " l S\n");
setColor(rightcol, false, null);
- currentStream.add(format(xm1 + w3 + w3) + " " + format(y1) + " m "
+ currentStream.add(format(xm1 + w3 + w3) + " " + format(y1) + " m "
+ format(xm1 + w3 + w3) + " " + format(y2) + " l S\n");
}
break;
@@ -982,14 +982,14 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(h) + " w\n");
float ym1 = y1 + (h / 2);
setColor(c, false, null);
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
} else {
c = lightenColor(c, (startOrBefore ? 1 : -1) * colFactor);
currentStream.add(format(w) + " w\n");
float xm1 = x1 + (w / 2);
setColor(c, false, null);
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
}
break;
@@ -1002,17 +1002,17 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
if (horz) {
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
}
}
-
+
/**
* Sets the current line width in points.
* @param width line width in points
@@ -1023,10 +1023,10 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(width) + " w\n");
}
}
-
+
/** {@inheritDoc} */
protected void clipRect(float x, float y, float width, float height) {
- currentStream.add(format(x) + " " + format(y) + " "
+ currentStream.add(format(x) + " " + format(y) + " "
+ format(width) + " " + format(height) + " re ");
clip();
}
@@ -1040,42 +1040,42 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Moves the current point to (x, y), omitting any connecting line segment.
+ * Moves the current point to (x, y), omitting any connecting line segment.
* @param x x coordinate
* @param y y coordinate
*/
protected void moveTo(float x, float y) {
currentStream.add(format(x) + " " + format(y) + " m ");
}
-
+
/**
- * Appends a straight line segment from the current point to (x, y). The
- * new current point is (x, y).
+ * Appends a straight line segment from the current point to (x, y). The
+ * new current point is (x, y).
* @param x x coordinate
* @param y y coordinate
*/
protected void lineTo(float x, float y) {
currentStream.add(format(x) + " " + format(y) + " l ");
}
-
+
/**
- * Closes the current subpath by appending a straight line segment from
+ * Closes the current subpath by appending a straight line segment from
* the current point to the starting point of the subpath.
*/
protected void closePath() {
currentStream.add("h ");
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
*/
protected void fillRect(float x, float y, float width, float height) {
if (width > 0 && height > 0) {
- currentStream.add(format(x) + " " + format(y) + " "
+ currentStream.add(format(x) + " " + format(y) + " "
+ format(width) + " " + format(height) + " re f\n");
}
}
-
+
/**
* Draw a line.
*
@@ -1131,7 +1131,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Returns area's id if it is the first area in the document with that id
+ * Returns area's id if it is the first area in the document with that id
* (i.e. if the area qualifies as a link target).
* Otherwise, or if the area has no id, null is returned.
*
@@ -1216,7 +1216,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* @param pdfPageRef the PDF page reference string
* @param relativeIPP the *relative* IP position in millipoints
* @param relativeBPP the *relative* BP position in millipoints
- * @param tf the transformation to apply once the relative positions have been
+ * @param tf the transformation to apply once the relative positions have been
* converted to points
*/
protected void saveAbsolutePosition(String id, String pdfPageRef,
@@ -1258,13 +1258,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* @param relativeBPP the *relative* BP position in millipoints
*/
protected void saveAbsolutePosition(String id, int relativeIPP, int relativeBPP) {
- saveAbsolutePosition(id, currentPageRef,
+ saveAbsolutePosition(id, currentPageRef,
relativeIPP, relativeBPP, currentState.getTransform());
}
/**
- * If the given block area is a possible link target, its id + absolute position will
- * be saved. The saved position is only correct if this function is called at the very
+ * If the given block area is a possible link target, its id + absolute position will
+ * be saved. The saved position is only correct if this function is called at the very
* start of renderBlock!
*
* @param block the block area in question
@@ -1392,7 +1392,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
// warn if link trait found but not allowed, else create link
if (linkTraitFound) {
if (!annotsAllowed) {
- log.warn("Skipping annotation for a link due to PDF profile: "
+ log.warn("Skipping annotation for a link due to PDF profile: "
+ pdfDoc.getProfile());
} else if (action != null) {
PDFLink pdfLink = factory.makeLink(ipRect, action);
@@ -1408,23 +1408,23 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
return tf;
}
-
+
/** {@inheritDoc} */
public void renderText(TextArea text) {
renderInlineAreaBackAndBorders(text);
Color ct = (Color) text.getTrait(Trait.COLOR);
updateColor(ct, true);
-
+
beginTextObject();
String fontName = getInternalFontNameForArea(text);
int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
-
+
// This assumes that *all* CIDFonts use a /ToUnicode mapping
Typeface tf = getTypeface(fontName);
-
+
textutil.updateTf(fontName, size / 1000f, tf.isMultiByte());
-
+
// word.getOffset() = only height of text itself
// currentBlockIPPosition: 0 for beginning of line; nonzero
@@ -1437,7 +1437,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
super.renderText(text);
textutil.writeTJ();
-
+
renderTextDecoration(tf, size, text, bl, rx);
}
@@ -1446,7 +1446,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
Font font = getFontFromArea(word.getParentArea());
String s = word.getWord();
- escapeText(s, word.getLetterAdjustArray(),
+ escapeText(s, word.getLetterAdjustArray(),
font, (AbstractTextArea)word.getParentArea());
super.renderWord(word);
@@ -1456,7 +1456,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
public void renderSpace(SpaceArea space) {
Font font = getFontFromArea(space.getParentArea());
String s = space.getSpace();
-
+
AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
escapeText(s, null, font, textArea);
@@ -1485,7 +1485,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
Font font, AbstractTextArea parentArea) {
escapeText(s, 0, s.length(), letterAdjust, font, parentArea);
}
-
+
/**
* Escapes text according to PDF rules.
* @param s Text to escape
@@ -1507,7 +1507,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
int l = s.length();
-
+
for (int i = start; i < end; i++) {
char orgChar = s.charAt(i);
char ch;
@@ -1553,7 +1553,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/**
* Establishes a new foreground or fill color. In contrast to updateColor
* this method does not check the PDFState for optimization possibilities.
- * @param col the color to apply
+ * @param col the color to apply
* @param fill true to set the fill color, false for the foreground color
* @param pdf StringBuffer to write the PDF code to, if null, the code is
* written to the current stream.
@@ -1567,7 +1567,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(color.getColorSpaceOut(fill));
}
}
-
+
/**
* Establishes a new foreground or fill color.
* @param col the color to apply (null skips this operation)
@@ -1595,7 +1595,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
protected void updateColor(Color col, boolean fill) {
updateColor(col, fill, null);
}
-
+
/** {@inheritDoc} */
public void renderImage(Image image, Rectangle2D pos) {
endTextObject();
@@ -1618,7 +1618,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
protected void putImage(String uri, Rectangle2D pos) {
putImage(uri, pos, null);
}
-
+
/**
* Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced.
* @param uri URL of the bitmap
@@ -1650,11 +1650,11 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
try {
ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
info = manager.getImageInfo(uri, sessionContext);
-
+
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, imageHandlerRegistry.getSupportedFlavors(), hints, sessionContext);
-
+
//First check for a dynamically registered handler
PDFImageHandler handler = imageHandlerRegistry.getHandler(img.getClass());
if (handler != null) {
@@ -1712,13 +1712,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(w) + " 0 0 "
+ format(-h) + " "
+ format(currentIPPosition / 1000f + x) + " "
- + format(currentBPPosition / 1000f + h + y)
+ + format(currentBPPosition / 1000f + h + y)
+ " cm\n" + xobj.getName() + " Do\n");
restoreGraphicsState();
}
/** {@inheritDoc} */
- protected RendererContext createRendererContext(int x, int y, int width, int height,
+ protected RendererContext createRendererContext(int x, int y, int width, int height,
Map foreignAttributes) {
RendererContext context = super.createRendererContext(
x, y, width, height, foreignAttributes);
@@ -1749,7 +1749,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
int style = area.getRuleStyle();
float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
float starty = (currentBPPosition + area.getOffset()) / 1000f;
- float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ area.getIPD()) / 1000f;
float ruleThickness = area.getRuleThickness() / 1000f;
Color col = (Color)area.getTrait(Trait.COLOR);
@@ -1758,7 +1758,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
case EN_SOLID:
case EN_DASHED:
case EN_DOUBLE:
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_DOTTED:
@@ -1766,7 +1766,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
//This displaces the dots to the right by half a dot's width
//TODO There's room for improvement here
currentStream.add("1 0 0 1 " + format(ruleThickness / 2) + " 0 cm\n");
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_GROOVE:
@@ -1811,7 +1811,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
public String getMimeType() {
return MIME_TYPE;
}
-
+
/**
* Sets the PDF/A mode for the PDF renderer.
* @param mode the PDF/A mode
@@ -1825,7 +1825,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* @param mode the PDF/X mode
*/
public void setXMode(PDFXMode mode) {
- this.pdfXMode = mode;
+ this.pdfXMode = mode;
}
/**
@@ -1846,7 +1846,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/**
* Sets the encryption parameters used by the PDF renderer.
- * @param encryptionParams the encryption parameters
+ * @param encryptionParams the encryption parameters
*/
public void setEncryptionParams(PDFEncryptionParams encryptionParams) {
this.encryptionParams = encryptionParams;
diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java b/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
index 826f610c8..8d1042f7f 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@ import org.apache.fop.render.Renderer;
import org.apache.fop.util.LogUtil;
/**
- * PDF renderer configurator
+ * PDF renderer configurator
*/
public class PDFRendererConfigurator extends PrintRendererConfigurator {
@@ -70,9 +70,9 @@ public class PDFRendererConfigurator extends PrintRendererConfigurator {
} catch (ConfigurationException e) {
LogUtil.handleException(log, e, false);
}
-
+
super.configure(renderer);
-
+
String s = cfg.getChild(PDFRenderer.PDF_A_MODE, true).getValue(null);
if (s != null) {
pdfRenderer.setAMode(PDFAMode.valueOf(s));
@@ -143,7 +143,7 @@ public class PDFRendererConfigurator extends PrintRendererConfigurator {
* @return Map the newly built filter map
* @throws ConfigurationException if a filter list is defined twice
*/
- public static Map buildFilterMapFromConfiguration(Configuration cfg)
+ public static Map buildFilterMapFromConfiguration(Configuration cfg)
throws ConfigurationException {
Map filterMap = new java.util.HashMap();
Configuration[] filterLists = cfg.getChildren("filterList");
@@ -156,11 +156,11 @@ public class PDFRendererConfigurator extends PrintRendererConfigurator {
String name = filt[j].getValue();
filterList.add(name);
}
-
+
if (type == null) {
type = PDFFilterList.DEFAULT_FILTER;
}
-
+
if (!filterList.isEmpty() && log.isDebugEnabled()) {
StringBuffer debug = new StringBuffer("Adding PDF filter");
if (filterList.size() != 1) {
@@ -175,13 +175,13 @@ public class PDFRendererConfigurator extends PrintRendererConfigurator {
}
log.debug(debug.toString());
}
-
+
if (filterMap.get(type) != null) {
- throw new ConfigurationException("A filterList of type '"
+ throw new ConfigurationException("A filterList of type '"
+ type + "' has already been defined");
}
filterMap.put(type, filterList);
}
- return filterMap;
+ return filterMap;
}
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java b/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java
index d3efa9667..de51aabc7 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java
@@ -49,5 +49,5 @@ public interface PDFRendererContextConstants extends RendererContextConstants {
/** The current pdf font size. */
String PDF_FONT_SIZE = "fontSize";
-
+
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java b/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java
index 98fd7b5db..fb65c9d74 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.fop.render.RendererConfigurator;
public class PDFRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_PDF};
-
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new PDFRenderer();
@@ -41,7 +41,7 @@ public class PDFRendererMaker extends AbstractRendererMaker {
public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
return new PDFRendererConfigurator(userAgent);
}
-
+
/** {@inheritDoc} */
public boolean needsOutputStream() {
return true;
diff --git a/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java b/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
index 73b50e323..e31628160 100644
--- a/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
+++ b/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -62,7 +62,7 @@ import org.apache.fop.svg.SVGUserAgent;
* It renders SVG to the PDF document using the PDFGraphics2D.
* The properties from the PDF renderer are subject to change.
*/
-public class PDFSVGHandler extends AbstractGenericSVGHandler
+public class PDFSVGHandler extends AbstractGenericSVGHandler
implements PDFRendererContextConstants {
/** logging instance */
@@ -93,7 +93,7 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
Map foreign = (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES);
QName qName = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
- if (foreign != null
+ if (foreign != null
&& "bitmap".equalsIgnoreCase((String)foreign.get(qName))) {
pdfi.paintAsBitmap = true;
}
@@ -156,12 +156,12 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
int xOffset = pdfInfo.currentXPosition;
int yOffset = pdfInfo.currentYPosition;
- FOUserAgent userAgent = context.getUserAgent();
+ FOUserAgent userAgent = context.getUserAgent();
final float deviceResolution = userAgent.getTargetResolution();
if (log.isDebugEnabled()) {
log.debug("Generating SVG at " + deviceResolution + "dpi.");
}
-
+
final float uaResolution = userAgent.getSourceResolution();
SVGUserAgent ua = new SVGUserAgent(userAgent, new AffineTransform());
@@ -169,22 +169,22 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
double s = uaResolution / deviceResolution;
AffineTransform resolutionScaling = new AffineTransform();
resolutionScaling.scale(s, s);
-
+
GVTBuilder builder = new GVTBuilder();
-
+
//Controls whether text painted by Batik is generated using text or path operations
boolean strokeText = false;
Configuration cfg = pdfInfo.cfg;
if (cfg != null) {
strokeText = cfg.getChild("stroke-text", true).getValueAsBoolean(strokeText);
}
-
- BridgeContext ctx = new PDFBridgeContext(ua,
+
+ BridgeContext ctx = new PDFBridgeContext(ua,
(strokeText ? null : pdfInfo.fi),
userAgent.getFactory().getImageManager(),
userAgent.getImageSessionContext(),
new AffineTransform());
-
+
GraphicsNode root;
try {
root = builder.build(ctx, doc);
@@ -211,7 +211,7 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
AffineTransform imageTransform = new AffineTransform();
imageTransform.concatenate(scaling);
imageTransform.concatenate(resolutionScaling);
-
+
/*
* Clip to the svg area.
* Note: To have the svg overlay (under) a text area then use
@@ -232,27 +232,27 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
if (pdfInfo.pdfContext == null) {
pdfInfo.pdfContext = pdfInfo.pdfPage;
}
- PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi,
+ PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi,
pdfInfo.pdfDoc,
pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
pdfInfo.currentFontName, pdfInfo.currentFontSize);
graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
if (!resolutionScaling.isIdentity()) {
- pdfInfo.currentStream.add("%resolution scaling for " + uaResolution
+ pdfInfo.currentStream.add("%resolution scaling for " + uaResolution
+ " -> " + deviceResolution + "\n");
pdfInfo.currentStream.add(
CTMHelper.toPDFString(resolutionScaling, false) + " cm\n");
graphics.scale(1 / s, 1 / s);
}
-
+
pdfInfo.currentStream.add("%SVG start\n");
//Save state and update coordinate system for the SVG image
pdfInfo.pdfState.push();
pdfInfo.pdfState.concatenate(imageTransform);
- //Now that we have the complete transformation matrix for the image, we can update the
+ //Now that we have the complete transformation matrix for the image, we can update the
//transformation matrix for the AElementBridge.
PDFAElementBridge aBridge = (PDFAElementBridge)ctx.getBridge(
SVGDOMImplementation.SVG_NAMESPACE_URI, SVGConstants.SVG_A_TAG);
@@ -272,7 +272,7 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
renderer.restoreGraphicsState();
pdfInfo.currentStream.add("%SVG end\n");
}
-
+
/** {@inheritDoc} */
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof PDFRenderer);
diff --git a/src/java/org/apache/fop/render/print/PageableRenderer.java b/src/java/org/apache/fop/render/print/PageableRenderer.java
index 947708cef..01a60646b 100644
--- a/src/java/org/apache/fop/render/print/PageableRenderer.java
+++ b/src/java/org/apache/fop/render/print/PageableRenderer.java
@@ -57,8 +57,8 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
* datatype: a positive Integer
*/
public static final String END_PAGE = "end-page";
-
-
+
+
/** first valid page number (1-based) */
protected int startNumber = 0;
/** last valid page number (1-based) */
@@ -68,17 +68,17 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
protected PagesMode mode = PagesMode.ALL;
private PageFilter pageFilter;
-
+
/**
* Creates a new PageableRenderer.
*/
public PageableRenderer() {
}
-
+
/** {@inheritDoc} */
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
-
+
Map rendererOptions = agent.getRendererOptions();
processOptions(rendererOptions);
this.pageFilter = new DefaultPageFilter();
@@ -97,7 +97,7 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
+ " must be an 'all', 'even', 'odd' or a PagesMode instance.");
}
}
-
+
o = rendererOptions.get(PageableRenderer.START_PAGE);
if (o != null) {
this.startNumber = getPositiveInteger(o);
@@ -132,7 +132,7 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
"Value must be a positive integer");
}
}
-
+
/** {@inheritDoc} */
public void stopRenderer() throws IOException {
super.stopRenderer();
@@ -149,13 +149,13 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
super.rememberPage(pageViewport);
}
}
-
+
private interface PageFilter {
boolean isValid(PageViewport page);
}
private class DefaultPageFilter implements PageFilter {
-
+
public boolean isValid(PageViewport page) {
int pageNum = page.getPageIndex() + 1;
assert pageNum >= 0;
@@ -171,7 +171,7 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
return true;
}
}
-
+
/** {@inheritDoc} */
public PageFormat getPageFormat(int pageIndex)
throws IndexOutOfBoundsException {
@@ -179,15 +179,15 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
if (pageIndex >= getNumberOfPages()) {
return null;
}
-
+
PageFormat pageFormat = new PageFormat();
-
+
Paper paper = new Paper();
-
+
Rectangle2D dim = getPageViewport(pageIndex).getViewArea();
double width = dim.getWidth();
double height = dim.getHeight();
-
+
// if the width is greater than the height assume landscape mode
// and swap the width and height values in the paper format
if (width > height) {
diff --git a/src/java/org/apache/fop/render/print/PagesMode.java b/src/java/org/apache/fop/render/print/PagesMode.java
index 6879aa68d..cf8bade1d 100644
--- a/src/java/org/apache/fop/render/print/PagesMode.java
+++ b/src/java/org/apache/fop/render/print/PagesMode.java
@@ -28,7 +28,7 @@ public final class PagesMode {
public static final PagesMode EVEN = new PagesMode("even");
/** the odd pages mode */
public static final PagesMode ODD = new PagesMode("odd");
-
+
private String name;
/**
@@ -43,7 +43,7 @@ public final class PagesMode {
public String getName() {
return this.name;
}
-
+
/**
* Returns a PagesMode instance by name.
* @param name the name of the pages mode
@@ -60,10 +60,10 @@ public final class PagesMode {
throw new IllegalArgumentException("Invalid value for PagesMode: " + name);
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return "PagesMode:" + name;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/print/PrintRenderer.java b/src/java/org/apache/fop/render/print/PrintRenderer.java
index 888776ecb..2eb2b07a2 100644
--- a/src/java/org/apache/fop/render/print/PrintRenderer.java
+++ b/src/java/org/apache/fop/render/print/PrintRenderer.java
@@ -39,14 +39,14 @@ public class PrintRenderer extends PageableRenderer {
* datatype: java.awt.print.PrinterJob
*/
public static final String PRINTER_JOB = "printerjob";
-
+
/**
* Printing parameter: the number of copies of the document to be printed,
* datatype: a positive Integer
*/
public static final String COPIES = "copies";
-
-
+
+
private int copies = 1;
private PrinterJob printerJob;
@@ -57,7 +57,7 @@ public class PrintRenderer extends PageableRenderer {
*/
public PrintRenderer() {
}
-
+
/**
* Creates a new PrintRenderer and allows you to pass in a specific PrinterJob instance
* that this renderer should work with.
@@ -69,7 +69,7 @@ public class PrintRenderer extends PageableRenderer {
this.printerJob = printerJob;
printerJob.setPageable(this);
}
-
+
private void initializePrinterJob() {
if (this.printerJob == null) {
printerJob = PrinterJob.getPrinterJob();
@@ -88,9 +88,9 @@ public class PrintRenderer extends PageableRenderer {
/** {@inheritDoc} */
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
-
+
Map rendererOptions = agent.getRendererOptions();
-
+
Object printerJobO = rendererOptions.get(PrintRenderer.PRINTER_JOB);
if (printerJobO != null) {
if (!(printerJobO instanceof PrinterJob)) {
@@ -118,7 +118,7 @@ public class PrintRenderer extends PageableRenderer {
public int getEndNumber() {
return endNumber;
}
-
+
/**
* Sets the number of the last page to be printed.
* @param end The ending page number
@@ -126,12 +126,12 @@ public class PrintRenderer extends PageableRenderer {
public void setEndPage(int end) {
this.endNumber = end;
}
-
+
/** @return the starting page number */
public int getStartPage() {
return startNumber;
}
-
+
/**
* Sets the number of the first page to be printed.
* @param start The starting page number
@@ -139,7 +139,7 @@ public class PrintRenderer extends PageableRenderer {
public void setStartPage(int start) {
this.startNumber = start;
}
-
+
/** {@inheritDoc} */
public void stopRenderer() throws IOException {
super.stopRenderer();
diff --git a/src/java/org/apache/fop/render/print/PrintRendererMaker.java b/src/java/org/apache/fop/render/print/PrintRendererMaker.java
index 2390567ef..21eb4717a 100644
--- a/src/java/org/apache/fop/render/print/PrintRendererMaker.java
+++ b/src/java/org/apache/fop/render/print/PrintRendererMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ import org.apache.fop.render.RendererConfigurator;
public class PrintRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_FOP_PRINT};
-
+
/**{@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new PrintRenderer();
diff --git a/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java b/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
index aa0fc88b9..b8ff8ef3f 100644
--- a/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
+++ b/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/ps/EPSTranscoder.java b/src/java/org/apache/fop/render/ps/EPSTranscoder.java
index c34772196..38e700a57 100644
--- a/src/java/org/apache/fop/render/ps/EPSTranscoder.java
+++ b/src/java/org/apache/fop/render/ps/EPSTranscoder.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps;
import org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D;
diff --git a/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java b/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java
index d5b2d2a23..e315b1433 100644
--- a/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java
+++ b/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.xmlgraphics.ps.PSDictionary;
* ImageEncoder implementation for CCITT encoded images.
*/
public class ImageEncoderCCITTFax implements ImageEncoder {
-
+
private final ImageRawCCITTFax ccitt;
/**
@@ -66,7 +66,7 @@ public class ImageEncoderCCITTFax implements ImageEncoder {
throw new IllegalStateException(
"Invalid compression scheme: " + compression);
}
-
+
return dict.toString() + " /CCITTFaxDecode";
}
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java b/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java
index ef4b9f16c..9baed2a8e 100644
--- a/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java
+++ b/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/ps/PSEventProducer.java b/src/java/org/apache/fop/render/ps/PSEventProducer.java
index 451ed1cea..c7c621e78 100644
--- a/src/java/org/apache/fop/render/ps/PSEventProducer.java
+++ b/src/java/org/apache/fop/render/ps/PSEventProducer.java
@@ -31,7 +31,7 @@ public interface PSEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,9 +50,9 @@ public interface PSEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* A PostScript dictionary could not be parsed.
* @param source the event source
@@ -61,5 +61,5 @@ public interface PSEventProducer extends EventProducer {
* @event.severity ERROR
*/
void postscriptDictionaryParseError(Object source, String content, Exception e);
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSFontUtils.java b/src/java/org/apache/fop/render/ps/PSFontUtils.java
index 63b12c5c8..6bb1f294b 100644
--- a/src/java/org/apache/fop/render/ps/PSFontUtils.java
+++ b/src/java/org/apache/fop/render/ps/PSFontUtils.java
@@ -55,7 +55,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
/** logging instance */
protected static Log log = LogFactory.getLog(PSFontUtils.class);
-
+
/**
* Generates the PostScript code for the font dictionary.
* @param gen PostScript generator to use for output
@@ -63,11 +63,11 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @return a Map of PSResource instances representing all defined fonts (key: font key)
* @throws IOException in case of an I/O problem
*/
- public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo)
+ public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo)
throws IOException {
return writeFontDict(gen, fontInfo, fontInfo.getFonts());
}
-
+
/**
* Generates the PostScript code for the font dictionary.
* @param gen PostScript generator to use for output
@@ -76,7 +76,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @return a Map of PSResource instances representing all defined fonts (key: font key)
* @throws IOException in case of an I/O problem
*/
- public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map fonts)
+ public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map fonts)
throws IOException {
gen.commentln("%FOPBeginFontDict");
@@ -88,7 +88,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
PSResource fontRes = new PSResource(PSResource.TYPE_FONT, tf.getFontName());
fontResources.put(key, fontRes);
embedFont(gen, tf, fontRes);
-
+
if (tf instanceof SingleByteFont) {
SingleByteFont sbf = (SingleByteFont)tf;
for (int i = 0, c = sbf.getAdditionalEncodingCount(); i < c; i++) {
@@ -108,12 +108,12 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
private static void reencodeFonts(PSGenerator gen, Map fonts) throws IOException {
ResourceTracker tracker = gen.getResourceTracker();
-
+
if (!tracker.isResourceSupplied(WINANSI_ENCODING_RESOURCE)) {
defineWinAnsiEncoding(gen);
}
gen.commentln("%FOPBeginFontReencode");
-
+
//Rewrite font encodings
Iterator iter = fonts.keySet().iterator();
while (iter.hasNext()) {
@@ -133,7 +133,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
//ignore (no encoding redefinition)
} else {
if (tf instanceof Base14Font) {
- //Our Base 14 fonts don't use the default encoding
+ //Our Base 14 fonts don't use the default encoding
redefineFontEncoding(gen, tf.getFontName(), tf.getEncodingName());
}
}
@@ -149,7 +149,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
if (tf == null) {
//This is to avoid an NPE if a malconfigured font is in the configuration but not
//used in the document. If it were used, we wouldn't get this far.
- String fallbackKey = fontInfo.getInternalFontKey(Font.DEFAULT_FONT);
+ String fallbackKey = fontInfo.getInternalFontKey(Font.DEFAULT_FONT);
tf = (Typeface)fonts.get(fallbackKey);
}
return tf;
@@ -162,7 +162,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @param fontRes the PSResource associated with the font
* @throws IOException In case of an I/O error
*/
- public static void embedFont(PSGenerator gen, Typeface tf, PSResource fontRes)
+ public static void embedFont(PSGenerator gen, Typeface tf, PSResource fontRes)
throws IOException {
boolean embeddedFont = false;
if (FontType.TYPE1 == tf.getFontType()) {
@@ -171,7 +171,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
if (isEmbeddable(cf)) {
InputStream in = getInputStreamOnFont(gen, cf);
if (in != null) {
- gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE,
+ gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE,
fontRes);
embedType1Font(gen, in);
gen.writeDSCComment(DSCConstants.END_RESOURCE);
@@ -193,8 +193,8 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
private static boolean isEmbeddable(CustomFont font) {
return font.isEmbeddable();
}
-
- private static InputStream getInputStreamOnFont(PSGenerator gen, CustomFont font)
+
+ private static InputStream getInputStreamOnFont(PSGenerator gen, CustomFont font)
throws IOException {
if (isEmbeddable(font)) {
Source source = font.getEmbedFileSource();
@@ -239,7 +239,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @param fonts the set of fonts to work with
* @return a Map of PSResource instances representing all defined fonts (key: font key)
*/
- public static Map determineSuppliedFonts(ResourceTracker resTracker,
+ public static Map determineSuppliedFonts(ResourceTracker resTracker,
FontInfo fontInfo, Map fonts) {
Map fontResources = new java.util.HashMap();
Iterator iter = fonts.keySet().iterator();
@@ -337,5 +337,5 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
gen.getResourceTracker().registerSuppliedResource(res);
return res;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java b/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
index 717153b3b..c17fe9e56 100644
--- a/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps;
import java.awt.Dimension;
@@ -47,7 +47,7 @@ public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter {
public PSGraphics2DAdapter(PSRenderer renderer) {
this(renderer.gen, true);
}
-
+
/**
* Constructor for use without a PSRenderer instance.
* @param gen the PostScript generator
@@ -57,16 +57,16 @@ public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter {
this.gen = gen;
this.clip = clip;
}
-
+
/** {@inheritDoc} */
- public void paintImage(Graphics2DImagePainter painter,
+ public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
float fwidth = width / 1000f;
float fheight = height / 1000f;
float fx = x / 1000f;
float fy = y / 1000f;
-
+
// get the 'width' and 'height' attributes of the SVG document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth() / 1000f;
@@ -83,7 +83,7 @@ public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter {
gen.defineRect(fx, fy, fwidth, fheight);
gen.writeln("clip");
}
-
+
// transform so that the coordinates (0,0) is from the top left
// and positive is down and to the right. (0,0) is where the
// viewBox puts it.
diff --git a/src/java/org/apache/fop/render/ps/PSImageFormResource.java b/src/java/org/apache/fop/render/ps/PSImageFormResource.java
index b00e2201d..11c3205e6 100644
--- a/src/java/org/apache/fop/render/ps/PSImageFormResource.java
+++ b/src/java/org/apache/fop/render/ps/PSImageFormResource.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ import org.apache.xmlgraphics.ps.PSResource;
public class PSImageFormResource extends PSResource {
private String uri;
-
+
/**
* Create a new Form Resource.
* @param id An ID for the form
@@ -37,7 +37,7 @@ public class PSImageFormResource extends PSResource {
public PSImageFormResource(int id, String uri) {
this("FOPForm:" + Integer.toString(id), uri);
}
-
+
/**
/**
* Create a new Form Resource.
@@ -48,7 +48,7 @@ public class PSImageFormResource extends PSResource {
super(PSResource.TYPE_FORM, name);
this.uri = uri;
}
-
+
/**
* Returns the image URI.
* @return the image URI
@@ -56,5 +56,5 @@ public class PSImageFormResource extends PSResource {
public String getImageURI() {
return this.uri;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSImageUtils.java b/src/java/org/apache/fop/render/ps/PSImageUtils.java
index 27eb736d8..7a011fbec 100644
--- a/src/java/org/apache/fop/render/ps/PSImageUtils.java
+++ b/src/java/org/apache/fop/render/ps/PSImageUtils.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps;
/**
diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java
index f84f46bf9..9f8cdc771 100644
--- a/src/java/org/apache/fop/render/ps/PSRenderer.java
+++ b/src/java/org/apache/fop/render/ps/PSRenderer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -121,7 +121,7 @@ import org.apache.fop.util.CharUtilities;
*
* This renderer inserts FOP-specific comments into the PostScript stream which
* may help certain users to do certain types of post-processing of the output.
- * These comments all start with "%FOP".
+ * These comments all start with "%FOP".
*
* @author Apache FOP Development Team
* @version $Id$
@@ -150,7 +150,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
private OutputStream outputStream;
/** the temporary file in case of two-pass processing */
private File tempFile;
-
+
/** The PostScript generator used to output the PostScript */
protected PSGenerator gen;
/** Determines whether the PS file is generated in two passes to minimize file size */
@@ -181,13 +181,13 @@ public class PSRenderer extends AbstractPathOrientedRenderer
/** Is used to determine the document's bounding box */
private Rectangle2D documentBoundingBox;
-
+
/** This is a collection holding all document header comments */
private Collection headerComments;
/** This is a collection holding all document footer comments */
private Collection footerComments;
-
+
/** {@inheritDoc} */
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
@@ -215,7 +215,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected.");
}
}
-
+
private int intValueOf(Object obj) {
if (obj instanceof Integer) {
return ((Integer)obj).intValue();
@@ -225,11 +225,11 @@ public class PSRenderer extends AbstractPathOrientedRenderer
throw new IllegalArgumentException("Integer or String with a number expected.");
}
}
-
+
/**
* Sets the landscape mode for this renderer.
* @param value false will normally generate a "pseudo-portrait" page, true will rotate
- * a "wider-than-long" page by 90 degrees.
+ * a "wider-than-long" page by 90 degrees.
*/
public void setAutoRotateLandscape(boolean value) {
this.autoRotateLandscape = value;
@@ -251,7 +251,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
throw new IllegalArgumentException("Only language levels 2 or 3 are allowed/supported");
}
}
-
+
/**
* Return the PostScript language level that the renderer produces.
* @return the language level
@@ -259,12 +259,12 @@ public class PSRenderer extends AbstractPathOrientedRenderer
public int getLanguageLevel() {
return this.languageLevel;
}
-
+
/**
* Sets the resource optimization mode. If set to true, the renderer does two passes to
* only embed the necessary resources in the PostScript file. This is slower, but produces
* smaller files.
- * @param value true to enable the resource optimization
+ * @param value true to enable the resource optimization
*/
public void setOptimizeResources(boolean value) {
this.twoPassGeneration = value;
@@ -335,7 +335,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
protected void clip() {
writeln("clip newpath");
}
-
+
/** {@inheritDoc} */
protected void clipRect(float x, float y, float width, float height) {
try {
@@ -350,27 +350,27 @@ public class PSRenderer extends AbstractPathOrientedRenderer
protected void moveTo(float x, float y) {
writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " M");
}
-
+
/**
- * Moves the current point by (x, y) relative to the current position,
- * omitting any connecting line segment.
+ * Moves the current point by (x, y) relative to the current position,
+ * omitting any connecting line segment.
* @param x x coordinate
* @param y y coordinate
*/
protected void rmoveTo(float x, float y) {
writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " RM");
}
-
+
/** {@inheritDoc} */
protected void lineTo(float x, float y) {
writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " lineto");
}
-
+
/** {@inheritDoc} */
protected void closePath() {
writeln("cp");
}
-
+
/** {@inheritDoc} */
protected void fillRect(float x, float y, float width, float height) {
if (width != 0 && height != 0) {
@@ -400,7 +400,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
protected boolean isImageInlined(String uri) {
return !isOptimizeResources() || uri == null || "".equals(uri);
}
-
+
/**
* Indicates whether an image should be inlined or added as a PostScript form.
* @param info the ImageInfo object of the image
@@ -410,7 +410,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (isImageInlined(info.getOriginalURI())) {
return true;
}
-
+
if (!isOptimizeResources()) {
throw new IllegalStateException("Must not get here if form support is enabled");
}
@@ -423,7 +423,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
info, inlineFlavors);
ImageProviderPipeline inlineChoice = manager.choosePipeline(inlineCandidates);
ImageFlavor inlineFlavor = (inlineChoice != null ? inlineChoice.getTargetFlavor() : null);
-
+
//Investigate choice for form mode
ImageFlavor[] formFlavors = getFormFlavors();
ImageProviderPipeline[] formCandidates
@@ -431,11 +431,11 @@ public class PSRenderer extends AbstractPathOrientedRenderer
info, formFlavors);
ImageProviderPipeline formChoice = manager.choosePipeline(formCandidates);
ImageFlavor formFlavor = (formChoice != null ? formChoice.getTargetFlavor() : null);
-
+
//Inline if form is not supported or if a better choice is available with inline mode
return formFlavor == null || !formFlavor.equals(inlineFlavor);
}
-
+
/** {@inheritDoc} */
protected void drawImage(String uri, Rectangle2D pos, Map foreignAttributes) {
endTextObject();
@@ -445,7 +445,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (log.isDebugEnabled()) {
log.debug("Handling image: " + uri);
}
-
+
ImageManager manager = getUserAgent().getFactory().getImageManager();
ImageInfo info = null;
try {
@@ -453,7 +453,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
info = manager.getImageInfo(uri, sessionContext);
int width = (int)pos.getWidth();
int height = (int)pos.getHeight();
-
+
//millipoints --> points for PostScript
float ptx = x / 1000f;
float pty = y / 1000f;
@@ -468,7 +468,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, getInlineFlavors(), hints, sessionContext);
-
+
//...and embed as inline image
if (img instanceof ImageGraphics2D) {
ImageGraphics2D imageG2D = (ImageGraphics2D)img;
@@ -488,7 +488,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
final ImageRawStream raw = (ImageRawStream)img;
if (raw instanceof ImageRawEPS) {
ImageRawEPS eps = (ImageRawEPS)raw;
- Rectangle2D bbox = eps.getBoundingBox();
+ Rectangle2D bbox = eps.getBoundingBox();
InputStream in = raw.createInputStream();
try {
PSImageUtils.renderEPS(in, uri,
@@ -525,9 +525,9 @@ public class PSRenderer extends AbstractPathOrientedRenderer
log.debug("Image " + info + " is embedded as a form later");
}
//Don't load image at this time, just put a form placeholder in the stream
- PSResource form = getFormForImage(uri);
+ PSResource form = getFormForImage(uri);
Rectangle2D targetRect = new Rectangle2D.Double(ptx, pty, ptw, pth);
- PSImageUtils.paintForm(form, info.getSize().getDimensionPt(), targetRect, gen);
+ PSImageUtils.paintForm(form, info.getSize().getDimensionPt(), targetRect, gen);
}
} catch (ImageException ie) {
@@ -586,7 +586,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
/** {@inheritDoc} */
- public void paintImage(RenderedImage image, RendererContext context,
+ public void paintImage(RenderedImage image, RendererContext context,
int x, int y, int width, int height) throws IOException {
float fx = (float)x / 1000f;
x += currentIPPosition / 1000f;
@@ -606,12 +606,12 @@ public class PSRenderer extends AbstractPathOrientedRenderer
* @param endy the y end position
*/
private void drawLine(float startx, float starty, float endx, float endy) {
- writeln(gen.formatDouble(startx) + " "
- + gen.formatDouble(starty) + " M "
- + gen.formatDouble(endx) + " "
+ writeln(gen.formatDouble(startx) + " "
+ + gen.formatDouble(starty) + " M "
+ + gen.formatDouble(endx) + " "
+ gen.formatDouble(endy) + " lineto stroke newpath");
}
-
+
/** Saves the graphics state of the rendering engine. */
public void saveGraphicsState() {
endTextObject();
@@ -673,7 +673,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
handleIOTrouble(ioe);
}
}
-
+
private String getPostScriptNameForFontKey(String key) {
int pos = key.indexOf('_');
String postFix = null;
@@ -695,7 +695,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
return tf.getFontName() + postFix;
}
}
-
+
/**
* Returns the PSResource for the given font key.
* @param key the font key ("F*")
@@ -706,7 +706,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (this.fontResources != null) {
res = (PSResource)this.fontResources.get(key);
} else {
- this.fontResources = new java.util.HashMap();
+ this.fontResources = new java.util.HashMap();
}
if (res == null) {
res = new PSResource(PSResource.TYPE_FONT, getPostScriptNameForFontKey(key));
@@ -714,7 +714,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
return res;
}
-
+
/**
* Changes the currently used font.
* @param key key of the font ("F*")
@@ -742,15 +742,15 @@ public class PSRenderer extends AbstractPathOrientedRenderer
|| area.hasTrait(Trait.BORDER_AFTER)
|| area.hasTrait(Trait.BORDER_START)
|| area.hasTrait(Trait.BORDER_END)) {
- comment("%FOPBeginBackgroundAndBorder: "
+ comment("%FOPBeginBackgroundAndBorder: "
+ startx + " " + starty + " " + width + " " + height);
super.drawBackAndBorders(area, startx, starty, width, height);
- comment("%FOPEndBackgroundAndBorder");
+ comment("%FOPEndBackgroundAndBorder");
}
}
-
+
/** {@inheritDoc} */
- protected void drawBorderLine(float x1, float y1, float x2, float y2,
+ protected void drawBorderLine(float x1, float y1, float x2, float y2,
boolean horz, boolean startOrBefore, int style, Color col) {
try {
float w = x2 - x1;
@@ -760,7 +760,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
return;
}
switch (style) {
- case Constants.EN_DASHED:
+ case Constants.EN_DASHED:
useColor(col);
if (horz) {
float unit = Math.abs(2 * h);
@@ -902,14 +902,14 @@ public class PSRenderer extends AbstractPathOrientedRenderer
handleIOTrouble(ioe);
}
}
-
+
/** {@inheritDoc} */
public void startRenderer(OutputStream outputStream)
throws IOException {
log.debug("Rendering areas to PostScript...");
this.outputStream = outputStream;
- OutputStream out;
+ OutputStream out;
if (isOptimizeResources()) {
this.tempFile = File.createTempFile("fop", null);
out = new java.io.FileOutputStream(this.tempFile);
@@ -917,7 +917,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
} else {
out = this.outputStream;
}
-
+
//Setup for PostScript generation
this.gen = new PSGenerator(out) {
/** Need to subclass PSGenerator to have better URI resolution */
@@ -944,7 +944,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
gen.writeDSCComment(DSCConstants.BBOX, DSCConstants.ATEND);
gen.writeDSCComment(DSCConstants.HIRES_BBOX, DSCConstants.ATEND);
this.documentBoundingBox = new Rectangle2D.Double();
- gen.writeDSCComment(DSCConstants.DOCUMENT_SUPPLIED_RESOURCES,
+ gen.writeDSCComment(DSCConstants.DOCUMENT_SUPPLIED_RESOURCES,
new Object[] {DSCConstants.ATEND});
if (headerComments != null) {
for (Iterator iter = headerComments.iterator(); iter.hasNext();) {
@@ -988,7 +988,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
PSResource res = (PSResource)this.fontResources.get(key);
gen.notifyResourceUsage(res);
}*/
-
+
//Write trailer
gen.writeDSCComment(DSCConstants.TRAILER);
if (footerComments != null) {
@@ -1016,7 +1016,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
pageDeviceDictionary.clear();
}
}
-
+
/**
* Used for two-pass production. This will rewrite the PostScript file from the temporary
* file while adding all needed resources.
@@ -1030,7 +1030,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
in = new java.io.BufferedInputStream(in);
try {
try {
- ResourceHandler.process(this.userAgent, in, this.outputStream,
+ ResourceHandler.process(this.userAgent, in, this.outputStream,
this.fontInfo, resTracker, this.formResources,
this.currentPageNumber, this.documentBoundingBox);
this.outputStream.flush();
@@ -1100,7 +1100,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
super.processOffDocumentItem(oDI);
}
-
+
/**
* Formats and writes a List of PSSetupCode instances to the output stream.
* @param setupCodeList a List of PSSetupCode instances
@@ -1111,8 +1111,8 @@ public class PSRenderer extends AbstractPathOrientedRenderer
Iterator i = setupCodeList.iterator();
while (i.hasNext()) {
PSSetupCode setupCode = (PSSetupCode)i.next();
- gen.commentln("%FOPBegin" + type + ": ("
- + (setupCode.getName() != null ? setupCode.getName() : "")
+ gen.commentln("%FOPBegin" + type + ": ("
+ + (setupCode.getName() != null ? setupCode.getName() : "")
+ ")");
LineNumberReader reader = new LineNumberReader(
new java.io.StringReader(setupCode.getContent()));
@@ -1137,9 +1137,9 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (this.currentPageNumber == 0) {
writeHeader();
}
-
+
this.currentPageNumber++;
-
+
gen.getResourceTracker().notifyStartNewPage();
gen.getResourceTracker().notifyResourceUsageOnPage(PSProcSets.STD_PROCSET);
gen.writeDSCComment(DSCConstants.PAGE, new Object[]
@@ -1159,7 +1159,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
pageSizes.add(new Long(Math.round(pageHeight)));
}
pageDeviceDictionary.put("/PageSize", pageSizes);
-
+
if (page.hasExtensionAttachments()) {
for (Iterator iter = page.getExtensionAttachments().iterator();
iter.hasNext();) {
@@ -1245,7 +1245,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (safeSetPageDevice) {
content += " SSPD";
} else {
- content += " setpagedevice";
+ content += " setpagedevice";
}
writeEnclosedExtensionAttachment(new PSSetPageDevice(content));
}
@@ -1256,8 +1256,8 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
concatMatrix(1, 0, 0, -1, 0, pageHeight);
- gen.writeDSCComment(DSCConstants.END_PAGE_SETUP);
-
+ gen.writeDSCComment(DSCConstants.END_PAGE_SETUP);
+
//Process page
super.renderPage(page);
@@ -1287,7 +1287,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
comment("%FOPEndRegionViewport");
}
}
-
+
/** Indicates the beginning of a text object. */
protected void beginTextObject() {
if (!inTextMode) {
@@ -1327,16 +1327,16 @@ public class PSRenderer extends AbstractPathOrientedRenderer
handleIOTrouble(ioe);
}
}
-
+
beginTextObject();
- writeln("1 0 0 -1 " + gen.formatDouble(rx / 1000f)
+ writeln("1 0 0 -1 " + gen.formatDouble(rx / 1000f)
+ " " + gen.formatDouble(bl / 1000f) + " Tm");
-
+
super.renderText(area); //Updates IPD
renderTextDecoration(tf, fontsize, area, bl, rx);
}
-
+
/** {@inheritDoc} */
protected void renderWord(WordArea word) {
renderText((TextArea)word.getParentArea(), word.getWord(), word.getLetterAdjustArray());
@@ -1349,9 +1349,9 @@ public class PSRenderer extends AbstractPathOrientedRenderer
String s = space.getSpace();
char sp = s.charAt(0);
Font font = getFontFromArea(textArea);
-
- int tws = (space.isAdjustable()
- ? ((TextArea) space.getParentArea()).getTextWordSpaceAdjust()
+
+ int tws = (space.isAdjustable()
+ ? ((TextArea) space.getParentArea()).getTextWordSpaceAdjust()
+ 2 * textArea.getTextLetterSpaceAdjust()
: 0);
@@ -1366,7 +1366,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
return tf;
}
-
+
private void renderText(AbstractTextArea area, String text, int[] letterAdjust) {
String fontkey = getInternalFontNameForArea(area);
int fontSize = area.getTraitAsInteger(Trait.FONT_SIZE);
@@ -1411,8 +1411,8 @@ public class PSRenderer extends AbstractPathOrientedRenderer
int initialSize = text.length();
initialSize += initialSize / 2;
StringBuffer sb = new StringBuffer(initialSize);
- if (letterAdjust == null
- && area.getTextLetterSpaceAdjust() == 0
+ if (letterAdjust == null
+ && area.getTextLetterSpaceAdjust() == 0
&& area.getTextWordSpaceAdjust() == 0) {
sb.append("(");
for (int i = start; i < end; i++) {
@@ -1437,7 +1437,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
int cw = tf.getWidth(mapped, fontsize) / 1000;
int ladj = (letterAdjust != null && i < end - 1 ? letterAdjust[i + 1] : 0);
- int tls = (i < end - 1 ? area.getTextLetterSpaceAdjust() : 0);
+ int tls = (i < end - 1 ? area.getTextLetterSpaceAdjust() : 0);
offsets[i - start] = cw + ladj + tls + wordSpace;
PSGenerator.escapeChar(codepoint, sb);
}
@@ -1479,7 +1479,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
return null;
}
}
-
+
/** {@inheritDoc} */
protected void restoreStateStackAfterBreakOut(List breakOutList) {
try {
@@ -1496,16 +1496,16 @@ public class PSRenderer extends AbstractPathOrientedRenderer
handleIOTrouble(ioe);
}
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void startVParea(CTM ctm, Rectangle2D clippingRect) {
saveGraphicsState();
if (clippingRect != null) {
- clipRect((float)clippingRect.getX() / 1000f,
- (float)clippingRect.getY() / 1000f,
- (float)clippingRect.getWidth() / 1000f,
+ clipRect((float)clippingRect.getX() / 1000f,
+ (float)clippingRect.getY() / 1000f,
+ (float)clippingRect.getWidth() / 1000f,
(float)clippingRect.getHeight() / 1000f);
}
// multiply with current CTM
@@ -1528,12 +1528,12 @@ public class PSRenderer extends AbstractPathOrientedRenderer
super.renderBlockViewport(bv, children);
comment("%FOPEndBlockViewport");
}
-
+
/** {@inheritDoc} */
protected void renderInlineParent(InlineParent ip) {
super.renderInlineParent(ip);
}
-
+
/**
* {@inheritDoc}
*/
@@ -1545,7 +1545,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
int style = area.getRuleStyle();
float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
float starty = (currentBPPosition + area.getOffset()) / 1000f;
- float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ area.getIPD()) / 1000f;
float ruleThickness = area.getRuleThickness() / 1000f;
Color col = (Color)area.getTrait(Trait.COLOR);
@@ -1555,7 +1555,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
case EN_SOLID:
case EN_DASHED:
case EN_DOUBLE:
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_DOTTED:
@@ -1563,13 +1563,13 @@ public class PSRenderer extends AbstractPathOrientedRenderer
//This displaces the dots to the right by half a dot's width
//TODO There's room for improvement here
gen.concatMatrix(1, 0, 0, 1, ruleThickness / 2, 0);
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_GROOVE:
case EN_RIDGE:
float half = area.getRuleThickness() / 2000f;
-
+
gen.useColor(lightenColor(col, 0.6f));
moveTo(startx, starty);
lineTo(endx, starty);
@@ -1606,7 +1606,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void renderImage(Image image, Rectangle2D pos) {
drawImage(image.getURL(), pos);
@@ -1615,7 +1615,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
/**
* {@inheritDoc}
*/
- protected RendererContext createRendererContext(int x, int y, int width, int height,
+ protected RendererContext createRendererContext(int x, int y, int width, int height,
Map foreignAttributes) {
RendererContext context = super.createRendererContext(
x, y, width, height, foreignAttributes);
@@ -1631,7 +1631,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
/**
* Formats and writes a PSExtensionAttachment to the output stream.
- *
+ *
* @param attachment an PSExtensionAttachment instance
*/
private void writeEnclosedExtensionAttachment(PSExtensionAttachment attachment)
@@ -1661,7 +1661,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
/**
* Formats and writes a Collection of PSExtensionAttachment instances to
* the output stream.
- *
+ *
* @param attachmentCollection
* a Collection of PSExtensionAttachment instances
*/
@@ -1677,15 +1677,15 @@ public class PSRenderer extends AbstractPathOrientedRenderer
iter.remove();
}
}
-
+
/**
* Sets whether or not the safe set page device macro should be used
* (as opposed to directly invoking setpagedevice) when setting the
* postscript page device.
- *
+ *
* This option is a useful option when you want to guard against the possibility
- * of invalid/unsupported postscript key/values being placed in the page device.
- *
+ * of invalid/unsupported postscript key/values being placed in the page device.
+ *
* @param safeSetPageDevice setting to false and the renderer will make a
* standard "setpagedevice" call, setting to true will make a safe set page
* device macro call (default is false).
@@ -1701,14 +1701,14 @@ public class PSRenderer extends AbstractPathOrientedRenderer
* It can cause problems (unwanted PostScript subsystem initgraphics/erasepage calls)
* on some printers when the pagedevice is set. If this causes problems on a
* particular implementation then use this setting with a 'false' value to try and
- * minimize the number of setpagedevice calls in the postscript document output.
+ * minimize the number of setpagedevice calls in the postscript document output.
* bpb
to rtrAttr
. */
@@ -313,7 +313,7 @@ final class TextAttributesConverter {
* @param bl the Block object the properties are read from
* @param rtfAttr the RtfAttributes object the attributes are written to
*/
- private static void attrBackgroundColor(CommonBorderPaddingBackground bpb,
+ private static void attrBackgroundColor(CommonBorderPaddingBackground bpb,
RtfAttributes rtfAttr) {
Color fopValue = bpb.backgroundColor;
int rtfColor = 0;
@@ -334,11 +334,11 @@ final class TextAttributesConverter {
rtfAttr.set(RtfText.ATTR_BACKGROUND_COLOR, rtfColor);
}
-
+
private static void attrBaseLineShift(Length baselineShift, RtfAttributes rtfAttr) {
-
+
int s = baselineShift.getEnum();
-
+
if (s == Constants.EN_SUPER) {
rtfAttr.set(RtfText.ATTR_SUPERSCRIPT);
} else if (s == Constants.EN_SUB) {
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java b/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java
index d1fd0192e..71bc9ed88 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java b/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java
index f3502b4aa..7b8a22df2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IBorderAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IBorderAttributes.java
index 0e9820994..5b3153b15 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IBorderAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IBorderAttributes.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java
index 6afba3ba1..2fff24afa 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java
index 7966010b6..87beb24d8 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java
index afbbba04b..957ce62f6 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java
index 568c33996..14486d8d1 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java
index 9bc096e7a..194d25653 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java
index d341f80fe..743b10e85 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java
index 7e2936ea8..890e00760 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java
index e620ff996..2083f9b6e 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java
index 6c49e7c08..d30bbb173 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java
index a7cca6dcf..299ff2169 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberCitationContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberCitationContainer.java
index 16f4a4af3..dba341700 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberCitationContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberCitationContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java
index 1aa5820fb..77832cac2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java
index f2c9b0aa6..f940d9dec 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java
index 74a50b8b5..c2b78e8a8 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java
index a61edf803..afa62807f 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java
index 1545df320..0522cdf10 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java
index 58ca07196..528c05e70 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
*/
public interface IRtfTextrunContainer {
-
+
/**
* Returns the current RtfTextrun object.
* Opens a new one if necessary.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
index e96fbbe30..87f7fe520 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,13 +45,13 @@ public interface ITableAttributes {
/** half the space between the cells of a table row in twips */
String ATTR_RTF_15_TRGAPH = "trgaph";
-
+
/**
* Position of the leftmost edge of the table with respect to the
* left edge of its column
*/
String ATTR_ROW_LEFT_INDENT = "trleft";
-
+
/** table row header */
String ATTR_HEADER = "trhdr";
@@ -140,7 +140,7 @@ public interface ITableAttributes {
//Table row attributes
/** row attribute, keep-together */
String ROW_KEEP_TOGETHER = "trkeep";
-
+
/** Height of a table row in twips */
String ROW_HEIGHT = "trrh";
@@ -206,5 +206,5 @@ public interface ITableAttributes {
*/
String[] CELL_VERT_ALIGN = {
ATTR_CELL_VERT_ALIGN_TOP, ATTR_CELL_VERT_ALIGN_CENTER, ATTR_CELL_VERT_ALIGN_BOTTOM};
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java
index d94563c69..dc0e559cc 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -50,9 +50,9 @@ public interface ITableColumnsInfo {
/** @return number of columns */
int getNumberOfColumns();
-
+
/**
- *
+ *
* @return true, if it's the first of multiple spanning columns
*/
boolean getFirstSpanningCol();
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IrtfTemplateContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IrtfTemplateContainer.java
index 5a8b6a5b9..a02825b3c 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IrtfTemplateContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IrtfTemplateContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java
index 79171cb47..aec0237e5 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfter.java
index 75abb5fbb..078439306 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfter.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
index f71075d96..5fbde8d3e 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -123,7 +123,7 @@ implements IRtfParagraphContainer, IRtfExternalGraphicContainer, IRtfTableContai
table = new RtfTable(this, writer, tc);
return table;
}
-
+
public RtfTextrun getTextrun()
throws IOException {
return RtfTextrun.getTextrun(this, writer, null);
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
index 92d6a5655..2eb95b587 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -215,17 +215,17 @@ implements java.lang.Cloneable {
xslAttributes = new org.xml.sax.helpers.AttributesImpl(pAttribs);
}
}
-
+
/**
* Add integer value addValue
to attribute with name name
.
- * If there is no such setted attribute, then value of this attribure is equal to
+ * If there is no such setted attribute, then value of this attribure is equal to
* addValue
.
* @param addValue the increment of value
* @param name the name of attribute
*/
public void addIntegerValue(int addValue, String name) {
Integer value = (Integer) getValue(name);
- int v = (value != null) ? value.intValue() : 0;
+ int v = (value != null) ? value.intValue() : 0;
set(name, v + addValue);
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBefore.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBefore.java
index c48d50ec9..0828be238 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBefore.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBefore.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
index 23883f672..f691c211c 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java
index 986e79c0c..3eee4cd71 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java
index 641202c99..8df7bd7b2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -158,7 +158,7 @@ public final class RtfColorTable {
//The color currently does not exist, so add it to the table.
//First add it, then read the size as index (to return it).
//So the first added color gets index 1. That is OK, because
- //index 0 is reserved for auto-colored.
+ //index 0 is reserved for auto-colored.
addColor (identifier);
retVal = colorTable.size ();
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java
index a3db213c4..5a6b1d6ed 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java
index 3e37ec9d7..6204e2ac2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
index 3e64a0f7d..3f1e2f7e1 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -97,7 +97,7 @@ public abstract class RtfElement {
public void newLine() throws IOException {
writer.write("\n");
}
-
+
/**
* Write an RTF control word to our Writer
* @param word RTF control word to write
@@ -224,7 +224,7 @@ public abstract class RtfElement {
writeControlWord(cw);
writeAttributes((RtfAttributes) value, null);
return;
- }
+ }
writeControlWord(cw);
}
@@ -246,7 +246,7 @@ public abstract class RtfElement {
writeControlWord(cw);
writeAttributes((RtfAttributes) value, null);
return;
- }
+ }
writeControlWordNS(cw);
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
index 932198676..182894ea5 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -65,7 +65,7 @@ public class RtfExternalGraphic extends RtfElement {
super(reason);
}
}
-
+
//////////////////////////////////////////////////
// Supported Formats
//////////////////////////////////////////////////
@@ -83,7 +83,7 @@ public class RtfExternalGraphic extends RtfElement {
public static boolean isFormat(byte[] data) {
return false;
}
-
+
/**
* Convert image data if necessary - for example when format is not supported by rtf.
*
@@ -93,7 +93,7 @@ public class RtfExternalGraphic extends RtfElement {
public FormatBase convert(FormatBase format, byte[] data) {
return format;
}
-
+
/**
* Determine image file format.
*
@@ -118,7 +118,7 @@ public class RtfExternalGraphic extends RtfElement {
return null;
}
}
-
+
/**
* Get image type.
*
@@ -127,7 +127,7 @@ public class RtfExternalGraphic extends RtfElement {
public int getType() {
return ImageConstants.I_NOT_SUPPORTED;
}
-
+
/**
* Get rtf tag.
*
@@ -137,7 +137,7 @@ public class RtfExternalGraphic extends RtfElement {
return "";
}
}
-
+
private static class FormatGIF extends FormatBase {
public static boolean isFormat(byte[] data) {
// Indentifier "GIF8" on position 0
@@ -145,12 +145,12 @@ public class RtfExternalGraphic extends RtfElement {
return ImageUtil.compareHexValues(pattern, data, 0, true);
}
-
+
public int getType() {
return ImageConstants.I_GIF;
}
}
-
+
private static class FormatEMF extends FormatBase {
public static boolean isFormat(byte[] data) {
// No offical Indentifier known
@@ -158,28 +158,28 @@ public class RtfExternalGraphic extends RtfElement {
return ImageUtil.compareHexValues(pattern, data, 0, true);
}
-
+
public int getType() {
return ImageConstants.I_EMF;
}
-
+
public String getRtfTag() {
return "emfblip";
}
}
-
+
private static class FormatBMP extends FormatBase {
public static boolean isFormat(byte[] data) {
byte [] pattern = new byte [] {(byte) 0x42, (byte) 0x4D};
return ImageUtil.compareHexValues(pattern, data, 0, true);
}
-
+
public int getType() {
return ImageConstants.I_BMP;
}
}
-
+
private static class FormatJPG extends FormatBase {
public static boolean isFormat(byte[] data) {
// Indentifier "0xFFD8" on position 0
@@ -187,16 +187,16 @@ public class RtfExternalGraphic extends RtfElement {
return ImageUtil.compareHexValues(pattern, data, 0, true);
}
-
+
public int getType() {
return ImageConstants.I_JPG;
}
-
+
public String getRtfTag() {
return "jpegblip";
}
}
-
+
private static class FormatPNG extends FormatBase {
public static boolean isFormat(byte[] data) {
// Indentifier "PNG" on position 1
@@ -204,16 +204,16 @@ public class RtfExternalGraphic extends RtfElement {
return ImageUtil.compareHexValues(pattern, data, 1, true);
}
-
+
public int getType() {
return ImageConstants.I_PNG;
}
-
+
public String getRtfTag() {
return "pngblip";
}
}
-
+
//////////////////////////////////////////////////
// @@ Members
//////////////////////////////////////////////////
@@ -370,7 +370,7 @@ public class RtfExternalGraphic extends RtfElement {
throw new ExternalGraphicException("The attribute 'src' of "
+ "RtfSpaceManager
object.
*/
@@ -49,8 +49,8 @@ public class RtfSpaceManager {
}
/**
- * Iterates block-level stack (i.e. all open blocks) and stops updating
- * candidate for adding space-before/space-after attribute in case of
+ * Iterates block-level stack (i.e. all open blocks) and stops updating
+ * candidate for adding space-before/space-after attribute in case of
* candidate presence.
*/
public void stopUpdatingSpaceBefore() {
@@ -61,10 +61,10 @@ public class RtfSpaceManager {
}
}
}
-
+
/**
* Set attributes as candidate for space attributes inheritance.
- *
+ *
* @param attrs attributes to set
*/
public void setCandidate(RtfAttributes attrs) {
@@ -74,24 +74,24 @@ public class RtfSpaceManager {
splitter.setSpaceAfterCandidate(attrs);
}
}
-
+
/**
- * Builds RtfSpaceSplitter on attrs
and adds it to the
+ * Builds RtfSpaceSplitter on attrs
and adds it to the
* block-level stack.
- *
+ *
* @param attrs RtfAttribute to add
* @return instance of RtfSpaceSplitter
*/
public RtfSpaceSplitter pushRtfSpaceSplitter(RtfAttributes attrs) {
RtfSpaceSplitter splitter;
splitter = new RtfSpaceSplitter(attrs, accumulatedSpace);
- // set accumulatedSpace to 0, because now accumulatedSpace used
+ // set accumulatedSpace to 0, because now accumulatedSpace used
// in splitter
accumulatedSpace = 0;
blockAttributes.addLast(splitter);
return splitter;
}
-
+
/**
* Removes RtfSpaceSplitter from top of block-level stack.
*/
@@ -105,7 +105,7 @@ public class RtfSpaceManager {
/**
* Pushes inline attributes to inline-level stack.
- *
+ *
* @param attrs attributes to add
*/
public void pushInlineAttributes(RtfAttributes attrs) {
@@ -123,7 +123,7 @@ public class RtfSpaceManager {
/**
* Peeks at inline-level attribute stack.
- *
+ *
* @return RtfAttributes from top of inline-level stack
*/
public RtfAttributes getLastInlineAttribute() {
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java
index 19db4dc6a..689a2753f 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java
@@ -45,7 +45,7 @@ public class RtfSpaceSplitter {
/**
* Create RtfSpaceSplitter with given RtfAttributes.
- *
+ *
* @param attrs RtfAttributes for splitting
* @param previousSpace integer, representing accumulated spacing
*/
@@ -62,7 +62,7 @@ public class RtfSpaceSplitter {
/**
* Remove attributes with name key
from
* commonAttributes
and return it as int.
- *
+ *
* @param key attributes name to extract
* @return integer, representing value of extracted attributes
*/
@@ -86,10 +86,10 @@ public class RtfSpaceSplitter {
return spaceBefore;
}
- /**
+ /**
* Sets a candidate for space-before property.
- *
- * @param candidate instance of RtfAttributes
, considered as
+ *
+ * @param candidate instance of RtfAttributes
, considered as
* a candidate for space-before adding
*/
public void setSpaceBeforeCandidate(RtfAttributes candidate) {
@@ -98,10 +98,10 @@ public class RtfSpaceSplitter {
}
}
- /**
+ /**
* Sets a candidate for space-after property.
- *
- * @param candidate instance of RtfAttributes
, considered as
+ *
+ * @param candidate instance of RtfAttributes
, considered as
* a candidate for space-after adding
*/
public void setSpaceAfterCandidate(RtfAttributes candidate) {
@@ -117,19 +117,19 @@ public class RtfSpaceSplitter {
public boolean isAfterCadidateSet() {
return spaceAfterCandidate != null;
}
-
+
/**
* Stops updating candidates for space-before attribute.
*/
public void stopUpdatingSpaceBefore() {
updatingSpaceBefore = false;
- }
+ }
/**
* Adds corresponding attributes to their candidates.
- *
- * @return integer, representing value of space-before/space-after
- * attributes, that can't be added anywhere (i.e. these attributes
+ *
+ * @return integer, representing value of space-before/space-after
+ * attributes, that can't be added anywhere (i.e. these attributes
* hasn't their candidates)
*/
public int flush() {
@@ -144,7 +144,7 @@ public class RtfSpaceSplitter {
if (!isAfterCadidateSet()) {
accumulatingSpace += spaceAfter;
} else {
- spaceAfterCandidate.addIntegerValue(spaceAfter,
+ spaceAfterCandidate.addIntegerValue(spaceAfter,
RtfText.SPACE_AFTER);
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java
index a9b531ca3..c7cc6d36f 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,21 +36,21 @@ import java.io.Writer;
public class RtfString extends RtfElement {
private String text = "";
-
+
RtfString(RtfContainer parent, Writer w, String s)
throws IOException {
super(parent, w);
-
+
text = s;
}
-
+
/**
* @return true if this element would generate no "useful" RTF content
*/
public boolean isEmpty() {
return text.trim().equals("");
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -58,11 +58,11 @@ public class RtfString extends RtfElement {
protected void writeRtfContent() throws IOException {
RtfStringConverter.getInstance().writeRtfString(writer, text);
}
-
+
public String getText() {
return text;
}
-
+
public void setText(String s) {
text = s;
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java
index 04275fd72..40460bb4d 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -132,5 +132,5 @@ public class RtfStringConverter {
}
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java
index fdbe94cfc..b838fb8a4 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
index b8bb4b032..eda5644a2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -110,16 +110,16 @@ public class RtfTable extends RtfContainer {
writeControlWordNS("pard");
}
- writeGroupMark(true);
+ writeGroupMark(true);
}
-
+
/**
* Overridden to write RTF suffix code, what comes after our children
* @throws IOException for I/O problems
*/
protected void writeRtfSuffix() throws IOException {
writeGroupMark(false);
-
+
if (isNestedTable()) {
getRow().writeRowAndCellsDefintions();
}
@@ -154,7 +154,7 @@ public class RtfTable extends RtfContainer {
}
/**
- *
+ *
* @return RtfAttributes of Header
*/
public RtfAttributes getHeaderAttribs() {
@@ -173,7 +173,7 @@ public class RtfTable extends RtfContainer {
return super.getRtfAttributes();
}
-
+
/** @return true if the the table is a nested table */
public boolean isNestedTable() {
if (isNestedTable == null) {
@@ -194,9 +194,9 @@ public class RtfTable extends RtfContainer {
return false;
}
-
+
/**
- *
+ *
* @return Parent row table (for nested tables only)
*/
public RtfTableRow getRow() {
@@ -209,7 +209,7 @@ public class RtfTable extends RtfContainer {
e = e.parent;
}
- return null;
+ return null;
}
/**
@@ -219,7 +219,7 @@ public class RtfTable extends RtfContainer {
public void setBorderAttributes(RtfAttributes attributes) {
borderAttributes = attributes;
}
-
+
/**
* Returns the RtfAttributes for the borders of the table.
* @return Border attributes of the table.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
index 1ba590f22..740ea36e5 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -100,7 +100,7 @@ public class RtfTableCell
if (attrs == null) {
attrs = new RtfAttributes();
}
-
+
attrs.set("intbl");
paragraph = new RtfParagraph(this, writer, attrs);
@@ -192,13 +192,13 @@ public class RtfTableCell
* table (Word2000 seems to do the same).
* Cause of this, dont't write horizontally merged cells.
* They just exist as placeholders in TableContext class,
- * and are never written to RTF file.
+ * and are never written to RTF file.
*/
// horizontal cell merge codes
if (hMerge == MERGE_WITH_PREVIOUS) {
return offset;
}
-
+
newLine();
this.widthOffset = offset;
@@ -225,13 +225,13 @@ public class RtfTableCell
if (attrib.getValue("number-columns-spanned") != null) {
// Get the number of columns spanned
int nbMergedCells = ((Integer)attrib.getValue("number-columns-spanned")).intValue();
-
+
RtfTable tab = getRow().getTable();
-
+
// Get the context of the current table in order to get the width of each column
ITableColumnsInfo tableColumnsInfo
= tab.getITableColumnsInfo();
-
+
tableColumnsInfo.selectFirstColumn();
// Reach the column index in table context corresponding to the current column cell
@@ -273,7 +273,7 @@ public class RtfTableCell
return xPos;
}
-
+
/**
* Overriden to avoid writing any it's a merged cell.
* @throws IOException for I/O problems
@@ -283,7 +283,7 @@ public class RtfTableCell
if (hMerge == MERGE_WITH_PREVIOUS) {
return;
}
-
+
super.writeRtfContent();
}
@@ -297,7 +297,7 @@ public class RtfTableCell
if (hMerge == MERGE_WITH_PREVIOUS) {
return;
}
-
+
super.writeRtfPrefix();
}
@@ -310,7 +310,7 @@ public class RtfTableCell
if (hMerge == MERGE_WITH_PREVIOUS) {
return;
}
-
+
if (getRow().getTable().isNestedTable()) {
//nested table
writeControlWordNS("nestcell");
@@ -330,19 +330,19 @@ public class RtfTableCell
writeControlWord("qr");
} else {
RtfElement lastChild = null;
-
+
if (getChildren().size() > 0) {
lastChild = (RtfElement) getChildren().get(getChildren().size() - 1);
}
-
-
+
+
if (lastChild != null
&& lastChild instanceof RtfTextrun) {
- //Don't write \ql in order to allow for example a right aligned paragraph
+ //Don't write \ql in order to allow for example a right aligned paragraph
//in a not right aligned table-cell to write its \qr.
} else {
writeControlWord("ql");
- }
+ }
}
if (!containsText()) {
@@ -497,7 +497,7 @@ public class RtfTableCell
}
return result;
}
-
+
/**
* Returns the current RtfTextrun object.
* Opens a new one if necessary.
@@ -506,20 +506,20 @@ public class RtfTableCell
*/
public RtfTextrun getTextrun() throws IOException {
RtfAttributes attrs = new RtfAttributes();
-
+
if (!getRow().getTable().isNestedTable()) {
attrs.set("intbl");
}
-
+
RtfTextrun textrun = RtfTextrun.getTextrun(this, writer, attrs);
//Suppress the very last \par, because the closing \cell applies the
- //paragraph attributes.
- textrun.setSuppressLastPar(true);
-
+ //paragraph attributes.
+ textrun.setSuppressLastPar(true);
+
return textrun;
}
-
+
/**
* Get the parent row.
* @return The parent row.
@@ -534,6 +534,6 @@ public class RtfTableCell
e = e.parent;
}
- return null;
+ return null;
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
index 2182f94ec..fe936e3f5 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -145,15 +145,15 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
// now children can write themselves, we have the correct RTF prefix code
super.writeRtfContent();
}
-
+
/**
- *
+ *
* @throws IOException In case of a IO-problem
*/
public void writeRowAndCellsDefintions() throws IOException {
// render the row and cells definitions
writeControlWord("trowd");
-
+
if (!getTable().isNestedTable()) {
writeControlWord("itap0");
}
@@ -181,24 +181,24 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
// write X positions of our cells
int xPos = 0;
-
+
final Object leftIndent = attrib.getValue(ITableAttributes.ATTR_ROW_LEFT_INDENT);
if (leftIndent != null) {
xPos = ((Integer)leftIndent).intValue();
}
-
+
RtfAttributes tableBorderAttributes = getTable().getBorderAttributes();
-
+
int index = 0;
for (Iterator it = getChildren().iterator(); it.hasNext();) {
final RtfElement e = (RtfElement)it.next();
if (e instanceof RtfTableCell) {
-
+
RtfTableCell rtfcell = (RtfTableCell)e;
-
+
// Adjust the cell's display attributes so the table's/row's borders
// are drawn properly.
-
+
if (tableBorderAttributes != null) {
// get border attributes from table
if (index == 0) {
@@ -233,7 +233,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
}
}
}
-
+
// get border attributes from row
if (index == 0) {
if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_LEFT)) {
@@ -268,7 +268,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
}
index++; // Added by Boris POUDEROUS on 2002/07/02
}
-
+
newLine();
}
@@ -366,9 +366,9 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
public boolean isHighestCell(int cellId) {
return (highestCell == cellId) ? true : false;
}
-
+
/**
- *
+ *
* @return Parent table of the row.
*/
public RtfTable getTable() {
@@ -381,6 +381,6 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
e = e.parent;
}
- return null;
+ return null;
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java
index fa4cf3978..a02d6db8f 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
index 3dc2e59e0..b176e1ee2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -79,7 +79,7 @@ public class RtfText extends RtfElement {
/** RtfText attributes: paragraph shading attributes */
/** Constant for the shading of the paragraph */
public static final String SHADING = "shading";
- /** Constant for the document's color tableshading of the paragraph */
+ /** Constant for the document's color tableshading of the paragraph */
public static final String SHADING_FRONT_COLOR = "cfpat";
/** Constant for the 100% shading of the paragraph */
public static final int FULL_SHADING = 10000;
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
index 05a97ffd4..e0703d7ba 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,33 +29,33 @@ import java.util.ListIterator;
// FOP
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic;
-/**
- * Class which contains a linear text run. It has methods to add attributes,
+/**
+ * Class which contains a linear text run. It has methods to add attributes,
* text, paragraph breaks....
* @author Peter Herweg, pherweg@web.de
*/
public class RtfTextrun extends RtfContainer {
private boolean bSuppressLastPar = false;
private RtfListItem rtfListItem;
-
+
/** Manager for handling space-* property. */
private RtfSpaceManager rtfSpaceManager = new RtfSpaceManager();
-
+
/** Class which represents the opening of a RTF group mark.*/
private class RtfOpenGroupMark extends RtfElement {
-
+
RtfOpenGroupMark(RtfContainer parent, Writer w, RtfAttributes attr)
throws IOException {
super(parent, w, attr);
}
-
+
/**
* @return true if this element would generate no "useful" RTF content
*/
public boolean isEmpty() {
return false;
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -65,22 +65,22 @@ public class RtfTextrun extends RtfContainer {
writeAttributes(getRtfAttributes(), null);
}
}
-
+
/** Class which represents the closing of a RTF group mark.*/
private class RtfCloseGroupMark extends RtfElement {
-
+
RtfCloseGroupMark(RtfContainer parent, Writer w)
throws IOException {
super(parent, w);
}
-
+
/**
* @return true if this element would generate no "useful" RTF content
*/
public boolean isEmpty() {
return false;
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -92,19 +92,19 @@ public class RtfTextrun extends RtfContainer {
/** Class which represents a paragraph break.*/
private class RtfParagraphBreak extends RtfElement {
-
+
RtfParagraphBreak(RtfContainer parent, Writer w)
throws IOException {
super(parent, w);
}
-
+
/**
* @return true if this element would generate no "useful" RTF content
*/
public boolean isEmpty() {
return false;
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -113,16 +113,16 @@ public class RtfTextrun extends RtfContainer {
writeControlWord("par");
}
}
-
+
/** Create an RTF container as a child of given container */
RtfTextrun(RtfContainer parent, Writer w, RtfAttributes attrs) throws IOException {
super(parent, w, attrs);
}
-
-
+
+
/**
* Adds instance of OpenGroupMark
as a child with attributes.
- *
+ *
* @param attrs attributes to add
* @throws IOException for I/O problems
*/
@@ -132,17 +132,17 @@ public class RtfTextrun extends RtfContainer {
/**
* Adds instance of CloseGroupMark
as a child.
- *
+ *
* @throws IOException for I/O problems
*/
private void addCloseGroupMark() throws IOException {
RtfCloseGroupMark r = new RtfCloseGroupMark(this, writer);
}
-
+
/**
- * Pushes block attributes, notifies all opened blocks about pushing block
+ * Pushes block attributes, notifies all opened blocks about pushing block
* attributes, adds OpenGroupMark
as a child.
- *
+ *
* @param attrs the block attributes to push
* @throws IOException for I/O problems
*/
@@ -151,11 +151,11 @@ public class RtfTextrun extends RtfContainer {
RtfSpaceSplitter splitter = rtfSpaceManager.pushRtfSpaceSplitter(attrs);
addOpenGroupMark(splitter.getCommonAttributes());
}
-
+
/**
- * Pops block attributes, notifies all opened blocks about pushing block
+ * Pops block attributes, notifies all opened blocks about pushing block
* attributes, adds CloseGroupMark
as a child.
- *
+ *
* @throws IOException for I/O problems
*/
public void popBlockAttributes() throws IOException {
@@ -166,7 +166,7 @@ public class RtfTextrun extends RtfContainer {
/**
* Pushes inline attributes.
- *
+ *
* @param attrs the inline attributes to push
* @throws IOException for I/O problems
*/
@@ -177,17 +177,17 @@ public class RtfTextrun extends RtfContainer {
/**
* Pop inline attributes.
- *
+ *
* @throws IOException for I/O problems
*/
public void popInlineAttributes() throws IOException {
rtfSpaceManager.popInlineAttributes();
addCloseGroupMark();
}
-
+
/**
* Add string to children list.
- *
+ *
* @param s string to add
* @throws IOException for I/O problems
*/
@@ -202,20 +202,20 @@ public class RtfTextrun extends RtfContainer {
RtfString r = new RtfString(this, writer, s);
rtfSpaceManager.popRtfSpaceSplitter();
}
-
+
/**
* Inserts a footnote.
- *
+ *
* @return inserted footnote
* @throws IOException for I/O problems
*/
public RtfFootnote addFootnote() throws IOException {
return new RtfFootnote(this, writer);
}
-
+
/**
* Inserts paragraph break before all close group marks.
- *
+ *
* @throws IOException for I/O problems
*/
public void addParagraphBreak() throws IOException {
@@ -241,7 +241,7 @@ public class RtfTextrun extends RtfContainer {
}
}
}
-
+
/**
* Inserts a page number.
* @param attr Attributes for the page number to insert.
@@ -250,7 +250,7 @@ public class RtfTextrun extends RtfContainer {
public void addPageNumber(RtfAttributes attr) throws IOException {
RtfPageNumber r = new RtfPageNumber(this, writer, attr);
}
-
+
/**
* Inserts a hyperlink.
* @param attr Attributes for the hyperlink to insert.
@@ -260,7 +260,7 @@ public class RtfTextrun extends RtfContainer {
public RtfHyperLink addHyperlink(RtfAttributes attr) throws IOException {
return new RtfHyperLink(this, writer, attr);
}
-
+
/**
* Inserts a bookmark.
* @param id Id for the inserted bookmark
@@ -294,7 +294,7 @@ public class RtfTextrun extends RtfContainer {
throws IOException {
List list = container.getChildren();
-
+
if (list.size() == 0) {
//add a new RtfTextrun
RtfTextrun textrun = new RtfTextrun(container, writer, attrs);
@@ -302,7 +302,7 @@ public class RtfTextrun extends RtfContainer {
return textrun;
}
-
+
Object obj = list.get(list.size() - 1);
if (obj instanceof RtfTextrun) {
@@ -313,18 +313,18 @@ public class RtfTextrun extends RtfContainer {
//add a new RtfTextrun as the last child
RtfTextrun textrun = new RtfTextrun(container, writer, attrs);
list.add(textrun);
-
+
return textrun;
}
-
+
/**
* specify, if the last paragraph control word (\par) should be suppressed.
* @param bSuppress true, if the last \par should be suppressed
- */
+ */
public void setSuppressLastPar(boolean bSuppress) {
bSuppressLastPar = bSuppress;
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -336,7 +336,7 @@ public class RtfTextrun extends RtfContainer {
* 2. To write the children
* Maybe this can be done more efficient.
*/
-
+
boolean bHasTableCellParent =
this.getParentOfClass(RtfTableCell.class) != null;
RtfAttributes attrBlockLevel = new RtfAttributes();
@@ -349,7 +349,7 @@ public class RtfTextrun extends RtfContainer {
break;
}
}
-
+
//get last RtfParagraphBreak, which is not followed by any visible child
RtfParagraphBreak lastParagraphBreak = null;
if (bLast) {
@@ -366,10 +366,10 @@ public class RtfTextrun extends RtfContainer {
}
}
}
-
+
//may contain for example \intbl
writeAttributes(attrib, null);
-
+
if (rtfListItem != null) {
rtfListItem.getRtfListStyle().writeParagraphPrefix(this);
}
@@ -384,8 +384,8 @@ public class RtfTextrun extends RtfContainer {
if (bHasTableCellParent) {
attrBlockLevel.set(e.getRtfAttributes());
}
-
-
+
+
/**
* -Write RtfParagraphBreak only, if the previous visible child
* was't also a RtfParagraphBreak.
@@ -396,21 +396,21 @@ public class RtfTextrun extends RtfContainer {
*/
boolean bHide = false;
bHide = bRtfParagraphBreak;
- bHide = bHide
- && (bPrevPar
- || bFirst
- || (bSuppressLastPar && bLast && lastParagraphBreak != null
+ bHide = bHide
+ && (bPrevPar
+ || bFirst
+ || (bSuppressLastPar && bLast && lastParagraphBreak != null
&& e == lastParagraphBreak));
-
+
if (!bHide) {
newLine();
- e.writeRtf();
-
+ e.writeRtf();
+
if (rtfListItem != null && e instanceof RtfParagraphBreak) {
rtfListItem.getRtfListStyle().writeParagraphPrefix(this);
}
}
-
+
if (e instanceof RtfParagraphBreak) {
bPrevPar = true;
} else if (e instanceof RtfCloseGroupMark) {
@@ -422,26 +422,26 @@ public class RtfTextrun extends RtfContainer {
bFirst = bFirst && e.isEmpty();
}
} //for (Iterator it = ...)
-
+
//
if (bHasTableCellParent) {
writeAttributes(attrBlockLevel, null);
}
-
+
}
-
+
/**
* Set the parent list-item of the textrun.
- *
+ *
* @param listItem parent list-item of the textrun
*/
public void setRtfListItem(RtfListItem listItem) {
rtfListItem = listItem;
}
-
+
/**
- * Gets the parent list-item of the textrun.
- *
+ * Gets the parent list-item of the textrun.
+ *
* @return parent list-item of the textrun
*/
public RtfListItem getRtfListItem() {
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
index c690a287b..339434b69 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -63,7 +63,7 @@ class WhitespaceCollapser {
txt.setText(newString);
}
}
-
+
/** process one RtfString from our container */
private void processString(RtfString txt) {
final String newString = processString(txt.getText());
@@ -71,7 +71,7 @@ class WhitespaceCollapser {
txt.setText(newString);
}
}
-
+
/** process one String */
private String processString(String txt) {
final String orig = txt;
@@ -80,7 +80,7 @@ class WhitespaceCollapser {
// to collapse multiple spaces into one
if (orig == null) {
return null;
- } else if (orig.length() > 0) {
+ } else if (orig.length() > 0) {
final boolean allSpaces = orig.trim().length() == 0;
final boolean endSpace = allSpaces
|| Character.isWhitespace(orig.charAt(orig.length() - 1));
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
index 7e9b59c20..430231792 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java
index 274ad53f5..859472709 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java
index 93bb991e8..c5e3cb191 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -67,7 +67,7 @@ public class ImageUtil {
} else {
//for example "600.0pt" has to be exited,
//when the dot is reached.
- break;
+ break;
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
index 826be58e7..96d65ad12 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -60,7 +60,7 @@ public class TableContext implements ITableColumnsInfo {
* as a number-rows-spanned attribute has been found.
*/
private final List colRowSpanningAttrs = new java.util.ArrayList();
-
+
/**
* This ArrayList contains one element for each column in the table.
* value == true means, it's the first of multiple spanned columns
@@ -71,7 +71,7 @@ public class TableContext implements ITableColumnsInfo {
private boolean bNextRowBelongsToHeader = false;
/**
- *
+ *
* @param value Specifies, if next row belongs to header
*/
public void setNextRowBelongsToHeader(boolean value) {
@@ -79,7 +79,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @return true, if next row belongs to header
*/
public boolean getNextRowBelongsToHeader() {
@@ -87,7 +87,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @param ctx BuilderContext
*/
public TableContext(BuilderContext ctx) {
@@ -95,7 +95,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- * Adds a column and sets its width.
+ * Adds a column and sets its width.
* @param width Width of next column
*/
public void setNextColumnWidth(Float width) {
@@ -103,7 +103,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @return RtfAttributes of current row-spanning cell
*/
public RtfAttributes getColumnRowSpanningAttrs() {
@@ -111,15 +111,15 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @return Number of currently spanned rows
*/
public Integer getColumnRowSpanningNumber() {
return (Integer)colRowSpanningNumber.get(colIndex);
}
-
+
/**
- *
+ *
* @return true, if it's the first of multiple spanning columns
*/
public boolean getFirstSpanningCol() {
@@ -128,7 +128,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @param iRowSpanning number of rows to span
* @param attrs RtfAttributes of row-spanning cell
*/
@@ -145,7 +145,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @param iRowSpanning number of rows to span in next column
* @param attrs RtfAttributes of row-spanning cell
*/
@@ -154,10 +154,10 @@ public class TableContext implements ITableColumnsInfo {
colRowSpanningNumber.add(iRowSpanning);
colRowSpanningAttrs.add(colIndex, attrs);
}
-
+
/**
- *
- * @param bFirstSpanningCol specifies, if it's the first of
+ *
+ * @param bFirstSpanningCol specifies, if it's the first of
* multiple spanned columns
*/
public void setCurrentFirstSpanningCol(
@@ -174,8 +174,8 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
- * @param bFirstSpanningCol specifies, if it's the first of
+ *
+ * @param bFirstSpanningCol specifies, if it's the first of
* multiple spanned columns
*/
public void setNextFirstSpanningCol(
@@ -234,7 +234,7 @@ public class TableContext implements ITableColumnsInfo {
if (colIndex < 0) {
throw new IllegalStateException("colIndex must not be negative!");
} else if (colIndex >= getNumberOfColumns()) {
- log.warn("Column width for column " + (colIndex + 1) + " is not defined, using "
+ log.warn("Column width for column " + (colIndex + 1) + " is not defined, using "
+ INVALID_COLUMN_WIDTH);
while (colIndex >= getNumberOfColumns()) {
setNextColumnWidth(new Float(INVALID_COLUMN_WIDTH));
@@ -250,9 +250,9 @@ public class TableContext implements ITableColumnsInfo {
public void setColumnIndex(int index) {
colIndex = index;
}
-
+
/**
- * @return Index of current column
+ * @return Index of current column
*/
public int getColumnIndex() {
return colIndex;
diff --git a/src/java/org/apache/fop/render/txt/Helper.java b/src/java/org/apache/fop/render/txt/Helper.java
index f2bd14914..1bdf86f0f 100644
--- a/src/java/org/apache/fop/render/txt/Helper.java
+++ b/src/java/org/apache/fop/render/txt/Helper.java
@@ -30,9 +30,9 @@ public final class Helper {
private Helper() { }
/**
- * Returns nearest integer to x
, divisible by
- * quantum
.
- *
+ * Returns nearest integer to x
, divisible by
+ * quantum
.
+ *
* @param x integer for quantization
* @param quantum integer, representing quantization
* @return computed nearest integer
@@ -44,9 +44,9 @@ public final class Helper {
}
/**
- * Returns minimal possible integer, greater or equal than
+ * Returns minimal possible integer, greater or equal than
* x
, divisible by quantum
.
- *
+ *
* @param x integer for quantization
* @param quantum integer, representing quantization
* @return computed nearest integer
@@ -59,7 +59,7 @@ public final class Helper {
/**
* Returns maximum possible integer, less or equal than
* oldValue
, divisible by quantum
.
- *
+ *
* @param x integer for quantization
* @param quantum integer, representing quantization
* @return computed nearest integer
@@ -71,9 +71,9 @@ public final class Helper {
/**
* Returns the closest integer to x/y
fraction.
- * It's possible to consider this methos as a analog of Math.round(x/y),
+ * It's possible to consider this methos as a analog of Math.round(x/y),
* without having deal with non-integer.
- *
+ *
* @param x integer, fraction numerator
* @param y integer, fraction denominator
* @return the value of the fraction rounded to the nearest
@@ -84,31 +84,31 @@ public final class Helper {
}
/**
- * Returns the smallest integer that is greater than or equal to the
+ * Returns the smallest integer that is greater than or equal to the
* x/y
fraction.
- * It's possible to consider this function as a analog of Math.ceil(x/y),
+ * It's possible to consider this function as a analog of Math.ceil(x/y),
* without having deal with non-integer.
- *
+ *
* @param x integer, fraction numerator
* @param y integer, fraction denominator
- * @return the smallest integer that is greater than or equal to
+ * @return the smallest integer that is greater than or equal to
* x/y
fraction
* @see java.lang.Math#ceil(double)
*/
public static int ceilPosition(int x, int y) {
return ceil(x, y) / y;
}
-
-
+
+
/**
* Returns the largest integer that is less than or equal to the
* argument and is equal to x/y
fraction.
- * It's possible to consider this function as a analog of Math.floor(x/y),
+ * It's possible to consider this function as a analog of Math.floor(x/y),
* without having deal with non-integer.
- *
+ *
* @param x integer, fraction numerator
* @param y integer, fraction denominator
- * @return the largest integer that is less than or equal to
+ * @return the largest integer that is less than or equal to
* the argument and is equal to x/y
fraction
* @see java.lang.Math#floor(double)
*/
diff --git a/src/java/org/apache/fop/render/txt/TXTRenderer.java b/src/java/org/apache/fop/render/txt/TXTRenderer.java
index b6d09d769..52c6912d4 100644
--- a/src/java/org/apache/fop/render/txt/TXTRenderer.java
+++ b/src/java/org/apache/fop/render/txt/TXTRenderer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.txt;
import java.awt.Color;
@@ -40,17 +40,17 @@ import org.apache.fop.render.txt.border.BorderManager;
/**
* Renderer that renders areas to plain text.
- *
+ *
* @author Art Welch
* @author Mark Lillywhite (to use
* the new Renderer interface)
*/
public class TXTRenderer extends AbstractPathOrientedRenderer {
-
+
private static final char LIGHT_SHADE = '\u2591';
-
+
private static final char MEDIUM_SHADE = '\u2592';
-
+
private static final char DARK_SHADE = '\u2593';
private static final char FULL_BLOCK = '\u2588';
@@ -95,7 +95,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/** Manager for storing border's information. */
private BorderManager bm;
-
+
/** Char for current filling. */
private char fillChar;
@@ -103,7 +103,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
private TXTState currentState = new TXTState();
private String encoding;
-
+
/**
* Constructs a newly allocated TXTRenderer
object.
*/
@@ -114,7 +114,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
public String getMimeType() {
return "text/plain";
}
-
+
/**
* Sets the encoding of the target file.
* @param encoding the encoding, null to select the default encoding (UTF-8)
@@ -125,7 +125,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Indicates if point (x, y) lay inside currentPage.
- *
+ *
* @param x x coordinate
* @param y y coordinate
* @return true if point lay inside page
@@ -136,7 +136,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Add char to text buffer.
- *
+ *
* @param x x coordinate
* @param y y coordinate
* @param ch char to add
@@ -149,7 +149,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Add char to text or background buffer.
- *
+ *
* @param x x coordinate
* @param y x coordinate
* @param ch char to add
@@ -168,7 +168,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Adds string to text buffer (charData
). bm
) to buffer for
- * background and images (i.e.decoData
).
+ * Projects current page borders (i.e.bm
) to buffer for
+ * background and images (i.e.decoData
).
*/
private void flushBorderToBuffer() {
for (int x = 0; x < pageWidth; x++) {
@@ -363,14 +363,14 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Does nothing.
+ * Does nothing.
* {@inheritDoc}
*/
protected void moveTo(float x, float y) {
}
/**
- * Does nothing.
+ * Does nothing.
* {@inheritDoc}
*/
protected void lineTo(float x, float y) {
@@ -384,16 +384,16 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Fills rectangle startX, startY, width, height with char
+ * Fills rectangle startX, startY, width, height with char
* charToFill
.
- *
+ *
* @param startX x-coordinate of upper left point
* @param startY y-coordinate of upper left point
* @param width width of rectangle
* @param height height of rectangle
- * @param charToFill filling char
+ * @param charToFill filling char
*/
- private void fillRect(int startX, int startY, int width, int height,
+ private void fillRect(int startX, int startY, int width, int height,
char charToFill) {
for (int x = startX; x < startX + width; x++) {
for (int y = startY; y < startY + height; y++) {
@@ -401,7 +401,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
}
}
-
+
/**
* Fills a rectangular area with the current filling char.
* {@inheritDoc}
@@ -410,7 +410,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
fillRect(bm.getStartX(), bm.getStartY(), bm.getWidth(), bm.getHeight(),
fillChar);
}
-
+
/**
* Changes current filling char.
* {@inheritDoc}
@@ -423,11 +423,11 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
// TODO: This fillShase is catually the luminance component of the color
// transformed to the YUV (YPrBb) Colorspace. It should use standard
// Java methods for its conversion instead of the formula given here.
- double fillShade = 0.30f / 255f * col.getRed()
- + 0.59f / 255f * col.getGreen()
+ double fillShade = 0.30f / 255f * col.getRed()
+ + 0.59f / 255f * col.getGreen()
+ 0.11f / 255f * col.getBlue();
fillShade = 1 - fillShade;
-
+
if (fillShade > 0.8f) {
fillChar = FULL_BLOCK;
} else if (fillShade > 0.6f) {
@@ -445,10 +445,10 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
protected void drawImage(String url, Rectangle2D pos, Map foreignAttributes) {
//No images are painted here
}
-
+
/**
* Fills image rectangle with a IMAGE_CHAR
.
- *
+ *
* @param image the base image
* @param pos the position of the image
*/
@@ -457,17 +457,17 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
int y1 = Helper.ceilPosition(currentBPPosition, CHAR_HEIGHT);
int width = Helper.ceilPosition((int) pos.getWidth(), CHAR_WIDTH);
int height = Helper.ceilPosition((int) pos.getHeight(), CHAR_HEIGHT);
-
+
fillRect(x1, y1, width, height, IMAGE_CHAR);
}
-
+
/**
* Returns the closest integer to the multiplication of a number and 1000.
- *
- * @param x the value of the argument, multiplied by
+ *
+ * @param x the value of the argument, multiplied by
* 1000 and rounded
- * @return the value of the argument multiplied by
+ * @return the value of the argument multiplied by
* 1000 and rounded to the nearest integer
*/
protected int toMilli(float x) {
@@ -476,11 +476,11 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Adds one element of border.
- *
+ *
* @param x x coordinate
* @param y y coordinate
* @param style integer, representing border style
- * @param type integer, representing border element type
+ * @param type integer, representing border element type
*/
private void addBitOfBorder(int x, int y, int style, int type) {
Point point = currentState.transformPoint(x, y);
@@ -542,7 +542,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void drawBackAndBorders(Area area, float startx, float starty,
float width, float height) {
@@ -567,10 +567,10 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
protected void endVParea() {
currentState.pop();
}
-
+
/** {@inheritDoc} */
protected void concatenateTransformationMatrix(AffineTransform at) {
currentState.push(new CTM(ptToMpt(at)));
}
-
+
}
diff --git a/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java b/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java
index 0ca509b66..f2c47735f 100644
--- a/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@ import org.apache.fop.render.PrintRendererConfigurator;
import org.apache.fop.render.Renderer;
/**
- * TXT Renderer configurator
+ * TXT Renderer configurator
*/
public class TXTRendererConfigurator extends PrintRendererConfigurator {
diff --git a/src/java/org/apache/fop/render/txt/TXTRendererMaker.java b/src/java/org/apache/fop/render/txt/TXTRendererMaker.java
index 24e24ea87..0db369ef2 100644
--- a/src/java/org/apache/fop/render/txt/TXTRendererMaker.java
+++ b/src/java/org/apache/fop/render/txt/TXTRendererMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,7 @@ import org.apache.fop.render.RendererConfigurator;
public class TXTRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_PLAIN_TEXT};
-
+
/**{@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new TXTRenderer();
diff --git a/src/java/org/apache/fop/render/txt/TXTState.java b/src/java/org/apache/fop/render/txt/TXTState.java
index 172b5eb9c..09abc2515 100644
--- a/src/java/org/apache/fop/render/txt/TXTState.java
+++ b/src/java/org/apache/fop/render/txt/TXTState.java
@@ -27,7 +27,7 @@ import java.util.LinkedList;
import org.apache.fop.area.CTM;
/**
- * This keeps information about the current state when writing to txt, i.e.
+ * This keeps information about the current state when writing to txt, i.e.
* manages coordinate transformation matrices for getting absolute coordinates.
*/
public class TXTState {
@@ -36,7 +36,7 @@ public class TXTState {
private LinkedList stackCTM = new LinkedList();
/**
- * Current result coordinate transformation matrix. It's product of
+ * Current result coordinate transformation matrix. It's product of
* all matrices in order, saved in stackCTM
.
*/
private CTM resultCTM = new CTM();
@@ -48,9 +48,9 @@ public class TXTState {
}
/**
- * Updates result coordinate transformation matrix
+ * Updates result coordinate transformation matrix
* (i.e. resultCTM
), multipliing it by given matrix.
- *
+ *
* @param ctm CTM
*/
private void updateResultCTM(CTM ctm) {
@@ -68,9 +68,9 @@ public class TXTState {
}
/**
- * Push the current coordinate transformation matrix onto the stack and
+ * Push the current coordinate transformation matrix onto the stack and
* reevaluate resultCTM
.
- *
+ *
* @param ctm instance of CTM
*/
public void push(CTM ctm) {
@@ -86,11 +86,11 @@ public class TXTState {
stackCTM.removeLast();
calcResultCTM();
}
-
+
/**
- * Modifies coordinate transformation matrix in such a way, so
+ * Modifies coordinate transformation matrix in such a way, so
* x-shift and y-shift will be transformed in text positions.
- *
+ *
* @param ctm CTM to modify
* @return instance of CTM
*/
@@ -100,13 +100,13 @@ public class TXTState {
da[4] = Helper.roundPosition((int) da[4], TXTRenderer.CHAR_WIDTH);
// refine y-shift
da[5] = Helper.roundPosition((int) da[5], TXTRenderer.CHAR_HEIGHT);
-
+
return new CTM(da[0], da[1], da[2], da[3], da[4], da[5]);
}
/**
* Transforms point
using ctm
.
- *
+ *
* @param p Point
* @param ctm CTM
* @return transformed Point
@@ -120,7 +120,7 @@ public class TXTState {
/**
* Transforms point (x, y) using resultCTM
.
- *
+ *
* @param x x-coordinate
* @param y y-coordinate
* @return transformed Point
diff --git a/src/java/org/apache/fop/render/txt/TXTStream.java b/src/java/org/apache/fop/render/txt/TXTStream.java
index 57797eb86..49e36be3a 100644
--- a/src/java/org/apache/fop/render/txt/TXTStream.java
+++ b/src/java/org/apache/fop/render/txt/TXTStream.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.txt;
import java.io.IOException;
@@ -26,9 +26,9 @@ import java.io.OutputStream;
* Helper class for text streams.
*/
public class TXTStream {
-
+
private static final String DEFAULT_ENCODING = "UTF-8";
-
+
private OutputStream out = null;
private boolean doOutput = true;
private String encoding = DEFAULT_ENCODING;
@@ -65,7 +65,7 @@ public class TXTStream {
public void setDoOutput(boolean doout) {
doOutput = doout;
}
-
+
/**
* Set the encoding for the text stream.
* @param encoding the encoding, if null, "UTF-8" is chosen as default
diff --git a/src/java/org/apache/fop/render/txt/border/AbstractBorderElement.java b/src/java/org/apache/fop/render/txt/border/AbstractBorderElement.java
index 80f8dc01c..cd79594c1 100644
--- a/src/java/org/apache/fop/render/txt/border/AbstractBorderElement.java
+++ b/src/java/org/apache/fop/render/txt/border/AbstractBorderElement.java
@@ -33,25 +33,25 @@ import org.apache.fop.render.txt.TXTState;
public abstract class AbstractBorderElement implements Constants {
/**
- * Constant for a line segment, directing from a center of symbol up
+ * Constant for a line segment, directing from a center of symbol up
* the the symbol boundary.
*/
public static final int UP = 0;
/**
- * Constant for a line segment, directing from a center of symbol right
+ * Constant for a line segment, directing from a center of symbol right
* the the symbol boundary.
*/
public static final int RIGHT = 1;
/**
- * Constant for a line segment, directing from a center of symbol down
+ * Constant for a line segment, directing from a center of symbol down
* the the symbol boundary.
*/
public static final int DOWN = 2;
/**
- * Constant for a line segment, directing from a center of symbol left
+ * Constant for a line segment, directing from a center of symbol left
* the the symbol boundary.
*/
public static final int LEFT = 3;
@@ -63,7 +63,7 @@ public abstract class AbstractBorderElement implements Constants {
protected int[] data = {0, 0, 0, 0};
/**
- * Initializes a newly created AbstractBorderElement
object
+ * Initializes a newly created AbstractBorderElement
object
* so that it represents an empty border element.
*/
public AbstractBorderElement() {
@@ -71,9 +71,9 @@ public abstract class AbstractBorderElement implements Constants {
/**
* Constructs a newly allocated AbstractBorderElement
object.
- * Fills array data
using binary representation of
+ * Fills array data
using binary representation of
* type
.
- *
+ *
* @param type binary representation of type gives data
*/
public AbstractBorderElement(int type) {
@@ -84,7 +84,7 @@ public abstract class AbstractBorderElement implements Constants {
/**
* Returns value of side's element of data
.
- *
+ *
* @param side integer, representing side
* @return value of side's element
*/
@@ -94,7 +94,7 @@ public abstract class AbstractBorderElement implements Constants {
/**
* Sets a value for data[side]
.
- *
+ *
* @param side integer, representing side
* @param value a new value for data[side]
*/
diff --git a/src/java/org/apache/fop/render/txt/border/BorderManager.java b/src/java/org/apache/fop/render/txt/border/BorderManager.java
index 4a470a37f..0af243ec6 100644
--- a/src/java/org/apache/fop/render/txt/border/BorderManager.java
+++ b/src/java/org/apache/fop/render/txt/border/BorderManager.java
@@ -32,7 +32,7 @@ public class BorderManager {
/** Width of current processed border. */
private int width;
-
+
/** Height of current processed border. */
private int height;
@@ -46,9 +46,9 @@ public class BorderManager {
private TXTState state;
/**
- * Constructs BorderManger, using pageWidth
and
+ * Constructs BorderManger, using pageWidth
and
* pageHeight
for creating borderInfo
.
- *
+ *
* @param pageWidth page width
* @param pageHeight page height
* @param state TXTState
@@ -60,12 +60,12 @@ public class BorderManager {
/**
* Adds border element to borderInfo
.
- *
+ *
* @param x x-coordinate
* @param y y-coordinate
* @param style border-style
- * @param type border element type, binary representation of wich gives
- * information about availability or absence of corresponding side.
+ * @param type border element type, binary representation of wich gives
+ * information about availability or absence of corresponding side.
*/
public void addBorderElement(int x, int y, int style, int type) {
AbstractBorderElement be = null;
@@ -91,9 +91,9 @@ public class BorderManager {
/**
* @param x x-coordinate
* @param y y-coordinate
- * @return if border element at point (x,y) is available, returns instance
- * of Character, created on char, given by corresponding border element,
- * otherwise returns null.
+ * @return if border element at point (x,y) is available, returns instance
+ * of Character, created on char, given by corresponding border element,
+ * otherwise returns null.
*/
public Character getCharacter(int x, int y) {
Character c = null;
@@ -109,7 +109,7 @@ public class BorderManager {
public int getWidth() {
return width;
}
-
+
/**
* Sets width of current processed border.
* @param width width of border
@@ -117,7 +117,7 @@ public class BorderManager {
public void setWidth(int width) {
this.width = width;
}
-
+
/**
* @return height of current processed border.
*/
diff --git a/src/java/org/apache/fop/render/txt/border/DashedBorderElement.java b/src/java/org/apache/fop/render/txt/border/DashedBorderElement.java
index d91179845..7c806e6ce 100644
--- a/src/java/org/apache/fop/render/txt/border/DashedBorderElement.java
+++ b/src/java/org/apache/fop/render/txt/border/DashedBorderElement.java
@@ -25,39 +25,39 @@ import java.util.Arrays;
* This class is responsible for managing of dashed border elements.
*/
public class DashedBorderElement extends AbstractBorderElement {
-
+
private static final char DASH_HORIZONTAL = '-';
private static final char DASH_VERTICAL = '|';
-
+
private static final char UNDEFINED = '?';
-
+
private static final int UP2 = 1;
-
+
private static final int RIGHT2 = 2;
-
+
private static final int DOWN2 = 4;
-
+
private static final int LEFT2 = 8;
-
+
private static char[] map = new char[20];
-
+
static {
Arrays.fill(map, UNDEFINED);
map[0] = ' ';
map[UP2] = DASH_VERTICAL;
map[DOWN2] = DASH_VERTICAL;
map[UP2 + DOWN2] = DASH_VERTICAL;
-
+
map[LEFT2] = DASH_HORIZONTAL;
map[RIGHT2] = DASH_HORIZONTAL;
map[LEFT2 + RIGHT2] = DASH_HORIZONTAL;
}
-
+
/**
* Constructs a newly allocated DashedBorderElement
object.
* Fills data
using superclass constructor.
- *
+ *
* @param type binary representation of type gives data
*/
public DashedBorderElement(int type) {
@@ -66,8 +66,8 @@ public class DashedBorderElement extends AbstractBorderElement {
/**
* Merges dashed border element with instance of solid and double border
- * element, returns instance of SolidAndDoubleBorderElement
.
- *
+ * element, returns instance of SolidAndDoubleBorderElement
.
+ *
* @param sdb instance of SolidAndDoubleBorderElement
to merge
* @return merged border element
*/
@@ -76,13 +76,13 @@ public class DashedBorderElement extends AbstractBorderElement {
for (int i = 0; i < 4; i++) {
e.setData(i, Math.max(data[i], sdb.getData(i)));
}
- return e;
+ return e;
}
/**
- * Merges dashed border element with dashed border element and returns
- * instance of DashedBorderElement
.
- *
+ * Merges dashed border element with dashed border element and returns
+ * instance of DashedBorderElement
.
+ *
* @param dbe instance of DashedBorderElement
to merge
* @return merged border element
*/
@@ -92,11 +92,11 @@ public class DashedBorderElement extends AbstractBorderElement {
}
return this;
}
-
+
/**
- * Converts dashed border element to
+ * Converts dashed border element to
* SolidAndDoubleBorderElement
.
- *
+ *
* @return converted instance of SolidAndDoubleBorderElement
*/
private AbstractBorderElement toSolidAndDouble() {
@@ -104,7 +104,7 @@ public class DashedBorderElement extends AbstractBorderElement {
for (int i = 0; i < 4; i++) {
e.setData(i, data[i]);
}
- return e;
+ return e;
}
/**
@@ -124,7 +124,7 @@ public class DashedBorderElement extends AbstractBorderElement {
return abe;
}
- /**
+ /**
* {@inheritDoc}
*/
public char convert2Char() {
diff --git a/src/java/org/apache/fop/render/txt/border/DottedBorderElement.java b/src/java/org/apache/fop/render/txt/border/DottedBorderElement.java
index e5930fcb3..3e1700f1a 100644
--- a/src/java/org/apache/fop/render/txt/border/DottedBorderElement.java
+++ b/src/java/org/apache/fop/render/txt/border/DottedBorderElement.java
@@ -23,13 +23,13 @@ package org.apache.fop.render.txt.border;
* This class is responsible for managing of dotted border elements.
*/
public class DottedBorderElement extends AbstractBorderElement {
-
+
private static final char MIDDLE_DOT = '\u00B7';
/**
* Merges dotted border element with another border element. Here merging
* is quite simple: returning this
without any comparing.
- *
+ *
* @param e instance of AbstractBorderElement
* @return instance of DottedBorderElement
*/
diff --git a/src/java/org/apache/fop/render/txt/border/SolidAndDoubleBorderElement.java b/src/java/org/apache/fop/render/txt/border/SolidAndDoubleBorderElement.java
index b14ecabe7..7defc64c6 100644
--- a/src/java/org/apache/fop/render/txt/border/SolidAndDoubleBorderElement.java
+++ b/src/java/org/apache/fop/render/txt/border/SolidAndDoubleBorderElement.java
@@ -47,67 +47,67 @@ public class SolidAndDoubleBorderElement extends AbstractBorderElement {
private static final char LIGHT_UP_AND_HORIZONTAL = '\u2534';
private static final char LIGHT_VERTICAL_AND_HORIZONTAL = '\u253C';
-
+
private static final char DOUBLE_HORIZONTAL = '\u2550';
private static final char DOUBLE_VERTICAL = '\u2551';
-
- private static final char DOUBLE_DOWN_AND_RIGHT = '\u2554';
+
+ private static final char DOUBLE_DOWN_AND_RIGHT = '\u2554';
private static final char DOUBLE_DOWN_AND_LEFT = '\u2557';
private static final char DOUBLE_UP_AND_RIGHT = '\u255A';
private static final char DOUBLE_UP_AND_LEFT = '\u255D';
-
+
private static final char DOUBLE_VERTICAL_AND_RIGHT = '\u2560';
-
+
private static final char DOUBLE_VERTICAL_AND_LEFT = '\u2563';
-
+
private static final char DOUBLE_DOWN_AND_HORIZONTAL = '\u2566';
-
+
private static final char DOUBLE_UP_AND_HORIZONTAL = '\u2569';
-
+
private static final char DOUBLE_VERTICAL_AND_HORIZONTAL = '\u256C';
-
+
private static final char DOWN_SINGLE_AND_RIGHT_DOUBLE = '\u2552';
-
+
private static final char DOWN_DOUBLE_AND_RIGHT_SINGLE = '\u2553';
private static final char DOWN_SINGLE_AND_LEFT_DOUBLE = '\u2555';
private static final char DOWN_DOUBLE_AND_LEFT_SINGLE = '\u2556';
-
+
private static final char UP_SINGLE_AND_RIGHT_DOUBLE = '\u2558';
-
+
private static final char UP_DOUBLE_AND_RIGHT_SINGLE = '\u2559';
-
+
private static final char UP_SINGLE_AND_LEFT_DOUBLE = '\u255B';
-
+
private static final char UP_DOUBLE_AND_LEFT_SINGLE = '\u255C';
-
+
private static final char VERTICAL_SINGLE_AND_RIGHT_DOUBLE = '\u255E';
-
+
private static final char VERTICAL_DOUBLE_AND_RIGHT_SINGLE = '\u255F';
-
+
private static final char VERTICAL_SINGLE_AND_LEFT_DOUBLE = '\u2561';
-
+
private static final char VERTICAL_DOUBLE_AND_LEFT_SINGLE = '\u2562';
-
+
private static final char DOWN_SINGLE_AND_HORIZONTAL_DOUBLE = '\u2564';
-
+
private static final char DOWN_DOUBLE_AND_HORIZONTAL_SINGLE = '\u2565';
-
+
private static final char UP_SINGLE_AND_HORIZONTAL_DOUBLE = '\u2567';
-
+
private static final char UP_DOUBLE_AND_HORIZONTAL_SINGLE = '\u2568';
-
+
private static final char VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE = '\u256A';
-
+
private static final char VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE = '\u256B';
-
+
private static final char UNDEFINED = '?';
-
+
private static final int UP3 = 1;
private static final int DOWN3 = 3;
@@ -174,19 +174,19 @@ public class SolidAndDoubleBorderElement extends AbstractBorderElement {
}
/**
- * Initializes a newly created SolidAndDoubleBorderElement
+ * Initializes a newly created SolidAndDoubleBorderElement
* object so that it represents an empty border element.
*/
public SolidAndDoubleBorderElement() {
}
/**
- * Constructs a newly allocated SolidAndDoubleBorderElement
- * object. Fills data
using binary representation of
- * type
. If border style is EN_DOUBLE, multiplies
- * data[side]
by 2 for every side to distinguish EN_SOLID and
+ * Constructs a newly allocated SolidAndDoubleBorderElement
+ * object. Fills data
using binary representation of
+ * type
. If border style is EN_DOUBLE, multiplies
+ * data[side]
by 2 for every side to distinguish EN_SOLID and
* EN_DOUBLE.
- *
+ *
* @param style integer, representing border style.
* @param type binary representation of type gives data
*/
@@ -198,7 +198,7 @@ public class SolidAndDoubleBorderElement extends AbstractBorderElement {
}
}
}
-
+
/**
* Merges with sde
.
* @param sde instance of SolidAndDoubleBorderElement
@@ -232,10 +232,10 @@ public class SolidAndDoubleBorderElement extends AbstractBorderElement {
}
return abe;
}
-
+
/**
* Maps to char.
- * @return resulting mapping char
+ * @return resulting mapping char
*/
private char map2Char() {
int key = 0;
diff --git a/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java b/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java
index 7aa22e080..4f62155a3 100644
--- a/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java
+++ b/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -88,7 +88,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
* @param comment the comment
*/
protected void comment(String comment) {
- if (handler instanceof LexicalHandler) {
+ if (handler instanceof LexicalHandler) {
try {
((LexicalHandler) handler).comment(comment.toCharArray(), 0, comment.length());
} catch (SAXException saxe) {
@@ -96,7 +96,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
}
}
}
-
+
/**
* Starts a new element (without attributes).
* @param tagName tag name of the element
@@ -158,7 +158,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
* @param value value of the attribute
*/
protected void addAttribute(QName name, String value) {
- atts.addAttribute(name.getNamespaceURI(), name.getLocalName(), name.getQName(),
+ atts.addAttribute(name.getNamespaceURI(), name.getLocalName(), name.getQName(),
CDATA, value);
}
@@ -175,7 +175,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
return "" + (int) rect.getX() + " " + (int) rect.getY() + " "
+ (int) rect.getWidth() + " " + (int) rect.getHeight();
}
-
+
/**
* Adds a new attribute to the protected member variable "atts".
* @param name name of the attribute
@@ -259,7 +259,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
* @param attachments a list of extension attachments
*/
protected abstract void handleExtensionAttachments(List attachments);
-
+
/**
* Renders a bookmark tree
* @param odi the bookmark data
diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java
index aec067b91..38db7abdf 100644
--- a/src/java/org/apache/fop/render/xml/XMLRenderer.java
+++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java
@@ -92,7 +92,7 @@ import org.apache.fop.util.ColorUtil;
* Renderer that renders areas to XML for debugging purposes.
* This creates an xml that contains the information of the area
* tree. It does not output any state or derived information.
- * The output can be used to build a new area tree which can be
+ * The output can be used to build a new area tree which can be
* rendered to any renderer.
*/
public class XMLRenderer extends AbstractXMLRenderer {
@@ -148,7 +148,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
public void setCompactFormat(boolean compact) {
this.compactFormat = compact;
}
-
+
private boolean isDetailedFormat() {
return !this.compactFormat;
}
@@ -243,7 +243,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
}
}
}
-
+
transferForeignObjects(area);
}
@@ -261,7 +261,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
String qn = "xmlns:" + (String)entry.getKey();
- atts.addAttribute("", (String)entry.getKey(), qn,
+ atts.addAttribute("", (String)entry.getKey(), qn,
CDATA, (String)entry.getValue());
}
}
@@ -606,7 +606,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
renderBlocks(block, children);
}
}
-
+
/** {@inheritDoc} */
protected void renderBlock(Block block) {
atts.clear();
@@ -779,7 +779,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
protected void renderWord(WordArea word) {
atts.clear();
addAttribute("offset", word.getOffset());
- int[] letterAdjust = word.getLetterAdjustArray();
+ int[] letterAdjust = word.getLetterAdjustArray();
if (letterAdjust != null) {
StringBuffer sb = new StringBuffer(64);
boolean nonZeroFound = false;
diff --git a/src/java/org/apache/fop/render/xml/XMLRendererMaker.java b/src/java/org/apache/fop/render/xml/XMLRendererMaker.java
index 5aa0deb2b..8526daa2a 100644
--- a/src/java/org/apache/fop/render/xml/XMLRendererMaker.java
+++ b/src/java/org/apache/fop/render/xml/XMLRendererMaker.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ import org.apache.fop.render.RendererConfigurator;
public class XMLRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_FOP_AREA_TREE};
-
+
/**{@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new XMLRenderer();
diff --git a/src/java/org/apache/fop/servlet/FopPrintServlet.java b/src/java/org/apache/fop/servlet/FopPrintServlet.java
index f99468743..d446dff54 100644
--- a/src/java/org/apache/fop/servlet/FopPrintServlet.java
+++ b/src/java/org/apache/fop/servlet/FopPrintServlet.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -53,31 +53,31 @@ import org.apache.fop.apps.MimeConstants;
*
* Example URL: http://servername/fop/servlet/FopPrintServlet?xml=data.xml&xsl=format.xsl
*
- * Note: This servlet is derived from FopServlet. Most methods are inherited from the
+ * Note: This servlet is derived from FopServlet. Most methods are inherited from the
* superclass. Only the differences to the base class are necessary.
- *
+ *
* @author Apache FOP Development Team
* @version $Id$
*/
public class FopPrintServlet extends FopServlet {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void render(Source src, Transformer transformer, HttpServletResponse response)
throws FOPException, TransformerException, IOException {
FOUserAgent foUserAgent = getFOUserAgent();
-
+
//Setup FOP
Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, foUserAgent);
-
+
//Make sure the XSL transformation's result is piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
//Start the transformation and rendering process
transformer.transform(src, res);
-
+
//Return the result
reportOK(response);
}
diff --git a/src/java/org/apache/fop/servlet/FopServlet.java b/src/java/org/apache/fop/servlet/FopServlet.java
index 173e622dd..9b2326032 100644
--- a/src/java/org/apache/fop/servlet/FopServlet.java
+++ b/src/java/org/apache/fop/servlet/FopServlet.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -85,7 +85,7 @@ public class FopServlet extends HttpServlet {
/** The FopFactory used to create Fop instances */
protected FopFactory fopFactory = null;
/** URIResolver for use by this servlet */
- protected URIResolver uriResolver;
+ protected URIResolver uriResolver;
/**
* {@inheritDoc}
@@ -101,7 +101,7 @@ public class FopServlet extends HttpServlet {
this.fopFactory.setURIResolver(this.uriResolver);
configureFopFactory();
}
-
+
/**
* This method is called right after the FopFactory is instantiated and can be overridden
* by subclasses to perform additional configuration.
@@ -111,7 +111,7 @@ public class FopServlet extends HttpServlet {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException {
@@ -163,7 +163,7 @@ public class FopServlet extends HttpServlet {
response.getOutputStream().write(content);
response.getOutputStream().flush();
}
-
+
/**
* Renders an XSL-FO file into a PDF file. The PDF is written to a byte
* array that is returned as the method's result.
@@ -252,7 +252,7 @@ public class FopServlet extends HttpServlet {
//Return the result
sendPDF(out.toByteArray(), response);
}
-
+
/** @return a new FOUserAgent for FOP */
protected FOUserAgent getFOUserAgent() {
FOUserAgent userAgent = fopFactory.newFOUserAgent();
diff --git a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
index 48bd2d6cb..413dac76d 100644
--- a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
+++ b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
@@ -37,9 +37,9 @@ public class ServletContextURIResolver implements URIResolver {
/** The protocol name for the servlet context URIs. */
public static final String SERVLET_CONTEXT_PROTOCOL = "servlet-context:";
-
+
private ServletContext servletContext;
-
+
/**
* Main constructor
* @param servletContext the servlet context to access the resources through
@@ -47,14 +47,14 @@ public class ServletContextURIResolver implements URIResolver {
public ServletContextURIResolver(ServletContext servletContext) {
this.servletContext = servletContext;
}
-
+
/** {@inheritDoc} */
public Source resolve(String href, String base) throws TransformerException {
if (href.startsWith(SERVLET_CONTEXT_PROTOCOL)) {
return resolveServletContextURI(href.substring(SERVLET_CONTEXT_PROTOCOL.length()));
} else {
- if (base != null
- && base.startsWith(SERVLET_CONTEXT_PROTOCOL)
+ if (base != null
+ && base.startsWith(SERVLET_CONTEXT_PROTOCOL)
&& (href.indexOf(':') < 0)) {
String abs = base + href;
return resolveServletContextURI(
diff --git a/src/java/org/apache/fop/svg/ACIUtils.java b/src/java/org/apache/fop/svg/ACIUtils.java
index 984b63f25..91dfb85ca 100644
--- a/src/java/org/apache/fop/svg/ACIUtils.java
+++ b/src/java/org/apache/fop/svg/ACIUtils.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,7 +44,7 @@ public final class ACIUtils {
Map.Entry entry = (Map.Entry)i.next();
if (entry.getValue() != null) {
System.out.println(entry.getKey() + ": " + entry.getValue());
- }
+ }
}
int start = aci.getBeginIndex();
System.out.print("AttrRuns: ");
@@ -54,7 +54,7 @@ public final class ACIUtils {
aci.setIndex(end);
if (start == end) {
break;
- }
+ }
start = end;
}
System.out.println("");
diff --git a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java
index b7cee29ef..83cfa8021 100644
--- a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java
+++ b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import org.apache.batik.bridge.UserAgent;
@@ -40,7 +40,7 @@ import org.xml.sax.EntityResolver;
public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
/**
- * The key to specify whether to stroke text instead of using text
+ * The key to specify whether to stroke text instead of using text
* operations.
*/
public static final TranscodingHints.Key KEY_STROKE_TEXT = new BooleanKey();
@@ -69,7 +69,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
hints.put(KEY_DOM_IMPLEMENTATION,
SVGDOMImplementation.getDOMImplementation());
}
-
+
/**
* Creates and returns the default user agent for this transcoder. Override
* this method if you need non-default behaviour.
@@ -78,7 +78,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
protected UserAgent createUserAgent() {
return new FOPTranscoderUserAgent();
}
-
+
/**
* @param logger
*/
@@ -93,9 +93,9 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
public void setEntityResolver(EntityResolver resolver) {
this.resolver = resolver;
}
-
+
/**
- * Returns the logger associated with this transcoder. It returns a
+ * Returns the logger associated with this transcoder. It returns a
* SimpleLog if no logger has been explicitly set.
* @return Logger the logger for the transcoder.
*/
@@ -106,7 +106,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
}
return this.logger;
}
-
+
/**
* Creates a DocumentFactory that is used to create an SVG DOM
* tree. The specified DOM Implementation is ignored and the Batik
@@ -118,7 +118,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
*/
protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
String parserClassname) {
- final FOPSAXSVGDocumentFactory factory
+ final FOPSAXSVGDocumentFactory factory
= new FOPSAXSVGDocumentFactory(parserClassname);
if (this.resolver != null) {
factory.setAdditionalEntityResolver(this.resolver);
@@ -141,18 +141,18 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
}
return stroke;
}
-
+
// --------------------------------------------------------------------
// FOP's default error handler (for transcoders)
// --------------------------------------------------------------------
/**
* This is the default transcoder error handler for FOP. It logs error
- * to an Commons Logger instead of to System.out. The remaining behaviour
+ * to an Commons Logger instead of to System.out. The remaining behaviour
* is the same as Batik's DefaultErrorHandler.
- */
+ */
protected class FOPErrorHandler implements ErrorHandler {
-
+
/**
* {@inheritDoc}
*/
@@ -244,5 +244,5 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
}
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/FOPSAXSVGDocumentFactory.java b/src/java/org/apache/fop/svg/FOPSAXSVGDocumentFactory.java
index e265613fa..720795cb2 100644
--- a/src/java/org/apache/fop/svg/FOPSAXSVGDocumentFactory.java
+++ b/src/java/org/apache/fop/svg/FOPSAXSVGDocumentFactory.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.io.IOException;
@@ -41,7 +41,7 @@ public class FOPSAXSVGDocumentFactory extends SAXSVGDocumentFactory {
public FOPSAXSVGDocumentFactory(String parser) {
super(parser);
}
-
+
/**
* Sets an additional entity resolver. It will be used before the default
* entity resolving.
@@ -50,9 +50,9 @@ public class FOPSAXSVGDocumentFactory extends SAXSVGDocumentFactory {
public void setAdditionalEntityResolver(EntityResolver resolver) {
this.additionalResolver = resolver;
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException {
diff --git a/src/java/org/apache/fop/svg/GraphicsConfiguration.java b/src/java/org/apache/fop/svg/GraphicsConfiguration.java
index a92baed27..ca3b3363c 100644
--- a/src/java/org/apache/fop/svg/GraphicsConfiguration.java
+++ b/src/java/org/apache/fop/svg/GraphicsConfiguration.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
@@ -27,8 +27,8 @@ import java.awt.image.VolatileImage;
* compilation errors.
* The version for JDK 1.4 needs to add an override for the abstract
* createCompatibleVolatileImage() method. It can't be overidden
- * for JDK 1.3 because there is no VolatileImage there.
- *
+ * for JDK 1.3 because there is no VolatileImage there.
+ *
*/
abstract public class GraphicsConfiguration extends java.awt.GraphicsConfiguration {
diff --git a/src/java/org/apache/fop/svg/PDFAElementBridge.java b/src/java/org/apache/fop/svg/PDFAElementBridge.java
index e9bb8a955..9ab360f39 100644
--- a/src/java/org/apache/fop/svg/PDFAElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFAElementBridge.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.geom.AffineTransform;
@@ -55,7 +55,7 @@ public class PDFAElementBridge extends AbstractGraphicsNodeBridge {
public AffineTransform getCurrentTransform() {
return this.transform;
}
-
+
/**
* Returns 'a'.
* @return the name of this node
diff --git a/src/java/org/apache/fop/svg/PDFANode.java b/src/java/org/apache/fop/svg/PDFANode.java
index 84c8b9e42..a2d1d354c 100644
--- a/src/java/org/apache/fop/svg/PDFANode.java
+++ b/src/java/org/apache/fop/svg/PDFANode.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import org.apache.batik.gvt.CompositeGraphicsNode;
@@ -102,7 +102,7 @@ public class PDFANode extends CompositeGraphicsNode {
}
}
} catch (Exception e) {
- //TODO Move this to setDestination() and throw an IllegalArgumentException
+ //TODO Move this to setDestination() and throw an IllegalArgumentException
e.printStackTrace();
}
Rectangle2D destRect = new Rectangle2D.Float(x, y, width, height);
diff --git a/src/java/org/apache/fop/svg/PDFBatikFlowTextElementBridge.java b/src/java/org/apache/fop/svg/PDFBatikFlowTextElementBridge.java
index 748e216a7..d167f5de4 100644
--- a/src/java/org/apache/fop/svg/PDFBatikFlowTextElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFBatikFlowTextElementBridge.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ import org.apache.fop.fonts.FontInfo;
public class PDFBatikFlowTextElementBridge extends BatikFlowTextElementBridge {
private PDFTextPainter textPainter;
-
+
/**
* Main Constructor.
* @param fontInfo the font directory
@@ -40,7 +40,7 @@ public class PDFBatikFlowTextElementBridge extends BatikFlowTextElementBridge {
public PDFBatikFlowTextElementBridge(FontInfo fontInfo) {
this.textPainter = new PDFFlowExtTextPainter(fontInfo);
}
-
+
/** {@inheritDoc} */
protected GraphicsNode instantiateGraphicsNode() {
GraphicsNode node = super.instantiateGraphicsNode();
@@ -58,5 +58,5 @@ public class PDFBatikFlowTextElementBridge extends BatikFlowTextElementBridge {
public TextPainter getTextPainter() {
return this.textPainter;
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/PDFBridgeContext.java b/src/java/org/apache/fop/svg/PDFBridgeContext.java
index 9f235b6a9..fdf83784f 100644
--- a/src/java/org/apache/fop/svg/PDFBridgeContext.java
+++ b/src/java/org/apache/fop/svg/PDFBridgeContext.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,7 +36,7 @@ import org.apache.fop.fonts.FontInfo;
* BridgeContext which registers the custom bridges for PDF output.
*/
public class PDFBridgeContext extends BridgeContext {
-
+
/** The font list. */
private final FontInfo fontInfo;
@@ -44,7 +44,7 @@ public class PDFBridgeContext extends BridgeContext {
private final ImageSessionContext imageSessionContext;
private AffineTransform linkTransform;
-
+
/**
* Constructs a new bridge context.
* @param userAgent the user agent
@@ -75,8 +75,8 @@ public class PDFBridgeContext extends BridgeContext {
* @param linkTransform AffineTransform to properly place links,
* may be null
*/
- public PDFBridgeContext(UserAgent userAgent,
- FontInfo fontInfo,
+ public PDFBridgeContext(UserAgent userAgent,
+ FontInfo fontInfo,
ImageManager imageManager,
ImageSessionContext imageSessionContext,
AffineTransform linkTransform) {
@@ -115,12 +115,12 @@ public class PDFBridgeContext extends BridgeContext {
public ImageSessionContext getImageSessionContext() {
return this.imageSessionContext;
}
-
+
private void putPDFElementBridgeConditional(String className, String testFor) {
try {
Class.forName(testFor);
//if we get here the test class is available
-
+
Class clazz = Class.forName(className);
Constructor constructor = clazz.getConstructor(new Class[] {FontInfo.class});
putBridge((Bridge)constructor.newInstance(new Object[] {fontInfo}));
@@ -128,7 +128,7 @@ public class PDFBridgeContext extends BridgeContext {
//simply ignore (bridges instantiated over this method are optional)
}
}
-
+
/** {@inheritDoc} */
public void registerSVGBridges() {
super.registerSVGBridges();
@@ -136,7 +136,7 @@ public class PDFBridgeContext extends BridgeContext {
if (fontInfo != null) {
PDFTextElementBridge textElementBridge = new PDFTextElementBridge(fontInfo);
putBridge(textElementBridge);
-
+
//Batik flow text extension (may not always be available)
//putBridge(new PDFBatikFlowTextElementBridge(fontInfo);
putPDFElementBridgeConditional(
@@ -148,7 +148,7 @@ public class PDFBridgeContext extends BridgeContext {
putPDFElementBridgeConditional(
"org.apache.fop.svg.PDFSVG12TextElementBridge",
"org.apache.batik.bridge.svg12.SVG12TextElementBridge");
-
+
//putBridge(new PDFSVGFlowRootElementBridge(fontInfo));
putPDFElementBridgeConditional(
"org.apache.fop.svg.PDFSVGFlowRootElementBridge",
diff --git a/src/java/org/apache/fop/svg/PDFContext.java b/src/java/org/apache/fop/svg/PDFContext.java
index 494d47636..b7eec7b73 100644
--- a/src/java/org/apache/fop/svg/PDFContext.java
+++ b/src/java/org/apache/fop/svg/PDFContext.java
@@ -31,7 +31,7 @@ public class PDFContext {
/** number of pages generated */
private int pagecount;
-
+
/** @return true if a page is set up for painting. */
public boolean isPagePending() {
return this.currentPage != null;
diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
index 5bdfe8c8d..dd13df1c4 100644
--- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
+++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
index cda1478bb..2d1c9279c 100644
--- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
+++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/svg/PDFFlowExtTextPainter.java b/src/java/org/apache/fop/svg/PDFFlowExtTextPainter.java
index 0e8f47cfe..1c85a2899 100644
--- a/src/java/org/apache/fop/svg/PDFFlowExtTextPainter.java
+++ b/src/java/org/apache/fop/svg/PDFFlowExtTextPainter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -45,5 +45,5 @@ public class PDFFlowExtTextPainter extends PDFTextPainter {
FlowExtTextPainter delegate = (FlowExtTextPainter)FlowExtTextPainter.getInstance();
return delegate.getTextRuns(node, aci);
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/PDFFlowTextPainter.java b/src/java/org/apache/fop/svg/PDFFlowTextPainter.java
index eeef40da1..5b307ce83 100644
--- a/src/java/org/apache/fop/svg/PDFFlowTextPainter.java
+++ b/src/java/org/apache/fop/svg/PDFFlowTextPainter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,7 +30,7 @@ import org.apache.fop.fonts.FontInfo;
* Text Painter for SVG 1.2 (flow) text.
*/
public class PDFFlowTextPainter extends PDFTextPainter {
-
+
/**
* Main constructor
* @param fontInfo the font directory
@@ -45,5 +45,5 @@ public class PDFFlowTextPainter extends PDFTextPainter {
FlowTextPainter delegate = (FlowTextPainter)FlowTextPainter.getInstance();
return delegate.getTextRuns(node, aci);
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java
index 4d1ee6a6d..ca2245a12 100644
--- a/src/java/org/apache/fop/svg/PDFGraphics2D.java
+++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java b/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java
index 20c2c5c89..83a431d5e 100644
--- a/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java
+++ b/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.Rectangle;
diff --git a/src/java/org/apache/fop/svg/PDFGraphicsDevice.java b/src/java/org/apache/fop/svg/PDFGraphicsDevice.java
index 763bc7bb4..5da2d50ee 100644
--- a/src/java/org/apache/fop/svg/PDFGraphicsDevice.java
+++ b/src/java/org/apache/fop/svg/PDFGraphicsDevice.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.GraphicsDevice;
diff --git a/src/java/org/apache/fop/svg/PDFImageElementBridge.java b/src/java/org/apache/fop/svg/PDFImageElementBridge.java
index 0513c78bb..7eb89d2b1 100644
--- a/src/java/org/apache/fop/svg/PDFImageElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFImageElementBridge.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.Graphics2D;
@@ -72,13 +72,13 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
protected GraphicsNode createImageGraphicsNode
(BridgeContext ctx, Element imageElement, ParsedURL purl) {
PDFBridgeContext pdfCtx = (PDFBridgeContext)ctx;
-
+
ImageManager manager = pdfCtx.getImageManager();
ImageSessionContext sessionContext = pdfCtx.getImageSessionContext();
try {
ImageInfo info = manager.getImageInfo(purl.toString(), sessionContext);
Image image = manager.getImage(info, supportedFlavors, sessionContext);
-
+
//TODO color profile overrides aren't handled, yet!
//ICCColorSpaceExt colorspaceOverride = extractColorSpace(e, ctx);
AbstractGraphicsNode specializedNode = null;
@@ -104,7 +104,7 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
ctx.getUserAgent().displayError(
new ImageException("Cannot convert an image to a usable format: " + purl));
}
-
+
Rectangle2D imgBounds = getImageBounds(ctx, imageElement);
Rectangle2D bounds = specializedNode.getPrimitiveBounds();
float [] vb = new float[4];
@@ -113,14 +113,14 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
vb[2] = (float) bounds.getWidth(); // width
vb[3] = (float) bounds.getHeight(); // height
- // handles the 'preserveAspectRatio', 'overflow' and 'clip'
+ // handles the 'preserveAspectRatio', 'overflow' and 'clip'
// and sets the appropriate AffineTransform to the image node
initializeViewport(ctx, imageElement, specializedNode, vb, imgBounds);
return specializedNode;
} catch (Exception e) {
ctx.getUserAgent().displayError(e);
}
-
+
return superCreateGraphicsNode(ctx, imageElement, purl);
}
@@ -144,13 +144,13 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
* the PDFGraphics2D.
*/
public class LoaderImageNode extends AbstractGraphicsNode {
-
+
private Image image;
private BridgeContext ctx;
private Element imageElement;
private ParsedURL purl;
private GraphicsNode origGraphicsNode = null;
-
+
/**
* Create a new image node for drawing natively handled images
* into PDF graphics.
@@ -159,7 +159,7 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
* @param imageElement the SVG image element
* @param purl the URL to the image
*/
- public LoaderImageNode(Image image, BridgeContext ctx,
+ public LoaderImageNode(Image image, BridgeContext ctx,
Element imageElement, ParsedURL purl) {
this.image = image;
this.ctx = ctx;
@@ -191,7 +191,7 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
if (origGraphicsNode == null) {
// Haven't constructed baseclass Graphics Node,
// so do so now.
- origGraphicsNode
+ origGraphicsNode
= PDFImageElementBridge.this.superCreateGraphicsNode
(ctx, imageElement, purl);
}
@@ -223,9 +223,9 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
* A node that holds a Graphics2D image.
*/
public class Graphics2DNode extends AbstractGraphicsNode {
-
+
private ImageGraphics2D image;
-
+
/**
* Create a new Graphics2D node.
* @param g2d the Graphics2D image
diff --git a/src/java/org/apache/fop/svg/PDFSVGFlowRootElementBridge.java b/src/java/org/apache/fop/svg/PDFSVGFlowRootElementBridge.java
index ec6996389..d313e6cc4 100644
--- a/src/java/org/apache/fop/svg/PDFSVGFlowRootElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFSVGFlowRootElementBridge.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ import org.apache.fop.fonts.FontInfo;
public class PDFSVGFlowRootElementBridge extends SVGFlowRootElementBridge {
private PDFTextPainter textPainter;
-
+
/**
* Main Constructor.
* @param fontInfo the font directory
@@ -40,7 +40,7 @@ public class PDFSVGFlowRootElementBridge extends SVGFlowRootElementBridge {
public PDFSVGFlowRootElementBridge(FontInfo fontInfo) {
this.textPainter = new PDFFlowTextPainter(fontInfo);
}
-
+
/** {@inheritDoc} */
protected GraphicsNode instantiateGraphicsNode() {
GraphicsNode node = super.instantiateGraphicsNode();
@@ -58,5 +58,5 @@ public class PDFSVGFlowRootElementBridge extends SVGFlowRootElementBridge {
public TextPainter getTextPainter() {
return this.textPainter;
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/PDFTextElementBridge.java b/src/java/org/apache/fop/svg/PDFTextElementBridge.java
index 47e794dda..4c11aa97e 100644
--- a/src/java/org/apache/fop/svg/PDFTextElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFTextElementBridge.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,7 +35,7 @@ import org.w3c.dom.Element;
* @author Keiron Liddle
*/
public class PDFTextElementBridge extends SVGTextElementBridge {
-
+
private PDFTextPainter pdfTextPainter;
/**
diff --git a/src/java/org/apache/fop/svg/PDFTextPainter.java b/src/java/org/apache/fop/svg/PDFTextPainter.java
index 754b0794b..d8123c4fb 100644
--- a/src/java/org/apache/fop/svg/PDFTextPainter.java
+++ b/src/java/org/apache/fop/svg/PDFTextPainter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -62,7 +62,7 @@ import org.apache.fop.util.CharUtilities;
public class PDFTextPainter extends StrokingTextPainter {
private static final boolean DEBUG = false;
-
+
private boolean strokeText = false;
private FontInfo fontInfo;
@@ -102,7 +102,7 @@ public class PDFTextPainter extends StrokingTextPainter {
if ((tpi != null) && (tpi.composite != null)) {
g2d.setComposite(tpi.composite);
}
-
+
//------------------------------------
TextSpanLayout layout = textRun.getLayout();
if (DEBUG) {
@@ -110,7 +110,7 @@ public class PDFTextPainter extends StrokingTextPainter {
System.out.println("================================================");
System.out.println("New text run:");
System.out.println("char count: " + charCount);
- System.out.println("range: "
+ System.out.println("range: "
+ runaci.getBeginIndex() + " - " + runaci.getEndIndex());
System.out.println("glyph count: " + layout.getGlyphCount()); //=getNumGlyphs()
}
@@ -125,26 +125,26 @@ public class PDFTextPainter extends StrokingTextPainter {
System.out.println("Text: " + chars);
pdf.currentStream.write("%Text: " + chars + "\n");
}
-
+
GeneralPath debugShapes = null;
if (DEBUG) {
debugShapes = new GeneralPath();
}
-
+
Font[] fonts = findFonts(runaci);
if (fonts == null || fonts.length == 0) {
//Draw using Java2D
textRun.getLayout().draw(g2d);
continue;
}
-
+
textUtil.saveGraphicsState();
textUtil.concatMatrix(g2d.getTransform());
Shape imclip = g2d.getClip();
pdf.writeClip(imclip);
-
+
applyColorAndPaint(tpi, pdf);
-
+
textUtil.beginTextObject();
textUtil.setFonts(fonts);
textUtil.setTextRenderingMode(tpi.fillPaint != null, tpi.strokePaint != null, false);
@@ -158,7 +158,7 @@ public class PDFTextPainter extends StrokingTextPainter {
boolean visibleChar = gv.isGlyphVisible(index)
|| (CharUtilities.isAnySpace(ch) && !CharUtilities.isZeroWidthSpace(ch));
if (DEBUG) {
- System.out.println("glyph " + index
+ System.out.println("glyph " + index
+ " -> " + layout.getGlyphIndex(index) + " => " + ch);
if (CharUtilities.isAnySpace(ch) && ch != 32) {
System.out.println("Space found: " + Integer.toHexString(ch));
@@ -198,9 +198,9 @@ public class PDFTextPainter extends StrokingTextPainter {
localTransform.concatenate(glyphTransform);
}
localTransform.scale(1, -1);
-
- boolean yPosChanged = (prevPos == null
- || prevPos.getY() != p.getY()
+
+ boolean yPosChanged = (prevPos == null
+ || prevPos.getY() != p.getY()
|| glyphTransform != null);
if (yPosChanged) {
if (index > 0) {
@@ -218,7 +218,7 @@ public class PDFTextPainter extends StrokingTextPainter {
textUtil.adjustGlyphTJ(adjust * 1000);
}
if (DEBUG) {
- System.out.println("==> x diff: " + xdiff + ", " + effxdiff
+ System.out.println("==> x diff: " + xdiff + ", " + effxdiff
+ ", charWidth: " + cw);
}
}
@@ -231,7 +231,7 @@ public class PDFTextPainter extends StrokingTextPainter {
}
char paintChar = (CharUtilities.isAnySpace(ch) ? ' ' : ch);
textUtil.writeTJChar(paintChar);
-
+
//Update last position
prevPos = p;
prevVisibleCharWidth = textUtil.getCurrentFont().getCharWidth(chars.charAt(index));
@@ -268,7 +268,7 @@ public class PDFTextPainter extends StrokingTextPainter {
}
pdf.applyAlpha(fillAlpha, PDFGraphics2D.OPAQUE);
}
-
+
private Font[] findFonts(AttributedCharacterIterator aci) {
List fonts = new java.util.ArrayList();
List gvtFonts = (List) aci.getAttribute(
@@ -343,5 +343,5 @@ public class PDFTextPainter extends StrokingTextPainter {
}
return (Font[])fonts.toArray(new Font[fonts.size()]);
}
-
+
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/svg/PDFTextUtil.java b/src/java/org/apache/fop/svg/PDFTextUtil.java
index f3c7f31a2..9ba7cd049 100644
--- a/src/java/org/apache/fop/svg/PDFTextUtil.java
+++ b/src/java/org/apache/fop/svg/PDFTextUtil.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
private FontInfo fontInfo;
private Font[] fonts;
private Font font;
-
+
/**
* Main constructor.
* @param fontInfo the font catalog
@@ -41,13 +41,13 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
super();
this.fontInfo = fontInfo;
}
-
+
/** {@inheritDoc} */
protected void initValues() {
super.initValues();
this.font = null;
}
-
+
/**
* Sets the current fonts for the text object. For every character, the suitable font will
* be selected.
@@ -56,7 +56,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
public void setFonts(Font[] fonts) {
this.fonts = fonts;
}
-
+
/**
* Sets the current font for the text object.
* @param font the new font
@@ -64,7 +64,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
public void setFont(Font font) {
setFonts(new Font[] {font});
}
-
+
/**
* Returns the current font in use.
* @return the current font or null if no font is currently active.
@@ -72,7 +72,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
public Font getCurrentFont() {
return this.font;
}
-
+
/**
* Sets the current font.
* @param f the new font to use
@@ -80,7 +80,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
public void setCurrentFont(Font f) {
this.font = f;
}
-
+
/**
* Determines whether the font with the given name is a multi-byte font.
* @param name the name of the font
@@ -114,7 +114,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
}
return fonts[0]; //TODO Maybe fall back to painting with shapes
}
-
+
/**
* Writes a char to the "TJ-Buffer".
* @param ch the unmapped character
diff --git a/src/java/org/apache/fop/svg/PDFTranscoder.java b/src/java/org/apache/fop/svg/PDFTranscoder.java
index 281df1b1d..333cd5e4c 100644
--- a/src/java/org/apache/fop/svg/PDFTranscoder.java
+++ b/src/java/org/apache/fop/svg/PDFTranscoder.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -78,7 +78,7 @@ import org.apache.fop.fonts.FontInfo;
* KEY_USER_STYLESHEET_URI to fix the URI of a user
* stylesheet, and KEY_PIXEL_TO_MM to specify the pixel to
* millimeter conversion factor.
- *
+ *
* String
into
* an array of int
, splitting the base along the
* given separator pattern.
- * Note: this method assumes the input is a string containing
+ * Note: this method assumes the input is a string containing
* only decimal integers, signed or unsigned, that are parsable
* by java.lang.Integer.parseInt(String)
. If this
* is not the case, the resulting NumberFormatException
* will have to be handled by the caller.
- *
+ *
* @param baseString the base string
* @param separatorPattern the pattern separating the integer values
* (if this is null
, the baseString is parsed as one
- * integer value)
+ * integer value)
* @return an array of int
whose size is equal to the number
* values in the input string; null
if this number
* is equal to zero.
*/
public static int[] toIntArray(String baseString, String separatorPattern) {
-
+
if (baseString == null || "".equals(baseString)) {
return null;
}
-
+
if (separatorPattern == null || "".equals(separatorPattern)) {
return new int[] { Integer.parseInt(baseString) };
}
-
+
String[] values = baseString.split(separatorPattern);
int numValues = values.length;
if (numValues == 0) {
return null;
}
-
+
int[] returnArray = new int[numValues];
for (int i = 0; i < numValues; ++i) {
returnArray[i] = Integer.parseInt(values[i]);
}
return returnArray;
-
+
}
/**
* Converts the given base String
into
* an array of double
, splitting the base along the
* given separator pattern.
- * Note: this method assumes the input is a string containing
+ * Note: this method assumes the input is a string containing
* only decimal doubles, signed or unsigned, that are parsable
* by java.lang.Double.parseDouble(String)
. If this
* is not the case, the resulting NumberFormatException
* will have to be handled by the caller.
- *
+ *
* @param baseString the base string
* @param separatorPattern the pattern separating the integer values
* (if this is null
, the baseString is parsed as one
- * double value)
+ * double value)
* @return an array of double
whose size is equal to the number
* values in the input string; null
if this number
* is equal to zero.
*/
public static double[] toDoubleArray(String baseString, String separatorPattern) {
-
+
if (baseString == null || "".equals(baseString)) {
return null;
}
-
+
if (separatorPattern == null || "".equals(separatorPattern)) {
return new double[] { Double.parseDouble(baseString) };
}
-
+
String[] values = baseString.split(separatorPattern);
int numValues = values.length;
if (numValues == 0) {
return null;
}
-
+
double[] returnArray = new double[numValues];
for (int i = 0; i < numValues; ++i) {
returnArray[i] = Double.parseDouble(values[i]);
}
return returnArray;
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/util/DOM2SAX.java b/src/java/org/apache/fop/util/DOM2SAX.java
index 15f371b45..04096e053 100644
--- a/src/java/org/apache/fop/util/DOM2SAX.java
+++ b/src/java/org/apache/fop/util/DOM2SAX.java
@@ -35,7 +35,7 @@ import org.xml.sax.helpers.AttributesImpl;
/**
* Helper class that produces a SAX stream from a DOM Document.
*
This section lists other known issues.
+- Apache Ant must be installed in order to + Apache Ant (Version 1.7 or later) must be installed in order to build FOP. Following best practices we don't include Ant with FOP anymore. You can find the instructions to install Ant in the Ant manual on the web.
diff --git a/src/documentation/content/xdocs/trunk/output.xml b/src/documentation/content/xdocs/trunk/output.xml index d03041f19..5e1b09088 100644 --- a/src/documentation/content/xdocs/trunk/output.xml +++ b/src/documentation/content/xdocs/trunk/output.xml @@ -754,6 +754,24 @@ out = proc.getOutputStream();]]>+ These are some known restrictions compared to other supported output formats (not a complete list): +
++ If you run into the problem that the printed output is incomplete on Windows: + this often happens to users printing to a PCL printer. + There seems to be an incompatibility between Java and certain PCL printer drivers + on Windows. Since most network-enabled laser printers support PostScript, try + switching to the PostScript printer driver for that printer model. +
+fo:block object
.
*/
-public class Block extends FObjMixed {
+public class Block extends FObjMixed implements BreakPropertySet {
// used for FO validation
private boolean blockOrInlineItemFound = false;
diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java
index 25b3f2a2a..b0bfb3a32 100644
--- a/src/java/org/apache/fop/fo/flow/BlockContainer.java
+++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java
@@ -28,6 +28,7 @@ import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.BreakPropertySet;
import org.apache.fop.fo.properties.CommonAbsolutePosition;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonMarginBlock;
@@ -38,7 +39,7 @@ import org.apache.fop.fo.properties.LengthRangeProperty;
* Class modelling the
* fo:block-container
object.
*/
-public class BlockContainer extends FObj {
+public class BlockContainer extends FObj implements BreakPropertySet {
// The value of properties relevant for fo:block-container.
private CommonAbsolutePosition commonAbsolutePosition;
private CommonBorderPaddingBackground commonBorderPaddingBackground;
diff --git a/src/java/org/apache/fop/fo/flow/ListBlock.java b/src/java/org/apache/fop/fo/flow/ListBlock.java
index dfadc9c02..8f72ded67 100644
--- a/src/java/org/apache/fop/fo/flow/ListBlock.java
+++ b/src/java/org/apache/fop/fo/flow/ListBlock.java
@@ -27,6 +27,7 @@ import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.BreakPropertySet;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.fo.properties.KeepProperty;
@@ -35,7 +36,7 @@ import org.apache.fop.fo.properties.KeepProperty;
* Class modelling the
* fo:list-block
object.
*/
-public class ListBlock extends FObj {
+public class ListBlock extends FObj implements BreakPropertySet {
// The value of properties relevant for fo:list-block.
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private CommonMarginBlock commonMarginBlock;
diff --git a/src/java/org/apache/fop/fo/flow/ListItem.java b/src/java/org/apache/fop/fo/flow/ListItem.java
index 95760c00b..f748bc15a 100644
--- a/src/java/org/apache/fop/fo/flow/ListItem.java
+++ b/src/java/org/apache/fop/fo/flow/ListItem.java
@@ -26,6 +26,7 @@ import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.BreakPropertySet;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.fo.properties.KeepProperty;
@@ -34,7 +35,7 @@ import org.apache.fop.fo.properties.KeepProperty;
* Class modelling the
* fo:list-item
object.
*/
-public class ListItem extends FObj {
+public class ListItem extends FObj implements BreakPropertySet {
// The value of properties relevant for fo:list-item.
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private CommonMarginBlock commonMarginBlock;
diff --git a/src/java/org/apache/fop/fo/flow/table/Table.java b/src/java/org/apache/fop/fo/flow/table/Table.java
index efd1f1c93..86196cb29 100644
--- a/src/java/org/apache/fop/fo/flow/table/Table.java
+++ b/src/java/org/apache/fop/fo/flow/table/Table.java
@@ -31,6 +31,7 @@ import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.StaticPropertyList;
import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.BreakPropertySet;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.fo.properties.KeepProperty;
@@ -42,7 +43,7 @@ import org.apache.fop.fo.properties.TableColLength;
* Class modelling the
* fo:table
object.
*/
-public class Table extends TableFObj implements ColumnNumberManagerHolder {
+public class Table extends TableFObj implements ColumnNumberManagerHolder, BreakPropertySet {
/** properties */
private CommonBorderPaddingBackground commonBorderPaddingBackground;
diff --git a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
index 548a9c4fa..919e73bfb 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
@@ -32,7 +32,7 @@ import org.apache.fop.fo.ValidationException;
* fo:table-and-caption
property.
* @todo needs implementation
*/
-public class TableAndCaption extends FObj {
+public class TableAndCaption extends FObj /*implements BreakPropertySet*/ {
// The value of properties relevant for fo:table-and-caption.
// Unused but valid items, commented out for performance:
// private CommonAccessibility commonAccessibility;
diff --git a/src/java/org/apache/fop/fo/flow/table/TableRow.java b/src/java/org/apache/fop/fo/flow/table/TableRow.java
index 4d11f8780..a40b550bc 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableRow.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableRow.java
@@ -27,6 +27,7 @@ import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.BreakPropertySet;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.LengthRangeProperty;
@@ -35,7 +36,7 @@ import org.apache.fop.fo.properties.LengthRangeProperty;
* Class modelling the
* fo:table-row
object.
*/
-public class TableRow extends TableCellContainer {
+public class TableRow extends TableCellContainer implements BreakPropertySet {
// The value of properties relevant for fo:table-row.
private LengthRangeProperty blockProgressionDimension;
private CommonBorderPaddingBackground commonBorderPaddingBackground;
diff --git a/src/java/org/apache/fop/fo/properties/BreakPropertySet.java b/src/java/org/apache/fop/fo/properties/BreakPropertySet.java
new file mode 100644
index 000000000..2babe0f19
--- /dev/null
+++ b/src/java/org/apache/fop/fo/properties/BreakPropertySet.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fo.properties;
+
+/**
+ * Defines property access methods for the break-before and break-after properties.
+ */
+public interface BreakPropertySet {
+
+ /** @return the "break-after" property. */
+ int getBreakAfter();
+
+ /** @return the "break-before" property. */
+ int getBreakBefore();
+
+}
diff --git a/src/java/org/apache/fop/fonts/MultiByteFont.java b/src/java/org/apache/fop/fonts/MultiByteFont.java
index 4843b308a..f25ca4e7e 100644
--- a/src/java/org/apache/fop/fonts/MultiByteFont.java
+++ b/src/java/org/apache/fop/fonts/MultiByteFont.java
@@ -29,7 +29,6 @@ import java.util.Map;
public class MultiByteFont extends CIDFont {
private static int uniqueCounter = -1;
- private static final DecimalFormat COUNTER_FORMAT = new DecimalFormat("00000");
private String ttcName = null;
private String encoding = "Identity-H";
@@ -58,7 +57,8 @@ public class MultiByteFont extends CIDFont {
uniqueCounter = 0; //We need maximum 5 character then we start again
}
}
- String cntString = COUNTER_FORMAT.format(uniqueCounter);
+ DecimalFormat counterFormat = new DecimalFormat("00000");
+ String cntString = counterFormat.format(uniqueCounter);
//Subset prefix as described in chapter 5.5.3 of PDF 1.4
StringBuffer sb = new StringBuffer("E");
diff --git a/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java b/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
index b7ea72bf0..624d99fc0 100644
--- a/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
+++ b/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
@@ -68,10 +68,10 @@ public class ImageConverterSVG2G2D extends AbstractImageConverter {
}
//Prepare
- float pxToMillimeter = (float)UnitConv.mm2in(72); //default: 72dpi
+ float pxToMillimeter = UnitConv.IN2MM / 72; //default: 72dpi
Number ptm = (Number)hints.get(ImageProcessingHints.SOURCE_RESOLUTION);
if (ptm != null) {
- pxToMillimeter = (float)UnitConv.mm2in(ptm.doubleValue());
+ pxToMillimeter = (float)(UnitConv.IN2MM / ptm.doubleValue());
}
UserAgent ua = createBatikUserAgent(pxToMillimeter);
GVTBuilder builder = new GVTBuilder();
diff --git a/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java b/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java
index ce6cde9d9..916b80d02 100644
--- a/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java
+++ b/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java
@@ -46,6 +46,7 @@ import org.apache.xmlgraphics.image.loader.impl.AbstractImagePreloader;
import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM;
import org.apache.xmlgraphics.image.loader.util.ImageUtil;
import org.apache.xmlgraphics.util.MimeConstants;
+import org.apache.xmlgraphics.util.UnitConv;
import org.apache.fop.svg.SimpleSVGUserAgent;
import org.apache.fop.util.UnclosableInputStream;
@@ -119,7 +120,7 @@ public class PreloaderSVG extends AbstractImagePreloader {
in.mark(length + 1);
SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(
getParserName());
- doc = (SVGDocument) factory.createSVGDocument(src.getSystemId(), in);
+ doc = factory.createSVGDocument(src.getSystemId(), in);
}
ImageInfo info = createImageInfo(uri, context, doc);
@@ -154,7 +155,7 @@ public class PreloaderSVG extends AbstractImagePreloader {
private ImageInfo createImageInfo(String uri, ImageContext context, SVGDocument doc) {
Element e = doc.getRootElement();
- float pxUnitToMillimeter = 25.4f / context.getSourceResolution();
+ float pxUnitToMillimeter = UnitConv.IN2MM / context.getSourceResolution();
UserAgent userAg = new SimpleSVGUserAgent(pxUnitToMillimeter,
new AffineTransform()) {
@@ -184,9 +185,12 @@ public class PreloaderSVG extends AbstractImagePreloader {
float height = UnitProcessor.svgVerticalLengthToUserSpace(
s, SVGOMDocument.SVG_HEIGHT_ATTRIBUTE, uctx);
+ int widthMpt = (int)Math.round(px2mpt(width, context.getSourceResolution()));
+ int heightMpt = (int)Math.round(px2mpt(height, context.getSourceResolution()));
+
ImageInfo info = new ImageInfo(uri, MimeConstants.MIME_SVG);
ImageSize size = new ImageSize();
- size.setSizeInMillipoints(Math.round(width * 1000), Math.round(height * 1000));
+ size.setSizeInMillipoints(widthMpt, heightMpt);
//Set the resolution to that of the FOUserAgent
size.setResolution(context.getSourceResolution());
size.calcPixelsFromSize();
@@ -210,4 +214,8 @@ public class PreloaderSVG extends AbstractImagePreloader {
}
+ private static double px2mpt(double px, double resolution) {
+ return px * 1000 * UnitConv.IN2PT / resolution;
+ }
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
index 17eb44049..b6dd4d082 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
@@ -251,12 +251,11 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
List returnList = new LinkedList();
if (!breakBeforeServed) {
- try {
+ breakBeforeServed = true;
+ if (!context.suppressBreakBefore()) {
if (addKnuthElementsForBreakBefore(returnList, context)) {
return returnList;
}
- } finally {
- breakBeforeServed = true;
}
}
@@ -281,6 +280,10 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
childLC.setStackLimitBP(MinOptMax.subtract(context.getStackLimitBP(), stackLimit));
childLC.setRefIPD(relDims.ipd);
childLC.setWritingMode(getBlockContainerFO().getWritingMode());
+ if (curLM == this.childLMs.get(0)) {
+ childLC.setFlags(LayoutContext.SUPPRESS_BREAK_BEFORE);
+ //Handled already by the parent (break collapsing, see above)
+ }
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
index 1d6662cb2..8837b1a0f 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
@@ -31,11 +31,13 @@ import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
import org.apache.fop.area.BlockParent;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.properties.BreakPropertySet;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.SpaceProperty;
import org.apache.fop.layoutmgr.inline.InlineLayoutManager;
import org.apache.fop.layoutmgr.inline.LineLayoutManager;
import org.apache.fop.traits.MinOptMax;
+import org.apache.fop.util.BreakUtil;
import org.apache.fop.util.ListUtil;
/**
@@ -255,12 +257,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
List returnList = new LinkedList();
if (!breakBeforeServed) {
- try {
+ breakBeforeServed = true;
+ if (!context.suppressBreakBefore()) {
if (addKnuthElementsForBreakBefore(returnList, context)) {
return returnList;
}
- } finally {
- breakBeforeServed = true;
}
}
@@ -294,6 +295,10 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(referenceIPD);
}
+ if (curLM == this.childLMs.get(0)) {
+ childLC.setFlags(LayoutContext.SUPPRESS_BREAK_BEFORE);
+ //Handled already by the parent (break collapsing, see above)
+ }
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
@@ -1004,18 +1009,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
*/
protected boolean addKnuthElementsForBreakBefore(List returnList,
LayoutContext context) {
- int breakBefore = -1;
- if (fobj instanceof org.apache.fop.fo.flow.Block) {
- breakBefore = ((org.apache.fop.fo.flow.Block) fobj).getBreakBefore();
- } else if (fobj instanceof org.apache.fop.fo.flow.BlockContainer) {
- breakBefore = ((org.apache.fop.fo.flow.BlockContainer) fobj).getBreakBefore();
- } else if (fobj instanceof org.apache.fop.fo.flow.ListBlock) {
- breakBefore = ((org.apache.fop.fo.flow.ListBlock) fobj).getBreakBefore();
- } else if (fobj instanceof org.apache.fop.fo.flow.ListItem) {
- breakBefore = ((org.apache.fop.fo.flow.ListItem) fobj).getBreakBefore();
- } else if (fobj instanceof org.apache.fop.fo.flow.table.Table) {
- breakBefore = ((org.apache.fop.fo.flow.table.Table) fobj).getBreakBefore();
- }
+ int breakBefore = getBreakBefore();
if (breakBefore == EN_PAGE
|| breakBefore == EN_COLUMN
|| breakBefore == EN_EVEN_PAGE
@@ -1029,6 +1023,27 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
}
+ /**
+ * Returns the break-before value of the current formatting object.
+ * @return the break-before value (Constants.EN_*)
+ */
+ private int getBreakBefore() {
+ int breakBefore = EN_AUTO;
+ if (fobj instanceof BreakPropertySet) {
+ breakBefore = ((BreakPropertySet)fobj).getBreakBefore();
+ }
+ if (true /* uncomment to only partially merge: && breakBefore != EN_AUTO*/) {
+ LayoutManager lm = getChildLM();
+ //It is assumed this is only called when the first LM is active.
+ if (lm instanceof BlockStackingLayoutManager) {
+ BlockStackingLayoutManager bslm = (BlockStackingLayoutManager)lm;
+ breakBefore = BreakUtil.compareBreakClasses(
+ breakBefore, bslm.getBreakBefore());
+ }
+ }
+ return breakBefore;
+ }
+
/**
* Creates Knuth elements for break-after and adds them to the return list.
* @param returnList return list to add the additional elements to
@@ -1038,16 +1053,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected boolean addKnuthElementsForBreakAfter(List returnList,
LayoutContext context) {
int breakAfter = -1;
- if (fobj instanceof org.apache.fop.fo.flow.Block) {
- breakAfter = ((org.apache.fop.fo.flow.Block) fobj).getBreakAfter();
- } else if (fobj instanceof org.apache.fop.fo.flow.BlockContainer) {
- breakAfter = ((org.apache.fop.fo.flow.BlockContainer) fobj).getBreakAfter();
- } else if (fobj instanceof org.apache.fop.fo.flow.ListBlock) {
- breakAfter = ((org.apache.fop.fo.flow.ListBlock) fobj).getBreakAfter();
- } else if (fobj instanceof org.apache.fop.fo.flow.ListItem) {
- breakAfter = ((org.apache.fop.fo.flow.ListItem) fobj).getBreakAfter();
- } else if (fobj instanceof org.apache.fop.fo.flow.table.Table) {
- breakAfter = ((org.apache.fop.fo.flow.table.Table) fobj).getBreakAfter();
+ if (fobj instanceof BreakPropertySet) {
+ breakAfter = ((BreakPropertySet)fobj).getBreakAfter();
}
if (breakAfter == EN_PAGE
|| breakAfter == EN_COLUMN
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutContext.java b/src/java/org/apache/fop/layoutmgr/LayoutContext.java
index 1be89304b..8b716dfde 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutContext.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutContext.java
@@ -47,12 +47,10 @@ public class LayoutContext {
public static final int CHECK_REF_AREA = 0x08;
/**
- * If this flag is set, it indicates that any leading fo:character
- * objects with suppress-at-line-break="suppress" should not generate
- * areas. This is the case at the beginning of each new LineArea
- * except the first.
+ * If this flag is set, it indicates that any break-before values other than "auto" should
+ * not cause a mandatory break as this break was already handled by a parent layout manager.
*/
- public static final int SUPPRESS_LEADING_SPACE = 0x10;
+ public static final int SUPPRESS_BREAK_BEFORE = 0x10;
public static final int FIRST_AREA = 0x20;
public static final int TRY_HYPHENATE = 0x40;
public static final int LAST_AREA = 0x80;
@@ -227,8 +225,8 @@ public class LayoutContext {
return ((this.flags & LAST_AREA) != 0);
}
- public boolean suppressLeadingSpace() {
- return ((this.flags & SUPPRESS_LEADING_SPACE) != 0);
+ public boolean suppressBreakBefore() {
+ return ((this.flags & SUPPRESS_BREAK_BEFORE) != 0);
}
/**
@@ -655,7 +653,7 @@ public class LayoutContext {
+ "\nSpace Adjust: \t" + getSpaceAdjust()
+ "\nIPD Adjust: \t" + getIPDAdjust()
+ "\nResolve Leading Space: \t" + resolveLeadingSpace()
- + "\nSuppress Leading Space: \t" + suppressLeadingSpace()
+ + "\nSuppress Break Before: \t" + suppressBreakBefore()
+ "\nIs First Area: \t" + isFirstArea()
+ "\nStarts New Area: \t" + startsNewArea()
+ "\nIs Last Area: \t" + isLastArea()
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
index f027922f7..d83cca642 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
@@ -197,12 +197,11 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
List returnList = new LinkedList();
if (!breakBeforeServed) {
- try {
+ breakBeforeServed = true;
+ if (!context.suppressBreakBefore()) {
if (addKnuthElementsForBreakBefore(returnList, context)) {
return returnList;
}
- } finally {
- breakBeforeServed = true;
}
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
index c32c6eb3d..c1fc19050 100644
--- a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
+++ b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
@@ -184,10 +184,22 @@ public class ColumnSetup {
* @return the computed base unit (in millipoint)
*/
protected double computeTableUnit(TableLayoutManager tlm) {
+ return computeTableUnit(tlm, tlm.getContentAreaIPD());
+ }
+
+ /**
+ * Works out the base unit for resolving proportional-column-width()
+ * [p-c-w(x) = x * base_unit_ipd]
+ *
+ * @param percentBaseContext the percent base context for relative values
+ * @param contentAreaIPD the IPD of the available content area
+ * @return the computed base unit (in millipoints)
+ */
+ public float computeTableUnit(PercentBaseContext percentBaseContext, int contentAreaIPD) {
int sumCols = 0;
float factors = 0;
- double unit = 0;
+ float unit = 0;
/* calculate the total width (specified absolute/percentages),
* and work out the total number of factors to use to distribute
@@ -196,7 +208,7 @@ public class ColumnSetup {
for (Iterator i = colWidths.iterator(); i.hasNext();) {
Length colWidth = (Length) i.next();
if (colWidth != null) {
- sumCols += colWidth.getValue(tlm);
+ sumCols += colWidth.getValue(percentBaseContext);
if (colWidth instanceof RelativeNumericProperty) {
factors += ((RelativeNumericProperty) colWidth).getTableUnits();
} else if (colWidth instanceof TableColLength) {
@@ -209,8 +221,8 @@ public class ColumnSetup {
* factors (if any)
*/
if (factors > 0) {
- if (sumCols < tlm.getContentAreaIPD()) {
- unit = (tlm.getContentAreaIPD() - sumCols) / factors;
+ if (sumCols < contentAreaIPD) {
+ unit = (contentAreaIPD - sumCols) / factors;
} else {
log.warn("No space remaining to distribute over columns.");
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
index 143c63bb9..dc2b3cc46 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
@@ -267,12 +267,14 @@ public class TableLayoutManager extends BlockStackingLayoutManager
}
addKnuthElementsForSpaceAfter(returnList, alignment);
- //addKnuthElementsForBreakBefore(returnList, context);
- int breakBefore = BreakUtil.compareBreakClasses(getTable().getBreakBefore(),
- childLC.getBreakBefore());
- if (breakBefore != Constants.EN_AUTO) {
- returnList.add(0, new BreakElement(getAuxiliaryPosition(), 0,
- -KnuthElement.INFINITE, breakBefore, context));
+ if (!context.suppressBreakBefore()) {
+ //addKnuthElementsForBreakBefore(returnList, context);
+ int breakBefore = BreakUtil.compareBreakClasses(getTable().getBreakBefore(),
+ childLC.getBreakBefore());
+ if (breakBefore != Constants.EN_AUTO) {
+ returnList.add(0, new BreakElement(getAuxiliaryPosition(), 0,
+ -KnuthElement.INFINITE, breakBefore, context));
+ }
}
//addKnuthElementsForBreakAfter(returnList, context);
diff --git a/src/java/org/apache/fop/pdf/PDFNumber.java b/src/java/org/apache/fop/pdf/PDFNumber.java
index 55834f529..c2fc704da 100644
--- a/src/java/org/apache/fop/pdf/PDFNumber.java
+++ b/src/java/org/apache/fop/pdf/PDFNumber.java
@@ -67,11 +67,33 @@ public class PDFNumber extends PDFObject {
return doubleOut(doubleDown, 6);
}
- // Static cache. Possible concurrency implications. See comment in doubleOut(double, int).
- private static DecimalFormat[] decimalFormatCache = new DecimalFormat[17];
-
private static final String BASE_FORMAT = "0.################";
+ private static class DecimalFormatThreadLocal extends ThreadLocal {
+
+ private int dec;
+
+ public DecimalFormatThreadLocal(int dec) {
+ this.dec = dec;
+ }
+
+ protected synchronized Object initialValue() {
+ String s = "0";
+ if (dec > 0) {
+ s = BASE_FORMAT.substring(0, dec + 2);
+ }
+ DecimalFormat df = new DecimalFormat(s, new DecimalFormatSymbols(Locale.US));
+ return df;
+ }
+ };
+ //DecimalFormat is not thread-safe!
+ private static final ThreadLocal[] DECIMAL_FORMAT_CACHE = new DecimalFormatThreadLocal[17];
+ static {
+ for (int i = 0, c = DECIMAL_FORMAT_CACHE.length; i < c; i++) {
+ DECIMAL_FORMAT_CACHE[i] = new DecimalFormatThreadLocal(i);
+ }
+ }
+
/**
* Output a double value to a string suitable for PDF.
* In this method it is possible to set the maximum
@@ -82,29 +104,15 @@ public class PDFNumber extends PDFObject {
* @return the value as a string
*/
public static String doubleOut(double doubleDown, int dec) {
- if (dec < 0 || dec >= decimalFormatCache.length) {
+ if (dec < 0 || dec >= DECIMAL_FORMAT_CACHE.length) {
throw new IllegalArgumentException("Parameter dec must be between 1 and "
- + (decimalFormatCache.length + 1));
+ + (DECIMAL_FORMAT_CACHE.length + 1));
}
- if (decimalFormatCache[dec] == null) {
- //We don't care about the rare case where a DecimalFormat might be replaced in
- //a multi-threaded environment, so we don't synchronize the access to the static
- //array (mainly for performance reasons). After all, the DecimalFormat instances
- //read-only objects so it doesn't matter which instance is used as long as one
- //is available.
- String s = "0";
- if (dec > 0) {
- s = BASE_FORMAT.substring(0, dec + 2);
- }
- DecimalFormat df = new DecimalFormat(s, new DecimalFormatSymbols(Locale.US));
- decimalFormatCache[dec] = df;
- }
- return decimalFormatCache[dec].format(doubleDown);
+ DecimalFormat df = (DecimalFormat)DECIMAL_FORMAT_CACHE[dec].get();
+ return df.format(doubleDown);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected String toPDFString() {
if (getNumber() == null) {
throw new IllegalArgumentException(
diff --git a/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java b/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java
index 7c4d66689..e3f510853 100644
--- a/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java
+++ b/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java
@@ -38,7 +38,6 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
-
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
@@ -60,8 +59,8 @@ import javax.swing.JToolBar;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
-import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.render.awt.AWTRenderer;
/**
@@ -76,6 +75,8 @@ public class PreviewDialog extends JFrame implements StatusListener {
protected AWTRenderer renderer;
/** The FOUserAgent associated with this window */
protected FOUserAgent foUserAgent;
+ /** The originally configured target resolution */
+ protected float configuredTargetResolution;
/**
* Renderable instance that can be used to reload and re-render a document after
* modifications.
@@ -107,6 +108,7 @@ public class PreviewDialog extends JFrame implements StatusListener {
public PreviewDialog(FOUserAgent foUserAgent, Renderable renderable) {
renderer = (AWTRenderer) foUserAgent.getRendererOverride();
this.foUserAgent = foUserAgent;
+ this.configuredTargetResolution = this.foUserAgent.getTargetResolution();
this.renderable = renderable;
translator = new Translator();
@@ -551,23 +553,23 @@ public class PreviewDialog extends JFrame implements StatusListener {
}
private void scaleActionPerformed(ActionEvent e) {
- try {
- int index = scale.getSelectedIndex();
- if (index == 0) {
- setScale(previewPanel.getScaleToFitWindow() * 100);
- } else if (index == 1) {
- setScale(previewPanel.getScaleToFitWidth() * 100);
- } else {
- String item = (String)scale.getSelectedItem();
- setScale(Double.parseDouble(item.substring(0, item.indexOf('%'))));
- }
- } catch (FOPException fopEx) {
- fopEx.printStackTrace();
+ int index = scale.getSelectedIndex();
+ if (index == 0) {
+ setScaleToFitWindow();
+ } else if (index == 1) {
+ setScaleToFitWidth();
+ } else {
+ String item = (String)scale.getSelectedItem();
+ setScale(Double.parseDouble(item.substring(0, item.indexOf('%'))));
}
}
/** Prints the document */
public void startPrinterJob(boolean showDialog) {
+ //Restore originally configured target resolution
+ float saveResolution = foUserAgent.getTargetResolution();
+ foUserAgent.setTargetResolution(this.configuredTargetResolution);
+
PrinterJob pj = PrinterJob.getPrinterJob();
pj.setPageable(renderer);
if (!showDialog || pj.printDialog()) {
@@ -577,6 +579,8 @@ public class PreviewDialog extends JFrame implements StatusListener {
e.printStackTrace();
}
}
+
+ foUserAgent.setTargetResolution(saveResolution);
}
/**
diff --git a/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java b/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java
index 05e03fda0..f8152a978 100644
--- a/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java
+++ b/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java
@@ -23,6 +23,7 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Point;
+import java.awt.Toolkit;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
@@ -36,11 +37,12 @@ import javax.swing.JViewport;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;
+import org.apache.xmlgraphics.util.UnitConv;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.area.PageViewport;
-
import org.apache.fop.render.awt.AWTRenderer;
@@ -155,6 +157,8 @@ public class PreviewPanel extends JPanel {
this.renderable = renderable;
this.renderer = renderer;
this.foUserAgent = foUserAgent;
+ //Override target resolution for the computer screen
+ this.foUserAgent.setTargetResolution(Toolkit.getDefaultToolkit().getScreenResolution());
gridPanel = new JPanel();
gridPanel.setLayout(new GridLayout(0, 1)); // rows, cols
@@ -393,8 +397,10 @@ public class PreviewPanel extends JPanel {
public double getScaleToFit(double viewWidth, double viewHeight) throws FOPException {
PageViewport pageViewport = renderer.getPageViewport(currentPage);
Rectangle2D pageSize = pageViewport.getViewArea();
- double widthScale = viewWidth / (pageSize.getWidth() / 1000f);
- double heightScale = viewHeight / (pageSize.getHeight() / 1000f);
+ float screenResolution = Toolkit.getDefaultToolkit().getScreenResolution();
+ float screenFactor = screenResolution / UnitConv.IN2PT;
+ double widthScale = viewWidth / (pageSize.getWidth() / 1000f) / screenFactor;
+ double heightScale = viewHeight / (pageSize.getHeight() / 1000f) / screenFactor;
return Math.min(displayMode == CONT_FACING ? widthScale / 2 : widthScale, heightScale);
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java b/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
index b61ebc346..f05a16f1a 100644
--- a/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
@@ -115,7 +115,6 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
pdfInfo.currentStream.add(graphics.getString());
renderer.restoreGraphicsState();
- pdfInfo.pdfState.pop();
}
/** {@inheritDoc} */
diff --git a/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java b/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
index 216802c8f..10c4a9c92 100644
--- a/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
@@ -75,10 +75,12 @@ public final class BorderAttributesConverter {
// Add padding to corresponding space (space-before or space-after)
// if side == START or END, do nothing
- if (side == CommonBorderPaddingBackground.BEFORE) {
- attributes.addIntegerValue(padding, RtfText.SPACE_BEFORE);
- } else if (side == CommonBorderPaddingBackground.AFTER) {
- attributes.addIntegerValue(padding, RtfText.SPACE_AFTER);
+ if (padding != 0) {
+ if (side == CommonBorderPaddingBackground.BEFORE) {
+ attributes.addIntegerValue(padding, RtfText.SPACE_BEFORE);
+ } else if (side == CommonBorderPaddingBackground.AFTER) {
+ attributes.addIntegerValue(padding, RtfText.SPACE_AFTER);
+ }
}
}
}
diff --git a/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java b/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
index caf11323f..33a2ff904 100644
--- a/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
+++ b/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
@@ -19,10 +19,9 @@
package org.apache.fop.render.rtf;
-import java.util.Map;
import java.util.HashMap;
+import java.util.Map;
-//FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.properties.FixedLength;
@@ -143,4 +142,8 @@ final class FoUnitsConverter {
// RTF font size units are in half-points
return (int)(result * 2.0);
}
+
+ public float convertMptToTwips(int width) {
+ return width * POINT_TO_TWIPS / 1000;
+ }
}
diff --git a/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java b/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
index c7f97ef4f..d50a81656 100644
--- a/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
@@ -21,6 +21,7 @@ package org.apache.fop.render.rtf;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.impl.SimpleLog;
+
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.expr.NumericOp;
@@ -58,6 +59,8 @@ final class PageAttributesConverter {
attrib.setTwips(RtfPage.PAGE_WIDTH, pagemaster.getPageWidth());
attrib.setTwips(RtfPage.PAGE_HEIGHT, pagemaster.getPageHeight());
+ //Sets the document level property
+ attrib.set(RtfPage.ITAP, "0");
Object widthRaw = attrib.getValue(RtfPage.PAGE_WIDTH);
Object heightRaw = attrib.getValue(RtfPage.PAGE_HEIGHT);
@@ -102,7 +105,7 @@ final class PageAttributesConverter {
if (after != null) {
afterBottom = (Length) NumericOp.addition(pageBottom, after.getExtent());
}
- attrib.setTwips(RtfPage.FOOTERY, beforeTop);
+ attrib.setTwips(RtfPage.FOOTERY, afterBottom);
} catch (Exception e) {
log.error("Exception in convertPageAttributes: "
+ e.getMessage() + "- page attributes ignored");
diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java
index 1adba9e2b..65c7bf681 100644
--- a/src/java/org/apache/fop/render/rtf/RTFHandler.java
+++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java
@@ -20,6 +20,8 @@
package org.apache.fop.render.rtf;
// Java
+import java.awt.Dimension;
+import java.awt.Rectangle;
import java.awt.geom.Point2D;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -51,12 +53,13 @@ import org.apache.xmlgraphics.image.loader.util.ImageUtil;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.datatypes.LengthBase;
-import org.apache.fop.datatypes.SimplePercentBaseContext;
+import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.events.ResourceEventProducer;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOText;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.XMLObj;
import org.apache.fop.fo.flow.AbstractGraphics;
import org.apache.fop.fo.flow.BasicLink;
@@ -74,6 +77,7 @@ import org.apache.fop.fo.flow.ListItem;
import org.apache.fop.fo.flow.ListItemBody;
import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.flow.PageNumber;
+import org.apache.fop.fo.flow.PageNumberCitation;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableBody;
import org.apache.fop.fo.flow.table.TableFooter;
@@ -89,8 +93,10 @@ import org.apache.fop.fo.pagination.Region;
import org.apache.fop.fo.pagination.SimplePageMaster;
import org.apache.fop.fo.pagination.StaticContent;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
-import org.apache.fop.fo.properties.FixedLength;
+import org.apache.fop.fo.properties.EnumLength;
import org.apache.fop.fonts.FontSetup;
+import org.apache.fop.layoutmgr.inline.ImageLayout;
+import org.apache.fop.layoutmgr.table.ColumnSetup;
import org.apache.fop.render.DefaultFontResolver;
import org.apache.fop.render.RendererEventProducer;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfAfterContainer;
@@ -110,6 +116,7 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFootnote;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfHyperLink;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfPage;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableCell;
@@ -117,6 +124,7 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem.RtfListItemLabel;
import org.apache.fop.render.rtf.rtflib.tools.BuilderContext;
+import org.apache.fop.render.rtf.rtflib.tools.PercentContext;
import org.apache.fop.render.rtf.rtflib.tools.TableContext;
/**
@@ -150,6 +158,10 @@ public class RTFHandler extends FOEventHandler {
private SimplePageMaster pagemaster;
+ private int nestedTableDepth = 1;
+
+ private PercentContext percentManager = new PercentContext();
+
/**
* Creates a new RTF structure handler.
* @param userAgent the FOUserAgent for this process
@@ -173,9 +185,7 @@ public class RTFHandler extends FOEventHandler {
eventProducer.ioError(this, ioe);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startDocument() throws SAXException {
// TODO sections should be created
try {
@@ -187,9 +197,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endDocument() throws SAXException {
try {
rtfFile.flush();
@@ -199,9 +207,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startPageSequence(PageSequence pageSeq) {
try {
//This is needed for region handling
@@ -240,6 +246,14 @@ public class RTFHandler extends FOEventHandler {
builderContext.pushContainer(sect);
+ //Calculate usable page width for this flow
+ int useAblePageWidth = pagemaster.getPageWidth().getValue()
+ - pagemaster.getCommonMarginBlock().marginLeft.getValue()
+ - pagemaster.getCommonMarginBlock().marginRight.getValue()
+ - sect.getRtfAttributes().getValueAsInteger(RtfPage.MARGIN_LEFT).intValue()
+ - sect.getRtfAttributes().getValueAsInteger(RtfPage.MARGIN_RIGHT).intValue();
+ percentManager.setDimension(pageSeq, useAblePageWidth);
+
bHeaderSpecified = false;
bFooterSpecified = false;
} catch (IOException ioe) {
@@ -247,9 +261,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endPageSequence(PageSequence pageSeq) {
if (bDefer) {
//If endBlock was called while SAX parsing, and the passed FO is Block
@@ -267,9 +279,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startFlow(Flow fl) {
if (bDefer) {
return;
@@ -357,9 +367,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endFlow(Flow fl) {
if (bDefer) {
return;
@@ -384,9 +392,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startBlock(Block bl) {
if (bDefer) {
return;
@@ -414,10 +420,7 @@ public class RTFHandler extends FOEventHandler {
}
}
-
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endBlock(Block bl) {
if (bDefer) {
@@ -443,9 +446,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startBlockContainer(BlockContainer blc) {
if (bDefer) {
return;
@@ -472,9 +473,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endBlockContainer(BlockContainer bl) {
if (bDefer) {
return;
@@ -499,9 +498,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startTable(Table tbl) {
if (bDefer) {
return;
@@ -519,6 +516,8 @@ public class RTFHandler extends FOEventHandler {
= TableAttributesConverter.convertTableAttributes(tbl);
RtfTable table = tc.newTable(atts, tableContext);
+ table.setNestedTableDepth(nestedTableDepth);
+ nestedTableDepth++;
CommonBorderPaddingBackground border = tbl.getCommonBorderPaddingBackground();
RtfAttributes borderAttributes = new RtfAttributes();
@@ -545,53 +544,32 @@ public class RTFHandler extends FOEventHandler {
builderContext.pushTableContext(tableContext);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endTable(Table tbl) {
if (bDefer) {
return;
}
+ nestedTableDepth--;
builderContext.popTableContext();
builderContext.popContainer();
}
- /**
- *
- * @param tc TableColumn that is starting;
- */
-
+ /** {@inheritDoc} */
public void startColumn(TableColumn tc) {
if (bDefer) {
return;
}
try {
- /**
- * Pass a SimplePercentBaseContext to getValue in order to
- * avoid a NullPointerException, which occurs when you use
- * proportional-column-width function in column-width attribute.
- * Of course the results won't be correct, but at least the
- * rest of the document will be rendered. Usage of the
- * TableLayoutManager is not welcome due to design reasons and
- * it also does not provide the correct values.
- * TODO: Make proportional-column-width working for rtf output
- */
- SimplePercentBaseContext context
- = new SimplePercentBaseContext(null,
- LengthBase.TABLE_UNITS,
- 100000);
-
- Integer iWidth
- = new Integer(tc.getColumnWidth().getValue(context) / 1000);
+ int iWidth = tc.getColumnWidth().getValue(percentManager);
+ percentManager.setDimension(tc, iWidth);
- String strWidth = iWidth.toString() + FixedLength.POINT;
- Float width = new Float(
- FoUnitsConverter.getInstance().convertToTwips(strWidth));
+ //convert to twips
+ Float width = new Float(FoUnitsConverter.getInstance().convertMptToTwips(iWidth));
builderContext.getTableContext().setNextColumnWidth(width);
builderContext.getTableContext().setNextColumnRowSpanning(
- new Integer(0), null);
+ new Integer(0), null);
builderContext.getTableContext().setNextFirstSpanningCol(false);
} catch (Exception e) {
log.error("startColumn: " + e.getMessage());
@@ -599,49 +577,34 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- *
- * @param tc TableColumn that is ending;
- */
-
+ /** {@inheritDoc} */
public void endColumn(TableColumn tc) {
if (bDefer) {
return;
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startHeader(TableHeader header) {
startPart(header);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endHeader(TableHeader header) {
endPart(header);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startFooter(TableFooter footer) {
startPart(footer);
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endFooter(TableFooter footer) {
endPart(footer);
}
- /**
- *
- * @param inl Inline that is starting.
- */
+ /** {@inheritDoc} */
public void startInline(Inline inl) {
if (bDefer) {
return;
@@ -669,10 +632,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- *
- * @param inl Inline that is ending.
- */
+ /** {@inheritDoc} */
public void endInline(Inline inl) {
if (bDefer) {
return;
@@ -735,10 +695,7 @@ public class RTFHandler extends FOEventHandler {
startPart(body);
}
-
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endBody(TableBody body) {
endPart(body);
}
@@ -775,9 +732,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endRow(TableRow tr) {
if (bDefer) {
return;
@@ -814,9 +769,7 @@ public class RTFHandler extends FOEventHandler {
builderContext.getTableContext().decreaseRowSpannings();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startCell(TableCell tc) {
if (bDefer) {
return;
@@ -868,7 +821,6 @@ public class RTFHandler extends FOEventHandler {
//process number-columns-spanned attribute
if (numberColumnsSpanned > 0) {
// Get the number of columns spanned
- RtfTable table = row.getTable();
tctx.setCurrentFirstSpanningCol(true);
// We widthdraw one cell because the first cell is already created
@@ -876,6 +828,8 @@ public class RTFHandler extends FOEventHandler {
for (int i = 0; i < numberColumnsSpanned - 1; ++i) {
tctx.selectNextColumn();
+ //aggregate width for further elements
+ width += tctx.getColumnWidth();
tctx.setCurrentFirstSpanningCol(false);
RtfTableCell hCell = row.newTableCellMergedHorizontally(
0, null);
@@ -890,10 +844,12 @@ public class RTFHandler extends FOEventHandler {
cell.getRtfAttributes());
} else {
tctx.setCurrentColumnRowSpanning(
- new Integer(numberRowsSpanned), null);
+ new Integer(numberRowsSpanned), cell.getRtfAttributes());
}
}
}
+ //save width of the cell, convert from twips to mpt
+ percentManager.setDimension(tc, (int)width * 50);
builderContext.pushContainer(cell);
} catch (IOException ioe) {
@@ -904,9 +860,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endCell(TableCell tc) {
if (bDefer) {
return;
@@ -917,9 +871,7 @@ public class RTFHandler extends FOEventHandler {
}
// Lists
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startList(ListBlock lb) {
if (bDefer) {
return;
@@ -944,9 +896,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endList(ListBlock lb) {
if (bDefer) {
return;
@@ -955,9 +905,7 @@ public class RTFHandler extends FOEventHandler {
builderContext.popContainer();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startListItem(ListItem li) {
if (bDefer) {
return;
@@ -995,9 +943,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endListItem(ListItem li) {
if (bDefer) {
return;
@@ -1006,9 +952,7 @@ public class RTFHandler extends FOEventHandler {
builderContext.popContainer();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startListLabel() {
if (bDefer) {
return;
@@ -1028,9 +972,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endListLabel() {
if (bDefer) {
return;
@@ -1039,46 +981,32 @@ public class RTFHandler extends FOEventHandler {
builderContext.popContainer();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startListBody() {
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endListBody() {
}
// Static Regions
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startStatic() {
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endStatic() {
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startMarkup() {
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endMarkup() {
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startLink(BasicLink basicLink) {
if (bDefer) {
return;
@@ -1109,9 +1037,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endLink() {
if (bDefer) {
return;
@@ -1120,9 +1046,7 @@ public class RTFHandler extends FOEventHandler {
builderContext.popContainer();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void image(ExternalGraphic eg) {
if (bDefer) {
return;
@@ -1153,16 +1077,14 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void foreignObject(InstreamForeignObject ifo) {
if (bDefer) {
return;
}
try {
- XMLObj child = (XMLObj) ifo.getChildXMLObj();
+ XMLObj child = ifo.getChildXMLObj();
Document doc = child.getDOMDocument();
String ns = child.getNamespaceURI();
@@ -1191,7 +1113,8 @@ public class RTFHandler extends FOEventHandler {
FOUserAgent userAgent = ifo.getUserAgent();
ImageManager manager = userAgent.getFactory().getImageManager();
- Image converted = manager.convertImage(image, FLAVORS);
+ Map hints = ImageUtil.getDefaultHints(ua.getImageSessionContext());
+ Image converted = manager.convertImage(image, FLAVORS, hints);
putGraphic(ifo, converted);
} catch (ImageException ie) {
@@ -1242,7 +1165,7 @@ public class RTFHandler extends FOEventHandler {
throws IOException {
byte[] rawData = null;
- ImageInfo info = image.getInfo();
+ final ImageInfo info = image.getInfo();
if (image instanceof ImageRawStream) {
ImageRawStream rawImage = (ImageRawStream)image;
@@ -1261,6 +1184,25 @@ public class RTFHandler extends FOEventHandler {
return;
}
+ //Set up percentage calculations
+ this.percentManager.setDimension(abstractGraphic);
+ PercentBaseContext pContext = new PercentBaseContext() {
+
+ public int getBaseLength(int lengthBase, FObj fobj) {
+ switch (lengthBase) {
+ case LengthBase.IMAGE_INTRINSIC_WIDTH:
+ return info.getSize().getWidthMpt();
+ case LengthBase.IMAGE_INTRINSIC_HEIGHT:
+ return info.getSize().getHeightMpt();
+ default:
+ return percentManager.getBaseLength(lengthBase, fobj);
+ }
+ }
+
+ };
+ ImageLayout layout = new ImageLayout(abstractGraphic, pContext,
+ image.getInfo().getSize().getDimensionMpt());
+
final IRtfTextrunContainer c
= (IRtfTextrunContainer)builderContext.getContainer(
IRtfTextrunContainer.class, true, this);
@@ -1273,63 +1215,23 @@ public class RTFHandler extends FOEventHandler {
}
rtfGraphic.setImageData(rawData);
- //set scaling
- if (abstractGraphic.getScaling() == Constants.EN_UNIFORM) {
- rtfGraphic.setScaling ("uniform");
- }
-
- //get width
- int width = 0;
- if (abstractGraphic.getWidth().getEnum() == Constants.EN_AUTO) {
- width = info.getSize().getWidthMpt();
- } else {
- width = abstractGraphic.getWidth().getValue();
- }
-
- //get height
- int height = 0;
- if (abstractGraphic.getWidth().getEnum() == Constants.EN_AUTO) {
- height = info.getSize().getHeightMpt();
- } else {
- height = abstractGraphic.getHeight().getValue();
- }
-
- //get content-width
- int contentwidth = 0;
- if (abstractGraphic.getContentWidth().getEnum()
- == Constants.EN_AUTO) {
- contentwidth = info.getSize().getWidthMpt();
- } else if (abstractGraphic.getContentWidth().getEnum()
- == Constants.EN_SCALE_TO_FIT) {
- contentwidth = width;
- } else {
- //TODO: check, if the value is a percent value
- contentwidth = abstractGraphic.getContentWidth().getValue();
- }
-
- //get content-width
- int contentheight = 0;
- if (abstractGraphic.getContentHeight().getEnum()
- == Constants.EN_AUTO) {
-
- contentheight = info.getSize().getHeightMpt();
-
- } else if (abstractGraphic.getContentHeight().getEnum()
- == Constants.EN_SCALE_TO_FIT) {
-
- contentheight = height;
- } else {
- //TODO: check, if the value is a percent value
- contentheight = abstractGraphic.getContentHeight().getValue();
- }
-
- //set width in rtf
- //newGraphic.setWidth((long) (contentwidth / 1000f) + FixedLength.POINT);
- rtfGraphic.setWidth((long) (contentwidth / 50f) + "twips");
-
- //set height in rtf
- //newGraphic.setHeight((long) (contentheight / 1000f) + FixedLength.POINT);
- rtfGraphic.setHeight((long) (contentheight / 50f) + "twips");
+ FoUnitsConverter converter = FoUnitsConverter.getInstance();
+ Dimension viewport = layout.getViewportSize();
+ Rectangle placement = layout.getPlacement();
+ int cropLeft = Math.round(converter.convertMptToTwips(-placement.x));
+ int cropTop = Math.round(converter.convertMptToTwips(-placement.y));
+ int cropRight = Math.round(converter.convertMptToTwips(
+ -1 * (viewport.width - placement.x - placement.width)));
+ int cropBottom = Math.round(converter.convertMptToTwips(
+ -1 * (viewport.height - placement.y - placement.height)));
+ rtfGraphic.setCropping(cropLeft, cropTop, cropRight, cropBottom);
+
+ int width = Math.round(converter.convertMptToTwips(viewport.width));
+ int height = Math.round(converter.convertMptToTwips(viewport.height));
+ width += cropLeft + cropRight;
+ height += cropTop + cropBottom;
+ rtfGraphic.setWidthTwips(width);
+ rtfGraphic.setHeightTwips(height);
//TODO: make this configurable:
// int compression = m_context.m_options.getRtfExternalGraphicCompressionRate ();
@@ -1342,15 +1244,11 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void pageRef() {
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startFootnote(Footnote footnote) {
if (bDefer) {
return;
@@ -1375,9 +1273,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endFootnote(Footnote footnote) {
if (bDefer) {
return;
@@ -1386,9 +1282,7 @@ public class RTFHandler extends FOEventHandler {
builderContext.popContainer();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void startFootnoteBody(FootnoteBody body) {
if (bDefer) {
return;
@@ -1409,9 +1303,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void endFootnoteBody(FootnoteBody body) {
if (bDefer) {
return;
@@ -1432,10 +1324,28 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void leader(Leader l) {
+ if (bDefer) {
+ return;
+ }
+
+ try {
+ percentManager.setDimension(l);
+ RtfAttributes rtfAttr = TextAttributesConverter.convertLeaderAttributes(
+ l, percentManager);
+
+ IRtfTextrunContainer container
+ = (IRtfTextrunContainer)builderContext.getContainer(
+ IRtfTextrunContainer.class, true, this);
+ RtfTextrun textrun = container.getTextrun();
+
+ textrun.addLeader(rtfAttr);
+
+ } catch (Exception e) {
+ log.error("startLeader: " + e.getMessage());
+ throw new RuntimeException(e.getMessage());
+ }
}
/**
@@ -1469,10 +1379,7 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- *
- * @param pagenum PageNumber that is starting.
- */
+ /** {@inheritDoc} */
public void startPageNumber(PageNumber pagenum) {
if (bDefer) {
return;
@@ -1497,16 +1404,64 @@ public class RTFHandler extends FOEventHandler {
}
}
- /**
- *
- * @param pagenum PageNumber that is ending.
- */
+ /** {@inheritDoc} */
public void endPageNumber(PageNumber pagenum) {
if (bDefer) {
return;
}
}
+ /** {@inheritDoc} */
+ public void startPageNumberCitation(PageNumberCitation l) {
+ if (bDefer) {
+ return;
+ }
+ try {
+
+ IRtfTextrunContainer container
+ = (IRtfTextrunContainer)builderContext.getContainer(
+ IRtfTextrunContainer.class, true, this);
+ RtfTextrun textrun = container.getTextrun();
+
+ textrun.addPageNumberCitation(l.getRefId());
+
+ } catch (Exception e) {
+ log.error("startPageNumberCitation: " + e.getMessage());
+ throw new RuntimeException(e.getMessage());
+ }
+ }
+
+ private void prepareTable(Table tab) {
+ // Allows to receive the available width of the table
+ percentManager.setDimension(tab);
+
+ // Table gets expanded by half of the border on each side inside Word
+ // When using wide borders the table gets cut off
+ int tabDiff = tab.getCommonBorderPaddingBackground().getBorderStartWidth(false) / 2
+ + tab.getCommonBorderPaddingBackground().getBorderEndWidth(false);
+
+ // check for "auto" value
+ if (!(tab.getInlineProgressionDimension().getMaximum(null).getLength()
+ instanceof EnumLength)) {
+ // value specified
+ percentManager.setDimension(tab,
+ tab.getInlineProgressionDimension().getMaximum(null)
+ .getLength().getValue(percentManager)
+ - tabDiff);
+ } else {
+ // set table width again without border width
+ percentManager.setDimension(tab, percentManager.getBaseLength(
+ LengthBase.CONTAINING_BLOCK_WIDTH, tab) - tabDiff);
+ }
+
+ ColumnSetup columnSetup = new ColumnSetup(tab);
+ //int sumOfColumns = columnSetup.getSumOfColumnWidths(percentManager);
+ float tableWidth = percentManager.getBaseLength(LengthBase.CONTAINING_BLOCK_WIDTH, tab);
+ float tableUnit = columnSetup.computeTableUnit(percentManager, Math.round(tableWidth));
+ percentManager.setTableUnit(tab, Math.round(tableUnit));
+
+ }
+
/**
* Calls the appropriate event handler for the passed FObj.
*
@@ -1659,6 +1614,16 @@ public class RTFHandler extends FOEventHandler {
} else {
endCell( (TableCell) foNode);
}
+ } else if (foNode instanceof Leader) {
+ if (bStart) {
+ leader((Leader) foNode);
+ }
+ } else if (foNode instanceof PageNumberCitation) {
+ if (bStart) {
+ startPageNumberCitation((PageNumberCitation) foNode);
+ } else {
+ endPageNumberCitation((PageNumberCitation) foNode);
+ }
} else {
RTFEventProducer eventProducer = RTFEventProducer.Provider.get(
getUserAgent().getEventBroadcaster());
@@ -1701,9 +1666,12 @@ public class RTFHandler extends FOEventHandler {
//recurse all table-columns
if (table.getColumns() != null) {
- for (Iterator it = table.getColumns().iterator(); it.hasNext();) {
- recurseFONode( (FONode) it.next() );
- }
+ //Calculation for column-widths which are not set
+ prepareTable(table);
+
+ for (Iterator it = table.getColumns().iterator(); it.hasNext();) {
+ recurseFONode( (FONode) it.next() );
+ }
} else {
//TODO Implement implicit column setup handling!
RTFEventProducer eventProducer = RTFEventProducer.Provider.get(
diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
index 792193b15..63c470b5d 100644
--- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
@@ -21,25 +21,30 @@ package org.apache.fop.render.rtf;
import java.awt.Color;
-//FOP
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
+import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOText;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.BlockContainer;
import org.apache.fop.fo.flow.Inline;
+import org.apache.fop.fo.flow.Leader;
import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonFont;
import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.fo.properties.CommonTextDecoration;
-import org.apache.fop.render.rtf.BorderAttributesConverter;
+import org.apache.fop.fo.properties.PercentLength;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IBorderAttributes;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFontManager;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfLeader;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
/** Converts FO properties to RtfAttributes
@@ -53,6 +58,8 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
*/
final class TextAttributesConverter {
+ private static Log log = LogFactory.getLog(TextAttributesConverter.class);
+
/**
* Constructor is private, because it's just a utility class.
*/
@@ -137,6 +144,131 @@ final class TextAttributesConverter {
return attrib;
}
+
+ /**
+ * Converts FO properties used by RtfLeader to RtfAttributes.
+ * @param fobj Leader
+ * @param context PercentBaseContext
+ * @return RtfAttributes
+ * @throws FOPException
+ */
+ public static RtfAttributes convertLeaderAttributes(Leader fobj, PercentBaseContext context)
+ throws FOPException {
+ boolean tab = false;
+ FOPRtfAttributes attrib = new FOPRtfAttributes();
+ attrib.set(RtfText.ATTR_FONT_FAMILY,
+ RtfFontManager.getInstance().getFontNumber(fobj.getCommonFont().getFirstFontFamily()));
+
+ if (fobj.getLeaderLength() != null) {
+ attrib.set(RtfLeader.LEADER_WIDTH, convertMptToTwips(fobj.getLeaderLength().getMaximum(
+ context).getLength().getValue(context)));
+
+ if (fobj.getLeaderLength().getMaximum(context) instanceof PercentLength) {
+ if (((PercentLength)fobj.getLeaderLength().getMaximum(context)).getString().equals(
+ "100.0%")) {
+ // Use Tab instead of white spaces
+ attrib.set(RtfLeader.LEADER_USETAB, 1);
+ tab = true;
+ }
+ }
+ }
+
+ attrFontColor(fobj.getColor(), attrib);
+
+ if (fobj.getLeaderPatternWidth() != null) {
+ //TODO calculate pattern width not possible for white spaces, because its using
+ //underlines for tab it would work with LEADER_PATTERN_WIDTH (expndtw)
+ }
+
+ switch(fobj.getLeaderPattern()) {
+ case Constants.EN_DOTS:
+ if (tab) {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_TAB_DOTTED);
+ } else {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_DOTTED);
+ }
+ break;
+ case Constants.EN_SPACE:
+ //nothing has to be set for spaces
+ break;
+ case Constants.EN_RULE:
+ //Things like start-indent, space-after, ... not supported?
+ //Leader class does not offer these properties
+ //TODO aggregate them with the leader width or
+ // create a second - blank leader - before
+
+ if (fobj.getRuleThickness() != null) {
+ //TODO See inside RtfLeader, better calculation for
+ //white spaces would be necessary
+ //attrib.set(RtfLeader.LEADER_RULE_THICKNESS,
+ // fobj.getRuleThickness().getValue(context));
+ log.warn("RTF: fo:leader rule-thickness not supported");
+ }
+
+ switch (fobj.getRuleStyle()) {
+ case Constants.EN_SOLID:
+ if (tab) {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_TAB_THICK);
+ } else {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_THICK);
+ }
+ break;
+ case Constants.EN_DASHED:
+ if (tab) {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_TAB_MIDDLEDOTTED);
+ } else {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_MIDDLEDOTTED);
+ }
+ break;
+ case Constants.EN_DOTTED:
+ if (tab) {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_TAB_DOTTED);
+ } else {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_DOTTED);
+ }
+ break;
+ case Constants.EN_DOUBLE:
+ if (tab) {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_TAB_EQUAL);
+ } else {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_EQUAL);
+ }
+ break;
+ case Constants.EN_GROOVE:
+ if (tab) {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_TAB_HYPHENS);
+ } else {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_HYPHENS);
+ }
+ break;
+ case Constants.EN_RIDGE:
+ if (tab) {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_TAB_UNDERLINE);
+ } else {
+ attrib.set(RtfLeader.LEADER_TABLEAD, RtfLeader.LEADER_UNDERLINE);
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case Constants.EN_USECONTENT:
+ log.warn("RTF: fo:leader use-content not supported");
+ break;
+ default:
+ break;
+ }
+
+ if (fobj.getLeaderAlignment() == Constants.EN_REFERENCE_AREA) {
+ log.warn("RTF: fo:leader reference-area not supported");
+ }
+ return attrib;
+ }
+
+ private static int convertMptToTwips(int mpt) {
+ return Math.round(FoUnitsConverter.getInstance().convertMptToTwips(mpt));
+ }
+
private static void attrFont(CommonFont font, FOPRtfAttributes rtfAttr) {
rtfAttr.set(RtfText.ATTR_FONT_FAMILY,
RtfFontManager.getInstance().getFontNumber(font.getFirstFontFamily()));
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
index 2eb95b587..5ec5e907e 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
@@ -28,6 +28,7 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc;
import java.util.HashMap;
import java.util.Iterator;
+
import org.xml.sax.Attributes;
import org.xml.sax.helpers.AttributesImpl;
@@ -163,6 +164,15 @@ implements java.lang.Cloneable {
return values.get(name);
}
+ /**
+ * Returns a value as an Integer. The value is simply cast to an Integer.
+ * @param name String containing attribute name
+ * @return the value of an attribute, null if not found
+ */
+ public Integer getValueAsInteger(String name) {
+ return (Integer)values.get(name);
+ }
+
/**
* @param name String containing attribute name
* @return true if given attribute is set
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
index 182894ea5..6123ac563 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
@@ -269,6 +269,9 @@ public class RtfExternalGraphic extends RtfElement {
*/
protected boolean scaleUniform = false;
+ /** cropping on left/top/right/bottom edges for \piccrop*N */
+ private int[] cropValues = new int[4];
+
/**
* Graphic compression rate
*/
@@ -406,6 +409,7 @@ public class RtfExternalGraphic extends RtfElement {
computeImageSize();
writeSizeInfo();
+ writeAttributes(getRtfAttributes(), null);
for (int i = 0; i < imagedata.length; i++) {
int iData = imagedata [i];
@@ -519,6 +523,19 @@ public class RtfExternalGraphic extends RtfElement {
writeControlWord("picscaley" + widthDesired * 100 / width);
}
}
+
+ if (this.cropValues[0] != 0) {
+ writeOneAttribute("piccropl", new Integer(this.cropValues[0]));
+ }
+ if (this.cropValues[1] != 0) {
+ writeOneAttribute("piccropt", new Integer(this.cropValues[1]));
+ }
+ if (this.cropValues[2] != 0) {
+ writeOneAttribute("piccropr", new Integer(this.cropValues[2]));
+ }
+ if (this.cropValues[3] != 0) {
+ writeOneAttribute("piccropb", new Integer(this.cropValues[3]));
+ }
}
//////////////////////////////////////////////////
@@ -545,6 +562,24 @@ public class RtfExternalGraphic extends RtfElement {
this.perCentW = ImageUtil.isPercent(theWidth);
}
+ /**
+ * Sets the desired width of the image.
+ * @param twips The desired image width (in twips)
+ */
+ public void setWidthTwips(int twips) {
+ this.widthDesired = twips;
+ this.perCentW = false;
+ }
+
+ /**
+ * Sets the desired height of the image.
+ * @param twips The desired image height (in twips)
+ */
+ public void setHeightTwips(int twips) {
+ this.heightDesired = twips;
+ this.perCentH = false;
+ }
+
/**
* Sets the flag whether the image size shall be adjusted.
*
@@ -553,9 +588,34 @@ public class RtfExternalGraphic extends RtfElement {
* false no adjustment
*/
public void setScaling(String value) {
- if (value.equalsIgnoreCase("uniform")) {
- this.scaleUniform = true;
- }
+ setUniformScaling("uniform".equalsIgnoreCase(value));
+ }
+
+ /**
+ * Sets the flag whether the image size shall be adjusted.
+ *
+ * @param uniform
+ * true image width or height shall be adjusted automatically\n
+ * false no adjustment
+ */
+ public void setUniformScaling(boolean uniform) {
+ this.scaleUniform = uniform;
+ }
+
+ /**
+ * Sets cropping values for all four edges for the \piccrop*N commands.
+ * A positive value crops toward the center of the picture;
+ * a negative value crops away from the center, adding a space border around the picture
+ * @param left left cropping value (in twips)
+ * @param top top cropping value (in twips)
+ * @param right right cropping value (in twips)
+ * @param bottom bottom cropping value (in twips)
+ */
+ public void setCropping(int left, int top, int right, int bottom) {
+ this.cropValues[0] = left;
+ this.cropValues[1] = top;
+ this.cropValues[2] = right;
+ this.cropValues[3] = bottom;
}
/**
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java
new file mode 100644
index 000000000..b3f11bc0a
--- /dev/null
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.rtf.rtflib.rtfdoc;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+
+/**
+ * Generates the leader in RTF.
+ */
+public class RtfLeader extends RtfContainer {
+
+ /*
+ * Format : \tqr \style \tx## { \pard \format \tab }
+ * ## represents the width \style represents the style (tldot, tlth, ...)
+ * \format represents standard formats (color, fontsize, ...)
+ *
+ *
+ * \pard \zwnj {\fsxx + Besides the important changes listed below, the most important areas with + improvements in this release are: +
++ Please note that with this release, we've dropped support for Java 1.3. + FOP will, from now on, require at least Java 1.4. +
++ There have been a few changes in tables that make FOP both more strict and more + compliant to the Recommendation: +
If an fo:table element contains explicit fo:table-column children, then those + elements set the total number of columns in the table. This means that a + validation error will now occur if a row contains more cells than available + columns. This change allows to improve performance, since the rendering of the + table may start as soon as the table-column elements have been parsed.
+If more flexibility is needed, then the fo:table-column elements may be just + omitted. The final number of columns will then be set by the row that has the + most cells.
++ The image libraries Jimi and JAI are no longer needed (and used) for image loading. + Instead we rely completely on the Image I/O API that has been introduced with + Java 1.4. If you still need support for bitmap image formats that do not work + out-of-the-box, we recommend adding + JAI Image I/O Tools + (an Image I/O compatible image codec package) to the classpath. JAI is still required + for building the FOP distribution but it is optional for normal builds and at run-time. +
+This test checks Bugzilla #44412 where a break-before on the first child of an otherwise - empty block is set. It is expected that the parent block creates two areas, the first with - only border-before on the first page and zero bpd. + empty block is set.
+ This test checks for the correct behaviour of multiple breaks at the same break possibility. +
+Java2DRenderer
class provides the abstract technical
@@ -625,8 +626,8 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
case Constants.EN_RIDGE:
float colFactor = (style == EN_GROOVE ? 0.4f : -0.4f);
if (horz) {
- Color uppercol = lightenColor(col, -colFactor);
- Color lowercol = lightenColor(col, colFactor);
+ Color uppercol = ColorUtil.lightenColor(col, -colFactor);
+ Color lowercol = ColorUtil.lightenColor(col, colFactor);
float h3 = h / 3;
float ym1 = y1 + (h3 / 2);
g2d.setStroke(new BasicStroke(h3));
@@ -637,8 +638,8 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
g2d.setColor(lowercol);
g2d.draw(new Line2D.Float(x1, ym1 + h3 + h3, x2, ym1 + h3 + h3));
} else {
- Color leftcol = lightenColor(col, -colFactor);
- Color rightcol = lightenColor(col, colFactor);
+ Color leftcol = ColorUtil.lightenColor(col, -colFactor);
+ Color rightcol = ColorUtil.lightenColor(col, colFactor);
float w3 = w / 3;
float xm1 = x1 + (w3 / 2);
g2d.setStroke(new BasicStroke(w3));
@@ -654,13 +655,13 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
case Constants.EN_OUTSET:
colFactor = (style == EN_OUTSET ? 0.4f : -0.4f);
if (horz) {
- col = lightenColor(col, (startOrBefore ? 1 : -1) * colFactor);
+ col = ColorUtil.lightenColor(col, (startOrBefore ? 1 : -1) * colFactor);
g2d.setStroke(new BasicStroke(h));
float ym1 = y1 + (h / 2);
g2d.setColor(col);
g2d.draw(new Line2D.Float(x1, ym1, x2, ym1));
} else {
- col = lightenColor(col, (startOrBefore ? 1 : -1) * colFactor);
+ col = ColorUtil.lightenColor(col, (startOrBefore ? 1 : -1) * colFactor);
float xm1 = x1 + (w / 2);
g2d.setStroke(new BasicStroke(w));
g2d.setColor(col);
@@ -830,7 +831,7 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
case EN_RIDGE:
float half = area.getRuleThickness() / 2000f;
- state.updateColor(lightenColor(col, 0.6f));
+ state.updateColor(ColorUtil.lightenColor(col, 0.6f));
moveTo(startx, starty);
lineTo(endx, starty);
lineTo(endx, starty + 2 * half);
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index 27caf86b4..61ed1ff07 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -117,6 +117,7 @@ import org.apache.fop.render.Graphics2DAdapter;
import org.apache.fop.render.RendererContext;
import org.apache.fop.util.CharUtilities;
import org.apache.fop.util.ColorProfileUtil;
+import org.apache.fop.util.ColorUtil;
/**
* Renderer that renders areas to PDF.
@@ -939,8 +940,8 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
float colFactor = (style == EN_GROOVE ? 0.4f : -0.4f);
currentStream.add("[] 0 d ");
if (horz) {
- Color uppercol = lightenColor(col, -colFactor);
- Color lowercol = lightenColor(col, colFactor);
+ Color uppercol = ColorUtil.lightenColor(col, -colFactor);
+ Color lowercol = ColorUtil.lightenColor(col, colFactor);
float h3 = h / 3;
currentStream.add(format(h3) + " w\n");
float ym1 = y1 + (h3 / 2);
@@ -954,8 +955,8 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m "
+ format(x2) + " " + format(ym1 + h3 + h3) + " l S\n");
} else {
- Color leftcol = lightenColor(col, -colFactor);
- Color rightcol = lightenColor(col, colFactor);
+ Color leftcol = ColorUtil.lightenColor(col, -colFactor);
+ Color rightcol = ColorUtil.lightenColor(col, colFactor);
float w3 = w / 3;
currentStream.add(format(w3) + " w\n");
float xm1 = x1 + (w3 / 2);
@@ -978,14 +979,14 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[] 0 d ");
Color c = col;
if (horz) {
- c = lightenColor(c, (startOrBefore ? 1 : -1) * colFactor);
+ c = ColorUtil.lightenColor(c, (startOrBefore ? 1 : -1) * colFactor);
currentStream.add(format(h) + " w\n");
float ym1 = y1 + (h / 2);
setColor(c, false, null);
currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
} else {
- c = lightenColor(c, (startOrBefore ? 1 : -1) * colFactor);
+ c = ColorUtil.lightenColor(c, (startOrBefore ? 1 : -1) * colFactor);
currentStream.add(format(w) + " w\n");
float xm1 = x1 + (w / 2);
setColor(c, false, null);
@@ -1773,7 +1774,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
case EN_RIDGE:
float half = area.getRuleThickness() / 2000f;
- setColor(lightenColor(col, 0.6f), true, null);
+ setColor(ColorUtil.lightenColor(col, 0.6f), true, null);
currentStream.add(format(startx) + " " + format(starty) + " m\n");
currentStream.add(format(endx) + " " + format(starty) + " l\n");
currentStream.add(format(endx) + " " + format(starty + 2 * half) + " l\n");
diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java
index 9f8cdc771..4785ea14f 100644
--- a/src/java/org/apache/fop/render/ps/PSRenderer.java
+++ b/src/java/org/apache/fop/render/ps/PSRenderer.java
@@ -106,6 +106,7 @@ import org.apache.fop.render.ps.extensions.PSExtensionAttachment;
import org.apache.fop.render.ps.extensions.PSSetPageDevice;
import org.apache.fop.render.ps.extensions.PSSetupCode;
import org.apache.fop.util.CharUtilities;
+import org.apache.fop.util.ColorUtil;
/**
* Renderer that renders to PostScript.
@@ -839,8 +840,8 @@ public class PSRenderer extends AbstractPathOrientedRenderer
float colFactor = (style == EN_GROOVE ? 0.4f : -0.4f);
gen.useDash(null);
if (horz) {
- Color uppercol = lightenColor(col, -colFactor);
- Color lowercol = lightenColor(col, colFactor);
+ Color uppercol = ColorUtil.lightenColor(col, -colFactor);
+ Color lowercol = ColorUtil.lightenColor(col, colFactor);
float h3 = h / 3;
gen.useLineWidth(h3);
float ym1 = y1 + (h3 / 2);
@@ -851,8 +852,8 @@ public class PSRenderer extends AbstractPathOrientedRenderer
gen.useColor(lowercol);
drawLine(x1, ym1 + h3 + h3, x2, ym1 + h3 + h3);
} else {
- Color leftcol = lightenColor(col, -colFactor);
- Color rightcol = lightenColor(col, colFactor);
+ Color leftcol = ColorUtil.lightenColor(col, -colFactor);
+ Color rightcol = ColorUtil.lightenColor(col, colFactor);
float w3 = w / 3;
gen.useLineWidth(w3);
float xm1 = x1 + (w3 / 2);
@@ -869,13 +870,13 @@ public class PSRenderer extends AbstractPathOrientedRenderer
colFactor = (style == EN_OUTSET ? 0.4f : -0.4f);
gen.useDash(null);
if (horz) {
- Color c = lightenColor(col, (startOrBefore ? 1 : -1) * colFactor);
+ Color c = ColorUtil.lightenColor(col, (startOrBefore ? 1 : -1) * colFactor);
gen.useLineWidth(h);
float ym1 = y1 + (h / 2);
gen.useColor(c);
drawLine(x1, ym1, x2, ym1);
} else {
- Color c = lightenColor(col, (startOrBefore ? 1 : -1) * colFactor);
+ Color c = ColorUtil.lightenColor(col, (startOrBefore ? 1 : -1) * colFactor);
gen.useLineWidth(w);
float xm1 = x1 + (w / 2);
gen.useColor(c);
@@ -1570,7 +1571,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
case EN_RIDGE:
float half = area.getRuleThickness() / 2000f;
- gen.useColor(lightenColor(col, 0.6f));
+ gen.useColor(ColorUtil.lightenColor(col, 0.6f));
moveTo(startx, starty);
lineTo(endx, starty);
lineTo(endx, starty + 2 * half);
diff --git a/src/java/org/apache/fop/traits/BlockProps.java b/src/java/org/apache/fop/traits/BlockProps.java
deleted file mode 100644
index 370a97982..000000000
--- a/src/java/org/apache/fop/traits/BlockProps.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.traits;
-
-import org.apache.fop.datatypes.Length;
-
-/**
- * Store all block-level layout properties on an FO.
- * Public "structure" allows direct member access.
- */
-public class BlockProps {
-
- public Length firstIndent; // text-indent
- public int lastIndent; // last-line-indent
- public int textAlign;
- public int textAlignLast;
- public int lineStackType; // line-stacking-strategy (enum)
-
-}
diff --git a/src/java/org/apache/fop/traits/BorderProps.java b/src/java/org/apache/fop/traits/BorderProps.java
index 20e362674..338743538 100644
--- a/src/java/org/apache/fop/traits/BorderProps.java
+++ b/src/java/org/apache/fop/traits/BorderProps.java
@@ -21,7 +21,8 @@ package org.apache.fop.traits;
import java.awt.Color;
import java.io.Serializable;
-import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.Constants;
@@ -162,13 +163,19 @@ public class BorderProps implements Serializable {
public static BorderProps valueOf(FOUserAgent foUserAgent, String s) {
if (s.startsWith("(") && s.endsWith(")")) {
s = s.substring(1, s.length() - 1);
- StringTokenizer st = new StringTokenizer(s, ",");
- String style = st.nextToken();
- String color = st.nextToken();
- int width = Integer.parseInt(st.nextToken());
+ Pattern pattern = Pattern.compile("([^,\\(]+(?:\\(.*\\))?)");
+ Matcher m = pattern.matcher(s);
+ boolean found;
+ found = m.find();
+ String style = m.group();
+ found = m.find();
+ String color = m.group();
+ found = m.find();
+ int width = Integer.parseInt(m.group());
int mode = SEPARATE;
- if (st.hasMoreTokens()) {
- String ms = st.nextToken();
+ found = m.find();
+ if (found) {
+ String ms = m.group();
if ("collapse-inner".equalsIgnoreCase(ms)) {
mode = COLLAPSE_INNER;
} else if ("collapse-outer".equalsIgnoreCase(ms)) {
diff --git a/src/java/org/apache/fop/traits/InlineProps.java b/src/java/org/apache/fop/traits/InlineProps.java
deleted file mode 100644
index 06ca2553d..000000000
--- a/src/java/org/apache/fop/traits/InlineProps.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.traits;
-
-/**
- * Store all inline "margin" related properties
- * Public "structure" allows direct member access.
- */
-public class InlineProps {
-
- public int marginTop;
- public int marginBottom;
- public int marginLeft;
- public int marginRight;
- public SpaceVal spaceStart;
- public SpaceVal spaceEnd;
-
-}
diff --git a/src/java/org/apache/fop/traits/LayoutProps.java b/src/java/org/apache/fop/traits/LayoutProps.java
deleted file mode 100644
index eff218b37..000000000
--- a/src/java/org/apache/fop/traits/LayoutProps.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.traits;
-
-import org.apache.fop.datatypes.KeepValue;
-import org.apache.fop.fo.Constants;
-
-/**
- * Store properties affecting layout: break-before, break-after, keeps, span.
- * for a block level FO.
- * Public "structure" allows direct member access.
- */
-public class LayoutProps {
-
- public int breakBefore; // enum constant BreakBefore.xxx
- public int breakAfter; // enum constant BreakAfter.xxx
- public KeepValue keepWithPrevious; /*LF*/
- public KeepValue keepWithNext; /*LF*/
- public KeepValue keepTogether; /*LF*/
- public int orphans; /*LF*/
- public int widows; /*LF*/
- public int blockProgressionUnit; /*LF*/
- public int lineStackingStrategy; /*LF*/
- public boolean bIsSpan;
- public SpaceVal spaceBefore;
- public SpaceVal spaceAfter;
-
- private static final int[] BREAK_PRIORITIES =
- new int[]{ Constants.EN_AUTO, Constants.EN_COLUMN, Constants.EN_PAGE };
-
-
- public LayoutProps() {
- breakBefore = breakAfter = Constants.EN_AUTO;
- bIsSpan = false;
- }
-
- // public static int higherBreak(int brkParent, int brkChild) {
- // if (brkParent == brkChild) return brkChild;
- // for (int i=0; i < s_breakPriorities.length; i++) {
- // int bp = s_breakPriorities[i];
- // if (bp == brkParent) return brkChild;
- // else if (bp == brkChild) return brkParent;
- // }
- // return brkChild;
- // }
-
- public void combineWithParent(LayoutProps parentLP) {
- if (parentLP.breakBefore != breakBefore) {
- for (int i = 0; i < BREAK_PRIORITIES.length; i++) {
- int bp = BREAK_PRIORITIES[i];
- if (bp == breakBefore) {
- breakBefore = parentLP.breakBefore;
- break;
- } else if (bp == parentLP.breakBefore) {
- break;
- }
- }
- }
- // Parent span always overrides child span
- bIsSpan = parentLP.bIsSpan;
- }
-
- public String toString() {
- return "LayoutProps:\n" +
- "breakBefore = " + breakBefore + "; breakAfter = " + breakAfter + "\n" +
- "spaceBefore = " + ((spaceBefore != null) ? spaceBefore.toString() : "null") + "\n" +
- "spaceAfter = " + ((spaceAfter != null) ? spaceAfter.toString() : "null") + "\n" +
- "bIsSpan = " + bIsSpan + "\n";
- }
-}
-
diff --git a/src/java/org/apache/fop/util/ColorUtil.java b/src/java/org/apache/fop/util/ColorUtil.java
index b85b0c017..9534bfba3 100644
--- a/src/java/org/apache/fop/util/ColorUtil.java
+++ b/src/java/org/apache/fop/util/ColorUtil.java
@@ -658,4 +658,27 @@ public final class ColorUtil {
colorMap.put("transparent", new Color(0, 0, 0, 0));
}
+ /**
+ * Lightens up a color for groove, ridge, inset and outset border effects.
+ * @param col the color to lighten up
+ * @param factor factor by which to lighten up (negative values darken the color)
+ * @return the modified color
+ */
+ public static Color lightenColor(Color col, float factor) {
+ // TODO: This function converts the color into the sRGB namespace.
+ // This should be avoided if possible.
+ float[] cols = new float[4];
+ cols = col.getRGBComponents(cols);
+ if (factor > 0) {
+ cols[0] += (1.0 - cols[0]) * factor;
+ cols[1] += (1.0 - cols[1]) * factor;
+ cols[2] += (1.0 - cols[2]) * factor;
+ } else {
+ cols[0] -= cols[0] * -factor;
+ cols[1] -= cols[1] * -factor;
+ cols[2] -= cols[2] * -factor;
+ }
+ return new Color(cols[0], cols[1], cols[2], cols[3]);
+ }
+
}
diff --git a/status.xml b/status.xml
index d5ca1ac9f..c134fadc2 100644
--- a/status.xml
+++ b/status.xml
@@ -53,6 +53,13 @@
+ * Where the presentation parameters conflict with parameters specified in the + * object's environment group (OEG), the parameters in the Include Object + * structured field override. If the referenced object is a page segment, the + * IOB parameters override the corresponding environment group parameters on all + * data objects in the page segment. + *
+ */ +public class IncludeObject extends AbstractNamedAFPObject { + + /** the object referenced is of type page segment */ + public static final byte TYPE_PAGE_SEGMENT = (byte)0x5F; + + /** the object referenced is of type other */ + public static final byte TYPE_OTHER = (byte)0x92; + + /** the object referenced is of type graphic */ + public static final byte TYPE_GRAPHIC = (byte)0xBB; + + /** the object referenced is of type barcode */ + public static final byte TYPE_BARCODE = (byte)0xEB; + + /** the object referenced is of type image */ + public static final byte TYPE_IMAGE = (byte)0xFB; + + + /** the object type referenced (default is other) */ + private byte objectType = TYPE_OTHER; + + /** the X-axis origin of the object area */ + private int xoaOset = 0; + + /** the Y-axis origin of the object area */ + private int yoaOset = 0; + + /** the orientation of the referenced object */ + private int oaOrent = 0; + + /** the X-axis origin defined in the object */ + private int xocaOset = -1; + + /** the Y-axis origin defined in the object */ + private int yocaOset = -1; + + /** + * Constructor for the include object with the specified name, the name must + * be a fixed length of eight characters and is the name of the referenced + * object. + * + * @param name the name of this include object + */ + public IncludeObject(String name) { + super(name); + } + + /** + * Sets the orientation to use for the Include Object. + * + * @param orientation + * The orientation (0,90, 180, 270) + */ + public void setObjectAreaOrientation(int orientation) { + if (orientation == 0 || orientation == 90 || orientation == 180 + || orientation == 270) { + this.oaOrent = orientation; + } else { + throw new IllegalArgumentException( + "The orientation must be one of the values 0, 90, 180, 270"); + } + } + + /** + * Sets the x and y offset to the origin in the object area + * + * @param x the X-axis origin of the object area + * @param y the Y-axis origin of the object area + */ + public void setObjectAreaOffset(int x, int y) { + this.xoaOset = x; + this.yoaOset = y; + } + + /** + * Sets the x and y offset of the content area to the object area + * used in conjunction with the {@link MappingOptionTriplet.POSITION} and + * {@link MappingOptionTriplet.POSITION_AND_TRIM}. + * + * @param x the X-axis origin defined in the object + * @param y the Y-axis origin defined in the object + */ + public void setContentAreaOffset(int x, int y) { + this.xocaOset = x; + this.yocaOset = y; + } + + /** + * Sets the data object type + * + * @param type the data object type + */ + public void setObjectType(byte type) { + this.objectType = type; + } + + /** {@inheritDoc} */ + public void writeToStream(OutputStream os) throws IOException { + byte[] data = new byte[36]; + super.copySF(data, Type.INCLUDE, Category.DATA_RESOURCE); + + // Set the total record length + int tripletDataLength = getTripletDataLength(); + byte[] len = BinaryUtils.convert(35 + tripletDataLength, 2); //Ignore first byte + data[1] = len[0]; + data[2] = len[1]; + + data[17] = 0x00; // reserved + data[18] = objectType; + + //XoaOset (object area) + if (xoaOset > -1) { + byte[] x = BinaryUtils.convert(xoaOset, 3); + data[19] = x[0]; + data[20] = x[1]; + data[21] = x[2]; + } else { + data[19] = (byte)0xFF; + data[20] = (byte)0xFF; + data[21] = (byte)0xFF; + } + + // YoaOset (object area) + if (yoaOset > -1) { + byte[] y = BinaryUtils.convert(yoaOset, 3); + data[22] = y[0]; + data[23] = y[1]; + data[24] = y[2]; + } else { + data[22] = (byte)0xFF; + data[23] = (byte)0xFF; + data[24] = (byte)0xFF; + } + + // XoaOrent/YoaOrent + switch (oaOrent) { + case -1: // use x/y axis orientation defined in object + data[25] = (byte)0xFF; // x axis rotation + data[26] = (byte)0xFF; // + data[27] = (byte)0xFF; // y axis rotation + data[28] = (byte)0xFF; + break; + case 90: + data[25] = 0x2D; + data[26] = 0x00; + data[27] = 0x5A; + data[28] = 0x00; + break; + case 180: + data[25] = 0x5A; + data[25] = 0x00; + data[27] = (byte)0x87; + data[28] = 0x00; + break; + case 270: + data[25] = (byte)0x87; + data[26] = 0x00; + data[27] = 0x00; + data[28] = 0x00; + break; + default: // 0 degrees + data[25] = 0x00; + data[26] = 0x00; + data[27] = 0x2D; + data[28] = 0x00; + break; + } + + // XocaOset (object content) + if (xocaOset > -1) { + byte[] x = BinaryUtils.convert(xocaOset, 3); + data[29] = x[0]; + data[30] = x[1]; + data[31] = x[2]; + } else { + data[29] = (byte)0xFF; + data[30] = (byte)0xFF; + data[31] = (byte)0xFF; + } + + // YocaOset (object content) + if (yocaOset > -1) { + byte[] y = BinaryUtils.convert(yocaOset, 3); + data[32] = y[0]; + data[33] = y[1]; + data[34] = y[2]; + } else { + data[32] = (byte)0xFF; + data[33] = (byte)0xFF; + data[34] = (byte)0xFF; + } + // RefCSys (Reference coordinate system) + data[35] = 0x01; // Page or overlay coordinate system + + // Write structured field data + os.write(data); + + // Write triplet for FQN internal/external object reference + if (tripletData != null) { + os.write(tripletData); + } + } + + private String getObjectTypeName() { + String objectTypeName = null; + if (objectType == TYPE_PAGE_SEGMENT) { + objectTypeName = "page segment"; + } else if (objectType == TYPE_OTHER) { + objectTypeName = "other"; + } else if (objectType == TYPE_GRAPHIC) { + objectTypeName = "graphic"; + } else if (objectType == TYPE_BARCODE) { + objectTypeName = "barcode"; + } else if (objectType == TYPE_IMAGE) { + objectTypeName = "image"; + } + return objectTypeName; + } + + /** {@inheritDoc} */ + public String toString() { + return "IncludeObject{name=" + this.getName() + + ", objectType=" + getObjectTypeName() + + ", xoaOset=" + xoaOset + + ", yoaOset=" + yoaOset + + ", oaOrent" + oaOrent + + ", xocaOset=" + xocaOset + + ", yocaOset=" + yocaOset + + "}"; + } + + /** + * Sets the mapping option + * + * @param optionValue the mapping option value + */ + public void setMappingOption(byte optionValue) { + addTriplet(new MappingOptionTriplet(optionValue)); + } + + /** + * Sets the extent of an object area in the X and Y directions + * + * @param x the x direction extent + * @param y the y direction extent + */ + public void setObjectAreaSize(int x, int y) { + addTriplet(new ObjectAreaSizeTriplet(x, y)); + } + + /** + * Sets the measurement units used to specify the units of measure + * + * @param xRes units per base on the x-axis + * @param yRes units per base on the y-axis + */ + public void setMeasurementUnits(int xRes, int yRes) { + addTriplet(new MeasurementUnitsTriplet(xRes, xRes)); + } + +} \ No newline at end of file diff --git a/src/java/org/apache/fop/afp/modca/IncludePageOverlay.java b/src/java/org/apache/fop/afp/modca/IncludePageOverlay.java new file mode 100644 index 000000000..44f0edc5b --- /dev/null +++ b/src/java/org/apache/fop/afp/modca/IncludePageOverlay.java @@ -0,0 +1,129 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.afp.modca; + +import java.io.IOException; +import java.io.OutputStream; + +import org.apache.fop.afp.util.BinaryUtils; + +/** + * + * The Include Page Overlay structured field references an overlay resource + * definition that is to be positioned on the page. A page overlay can be + * referenced at any time during the page state, but not during an object state. + * The overlay contains its own active environment group definition. + * + * Note: There is no need for the triplets, so I have ignored them. + * + * A real example of where this will be used is for static overlays, such as an + * address on the page. + * + */ +public class IncludePageOverlay extends AbstractNamedAFPObject { + + /** + * The x coordinate + */ + private int x = 0; + + /** + * The y coordinate + */ + private int y = 0; + + /** + * The orientation + */ + private int orientation = 0; + + /** + * Constructor for the Include Page Overlay + * + * @param overlayName Name of the page segment + * @param x The x position + * @param y The y position + * @param orientation The orientation + */ + public IncludePageOverlay(String overlayName, int x, int y, int orientation) { + super(overlayName); + + this.x = x; + this.y = y; + setOrientation(orientation); + } + + /** + * Sets the orientation to use for the overlay. + * + * @param orientation + * The orientation (0,90, 180, 270) + */ + public void setOrientation(int orientation) { + if (orientation == 0 || orientation == 90 || orientation == 180 + || orientation == 270) { + this.orientation = orientation; + } else { + throw new IllegalArgumentException( + "The orientation must be one of the values 0, 90, 180, 270"); + } + } + + /** {@inheritDoc} */ + public void writeToStream(OutputStream os) throws IOException { + byte[] data = new byte[25]; //(9 +16) + copySF(data, Type.INCLUDE, Category.PAGE_OVERLAY); + + // Set the total record length + byte[] len = BinaryUtils.convert(24, 2); //Ignore first byte + data[1] = len[0]; + data[2] = len[1]; + + byte[] xPos = BinaryUtils.convert(x, 3); + data[17] = xPos[0]; // x coordinate + data[18] = xPos[1]; + data[19] = xPos[2]; + + byte[] yPos = BinaryUtils.convert(y, 3); + data[20] = yPos[0]; // y coordinate + data[21] = yPos[1]; + data[22] = yPos[2]; + + switch (orientation) { + case 90: + data[23] = 0x2D; + data[24] = 0x00; + break; + case 180: + data[23] = 0x5A; + data[24] = 0x00; + break; + case 270: + data[23] = (byte) 0x87; + data[24] = 0x00; + break; + default: + data[23] = 0x00; + data[24] = 0x00; + break; + } + os.write(data); + } +} \ No newline at end of file diff --git a/src/java/org/apache/fop/afp/modca/IncludePageSegment.java b/src/java/org/apache/fop/afp/modca/IncludePageSegment.java new file mode 100644 index 000000000..7355e3b1a --- /dev/null +++ b/src/java/org/apache/fop/afp/modca/IncludePageSegment.java @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.afp.modca; + +import java.io.IOException; +import java.io.OutputStream; + +import org.apache.fop.afp.util.BinaryUtils; + +/** + * The Include Page Segment structured field references a page segment resource + * object that is to be presented on the page or overlay presentation space. The IPS + * specifies a reference point on the including page or overlay coordinate system that + * may be used to position objects contained in the page segment. A page segment + * can be referenced at any time during page or overlay state, but not during an + * object state. The page segment inherits the active environment group definition of + * the including page or overlay. + * + * Note : No use for Triplets. + * + * A 'real' example for where this will be used is for + * the dynamic placing of overlay objects, such as signatures + * that may have to be placed at different positions on a document. + * + */ +public class IncludePageSegment extends AbstractNamedAFPObject { + + /** + * The x position where we need to put this object on the page + */ + private int x; + + /** + * The y position where we need to put this object on the page + */ + private int y; + + /** + * Constructor for the Include Page Segment + * + * @param name Name of the page segment + * @param x The x position + * @param y The y position + */ + public IncludePageSegment(String name, int x, int y) { + super(name); + + this.x = x; + this.y = y; + } + + /** {@inheritDoc} */ + public void writeToStream(OutputStream os) throws IOException { + byte[] data = new byte[23]; //(9 +14) + copySF(data, Type.INCLUDE, Category.PAGE_SEGMENT); + + // Set the total record length + byte[] len = BinaryUtils.convert(22, 2); //Ignore first byte + data[1] = len[0]; + data[2] = len[1]; + + byte[] xPos = BinaryUtils.convert(x, 3); + data[17] = xPos[0]; // x coordinate + data[18] = xPos[1]; + data[19] = xPos[2]; + + byte[] yPos = BinaryUtils.convert(y, 3); + data[20] = yPos[0]; // y coordinate + data[21] = yPos[1]; + data[22] = yPos[2]; + + os.write(data); + } +} diff --git a/src/java/org/apache/fop/afp/modca/InterchangeSet.java b/src/java/org/apache/fop/afp/modca/InterchangeSet.java new file mode 100644 index 000000000..28a4da42b --- /dev/null +++ b/src/java/org/apache/fop/afp/modca/InterchangeSet.java @@ -0,0 +1,115 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id: $ */ + +package org.apache.fop.afp.modca; + +/** + * MO:DCA Interchange Set + */ +public class InterchangeSet { + /** interchange set 1 string value */ + public static final String MODCA_PRESENTATION_INTERCHANGE_SET_1 = "MO:DCA-P IS/1"; + + /** interchange set 2 string value */ + public static final String MODCA_PRESENTATION_INTERCHANGE_SET_2 = "MO:DCA-P IS/2"; + + /** resource interchange set string value */ + public static final String MODCA_RESOURCE_INTERCHANGE_SET = "MO:DCA-L"; + + private static final String[] NAMES = { + MODCA_PRESENTATION_INTERCHANGE_SET_1, + MODCA_PRESENTATION_INTERCHANGE_SET_2, + MODCA_RESOURCE_INTERCHANGE_SET + }; + + private static final int SET_1 = 0; + private static final int SET_2 = 1; + private static final int RESOURCE_SET = 2; + + /** the actual interchange set in use */ + private int value; + + /** + * Returns the interchange set value of a given string + * + * @param str an interchange set value + * @return an interchange set + */ + public static InterchangeSet valueOf(String str) { + if (MODCA_PRESENTATION_INTERCHANGE_SET_1.equals(str)) { + return new InterchangeSet(SET_1); + } else if (MODCA_PRESENTATION_INTERCHANGE_SET_2.equals(str)) { + return new InterchangeSet(SET_2); + } else if (MODCA_RESOURCE_INTERCHANGE_SET.equals(str)) { + return new InterchangeSet(RESOURCE_SET); + } else { + throw new IllegalArgumentException("Invalid MO:DCA interchange set :" + str); + } + } + + /** + * Main constructor + * + * @param value the interchange set value + */ + public InterchangeSet(int value) { + this.value = value; + } + + /** + * Returns true if complies with MOD:CA interchange set 1 + * + * @return true if complies with MOD:CA interchange set 1 + */ + protected boolean is1() { + return value == SET_1; + } + + /** + * Returns true if complies with MOD:CA interchange set 2 + * + * @return true if complies with MOD:CA interchange set 2 + */ + public boolean is2() { + return value == SET_2; + } + + /** + * Returns true if complies with MOD:CA resource set + * + * @return true if complies with MOD:CA resource set + */ + public boolean isResource() { + return value == RESOURCE_SET; + } + + /** {@inheritDoc} */ + public String toString() { + return NAMES[value]; + } + + /** + * Returns true if MOD:CA interchange set 2 (resource groups) is supported + * + * @return true if MOD:CA interchange set 2 (resource groups) is supported + */ + public boolean supportsLevel2() { + return is2() || isResource(); + } +} diff --git a/src/java/org/apache/fop/afp/modca/InvokeMediumMap.java b/src/java/org/apache/fop/afp/modca/InvokeMediumMap.java new file mode 100644 index 000000000..f910a0b9c --- /dev/null +++ b/src/java/org/apache/fop/afp/modca/InvokeMediumMap.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.afp.modca; + +import java.io.IOException; +import java.io.OutputStream; + +import org.apache.fop.afp.util.BinaryUtils; + +/** + * The Invoke Medium Map structured field identifies the Medium Map that is to + * become active for the document. An Invoke Medium Map structured field affects + * the document's current environment. The Medium Map's effect on current environment + * parameter values lasts until a new Medium Map is invoked. + */ +public class InvokeMediumMap extends AbstractNamedAFPObject { + + /** + * Constructor for the Invoke Medium Map + * + * @param name the name of the medium map + */ + public InvokeMediumMap(String name) { + super(name); + } + + /** {@inheritDoc} */ + public void writeToStream(OutputStream os) throws IOException { + + byte[] data = new byte[17]; + copySF(data, Type.MAP, Category.MEDIUM_MAP); + + // Set the total record length + byte[] len = BinaryUtils.convert(16, 2); //Ignore first byte + data[1] = len[0]; + data[2] = len[1]; + + os.write(data); + } +} \ No newline at end of file diff --git a/src/java/org/apache/fop/afp/modca/MapCodedFont.java b/src/java/org/apache/fop/afp/modca/MapCodedFont.java new file mode 100644 index 000000000..fb9637678 --- /dev/null +++ b/src/java/org/apache/fop/afp/modca/MapCodedFont.java @@ -0,0 +1,273 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.afp.modca; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.util.Iterator; +import java.util.List; + +import org.apache.fop.afp.AFPConstants; +import org.apache.fop.afp.fonts.AFPFont; +import org.apache.fop.afp.fonts.CharacterSet; +import org.apache.fop.afp.fonts.FontRuntimeException; +import org.apache.fop.afp.fonts.OutlineFont; +import org.apache.fop.afp.fonts.RasterFont; +import org.apache.fop.afp.util.BinaryUtils; + +/** + * The Map Coded Font structured field maps a unique coded font resource local + * ID, which may be embedded one or more times within an object's data and + * descriptor, to the identifier of a coded font resource object. Additionally, + * the Map Coded Font structured field specifies a set of resource attributes + * for the coded font. + */ +public class MapCodedFont extends AbstractStructuredAFPObject { + + /** + * The collection of map coded fonts (maximum of 254) + */ + private final List/*+ * The entity resolver only handles queries for the DTD. It will find any URI + * with a recognised public id and return an {@link org.xml.sax.InputSource}. + *
+ * @author Joe Schmetzer + */ +public class DTDEntityResolver implements EntityResolver { + + /** Public ID for the AFP fonts 1.0 DTD. */ + public static final String AFP_DTD_1_0_ID + = "-//APACHE/DTD AFP Installed Font Definition DTD 1.0//EN"; + + /** Resource location for the AFP fonts 1.0 DTD. */ + public static final String AFP_DTD_1_0_RESOURCE + = "afp-fonts-1.0.dtd"; + + /** Public ID for the AFP fonts 1.1 DTD. */ + public static final String AFP_DTD_1_1_ID + = "-//APACHE/DTD AFP Installed Font Definition DTD 1.1//EN"; + + /** Resource location for the AFP fonts 1.1 DTD. */ + public static final String AFP_DTD_1_1_RESOURCE + = "afp-fonts-1.1.dtd"; + + /** Public ID for the AFP fonts 1.2 DTD. */ + public static final String AFP_DTD_1_2_ID + = "-//APACHE/DTD AFP Installed Font Definition DTD 1.2//EN"; + + /** Resource location for the AFP fonts 1.2 DTD. */ + public static final String AFP_DTD_1_2_RESOURCE + = "afp-fonts-1.2.dtd"; + + /** + * Resolve the combination of system and public identifiers. + * If this resolver recognises the publicId, it will handle the resolution + * from the classpath, otherwise it will return null and allow the default + * resolution to occur. + * + * @param publicId the public identifier to use + * @param systemId the system identifier to resolve + * @return An input source to the entity or null if not handled + * @throws IOException an error reading the stream + */ + public InputSource resolveEntity(String publicId, String systemId) + throws IOException { + + URL resource = null; + if ( AFP_DTD_1_2_ID.equals(publicId) ) { + resource = getResource( AFP_DTD_1_2_RESOURCE ); + } else if ( AFP_DTD_1_1_ID.equals(publicId) ) { + resource = getResource( AFP_DTD_1_1_RESOURCE ); + } else if ( AFP_DTD_1_0_ID.equals(publicId) ) { + throw new FontRuntimeException( + "The AFP Installed Font Definition 1.0 DTD is not longer supported" ); + } else if (systemId != null && systemId.indexOf("afp-fonts.dtd") >= 0 ) { + throw new FontRuntimeException( + "The AFP Installed Font Definition DTD must be specified using the public id" ); + } else { + return null; + } + + InputSource inputSource = new InputSource( resource.openStream() ); + inputSource.setPublicId( publicId ); + inputSource.setSystemId( systemId ); + + return inputSource; + } + + /** + * Returns the URL of a resource on the classpath + * @param resourceName the path to the resource relative to the root of the + * classpath. + * @return the URL of the required resource + * @throws FontRuntimeException if the resource could not be found. + */ + private URL getResource(String resourcePath) { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + if (cl == null) { + cl = ClassLoader.getSystemClassLoader(); + } + + URL resource = cl.getResource( resourcePath ); + if (resource == null) { + throw new FontRuntimeException( "Resource " + resourcePath + + "could not be found on the classpath" ); + } + + return resource; + } +} diff --git a/src/java/org/apache/fop/afp/util/StringUtils.java b/src/java/org/apache/fop/afp/util/StringUtils.java new file mode 100644 index 000000000..ce68d27be --- /dev/null +++ b/src/java/org/apache/fop/afp/util/StringUtils.java @@ -0,0 +1,81 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.afp.util; + +/** + * Library of utility methods useful in dealing with strings. + * + */ +public class StringUtils { + + /** + * Padds the string to the left with the given character for + * the specified length. + * @param input The input string. + * @param padding The char used for padding. + * @param length The length of the new string. + * @return The padded string. + */ + public static String lpad(String input, char padding, int length) { + + if (input == null) { + input = new String(); + } + + if (input.length() >= length) { + return input; + } else { + StringBuffer result = new StringBuffer(); + int numChars = length - input.length(); + for (int i = 0; i < numChars; i++) { + result.append(padding); + } + result.append(input); + return result.toString(); + } + } + + /** + * Padds the string to the right with the given character for + * the specified length. + * @param input The input string. + * @param padding The char used for padding. + * @param length The length of the new string. + * @return The padded string. + */ + public static String rpad(String input, char padding, int length) { + + if (input == null) { + input = new String(); + } + + if (input.length() >= length) { + return input; + } else { + StringBuffer result = new StringBuffer(input); + int numChars = length - input.length(); + for (int i = 0; i < numChars; i++) { + result.append(padding); + } + return result.toString(); + } + } + +} \ No newline at end of file diff --git a/src/java/org/apache/fop/afp/util/StructuredFieldReader.java b/src/java/org/apache/fop/afp/util/StructuredFieldReader.java new file mode 100644 index 000000000..34add3bbe --- /dev/null +++ b/src/java/org/apache/fop/afp/util/StructuredFieldReader.java @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.afp.util; + +import java.io.IOException; +import java.io.InputStream; + +/** + * A helper class to read structured fields from a MO:DCA document. Each + * component of a mixed object document is explicitly defined and delimited + * in the data. This is accomplished through the use of MO:DCA data structures, + * called structured fields. Structured fields are used to envelop document + * components and to provide commands and information to applications using + * the data. Structured fields may contain one or more parameters. Each + * parameter provides one value from a set of values defined by the architecture. + *
+ * MO:DCA structured fields consist of two parts: an introducer that identifies + * the length and type of the structured field, and data that provides the + * structured field's effect. The data is contained in a set of parameters, + * which can consist of other data structures and data elements. The maximum + * length of a structured field is 32767 bytes. + * + */ +public class StructuredFieldReader { + + /** + * The input stream to read + */ + private InputStream inputStream = null; + + /** + * The constructor for the StructuredFieldReader + * @param inputStream the input stream to process + */ + public StructuredFieldReader(InputStream inputStream) { + this.inputStream = inputStream; + } + + /** + * Get the next structured field as identified by the identifer + * parameter (this must be a valid MO:DCA structured field. + * @param identifier the three byte identifier + * @throws IOException if an I/O exception occurred + * @return the next structured field or null when there are no more + */ + public byte[] getNext(byte[] identifier) throws IOException { + + int bufferPointer = 0; + byte[] bufferData = new byte[identifier.length + 2]; + for (int x = 0; x < identifier.length; x++) { + bufferData[x] = 0x00; + } + + int c; + while ((c = inputStream.read()) > -1) { + + bufferData[bufferPointer] = (byte) c; + + // Check the last characters in the buffer + int index = 0; + boolean found = true; + + for (int i = identifier.length - 1; i > -1; i--) { + + int p = bufferPointer - index; + if (p < 0) { + p = bufferData.length + p; + } + + index++; + + if (identifier[i] != bufferData[p]) { + found = false; + break; + } + + } + + if (found) { + + byte[] length = new byte[2]; + + int a = bufferPointer - identifier.length; + if (a < 0) { + a = bufferData.length + a; + } + + int b = bufferPointer - identifier.length - 1; + if (b < 0) { + b = bufferData.length + b; + } + + length[0] = bufferData[b]; + length[1] = bufferData[a]; + + int reclength = ((length[0] & 0xFF) << 8) + + (length[1] & 0xFF) - identifier.length - 2; + + byte[] retval = new byte[reclength]; + + inputStream.read(retval, 0, reclength); + + return retval; + + } + + bufferPointer++; + if (bufferPointer >= bufferData.length) { + bufferPointer = 0; + } + + } + + return null; + } +} diff --git a/src/java/org/apache/fop/fonts/Base14Font.java b/src/java/org/apache/fop/fonts/Base14Font.java index 04349a148..9b2e95bc7 100644 --- a/src/java/org/apache/fop/fonts/Base14Font.java +++ b/src/java/org/apache/fop/fonts/Base14Font.java @@ -19,6 +19,7 @@ package org.apache.fop.fonts; + /** * Base class for all Base 14 fonts. */ diff --git a/src/java/org/apache/fop/fonts/CustomFont.java b/src/java/org/apache/fop/fonts/CustomFont.java index 0b40dfecc..4cf24ae16 100644 --- a/src/java/org/apache/fop/fonts/CustomFont.java +++ b/src/java/org/apache/fop/fonts/CustomFont.java @@ -26,6 +26,7 @@ import java.util.Set; import javax.xml.transform.Source; + /** * Abstract base class for custom fonts loaded from files, for example. */ diff --git a/src/java/org/apache/fop/fonts/Font.java b/src/java/org/apache/fop/fonts/Font.java index ebd45457d..e9740c00c 100644 --- a/src/java/org/apache/fop/fonts/Font.java +++ b/src/java/org/apache/fop/fonts/Font.java @@ -23,6 +23,7 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.fop.fonts.CodePointMapping; /** * This class holds font state information and provides access to the font diff --git a/src/java/org/apache/fop/fonts/FontCollection.java b/src/java/org/apache/fop/fonts/FontCollection.java index 3c9bba7f4..d481ae2f9 100644 --- a/src/java/org/apache/fop/fonts/FontCollection.java +++ b/src/java/org/apache/fop/fonts/FontCollection.java @@ -24,6 +24,7 @@ package org.apache.fop.fonts; * Sets up a set of fonts */ public interface FontCollection { + /** * Sets up fonts in a font info object. * diff --git a/src/java/org/apache/fop/fonts/FontDescriptor.java b/src/java/org/apache/fop/fonts/FontDescriptor.java index fadc73834..e7c81c9f3 100644 --- a/src/java/org/apache/fop/fonts/FontDescriptor.java +++ b/src/java/org/apache/fop/fonts/FontDescriptor.java @@ -19,6 +19,7 @@ package org.apache.fop.fonts; + /** * This interface enhances the font metrics interface with access methods to * value needed to register fonts in various target formats like PDF or diff --git a/src/java/org/apache/fop/fonts/FontEventListener.java b/src/java/org/apache/fop/fonts/FontEventListener.java index b508d7053..740a05fdc 100644 --- a/src/java/org/apache/fop/fonts/FontEventListener.java +++ b/src/java/org/apache/fop/fonts/FontEventListener.java @@ -19,7 +19,6 @@ package org.apache.fop.fonts; - /** * Event listener interface for font-related events. */ diff --git a/src/java/org/apache/fop/fonts/FontMetrics.java b/src/java/org/apache/fop/fonts/FontMetrics.java index 7d5588690..29ade1ef3 100644 --- a/src/java/org/apache/fop/fonts/FontMetrics.java +++ b/src/java/org/apache/fop/fonts/FontMetrics.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.Set; + /** * Main interface for access to font metrics. */ diff --git a/src/java/org/apache/fop/fonts/FontTriplet.java b/src/java/org/apache/fop/fonts/FontTriplet.java index 8e0acd8f2..f5cfe442a 100644 --- a/src/java/org/apache/fop/fonts/FontTriplet.java +++ b/src/java/org/apache/fop/fonts/FontTriplet.java @@ -21,6 +21,7 @@ package org.apache.fop.fonts; import java.io.Serializable; + /** * FontTriplet contains information on name, style and weight of one font */ diff --git a/src/java/org/apache/fop/fonts/FontType.java b/src/java/org/apache/fop/fonts/FontType.java index 0abe06a10..95b594ca4 100644 --- a/src/java/org/apache/fop/fonts/FontType.java +++ b/src/java/org/apache/fop/fonts/FontType.java @@ -19,12 +19,10 @@ package org.apache.fop.fonts; -import org.apache.avalon.framework.ValuedEnum; - /** * This class enumerates all supported font types. */ -public class FontType extends ValuedEnum { +public class FontType { /** * Collective identifier for "other" font types @@ -51,12 +49,16 @@ public class FontType extends ValuedEnum { */ public static final FontType TRUETYPE = new FontType("TrueType", 5); + private final String name; + private final int value; + /** * @see org.apache.avalon.framework.Enum#Enum(String) */ protected FontType(String name, int value) { - super(name, value); + this.name = name; + this.value = value; } @@ -107,4 +109,22 @@ public class FontType extends ValuedEnum { } } + /** + * Returns the name + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Returns the value + * + * @return the value + */ + public int getValue() { + return value; + } + } diff --git a/src/java/org/apache/fop/fonts/FontUtil.java b/src/java/org/apache/fop/fonts/FontUtil.java index 6ec89631f..49f23c12f 100644 --- a/src/java/org/apache/fop/fonts/FontUtil.java +++ b/src/java/org/apache/fop/fonts/FontUtil.java @@ -19,6 +19,7 @@ package org.apache.fop.fonts; + /** * Font utilities. */ diff --git a/src/java/org/apache/fop/fonts/MultiByteFont.java b/src/java/org/apache/fop/fonts/MultiByteFont.java index f25ca4e7e..b22b92e2f 100644 --- a/src/java/org/apache/fop/fonts/MultiByteFont.java +++ b/src/java/org/apache/fop/fonts/MultiByteFont.java @@ -23,6 +23,7 @@ package org.apache.fop.fonts; import java.text.DecimalFormat; import java.util.Map; + /** * Generic MultiByte (CID) font */ diff --git a/src/java/org/apache/fop/fonts/MutableFont.java b/src/java/org/apache/fop/fonts/MutableFont.java index 5939bfed4..a5acf51b3 100644 --- a/src/java/org/apache/fop/fonts/MutableFont.java +++ b/src/java/org/apache/fop/fonts/MutableFont.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.Set; + /** * This interface is used to set the values of a font during configuration time. */ diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java index 6b0e88cbb..dc8a020ae 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java @@ -20,12 +20,12 @@ package org.apache.fop.layoutmgr.inline; import org.apache.fop.fo.flow.PageNumber; -import org.apache.fop.area.inline.InlineArea; -import org.apache.fop.area.inline.TextArea; -import org.apache.fop.area.Trait; import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontInfo; import org.apache.fop.fonts.FontTriplet; +import org.apache.fop.area.inline.InlineArea; +import org.apache.fop.area.inline.TextArea; +import org.apache.fop.area.Trait; import org.apache.fop.layoutmgr.LayoutContext; import org.apache.fop.layoutmgr.TraitSetter; import org.apache.fop.traits.MinOptMax; diff --git a/src/java/org/apache/fop/pdf/PDFState.java b/src/java/org/apache/fop/pdf/PDFState.java index 0f3e06070..138458552 100644 --- a/src/java/org/apache/fop/pdf/PDFState.java +++ b/src/java/org/apache/fop/pdf/PDFState.java @@ -25,7 +25,7 @@ import java.awt.Shape; import java.awt.geom.Area; import java.awt.geom.GeneralPath; -import org.apache.fop.render.AbstractState; +import org.apache.fop.AbstractState; /** * This keeps information about the current state when writing to pdf. @@ -44,7 +44,7 @@ import org.apache.fop.render.AbstractState; * It is impossible to optimise the result without analysing the all * the possible combinations after completing. */ -public class PDFState extends org.apache.fop.render.AbstractState { +public class PDFState extends org.apache.fop.AbstractState { private static final long serialVersionUID = 5384726143906371279L; @@ -165,7 +165,7 @@ public class PDFState extends org.apache.fop.render.AbstractState { return new PDFState(); } - private class PDFData extends org.apache.fop.render.AbstractState.AbstractData { + private class PDFData extends org.apache.fop.AbstractState.AbstractData { private static final long serialVersionUID = 3527950647293177764L; diff --git a/src/java/org/apache/fop/render/AbstractState.java b/src/java/org/apache/fop/render/AbstractState.java deleted file mode 100644 index 04409390f..000000000 --- a/src/java/org/apache/fop/render/AbstractState.java +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render; - -import java.awt.Color; -import java.awt.geom.AffineTransform; -import java.io.Serializable; -import java.util.Arrays; -import java.util.Iterator; -import java.util.Stack; - -/** - * A base class which holds information about the current rendering state. - */ -public abstract class AbstractState implements Cloneable, Serializable { - - /** current state data */ - private AbstractData currentData = null; - - /** the state stack */ - private StateStack stateStack = null; - - /** - * Instantiates a new state data object - * - * @return a new state data object - */ - protected abstract AbstractData instantiateData(); - - /** - * Instantiates a new state object - * - * @return a new state object - */ - protected abstract AbstractState instantiateState(); - - /** - * Returns the currently valid state - * - * @return the currently valid state - */ - public AbstractData getData() { - if (currentData == null) { - currentData = instantiateData(); - } - return currentData; - } - - /** - * Set the current color. - * Check if the new color is a change and then set the current color. - * - * @param col the color to set - * @return true if the color has changed - */ - public boolean setColor(Color col) { - if (!col.equals(getData().color)) { - getData().color = col; - return true; - } - return false; - } - - /** - * Get the color. - * - * @return the color - */ - public Color getColor() { - if (getData().color == null) { - getData().color = Color.black; - } - return getData().color; - } - - /** - * Get the background color. - * - * @return the background color - */ - public Color getBackColor() { - if (getData().backColor == null) { - getData().backColor = Color.white; - } - return getData().backColor; - } - - /** - * Set the current background color. - * Check if the new background color is a change and then set the current background color. - * - * @param col the background color to set - * @return true if the color has changed - */ - public boolean setBackColor(Color col) { - if (!col.equals(getData().backColor)) { - getData().backColor = col; - return true; - } - return false; - } - - /** - * Set the current font name - * - * @param internalFontName the internal font name - * @return true if the font name has changed - */ - public boolean setFontName(String internalFontName) { - if (!internalFontName.equals(getData().fontName)) { - getData().fontName = internalFontName; - return true; - } - return false; - } - - /** - * Gets the current font name - * - * @return the current font name - */ - public String getFontName() { - return getData().fontName; - } - - /** - * Gets the current font size - * - * @return the current font size - */ - public int getFontSize() { - return getData().fontSize; - } - - /** - * Set the current font size. - * Check if the font size is a change and then set the current font size. - * - * @param size the font size to set - * @return true if the font size has changed - */ - public boolean setFontSize(int size) { - if (size != getData().fontSize) { - getData().fontSize = size; - return true; - } - return false; - } - - /** - * Set the current line width. - * - * @param width the line width in points - * @return true if the line width has changed - */ - public boolean setLineWidth(float width) { - if (getData().lineWidth != width) { - getData().lineWidth = width; - return true; - } - return false; - } - - /** - * Returns the current line width - * - * @return the current line width - */ - public float getLineWidth() { - return getData().lineWidth; - } - - /** - * Sets the dash array (line type) for the current basic stroke - * - * @param dash the line dash array - * @return true if the dash array has changed - */ - public boolean setDashArray(float[] dash) { - if (!Arrays.equals(dash, getData().dashArray)) { - getData().dashArray = dash; - return true; - } - return false; - } - - /** - * Get the current transform. - * This gets the combination of all transforms in the - * current state. - * - * @return the calculate combined transform for the current state - */ - public AffineTransform getTransform() { - AffineTransform at = new AffineTransform(); - for (Iterator iter = getStateStack().iterator(); iter.hasNext();) { - AbstractData data = (AbstractData)iter.next(); - AffineTransform stackTrans = data.getTransform(); - at.concatenate(stackTrans); - } - AffineTransform currentTrans = getData().getTransform(); - at.concatenate(currentTrans); - return at; - } - - /** - * Check the current transform. - * The transform for the current state is the combination of all - * transforms in the current state. The parameter is compared - * against this current transform. - * - * @param tf the transform the check against - * @return true if the new transform is different then the current transform - */ - public boolean checkTransform(AffineTransform tf) { - return !tf.equals(getData().getTransform()); - } - - /** - * Get a copy of the base transform for the page. Used to translate - * IPP/BPP values into X,Y positions when positioning is "fixed". - * - * @return the base transform, or null if the state stack is empty - */ - public AffineTransform getBaseTransform() { - if (getStateStack().isEmpty()) { - return null; - } else { - AbstractData baseData = (AbstractData)getStateStack().get(0); - return (AffineTransform) baseData.getTransform().clone(); - } - } - - /** - * Concatenates the given AffineTransform to the current one. - * - * @param at the transform to concatenate to the current level transform - */ - public void concatenate(AffineTransform at) { - getData().concatenate(at); - } - - /** - * Resets the current AffineTransform. - */ - public void resetTransform() { - getData().resetTransform(); - } - - /** - * Push the current state onto the stack. - * This call should be used when the Q operator is used - * so that the state is known when popped. - */ - public void push() { - AbstractData copy = (AbstractData)getData().clone(); - getStateStack().push(copy); - } - - /** - * Pop the state from the stack and set current values to popped state. - * This should be called when a Q operator is used so - * the state is restored to the correct values. - * - * @return the restored state, null if the stack is empty - */ - public AbstractData pop() { - if (!getStateStack().isEmpty()) { - this.currentData = (AbstractData)getStateStack().pop(); - return this.currentData; - } else { - return null; - } - } - - /** - * Clears the state stack - */ - public void clear() { - getStateStack().clear(); - currentData = null; - } - - /** - * Return the state stack - * - * @return the state stack - */ - protected Stack/*- * Where the presentation parameters conflict with parameters specified in the - * object's environment group (OEG), the parameters in the Include Object - * structured field override. If the referenced object is a page segment, the - * IOB parameters override the corresponding environment group parameters on all - * data objects in the page segment. - *
- */ -public class IncludeObject extends AbstractNamedAFPObject { - - /** the object referenced is of type page segment */ - public static final byte TYPE_PAGE_SEGMENT = (byte)0x5F; - - /** the object referenced is of type other */ - public static final byte TYPE_OTHER = (byte)0x92; - - /** the object referenced is of type graphic */ - public static final byte TYPE_GRAPHIC = (byte)0xBB; - - /** the object referenced is of type barcode */ - public static final byte TYPE_BARCODE = (byte)0xEB; - - /** the object referenced is of type image */ - public static final byte TYPE_IMAGE = (byte)0xFB; - - - /** the object type referenced (default is other) */ - private byte objectType = TYPE_OTHER; - - /** the X-axis origin of the object area */ - private int xoaOset = 0; - - /** the Y-axis origin of the object area */ - private int yoaOset = 0; - - /** the orientation of the referenced object */ - private int oaOrent = 0; - - /** the X-axis origin defined in the object */ - private int xocaOset = -1; - - /** the Y-axis origin defined in the object */ - private int yocaOset = -1; - - /** - * Constructor for the include object with the specified name, the name must - * be a fixed length of eight characters and is the name of the referenced - * object. - * - * @param name the name of this include object - */ - public IncludeObject(String name) { - super(name); - } - - /** - * Sets the orientation to use for the Include Object. - * - * @param orientation - * The orientation (0,90, 180, 270) - */ - public void setObjectAreaOrientation(int orientation) { - if (orientation == 0 || orientation == 90 || orientation == 180 - || orientation == 270) { - this.oaOrent = orientation; - } else { - throw new IllegalArgumentException( - "The orientation must be one of the values 0, 90, 180, 270"); - } - } - - /** - * Sets the x and y offset to the origin in the object area - * - * @param x the X-axis origin of the object area - * @param y the Y-axis origin of the object area - */ - public void setObjectAreaOffset(int x, int y) { - this.xoaOset = x; - this.yoaOset = y; - } - - /** - * Sets the x and y offset of the content area to the object area - * used in conjunction with the {@link MappingOptionTriplet.POSITION} and - * {@link MappingOptionTriplet.POSITION_AND_TRIM}. - * - * @param x the X-axis origin defined in the object - * @param y the Y-axis origin defined in the object - */ - public void setContentAreaOffset(int x, int y) { - this.xocaOset = x; - this.yocaOset = y; - } - - /** - * Sets the data object type - * - * @param type the data object type - */ - public void setObjectType(byte type) { - this.objectType = type; - } - - /** {@inheritDoc} */ - public void writeToStream(OutputStream os) throws IOException { - byte[] data = new byte[36]; - super.copySF(data, Type.INCLUDE, Category.DATA_RESOURCE); - - // Set the total record length - int tripletDataLength = getTripletDataLength(); - byte[] len = BinaryUtils.convert(35 + tripletDataLength, 2); //Ignore first byte - data[1] = len[0]; - data[2] = len[1]; - - data[17] = 0x00; // reserved - data[18] = objectType; - - //XoaOset (object area) - if (xoaOset > -1) { - byte[] x = BinaryUtils.convert(xoaOset, 3); - data[19] = x[0]; - data[20] = x[1]; - data[21] = x[2]; - } else { - data[19] = (byte)0xFF; - data[20] = (byte)0xFF; - data[21] = (byte)0xFF; - } - - // YoaOset (object area) - if (yoaOset > -1) { - byte[] y = BinaryUtils.convert(yoaOset, 3); - data[22] = y[0]; - data[23] = y[1]; - data[24] = y[2]; - } else { - data[22] = (byte)0xFF; - data[23] = (byte)0xFF; - data[24] = (byte)0xFF; - } - - // XoaOrent/YoaOrent - switch (oaOrent) { - case -1: // use x/y axis orientation defined in object - data[25] = (byte)0xFF; // x axis rotation - data[26] = (byte)0xFF; // - data[27] = (byte)0xFF; // y axis rotation - data[28] = (byte)0xFF; - break; - case 90: - data[25] = 0x2D; - data[26] = 0x00; - data[27] = 0x5A; - data[28] = 0x00; - break; - case 180: - data[25] = 0x5A; - data[25] = 0x00; - data[27] = (byte)0x87; - data[28] = 0x00; - break; - case 270: - data[25] = (byte)0x87; - data[26] = 0x00; - data[27] = 0x00; - data[28] = 0x00; - break; - default: // 0 degrees - data[25] = 0x00; - data[26] = 0x00; - data[27] = 0x2D; - data[28] = 0x00; - break; - } - - // XocaOset (object content) - if (xocaOset > -1) { - byte[] x = BinaryUtils.convert(xocaOset, 3); - data[29] = x[0]; - data[30] = x[1]; - data[31] = x[2]; - } else { - data[29] = (byte)0xFF; - data[30] = (byte)0xFF; - data[31] = (byte)0xFF; - } - - // YocaOset (object content) - if (yocaOset > -1) { - byte[] y = BinaryUtils.convert(yocaOset, 3); - data[32] = y[0]; - data[33] = y[1]; - data[34] = y[2]; - } else { - data[32] = (byte)0xFF; - data[33] = (byte)0xFF; - data[34] = (byte)0xFF; - } - // RefCSys (Reference coordinate system) - data[35] = 0x01; // Page or overlay coordinate system - - // Write structured field data - os.write(data); - - // Write triplet for FQN internal/external object reference - if (tripletData != null) { - os.write(tripletData); - } - } - - private String getObjectTypeName() { - String objectTypeName = null; - if (objectType == TYPE_PAGE_SEGMENT) { - objectTypeName = "page segment"; - } else if (objectType == TYPE_OTHER) { - objectTypeName = "other"; - } else if (objectType == TYPE_GRAPHIC) { - objectTypeName = "graphic"; - } else if (objectType == TYPE_BARCODE) { - objectTypeName = "barcode"; - } else if (objectType == TYPE_IMAGE) { - objectTypeName = "image"; - } - return objectTypeName; - } - - /** {@inheritDoc} */ - public String toString() { - return "IncludeObject{name=" + this.getName() - + ", objectType=" + getObjectTypeName() - + ", xoaOset=" + xoaOset - + ", yoaOset=" + yoaOset - + ", oaOrent" + oaOrent - + ", xocaOset=" + xocaOset - + ", yocaOset=" + yocaOset - + "}"; - } - - /** - * Sets the mapping option - * - * @param optionValue the mapping option value - */ - public void setMappingOption(byte optionValue) { - addTriplet(new MappingOptionTriplet(optionValue)); - } - - /** - * Sets the extent of an object area in the X and Y directions - * - * @param x the x direction extent - * @param y the y direction extent - */ - public void setObjectAreaSize(int x, int y) { - addTriplet(new ObjectAreaSizeTriplet(x, y)); - } - - /** - * Sets the measurement units used to specify the units of measure - * - * @param xRes units per base on the x-axis - * @param yRes units per base on the y-axis - */ - public void setMeasurementUnits(int xRes, int yRes) { - addTriplet(new MeasurementUnitsTriplet(xRes, xRes)); - } - -} \ No newline at end of file diff --git a/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java b/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java deleted file mode 100644 index be1ef870f..000000000 --- a/src/java/org/apache/fop/render/afp/modca/IncludePageOverlay.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.afp.modca; - -import java.io.IOException; -import java.io.OutputStream; - -import org.apache.fop.render.afp.tools.BinaryUtils; - -/** - * - * The Include Page Overlay structured field references an overlay resource - * definition that is to be positioned on the page. A page overlay can be - * referenced at any time during the page state, but not during an object state. - * The overlay contains its own active environment group definition. - * - * Note: There is no need for the triplets, so I have ignored them. - * - * A real example of where this will be used is for static overlays, such as an - * address on the page. - * - */ -public class IncludePageOverlay extends AbstractNamedAFPObject { - - /** - * The x coordinate - */ - private int x = 0; - - /** - * The y coordinate - */ - private int y = 0; - - /** - * The orientation - */ - private int orientation = 0; - - /** - * Constructor for the Include Page Overlay - * - * @param overlayName Name of the page segment - * @param x The x position - * @param y The y position - * @param orientation The orientation - */ - public IncludePageOverlay(String overlayName, int x, int y, int orientation) { - super(overlayName); - - this.x = x; - this.y = y; - setOrientation(orientation); - } - - /** - * Sets the orientation to use for the overlay. - * - * @param orientation - * The orientation (0,90, 180, 270) - */ - public void setOrientation(int orientation) { - if (orientation == 0 || orientation == 90 || orientation == 180 - || orientation == 270) { - this.orientation = orientation; - } else { - throw new IllegalArgumentException( - "The orientation must be one of the values 0, 90, 180, 270"); - } - } - - /** {@inheritDoc} */ - public void writeToStream(OutputStream os) throws IOException { - byte[] data = new byte[25]; //(9 +16) - copySF(data, Type.INCLUDE, Category.PAGE_OVERLAY); - - // Set the total record length - byte[] len = BinaryUtils.convert(24, 2); //Ignore first byte - data[1] = len[0]; - data[2] = len[1]; - - byte[] xPos = BinaryUtils.convert(x, 3); - data[17] = xPos[0]; // x coordinate - data[18] = xPos[1]; - data[19] = xPos[2]; - - byte[] yPos = BinaryUtils.convert(y, 3); - data[20] = yPos[0]; // y coordinate - data[21] = yPos[1]; - data[22] = yPos[2]; - - switch (orientation) { - case 90: - data[23] = 0x2D; - data[24] = 0x00; - break; - case 180: - data[23] = 0x5A; - data[24] = 0x00; - break; - case 270: - data[23] = (byte) 0x87; - data[24] = 0x00; - break; - default: - data[23] = 0x00; - data[24] = 0x00; - break; - } - os.write(data); - } -} \ No newline at end of file diff --git a/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java b/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java deleted file mode 100644 index a9d247553..000000000 --- a/src/java/org/apache/fop/render/afp/modca/IncludePageSegment.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.afp.modca; - -import java.io.IOException; -import java.io.OutputStream; - -import org.apache.fop.render.afp.tools.BinaryUtils; - -/** - * The Include Page Segment structured field references a page segment resource - * object that is to be presented on the page or overlay presentation space. The IPS - * specifies a reference point on the including page or overlay coordinate system that - * may be used to position objects contained in the page segment. A page segment - * can be referenced at any time during page or overlay state, but not during an - * object state. The page segment inherits the active environment group definition of - * the including page or overlay. - * - * Note : No use for Triplets. - * - * A 'real' example for where this will be used is for - * the dynamic placing of overlay objects, such as signatures - * that may have to be placed at different positions on a document. - * - */ -public class IncludePageSegment extends AbstractNamedAFPObject { - - /** - * The x position where we need to put this object on the page - */ - private int x; - - /** - * The y position where we need to put this object on the page - */ - private int y; - - /** - * Constructor for the Include Page Segment - * - * @param name Name of the page segment - * @param x The x position - * @param y The y position - */ - public IncludePageSegment(String name, int x, int y) { - super(name); - - this.x = x; - this.y = y; - } - - /** {@inheritDoc} */ - public void writeToStream(OutputStream os) throws IOException { - byte[] data = new byte[23]; //(9 +14) - copySF(data, Type.INCLUDE, Category.PAGE_SEGMENT); - - // Set the total record length - byte[] len = BinaryUtils.convert(22, 2); //Ignore first byte - data[1] = len[0]; - data[2] = len[1]; - - byte[] xPos = BinaryUtils.convert(x, 3); - data[17] = xPos[0]; // x coordinate - data[18] = xPos[1]; - data[19] = xPos[2]; - - byte[] yPos = BinaryUtils.convert(y, 3); - data[20] = yPos[0]; // y coordinate - data[21] = yPos[1]; - data[22] = yPos[2]; - - os.write(data); - } -} diff --git a/src/java/org/apache/fop/render/afp/modca/InterchangeSet.java b/src/java/org/apache/fop/render/afp/modca/InterchangeSet.java deleted file mode 100644 index 4d52df3d3..000000000 --- a/src/java/org/apache/fop/render/afp/modca/InterchangeSet.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id: $ */ - -package org.apache.fop.render.afp.modca; - -/** - * MO:DCA Interchange Set - */ -public class InterchangeSet { - /** interchange set 1 string value */ - public static final String MODCA_PRESENTATION_INTERCHANGE_SET_1 = "MO:DCA-P IS/1"; - - /** interchange set 2 string value */ - public static final String MODCA_PRESENTATION_INTERCHANGE_SET_2 = "MO:DCA-P IS/2"; - - /** resource interchange set string value */ - public static final String MODCA_RESOURCE_INTERCHANGE_SET = "MO:DCA-L"; - - private static final String[] NAMES = { - MODCA_PRESENTATION_INTERCHANGE_SET_1, - MODCA_PRESENTATION_INTERCHANGE_SET_2, - MODCA_RESOURCE_INTERCHANGE_SET - }; - - private static final int SET_1 = 0; - private static final int SET_2 = 1; - private static final int RESOURCE_SET = 2; - - /** the actual interchange set in use */ - private int value; - - /** - * Returns the interchange set value of a given string - * - * @param str an interchange set value - * @return an interchange set - */ - public static InterchangeSet valueOf(String str) { - if (MODCA_PRESENTATION_INTERCHANGE_SET_1.equals(str)) { - return new InterchangeSet(SET_1); - } else if (MODCA_PRESENTATION_INTERCHANGE_SET_2.equals(str)) { - return new InterchangeSet(SET_2); - } else if (MODCA_RESOURCE_INTERCHANGE_SET.equals(str)) { - return new InterchangeSet(RESOURCE_SET); - } else { - throw new IllegalArgumentException("Invalid MO:DCA interchange set :" + str); - } - } - - /** - * Main constructor - * - * @param value the interchange set value - */ - public InterchangeSet(int value) { - this.value = value; - } - - /** - * Returns true if complies with MOD:CA interchange set 1 - * - * @return true if complies with MOD:CA interchange set 1 - */ - protected boolean is1() { - return value == SET_1; - } - - /** - * Returns true if complies with MOD:CA interchange set 2 - * - * @return true if complies with MOD:CA interchange set 2 - */ - public boolean is2() { - return value == SET_2; - } - - /** - * Returns true if complies with MOD:CA resource set - * - * @return true if complies with MOD:CA resource set - */ - public boolean isResource() { - return value == RESOURCE_SET; - } - - /** {@inheritDoc} */ - public String toString() { - return NAMES[value]; - } - - /** - * Returns true if MOD:CA interchange set 2 (resource groups) is supported - * - * @return true if MOD:CA interchange set 2 (resource groups) is supported - */ - public boolean supportsLevel2() { - return is2() || isResource(); - } -} diff --git a/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java b/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java deleted file mode 100644 index cee7711e6..000000000 --- a/src/java/org/apache/fop/render/afp/modca/InvokeMediumMap.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.afp.modca; - -import java.io.IOException; -import java.io.OutputStream; - -import org.apache.fop.render.afp.tools.BinaryUtils; - -/** - * The Invoke Medium Map structured field identifies the Medium Map that is to - * become active for the document. An Invoke Medium Map structured field affects - * the document's current environment. The Medium Map's effect on current environment - * parameter values lasts until a new Medium Map is invoked. - */ -public class InvokeMediumMap extends AbstractNamedAFPObject { - - /** - * Constructor for the Invoke Medium Map - * - * @param name the name of the medium map - */ - public InvokeMediumMap(String name) { - super(name); - } - - /** {@inheritDoc} */ - public void writeToStream(OutputStream os) throws IOException { - - byte[] data = new byte[17]; - copySF(data, Type.MAP, Category.MEDIUM_MAP); - - // Set the total record length - byte[] len = BinaryUtils.convert(16, 2); //Ignore first byte - data[1] = len[0]; - data[2] = len[1]; - - os.write(data); - } -} \ No newline at end of file diff --git a/src/java/org/apache/fop/render/afp/modca/MapCodedFont.java b/src/java/org/apache/fop/render/afp/modca/MapCodedFont.java deleted file mode 100644 index f305630bc..000000000 --- a/src/java/org/apache/fop/render/afp/modca/MapCodedFont.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.afp.modca; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.util.Iterator; -import java.util.List; - -import org.apache.fop.render.afp.AFPConstants; -import org.apache.fop.render.afp.exceptions.FontRuntimeException; -import org.apache.fop.render.afp.fonts.AFPFont; -import org.apache.fop.render.afp.fonts.CharacterSet; -import org.apache.fop.render.afp.fonts.OutlineFont; -import org.apache.fop.render.afp.fonts.RasterFont; -import org.apache.fop.render.afp.tools.BinaryUtils; - -/** - * The Map Coded Font structured field maps a unique coded font resource local - * ID, which may be embedded one or more times within an object's data and - * descriptor, to the identifier of a coded font resource object. Additionally, - * the Map Coded Font structured field specifies a set of resource attributes - * for the coded font. - * - * @author Pete Townsend - */ -public class MapCodedFont extends AbstractStructuredAFPObject { - - /** - * The collection of map coded fonts (maximum of 254) - */ - private List/*- * The entity resolver only handles queries for the DTD. It will find any URI - * with a recognised public id and return an {@link org.xml.sax.InputSource}. - *
- * @author Joe Schmetzer - */ -public class DTDEntityResolver implements EntityResolver { - - /** Public ID for the AFP fonts 1.0 DTD. */ - public static final String AFP_DTD_1_0_ID - = "-//APACHE/DTD AFP Installed Font Definition DTD 1.0//EN"; - - /** Resource location for the AFP fonts 1.0 DTD. */ - public static final String AFP_DTD_1_0_RESOURCE - = "afp-fonts-1.0.dtd"; - - /** Public ID for the AFP fonts 1.1 DTD. */ - public static final String AFP_DTD_1_1_ID - = "-//APACHE/DTD AFP Installed Font Definition DTD 1.1//EN"; - - /** Resource location for the AFP fonts 1.1 DTD. */ - public static final String AFP_DTD_1_1_RESOURCE - = "afp-fonts-1.1.dtd"; - - /** Public ID for the AFP fonts 1.2 DTD. */ - public static final String AFP_DTD_1_2_ID - = "-//APACHE/DTD AFP Installed Font Definition DTD 1.2//EN"; - - /** Resource location for the AFP fonts 1.2 DTD. */ - public static final String AFP_DTD_1_2_RESOURCE - = "afp-fonts-1.2.dtd"; - - /** - * Resolve the combination of system and public identifiers. - * If this resolver recognises the publicId, it will handle the resolution - * from the classpath, otherwise it will return null and allow the default - * resolution to occur. - * - * @param publicId the public identifier to use - * @param systemId the system identifier to resolve - * @return An input source to the entity or null if not handled - * @throws IOException an error reading the stream - */ - public InputSource resolveEntity(String publicId, String systemId) - throws IOException { - - URL resource = null; - if ( AFP_DTD_1_2_ID.equals(publicId) ) { - resource = getResource( AFP_DTD_1_2_RESOURCE ); - } else if ( AFP_DTD_1_1_ID.equals(publicId) ) { - resource = getResource( AFP_DTD_1_1_RESOURCE ); - } else if ( AFP_DTD_1_0_ID.equals(publicId) ) { - throw new FontRuntimeException( - "The AFP Installed Font Definition 1.0 DTD is not longer supported" ); - } else if (systemId != null && systemId.indexOf("afp-fonts.dtd") >= 0 ) { - throw new FontRuntimeException( - "The AFP Installed Font Definition DTD must be specified using the public id" ); - } else { - return null; - } - - InputSource inputSource = new InputSource( resource.openStream() ); - inputSource.setPublicId( publicId ); - inputSource.setSystemId( systemId ); - - return inputSource; - } - - /** - * Returns the URL of a resource on the classpath - * @param resourceName the path to the resource relative to the root of the - * classpath. - * @return the URL of the required resource - * @throws FontRuntimeException if the resource could not be found. - */ - private URL getResource(String resourcePath) { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - if (cl == null) { - cl = ClassLoader.getSystemClassLoader(); - } - - URL resource = cl.getResource( resourcePath ); - if (resource == null) { - throw new FontRuntimeException( "Resource " + resourcePath - + "could not be found on the classpath" ); - } - - return resource; - } -} diff --git a/src/java/org/apache/fop/render/afp/tools/StringUtils.java b/src/java/org/apache/fop/render/afp/tools/StringUtils.java deleted file mode 100644 index c49509aa0..000000000 --- a/src/java/org/apache/fop/render/afp/tools/StringUtils.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.afp.tools; - -/** - * Library of utility methods useful in dealing with strings. - * - */ -public class StringUtils { - - /** - * Padds the string to the left with the given character for - * the specified length. - * @param input The input string. - * @param padding The char used for padding. - * @param length The length of the new string. - * @return The padded string. - */ - public static String lpad(String input, char padding, int length) { - - if (input == null) { - input = new String(); - } - - if (input.length() >= length) { - return input; - } else { - StringBuffer result = new StringBuffer(); - int numChars = length - input.length(); - for (int i = 0; i < numChars; i++) { - result.append(padding); - } - result.append(input); - return result.toString(); - } - } - - /** - * Padds the string to the right with the given character for - * the specified length. - * @param input The input string. - * @param padding The char used for padding. - * @param length The length of the new string. - * @return The padded string. - */ - public static String rpad(String input, char padding, int length) { - - if (input == null) { - input = new String(); - } - - if (input.length() >= length) { - return input; - } else { - StringBuffer result = new StringBuffer(input); - int numChars = length - input.length(); - for (int i = 0; i < numChars; i++) { - result.append(padding); - } - return result.toString(); - } - } - -} \ No newline at end of file diff --git a/src/java/org/apache/fop/render/afp/tools/StructuredFieldReader.java b/src/java/org/apache/fop/render/afp/tools/StructuredFieldReader.java deleted file mode 100644 index 48beff023..000000000 --- a/src/java/org/apache/fop/render/afp/tools/StructuredFieldReader.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.afp.tools; - -import java.io.IOException; -import java.io.InputStream; - -/** - * A helper class to read structured fields from a MO:DCA document. Each - * component of a mixed object document is explicitly defined and delimited - * in the data. This is accomplished through the use of MO:DCA data structures, - * called structured fields. Structured fields are used to envelop document - * components and to provide commands and information to applications using - * the data. Structured fields may contain one or more parameters. Each - * parameter provides one value from a set of values defined by the architecture. - *
- * MO:DCA structured fields consist of two parts: an introducer that identifies - * the length and type of the structured field, and data that provides the - * structured field's effect. The data is contained in a set of parameters, - * which can consist of other data structures and data elements. The maximum - * length of a structured field is 32767 bytes. - * - */ -public class StructuredFieldReader { - - /** - * The input stream to read - */ - private InputStream inputStream = null; - - /** - * The constructor for the StructuredFieldReader - * @param inputStream the input stream to process - */ - public StructuredFieldReader(InputStream inputStream) { - this.inputStream = inputStream; - } - - /** - * Get the next structured field as identified by the identifer - * parameter (this must be a valid MO:DCA structured field. - * @param identifier the three byte identifier - * @throws IOException if an I/O exception occurred - * @return the next structured field or null when there are no more - */ - public byte[] getNext(byte[] identifier) throws IOException { - - int bufferPointer = 0; - byte[] bufferData = new byte[identifier.length + 2]; - for (int x = 0; x < identifier.length; x++) { - bufferData[x] = 0x00; - } - - int c; - while ((c = inputStream.read()) > -1) { - - bufferData[bufferPointer] = (byte) c; - - // Check the last characters in the buffer - int index = 0; - boolean found = true; - - for (int i = identifier.length - 1; i > -1; i--) { - - int p = bufferPointer - index; - if (p < 0) { - p = bufferData.length + p; - } - - index++; - - if (identifier[i] != bufferData[p]) { - found = false; - break; - } - - } - - if (found) { - - byte[] length = new byte[2]; - - int a = bufferPointer - identifier.length; - if (a < 0) { - a = bufferData.length + a; - } - - int b = bufferPointer - identifier.length - 1; - if (b < 0) { - b = bufferData.length + b; - } - - length[0] = bufferData[b]; - length[1] = bufferData[a]; - - int reclength = ((length[0] & 0xFF) << 8) - + (length[1] & 0xFF) - identifier.length - 2; - - byte[] retval = new byte[reclength]; - - inputStream.read(retval, 0, reclength); - - return retval; - - } - - bufferPointer++; - if (bufferPointer >= bufferData.length) { - bufferPointer = 0; - } - - } - - return null; - } -} diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index 61ed1ff07..cc1caea03 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -50,6 +50,7 @@ import org.apache.xmlgraphics.xmp.Metadata; import org.apache.xmlgraphics.xmp.schemas.XMPBasicAdapter; import org.apache.xmlgraphics.xmp.schemas.XMPBasicSchema; +import org.apache.fop.AbstractState; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.MimeConstants; @@ -112,7 +113,6 @@ import org.apache.fop.pdf.PDFTextUtil; import org.apache.fop.pdf.PDFXMode; import org.apache.fop.pdf.PDFXObject; import org.apache.fop.render.AbstractPathOrientedRenderer; -import org.apache.fop.render.AbstractState; import org.apache.fop.render.Graphics2DAdapter; import org.apache.fop.render.RendererContext; import org.apache.fop.util.CharUtilities; diff --git a/src/java/org/apache/fop/render/ps/PSTextPainter.java b/src/java/org/apache/fop/render/ps/PSTextPainter.java index 31cb4b605..7c525dbf7 100644 --- a/src/java/org/apache/fop/render/ps/PSTextPainter.java +++ b/src/java/org/apache/fop/render/ps/PSTextPainter.java @@ -38,6 +38,9 @@ import java.util.Iterator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.FontInfo; +import org.apache.fop.fonts.FontTriplet; import org.apache.xmlgraphics.java2d.ps.PSGraphics2D; import org.apache.xmlgraphics.java2d.TextHandler; @@ -51,9 +54,6 @@ import org.apache.batik.gvt.text.TextPaintInfo; import org.apache.batik.gvt.font.GVTFontFamily; import org.apache.batik.gvt.renderer.StrokingTextPainter; -import org.apache.fop.fonts.Font; -import org.apache.fop.fonts.FontInfo; -import org.apache.fop.fonts.FontTriplet; /** * Renders the attributed character iterator of a TextNode. diff --git a/src/java/org/apache/fop/store/FileStore.java b/src/java/org/apache/fop/store/FileStore.java deleted file mode 100644 index 131daf32b..000000000 --- a/src/java/org/apache/fop/store/FileStore.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.store; - -import java.io.File; -import java.io.FileDescriptor; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.RandomAccessFile; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.xmlgraphics.image.loader.ImageManager; - -/** - * A useful class which is able to easily store and retrieve large resources (such as images) - */ -public class FileStore { - - /** logger */ - protected static Log log = LogFactory.getLog(ImageManager.class); - - /** Internal temporary storage buffer size */ - private static final int BUFFER_SIZE = 4096; - - /** Used for storage of data objects */ - protected RandomAccessFile raFile; - - /** The temporary cache file */ - private File tempFile; - - /** The file outputstream */ - protected FileOutputStream fos; - - /** - * Default constructor - * - * @param prefix file store prefix - */ - public FileStore(String prefix) { - try { - this.tempFile = File.createTempFile(prefix, null); - this.raFile = new RandomAccessFile(tempFile, "rw"); - FileDescriptor fd = raFile.getFD(); - this.fos = new FileOutputStream(fd); - } catch (IOException e) { - // TODO - log.error(e.getMessage()); - } - } - - /** - * Clears the resource store. - * - * @throws IOException if an error occurs while clearing the store - */ - public void clear() throws IOException { - if (tempFile != null) { - raFile.close(); - raFile = null; - fos = null; - if (tempFile.exists() && !tempFile.delete()) { - throw new IOException("Could not delete temporary file: " + tempFile); - } - tempFile = null; - } - } - - /** {@inheritDoc} */ - public void finalize() throws Throwable { - try { - clear(); - } finally { - super.finalize(); - } - } - - /** - * Returns the storer of a given object - * - * @param object an object to be stored - * @return a storer of the object - */ - protected Storer getStorer(Object object) { - Storer storer; - if (object instanceof Writable) { - storer = new WritableStorer(this, (Writable)object); - } else if (object instanceof InputStream) { - storer = new InputStreamStorer(this, (InputStream)object); - } else { - throw new IllegalArgumentException("Unsupported object " + object); - } - return storer; - } - - /** - * Stores an object in the cache - * - * @param object the object to store - * @return a new save information record - * - * @throws java.io.IOException an I/O exception of some sort has occurred. - */ - public StoreRecord write(Object object) throws IOException { - return getStorer(object).store(); - } - - /** - * Reads all the data from a given store information record - * and returns it in a byte array. - * This is potentially a memory hungry operation so use with care. - * - * @param storeInfo a store information record - * @return the stored data in a byte array. - * @throws java.io.IOException an I/O exception of some sort has occurred. - */ - public byte[] read(StoreRecord storeInfo) throws IOException { - raFile.seek(storeInfo.position); - byte[] buff = new byte[storeInfo.size]; - raFile.read(buff); - return buff; - } - - /** - * Writes out the resource in full using the store information to the given outputstream. - * - * @param storeInfo the save information - * @param os the outputstream to write to - * - * @throws java.io.IOException an I/O exception of some sort has occurred. - */ - public void writeToStream(StoreRecord storeInfo, OutputStream os) throws IOException { - if (storeInfo == null) { - throw new IllegalArgumentException("save is null"); - } - double chunkCount = storeInfo.size / BUFFER_SIZE; - byte[] buffer = new byte[BUFFER_SIZE]; - raFile.seek(storeInfo.position); - for (int cnt = 0; cnt < chunkCount; cnt++) { - raFile.read(buffer, 0, BUFFER_SIZE); - os.write(buffer, 0, BUFFER_SIZE); - } - int lastChunkLength = storeInfo.size % BUFFER_SIZE; - raFile.read(buffer, 0, lastChunkLength); - os.write(buffer, 0, lastChunkLength); - } -} diff --git a/src/java/org/apache/fop/store/InputStreamStorer.java b/src/java/org/apache/fop/store/InputStreamStorer.java deleted file mode 100644 index 5d72c932f..000000000 --- a/src/java/org/apache/fop/store/InputStreamStorer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.store; - -import java.io.IOException; -import java.io.InputStream; - -import org.apache.commons.io.IOUtils; - -/** - * Storer of InputStreams - */ -public final class InputStreamStorer extends Storer { - - /** an inputstream */ - private final InputStream in; - - /** - * Constructor - * - * @param store our resource store - * @param in an inputstream - */ - protected InputStreamStorer(FileStore store, InputStream in) { - super(store); - this.in = in; - } - - /** {@inheritDoc} */ - protected void doStore() throws IOException { - IOUtils.copy(in, store.fos); - } -} \ No newline at end of file diff --git a/src/java/org/apache/fop/store/StoreRecord.java b/src/java/org/apache/fop/store/StoreRecord.java deleted file mode 100644 index f4dd8ff49..000000000 --- a/src/java/org/apache/fop/store/StoreRecord.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.store; - -import java.io.IOException; -import java.io.OutputStream; - -/** - * Store save information - */ -public class StoreRecord { - - /** the resource store associated with this store information */ - private final FileStore store; - - /** data position */ - protected long position; - - /** data chunk size */ - protected int size; - - /** - * Main constructor - * - * @param store our resource store - */ - public StoreRecord(FileStore store) { - this.store = store; - } - - /** - * Returns the storage position - * - * @return the storage position - */ - public long getPosition() { - return this.position; - } - - /** - * Returns the storage size - * - * @return the storage size - */ - public int getLength() { - return this.size; - } - - /** - * Returns the resource store associated with this store record - * - * @return the resource store associated with this store record - */ - public FileStore getStore() { - return this.store; - } - - /** - * Convenience method used to writes the data referenced - * by this storage record to an outputstream - * - * @param os the outputstream to write to - * @throws java.io.IOException an I/O exception of some sort has occurred. - */ - public void writeToStream(OutputStream os) throws IOException { - store.writeToStream(this, os); - } - - /** {@inheritDoc} */ - public String toString() { - return "pos=" + position + ", size=" + size; - } -} \ No newline at end of file diff --git a/src/java/org/apache/fop/store/Storer.java b/src/java/org/apache/fop/store/Storer.java deleted file mode 100644 index d8dbab191..000000000 --- a/src/java/org/apache/fop/store/Storer.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.store; - -import java.io.IOException; - -/** - * Base storer class - */ -public class Storer { - - /** write session */ - protected final WriteSession session; - - /** file store */ - protected final FileStore store; - - /** - * Constructor - * - * @param store our resource store - */ - public Storer(FileStore store) { - this.store = store; - this.session = new WriteSession(this); - } - - /** - * Instantiates the store information record - * - * @return a new store information record - */ - protected StoreRecord createRecord() { - return new StoreRecord(store); - } - - /** - * Stores the object - * - * @return a store information record - * @throws IOException thrown if an I/O exception of some sort has occurred. - */ - public StoreRecord store() throws IOException { - StoreRecord record = null; - session.begin(); - try { - doStore(); - } finally { - record = session.end(); - } - return record; - } - - /** - * Actually performs the store operation - * - * @throws IOException thrown if an I/O exception of some sort has occurred. - */ - protected void doStore() throws IOException { - } - - /** - * Returns the file store associated with this storer - * - * @return the file store associated with this storer - */ - protected FileStore getStore() { - return store; - } -} diff --git a/src/java/org/apache/fop/store/Writable.java b/src/java/org/apache/fop/store/Writable.java deleted file mode 100644 index 8f6052261..000000000 --- a/src/java/org/apache/fop/store/Writable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.store; - -import java.io.IOException; -import java.io.OutputStream; - -/** - * Implementing object is able to write to an OutputStream - */ -public interface Writable { - - /** - * DataStream objects must implement the writeToStream() - * method to write its data to the given OutputStream - * - * @param outputStream The outputsteam stream - * @throws java.io.IOException an I/O exception of some sort has occurred. - */ - void writeToStream(OutputStream outputStream) throws IOException; -} diff --git a/src/java/org/apache/fop/store/WritableStorer.java b/src/java/org/apache/fop/store/WritableStorer.java deleted file mode 100644 index bba11287e..000000000 --- a/src/java/org/apache/fop/store/WritableStorer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.store; - -import java.io.IOException; - -/** - * Storer of objects that implement the Writable interface - */ -public class WritableStorer extends Storer { - - /** a Writable object */ - protected final Writable writable; - - /** - * Constructor - * - * @param store our resource store - * @param writable an object implementing the Writable interface - */ - public WritableStorer(FileStore store, Writable writable) { - super(store); - this.writable = writable; - } - - /** {@inheritDoc} */ - protected void doStore() throws IOException { - writable.writeToStream(store.fos); - } -} diff --git a/src/java/org/apache/fop/store/WriteSession.java b/src/java/org/apache/fop/store/WriteSession.java deleted file mode 100644 index 034357355..000000000 --- a/src/java/org/apache/fop/store/WriteSession.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.store; - -import java.io.IOException; -import java.io.OutputStream; - -/** - * A Write session - */ -public class WriteSession { - /** true if the session output was flushed */ - protected boolean flushed = false; - - /** the session storer */ - private final Storer storer; - - /** the storer's file store */ - private final FileStore store; - - /** the store information record */ - protected StoreRecord record; - - /** - * Constructor - * - * @param store our store - */ - public WriteSession(FileStore store) { - this.storer = new Storer(store); - this.store = store; - } - - /** - * Constructor - * - * @param storer our storer - */ - public WriteSession(Storer storer) { - this.storer = storer; - this.store = storer.getStore(); - } - - /** - * Begins the session - * - * @throws IOException thrown if an I/O exception of some sort has occurred. - */ - public void begin() throws IOException { - // always write to the end of the store - long length = store.raFile.length(); - if (store.raFile.getFilePointer() < length) { - store.raFile.seek(length); - } - - this.record = storer.createRecord(); - record.position = store.raFile.getFilePointer(); - } - - /** - * Ends the session - * - * @return a new store information record - * @throws IOException thrown if an I/O exception of some sort has occurred. - */ - public StoreRecord end() throws IOException { - if (!flushed) { - store.fos.flush(); - flushed = true; - } - record.size = (int)(store.raFile.getFilePointer() - record.position); - return record; - } - - /** - * Returns the outputstream of this store - * - * @return the outputstream of this store - */ - public OutputStream getOutputStream() { - return store.fos; - } - - /** - * Returns the store record - * - * @return the store record - */ - public StoreRecord getRecord() { - return record; - } -} \ No newline at end of file diff --git a/src/java/org/apache/fop/svg/GraphicsConfiguration.java b/src/java/org/apache/fop/svg/GraphicsConfiguration.java index ca3b3363c..881096b9a 100644 --- a/src/java/org/apache/fop/svg/GraphicsConfiguration.java +++ b/src/java/org/apache/fop/svg/GraphicsConfiguration.java @@ -17,7 +17,6 @@ /* $Id$ */ - package org.apache.fop.svg; import java.awt.image.VolatileImage; diff --git a/src/java/org/apache/fop/svg/PDFBridgeContext.java b/src/java/org/apache/fop/svg/PDFBridgeContext.java index fdf83784f..6aa29cfa1 100644 --- a/src/java/org/apache/fop/svg/PDFBridgeContext.java +++ b/src/java/org/apache/fop/svg/PDFBridgeContext.java @@ -26,11 +26,11 @@ import org.apache.batik.bridge.Bridge; import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.DocumentLoader; import org.apache.batik.bridge.UserAgent; +import org.apache.fop.fonts.FontInfo; import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.ImageSessionContext; -import org.apache.fop.fonts.FontInfo; /** * BridgeContext which registers the custom bridges for PDF output. diff --git a/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java b/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java index 83a431d5e..0204a2756 100644 --- a/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java +++ b/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java @@ -26,6 +26,7 @@ import java.awt.image.ColorModel; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; + /** * Our implementation of the class that returns information about * roughly what we can handle and want to see (alpha for example). -- cgit v1.2.3 From c550e0349a64c0c66d6cee0f2e6f1baa97e14ad2 Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey- The default value for the "images mode" setting is "b+w" (black and white). When the setting is "color" a "bits-per-pixel" setting can be provided. When the setting "native" is set to true, images (TIFF, JPEG and Encapsulated Postscript) will be placed in the datastream in their native form using a MO:DCA Object Container. + The default value for the images "mode" setting is "b+w" (black and white). When the images "mode" setting is "b+w" a "bits-per-pixel" setting can be provided to aid the grayscale conversion process. With this setting all images referenced in your source document are converted to an IOCA FS45 grayscale bitmap image form. + When the setting is "color" all images are converted to an IOCA FS45 color bitmap image form. When "native" setting is "true", all images encountered (TIFF, GIF, JPEG and Encapsulated Postscript etc.) will be embedded directly in the datastream in their native form using a MO:DCA Object Container.
The default value for the "renderer-resolution" is 240 dpi.
diff --git a/src/java/META-INF/services/org.apache.fop.render.afp.AFPImageHandler b/src/java/META-INF/services/org.apache.fop.render.afp.AFPImageHandler
new file mode 100644
index 000000000..deab7d259
--- /dev/null
+++ b/src/java/META-INF/services/org.apache.fop.render.afp.AFPImageHandler
@@ -0,0 +1,5 @@
+org.apache.fop.render.afp.AFPImageHandlerRenderedImage
+org.apache.fop.render.afp.AFPImageHandlerRawCCITTFax
+org.apache.fop.render.afp.AFPImageHandlerRawStream
+org.apache.fop.render.afp.AFPImageHandlerGraphics2D
+org.apache.fop.render.afp.AFPImageHandlerXML
diff --git a/src/java/org/apache/fop/afp/AFPForeignAttributeReader.java b/src/java/org/apache/fop/afp/AFPForeignAttributeReader.java
deleted file mode 100644
index 710c24533..000000000
--- a/src/java/org/apache/fop/afp/AFPForeignAttributeReader.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.afp;
-
-import java.io.File;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.fop.render.afp.extensions.AFPElementMapping;
-import org.apache.xmlgraphics.util.QName;
-
-/**
- * Parses any AFP foreign attributes
- */
-public class AFPForeignAttributeReader {
- private static final Log log = LogFactory.getLog("org.apache.xmlgraphics.afp");
-
- /** the resource-name attribute */
- public static final String RESOURCE_NAME = "afp:resource-name";
-
- /** the resource-level attribute */
- public static final String RESOURCE_LEVEL = "afp:resource-level";
-
- /** the resource-group-file attribute */
- public static final String RESOURCE_GROUP_FILE = "afp:resource-group-file";
-
- /**
- * Main constructor
- */
- public AFPForeignAttributeReader() {
- }
-
- /**
- * Returns the resource information
- *
- * @param foreignAttributes the foreign attributes
- * @return the resource information
- */
- public AFPResourceInfo getResourceInfo(Map/* Contains a collection of AFP Graphics Object Content Architecture (GOCA) structured objects. Contains a collection of AFP font related classes. Contains a collection of AFP Image Object Content Architecture (IOCA) structured objects. Contains a collection of AFP Mixed Object Document Content Architecture (MO:DCA) structured objects. Contains a collection of AFP Mixed Object Document Content Architecture (MO:DCA) triplet classes. Contains an AFP library. An AFP Renderer implementation and supporting classes. Contains a collection of AFP specific Batik bridges. Contains a collection of useful AFP utility classes.
@@ -75,10 +79,15 @@ public class ImageConverterSVG2G2D extends AbstractImageConverter {
GVTBuilder builder = new GVTBuilder();
final BridgeContext ctx = new BridgeContext(ua);
+ Document doc = svg.getDocument();
+ //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
+ //to it.
+ Document clonedDoc = BatikUtil.cloneSVGDocument(doc);
+
//Build the GVT tree
final GraphicsNode root;
try {
- root = builder.build(ctx, svg.getDocument());
+ root = builder.build(ctx, clonedDoc);
} catch (Exception e) {
throw new ImageException("GVT tree could not be built for SVG graphic", e);
}
diff --git a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
index 5c253fe94..35876a728 100644
--- a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
+++ b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
@@ -24,22 +24,25 @@ import java.awt.Dimension;
import java.awt.geom.AffineTransform;
import java.io.IOException;
+import org.w3c.dom.Document;
+
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.GVTBuilder;
import org.apache.batik.dom.AbstractDocument;
import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.apache.batik.dom.util.DOMUtilities;
import org.apache.batik.gvt.GraphicsNode;
+
+import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
+import org.apache.xmlgraphics.util.QName;
+
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.events.EventBroadcaster;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
import org.apache.fop.image.loader.batik.Graphics2DImagePainterImpl;
import org.apache.fop.render.RendererContext.RendererContextWrapper;
-import org.apache.fop.render.afp.AFPGraphics2DAdapter;
import org.apache.fop.svg.SVGEventProducer;
import org.apache.fop.svg.SVGUserAgent;
-import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
-import org.apache.xmlgraphics.util.QName;
-import org.w3c.dom.Document;
/**
* Generic XML handler for SVG. Uses Apache Batik for SVG processing and simply paints to
@@ -133,15 +136,19 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC
//Create Batik BridgeContext
final BridgeContext bridgeContext = new BridgeContext(svgUserAgent);
- //Build the GVT tree
+ //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
+ //to it.
+ Document clonedDoc = DOMUtilities.deepCloneDocument(doc, doc.getImplementation());
- final GraphicsNode root = buildGraphicsNode(userAgent, bridgeContext, doc);
+ //Build the GVT tree
+ final GraphicsNode root = buildGraphicsNode(userAgent, bridgeContext, clonedDoc);
// Create Graphics2DImagePainter
final RendererContextWrapper wrappedContext = RendererContext.wrapRendererContext(
rendererContext);
Dimension imageSize = getImageSize(wrappedContext);
- final Graphics2DImagePainter painter = createGraphics2DImagePainter(root, bridgeContext, imageSize);
+ final Graphics2DImagePainter painter = createGraphics2DImagePainter(
+ root, bridgeContext, imageSize);
//Let the painter paint the SVG on the Graphics2D instance
Graphics2DAdapter g2dAdapter = rendererContext.getRenderer().getGraphics2DAdapter();
diff --git a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
index 9deea77b4..ca64d6bc2 100644
--- a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
+++ b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
@@ -24,9 +24,18 @@ import java.awt.Dimension;
import java.awt.geom.AffineTransform;
import java.io.IOException;
+import org.w3c.dom.Document;
+
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.apache.batik.dom.util.DOMUtilities;
import org.apache.batik.gvt.GraphicsNode;
+
+import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
+import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
+import org.apache.xmlgraphics.util.MimeConstants;
+
import org.apache.fop.afp.AFPGraphics2D;
import org.apache.fop.afp.AFPGraphicsObjectInfo;
import org.apache.fop.afp.AFPObjectAreaInfo;
@@ -44,11 +53,6 @@ import org.apache.fop.render.RendererContext;
import org.apache.fop.render.RendererContext.RendererContextWrapper;
import org.apache.fop.svg.SVGEventProducer;
import org.apache.fop.svg.SVGUserAgent;
-import org.apache.xmlgraphics.image.loader.ImageManager;
-import org.apache.xmlgraphics.image.loader.ImageSessionContext;
-import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
-import org.apache.xmlgraphics.util.MimeConstants;
-import org.w3c.dom.Document;
/**
* AFP XML handler for SVG. Uses Apache Batik for SVG processing.
@@ -107,8 +111,12 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler {
// Create an AFPBridgeContext
BridgeContext bridgeContext = createBridgeContext(userAgent, g2d);
+ //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
+ //to it.
+ Document clonedDoc = DOMUtilities.deepCloneDocument(doc, doc.getImplementation());
+
// Build the SVG DOM and provide the painter with it
- GraphicsNode root = buildGraphicsNode(userAgent, bridgeContext, doc);
+ GraphicsNode root = buildGraphicsNode(userAgent, bridgeContext, clonedDoc);
// Create Graphics2DImagePainter
final RendererContextWrapper wrappedContext
diff --git a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
index ba5c86059..2d16b120d 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
@@ -23,18 +23,21 @@ import java.awt.geom.AffineTransform;
import java.io.IOException;
import java.util.Map;
+import org.w3c.dom.Document;
+
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.GVTBuilder;
+import org.apache.batik.dom.util.DOMUtilities;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.render.AbstractGenericSVGHandler;
import org.apache.fop.render.Renderer;
import org.apache.fop.render.RendererContext;
import org.apache.fop.render.RendererContextConstants;
import org.apache.fop.svg.SVGEventProducer;
import org.apache.fop.svg.SVGUserAgent;
-import org.w3c.dom.Document;
/**
* Java2D XML handler for SVG (uses Apache Batik).
@@ -128,12 +131,16 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
SVGUserAgent ua = new SVGUserAgent(context.getUserAgent(), new AffineTransform());
- GVTBuilder builder = new GVTBuilder();
BridgeContext ctx = new BridgeContext(ua);
+ //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
+ //to it.
+ Document clonedDoc = DOMUtilities.deepCloneDocument(doc, doc.getImplementation());
+
GraphicsNode root;
try {
- root = builder.build(ctx, doc);
+ GVTBuilder builder = new GVTBuilder();
+ root = builder.build(ctx, clonedDoc);
} catch (Exception e) {
SVGEventProducer eventProducer = SVGEventProducer.Provider.get(
context.getUserAgent().getEventBroadcaster());
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index e31f1eaea..dda7e2083 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -1635,6 +1635,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
(int)pos.getHeight());
uri = URISpecification.getURL(uri);
+ uri = URISpecification.preResolveURI(uri, userAgent.getBaseURL());
PDFXObject xobject = pdfDoc.getXObject(uri);
if (xobject != null) {
float w = (float) pos.getWidth() / 1000f;
diff --git a/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java b/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
index 5d027aefe..0bf9bd95b 100644
--- a/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
+++ b/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
@@ -25,14 +25,18 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
+import org.w3c.dom.Document;
+
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.GVTBuilder;
import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.apache.batik.dom.util.DOMUtilities;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.util.SVGConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.pdf.PDFDocument;
@@ -49,7 +53,6 @@ import org.apache.fop.svg.PDFBridgeContext;
import org.apache.fop.svg.PDFGraphics2D;
import org.apache.fop.svg.SVGEventProducer;
import org.apache.fop.svg.SVGUserAgent;
-import org.w3c.dom.Document;
/**
* PDF XML handler for SVG (uses Apache Batik).
@@ -164,8 +167,6 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
AffineTransform resolutionScaling = new AffineTransform();
resolutionScaling.scale(s, s);
- GVTBuilder builder = new GVTBuilder();
-
//Controls whether text painted by Batik is generated using text or path operations
boolean strokeText = false;
Configuration cfg = pdfInfo.cfg;
@@ -179,10 +180,14 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
userAgent.getImageSessionContext(),
new AffineTransform());
+ //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
+ //to it.
+ Document clonedDoc = DOMUtilities.deepCloneDocument(doc, doc.getImplementation());
+
GraphicsNode root;
try {
- root = builder.build(ctx, doc);
- builder = null;
+ GVTBuilder builder = new GVTBuilder();
+ root = builder.build(ctx, clonedDoc);
} catch (Exception e) {
SVGEventProducer eventProducer = SVGEventProducer.Provider.get(
context.getUserAgent().getEventBroadcaster());
diff --git a/src/java/org/apache/fop/render/ps/PSSVGHandler.java b/src/java/org/apache/fop/render/ps/PSSVGHandler.java
index 1e65dfb98..646cd3823 100644
--- a/src/java/org/apache/fop/render/ps/PSSVGHandler.java
+++ b/src/java/org/apache/fop/render/ps/PSSVGHandler.java
@@ -29,6 +29,7 @@ import org.w3c.dom.Document;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.GVTBuilder;
+import org.apache.batik.dom.util.DOMUtilities;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -258,7 +259,6 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
PSGraphics2D graphics = new PSGraphics2D(strokeText, gen);
graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
- GVTBuilder builder = new GVTBuilder();
NativeTextHandler nativeTextHandler = null;
BridgeContext ctx = new BridgeContext(ua);
if (!strokeText) {
@@ -271,9 +271,14 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
ctx.putBridge(tBridge);
}
+ //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
+ //to it.
+ Document clonedDoc = DOMUtilities.deepCloneDocument(doc, doc.getImplementation());
+
GraphicsNode root;
try {
- root = builder.build(ctx, doc);
+ GVTBuilder builder = new GVTBuilder();
+ root = builder.build(ctx, clonedDoc);
} catch (Exception e) {
SVGEventProducer eventProducer = SVGEventProducer.Provider.get(
context.getUserAgent().getEventBroadcaster());
@@ -288,7 +293,6 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
float sy = psInfo.getHeight() / h;
ctx = null;
- builder = null;
try {
gen.commentln("%FOPBeginSVG");
diff --git a/status.xml b/status.xml
index 0f139fba7..b2e37dd33 100644
--- a/status.xml
+++ b/status.xml
@@ -53,6 +53,9 @@