Java Doc for RasterizerTask.java in  » Graphic-Library » batik » org » apache » tools » ant » taskdefs » optional » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Graphic Library » batik » org.apache.tools.ant.taskdefs.optional 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tools.ant.taskdefs.optional.RasterizerTask

RasterizerTask
public class RasterizerTask extends MatchingTask (Code)
This Ant task can be used to convert SVG images to raster images.

Possible result raster image formats are PNG, JPEG, TIFF, and PDF. Batik SVGConverter is used to execute the conversion. You need Batik to produce the first three raster image types and FOP to produce PDF.


See Also:   SVGConverter
See Also:    SVGConverter
See Also:   org.apache.batik.apps.rasterizer.Main
See Also:    Main
author:
   Henri Ruini
version:
   $Id: RasterizerTask.java 475685 2006-11-16 11:16:05Z cam $

Inner Class :public static class ValidImageTypes extends EnumeratedAttribute
Inner Class :public static class ValidMediaTypes extends EnumeratedAttribute

Field Summary
protected  Stringarea
     Output Area of Interest (AOI) area.
protected  Stringbackground
     Output background color.
protected  SVGConverterconverter
     Converter object used to convert SVG images to raster images.
protected  FiledestDir
     Destination directory for output images.
protected  FiledestFile
     Destination image path.
protected  floatdpi
     Output pixel size - dots per inch.
protected  Vectorfilesets
     Contents of fileset elements.
protected  floatheight
     Output image height.
protected  Stringlanguage
     Output image language.
protected  floatmaxHeight
     Maximum output image height.
protected  floatmaxWidth
     Maximum output image width.
protected  StringmediaType
     Media type of CSS file used to produce output images.
protected  floatquality
     Output image quality.
protected  StringreaderClassName
     XML parser class currently in use.
protected  DestinationTyperesultType
     Result image type.
protected  FilesrcDir
     Source directory of images.
protected  FilesrcFile
     Source image path.
protected  floatwidth
     Output image width.

Constructor Summary
public  RasterizerTask()
     Initializes a new rasterizer task.

Method Summary
public  voidaddFileset(FileSet set)
     Reads fileset elements.
protected  booleanallowedToSetQuality(DestinationType type)
     Checks if the quality value can be set.
public  voidexecute()
     Validates and sets input values and files, then starts the conversion process.
protected  Rectangle2DgetAreaOfInterest(String area)
     Returns a valid Area of Interest (AOI) as a Rectangle2D object.
Parameters:
  area - AOI input area.
protected  ColorgetBackgroundColor(String argb)
     Returns a valid background color object.
Parameters:
  argb - String containing color channel values.
protected  floatgetQuality(float quality)
     Returns a valid quality value.
Parameters:
  quality - Input quality value to be tested.
protected  DestinationTypegetResultType(String type)
     Returns the correct result image type object.
Parameters:
  type - Result image type as a string.
protected  String[]getSourceFiles()
     Gets source files from the task parameters and child elements, combines those to a one list, and returns the list.
public  voidsetArea(String area)
     Gets area attribute value.
public  voidsetBg(String bg)
     Gets bg attribute value.
public  voidsetClassname(String value)
     Sets classname of an XML parser.
public  voidsetDest(File file)
     Gets dest attribute value.
public  voidsetDestdir(File dir)
     Gets destdir attribute value.
public  voidsetDpi(float dpi)
     Gets dpi attribute value.

The value have to be a positive float.

public  voidsetHeight(float height)
     Gets height attribute value.
public  voidsetLang(String language)
     Gets lang attribute value.
public  voidsetMaxheight(float height)
     Gets maxheight attribute value.
public  voidsetMaxwidth(float width)
     Gets maxwidth attribute value.
public  voidsetMedia(ValidMediaTypes media)
     Gets media attribute value.
public  voidsetQuality(float quality)
     Gets quality attribute value.

The value have to be a float between 0 and 1 excluded.

protected  voidsetRasterizingParameters()
     Checks and sets parameter values to the converter.

Some invalid values are just swallowed and default values are used instead.

public  voidsetResult(ValidImageTypes type)
     Gets result attribute value.
public  voidsetSrc(File file)
     Gets src attribute value.
public  voidsetSrcdir(File dir)
     Gets srcdir attribute value.
public  voidsetWidth(float width)
     Gets width attribute value.

Field Detail
area
protected String area(Code)
Output Area of Interest (AOI) area.



background
protected String background(Code)
Output background color.



converter
protected SVGConverter converter(Code)
Converter object used to convert SVG images to raster images.



destDir
protected File destDir(Code)
Destination directory for output images.



destFile
protected File destFile(Code)
Destination image path.



dpi
protected float dpi(Code)
Output pixel size - dots per inch.



filesets
protected Vector filesets(Code)
Contents of fileset elements.



height
protected float height(Code)
Output image height.



language
protected String language(Code)
Output image language.



maxHeight
protected float maxHeight(Code)
Maximum output image height.



maxWidth
protected float maxWidth(Code)
Maximum output image width.



mediaType
protected String mediaType(Code)
Media type of CSS file used to produce output images.



quality
protected float quality(Code)
Output image quality.



readerClassName
protected String readerClassName(Code)
XML parser class currently in use.



resultType
protected DestinationType resultType(Code)
Result image type. The default is PNG.



