|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface GraphicFactory
Factory allowing to create Graphic objects.
Such factories must be registered with XMLmind XSL-FO Converter
using GraphicFactories.register(com.xmlmind.fo.graphic.GraphicFactory).
The implementations of this interface are expected to be thread-safe.
| Method Summary | |
|---|---|
Graphic |
convertGraphic(Graphic graphic,
String format,
double xScale,
double yScale,
Object clientData,
GraphicEnv env)
Converts specified graphic to specified format, while optionally rescaling it. |
Graphic |
createGraphic(String location,
String format,
Object clientData,
GraphicEnv env)
Creates a graphic which represents the illustration stored as specified location. |
String[] |
getInputFormats()
Returns the list of input MIME types supported by createGraphic(java.lang.String, java.lang.String, java.lang.Object, com.xmlmind.fo.graphic.GraphicEnv). |
String |
getName()
Returns the name of this factory. |
String[] |
getOutputFormats()
Returns the list of output MIME types supported by convertGraphic(com.xmlmind.fo.graphic.Graphic, java.lang.String, double, double, java.lang.Object, com.xmlmind.fo.graphic.GraphicEnv). |
String |
getParameter(String name)
Returns the value of the parameter having specified name. |
void |
setParameter(String name,
String value)
Sets parameter having specified name and specified value. |
| Method Detail |
|---|
String getName()
void setParameter(String name,
String value)
throws IllegalArgumentException
name - name of the parametervalue - value of the parameter.
Specify null to restore the default value of parameter
name
IllegalArgumentException - if specified parameter is unknown or
if specified value is invalid.getParameter(java.lang.String)String getParameter(String name)
null if the parameter is unknown.
name - name of the parametersetParameter(java.lang.String, java.lang.String)String[] getInputFormats()
createGraphic(java.lang.String, java.lang.String, java.lang.Object, com.xmlmind.fo.graphic.GraphicEnv).
String[] getOutputFormats()
convertGraphic(com.xmlmind.fo.graphic.Graphic, java.lang.String, double, double, java.lang.Object, com.xmlmind.fo.graphic.GraphicEnv).
In order to be useful to XMLmind XSL-FO Converter, a factory must return one or more of "image/png", "image/x-wmf", "image/x-emf".
Graphic createGraphic(String location,
String format,
Object clientData,
GraphicEnv env)
throws Exception
IMPORTANT: the created Graphic must bear the resolution information stored in the source located by location. If this source does not contain any resolution information then the resolution fields of created Graphic must be set to 0.
location - location of the graphic file.
The string form of an URL. May be a "data:" URL.format - MIME type of the image to be created.
This format is guaranteed to be listed by getInputFormats().clientData - opaque client data to be associated with the
newly created graphicenv - services provided by XMLmind XSL-FO Converter
Exception - if, for any reason, this method fails
Graphic convertGraphic(Graphic graphic,
String format,
double xScale,
double yScale,
Object clientData,
GraphicEnv env)
throws Exception
Even when there is apparently nothing to do (that is, same format, no scaling), this method saves a copy of graphic and returns the saved copy. This method never returns graphic.
IMPORTANT: if graphic has resolution information and if image format format allows to store this information, then this resolution information must be stored in the source of the newly created Graphic.
graphic - graphic to be convertedformat - MIME type of the image to be created.
This format is guaranteed to be listed by getOutputFormats().xScale - scaling factor to apply to the width of graphicyScale - scaling factor to apply to the height of graphicclientData - opaque client data to be associated with the
newly created graphicenv - services provided by XMLmind XSL-FO Converter
Exception - if, for any reason, this method fails
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||