Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.batik.gvt
Class TextSelectionTest  view TextSelectionTest download TextSelectionTest.java

java.lang.Object
  extended byorg.apache.batik.test.AbstractTest
      extended byorg.apache.batik.test.svg.AbstractRenderingAccuracyTest
          extended byorg.apache.batik.test.svg.SVGRenderingAccuracyTest
              extended byorg.apache.batik.test.svg.PreconfiguredRenderingTest
                  extended byorg.apache.batik.test.svg.SamplesRenderingTest
                      extended byorg.apache.batik.test.svg.JSVGRenderingAccuracyTest
                          extended byorg.apache.batik.gvt.TextSelectionTest
All Implemented Interfaces:
org.apache.batik.swing.JSVGCanvasHandler.Delegate, org.apache.batik.test.Test

public class TextSelectionTest
extends org.apache.batik.test.svg.JSVGRenderingAccuracyTest

This test validates that the text selection API's work properly.

Version:
$Id: TextSelectionTest.java,v 1.6 2005/04/01 02:28:16 deweese Exp $

Nested Class Summary
 
Nested classes inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
org.apache.batik.test.svg.SVGRenderingAccuracyTest.InternalPNGTranscoder
 
Field Summary
static java.lang.String CANDIDATE_DIR
           
protected  int end
           
static java.lang.String ENTRY_KEY_ERROR_DESCRIPTION
           
static java.lang.String ERROR_BAD_ID
          Error id doesn't reference an element {0} = id
static java.lang.String ERROR_CANNOT_READ_REF_URL
          Error when unable to read/open ref URL {0} = URL {1} = exception stack trace.
static java.lang.String ERROR_GETTING_SELECTION
          Error couldn't get selection highlight specified.
static java.lang.String ERROR_ID_NOT_TEXT
          Error id doesn't reference a text element {0} = id {1} = element referenced
static java.lang.String ERROR_NO_REFERENCE
          No Reference or Variation file to compaire with.
static java.lang.String ERROR_READING_SVG
          Error when unable to load requested SVG file {0} = file {1} = exception
static java.lang.String ERROR_WRONG_RESULT
          Result didn't match reference result.
static java.lang.String REFERENCE_DIR
          Directory for reference files
protected  int start
           
protected  java.lang.String textID
           
static java.lang.String VARIATION_DIR
           
 
Fields inherited from class org.apache.batik.test.svg.JSVGRenderingAccuracyTest
done, ERROR_SAVE_FAILED, failReport, fos, handler, srcURL
 
Fields inherited from class org.apache.batik.test.svg.SamplesRenderingTest
REF_IMAGE_PREFIX, REF_IMAGE_SUFFIX, SAVE_CANDIDATE_REFERENCE_PREFIX, SAVE_CANDIDATE_REFERENCE_SUFFIX, SAVE_VARIATION_PREFIX, SAVE_VARIATION_SUFFIX, SVG_URL_PREFIX, VARIATION_PREFIX, VARIATION_SUFFIX
 
Fields inherited from class org.apache.batik.test.svg.PreconfiguredRenderingTest
PATH_SEPARATOR, PNG_EXTENSION, SVG_EXTENSION, SVGZ_EXTENSION
 
Fields inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
ERROR_CANNOT_TRANSCODE_SVG, userLanguage, validate, VALIDATING_PARSER
 
Fields inherited from class org.apache.batik.test.svg.AbstractRenderingAccuracyTest
candidateReference, configuration, CONFIGURATION_RESOURCES, COULD_NOT_GENERATE_COMPARISON_IMAGES, COULD_NOT_LOAD_IMAGE, COULD_NOT_OPEN_VARIATION_URL, ENTRY_KEY_DIFFERENCE_IMAGE, ENTRY_KEY_INTERNAL_ERROR, ENTRY_KEY_REFERENCE_GENERATED_IMAGE_URI, ERROR_CANNOT_CREATE_TEMP_FILE, ERROR_CANNOT_CREATE_TEMP_FILE_STREAM, ERROR_CANNOT_OPEN_GENERATED_IMAGE, ERROR_CANNOT_OPEN_REFERENCE_IMAGE, ERROR_ERROR_WHILE_COMPARING_FILES, ERROR_SVG_RENDERING_NOT_ACCURATE, IMAGE_FILE_EXTENSION, IMAGE_TYPE_COMPARISON, IMAGE_TYPE_DIFF, refImgURL, saveVariation, svgURL, TEMP_FILE_PREFIX, TEMP_FILE_SUFFIX, tempDirectory, variationURL
 