srcDir
protected File srcDir(Code)
Source directory of images.



srcFile
protected File srcFile(Code)
Source image path.



width
protected float width(Code)
Output image width.




Constructor Detail
RasterizerTask
public RasterizerTask()(Code)
Initializes a new rasterizer task.




Method Detail
addFileset
public void addFileset(FileSet set)(Code)
Reads fileset elements.

fileset elements can be used when there are many files to be rasterized.


Parameters:
  set - fileset elements



allowedToSetQuality
protected boolean allowedToSetQuality(DestinationType type)(Code)
Checks if the quality value can be set. Only result image type is checked.
Parameters:
  type - Result image type. true if the quality can be set and false otherwise.



execute
public void execute() throws BuildException(Code)
Validates and sets input values and files, then starts the conversion process.

See Ant documentation to find out more about the meaning of execute in Ant task.


throws:
  BuildException - Parameters are not set correctly or the conversion fails.



getAreaOfInterest
protected Rectangle2D getAreaOfInterest(String area) throws BuildException(Code)
Returns a valid Area of Interest (AOI) as a Rectangle2D object.
Parameters:
  area - AOI input area. A valid AOI rectangle.
throws:
  BuildException - AOI area is invalid.



getBackgroundColor
protected Color getBackgroundColor(String argb) throws BuildException(Code)
Returns a valid background color object.
Parameters:
  argb - String containing color channel values. A valid background color.
throws:
  BuildException - Input value is invalid.



getQuality
protected float getQuality(float quality) throws BuildException(Code)
Returns a valid quality value.
Parameters:
  quality - Input quality value to be tested. Valid quality value.
throws:
  BuildException - Input quality value is not valid.



getResultType
protected DestinationType getResultType(String type)(Code)
Returns the correct result image type object.
Parameters:
  type - Result image type as a string. Result image type as an object or null if the parameter doesn't have corresponding object.



getSourceFiles
protected String[] getSourceFiles()(Code)
Gets source files from the task parameters and child elements, combines those to a one list, and returns the list. Array of source filename strings.



setArea
public void setArea(String area)(Code)
Gets area attribute value.

The value have to be four integers separated with whitespaces or commas. The attribute is optional.


Parameters:
  area - Attribute value.



setBg
public void setBg(String bg)(Code)
Gets bg attribute value.

The value have to be three or four integers separated with whitespaces or commas. The attribute is optional.


Parameters:
  bg - Attribute value.



setClassname
public void setClassname(String value)(Code)
Sets classname of an XML parser. The attribute is optional.
Parameters:
  value - Java classname of an XML parser.



setDest
public void setDest(File file)(Code)
Gets dest attribute value.

The attribute have to have a value when src attribute has a value.


Parameters:
  file - Attribute value.



setDestdir
public void setDestdir(File dir)(Code)
Gets destdir attribute value.

This attribute have to have a value if either srcdir attribute or fileset elements exists.


Parameters:
  dir - Attribute value.



setDpi
public void setDpi(float dpi)(Code)
Gets dpi attribute value.

The value have to be a positive float. The attribute is optional.


Parameters:
  dpi - Attribute value.



setHeight
public void setHeight(float height)(Code)
Gets height attribute value.

The attribute is optional.


Parameters:
  height - Attribute value.



setLang
public void setLang(String language)(Code)
Gets lang attribute value.

See SVG specification for valid values. The attribute is optional.


Parameters:
  lang - Attribute value.



setMaxheight
public void setMaxheight(float height)(Code)
Gets maxheight attribute value.

The attribute is optional.


Parameters:
  height - Attribute value.



setMaxwidth
public void setMaxwidth(float width)(Code)
Gets maxwidth attribute value.

The attribute is optional.


Parameters:
  width - Attribute value.



setMedia
public void setMedia(ValidMediaTypes media)(Code)
Gets media attribute value.

The value have to a media type defined in CSS2 specifications. Only visual media group is supported.


Parameters:
  media - Attribute value.



setQuality
public void setQuality(float quality)(Code)
Gets quality attribute value.

The value have to be a float between 0 and 1 excluded. The attribute is optional.


Parameters:
  quality - Attribute value.



setRasterizingParameters
protected void setRasterizingParameters() throws BuildException(Code)
Checks and sets parameter values to the converter.

Some invalid values are just swallowed and default values are used instead. This is done when the invalid value cannot be correctly differentiated from the default value and the default value doesn't cause any harm. BuildException is thrown if the invalid value is clearly recognized.


throws:
  BuildException - Invalid parameter value.



setResult
public void setResult(ValidImageTypes type)(Code)
Gets result attribute value.

See the documentation for valid values.


Parameters:
  type - Attribute value.



setSrc
public void setSrc(File file)(Code)
Gets src attribute value.

One of the following have to have a value: this attribute, srcdir attribute or fileset element.


Parameters:
  file - Attribute value.



setSrcdir
public void setSrcdir(File dir)(Code)
Gets srcdir attribute value.

If srcfile attribute doesn't have a value then either this attribute have to have a value or the element have to contain fileset elements.


Parameters:
  dir - Attribute value.



setWidth
public void setWidth(float width)(Code)
Gets width attribute value.

The attribute is optional.


Parameters:
  width - Attribute value.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.