|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.optional.laf.synth.SynthPreprocessor
public class SynthPreprocessor
Process a synth file to replace colors etc... with the styles
Copyright (c) Xoetrope Ltd., 2001-2005
License: see license.txt
$Revision: 1.13 $
| Constructor Summary | |
|---|---|
SynthPreprocessor()
Creates a new instance of SynthPreprocessor |
|
| Method Summary | |
|---|---|
protected java.lang.String |
convertSvg(java.lang.String name,
int width,
int height,
java.lang.String ext,
boolean isPng)
Converts an SVG file to a PNG or a TIFF file |
protected java.lang.String |
findAndReplace(java.util.Hashtable methodNames,
java.lang.String originalText)
Search and replace a function references embedded in the synth file |
protected java.lang.String |
getColorStyleAttribute(java.lang.String key,
int attrib,
boolean asColorResource)
Replace the tagged field |
protected java.lang.String |
getIndexedStyleAttribute(java.lang.String key,
int attrib,
java.lang.String[] values)
Replace the tagged field |
static SynthPreprocessor |
getInstance()
Get an instance of this preprocessor |
protected java.lang.String |
getPngForSvg(java.lang.String key)
Replace the tagged field and create a PNG file in place of the original SVG. |
protected java.lang.String |
getStyleAttribute(java.lang.String key,
int attrib)
Replace the tagged field |
protected java.lang.String |
getTiffForSvg(java.lang.String key)
Replace the tagged field and create a TIFF file in place of the original SVG. |
java.lang.String |
process(java.io.BufferedInputStream is)
Read the file from the input stream, do any substitutions required and return the processed file as a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SynthPreprocessor()
| Method Detail |
|---|
public static SynthPreprocessor getInstance()
public java.lang.String process(java.io.BufferedInputStream is)
throws java.io.IOException
process in interface FilePreprocessoris - the input stream
java.io.IOException - problems reading the input stream
protected java.lang.String findAndReplace(java.util.Hashtable methodNames,
java.lang.String originalText)
methodNames - the table of methods to find and replaceoriginalText - the original config file text
protected java.lang.String getStyleAttribute(java.lang.String key,
int attrib)
key - the style nameattrib - the attribute to lookup in the style
protected java.lang.String getColorStyleAttribute(java.lang.String key,
int attrib,
boolean asColorResource)
key - the argument value to replaceattrib - the attribute to lookup in the styleasColorResource - output the colour as a ColorUIResource
protected java.lang.String getIndexedStyleAttribute(java.lang.String key,
int attrib,
java.lang.String[] values)
key - the style nameattrib - the attribute to lookup in the stylevalues - the values array into which the attribute indexes
protected java.lang.String getPngForSvg(java.lang.String key)
key - the style name
protected java.lang.String getTiffForSvg(java.lang.String key)
key - the style name
protected java.lang.String convertSvg(java.lang.String name,
int width,
int height,
java.lang.String ext,
boolean isPng)
name - the file namewidth - the target image widthheight - the targetimage heightext - the converted file extensionisPng - true for a png file, false for a tiff file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||