Fields inherited from class org.apache.batik.test.AbstractTest
id, name, parent
 
Constructor Summary
TextSelectionTest(java.lang.String file, java.lang.String textID, java.lang.Integer start, java.lang.Integer end)
          Constructor.
 
Method Summary
 java.lang.String buildCandidateReferenceFile(java.lang.String svgDir, java.lang.String svgFile)
          Gives a chance to the subclass to control the construction of the candidateReference URL, which is built as: getCandidatereferencePrefix() + svgDir + getCandidatereferenceSuffix() + svgFile + PNG_EXTENSION
protected  java.lang.String buildRefImgURL(java.lang.String svgDir, java.lang.String svgFile)
          Gives a chance to the subclass to control the construction of the reference PNG file from the svgFile name The refImgURL is built as: getRefImagePrefix() + svgDir + getRefImageSuffix() + svgFile
 java.lang.String buildSaveVariationFile(java.lang.String svgDir, java.lang.String svgFile)
          Gives a chance to the subclass to control the construction of the saveVariation URL, which is built as: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + PNG_EXTENSION
 java.lang.String buildVariationURL(java.lang.String svgDir, java.lang.String svgFile)
          Gives a chance to the subclass to control the construction of the variation URL, which is built as: getVariationPrefix() + svgDir + getVariationSuffix() + svgFile + PNG_EXTENSION
 void canvasRendered(org.apache.batik.swing.JSVGCanvas canvas)
           
 org.apache.batik.swing.JSVGCanvasHandler createCanvasHandler()
           
 java.lang.String getName()
          Returns this Test's name
 void setId(java.lang.String id)
          For preconfigured tests, the configuration has to be derived from the test identifier.
 
Methods inherited from class org.apache.batik.test.svg.JSVGRenderingAccuracyTest
canvasDone, canvasInit, canvasLoaded, canvasUpdated, copyImage, encode, failure, fmt, scriptDone
 
Methods inherited from class org.apache.batik.test.svg.SamplesRenderingTest
getCandidateReferencePrefix, getCandidateReferenceSuffix, getRefImagePrefix, getRefImageSuffix, getSaveVariationPrefix, getSaveVariationSuffix, getSVGURLPrefix, getVariationPrefix, getVariationSuffix
 
Methods inherited from class org.apache.batik.test.svg.PreconfiguredRenderingTest
breakSVGFile, buildSVGURL, setFile
 
Methods inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
getTestImageTranscoder, getUserLanguage, getValidating, manipulateSVGDocument, setUserLanguage, setValidating
 
Methods inherited from class org.apache.batik.test.svg.AbstractRenderingAccuracyTest
buildDiffImage, compare, getCandidateReference, getImage, getImage, getNextTempFileName, getNextTempFileName, getSaveVariation, getTempDirectory, getURLFile, getVariationURL, imageToFile, makeCompareImage, makeRandomFileName, makeTempFileName, resolveURL, run, saveImage, saveImage, setCandidateReference, setConfig, setSaveVariation, setVariationURL
 
Methods inherited from class org.apache.batik.test.AbstractTest
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getParent, getQualifiedId, reportError, reportException, reportSuccess, runImpl, runImplBasic, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REFERENCE_DIR

public static final java.lang.String REFERENCE_DIR
Directory for reference files

See Also:
Constant Field Values

VARIATION_DIR

public static final java.lang.String VARIATION_DIR
See Also:
Constant Field Values

CANDIDATE_DIR

public static final java.lang.String CANDIDATE_DIR
See Also:
Constant Field Values

ERROR_READING_SVG

public static final java.lang.String ERROR_READING_SVG
Error when unable to load requested SVG file {0} = file {1} = exception

See Also:
Constant Field Values

ERROR_BAD_ID

public static final java.lang.String ERROR_BAD_ID
Error id doesn't reference an element {0} = id

See Also:
Constant Field Values

ERROR_ID_NOT_TEXT

public static final java.lang.String ERROR_ID_NOT_TEXT
Error id doesn't reference a text element {0} = id {1} = element referenced

See Also:
Constant Field Values

ERROR_GETTING_SELECTION

public static final java.lang.String ERROR_GETTING_SELECTION
Error couldn't get selection highlight specified. {0} = id {1} = start index {2} = end index {3} = exception

See Also:
Constant Field Values

ERROR_CANNOT_READ_REF_URL

public static final java.lang.String ERROR_CANNOT_READ_REF_URL
Error when unable to read/open ref URL {0} = URL {1} = exception stack trace.

See Also:
Constant Field Values

ERROR_WRONG_RESULT

public static final java.lang.String ERROR_WRONG_RESULT
Result didn't match reference result. {0} = first byte of mismatch

See Also:
Constant Field Values

ERROR_NO_REFERENCE

public static final java.lang.String ERROR_NO_REFERENCE
No Reference or Variation file to compaire with. {0} = reference url

See Also:
Constant Field Values

ENTRY_KEY_ERROR_DESCRIPTION

public static final java.lang.String ENTRY_KEY_ERROR_DESCRIPTION
See Also:
Constant Field Values

textID

protected java.lang.String textID

start

protected int start

end

protected int end
Constructor Detail

TextSelectionTest

public TextSelectionTest(java.lang.String file,
                         java.lang.String textID,
                         java.lang.Integer start,
                         java.lang.Integer end)
Constructor. ref is ignored if action == ROUND.

Method Detail

setId

public void setId(java.lang.String id)
Description copied from class: org.apache.batik.test.svg.PreconfiguredRenderingTest
For preconfigured tests, the configuration has to be derived from the test identifier. The identifier should characterize the SVG file to be tested.


buildRefImgURL

protected java.lang.String buildRefImgURL(java.lang.String svgDir,
                                          java.lang.String svgFile)
Description copied from class: org.apache.batik.test.svg.PreconfiguredRenderingTest
Gives a chance to the subclass to control the construction of the reference PNG file from the svgFile name The refImgURL is built as: getRefImagePrefix() + svgDir + getRefImageSuffix() + svgFile


buildVariationURL

public java.lang.String buildVariationURL(java.lang.String svgDir,
                                          java.lang.String svgFile)
Description copied from class: org.apache.batik.test.svg.PreconfiguredRenderingTest
Gives a chance to the subclass to control the construction of the variation URL, which is built as: getVariationPrefix() + svgDir + getVariationSuffix() + svgFile + PNG_EXTENSION


buildSaveVariationFile

public java.lang.String buildSaveVariationFile(java.lang.String svgDir,
                                               java.lang.String svgFile)
Description copied from class: org.apache.batik.test.svg.PreconfiguredRenderingTest
Gives a chance to the subclass to control the construction of the saveVariation URL, which is built as: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + PNG_EXTENSION


buildCandidateReferenceFile

public java.lang.String buildCandidateReferenceFile(java.lang.String svgDir,
                                                    java.lang.String svgFile)
Description copied from class: org.apache.batik.test.svg.PreconfiguredRenderingTest
Gives a chance to the subclass to control the construction of the candidateReference URL, which is built as: getCandidatereferencePrefix() + svgDir + getCandidatereferenceSuffix() + svgFile + PNG_EXTENSION


getName

public java.lang.String getName()
Returns this Test's name


createCanvasHandler

public org.apache.batik.swing.JSVGCanvasHandler createCanvasHandler()

canvasRendered

public void canvasRendered(org.apache.batik.swing.JSVGCanvas canvas)