diff --git a/java/PrimaDla/.classpath b/java/PrimaDla/.classpath new file mode 100644 index 00000000..5c595b59 --- /dev/null +++ b/java/PrimaDla/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/java/PrimaDla/.project b/java/PrimaDla/.project new file mode 100644 index 00000000..c500c236 --- /dev/null +++ b/java/PrimaDla/.project @@ -0,0 +1,20 @@ + + + PrimaDla + + + PrimaBasic + PrimaIo + PrimaMaths + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/java/PrimaDla/apidoc/allclasses-frame.html b/java/PrimaDla/apidoc/allclasses-frame.html new file mode 100644 index 00000000..2ec2ab85 --- /dev/null +++ b/java/PrimaDla/apidoc/allclasses-frame.html @@ -0,0 +1,103 @@ + + + + + +All Classes (PrimaDla API) + + + + +

All Classes

+
+ +
+ + diff --git a/java/PrimaDla/apidoc/allclasses-noframe.html b/java/PrimaDla/apidoc/allclasses-noframe.html new file mode 100644 index 00000000..abd885ac --- /dev/null +++ b/java/PrimaDla/apidoc/allclasses-noframe.html @@ -0,0 +1,103 @@ + + + + + +All Classes (PrimaDla API) + + + + +

All Classes

+
+ +
+ + diff --git a/java/PrimaDla/apidoc/constant-values.html b/java/PrimaDla/apidoc/constant-values.html new file mode 100644 index 00000000..db71476c --- /dev/null +++ b/java/PrimaDla/apidoc/constant-values.html @@ -0,0 +1,1006 @@ + + + + + +Constant Field Values (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

org.primaresearch.*

+ + + + +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/deprecated-list.html b/java/PrimaDla/apidoc/deprecated-list.html new file mode 100644 index 00000000..b78bc2c4 --- /dev/null +++ b/java/PrimaDla/apidoc/deprecated-list.html @@ -0,0 +1,116 @@ + + + + + +Deprecated List (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/help-doc.html b/java/PrimaDla/apidoc/help-doc.html new file mode 100644 index 00000000..48766f5e --- /dev/null +++ b/java/PrimaDla/apidoc/help-doc.html @@ -0,0 +1,221 @@ + + + + + +API Help (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/index-all.html b/java/PrimaDla/apidoc/index-all.html new file mode 100644 index 00000000..06cc6090 --- /dev/null +++ b/java/PrimaDla/apidoc/index-all.html @@ -0,0 +1,2702 @@ + + + + + +Index (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
A C D E F G H I J L M N O P R S T U V W X  + + +

A

+
+
add(GroupMember) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Adds the given group member
+
+
addConverter(LayoutConverter) - Method in class org.primaresearch.dla.page.layout.converter.ChainConverter
+
+
Adds a converter to the chain
+
+
addDefaultSchemas() - Method in class org.primaresearch.dla.page.io.xml.PageXmlModelAndValidatorProvider
+
+
Adds the internal default schemas to the list of schema sources.
+
+
addRegion(Region) - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
addRegion(Region) - Method in interface org.primaresearch.dla.page.layout.physical.RegionContainer
+
+
Adds a nested region
+
+
addRegionRef(String) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Adds a reference to a region as group member
+
+
addRelation(ContentObjectRelation) - Method in class org.primaresearch.dla.page.layout.logical.Relations
+
+
Adds a relation to this container.
+
+
addTextObject(LowLevelTextObject) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
addTextObject(LowLevelTextObject) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
addTextObject(LowLevelTextObject) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
addTextObject(LowLevelTextObject) - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Adds a child text object
+
+
addTextObject(LowLevelTextObject) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
AdvertRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for advert regions.
+
+
AdvertRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.AdvertRegion
+
 
+
AdvertRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For advertisements
+
+
ATTR_bgColour - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_bold - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_borderPresent - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_caption - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_colour - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_colourDepth - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_columns - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_comments - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_conf - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_custom - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_embText - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_filename - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_fontSize - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_id - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_imageFilename - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_imageHeight - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_imageWidth - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_indented - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_index - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_italic - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_kerning - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_language - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_leading - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_letterSpaced - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_ligature - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_lineColour - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_lineSeparators - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_numColours - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_orientation - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_pcGtsId - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_penColour - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_points - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_primaryLanguage - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_primaryScript - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_readingDirection - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_readingOrientation - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_regionRef - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_reverseVideo - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_rows - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_secondaryLanguage - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_secondaryScript - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_smallCaps - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_strikethrough - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_subscript - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_superscript - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_symbol - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_textColour - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_type - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_underlined - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_x - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_y - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ATTR_zIndex - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
AttributeContainer - Interface in org.primaresearch.dla.page.layout.physical
+
+
Represents an object that can have Attributes.
+
+
AttributeFactory - Interface in org.primaresearch.dla.page.layout.physical
+
+
Interface for factories that create attribute collections for page content objects.
+
+
+ + + +

C

+
+
CAPTION - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
CATCH_WORD - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
ChainConverter - Class in org.primaresearch.dla.page.layout.converter
+
+
Meta converter representing a chain of converters.
+
+
ChainConverter() - Constructor for class org.primaresearch.dla.page.layout.converter.ChainConverter
+
 
+
changeTypeOfRegion(ContentObject, RegionType) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Creates a region object with the id of the given object and the new region type.
+
+
characters(char[], int, int) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2010_03_19
+
+
Receive notification of character data inside an element.
+
+
characters(char[], int, int) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2013_07_15
+
+
Receive notification of character data inside an element.
+
+
characters(char[], int, int) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_AbbyyFineReader10
+
+
Receive notification of character data inside an element.
+
+
characters(char[], int, int) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Alto_2_1
+
+
Receive notification of character data inside an element.
+
+
characters(char[], int, int) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Hocr
+
+
Receive notification of character data inside an element.
+
+
characters(char[], int, int) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerLegacy
+
+
Receive notification of character data inside an element.
+
+
ChartRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for chart regions.
+
+
ChartRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
ChartRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For charts
+
+
checkForCompliance(PageLayout) - Method in class org.primaresearch.dla.page.layout.converter.ChainConverter
+
 
+
checkForCompliance(PageLayout) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16
+
 
+
checkForCompliance(PageLayout) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12
+
 
+
checkForCompliance(PageLayout) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19
+
 
+
checkForCompliance(Page, FormatVersion) - Static method in class org.primaresearch.dla.page.layout.converter.ConverterHub
+
+
Checks if the given page (layout) complies with specified target format.
+
+
checkForCompliance(PageLayout) - Method in interface org.primaresearch.dla.page.layout.converter.LayoutConverter
+
+
Checks if the given page layout is consistent to the target format version + of this converter.
+
+
ChemRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for chemical formula regions.
+
+
ChemRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.ChemRegion
+
 
+
ChemRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For chemical notations
+
+
compare(GeometricObject, GeometricObject) - Method in class org.primaresearch.dla.page.layout.GeometricObjectPositionComparator
+
 
+
composeText(boolean, boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
composeText(boolean, boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
composeText(boolean, boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
composeText(boolean, boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Composes the text for this object using the child text objects.
+
+
contains(Id) - Method in class org.primaresearch.dla.page.layout.logical.ReadingOrder
+
+
Checks the the region with the given ID is referenced in the reading order.
+
+
containsRegionRef(Id) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Recursively checks if this group or a child group contains a region reference with the given ID.
+
+
ContentFactory - Class in org.primaresearch.dla.page.layout.physical
+
+
Factory for creating page content objects.
+
+
ContentFactory(IdRegister, AttributeFactory) - Constructor for class org.primaresearch.dla.page.layout.physical.ContentFactory
+
+
Constructor
+
+
ContentIterator - Interface in org.primaresearch.dla.page.layout.physical
+
+
Iterator for all page content objects of a specified type
+
+
ContentObject - Interface in org.primaresearch.dla.page.layout.physical
+
+
Represents physical page content objects (e.g.
+
+
ContentObjectProcessor - Class in org.primaresearch.dla.page.layout.physical
+
+
Processes all content objects of a page using a customisable processing method.
+
+
ContentObjectProcessor() - Constructor for class org.primaresearch.dla.page.layout.physical.ContentObjectProcessor
+
 
+
ContentObjectRelation - Class in org.primaresearch.dla.page.layout.logical
+
+
Represents a relation between two page content objects (e.g.
+
+
ContentObjectRelation(ContentObject, ContentObject, ContentObjectRelation.RelationType) - Constructor for class org.primaresearch.dla.page.layout.logical.ContentObjectRelation
+
+
Constructor
+
+
ContentObjectRelation.RelationType - Class in org.primaresearch.dla.page.layout.logical
+
+
Relation type for page content objects.
+
+
contentType - Variable in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
ContentType - Class in org.primaresearch.dla.page.layout.physical.shared
+
+
Base class for different types of page content.
+
+
ContentType() - Constructor for class org.primaresearch.dla.page.layout.physical.shared.ContentType
+
+
Empty constructor (required for GWT)
+
+
ContentType(String) - Constructor for class org.primaresearch.dla.page.layout.physical.shared.ContentType
+
+
Constructor
+
+
CONVERSION_ADD_REQUIRED_REGION - Static variable in class org.primaresearch.dla.page.layout.converter.ConversionMessage
+
 
+
CONVERSION_GENERAL - Static variable in class org.primaresearch.dla.page.layout.converter.ConversionMessage
+
 
+
CONVERSION_RESET_INVALID_ATTRIBUTE - Static variable in class org.primaresearch.dla.page.layout.converter.ConversionMessage
+
 
+
ConversionMessage - Class in org.primaresearch.dla.page.layout.converter
+
+
Format conversion related message
+
+
ConversionMessage(String) - Constructor for class org.primaresearch.dla.page.layout.converter.ConversionMessage
+
+
Constructor for general message
+
+
ConversionMessage(String, int) - Constructor for class org.primaresearch.dla.page.layout.converter.ConversionMessage
+
+
Constructor for specific message code
+
+
convert(PageLayout) - Method in class org.primaresearch.dla.page.layout.converter.ChainConverter
+
 
+
convert(PageLayout) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16
+
 
+
convert(PageLayout) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12
+
 
+
convert(PageLayout) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19
+
 
+
convert(Page, FormatModel) - Static method in class org.primaresearch.dla.page.layout.converter.ConverterHub
+
+
Converts the given page (layout) to the specified target format (might change attributes, attribute values and attribute constraints).
+
+
convert(PageLayout) - Method in interface org.primaresearch.dla.page.layout.converter.LayoutConverter
+
+
Converts the given page layout to the specified target format.
+
+
Converter_2010_01_12_to_2009_03_16 - Class in org.primaresearch.dla.page.layout.converter
+
+
Converter for 2010-01-12 format to 2009-03-16 format.
+
+ + Adds temp region if there is no region (at least one region required) +
+
+
Converter_2010_01_12_to_2009_03_16() - Constructor for class org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16
+
 
+
Converter_2010_03_19_to_2010_01_12 - Class in org.primaresearch.dla.page.layout.converter
+
+
Converter for 2010-03-19 format to 2010-01-12 format.
+
+ + Removes unsupported text types (signature-mark, catch-word, marginalia, footnote, footnote-continued, TOC-entry) +
+
+
Converter_2010_03_19_to_2010_01_12() - Constructor for class org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12
+
 
+
Converter_2013_07_15_to_2010_03_19 - Class in org.primaresearch.dla.page.layout.converter
+
+
Converter for 2013-07-15 format to 2010-03-19 format.
+
+ + Removes unsupported graphic types (frame, barcode, decoration) + Removes unsupported text types (endnote, other) + Removes unsupported colours (other) + Removes unsupported languages + Converts unsupported regions to 'Unknown' (Music, Chem, Advert) + Removes unsupported attributes from regions, lines, words, and glyphs +
+
+
Converter_2013_07_15_to_2010_03_19() - Constructor for class org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19
+
 
+
ConverterHub - Class in org.primaresearch.dla.page.layout.converter
+
+
Central access point for converting page objects to specific format versions.
+
+
createAttributes(ContentType) - Method in interface org.primaresearch.dla.page.layout.physical.AttributeFactory
+
+
Returns a collection of attributes suitable for content objects of the given type.
+
+
createAttributes(ContentType) - Method in class org.primaresearch.dla.page.layout.physical.DefaultAttributeFactory
+
 
+
createChildGroup() - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Creates a group and adds it as child to this group
+
+
createContent(ContentType) - Method in class org.primaresearch.dla.page.layout.physical.ContentFactory
+
+
Creates a new content object of the given type
+
+
createGlyph() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
createGlyph(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
+
Creates a new glyph object and adds it to this word
+
+
createHandler(XmlModelAndValidatorProvider, XmlFormatVersion) - Static method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerFactory
+
+
Creates a handler for the given format
+
+
createLayer() - Method in class org.primaresearch.dla.page.layout.logical.Layers
+
+
Creates and returns a new layer.
+
+
createLayers() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Creates and returns a new layers object for the layout.
+
+
createLayers(PageLayout) - Method in class org.primaresearch.dla.page.layout.physical.ContentFactory
+
+
Creates a layer container
+
+
createReadingOrder() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Creates and returns a new reading order for the layout.
+
+
createReadingOrder(PageLayout) - Method in class org.primaresearch.dla.page.layout.physical.ContentFactory
+
+
Creates a reading order object
+
+
createRegion(RegionType) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Creates a region of the specified type.
+
+
createRegion(RegionType, String) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Creates a region of the specified type.
+
+
createRegion(RegionType, String, RegionContainer) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Creates a region of the specified type.
+
+
createTextLine() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
+
Creates a child text line
+
+
createTextLine(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
+
Creates a new text line object and adds it to this text region
+
+
createWord() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
createWord(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
+
Creates a new word object and adds it to this text line.
+
+
CREDIT - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
currentNestedRegionIterator - Variable in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
+ + + +

D

+
+
DATE_FORMAT - Static variable in class org.primaresearch.dla.page.MetaData
+
 
+
DefaultAttributeFactory - Class in org.primaresearch.dla.page.layout.physical
+
+
Attribute factory for the default layout content types of PAGE (static/dynamic).
+
+ In static mode types and attributes are hard coded.
+
+
DefaultAttributeFactory() - Constructor for class org.primaresearch.dla.page.layout.physical.DefaultAttributeFactory
+
+
Constructor for static use
+
+
DefaultAttributeFactory(FormatModel) - Constructor for class org.primaresearch.dla.page.layout.physical.DefaultAttributeFactory
+
+
Constructor for dynamic use.
+
+
DefaultTextRegionTypes - Interface in org.primaresearch.dla.page.layout.physical.text.impl
+
+
Collection of text region sub-types in compliance with the PAGE XML schema (version 2013-07-15).
+
+
DefaultXmlNames - Class in org.primaresearch.dla.page.io.xml
+
+
Class containing hard coded XML element and attribute names for the PAGE format.
+
+
DefaultXmlNames() - Constructor for class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
delete(GroupMember) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Deletes a group member.
+
+
doProcess(ContentObject) - Method in class org.primaresearch.dla.page.layout.physical.ContentObjectProcessor
+
+
Called for each content object.
+
+
DROP_CAPITAL - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
+ + + +

E

+
+
ELEMENT_AdvertRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_AlternativeImage - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Baseline - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Border - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_ChartRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_ChemRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Comments - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Coords - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Created - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Creator - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_FrameRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Glyph - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_GraphicRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_ImageRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_LastChange - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Layer - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Layers - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_LineDrawingRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_MathsRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Metadata - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_MusicRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_NoiseRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_OrderedGroup - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_OrderedGroupIndexed - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Page - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_PcGts - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_PlainText - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Point - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_PrintSpace - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_ReadingOrder - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_RegionRef - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_RegionRefIndexed - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Relation - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Relations - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_SeparatorRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_TableRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_TextEquiv - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_TextLine - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_TextRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_TextStyle - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Unicode - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_UnknownRegion - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_UnorderedGroup - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_UnorderedGroupIndexed - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
ELEMENT_Word - Static variable in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
endElement(String, String, String) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2010_03_19
+
+
Receive notification of the end of an element.
+
+
endElement(String, String, String) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2013_07_15
+
+
Receive notification of the end of an element.
+
+
endElement(String, String, String) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_AbbyyFineReader10
+
+
Receive notification of the end of an element.
+
+
endElement(String, String, String) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Alto_2_1
+
+
Receive notification of the end of an element.
+
+
endElement(String, String, String) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Hocr
+
+
Receive notification of the end of an element.
+
+
endElement(String, String, String) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerLegacy
+
+
Receive notification of the end of an element.
+
+
ENDNOTE - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
equals(Object) - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType
+
 
+
equals(ContentType) - Method in class org.primaresearch.dla.page.layout.physical.shared.ContentType
+
 
+
equals(Object) - Method in class org.primaresearch.dla.page.Page.MeasurementUnit
+
 
+
error(SAXParseException) - Method in class org.primaresearch.dla.page.io.xml.PageErrorHandler
+
 
+
exportRelations() - Method in class org.primaresearch.dla.page.layout.logical.Relations
+
+
Exports a set of all relations.
+
+
+ + + +

F

+
+
fatalError(SAXParseException) - Method in class org.primaresearch.dla.page.io.xml.PageErrorHandler
+
 
+
FileInput - Class in org.primaresearch.dla.page.io
+
+
Input source implementation for files
+
+
FileInput(File) - Constructor for class org.primaresearch.dla.page.io.FileInput
+
 
+
FileTarget - Class in org.primaresearch.dla.page.io
+
+
OutputTarget implementation for files.
+
+
FileTarget(File) - Constructor for class org.primaresearch.dla.page.io.FileTarget
+
 
+
FLOATING - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
FOOTER - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
FOOTNOTE - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
FOOTNOTE_CONTINUED - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
FrameRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for frame regions.
+
+
FrameRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.FrameRegion
+
 
+
+ + + +

G

+
+
GeometricObject - Interface in org.primaresearch.dla.page.layout.shared
+
+
Interface for any object that can be located on a page (e.g.
+
+
GeometricObjectImpl - Class in org.primaresearch.dla.page.layout
+
+
Basic implementation of an object that can be located on the document page.
+
+
GeometricObjectImpl(Polygon) - Constructor for class org.primaresearch.dla.page.layout.GeometricObjectImpl
+
+
Constructor
+
+
GeometricObjectPositionComparator - Class in org.primaresearch.dla.page.layout
+
+
Comparator to sort geometric objects by bounding box position (left or top).
+
+
getAlternativeImages() - Method in class org.primaresearch.dla.page.Page
+
+
Returns a list of alternative images that are associated with this page (e.g.
+
+
getAttributes() - Method in interface org.primaresearch.dla.page.layout.physical.AttributeContainer
+
+
Returns the attributes of the object.
+
+
getAttributes() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
getAttributes() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
getAttributes() - Method in class org.primaresearch.dla.page.Page
+
 
+
getBaseline() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
+
Returns the baseline attached to this text line.
+
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.AdvertRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.ChemRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.FrameRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.MathsRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.MusicRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
getBgColour() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getBorder() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the page border object
+
+
getCaption() - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Returns the caption (display name)
+
+
getChartType() - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
getCode() - Method in class org.primaresearch.dla.page.layout.converter.ConversionMessage
+
+
Returns the message code (see CONVERSION_... constants)
+
+
getColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion
+
 
+
getColourDepth() - Method in class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
getComments() - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation
+
+
Returns comments
+
+
getComments() - Method in class org.primaresearch.dla.page.MetaData
+
+
Returns comments (generic)
+
+
getComments() - Method in class org.primaresearch.dla.page.Page.AlternativeImage
+
 
+
getConfidence() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getConfidence() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
getConfidence() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Returns the OCR confidence for the text content.
+
+
getContentType() - Method in interface org.primaresearch.dla.page.layout.physical.ContentIterator
+
+
Returns the content type of the page content objects this iterator was created for.
+
+
getContentType() - Method in class org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator
+
 
+
getContentType() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
getConversionInformation() - Method in interface org.primaresearch.dla.page.io.xml.XmlPageWriter
+
+
Returns format conversion related messages
+
+
getConversionInformation() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
 
+
getConversionInformation() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
 
+
getCoords() - Method in class org.primaresearch.dla.page.layout.GeometricObjectImpl
+
 
+
getCoords() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
getCoords() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
getCoords() - Method in interface org.primaresearch.dla.page.layout.shared.GeometricObject
+
+
Returns the location of the object.
+
+
getCreationTime() - Method in class org.primaresearch.dla.page.MetaData
+
+
Returns the creation date/time
+
+
getCreator() - Method in class org.primaresearch.dla.page.MetaData
+
+
Returns the creating person, institution, and/or tool
+
+
getCurrentObject() - Method in class org.primaresearch.dla.page.layout.physical.ContentObjectProcessor
+
+
Returns the content object that is currently processed.
+
+
getCustomField() - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation
+
+
Returns custom content
+
+
getDiscreteValuesPerInch() - Method in class org.primaresearch.dla.page.Page.MeasurementUnit
+
 
+
getErrors() - Method in class org.primaresearch.dla.page.io.xml.PageErrorHandler
+
+
Returns all registered errors
+
+
getErrors() - Method in class org.primaresearch.dla.page.io.xml.XmlPageReader
+
+
Returns a list of errors that occurred on the last call of read().
+
+
getErrors() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
 
+
getErrors() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
+
Returns a list of writing errors
+
+
getFile() - Method in class org.primaresearch.dla.page.io.FileInput
+
 
+
getFile() - Method in class org.primaresearch.dla.page.io.FileTarget
+
 
+
getFilename() - Method in class org.primaresearch.dla.page.Page.AlternativeImage
+
 
+
getFontSize() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getFormatModel(FormatVersion) - Method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
 
+
getFormattedCreationTime() - Method in class org.primaresearch.dla.page.MetaData
+
+
Returns the creation date/time
+
+
getFormattedLastModificationTime() - Method in class org.primaresearch.dla.page.MetaData
+
+
Returns the modification date/time
+
+
getFormatVersion() - Method in class org.primaresearch.dla.page.Page
+
+
Returns the version of the page format.
+
+
getGraphicType() - Method in class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
getGtsId() - Method in class org.primaresearch.dla.page.Page
+
+
Returns the ground truth and storage ID of this page
+
+
getHeight() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the page height.
+
+
getId() - Method in class org.primaresearch.dla.page.layout.logical.Group
+
 
+
getId() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
getId() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
getIdRegister() - Method in class org.primaresearch.dla.page.layout.logical.Group
+
 
+
getIdRegister() - Method in class org.primaresearch.dla.page.layout.physical.ContentFactory
+
+
Sets the ID register that is used for creating new objects
+
+
getIdRegister() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
getIdRegister() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
getImageFilename() - Method in class org.primaresearch.dla.page.Page
+
+
Returns the main image file that is associated with this page.
+
+
getInstance() - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Returns the instance of the singleton.
+
+
getInstance() - Static method in class org.primaresearch.dla.page.layout.converter.ConverterHub
+
+
Returns singleton instance
+
+
getInstance(boolean) - Static method in class org.primaresearch.dla.page.layout.GeometricObjectPositionComparator
+
+
Creates a comparator
+
+
getKerning() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getLanguage() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
getLastModificationTime() - Method in class org.primaresearch.dla.page.MetaData
+
+
Returns the modification date/time
+
+
getLatestSchemaModel() - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Returns the model of the latest XML schema.
+
+
getLayer(int) - Method in class org.primaresearch.dla.page.layout.logical.Layers
+
+
Returns the layer at the given index.
+
+
getLayer() - Method in interface org.primaresearch.dla.page.layout.physical.ContentIterator
+
+
Returns the layer this iterator is restricted to (no null for no restriction)
+
+
getLayer() - Method in class org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator
+
 
+
getLayer() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
getLayers() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the layers of the layout.
+
+
getLayout() - Method in class org.primaresearch.dla.page.Page
+
+
Returns the page layout
+
+
getLeading() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getLineColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
getMeasurementUnit() - Method in class org.primaresearch.dla.page.Page
+
+
Returns the measurement unit for coordinates
+
+
getMember(int) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Returns the group member at the given position
+
+
getMetaData() - Method in class org.primaresearch.dla.page.Page
+
+
Returns the page metadata
+
+
getName() - Method in class org.primaresearch.dla.page.layout.physical.shared.ContentType
+
+
Returns the name of this type
+
+
getName() - Method in class org.primaresearch.dla.page.Page.MeasurementUnit
+
 
+
getNamespace() - Method in interface org.primaresearch.dla.page.io.xml.XmlPageWriter
+
+
Returns the name space.
+
+
getNamespace() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
 
+
getNamespace() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
 
+
getNumberOfColumns() - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
getNumberOfRows() - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
getNumColours() - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
getNumColours() - Method in class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
getObject(ContentType, String) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the content object of given type and ID
+
+
getObject1() - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation
+
 
+
getObject2() - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation
+
 
+
getObjectAt(int, int, ContentType) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Looks for a content object of a specific type at the given position within the document page.
+
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.AdvertRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.ChemRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.MathsRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.MusicRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
getOrientation() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getOutputStream() - Method in class org.primaresearch.dla.page.io.xml.StreamTarget
+
 
+
getPageObject() - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler
+
+
Returns the page object that has been created from XML
+
+
getPageObject() - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2010_03_19
+
 
+
getPageObject() - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2013_07_15
+
 
+
getPageObject() - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_AbbyyFineReader10
+
 
+
getPageObject() - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Alto_2_1
+
 
+
getPageObject() - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Hocr
+
 
+
getPageObject() - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerLegacy
+
 
+
getParent() - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Returns the parent of this group or null if it is a root group
+
+
getParent() - Method in interface org.primaresearch.dla.page.layout.logical.GroupMember
+
+
Returns the parent group
+
+
getParent() - Method in class org.primaresearch.dla.page.layout.logical.RegionRef
+
 
+
getParent() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
getParentChildRelation(ContentType, String) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns a parent-child relation object
+
+
getParentRegion() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
getParentRegion() - Method in interface org.primaresearch.dla.page.layout.physical.Region
+
+
Returns the parent region if this is a nested region or null if it has no parent
+
+
getPenColour() - Method in class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
getPlainText() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getPlainText() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
getPlainText() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Returns the plain text.
+
+
getPrimaryLanguage() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
getPrimaryLanguage() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getPrimaryScript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getPrintSpace() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the page print space object.
+
+
getReader() - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Creates and returns an XML reader for PAGE.
+
+
getReadingDirection() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getReadingOrder() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the reading order of the layout.
+
+
getReadingOrientation() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getRegion(int) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the region at the specified index.
+
+
getRegion(Id) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the region with the given ID.
+
+
getRegion(String) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the region with the given ID.
+
+
getRegion(int) - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
getRegion(int) - Method in interface org.primaresearch.dla.page.layout.physical.RegionContainer
+
+
Returns a nested region
+
+
getRegionAt(int, int) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Looks for a region at the given position within the document page.
+
+
getRegionCount() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the number of regions in this page layout.
+
+
getRegionCount() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
getRegionCount() - Method in interface org.primaresearch.dla.page.layout.physical.RegionContainer
+
+
Returns the number of regions that are nested within this object
+
+
getRegionId() - Method in class org.primaresearch.dla.page.layout.logical.RegionRef
+
+
Returns the ID of the referenced region
+
+
getRegionsSorted() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns a sorted list of all regions.
+
+
getRelation(Id, Id) - Method in class org.primaresearch.dla.page.layout.logical.Relations
+
+
Returns the relation for the objects with id1 and id2 or 'null', if no such relation exists.
+
+
getRelations() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the container for all relations between regions.
+
+
getRelationType() - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation
+
 
+
getRoot() - Method in class org.primaresearch.dla.page.layout.logical.ReadingOrder
+
+
Returns the root group (the reading order always has a root group)
+
+
getSchemaLocation() - Method in interface org.primaresearch.dla.page.io.xml.XmlPageWriter
+
+
Returns the location of the schema (e.g.
+
+
getSchemaLocation() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
 
+
getSchemaLocation() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
 
+
getSchemaModel(XmlFormatVersion) - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Returns the model of the latest XML schema.
+
+
getSchemaUrl() - Method in interface org.primaresearch.dla.page.io.xml.XmlPageWriter
+
+
Returns the URL of the schema file (e.g.
+
+
getSchemaUrl() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
 
+
getSchemaUrl() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
 
+
getSchemaVersion() - Method in interface org.primaresearch.dla.page.io.xml.XmlPageWriter
+
+
Returns the XML schema version the writer supports (in format yyyy-mm-dd).
+
+
getSchemaVersion() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
 
+
getSchemaVersion() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
 
+
getSecondaryLanguage() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getSecondaryScript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getSize() - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Returns the size of this group
+
+
getSize() - Method in class org.primaresearch.dla.page.layout.logical.Layers
+
+
Returns the number of layers.
+
+
getSourceVersion() - Method in class org.primaresearch.dla.page.layout.converter.ChainConverter
+
 
+
getSourceVersion() - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16
+
 
+
getSourceVersion() - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12
+
 
+
getSourceVersion() - Method in class org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19
+
 
+
getSourceVersion() - Method in interface org.primaresearch.dla.page.layout.converter.LayoutConverter
+
+
Format version before the conversion
+
+
getTargetVersion() - Method in class org.primaresearch.dla.page.layout.converter.ChainConverter
+
 
+
getTargetVersion() - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16
+
 
+
getTargetVersion() - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12
+
 
+
getTargetVersion() - Method in class org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19
+
 
+
getTargetVersion() - Method in interface org.primaresearch.dla.page.layout.converter.LayoutConverter
+
+
Format version after the conversion
+
+
getText() - Method in class org.primaresearch.dla.page.layout.converter.ConversionMessage
+
+
Returns the message content
+
+
getText() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getText() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
getText() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Returns the Unicode text.
+
+
getTextColour() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getTextObject(int) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
getTextObject(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
getTextObject(int) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getTextObject(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getTextObject(int) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
getTextObject(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
getTextObject(int) - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Returns a child text object
+
+
getTextObject(Id) - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Returns a child text object
+
+
getTextObject(int) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
getTextObject(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
getTextObjectCount() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
getTextObjectCount() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getTextObjectCount() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
getTextObjectCount() - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Returns the number of child text objects
+
+
getTextObjectCount() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
getTextObjectsSorted() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
getTextObjectsSorted() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getTextObjectsSorted() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
getTextObjectsSorted() - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Returns a sorted list of all text objects (sorts by x or y position, depending on the object type).
+
+
getTextObjectsSorted(boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
getTextType() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getType() - Method in interface org.primaresearch.dla.page.layout.physical.ContentObject
+
+
Returns the type of this page content object
+
+
getType() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
getType() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
getType() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
getType() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
getType() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
getUrl() - Method in class org.primaresearch.dla.page.io.UrlInput
+
 
+
getWarnings() - Method in class org.primaresearch.dla.page.io.xml.PageErrorHandler
+
+
Returns all registered warnings
+
+
getWarnings() - Method in class org.primaresearch.dla.page.io.xml.XmlPageReader
+
+
Returns a list of warnings that occurred on the last call of read().
+
+
getWarnings() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
 
+
getWarnings() - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
+
Returns a list of writing warnings
+
+
getWidth() - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns the page width.
+
+
getWriter(XmlFormatVersion) - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Creates and returns an XML writer for PAGE using the specified schema version.
+
+
getWriterForLastestXmlFormat() - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Creates and returns an XML writer for PAGE using the latest schema version.
+
+
getXmlName(ContentType) - Method in class org.primaresearch.dla.page.io.xml.DefaultXmlNames
+
 
+
getXmlName(ContentType) - Method in interface org.primaresearch.dla.page.io.xml.XmlNameProvider
+
 
+
getZIndex() - Method in class org.primaresearch.dla.page.layout.logical.Layer
+
+
Returns the z index of this layer (for ordering in z-dimension)
+
+
Glyph - Static variable in class org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType
+
+
Type for glyph objects
+
+
Glyph - Class in org.primaresearch.dla.page.layout.physical.text.impl
+
+
Specialised low level text object representing glyphs within a page layout.
+
+
Glyph(IdRegister, Id, Polygon, VariableMap, LowLevelTextContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
GraphicRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for graphic regions.
+
+
GraphicRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
GraphicRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For graphics
+
+
Group - Class in org.primaresearch.dla.page.layout.logical
+
+
A logical group within a page layout (e.g.
+
+
GroupMember - Interface in org.primaresearch.dla.page.layout.logical
+
+
A member of a logical layout group.
+
+
+ + + +

H

+
+
hasEmbeddedText() - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
hasEmbeddedText() - Method in class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
hasEmbeddedText() - Method in class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
hasEmbeddedText() - Method in class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
hasEmbeddedText() - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
hasErrors() - Method in class org.primaresearch.dla.page.io.xml.PageErrorHandler
+
+
Checks if there were errors
+
+
hasLineSeparators() - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
hasLowLevelTextObject(LowLevelTextType) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Checks if this page layout contains text objects of the given type
+
+
hasNext() - Method in interface org.primaresearch.dla.page.layout.physical.ContentIterator
+
+
Is there another page content object?
+
+
hasNext() - Method in class org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator
+
 
+
hasNext() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
hasRegions() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
hasRegions() - Method in interface org.primaresearch.dla.page.layout.physical.RegionContainer
+
+
Checks if this object contains nested regions
+
+
hasTextObjects() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
hasTextObjects() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
hasTextObjects() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
hasTextObjects() - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Checks if there child text objects
+
+
hasTextObjects() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
hasWarnings() - Method in class org.primaresearch.dla.page.io.xml.PageErrorHandler
+
+
Checks if there were warnings
+
+
HEADER - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
HEADING - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
+ + + +

I

+
+
ImageRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for image regions.
+
+
ImageRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
ImageRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For image regions
+
+
INCH_BY_1200 - Static variable in class org.primaresearch.dla.page.Page.MeasurementUnit
+
+
1200th of an inch
+
+
index - Variable in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
init(String) - Method in class org.primaresearch.dla.page.layout.physical.shared.ContentType
+
+
Initialises this type
+
+
InputSource - Interface in org.primaresearch.dla.page.io
+
+
Interface for input sources such as files or URLs.
+
+
isBold() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
isBold() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
isBold() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isBold() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
isBold() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Bold text?
+
+
isBorderPresent() - Method in class org.primaresearch.dla.page.layout.physical.impl.FrameRegion
+
 
+
isEmpty() - Method in class org.primaresearch.dla.page.layout.logical.Relations
+
+
Checks if there are relations in this container
+
+
isIncludeLowLevelTextObjects() - Method in class org.primaresearch.dla.page.layout.physical.ContentObjectProcessor
+
+
Flag to set if text lines, words, and glyphs should be included or not
+
+
isIndented() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isItalic() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
isItalic() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
isItalic() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isItalic() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
isItalic() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Italic text?
+
+
isLetterSpaced() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
isLetterSpaced() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
isLetterSpaced() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isLetterSpaced() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
isLetterSpaced() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Letter spaced (gaps between characters)?
+
+
isOrdered() - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Returns the 'ordered' state of this group
+
+
isReverseVideo() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isSmallCaps() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
isSmallCaps() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
isSmallCaps() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isSmallCaps() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
isSmallCaps() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Small caps (lower case characters appear as smaller capitals)?
+
+
isStrikethrough() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
isStrikethrough() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
isStrikethrough() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isStrikethrough() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
isStrikethrough() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Strikethrough (line through text)?
+
+
isSubscript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
isSubscript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
isSubscript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isSubscript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
isSubscript() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Subscript (small letters below the baseline)?
+
+
isSuperscript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
isSuperscript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
isSuperscript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isSuperscript() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
isSuperscript() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Superscript (small letters above the line of text)?
+
+
isTemporary() - Method in interface org.primaresearch.dla.page.layout.physical.ContentObject
+
+
Checks if this is a temporary content object
+
+
isTemporary() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
isTemporary() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isTemporary() - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
isUnderlined() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
isUnderlined() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
isUnderlined() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
isUnderlined() - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
isUnderlined() - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Underlined text?
+
+
iterator(ContentType) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns a new iterator for a specific page content type.
+
+
iterator(ContentType, Layer) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Returns a new iterator for a specific page content type.
+
+
+ + + +

J

+
+
Join - Static variable in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType
+
+
Strong relation (e.g.
+
+
+ + + +

L

+
+
Layer - Class in org.primaresearch.dla.page.layout.logical
+
+
Layer representing a group of regions with a specific z-index
+
+
layer - Variable in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
Layers - Class in org.primaresearch.dla.page.layout.logical
+
+
Container class for logical layers that can contain layout regions.
+
+
Layers(PageLayout, IdRegister, ContentFactory) - Constructor for class org.primaresearch.dla.page.layout.logical.Layers
+
+
Constructor
+
+
LayoutConverter - Interface in org.primaresearch.dla.page.layout.converter
+
+
Interface for converters that convert a page layout to comply with a certain format version.
+
+
LineDrawingRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for line drawing regions.
+
+
LineDrawingRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
LineDrawingRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For line drawings
+
+
Link - Static variable in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType
+
+
Weak relation (e.g.
+
+
LowLevelTextContainer - Interface in org.primaresearch.dla.page.layout.physical.text
+
+
Container for low-level text objects (text lines, words, glyphs).
+
+
LowLevelTextContainerImpl - Class in org.primaresearch.dla.page.layout.physical.text
+
+
Basic implementation of a low level text object container.
+
+
LowLevelTextContainerImpl() - Constructor for class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
LowLevelTextObject - Class in org.primaresearch.dla.page.layout.physical.text
+
+
Abstract class representing low level text objects such as text line, word and glyph.
+
+
LowLevelTextObject(IdRegister, Id, Polygon, VariableMap, LowLevelTextContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
LowLevelTextObjectIterator - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Page content object iterator implementation for low level text objects (text lines, words, and glyphs).
+
+
LowLevelTextObjectIterator(PageLayout, LowLevelTextType, Layer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator
+
+
Constructor
+
+
LowLevelTextType - Class in org.primaresearch.dla.page.layout.physical.shared
+
+
Content types for low level text objects (text lines, words, glyphs).
+
+
LowLevelTextType() - Constructor for class org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType
+
+
Empty constructor (required for GWT)
+
+
LowLevelTextType(String) - Constructor for class org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType
+
+
Constructor
+
+
+ + + +

M

+
+
MARGINALIA - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
MathsRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for maths regions.
+
+
MathsRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.MathsRegion
+
 
+
MathsRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For mathematical formulas/equations
+
+
MetaData - Class in org.primaresearch.dla.page
+
+
Class for document metadata such as creation date, comments, ...
+
+
MetaData() - Constructor for class org.primaresearch.dla.page.MetaData
+
 
+
MetsMultiPageReader - Class in org.primaresearch.dla.page.io.xml
+
+
Reader for multiple page file defined in METS XML format.
+
+
MetsMultiPageReader() - Constructor for class org.primaresearch.dla.page.io.xml.MetsMultiPageReader
+
 
+
MM_BY_10 - Static variable in class org.primaresearch.dla.page.Page.MeasurementUnit
+
+
One tenth of a mm
+
+
moveTo(Group) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
 
+
moveTo(Group) - Method in interface org.primaresearch.dla.page.layout.logical.GroupMember
+
+
Moves this object to another group
+
+
moveTo(Group) - Method in class org.primaresearch.dla.page.layout.logical.RegionRef
+
+
Moves this group member to another group.
+
+
MusicRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for musical notation regions.
+
+
MusicRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.MusicRegion
+
 
+
MusicRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For musical notations
+
+
+ + + +

N

+
+
next() - Method in interface org.primaresearch.dla.page.layout.physical.ContentIterator
+
+
Progresses the iterator and returns the next page content object.
+
+
next() - Method in class org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator
+
 
+
next() - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
NoiseRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for noise regions.
+
+
NoiseRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.NoiseRegion
+
 
+
NoiseRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For noise on the page
+
+
+ + + +

O

+
+
org.primaresearch.dla.page - package org.primaresearch.dla.page
+
 
+
org.primaresearch.dla.page.io - package org.primaresearch.dla.page.io
+
 
+
org.primaresearch.dla.page.io.xml - package org.primaresearch.dla.page.io.xml
+
 
+
org.primaresearch.dla.page.io.xml.sax - package org.primaresearch.dla.page.io.xml.sax
+
 
+
org.primaresearch.dla.page.layout - package org.primaresearch.dla.page.layout
+
 
+
org.primaresearch.dla.page.layout.converter - package org.primaresearch.dla.page.layout.converter
+
 
+
org.primaresearch.dla.page.layout.logical - package org.primaresearch.dla.page.layout.logical
+
 
+
org.primaresearch.dla.page.layout.physical - package org.primaresearch.dla.page.layout.physical
+
 
+
org.primaresearch.dla.page.layout.physical.impl - package org.primaresearch.dla.page.layout.physical.impl
+
 
+
org.primaresearch.dla.page.layout.physical.shared - package org.primaresearch.dla.page.layout.physical.shared
+
 
+
org.primaresearch.dla.page.layout.physical.text - package org.primaresearch.dla.page.layout.physical.text
+
 
+
org.primaresearch.dla.page.layout.physical.text.impl - package org.primaresearch.dla.page.layout.physical.text.impl
+
 
+
org.primaresearch.dla.page.layout.shared - package org.primaresearch.dla.page.layout.shared
+
 
+
OTHER - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
OutputTarget - Interface in org.primaresearch.dla.page.io
+
+
Interface for output targets (e.g.
+
+
+ + + +

P

+
+
Page - Static variable in class org.primaresearch.dla.page.layout.physical.shared.ContentType
+
+
Content type for a document page itself
+
+
Page - Class in org.primaresearch.dla.page
+
+
Central class representing one page of a document (e.g.
+
+
Page() - Constructor for class org.primaresearch.dla.page.Page
+
+
Constructor using the default page format.
+
+
Page(FormatModel) - Constructor for class org.primaresearch.dla.page.Page
+
+
Constructor using dynamic page format.
+
+
Page.AlternativeImage - Class in org.primaresearch.dla.page
+
+
Alternative document page image (e.g.
+
+
Page.AlternativeImage(String) - Constructor for class org.primaresearch.dla.page.Page.AlternativeImage
+
 
+
Page.MeasurementUnit - Class in org.primaresearch.dla.page
+
+
Measurement unit for coordinates.
+ Introduced to support ALTO XML files.
+
+
Page.MeasurementUnit(String, double) - Constructor for class org.primaresearch.dla.page.Page.MeasurementUnit
+
 
+
PAGE_NUMBER - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
PageErrorHandler - Class in org.primaresearch.dla.page.io.xml
+
+
Error handler implementation that collects errors and warnings.
+
+
PageErrorHandler() - Constructor for class org.primaresearch.dla.page.io.xml.PageErrorHandler
+
 
+
PageLayout - Class in org.primaresearch.dla.page.layout
+
+
Class representing the layout and text content of a document page.
+
+
PageLayout(ContentFactory) - Constructor for class org.primaresearch.dla.page.layout.PageLayout
+
+
Constructor
+
+
pageLayout - Variable in class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
 
+
PageReader - Interface in org.primaresearch.dla.page.io
+
+
Reader interface for PAGE.
+
+
PageWriter - Interface in org.primaresearch.dla.page.io
+
+
Interface for writing PAGE.
+
+
PageXmlInputOutput - Class in org.primaresearch.dla.page.io.xml
+
+
Central access point for reading and writing PAGE XML.
+
+ Note: Page objects can only be saved using the XML format they are set to.
+
+
PageXmlModelAndValidatorProvider - Class in org.primaresearch.dla.page.io.xml
+
+
Provides access to models and validators for different PAGE XML schema versions.
+
+
PageXmlModelAndValidatorProvider() - Constructor for class org.primaresearch.dla.page.io.xml.PageXmlModelAndValidatorProvider
+
+
Constructor for default schemas only
+
+
PageXmlModelAndValidatorProvider(String, String) - Constructor for class org.primaresearch.dla.page.io.xml.PageXmlModelAndValidatorProvider
+
+
Constructor for additional schema retrieval from a folder structure.
+ + Example:
+   -schema
+     -2010-01-12
+       -pagecontent.xsd
+     -2010-03-19
+       -pagecontent.xsd
+
+
PARAGRAPH - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
ParentChildRelation - Static variable in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType
+
+
Parent-child relation (e.g.
+
+
PIXEL - Static variable in class org.primaresearch.dla.page.Page.MeasurementUnit
+
 
+
postProcessPage(Page, int, int, double, double) - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Post-processes the given page object using the specified image dimension and resolution.
+ This could include scaling all coordinates if they are not measured in pixel.
+
+
+ + + +

R

+
+
read(InputSource) - Method in interface org.primaresearch.dla.page.io.PageReader
+
+
Reads a PAGE input source and returns a Page object.
+
+
read(InputSource) - Method in class org.primaresearch.dla.page.io.xml.MetsMultiPageReader
+
 
+
read(InputSource) - Method in class org.primaresearch.dla.page.io.xml.XmlPageReader
+
+
Reads a PAGE XML file and returns a Page object.
+
+
ReadingOrder - Class in org.primaresearch.dla.page.layout.logical
+
+
Class for logical reading order of layout regions.
+
+
ReadingOrder(PageLayout, IdRegister, ContentFactory) - Constructor for class org.primaresearch.dla.page.layout.logical.ReadingOrder
+
+
Constructor
+
+
readPage(String) - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Creates a page object from the given XML file.
+
+
readPage(URL) - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Creates a page object from the given XML file.
+
+
Region - Interface in org.primaresearch.dla.page.layout.physical
+
+
Layout region
+
+
RegionContainer - Interface in org.primaresearch.dla.page.layout.physical
+
+
Interface for classes that are able to contain nested layout regions.
+
+
RegionImpl - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Basic implementation for layout regions.
+
+
RegionImpl(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
+
Constructor
+
+
RegionIterator - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Page content object iterator implementation for regions (zones/blocks).
+
+
RegionIterator(PageLayout, RegionType, Layer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+
+
Constructor
+
+
RegionRef - Class in org.primaresearch.dla.page.layout.logical
+
+
A group member pointing to an Identifiable object (e.g.
+
+
RegionType - Class in org.primaresearch.dla.page.layout.physical.shared
+
+
Content types for layout regions.
+
+
RegionType() - Constructor for class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
Empty constructor (required for GWT)
+
+
RegionType(String) - Constructor for class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
Constructor
+
+
registerNewId(String) - Method in class org.primaresearch.dla.page.layout.physical.ContentFactory
+
+
Registers the specified ID
+
+
Relations - Class in org.primaresearch.dla.page.layout.logical
+
+
Container class for relations between content objects.
+
+
Relations() - Constructor for class org.primaresearch.dla.page.layout.logical.Relations
+
 
+
removeRegion(Id) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Removes the specified region object from the page layout.
+
+
removeRegion(Id, boolean) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Removes the specified region object from the page layout.
+
+
removeRegion(int) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Removes the region at the specified index from the page layout.
+
+
removeRegion(int, boolean) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Removes the region at the specified index from the page layout.
+
+
removeRegion(Region) - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
removeRegion(Region) - Method in interface org.primaresearch.dla.page.layout.physical.RegionContainer
+
+
Removes a nested region
+
+
removeRegionRef(String) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Removes a reference to a region
+
+
removeTextObject(int) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
removeTextObject(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
removeTextObject(int) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
removeTextObject(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
removeTextObject(int) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
removeTextObject(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
removeTextObject(int) - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Removes a child text object
+
+
removeTextObject(Id) - Method in interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer
+
+
Removes a child text object
+
+
removeTextObject(int) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
removeTextObject(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+
 
+
run(PageLayout, boolean) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16
+
+
Runs check or conversion
+
+
run(PageLayout, boolean) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12
+
+
Runs check or conversion
+
+
run(PageLayout, boolean) - Method in class org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19
+
+
Runs check or conversion
+
+
run(Page) - Method in class org.primaresearch.dla.page.layout.physical.ContentObjectProcessor
+
+
Run the processor.
+
+
+ + + +

S

+
+
SaxPageHandler - Class in org.primaresearch.dla.page.io.xml.sax
+
+
Abstract base class for SAX handlers intended for PAGE XML.
+
+
SaxPageHandler() - Constructor for class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler
+
 
+
SaxPageHandler_2010_03_19 - Class in org.primaresearch.dla.page.io.xml.sax
+
+
Legacy PAGE XML handler for 2010 format.
+
+
SaxPageHandler_2010_03_19(XmlModelAndValidatorProvider, XmlFormatVersion) - Constructor for class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2010_03_19
+
 
+
SaxPageHandler_2013_07_15 - Class in org.primaresearch.dla.page.io.xml.sax
+
+
XML handler for 2013 PAGE format.
+
+
SaxPageHandler_2013_07_15(XmlModelAndValidatorProvider, XmlFormatVersion) - Constructor for class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2013_07_15
+
 
+
SaxPageHandler_AbbyyFineReader10 - Class in org.primaresearch.dla.page.io.xml.sax
+
+
Experimental SAX XML handler to read Abbyy FineReader 10 XML files.
+
+
SaxPageHandler_AbbyyFineReader10(XmlModelAndValidatorProvider, XmlFormatVersion) - Constructor for class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_AbbyyFineReader10
+
 
+
SaxPageHandler_Alto_2_1 - Class in org.primaresearch.dla.page.io.xml.sax
+
+
Experimental SAX XML handler to read ALTO XML files.
+
+
SaxPageHandler_Alto_2_1(XmlModelAndValidatorProvider, XmlFormatVersion) - Constructor for class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Alto_2_1
+
 
+
SaxPageHandler_Hocr - Class in org.primaresearch.dla.page.io.xml.sax
+
+
Experimental SAX XML handler to read HOCR XHTML files (e.g.
+
+
SaxPageHandler_Hocr() - Constructor for class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Hocr
+
 
+
SaxPageHandlerFactory - Class in org.primaresearch.dla.page.io.xml.sax
+
+
Creates SAX handlers for PAGE XML.
+
+
SaxPageHandlerFactory() - Constructor for class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerFactory
+
 
+
SaxPageHandlerLegacy - Class in org.primaresearch.dla.page.io.xml.sax
+
+
Handler for PAGE schema version 2010-01-12 and older.
+
+
SaxPageHandlerLegacy(XmlModelAndValidatorProvider, XmlFormatVersion) - Constructor for class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerLegacy
+
 
+
SeparatorRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for separator regions.
+
+
SeparatorRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion
+
 
+
SeparatorRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For separators
+
+
setAdditionalSchemaLocation(String) - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Sets the location of additional schema files and assumes the default schema file name 'pagecontent.xsd'.
+
+
setAdditionalSchemaLocation(String, String) - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Sets the location of additional schema files and searches for schemas having the specified name.
+
+
setAttributeFactory(AttributeFactory) - Method in class org.primaresearch.dla.page.layout.physical.ContentFactory
+
+
Sets the attribute factory that is used for creating attributes for new objects
+
+
setBaseline(Polygon) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
+
Sets the baseline attached to this text line.
+
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.AdvertRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.ChemRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.FrameRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.MathsRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.MusicRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
setBgColour(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setBold(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
setBold(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setBold(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setBold(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setBold(Boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Bold text?
+
+
setBorder(GeometricObject) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Sets the page border.
+
+
setBorderPresent(boolean) - Method in class org.primaresearch.dla.page.layout.physical.impl.FrameRegion
+
 
+
setCaption(String) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Sets the caption (display name)
+
+
setChartType(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
setColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion
+
 
+
setColourDepth(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
setComments(String) - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation
+
+
Sets comments
+
+
setComments(String) - Method in class org.primaresearch.dla.page.MetaData
+
+
Sets generic comments
+
+
setComments(String) - Method in class org.primaresearch.dla.page.Page.AlternativeImage
+
 
+
setConfidence(Double) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setConfidence(Double) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
setConfidence(Double) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Sets the OCR confidence for the text content.
+
+
setCoords(Polygon) - Method in class org.primaresearch.dla.page.layout.GeometricObjectImpl
+
 
+
setCoords(Polygon) - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
setCoords(Polygon) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
setCoords(Polygon) - Method in interface org.primaresearch.dla.page.layout.shared.GeometricObject
+
+
Sets the location of the object
+
+
setCreationTime(Date) - Method in class org.primaresearch.dla.page.MetaData
+
+
Sets the creation date/time
+
+
setCreator(String) - Method in class org.primaresearch.dla.page.MetaData
+
+
Sets the creating person, institution, and/or tool
+
+
setCustomField(String) - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation
+
+
Sets custom content
+
+
setEmbeddedText(boolean) - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
setEmbeddedText(boolean) - Method in class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
setEmbeddedText(boolean) - Method in class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
setEmbeddedText(boolean) - Method in class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
setEmbeddedText(boolean) - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
setFilename(String) - Method in class org.primaresearch.dla.page.Page.AlternativeImage
+
 
+
setFontSize(double) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setFormatVersion(FormatModel) - Method in class org.primaresearch.dla.page.Page
+
+
Converts the page to the specified format.
+
+
setGraphicType(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
setGtsId(Id) - Method in class org.primaresearch.dla.page.Page
+
+
Sets the ground truth and storage ID of this page
+
+
setGtsId(String) - Method in class org.primaresearch.dla.page.Page
+
+
Sets the ground truth and storage ID of this page
+
+
setId(String) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
 
+
setId(Id) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
 
+
setId(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
setId(Id) - Method in class org.primaresearch.dla.page.layout.physical.impl.RegionImpl
+
 
+
setId(String) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
setId(Id) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
setImageFilename(String) - Method in class org.primaresearch.dla.page.Page
+
+
Sets the main image file that is associated with this page.
+
+
setIncludeLowLevelTextObjects(boolean) - Method in class org.primaresearch.dla.page.layout.physical.ContentObjectProcessor
+
+
Flag to set if text lines, words, and glyphs should be included or not
+
+
setIndented(boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setItalic(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
setItalic(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setItalic(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setItalic(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setItalic(Boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Italic text?
+
+
setKerning(int) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setLanguage(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setLastModifiedTime(Date) - Method in class org.primaresearch.dla.page.MetaData
+
+
Sets the modification date/time
+
+
setLeading(int) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setLetterSpaced(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
setLetterSpaced(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setLetterSpaced(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setLetterSpaced(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setLetterSpaced(Boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Letter spaced (gaps between characters)?
+
+
setLineColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
setLineSeparators(boolean) - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
setMeasurementUnit(Page.MeasurementUnit) - Method in class org.primaresearch.dla.page.Page
+
+
Sets the measurement unit for coordinates
+
+
setNumberOfColumns(int) - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
setNumberOfRows(int) - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
setNumColours(int) - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
setNumColours(int) - Method in class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
setOrdered(boolean) - Method in class org.primaresearch.dla.page.layout.logical.Group
+
+
Sets the 'ordered' state of this group
+
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.AdvertRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.ChemRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.MathsRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.MusicRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
setOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setParent(LowLevelTextContainer) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
setPenColour(String) - Method in class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+
 
+
setPlainText(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setPlainText(String) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
setPlainText(String) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Sets the plain text.
+
+
setPrimaryLanguage(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setPrimaryLanguage(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setPrimarySkript(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setPrintSpace(GeometricObject) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Sets the page print space.
+
+
setReadingDirection(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setReadingOrientation(double) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setReverseVideo(boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setSecondaryLanguage(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setSecondarySkript(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setSize(int, int) - Method in class org.primaresearch.dla.page.layout.PageLayout
+
+
Sets width and height of the page.
+
+
setSmallCaps(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
setSmallCaps(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setSmallCaps(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setSmallCaps(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setSmallCaps(Boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Small caps (lower case characters appear as smaller capitals)?
+
+
setStrikethrough(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
setStrikethrough(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setStrikethrough(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setStrikethrough(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setStrikethrough(Boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Strikethrough (line through text)?
+
+
setSubscript(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
setSubscript(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setSubscript(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setSubscript(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setSubscript(Boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Subscript (small letters below the baseline)?
+
+
setSuperscript(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
setSuperscript(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setSuperscript(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setSuperscript(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setSuperscript(Boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Superscript (small letters above the line of text)?
+
+
setText(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setText(String) - Method in class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject
+
 
+
setText(String) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Sets the Unicode text.
+
+
setTextColour(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setTextType(String) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setUnderlined(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Glyph
+
 
+
setUnderlined(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
setUnderlined(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
setUnderlined(Boolean) - Method in class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
setUnderlined(Boolean) - Method in interface org.primaresearch.dla.page.layout.physical.text.TextObject
+
+
Underlined text?
+
+
setZIndex(int) - Method in class org.primaresearch.dla.page.layout.logical.Layer
+
+
Sets the z index of this layer (for ordering in z-dimension)
+
+
SIGNATURE_MARK - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
startElement(String, String, String, Attributes) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2010_03_19
+
+
Receive notification of the start of an element.
+
+
startElement(String, String, String, Attributes) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2013_07_15
+
+
Receive notification of the start of an element.
+
+
startElement(String, String, String, Attributes) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_AbbyyFineReader10
+
+
Receive notification of the start of an element.
+
+
startElement(String, String, String, Attributes) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Alto_2_1
+
+
Receive notification of the start of an element.
+
+
startElement(String, String, String, Attributes) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Hocr
+
+
Receive notification of the start of an element.
+
+
startElement(String, String, String, Attributes) - Method in class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerLegacy
+
+
Receive notification of the start of an element.
+
+
StreamTarget - Class in org.primaresearch.dla.page.io.xml
+
+
Generic output target can be any type of stream.
+
+
StreamTarget(OutputStream) - Constructor for class org.primaresearch.dla.page.io.xml.StreamTarget
+
 
+
+ + + +

T

+
+
TableRegion - Class in org.primaresearch.dla.page.layout.physical.impl
+
+
Specialised implementation for table regions.
+
+
TableRegion(IdRegister, RegionType, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.impl.TableRegion
+
 
+
TableRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For tables
+
+
TEMP_ID_SUFFIX - Static variable in interface org.primaresearch.dla.page.layout.physical.ContentObject
+
+
Suffix used for IDs of temporary content objects
+
+
TextLine - Static variable in class org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType
+
+
Type for text line objects
+
+
TextLine - Class in org.primaresearch.dla.page.layout.physical.text.impl
+
+
Specialised low level text object representing text lines within a page layout.
+
+
TextLine(ContentFactory, IdRegister, Id, Polygon, VariableMap, LowLevelTextContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.text.impl.TextLine
+
 
+
TextObject - Interface in org.primaresearch.dla.page.layout.physical.text
+
+
Interface for objects with text content (e.g.
+
+
TextRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For text regions
+
+
TextRegion - Class in org.primaresearch.dla.page.layout.physical.text.impl
+
+
Specialised layout region for text.
+
+
TextRegion(ContentFactory, IdRegister, Id, Polygon, VariableMap, RegionContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+
 
+
TOC_ENTRY - Static variable in interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+
 
+
toString() - Method in class org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType
+
 
+
+ + + +

U

+
+
UnknownRegion - Static variable in class org.primaresearch.dla.page.layout.physical.shared.RegionType
+
+
For regions of unknown/undetermined type
+
+
UrlInput - Class in org.primaresearch.dla.page.io
+
+
InputSouce implementation for URLs.
+
+
UrlInput(URL) - Constructor for class org.primaresearch.dla.page.io.UrlInput
+
 
+
+ + + +

V

+
+
validate(Page) - Method in interface org.primaresearch.dla.page.io.PageWriter
+
+
Validates the given page object against the format it is set to.
+
+
validate(Page) - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
+
Validates the given Page object against the XML schema.
+
+
validate(Page) - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
+
Validates the given Page object against the XML schema.
+
+
+ + + +

W

+
+
warning(SAXParseException) - Method in class org.primaresearch.dla.page.io.xml.PageErrorHandler
+
 
+
Word - Static variable in class org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType
+
+
Type for word objects
+
+
Word - Class in org.primaresearch.dla.page.layout.physical.text.impl
+
+
Specialised low level text object representing words within a page layout.
+
+
Word(ContentFactory, IdRegister, Id, Polygon, VariableMap, LowLevelTextContainer) - Constructor for class org.primaresearch.dla.page.layout.physical.text.impl.Word
+
 
+
write(Page, OutputTarget) - Method in interface org.primaresearch.dla.page.io.PageWriter
+
+
Writes the given Page object to an output target.
+
+
write(Page, OutputTarget) - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
+
Writes the given Page object to an XML file.
+
+
write(Page, OutputTarget) - Method in class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
+
Writes the given Page object to an XML file.
+
+
writePage(Page, String) - Static method in class org.primaresearch.dla.page.io.xml.PageXmlInputOutput
+
+
Saves the given document page to an XML file at the specified + location, using the latest PAGE XML format or the format the + page object has been loaded with.
+
+
+ + + +

X

+
+
XmlNameProvider - Interface in org.primaresearch.dla.page.io.xml
+
+
Provides the XML element names for content objects.
+
+
XmlPageReader - Class in org.primaresearch.dla.page.io.xml
+
+
Page reader implementation for XML files (supports validation against schema).
+
+
XmlPageReader(XmlModelAndValidatorProvider) - Constructor for class org.primaresearch.dla.page.io.xml.XmlPageReader
+
+
Constructor
+
+
XmlPageWriter - Interface in org.primaresearch.dla.page.io.xml
+
+
Interface for page writers producing XML.
+
+
XmlPageWriter_2010_03_19 - Class in org.primaresearch.dla.page.io.xml
+
+
Page writer implementation for XML files.
+
+
XmlPageWriter_2010_03_19(XmlValidator) - Constructor for class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+
+
Constructor
+
+
XmlPageWriter_2013_07_15 - Class in org.primaresearch.dla.page.io.xml
+
+
Page writer implementation for XML files.
+
+
XmlPageWriter_2013_07_15(XmlValidator) - Constructor for class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+
+
Constructor
+
+
+A C D E F G H I J L M N O P R S T U V W X 
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/index.html b/java/PrimaDla/apidoc/index.html new file mode 100644 index 00000000..91f355d9 --- /dev/null +++ b/java/PrimaDla/apidoc/index.html @@ -0,0 +1,67 @@ + + + + + +PrimaDla API + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/MetaData.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/MetaData.html new file mode 100644 index 00000000..1e960992 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/MetaData.html @@ -0,0 +1,459 @@ + + + + + +MetaData (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page
+

Class MetaData

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.AlternativeImage.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.AlternativeImage.html new file mode 100644 index 00000000..aac0784e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.AlternativeImage.html @@ -0,0 +1,303 @@ + + + + + +Page.AlternativeImage (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page
+

Class Page.AlternativeImage

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.MeasurementUnit.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.MeasurementUnit.html new file mode 100644 index 00000000..ccab2d54 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.MeasurementUnit.html @@ -0,0 +1,364 @@ + + + + + +Page.MeasurementUnit (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page
+

Class Page.MeasurementUnit

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.html new file mode 100644 index 00000000..774fc012 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/Page.html @@ -0,0 +1,530 @@ + + + + + +Page (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page
+

Class Page

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/MetaData.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/MetaData.html new file mode 100644 index 00000000..a383b411 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/MetaData.html @@ -0,0 +1,158 @@ + + + + + +Uses of Class org.primaresearch.dla.page.MetaData (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.MetaData

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.AlternativeImage.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.AlternativeImage.html new file mode 100644 index 00000000..f2378b93 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.AlternativeImage.html @@ -0,0 +1,158 @@ + + + + + +Uses of Class org.primaresearch.dla.page.Page.AlternativeImage (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.Page.AlternativeImage

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.MeasurementUnit.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.MeasurementUnit.html new file mode 100644 index 00000000..a2e7a3eb --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.MeasurementUnit.html @@ -0,0 +1,198 @@ + + + + + +Uses of Class org.primaresearch.dla.page.Page.MeasurementUnit (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.Page.MeasurementUnit

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.html new file mode 100644 index 00000000..320a1785 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/class-use/Page.html @@ -0,0 +1,375 @@ + + + + + +Uses of Class org.primaresearch.dla.page.Page (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.Page

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/FileInput.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/FileInput.html new file mode 100644 index 00000000..5ce42383 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/FileInput.html @@ -0,0 +1,265 @@ + + + + + +FileInput (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io
+

Class FileInput

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/FileTarget.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/FileTarget.html new file mode 100644 index 00000000..363166fd --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/FileTarget.html @@ -0,0 +1,265 @@ + + + + + +FileTarget (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io
+

Class FileTarget

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/InputSource.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/InputSource.html new file mode 100644 index 00000000..a7463bae --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/InputSource.html @@ -0,0 +1,166 @@ + + + + + +InputSource (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io
+

Interface InputSource

+
+
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/OutputTarget.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/OutputTarget.html new file mode 100644 index 00000000..acedb372 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/OutputTarget.html @@ -0,0 +1,166 @@ + + + + + +OutputTarget (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io
+

Interface OutputTarget

+
+
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/PageReader.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/PageReader.html new file mode 100644 index 00000000..5a388d23 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/PageReader.html @@ -0,0 +1,223 @@ + + + + + +PageReader (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io
+

Interface PageReader

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/PageWriter.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/PageWriter.html new file mode 100644 index 00000000..b7d68c15 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/PageWriter.html @@ -0,0 +1,247 @@ + + + + + +PageWriter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io
+

Interface PageWriter

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/UrlInput.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/UrlInput.html new file mode 100644 index 00000000..7e5e64c7 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/UrlInput.html @@ -0,0 +1,265 @@ + + + + + +UrlInput (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io
+

Class UrlInput

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/FileInput.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/FileInput.html new file mode 100644 index 00000000..10e25441 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/FileInput.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.FileInput (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.FileInput

+
+
No usage of org.primaresearch.dla.page.io.FileInput
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/FileTarget.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/FileTarget.html new file mode 100644 index 00000000..172709e1 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/FileTarget.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.FileTarget (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.FileTarget

+
+
No usage of org.primaresearch.dla.page.io.FileTarget
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/InputSource.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/InputSource.html new file mode 100644 index 00000000..f5d9c1be --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/InputSource.html @@ -0,0 +1,207 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.io.InputSource (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.io.InputSource

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/OutputTarget.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/OutputTarget.html new file mode 100644 index 00000000..64e3b3ea --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/OutputTarget.html @@ -0,0 +1,221 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.io.OutputTarget (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.io.OutputTarget

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/PageReader.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/PageReader.html new file mode 100644 index 00000000..2951b105 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/PageReader.html @@ -0,0 +1,158 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.io.PageReader (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.io.PageReader

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/PageWriter.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/PageWriter.html new file mode 100644 index 00000000..237a9766 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/PageWriter.html @@ -0,0 +1,179 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.io.PageWriter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.io.PageWriter

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/UrlInput.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/UrlInput.html new file mode 100644 index 00000000..101b8d32 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/class-use/UrlInput.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.UrlInput (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.UrlInput

+
+
No usage of org.primaresearch.dla.page.io.UrlInput
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-frame.html new file mode 100644 index 00000000..2b00c354 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-frame.html @@ -0,0 +1,28 @@ + + + + + +org.primaresearch.dla.page.io (PrimaDla API) + + + + +

org.primaresearch.dla.page.io

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-summary.html new file mode 100644 index 00000000..ef201bee --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-summary.html @@ -0,0 +1,183 @@ + + + + + +org.primaresearch.dla.page.io (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.io

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-tree.html new file mode 100644 index 00000000..78e02558 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-tree.html @@ -0,0 +1,138 @@ + + + + + +org.primaresearch.dla.page.io Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.io

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-use.html new file mode 100644 index 00000000..a2cb0178 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/package-use.html @@ -0,0 +1,192 @@ + + + + + +Uses of Package org.primaresearch.dla.page.io (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.io

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/DefaultXmlNames.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/DefaultXmlNames.html new file mode 100644 index 00000000..1d33d742 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/DefaultXmlNames.html @@ -0,0 +1,1650 @@ + + + + + +DefaultXmlNames (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class DefaultXmlNames

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/MetsMultiPageReader.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/MetsMultiPageReader.html new file mode 100644 index 00000000..e7cace51 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/MetsMultiPageReader.html @@ -0,0 +1,260 @@ + + + + + +MetsMultiPageReader (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class MetsMultiPageReader

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageErrorHandler.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageErrorHandler.html new file mode 100644 index 00000000..a7b666ab --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageErrorHandler.html @@ -0,0 +1,377 @@ + + + + + +PageErrorHandler (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class PageErrorHandler

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageXmlInputOutput.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageXmlInputOutput.html new file mode 100644 index 00000000..53f4bea7 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageXmlInputOutput.html @@ -0,0 +1,486 @@ + + + + + +PageXmlInputOutput (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class PageXmlInputOutput

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageXmlModelAndValidatorProvider.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageXmlModelAndValidatorProvider.html new file mode 100644 index 00000000..4e1d08b5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/PageXmlModelAndValidatorProvider.html @@ -0,0 +1,337 @@ + + + + + +PageXmlModelAndValidatorProvider (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class PageXmlModelAndValidatorProvider

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/StreamTarget.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/StreamTarget.html new file mode 100644 index 00000000..d5995c62 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/StreamTarget.html @@ -0,0 +1,265 @@ + + + + + +StreamTarget (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class StreamTarget

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlNameProvider.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlNameProvider.html new file mode 100644 index 00000000..870f100e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlNameProvider.html @@ -0,0 +1,214 @@ + + + + + +XmlNameProvider (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Interface XmlNameProvider

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageReader.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageReader.html new file mode 100644 index 00000000..9582f901 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageReader.html @@ -0,0 +1,314 @@ + + + + + +XmlPageReader (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class XmlPageReader

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter.html new file mode 100644 index 00000000..02c11d1f --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter.html @@ -0,0 +1,293 @@ + + + + + +XmlPageWriter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Interface XmlPageWriter

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter_2010_03_19.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter_2010_03_19.html new file mode 100644 index 00000000..77d2b727 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter_2010_03_19.html @@ -0,0 +1,437 @@ + + + + + +XmlPageWriter_2010_03_19 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class XmlPageWriter_2010_03_19

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter_2013_07_15.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter_2013_07_15.html new file mode 100644 index 00000000..fab02616 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/XmlPageWriter_2013_07_15.html @@ -0,0 +1,443 @@ + + + + + +XmlPageWriter_2013_07_15 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml
+

Class XmlPageWriter_2013_07_15

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/DefaultXmlNames.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/DefaultXmlNames.html new file mode 100644 index 00000000..b51c35cc --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/DefaultXmlNames.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.DefaultXmlNames (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.DefaultXmlNames

+
+
No usage of org.primaresearch.dla.page.io.xml.DefaultXmlNames
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/MetsMultiPageReader.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/MetsMultiPageReader.html new file mode 100644 index 00000000..a5d7ed56 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/MetsMultiPageReader.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.MetsMultiPageReader (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.MetsMultiPageReader

+
+
No usage of org.primaresearch.dla.page.io.xml.MetsMultiPageReader
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageErrorHandler.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageErrorHandler.html new file mode 100644 index 00000000..a54a9acb --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageErrorHandler.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.PageErrorHandler (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.PageErrorHandler

+
+
No usage of org.primaresearch.dla.page.io.xml.PageErrorHandler
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageXmlInputOutput.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageXmlInputOutput.html new file mode 100644 index 00000000..bef2e039 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageXmlInputOutput.html @@ -0,0 +1,158 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.PageXmlInputOutput (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.PageXmlInputOutput

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageXmlModelAndValidatorProvider.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageXmlModelAndValidatorProvider.html new file mode 100644 index 00000000..76a8909b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/PageXmlModelAndValidatorProvider.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.PageXmlModelAndValidatorProvider (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.PageXmlModelAndValidatorProvider

+
+
No usage of org.primaresearch.dla.page.io.xml.PageXmlModelAndValidatorProvider
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/StreamTarget.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/StreamTarget.html new file mode 100644 index 00000000..65529de8 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/StreamTarget.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.StreamTarget (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.StreamTarget

+
+
No usage of org.primaresearch.dla.page.io.xml.StreamTarget
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlNameProvider.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlNameProvider.html new file mode 100644 index 00000000..d9445d26 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlNameProvider.html @@ -0,0 +1,158 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.io.xml.XmlNameProvider (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.io.xml.XmlNameProvider

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageReader.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageReader.html new file mode 100644 index 00000000..18508017 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageReader.html @@ -0,0 +1,158 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.XmlPageReader (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.XmlPageReader

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter.html new file mode 100644 index 00000000..9134b4d4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter.html @@ -0,0 +1,185 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.io.xml.XmlPageWriter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.io.xml.XmlPageWriter

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter_2010_03_19.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter_2010_03_19.html new file mode 100644 index 00000000..0dec7eb1 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter_2010_03_19.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19

+
+
No usage of org.primaresearch.dla.page.io.xml.XmlPageWriter_2010_03_19
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter_2013_07_15.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter_2013_07_15.html new file mode 100644 index 00000000..5913dfe3 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/class-use/XmlPageWriter_2013_07_15.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15

+
+
No usage of org.primaresearch.dla.page.io.xml.XmlPageWriter_2013_07_15
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-frame.html new file mode 100644 index 00000000..fbe61d74 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-frame.html @@ -0,0 +1,32 @@ + + + + + +org.primaresearch.dla.page.io.xml (PrimaDla API) + + + + +

org.primaresearch.dla.page.io.xml

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-summary.html new file mode 100644 index 00000000..9654a6d1 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-summary.html @@ -0,0 +1,209 @@ + + + + + +org.primaresearch.dla.page.io.xml (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.io.xml

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-tree.html new file mode 100644 index 00000000..52f2ae4a --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-tree.html @@ -0,0 +1,150 @@ + + + + + +org.primaresearch.dla.page.io.xml Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.io.xml

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-use.html new file mode 100644 index 00000000..82dce11d --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/package-use.html @@ -0,0 +1,168 @@ + + + + + +Uses of Package org.primaresearch.dla.page.io.xml (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.io.xml

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler.html new file mode 100644 index 00000000..4d4cb467 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler.html @@ -0,0 +1,284 @@ + + + + + +SaxPageHandler (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml.sax
+

Class SaxPageHandler

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerFactory.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerFactory.html new file mode 100644 index 00000000..47ca4068 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerFactory.html @@ -0,0 +1,267 @@ + + + + + +SaxPageHandlerFactory (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml.sax
+

Class SaxPageHandlerFactory

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerLegacy.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerLegacy.html new file mode 100644 index 00000000..5858186e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerLegacy.html @@ -0,0 +1,380 @@ + + + + + +SaxPageHandlerLegacy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml.sax
+

Class SaxPageHandlerLegacy

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2010_03_19.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2010_03_19.html new file mode 100644 index 00000000..da626e4b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2010_03_19.html @@ -0,0 +1,380 @@ + + + + + +SaxPageHandler_2010_03_19 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml.sax
+

Class SaxPageHandler_2010_03_19

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2013_07_15.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2013_07_15.html new file mode 100644 index 00000000..d7054cda --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2013_07_15.html @@ -0,0 +1,380 @@ + + + + + +SaxPageHandler_2013_07_15 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml.sax
+

Class SaxPageHandler_2013_07_15

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_AbbyyFineReader10.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_AbbyyFineReader10.html new file mode 100644 index 00000000..404faa4a --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_AbbyyFineReader10.html @@ -0,0 +1,380 @@ + + + + + +SaxPageHandler_AbbyyFineReader10 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml.sax
+

Class SaxPageHandler_AbbyyFineReader10

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Alto_2_1.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Alto_2_1.html new file mode 100644 index 00000000..43238d60 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Alto_2_1.html @@ -0,0 +1,380 @@ + + + + + +SaxPageHandler_Alto_2_1 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml.sax
+

Class SaxPageHandler_Alto_2_1

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Hocr.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Hocr.html new file mode 100644 index 00000000..eaaa826f --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Hocr.html @@ -0,0 +1,378 @@ + + + + + +SaxPageHandler_Hocr (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.io.xml.sax
+

Class SaxPageHandler_Hocr

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler.html new file mode 100644 index 00000000..89c294a2 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler.html @@ -0,0 +1,204 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.sax.SaxPageHandler

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandlerFactory.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandlerFactory.html new file mode 100644 index 00000000..e259511e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandlerFactory.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerFactory (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerFactory

+
+
No usage of org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerFactory
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandlerLegacy.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandlerLegacy.html new file mode 100644 index 00000000..4df31878 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandlerLegacy.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerLegacy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerLegacy

+
+
No usage of org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerLegacy
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_2010_03_19.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_2010_03_19.html new file mode 100644 index 00000000..87bbd2b6 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_2010_03_19.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2010_03_19 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2010_03_19

+
+
No usage of org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2010_03_19
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_2013_07_15.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_2013_07_15.html new file mode 100644 index 00000000..016227fa --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_2013_07_15.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2013_07_15 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2013_07_15

+
+
No usage of org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_2013_07_15
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_AbbyyFineReader10.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_AbbyyFineReader10.html new file mode 100644 index 00000000..53b24b12 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_AbbyyFineReader10.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_AbbyyFineReader10 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_AbbyyFineReader10

+
+
No usage of org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_AbbyyFineReader10
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_Alto_2_1.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_Alto_2_1.html new file mode 100644 index 00000000..3299872e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_Alto_2_1.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Alto_2_1 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Alto_2_1

+
+
No usage of org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Alto_2_1
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_Hocr.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_Hocr.html new file mode 100644 index 00000000..84939ab9 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/class-use/SaxPageHandler_Hocr.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Hocr (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Hocr

+
+
No usage of org.primaresearch.dla.page.io.xml.sax.SaxPageHandler_Hocr
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-frame.html new file mode 100644 index 00000000..f0707aa4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-frame.html @@ -0,0 +1,26 @@ + + + + + +org.primaresearch.dla.page.io.xml.sax (PrimaDla API) + + + + +

org.primaresearch.dla.page.io.xml.sax

+
+

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-summary.html new file mode 100644 index 00000000..a7cd49e2 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-summary.html @@ -0,0 +1,178 @@ + + + + + +org.primaresearch.dla.page.io.xml.sax (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.io.xml.sax

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-tree.html new file mode 100644 index 00000000..8b1f655b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-tree.html @@ -0,0 +1,143 @@ + + + + + +org.primaresearch.dla.page.io.xml.sax Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.io.xml.sax

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-use.html new file mode 100644 index 00000000..1bdbb78c --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/io/xml/sax/package-use.html @@ -0,0 +1,151 @@ + + + + + +Uses of Package org.primaresearch.dla.page.io.xml.sax (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.io.xml.sax

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/GeometricObjectImpl.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/GeometricObjectImpl.html new file mode 100644 index 00000000..df246db5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/GeometricObjectImpl.html @@ -0,0 +1,301 @@ + + + + + +GeometricObjectImpl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout
+

Class GeometricObjectImpl

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/GeometricObjectPositionComparator.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/GeometricObjectPositionComparator.html new file mode 100644 index 00000000..f4b35a49 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/GeometricObjectPositionComparator.html @@ -0,0 +1,263 @@ + + + + + +GeometricObjectPositionComparator (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout
+

Class GeometricObjectPositionComparator

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/PageLayout.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/PageLayout.html new file mode 100644 index 00000000..ffc7ece7 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/PageLayout.html @@ -0,0 +1,819 @@ + + + + + +PageLayout (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout
+

Class PageLayout

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/GeometricObjectImpl.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/GeometricObjectImpl.html new file mode 100644 index 00000000..737becd4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/GeometricObjectImpl.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.GeometricObjectImpl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.GeometricObjectImpl

+
+
No usage of org.primaresearch.dla.page.layout.GeometricObjectImpl
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/GeometricObjectPositionComparator.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/GeometricObjectPositionComparator.html new file mode 100644 index 00000000..22f29f69 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/GeometricObjectPositionComparator.html @@ -0,0 +1,158 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.GeometricObjectPositionComparator (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.GeometricObjectPositionComparator

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/PageLayout.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/PageLayout.html new file mode 100644 index 00000000..700201a8 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/class-use/PageLayout.html @@ -0,0 +1,347 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.PageLayout (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.PageLayout

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ChainConverter.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ChainConverter.html new file mode 100644 index 00000000..8a926c82 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ChainConverter.html @@ -0,0 +1,355 @@ + + + + + +ChainConverter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.converter
+

Class ChainConverter

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ConversionMessage.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ConversionMessage.html new file mode 100644 index 00000000..b1ba810b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ConversionMessage.html @@ -0,0 +1,366 @@ + + + + + +ConversionMessage (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.converter
+

Class ConversionMessage

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ConverterHub.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ConverterHub.html new file mode 100644 index 00000000..d659eef4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/ConverterHub.html @@ -0,0 +1,269 @@ + + + + + +ConverterHub (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.converter
+

Class ConverterHub

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2010_01_12_to_2009_03_16.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2010_01_12_to_2009_03_16.html new file mode 100644 index 00000000..dd0a6cf7 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2010_01_12_to_2009_03_16.html @@ -0,0 +1,361 @@ + + + + + +Converter_2010_01_12_to_2009_03_16 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.converter
+

Class Converter_2010_01_12_to_2009_03_16

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2010_03_19_to_2010_01_12.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2010_03_19_to_2010_01_12.html new file mode 100644 index 00000000..97fc8829 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2010_03_19_to_2010_01_12.html @@ -0,0 +1,361 @@ + + + + + +Converter_2010_03_19_to_2010_01_12 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.converter
+

Class Converter_2010_03_19_to_2010_01_12

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2013_07_15_to_2010_03_19.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2013_07_15_to_2010_03_19.html new file mode 100644 index 00000000..b8fa85ac --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/Converter_2013_07_15_to_2010_03_19.html @@ -0,0 +1,366 @@ + + + + + +Converter_2013_07_15_to_2010_03_19 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.converter
+

Class Converter_2013_07_15_to_2010_03_19

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/LayoutConverter.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/LayoutConverter.html new file mode 100644 index 00000000..e487ce5f --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/LayoutConverter.html @@ -0,0 +1,269 @@ + + + + + +LayoutConverter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.converter
+

Interface LayoutConverter

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ChainConverter.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ChainConverter.html new file mode 100644 index 00000000..cc9fd86a --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ChainConverter.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.converter.ChainConverter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.converter.ChainConverter

+
+
No usage of org.primaresearch.dla.page.layout.converter.ChainConverter
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ConversionMessage.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ConversionMessage.html new file mode 100644 index 00000000..11c56bd8 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ConversionMessage.html @@ -0,0 +1,288 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.converter.ConversionMessage (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.converter.ConversionMessage

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ConverterHub.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ConverterHub.html new file mode 100644 index 00000000..d3a02c8b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/ConverterHub.html @@ -0,0 +1,158 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.converter.ConverterHub (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.converter.ConverterHub

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2010_01_12_to_2009_03_16.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2010_01_12_to_2009_03_16.html new file mode 100644 index 00000000..eb0b611c --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2010_01_12_to_2009_03_16.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16

+
+
No usage of org.primaresearch.dla.page.layout.converter.Converter_2010_01_12_to_2009_03_16
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2010_03_19_to_2010_01_12.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2010_03_19_to_2010_01_12.html new file mode 100644 index 00000000..4cbc12e4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2010_03_19_to_2010_01_12.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12

+
+
No usage of org.primaresearch.dla.page.layout.converter.Converter_2010_03_19_to_2010_01_12
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2013_07_15_to_2010_03_19.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2013_07_15_to_2010_03_19.html new file mode 100644 index 00000000..dc735920 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/Converter_2013_07_15_to_2010_03_19.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19 (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19

+
+
No usage of org.primaresearch.dla.page.layout.converter.Converter_2013_07_15_to_2010_03_19
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/LayoutConverter.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/LayoutConverter.html new file mode 100644 index 00000000..5ca388ba --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/class-use/LayoutConverter.html @@ -0,0 +1,208 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.converter.LayoutConverter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.converter.LayoutConverter

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-frame.html new file mode 100644 index 00000000..72ffefd8 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-frame.html @@ -0,0 +1,28 @@ + + + + + +org.primaresearch.dla.page.layout.converter (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout.converter

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-summary.html new file mode 100644 index 00000000..acad790e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-summary.html @@ -0,0 +1,200 @@ + + + + + +org.primaresearch.dla.page.layout.converter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout.converter

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-tree.html new file mode 100644 index 00000000..1c44f123 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-tree.html @@ -0,0 +1,138 @@ + + + + + +org.primaresearch.dla.page.layout.converter Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout.converter

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-use.html new file mode 100644 index 00000000..f0e660df --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/converter/package-use.html @@ -0,0 +1,203 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout.converter (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout.converter

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.RelationType.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.RelationType.html new file mode 100644 index 00000000..66cfd946 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.RelationType.html @@ -0,0 +1,322 @@ + + + + + +ContentObjectRelation.RelationType (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Class ContentObjectRelation.RelationType

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.html new file mode 100644 index 00000000..bca13415 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.html @@ -0,0 +1,381 @@ + + + + + +ContentObjectRelation (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Class ContentObjectRelation

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Group.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Group.html new file mode 100644 index 00000000..d4890b9e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Group.html @@ -0,0 +1,541 @@ + + + + + +Group (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Class Group

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/GroupMember.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/GroupMember.html new file mode 100644 index 00000000..219af7b9 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/GroupMember.html @@ -0,0 +1,234 @@ + + + + + +GroupMember (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Interface GroupMember

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Layer.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Layer.html new file mode 100644 index 00000000..5f80c6e1 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Layer.html @@ -0,0 +1,261 @@ + + + + + +Layer (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Class Layer

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Layers.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Layers.html new file mode 100644 index 00000000..9c193b75 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Layers.html @@ -0,0 +1,305 @@ + + + + + +Layers (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Class Layers

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ReadingOrder.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ReadingOrder.html new file mode 100644 index 00000000..9540f3a5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/ReadingOrder.html @@ -0,0 +1,290 @@ + + + + + +ReadingOrder (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Class ReadingOrder

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/RegionRef.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/RegionRef.html new file mode 100644 index 00000000..493815e4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/RegionRef.html @@ -0,0 +1,275 @@ + + + + + +RegionRef (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Class RegionRef

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Relations.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Relations.html new file mode 100644 index 00000000..8656920a --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/Relations.html @@ -0,0 +1,315 @@ + + + + + +Relations (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.logical
+

Class Relations

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ContentObjectRelation.RelationType.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ContentObjectRelation.RelationType.html new file mode 100644 index 00000000..7d463df0 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ContentObjectRelation.RelationType.html @@ -0,0 +1,198 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ContentObjectRelation.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ContentObjectRelation.html new file mode 100644 index 00000000..d9bc0fb8 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ContentObjectRelation.html @@ -0,0 +1,214 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.logical.ContentObjectRelation (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.logical.ContentObjectRelation

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Group.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Group.html new file mode 100644 index 00000000..5cd793ea --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Group.html @@ -0,0 +1,220 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.logical.Group (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.logical.Group

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/GroupMember.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/GroupMember.html new file mode 100644 index 00000000..a0e918c5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/GroupMember.html @@ -0,0 +1,206 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.logical.GroupMember (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.logical.GroupMember

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Layer.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Layer.html new file mode 100644 index 00000000..88e9f1c8 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Layer.html @@ -0,0 +1,274 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.logical.Layer (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.logical.Layer

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Layers.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Layers.html new file mode 100644 index 00000000..22351abd --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Layers.html @@ -0,0 +1,188 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.logical.Layers (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.logical.Layers

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ReadingOrder.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ReadingOrder.html new file mode 100644 index 00000000..24aec128 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/ReadingOrder.html @@ -0,0 +1,188 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.logical.ReadingOrder (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.logical.ReadingOrder

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/RegionRef.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/RegionRef.html new file mode 100644 index 00000000..fc46d4e5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/RegionRef.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.logical.RegionRef (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.logical.RegionRef

+
+
No usage of org.primaresearch.dla.page.layout.logical.RegionRef
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Relations.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Relations.html new file mode 100644 index 00000000..19f81a87 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/class-use/Relations.html @@ -0,0 +1,158 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.logical.Relations (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.logical.Relations

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-frame.html new file mode 100644 index 00000000..658c653d --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-frame.html @@ -0,0 +1,30 @@ + + + + + +org.primaresearch.dla.page.layout.logical (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout.logical

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-summary.html new file mode 100644 index 00000000..619dccd3 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-summary.html @@ -0,0 +1,195 @@ + + + + + +org.primaresearch.dla.page.layout.logical (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout.logical

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-tree.html new file mode 100644 index 00000000..e9dfc960 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-tree.html @@ -0,0 +1,143 @@ + + + + + +org.primaresearch.dla.page.layout.logical Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout.logical

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-use.html new file mode 100644 index 00000000..4f7a16c5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/logical/package-use.html @@ -0,0 +1,264 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout.logical (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout.logical

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-frame.html new file mode 100644 index 00000000..5bf20f44 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-frame.html @@ -0,0 +1,21 @@ + + + + + +org.primaresearch.dla.page.layout (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout

+
+

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-summary.html new file mode 100644 index 00000000..5e6f1ac6 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-summary.html @@ -0,0 +1,148 @@ + + + + + +org.primaresearch.dla.page.layout (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-tree.html new file mode 100644 index 00000000..56fff5eb --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-tree.html @@ -0,0 +1,131 @@ + + + + + +org.primaresearch.dla.page.layout Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-use.html new file mode 100644 index 00000000..d974f543 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/package-use.html @@ -0,0 +1,256 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/AttributeContainer.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/AttributeContainer.html new file mode 100644 index 00000000..354597b9 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/AttributeContainer.html @@ -0,0 +1,222 @@ + + + + + +AttributeContainer (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Interface AttributeContainer

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/AttributeFactory.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/AttributeFactory.html new file mode 100644 index 00000000..f5aa25de --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/AttributeFactory.html @@ -0,0 +1,219 @@ + + + + + +AttributeFactory (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Interface AttributeFactory

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentFactory.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentFactory.html new file mode 100644 index 00000000..23de19ba --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentFactory.html @@ -0,0 +1,360 @@ + + + + + +ContentFactory (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Class ContentFactory

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentIterator.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentIterator.html new file mode 100644 index 00000000..3f392005 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentIterator.html @@ -0,0 +1,265 @@ + + + + + +ContentIterator (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Interface ContentIterator

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentObject.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentObject.html new file mode 100644 index 00000000..3b991e69 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentObject.html @@ -0,0 +1,304 @@ + + + + + +ContentObject (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Interface ContentObject

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentObjectProcessor.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentObjectProcessor.html new file mode 100644 index 00000000..d959c45c --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/ContentObjectProcessor.html @@ -0,0 +1,327 @@ + + + + + +ContentObjectProcessor (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Class ContentObjectProcessor

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/DefaultAttributeFactory.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/DefaultAttributeFactory.html new file mode 100644 index 00000000..57576dde --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/DefaultAttributeFactory.html @@ -0,0 +1,294 @@ + + + + + +DefaultAttributeFactory (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Class DefaultAttributeFactory

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/Region.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/Region.html new file mode 100644 index 00000000..5c0b0cbd --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/Region.html @@ -0,0 +1,272 @@ + + + + + +Region (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Interface Region

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/RegionContainer.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/RegionContainer.html new file mode 100644 index 00000000..d8b31a58 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/RegionContainer.html @@ -0,0 +1,290 @@ + + + + + +RegionContainer (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical
+

Interface RegionContainer

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/AttributeContainer.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/AttributeContainer.html new file mode 100644 index 00000000..8f9ac5fe --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/AttributeContainer.html @@ -0,0 +1,350 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.AttributeContainer (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.AttributeContainer

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/AttributeFactory.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/AttributeFactory.html new file mode 100644 index 00000000..320d217e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/AttributeFactory.html @@ -0,0 +1,189 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.AttributeFactory (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.AttributeFactory

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentFactory.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentFactory.html new file mode 100644 index 00000000..4f026950 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentFactory.html @@ -0,0 +1,228 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.ContentFactory (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.ContentFactory

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentIterator.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentIterator.html new file mode 100644 index 00000000..19ebf69a --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentIterator.html @@ -0,0 +1,195 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.ContentIterator (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.ContentIterator

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentObject.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentObject.html new file mode 100644 index 00000000..91d9013e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentObject.html @@ -0,0 +1,476 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.ContentObject (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.ContentObject

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentObjectProcessor.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentObjectProcessor.html new file mode 100644 index 00000000..005a6ab3 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/ContentObjectProcessor.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.ContentObjectProcessor (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.ContentObjectProcessor

+
+
No usage of org.primaresearch.dla.page.layout.physical.ContentObjectProcessor
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/DefaultAttributeFactory.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/DefaultAttributeFactory.html new file mode 100644 index 00000000..7029b92c --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/DefaultAttributeFactory.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.DefaultAttributeFactory (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.DefaultAttributeFactory

+
+
No usage of org.primaresearch.dla.page.layout.physical.DefaultAttributeFactory
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/Region.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/Region.html new file mode 100644 index 00000000..10478324 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/Region.html @@ -0,0 +1,408 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.Region (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.Region

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/RegionContainer.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/RegionContainer.html new file mode 100644 index 00000000..370f0074 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/class-use/RegionContainer.html @@ -0,0 +1,462 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.RegionContainer (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.RegionContainer

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/AdvertRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/AdvertRegion.html new file mode 100644 index 00000000..f34539ca --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/AdvertRegion.html @@ -0,0 +1,341 @@ + + + + + +AdvertRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class AdvertRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ChartRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ChartRegion.html new file mode 100644 index 00000000..c5c5c9b4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ChartRegion.html @@ -0,0 +1,419 @@ + + + + + +ChartRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class ChartRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ChemRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ChemRegion.html new file mode 100644 index 00000000..f7ee2135 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ChemRegion.html @@ -0,0 +1,341 @@ + + + + + +ChemRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class ChemRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/FrameRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/FrameRegion.html new file mode 100644 index 00000000..89b1479c --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/FrameRegion.html @@ -0,0 +1,341 @@ + + + + + +FrameRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class FrameRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/GraphicRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/GraphicRegion.html new file mode 100644 index 00000000..287fe584 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/GraphicRegion.html @@ -0,0 +1,393 @@ + + + + + +GraphicRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class GraphicRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ImageRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ImageRegion.html new file mode 100644 index 00000000..6cc9be2b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/ImageRegion.html @@ -0,0 +1,393 @@ + + + + + +ImageRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class ImageRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/LineDrawingRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/LineDrawingRegion.html new file mode 100644 index 00000000..c21cb88d --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/LineDrawingRegion.html @@ -0,0 +1,393 @@ + + + + + +LineDrawingRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class LineDrawingRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/LowLevelTextObjectIterator.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/LowLevelTextObjectIterator.html new file mode 100644 index 00000000..5344d524 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/LowLevelTextObjectIterator.html @@ -0,0 +1,344 @@ + + + + + +LowLevelTextObjectIterator (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class LowLevelTextObjectIterator

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/MathsRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/MathsRegion.html new file mode 100644 index 00000000..5c33c177 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/MathsRegion.html @@ -0,0 +1,341 @@ + + + + + +MathsRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class MathsRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/MusicRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/MusicRegion.html new file mode 100644 index 00000000..3493e5da --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/MusicRegion.html @@ -0,0 +1,341 @@ + + + + + +MusicRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class MusicRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/NoiseRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/NoiseRegion.html new file mode 100644 index 00000000..70675793 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/NoiseRegion.html @@ -0,0 +1,273 @@ + + + + + +NoiseRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class NoiseRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/RegionImpl.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/RegionImpl.html new file mode 100644 index 00000000..0ce3dc72 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/RegionImpl.html @@ -0,0 +1,591 @@ + + + + + +RegionImpl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class RegionImpl

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/RegionIterator.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/RegionIterator.html new file mode 100644 index 00000000..5a56a261 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/RegionIterator.html @@ -0,0 +1,432 @@ + + + + + +RegionIterator (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class RegionIterator

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/SeparatorRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/SeparatorRegion.html new file mode 100644 index 00000000..35c6c28f --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/SeparatorRegion.html @@ -0,0 +1,341 @@ + + + + + +SeparatorRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class SeparatorRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/TableRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/TableRegion.html new file mode 100644 index 00000000..87dc9d40 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/TableRegion.html @@ -0,0 +1,471 @@ + + + + + +TableRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.impl
+

Class TableRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/AdvertRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/AdvertRegion.html new file mode 100644 index 00000000..93c53c4e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/AdvertRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.AdvertRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.AdvertRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.AdvertRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ChartRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ChartRegion.html new file mode 100644 index 00000000..ec5c6eba --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ChartRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.ChartRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.ChartRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.ChartRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ChemRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ChemRegion.html new file mode 100644 index 00000000..023166ff --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ChemRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.ChemRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.ChemRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.ChemRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/FrameRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/FrameRegion.html new file mode 100644 index 00000000..13cc4f57 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/FrameRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.FrameRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.FrameRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.FrameRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/GraphicRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/GraphicRegion.html new file mode 100644 index 00000000..12aab9e7 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/GraphicRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.GraphicRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.GraphicRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.GraphicRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ImageRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ImageRegion.html new file mode 100644 index 00000000..55ad4dd0 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/ImageRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.ImageRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.ImageRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.ImageRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/LineDrawingRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/LineDrawingRegion.html new file mode 100644 index 00000000..e2a7cee4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/LineDrawingRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/LowLevelTextObjectIterator.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/LowLevelTextObjectIterator.html new file mode 100644 index 00000000..999dbcde --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/LowLevelTextObjectIterator.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/MathsRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/MathsRegion.html new file mode 100644 index 00000000..71987d29 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/MathsRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.MathsRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.MathsRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.MathsRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/MusicRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/MusicRegion.html new file mode 100644 index 00000000..d3a80161 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/MusicRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.MusicRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.MusicRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.MusicRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/NoiseRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/NoiseRegion.html new file mode 100644 index 00000000..be8238fe --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/NoiseRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.NoiseRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.NoiseRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.NoiseRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/RegionImpl.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/RegionImpl.html new file mode 100644 index 00000000..d96869f7 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/RegionImpl.html @@ -0,0 +1,248 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.RegionImpl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.RegionImpl

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/RegionIterator.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/RegionIterator.html new file mode 100644 index 00000000..f7848672 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/RegionIterator.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.RegionIterator (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.RegionIterator

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.RegionIterator
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/SeparatorRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/SeparatorRegion.html new file mode 100644 index 00000000..a665d731 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/SeparatorRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/TableRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/TableRegion.html new file mode 100644 index 00000000..0bc09ca7 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/class-use/TableRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.impl.TableRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.impl.TableRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.impl.TableRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-frame.html new file mode 100644 index 00000000..85170882 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-frame.html @@ -0,0 +1,33 @@ + + + + + +org.primaresearch.dla.page.layout.physical.impl (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout.physical.impl

+
+

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-summary.html new file mode 100644 index 00000000..22442bce --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-summary.html @@ -0,0 +1,220 @@ + + + + + +org.primaresearch.dla.page.layout.physical.impl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout.physical.impl

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-tree.html new file mode 100644 index 00000000..62518495 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-tree.html @@ -0,0 +1,146 @@ + + + + + +org.primaresearch.dla.page.layout.physical.impl Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout.physical.impl

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-use.html new file mode 100644 index 00000000..4368effb --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/impl/package-use.html @@ -0,0 +1,172 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout.physical.impl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout.physical.impl

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-frame.html new file mode 100644 index 00000000..23445084 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-frame.html @@ -0,0 +1,30 @@ + + + + + +org.primaresearch.dla.page.layout.physical (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout.physical

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-summary.html new file mode 100644 index 00000000..a6007e95 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-summary.html @@ -0,0 +1,197 @@ + + + + + +org.primaresearch.dla.page.layout.physical (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout.physical

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-tree.html new file mode 100644 index 00000000..e89b3aa5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-tree.html @@ -0,0 +1,168 @@ + + + + + +org.primaresearch.dla.page.layout.physical Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout.physical

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-use.html new file mode 100644 index 00000000..f514318e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/package-use.html @@ -0,0 +1,367 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout.physical (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout.physical

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/ContentType.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/ContentType.html new file mode 100644 index 00000000..64449bde --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/ContentType.html @@ -0,0 +1,364 @@ + + + + + +ContentType (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.shared
+

Class ContentType

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/LowLevelTextType.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/LowLevelTextType.html new file mode 100644 index 00000000..57dd3f6a --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/LowLevelTextType.html @@ -0,0 +1,349 @@ + + + + + +LowLevelTextType (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.shared
+

Class LowLevelTextType

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/RegionType.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/RegionType.html new file mode 100644 index 00000000..a1777cb5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/RegionType.html @@ -0,0 +1,509 @@ + + + + + +RegionType (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.shared
+

Class RegionType

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/ContentType.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/ContentType.html new file mode 100644 index 00000000..cc662828 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/ContentType.html @@ -0,0 +1,390 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.shared.ContentType (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.shared.ContentType

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/LowLevelTextType.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/LowLevelTextType.html new file mode 100644 index 00000000..c431b4eb --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/LowLevelTextType.html @@ -0,0 +1,218 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/RegionType.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/RegionType.html new file mode 100644 index 00000000..5f7a2eb2 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/class-use/RegionType.html @@ -0,0 +1,419 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.shared.RegionType (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.shared.RegionType

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-frame.html new file mode 100644 index 00000000..03343356 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-frame.html @@ -0,0 +1,21 @@ + + + + + +org.primaresearch.dla.page.layout.physical.shared (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout.physical.shared

+
+

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-summary.html new file mode 100644 index 00000000..7331981e --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-summary.html @@ -0,0 +1,148 @@ + + + + + +org.primaresearch.dla.page.layout.physical.shared (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout.physical.shared

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-tree.html new file mode 100644 index 00000000..62f7184f --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-tree.html @@ -0,0 +1,134 @@ + + + + + +org.primaresearch.dla.page.layout.physical.shared Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout.physical.shared

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-use.html new file mode 100644 index 00000000..94b5f100 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/shared/package-use.html @@ -0,0 +1,286 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout.physical.shared (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout.physical.shared

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainer.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainer.html new file mode 100644 index 00000000..ee49d805 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainer.html @@ -0,0 +1,363 @@ + + + + + +LowLevelTextContainer (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text
+

Interface LowLevelTextContainer

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainerImpl.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainerImpl.html new file mode 100644 index 00000000..6f5882dc --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainerImpl.html @@ -0,0 +1,354 @@ + + + + + +LowLevelTextContainerImpl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text
+

Class LowLevelTextContainerImpl

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextObject.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextObject.html new file mode 100644 index 00000000..0bfe3686 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/LowLevelTextObject.html @@ -0,0 +1,603 @@ + + + + + +LowLevelTextObject (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text
+

Class LowLevelTextObject

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/TextObject.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/TextObject.html new file mode 100644 index 00000000..17db908f --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/TextObject.html @@ -0,0 +1,569 @@ + + + + + +TextObject (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text
+

Interface TextObject

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextContainer.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextContainer.html new file mode 100644 index 00000000..9916439b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextContainer.html @@ -0,0 +1,251 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextContainerImpl.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextContainerImpl.html new file mode 100644 index 00000000..cddafeaa --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextContainerImpl.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl

+
+
No usage of org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextObject.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextObject.html new file mode 100644 index 00000000..8a3b2437 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/LowLevelTextObject.html @@ -0,0 +1,321 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/TextObject.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/TextObject.html new file mode 100644 index 00000000..a5eaaa2f --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/class-use/TextObject.html @@ -0,0 +1,200 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.text.TextObject (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.text.TextObject

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/DefaultTextRegionTypes.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/DefaultTextRegionTypes.html new file mode 100644 index 00000000..21184982 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/DefaultTextRegionTypes.html @@ -0,0 +1,435 @@ + + + + + +DefaultTextRegionTypes (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text.impl
+

Interface DefaultTextRegionTypes

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/Glyph.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/Glyph.html new file mode 100644 index 00000000..a5990ec8 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/Glyph.html @@ -0,0 +1,593 @@ + + + + + +Glyph (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text.impl
+

Class Glyph

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/TextLine.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/TextLine.html new file mode 100644 index 00000000..1bdb0075 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/TextLine.html @@ -0,0 +1,934 @@ + + + + + +TextLine (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text.impl
+

Class TextLine

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/TextRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/TextRegion.html new file mode 100644 index 00000000..d1a84844 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/TextRegion.html @@ -0,0 +1,1421 @@ + + + + + +TextRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text.impl
+

Class TextRegion

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/Word.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/Word.html new file mode 100644 index 00000000..863e7d9a --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/Word.html @@ -0,0 +1,902 @@ + + + + + +Word (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.physical.text.impl
+

Class Word

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/DefaultTextRegionTypes.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/DefaultTextRegionTypes.html new file mode 100644 index 00000000..e1b63d8b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/DefaultTextRegionTypes.html @@ -0,0 +1,116 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes

+
+
No usage of org.primaresearch.dla.page.layout.physical.text.impl.DefaultTextRegionTypes
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/Glyph.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/Glyph.html new file mode 100644 index 00000000..4dcdf9e4 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/Glyph.html @@ -0,0 +1,162 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.text.impl.Glyph (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.text.impl.Glyph

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/TextLine.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/TextLine.html new file mode 100644 index 00000000..fc43abc5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/TextLine.html @@ -0,0 +1,164 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.text.impl.TextLine (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.text.impl.TextLine

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/TextRegion.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/TextRegion.html new file mode 100644 index 00000000..216bcf75 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/TextRegion.html @@ -0,0 +1,116 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.text.impl.TextRegion (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.text.impl.TextRegion

+
+
No usage of org.primaresearch.dla.page.layout.physical.text.impl.TextRegion
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/Word.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/Word.html new file mode 100644 index 00000000..c26e90e0 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/class-use/Word.html @@ -0,0 +1,162 @@ + + + + + +Uses of Class org.primaresearch.dla.page.layout.physical.text.impl.Word (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Class
org.primaresearch.dla.page.layout.physical.text.impl.Word

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-frame.html new file mode 100644 index 00000000..a1a5c8c3 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-frame.html @@ -0,0 +1,26 @@ + + + + + +org.primaresearch.dla.page.layout.physical.text.impl (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout.physical.text.impl

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-summary.html new file mode 100644 index 00000000..f1f0e739 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-summary.html @@ -0,0 +1,171 @@ + + + + + +org.primaresearch.dla.page.layout.physical.text.impl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout.physical.text.impl

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-tree.html new file mode 100644 index 00000000..5a0d38f5 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-tree.html @@ -0,0 +1,144 @@ + + + + + +org.primaresearch.dla.page.layout.physical.text.impl Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout.physical.text.impl

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-use.html new file mode 100644 index 00000000..d480af1c --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/impl/package-use.html @@ -0,0 +1,161 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout.physical.text.impl (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout.physical.text.impl

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-frame.html new file mode 100644 index 00000000..82c6f84d --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-frame.html @@ -0,0 +1,25 @@ + + + + + +org.primaresearch.dla.page.layout.physical.text (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout.physical.text

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-summary.html new file mode 100644 index 00000000..a6e0116b --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-summary.html @@ -0,0 +1,165 @@ + + + + + +org.primaresearch.dla.page.layout.physical.text (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout.physical.text

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-tree.html new file mode 100644 index 00000000..f825f134 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-tree.html @@ -0,0 +1,135 @@ + + + + + +org.primaresearch.dla.page.layout.physical.text Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout.physical.text

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-use.html new file mode 100644 index 00000000..1b924e48 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/physical/text/package-use.html @@ -0,0 +1,192 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout.physical.text (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout.physical.text

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/GeometricObject.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/GeometricObject.html new file mode 100644 index 00000000..0839a656 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/GeometricObject.html @@ -0,0 +1,239 @@ + + + + + +GeometricObject (PrimaDla API) + + + + + + + +
+ + + + + +
+ + + +
+
org.primaresearch.dla.page.layout.shared
+

Interface GeometricObject

+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/class-use/GeometricObject.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/class-use/GeometricObject.html new file mode 100644 index 00000000..d7344309 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/class-use/GeometricObject.html @@ -0,0 +1,397 @@ + + + + + +Uses of Interface org.primaresearch.dla.page.layout.shared.GeometricObject (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Interface
org.primaresearch.dla.page.layout.shared.GeometricObject

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-frame.html new file mode 100644 index 00000000..217ab39c --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-frame.html @@ -0,0 +1,19 @@ + + + + + +org.primaresearch.dla.page.layout.shared (PrimaDla API) + + + + +

org.primaresearch.dla.page.layout.shared

+
+

Interfaces

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-summary.html new file mode 100644 index 00000000..6f3f2add --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-summary.html @@ -0,0 +1,136 @@ + + + + + +org.primaresearch.dla.page.layout.shared (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page.layout.shared

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-tree.html new file mode 100644 index 00000000..5aa9d8f6 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-tree.html @@ -0,0 +1,125 @@ + + + + + +org.primaresearch.dla.page.layout.shared Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page.layout.shared

+Package Hierarchies: + +
+
+

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-use.html new file mode 100644 index 00000000..7933443f --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/layout/shared/package-use.html @@ -0,0 +1,235 @@ + + + + + +Uses of Package org.primaresearch.dla.page.layout.shared (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page.layout.shared

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-frame.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-frame.html new file mode 100644 index 00000000..f5f1fa47 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-frame.html @@ -0,0 +1,22 @@ + + + + + +org.primaresearch.dla.page (PrimaDla API) + + + + +

org.primaresearch.dla.page

+
+

Classes

+ +
+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-summary.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-summary.html new file mode 100644 index 00000000..ba217208 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-summary.html @@ -0,0 +1,155 @@ + + + + + +org.primaresearch.dla.page (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Package org.primaresearch.dla.page

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-tree.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-tree.html new file mode 100644 index 00000000..87b5fffb --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-tree.html @@ -0,0 +1,132 @@ + + + + + +org.primaresearch.dla.page Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For Package org.primaresearch.dla.page

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-use.html b/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-use.html new file mode 100644 index 00000000..1a3ce966 --- /dev/null +++ b/java/PrimaDla/apidoc/org/primaresearch/dla/page/package-use.html @@ -0,0 +1,267 @@ + + + + + +Uses of Package org.primaresearch.dla.page (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Uses of Package
org.primaresearch.dla.page

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/overview-frame.html b/java/PrimaDla/apidoc/overview-frame.html new file mode 100644 index 00000000..ef4e7524 --- /dev/null +++ b/java/PrimaDla/apidoc/overview-frame.html @@ -0,0 +1,32 @@ + + + + + +Overview List (PrimaDla API) + + + + +
All Classes
+
+

Packages

+ +
+

 

+ + diff --git a/java/PrimaDla/apidoc/overview-summary.html b/java/PrimaDla/apidoc/overview-summary.html new file mode 100644 index 00000000..be03afe8 --- /dev/null +++ b/java/PrimaDla/apidoc/overview-summary.html @@ -0,0 +1,178 @@ + + + + + +Overview (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Prima DLA Java Library

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
org.primaresearch.dla.page 
org.primaresearch.dla.page.io 
org.primaresearch.dla.page.io.xml 
org.primaresearch.dla.page.io.xml.sax 
org.primaresearch.dla.page.layout 
org.primaresearch.dla.page.layout.converter 
org.primaresearch.dla.page.layout.logical 
org.primaresearch.dla.page.layout.physical 
org.primaresearch.dla.page.layout.physical.impl 
org.primaresearch.dla.page.layout.physical.shared 
org.primaresearch.dla.page.layout.physical.text 
org.primaresearch.dla.page.layout.physical.text.impl 
org.primaresearch.dla.page.layout.shared 
+
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/overview-tree.html b/java/PrimaDla/apidoc/overview-tree.html new file mode 100644 index 00000000..19fba2a1 --- /dev/null +++ b/java/PrimaDla/apidoc/overview-tree.html @@ -0,0 +1,285 @@ + + + + + +Class Hierarchy (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/package-list b/java/PrimaDla/apidoc/package-list new file mode 100644 index 00000000..6718faa9 --- /dev/null +++ b/java/PrimaDla/apidoc/package-list @@ -0,0 +1,13 @@ +org.primaresearch.dla.page +org.primaresearch.dla.page.io +org.primaresearch.dla.page.io.xml +org.primaresearch.dla.page.io.xml.sax +org.primaresearch.dla.page.layout +org.primaresearch.dla.page.layout.converter +org.primaresearch.dla.page.layout.logical +org.primaresearch.dla.page.layout.physical +org.primaresearch.dla.page.layout.physical.impl +org.primaresearch.dla.page.layout.physical.shared +org.primaresearch.dla.page.layout.physical.text +org.primaresearch.dla.page.layout.physical.text.impl +org.primaresearch.dla.page.layout.shared diff --git a/java/PrimaDla/apidoc/resources/background.gif b/java/PrimaDla/apidoc/resources/background.gif new file mode 100644 index 00000000..f471940f Binary files /dev/null and b/java/PrimaDla/apidoc/resources/background.gif differ diff --git a/java/PrimaDla/apidoc/resources/tab.gif b/java/PrimaDla/apidoc/resources/tab.gif new file mode 100644 index 00000000..1a73a83b Binary files /dev/null and b/java/PrimaDla/apidoc/resources/tab.gif differ diff --git a/java/PrimaDla/apidoc/resources/titlebar.gif b/java/PrimaDla/apidoc/resources/titlebar.gif new file mode 100644 index 00000000..17443b3e Binary files /dev/null and b/java/PrimaDla/apidoc/resources/titlebar.gif differ diff --git a/java/PrimaDla/apidoc/resources/titlebar_end.gif b/java/PrimaDla/apidoc/resources/titlebar_end.gif new file mode 100644 index 00000000..3ad78d46 Binary files /dev/null and b/java/PrimaDla/apidoc/resources/titlebar_end.gif differ diff --git a/java/PrimaDla/apidoc/serialized-form.html b/java/PrimaDla/apidoc/serialized-form.html new file mode 100644 index 00000000..d969af64 --- /dev/null +++ b/java/PrimaDla/apidoc/serialized-form.html @@ -0,0 +1,203 @@ + + + + + +Serialized Form (PrimaDla API) + + + + + + + +
+ + + + + +
+ + +
+

Serialized Form

+
+
+ +
+ +
+ + + + + +
+ + +

Copyright © 2014 PPImA Research Lab. All Rights Reserved.

+ + diff --git a/java/PrimaDla/apidoc/stylesheet.css b/java/PrimaDla/apidoc/stylesheet.css new file mode 100644 index 00000000..0aeaa97f --- /dev/null +++ b/java/PrimaDla/apidoc/stylesheet.css @@ -0,0 +1,474 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ +body { + background-color:#ffffff; + color:#353833; + font-family:Arial, Helvetica, sans-serif; + font-size:76%; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4c6b87; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4c6b87; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-size:1.3em; +} +h1 { + font-size:1.8em; +} +h2 { + font-size:1.5em; +} +h3 { + font-size:1.4em; +} +h4 { + font-size:1.3em; +} +h5 { + font-size:1.2em; +} +h6 { + font-size:1.1em; +} +ul { + list-style-type:disc; +} +code, tt { + font-size:1.2em; +} +dt code { + font-size:1.2em; +} +table tr td dt code { + font-size:1.2em; + vertical-align:top; +} +sup { + font-size:.6em; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:.8em; + z-index:200; + margin-top:-7px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + background-image:url(resources/titlebar.gif); + background-position:left top; + background-repeat:no-repeat; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:1em; + margin:0; +} +.topNav { + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; +} +.bottomNav { + margin-top:10px; + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; +} +.subNav { + background-color:#dee3e9; + border-bottom:1px solid #9eadc0; + float:left; + width:100%; + overflow:hidden; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding:3px 6px; +} +ul.subNavList li{ + list-style:none; + float:left; + font-size:90%; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; +} +.navBarCell1Rev { + background-image:url(resources/tab.gif); + background-color:#a88834; + color:#FFFFFF; + margin: auto 5px; + border:1px solid #c9aa44; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader h1 { + font-size:1.3em; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 25px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:1.2em; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + margin:0 0 6px -8px; + padding:2px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + margin:0 0 6px -8px; + padding:2px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:1.0em; +} +.indexContainer h2 { + font-size:1.1em; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:1.1em; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:10px 0 10px 20px; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:25px; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #9eadc0; + background-color:#f9f9f9; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:1px solid #9eadc0; + border-top:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; + border-bottom:1px solid #9eadc0; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.contentContainer table, .classUseContainer table, .constantValuesContainer table { + border-bottom:1px solid #9eadc0; + width:100%; +} +.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table { + width:100%; +} +.contentContainer .description table, .contentContainer .details table { + border-bottom:none; +} +.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{ + vertical-align:top; + padding-right:20px; +} +.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast, +.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast, +.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne, +.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne { + padding-right:3px; +} +.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#FFFFFF; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + margin:0px; +} +caption a:link, caption a:hover, caption a:active, caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span { + white-space:nowrap; + padding-top:8px; + padding-left:8px; + display:block; + float:left; + background-image:url(resources/titlebar.gif); + height:18px; +} +.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { + width:10px; + background-image:url(resources/titlebar_end.gif); + background-repeat:no-repeat; + background-position:top right; + position:relative; + float:left; +} +ul.blockList ul.blockList li.blockList table { + margin:0 0 12px 0px; + width:100%; +} +.tableSubHeadingColor { + background-color: #EEEEFF; +} +.altColor { + background-color:#eeeeef; +} +.rowColor { + background-color:#ffffff; +} +.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td { + text-align:left; + padding:3px 3px 3px 7px; +} +th.colFirst, th.colLast, th.colOne, .constantValuesContainer th { + background:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + text-align:left; + padding:3px 3px 3px 7px; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +td.colFirst, th.colFirst { + border-left:1px solid #9eadc0; + white-space:nowrap; +} +td.colLast, th.colLast { + border-right:1px solid #9eadc0; +} +td.colOne, th.colOne { + border-right:1px solid #9eadc0; + border-left:1px solid #9eadc0; +} +table.overviewSummary { + padding:0px; + margin-left:0px; +} +table.overviewSummary td.colFirst, table.overviewSummary th.colFirst, +table.overviewSummary td.colOne, table.overviewSummary th.colOne { + width:25%; + vertical-align:middle; +} +table.packageSummary td.colFirst, table.overviewSummary th.colFirst { + width:25%; + vertical-align:middle; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:.9em; +} +.block { + display:block; + margin:3px 0 0 0; +} +.strong { + font-weight:bold; +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/PrimaDla.gwt.xml b/java/PrimaDla/src/org/primaresearch/dla/PrimaDla.gwt.xml new file mode 100644 index 00000000..649a8a19 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/PrimaDla.gwt.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/MetaData.java b/java/PrimaDla/src/org/primaresearch/dla/page/MetaData.java new file mode 100644 index 00000000..5d380aba --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/MetaData.java @@ -0,0 +1,119 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page; + +import java.io.Serializable; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * Class for document metadata such as creation date, comments, ... + * + * @author Christian Clausner + * + */ +public class MetaData implements Serializable { + + private static final long serialVersionUID = 1L; + + public static DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); //TODO cannot be used in GWT projects! + + private String creator = null; + private long created = 0L; + private long lastModified = 0L; + private String comments = null; + + /** + * Returns the creating person, institution, and/or tool + * @return Creator description + */ + public String getCreator() { + return creator; + } + + /** + * Sets the creating person, institution, and/or tool + * @param creator Creator description + */ + public void setCreator(String creator) { + this.creator = creator; + } + + /** + * Returns comments (generic) + * @return Comments text + */ + public String getComments() { + return comments; + } + + /** + * Sets generic comments + * @param comments Comments text + */ + public void setComments(String comments) { + this.comments = comments; + } + + /** + * Returns the creation date/time + * @return Date and time formatted according to the DATE_FORMAT constant + */ + public String getFormattedCreationTime() { + return DATE_FORMAT.format(new Date(created)); + } + + /** + * Returns the creation date/time + * @return Date object + */ + public Date getCreationTime() { + return new Date(created); + } + + /** + * Returns the modification date/time + * @return Date and time formatted according to the DATE_FORMAT constant + */ + public String getFormattedLastModificationTime() { + return DATE_FORMAT.format(new Date(lastModified)); + } + + /** + * Returns the modification date/time + * @return Date object + */ + public Date getLastModificationTime() { + return new Date(lastModified); + } + + /** + * Sets the creation date/time + * @param d Date object + */ + public void setCreationTime(Date d) { + created = d.getTime(); + } + + /** + * Sets the modification date/time + * @param d Date object + */ + public void setLastModifiedTime(Date d) { + lastModified = d.getTime(); + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/Page.java b/java/PrimaDla/src/org/primaresearch/dla/page/Page.java new file mode 100644 index 00000000..310119bc --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/Page.java @@ -0,0 +1,268 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page; + +import java.util.ArrayList; +import java.util.List; + +import org.primaresearch.dla.page.io.xml.PageXmlInputOutput; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.converter.ConversionMessage; +import org.primaresearch.dla.page.layout.converter.ConverterHub; +import org.primaresearch.dla.page.layout.physical.AttributeContainer; +import org.primaresearch.dla.page.layout.physical.AttributeFactory; +import org.primaresearch.dla.page.layout.physical.ContentFactory; +import org.primaresearch.dla.page.layout.physical.DefaultAttributeFactory; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.ident.XmlIdRegister; +import org.primaresearch.io.FormatModel; +import org.primaresearch.io.FormatVersion; +import org.primaresearch.shared.variable.VariableMap; + +/** + * Central class representing one page of a document (e.g. a book page). + * + * @author Christian Clausner + */ +public class Page implements AttributeContainer { + + private PageLayout layout; + private ContentFactory contentFactory; + private IdRegister idRegister; + private MetaData metaData; + private String imageFilename; + private Id gtsId = null; + private FormatVersion formatVersion = null; + + private VariableMap attributes; + + private List alternativeImages; + + private MeasurementUnit measurementUnit = MeasurementUnit.PIXEL; + + + /** + * Returns the version of the page format. + * @return Version object + */ + public FormatVersion getFormatVersion() { + return formatVersion; + } + + /** + * Converts the page to the specified format. + * Note that this might change the page layout. + */ + public List setFormatVersion(FormatModel formatModel) { + contentFactory.setAttributeFactory(createAttributeFactory(formatModel)); + List ret = ConverterHub.convert(this, formatModel); + this.formatVersion = formatModel.getVersion(); + return ret; + } + + private AttributeFactory createAttributeFactory(FormatModel formatModel) { + AttributeFactory attribFactory = null; + if (formatModel != null) { + attribFactory = new DefaultAttributeFactory(formatModel); + } else { + attribFactory = new DefaultAttributeFactory(); + } + return attribFactory; + } + + /** + * Returns the main image file that is associated with this page. + * @return Filename + */ + public String getImageFilename() { + return imageFilename; + } + + /** + * Sets the main image file that is associated with this page. + * @param imageFilename Filename (without path) + */ + public void setImageFilename(String imageFilename) { + this.imageFilename = imageFilename; + } + + /** + * Constructor using the default page format. + */ + public Page() { + this(PageXmlInputOutput.getLatestSchemaModel()); + } + + /** + * Constructor using dynamic page format. + * @param formatModel Model for dynamic format + */ + public Page(FormatModel formatModel) { + this.idRegister = new XmlIdRegister(); + this.formatVersion = formatModel.getVersion(); + AttributeFactory attrFactory = createAttributeFactory(formatModel); + contentFactory = new ContentFactory(idRegister, attrFactory); + layout = new PageLayout(contentFactory); + metaData = new MetaData(); + attributes = attrFactory.createAttributes(ContentType.Page); + } + + /** + * Returns the page layout + * @return Layout object + */ + public PageLayout getLayout() { + return layout; + } + + /** + * Returns the page metadata + * @return Metadata object + */ + public MetaData getMetaData() { + return metaData; + } + + /** + * Returns the ground truth and storage ID of this page + * @return ID object + */ + public Id getGtsId() { + return gtsId; + } + + /** + * Sets the ground truth and storage ID of this page + * @param gtsId ID object + * @throws InvalidIdException ID is being used already (must be unique) + */ + public void setGtsId(Id gtsId) throws InvalidIdException { + idRegister.registerId(gtsId, this.gtsId); + this.gtsId = gtsId; + } + + /** + * Sets the ground truth and storage ID of this page + * @param gtsId ID text + * @throws InvalidIdException ID is being used already (must be unique) or the format is invalid + */ + public void setGtsId(String gtsId) throws InvalidIdException { + this.gtsId = idRegister.registerId(gtsId, this.gtsId); + } + + @Override + public VariableMap getAttributes() { + return attributes; + } + + /** + * Returns a list of alternative images that are associated with this page (e.g. bilevel/bitonal/black-and-white image) + * @return List with image objects + */ + public List getAlternativeImages() { + if (alternativeImages == null) + alternativeImages = new ArrayList(); + return alternativeImages; + } + + + + /** + * Alternative document page image (e.g. black-and-white or grey level) + * + * @author Christian Clausner + * + */ + public static final class AlternativeImage { + private String filename; + private String comments; + + public AlternativeImage(String filename) { + this.filename = filename; + } + + public String getFilename() { + return filename; + } + public void setFilename(String filename) { + this.filename = filename; + } + public String getComments() { + return comments; + } + public void setComments(String comments) { + this.comments = comments; + } + } + + /** + * Returns the measurement unit for coordinates + * @return Current unit + */ + public MeasurementUnit getMeasurementUnit() { + return measurementUnit; + } + + /** + * Sets the measurement unit for coordinates + * @param unit Unit object + */ + public void setMeasurementUnit(MeasurementUnit unit) { + this.measurementUnit = unit; + } + + + + + /** + * Measurement unit for coordinates.
+ * Introduced to support ALTO XML files. Use XmlInputOutput.postProcessPage(...) + * to scale all coordinates using the image information. + */ + public static class MeasurementUnit { + public static final MeasurementUnit PIXEL = new MeasurementUnit("pixel", 0.0); + /** One tenth of a mm */ + public static final MeasurementUnit MM_BY_10 = new MeasurementUnit("mm10", 254.0); + /** 1200th of an inch */ + public static final MeasurementUnit INCH_BY_1200 = new MeasurementUnit("inch1200", 1200.0); + + private String name; + private double discreteValuesPerInch; + + public MeasurementUnit(String name, double discreteValuesPerInch) { + this.name = name; + this.discreteValuesPerInch = discreteValuesPerInch; + } + + public double getDiscreteValuesPerInch() { + return discreteValuesPerInch; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object other) { + if (other == null || !(other instanceof MeasurementUnit)) + return false; + return name.equals(((MeasurementUnit)other).getName()); + } + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/FileInput.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/FileInput.java new file mode 100644 index 00000000..d44e2e67 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/FileInput.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io; + +import java.io.File; + +/** + * Input source implementation for files + * + * @author Christian Clausner + * + */ +public class FileInput implements InputSource { + + + private File file; + + public FileInput(File file) { + this.file = file; + } + + public File getFile() { + return file; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/FileTarget.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/FileTarget.java new file mode 100644 index 00000000..c4b0bad5 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/FileTarget.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io; + +import java.io.File; + +/** + * OutputTarget implementation for files. + * + * @author Christian Clausner + * + */ +public class FileTarget implements OutputTarget { + + private File file; + + public FileTarget(File file) { + this.file = file; + } + + public File getFile() { + return file; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/InputSource.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/InputSource.java new file mode 100644 index 00000000..aabc69f5 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/InputSource.java @@ -0,0 +1,26 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io; + +/** + * Interface for input sources such as files or URLs. + * + * @author Christian Clausner + * + */ +public interface InputSource { + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/OutputTarget.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/OutputTarget.java new file mode 100644 index 00000000..b1172c85 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/OutputTarget.java @@ -0,0 +1,26 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io; + +/** + * Interface for output targets (e.g. files). + * + * @author Christian Clausner + * + */ +public interface OutputTarget { + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/PageReader.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/PageReader.java new file mode 100644 index 00000000..e4a74ddd --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/PageReader.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io; + +import org.primaresearch.dla.page.Page; +import org.primaresearch.io.UnsupportedFormatVersionException; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.UnsupportedSchemaVersionException; + +/** + * Reader interface for PAGE. + * + * @author Christian Clausner + * + */ +public interface PageReader { + + /** + * Reads a PAGE input source and returns a Page object. + * @param source Input source of some kind (e.g. FileInput). + * @return Page object + * @throws UnsupportedSchemaVersionException + */ + public Page read(InputSource source) throws UnsupportedFormatVersionException; + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/PageWriter.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/PageWriter.java new file mode 100644 index 00000000..3743ce7f --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/PageWriter.java @@ -0,0 +1,43 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io; + +import org.primaresearch.dla.page.Page; +import org.primaresearch.io.UnsupportedFormatVersionException; + +/** + * Interface for writing PAGE. + * + * @author Christian Clausner + * + */ +public interface PageWriter { + + /** + * Writes the given Page object to an output target. + * + * @return Returns true if written successfully, false otherwise. + */ + public boolean write(Page page, OutputTarget target) throws UnsupportedFormatVersionException; + + /** + * Validates the given page object against the format it is set to. + * + * @return Returns true if valid, false otherwise. + */ + public boolean validate(Page page) throws UnsupportedFormatVersionException; + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/UrlInput.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/UrlInput.java new file mode 100644 index 00000000..7531854e --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/UrlInput.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io; + +import java.net.URL; + +/** + * InputSouce implementation for URLs. + * + * @author Christian Clausner + * + */ +public class UrlInput implements InputSource { + + private URL url; + + public UrlInput(URL url) { + this.url = url; + } + + public URL getUrl() { + return url; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/DefaultXmlNames.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/DefaultXmlNames.java new file mode 100644 index 00000000..95de0c91 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/DefaultXmlNames.java @@ -0,0 +1,169 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; + +/** + * Class containing hard coded XML element and attribute names for the PAGE format. + * + * @author Christian Clausner + * + */ +public class DefaultXmlNames implements XmlNameProvider { + public static final String ELEMENT_PcGts = "PcGts"; + public static final String ELEMENT_Page = "Page"; + public static final String ELEMENT_TextRegion = "TextRegion"; + public static final String ELEMENT_ImageRegion = "ImageRegion"; + public static final String ELEMENT_LineDrawingRegion = "LineDrawingRegion"; + public static final String ELEMENT_GraphicRegion = "GraphicRegion"; + public static final String ELEMENT_TableRegion = "TableRegion"; + public static final String ELEMENT_ChartRegion = "ChartRegion"; + public static final String ELEMENT_SeparatorRegion = "SeparatorRegion"; + public static final String ELEMENT_MathsRegion = "MathsRegion"; + public static final String ELEMENT_NoiseRegion = "NoiseRegion"; + public static final String ELEMENT_FrameRegion = "FrameRegion"; + public static final String ELEMENT_UnknownRegion = "UnknownRegion"; + public static final String ELEMENT_AdvertRegion = "AdvertRegion"; + public static final String ELEMENT_ChemRegion = "ChemRegion"; + public static final String ELEMENT_MusicRegion = "MusicRegion"; + + public static final String ELEMENT_Border = "Border"; + public static final String ELEMENT_ReadingOrder = "ReadingOrder"; + public static final String ELEMENT_RegionRef = "RegionRef"; + public static final String ELEMENT_UnorderedGroup = "UnorderedGroup"; + public static final String ELEMENT_OrderedGroup = "OrderedGroup"; + public static final String ELEMENT_RegionRefIndexed = "RegionRefIndexed"; + public static final String ELEMENT_UnorderedGroupIndexed = "UnorderedGroupIndexed"; + public static final String ELEMENT_OrderedGroupIndexed = "OrderedGroupIndexed"; + public static final String ELEMENT_Layers = "Layers"; + public static final String ELEMENT_Layer = "Layer"; + public static final String ELEMENT_PrintSpace = "PrintSpace"; + + public static final String ELEMENT_Coords = "Coords"; + public static final String ELEMENT_Point = "Point"; + public static final String ELEMENT_TextEquiv = "TextEquiv"; + public static final String ELEMENT_TextLine = "TextLine"; + public static final String ELEMENT_Word = "Word"; + public static final String ELEMENT_Glyph = "Glyph"; + public static final String ELEMENT_PlainText = "PlainText"; + public static final String ELEMENT_Unicode = "Unicode"; + public static final String ELEMENT_Baseline = "Baseline"; + + public static final String ELEMENT_Metadata = "Metadata"; + public static final String ELEMENT_Creator = "Creator"; + public static final String ELEMENT_Created = "Created"; + public static final String ELEMENT_LastChange = "LastChange"; + public static final String ELEMENT_Comments = "Comments"; + + public static final String ELEMENT_AlternativeImage = "AlternativeImage"; + public static final String ELEMENT_Relations = "Relations"; + public static final String ELEMENT_Relation = "Relation"; + public static final String ELEMENT_TextStyle = "TextStyle"; + + + public static final String ATTR_pcGtsId = "pcGtsId"; + public static final String ATTR_imageFilename = "imageFilename"; + public static final String ATTR_imageWidth = "imageWidth"; + public static final String ATTR_imageHeight = "imageHeight"; + public static final String ATTR_id = "id"; + public static final String ATTR_x = "x"; + public static final String ATTR_y = "y"; + public static final String ATTR_orientation = "orientation"; + public static final String ATTR_readingOrientation = "readingOrientation"; + public static final String ATTR_readingDirection = "readingDirection"; + public static final String ATTR_leading = "leading"; + public static final String ATTR_kerning = "kerning"; + public static final String ATTR_fontSize = "fontSize"; + public static final String ATTR_type = "type"; + public static final String ATTR_textColour = "textColour"; + public static final String ATTR_bgColour = "bgColour"; + public static final String ATTR_reverseVideo = "reverseVideo"; + public static final String ATTR_indented = "indented"; + public static final String ATTR_primaryLanguage = "primaryLanguage"; + public static final String ATTR_secondaryLanguage = "secondaryLanguage"; + public static final String ATTR_language = "language"; + public static final String ATTR_primaryScript = "primaryScript"; + public static final String ATTR_secondaryScript = "secondaryScript"; + public static final String ATTR_colourDepth = "colourDepth"; + public static final String ATTR_embText = "embText"; + public static final String ATTR_penColour = "penColour"; + public static final String ATTR_numColours = "numColours"; + public static final String ATTR_rows = "rows"; + public static final String ATTR_columns = "columns"; + public static final String ATTR_lineColour = "lineColour"; + public static final String ATTR_lineSeparators = "lineSeparators"; + public static final String ATTR_colour = "colour"; + public static final String ATTR_borderPresent = "borderPresent"; + public static final String ATTR_symbol = "symbol"; + public static final String ATTR_ligature = "ligature"; + public static final String ATTR_regionRef = "regionRef"; + public static final String ATTR_index = "index"; + public static final String ATTR_zIndex = "zIndex"; + public static final String ATTR_points = "points"; + public static final String ATTR_caption = "caption"; + public static final String ATTR_conf = "conf"; + public static final String ATTR_custom = "custom"; + public static final String ATTR_comments = "comments"; + public static final String ATTR_filename = "filename"; + public static final String ATTR_bold = "bold"; + public static final String ATTR_italic = "italic"; + public static final String ATTR_underlined = "underlined"; + public static final String ATTR_strikethrough = "strikethrough"; + public static final String ATTR_subscript = "subscript"; + public static final String ATTR_superscript = "superscript"; + public static final String ATTR_smallCaps = "smallCaps"; + public static final String ATTR_letterSpaced = "letterSpaced"; + + @Override + public String getXmlName(ContentType type) { + if (type == RegionType.ChartRegion) + return ELEMENT_ChartRegion; + if (type == RegionType.GraphicRegion) + return ELEMENT_GraphicRegion; + if (type == RegionType.ImageRegion) + return ELEMENT_ImageRegion; + if (type == RegionType.LineDrawingRegion) + return ELEMENT_LineDrawingRegion; + if (type == RegionType.MathsRegion) + return ELEMENT_MathsRegion; + if (type == RegionType.NoiseRegion) + return ELEMENT_NoiseRegion; + if (type == RegionType.SeparatorRegion) + return ELEMENT_SeparatorRegion; + if (type == RegionType.AdvertRegion) + return ELEMENT_AdvertRegion; + if (type == RegionType.ChemRegion) + return ELEMENT_ChemRegion; + if (type == RegionType.MusicRegion) + return ELEMENT_MusicRegion; + if (type == RegionType.TableRegion) + return ELEMENT_TableRegion; + if (type == RegionType.TextRegion) + return ELEMENT_TextRegion; + if (type == RegionType.UnknownRegion) + return ELEMENT_UnknownRegion; + if (type == LowLevelTextType.TextLine) + return ELEMENT_TextLine; + if (type == LowLevelTextType.Word) + return ELEMENT_Word; + if (type == LowLevelTextType.Glyph) + return ELEMENT_Glyph; + return type.getName(); + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/MetsMultiPageReader.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/MetsMultiPageReader.java new file mode 100644 index 00000000..2244bdb2 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/MetsMultiPageReader.java @@ -0,0 +1,168 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.primaresearch.dla.page.io.FileInput; +import org.primaresearch.dla.page.io.InputSource; +import org.primaresearch.dla.page.io.UrlInput; +import org.primaresearch.io.xml.IOError; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + + +/** + * Reader for multiple page file defined in METS XML format. + * + * @author Christian Clausner + * + */ +public class MetsMultiPageReader { + + private SAXParser parser; + private SaxMetsHandler metsHandler = null; + private PageErrorHandler lastErrors; + + public MetsMultiPageReader() { + createParser(); + } + + public List read(InputSource source) { + + lastErrors = new PageErrorHandler(); + + parse(source, lastErrors); + + List pageFiles = null; + + if (!lastErrors.hasErrors()) + pageFiles = metsHandler.getPageFiles(); + + return pageFiles; + } + + /** + * Parses a METS file + */ + private void parse(InputSource input, PageErrorHandler errorHandler) { + try{ + XMLReader reader = parser.getXMLReader(); + reader.setErrorHandler(errorHandler); + reader.setContentHandler(metsHandler); + InputStream inputStream = getInputStream(input); + if (inputStream == null) + return; + org.xml.sax.InputSource saxInput = new org.xml.sax.InputSource(inputStream); + //saxInput.setEncoding("utf-8"); + reader.parse(saxInput); + } catch (Throwable t) { + t.printStackTrace(); + } + } + + /** + * Creates the SAX parser for METS XML. + */ + private void createParser() { + try { + // Obtain a new instance of a SAXParserFactory. + SAXParserFactory factory = SAXParserFactory.newInstance(); + // Specifies that the parser produced by this code will provide support for XML namespaces. + factory.setNamespaceAware(true); + factory.setValidating(false); + + this.metsHandler = new SaxMetsHandler(); + + // Creates a new instance of a SAXParser using the currently configured factory parameters. + parser = factory.newSAXParser(); + + } catch (Throwable t) { + t.printStackTrace(); + } + } + + private InputStream getInputStream(InputSource source) { + if (source instanceof FileInput) { + File f = ((FileInput)source).getFile(); + try { + return new FileInputStream(f); + } catch (FileNotFoundException e) { + e.printStackTrace(); + lastErrors.getErrors().add(new IOError("Could not open stream from file: "+e.getMessage())); + } + } + else if (source instanceof UrlInput) { + try { + return ((UrlInput)source).getUrl().openStream(); + } catch (IOException e) { + e.printStackTrace(); + lastErrors.getErrors().add(new IOError("Could not open stream from URL: "+e.getMessage())); + } + } + else + throw new IllegalArgumentException("Only FileInput and UrlInput allowed for MetsMultiPageReader"); + return null; + } + + + /** + * SAX handler implementation to parse METS. + * + * @author Christian Clausner + */ + private static class SaxMetsHandler extends DefaultHandler { + + private static final String ELEMENT_FLocat = "FLocat"; + private static final String ATTR_href = "xlink:href"; + + private List pageFiles = new ArrayList(); + + public List getPageFiles() { + return pageFiles; + } + + /** + * Receive notification of the start of an element. + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) + throws SAXException { + + if (ELEMENT_FLocat.equals(localName)){ + int i; + if ((i = atts.getIndex(ATTR_href)) >= 0) { + pageFiles.add(atts.getValue(i)); + } + } + } + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/PageErrorHandler.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/PageErrorHandler.java new file mode 100644 index 00000000..6eab334b --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/PageErrorHandler.java @@ -0,0 +1,85 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import java.util.ArrayList; +import java.util.List; + +import org.primaresearch.io.xml.IOError; +import org.primaresearch.io.xml.XmlValidationError; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/** + * Error handler implementation that collects errors and warnings. + * + * @author Christian Clausner + * + */ +public class PageErrorHandler implements ErrorHandler { + + List errors = new ArrayList(); + List warnings = new ArrayList(); + + @Override + public void error(SAXParseException exc) throws SAXException { + errors.add(new XmlValidationError(exc.getMessage(), "Line "+exc.getLineNumber()+", Column: "+exc.getColumnNumber())); + } + + @Override + public void fatalError(SAXParseException exc) throws SAXException { + errors.add(new XmlValidationError(exc.getMessage(), "Line "+exc.getLineNumber()+", Column: "+exc.getColumnNumber())); + } + + @Override + public void warning(SAXParseException exc) throws SAXException { + warnings.add(new XmlValidationError(exc.getMessage(), "Line "+exc.getLineNumber()+", Column: "+exc.getColumnNumber())); + } + + /** + * Checks if there were errors + * @return true if errors were registered + */ + public boolean hasErrors() { + return !errors.isEmpty(); + } + + /** + * Checks if there were warnings + * @return true if warnings were registered + */ + public boolean hasWarnings() { + return !warnings.isEmpty(); + } + + /** + * Returns all registered errors + * @return List of error objects + */ + public List getErrors() { + return errors; + } + + /** + * Returns all registered warnings + * @return List of warning objects + */ + public List getWarnings() { + return warnings; + } + +} \ No newline at end of file diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/PageXmlInputOutput.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/PageXmlInputOutput.java new file mode 100644 index 00000000..95752a64 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/PageXmlInputOutput.java @@ -0,0 +1,355 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import java.io.File; +import java.net.URL; + +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.Page.MeasurementUnit; +import org.primaresearch.dla.page.io.FileInput; +import org.primaresearch.dla.page.io.FileTarget; +import org.primaresearch.dla.page.io.UrlInput; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.ContentIterator; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.io.FormatModel; +import org.primaresearch.io.FormatModelSource; +import org.primaresearch.io.FormatVersion; +import org.primaresearch.io.UnsupportedFormatVersionException; +import org.primaresearch.io.xml.SchemaModelParser; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlValidator; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.NoSchemasException; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.UnsupportedSchemaVersionException; +import org.primaresearch.maths.geometry.Point; +import org.primaresearch.maths.geometry.Polygon; + +/** + * Central access point for reading and writing PAGE XML.
+ *
+ * Note: Page objects can only be saved using the XML format they are set to. + * Call Page.setFormatVersion to convert the page object to another version + * if necessary.
+ *
+ * To validate a page object without writing a file call the validate() method + * of a PageWriter. + * + * @author Christian Clausner + * + */ +public class PageXmlInputOutput implements FormatModelSource { + + private static PageXmlInputOutput instance = null; + private XmlModelAndValidatorProvider validatorProvider; + + /** + * Constructor (private because this is a singleton). + */ + private PageXmlInputOutput() { + try { + validatorProvider = new PageXmlModelAndValidatorProvider(); //Provider supporting the default schemas + } catch (NoSchemasException e) { + e.printStackTrace(); + } + } + + /** + * Returns the instance of the singleton. + */ + public static PageXmlInputOutput getInstance() { + if (instance == null) + instance = new PageXmlInputOutput(); + return instance; + } + + /** + * Returns the validator provider of the singleton. + */ + private static XmlModelAndValidatorProvider getValidatorProvider() { + return getInstance().validatorProvider; + } + + /** + * Sets the validator provider of the singleton. + */ + private static void setValidatorProvider(XmlModelAndValidatorProvider provider) { + getInstance().validatorProvider = provider; + } + + /** + * Sets the location of additional schema files and assumes the default schema file name 'pagecontent.xsd'. + * @param rootFolder Root of the schema folder structure containing the schema files. + * @throws NoSchemasException No schemas found at the given location + */ + public static void setAdditionalSchemaLocation(String rootFolder) throws NoSchemasException { + setAdditionalSchemaLocation(rootFolder, "pagecontent.xsd"); + } + + /** + * Sets the location of additional schema files and searches for schemas having the specified name. + * + * @param rootFolder Root of the schema folder structure containing the schema files + * @param schemaFilename Usually a filename with extension .xsd + * @throws NoSchemasException No schemas found at the given location + */ + public static void setAdditionalSchemaLocation(String rootFolder, String schemaFilename) throws NoSchemasException { + if (rootFolder == null) + setValidatorProvider(new PageXmlModelAndValidatorProvider()); + else + setValidatorProvider(new PageXmlModelAndValidatorProvider(rootFolder, schemaFilename)); + } + + /** + * Creates and returns an XML writer for PAGE using the latest schema version. + * + * @throws UnsupportedSchemaVersionException Schema file could not be found. + */ + public static XmlPageWriter getWriterForLastestXmlFormat(/*boolean validation*/) throws UnsupportedSchemaVersionException { + XmlValidator validator = null; + //if (validation) { + XmlModelAndValidatorProvider validatorProvider = getValidatorProvider(); + if (validatorProvider != null) { + validator = validatorProvider.getValidator(new XmlFormatVersion("2013-07-15")); + } + //} + return new XmlPageWriter_2013_07_15(validator); + } + + /** + * Creates and returns an XML writer for PAGE using the specified schema version. + * This might require the schema location to be set beforehand. + * + * @throws UnsupportedSchemaVersionException The schema file could not be found. + */ + public static XmlPageWriter getWriter(XmlFormatVersion schemaVersion) throws UnsupportedSchemaVersionException { + XmlValidator validator = null; + + XmlModelAndValidatorProvider validatorProvider = getValidatorProvider(); + if (validatorProvider != null) { + validator = validatorProvider.getValidator(schemaVersion); + } + + if (new XmlFormatVersion("2013-07-15").equals(schemaVersion)) + return new XmlPageWriter_2013_07_15(validator); + + //Legacy + return new XmlPageWriter_2010_03_19(validator); + } + + /** + * Saves the given document page to an XML file at the specified + * location, using the latest PAGE XML format or the format the + * page object has been loaded with. + * + * @param page Page object + * @param filePath Target file + * @throws UnsupportedSchemaVersionException Schema file could not be found. + */ + public static boolean writePage(Page page, String filePath/*, boolean validate*/) throws UnsupportedSchemaVersionException { + XmlPageWriter writer = null; + if (page.getFormatVersion() == null || !(page.getFormatVersion() instanceof XmlFormatVersion)) + writer = getWriterForLastestXmlFormat(/*validate*/); + else { + writer = getWriter((XmlFormatVersion)page.getFormatVersion()); + } + try { + return writer.write(page, new FileTarget(new File(filePath))); + } catch (UnsupportedFormatVersionException e) { + e.printStackTrace(); + } + return false; + } + + /** + * Creates and returns an XML reader for PAGE. + */ + public static XmlPageReader getReader(/*boolean validation*/) { + XmlModelAndValidatorProvider validatorProvider = null; + //if (validation) + validatorProvider = getValidatorProvider(); + return new XmlPageReader(validatorProvider); + } + + /** + * Creates a page object from the given XML file (no validation). + * + * @param filePath Path to PAGE XML file. + * @return Page object + */ + //public static Page readPage(String filePath) { + // try { + // return readPage(filePath, false); + // } catch (UnsupportedFormatVersionException e) { + // e.printStackTrace(); //Cannot happen + // } + // return null; + //} + + /** + * Creates a page object from the given XML file. + * + * @param filePath Path to PAGE XML file. + * @return Page object + * @throws UnsupportedSchemaVersionException Schema file not found + */ + public static Page readPage(String filePath/*, boolean validate*/) throws UnsupportedFormatVersionException { + XmlPageReader reader = getReader(/*validate*/); + return reader.read(new FileInput(new File(filePath))); + } + + /** + * Creates a page object from the given XML file. + * + * @param url URL of PAGE XML file. + * @return Page object + * @throws UnsupportedSchemaVersionException Schema file not found + */ + public static Page readPage(URL url) throws UnsupportedFormatVersionException { + XmlPageReader reader = getReader(/*validate*/); + return reader.read(new UrlInput(url)); + } + + /** + * Returns the model of the latest XML schema. + */ + public static SchemaModelParser getLatestSchemaModel() { + PageXmlInputOutput instance = getInstance(); + try { + return instance.validatorProvider.getSchemaParser(instance.validatorProvider.getLatestSchemaVersion()); + } catch (UnsupportedSchemaVersionException e) { + e.printStackTrace(); + } + return null; + } + + /** + * Returns the model of the latest XML schema. + */ + public static SchemaModelParser getSchemaModel(XmlFormatVersion version) { + PageXmlInputOutput instance = getInstance(); + try { + return instance.validatorProvider.getSchemaParser(version); + } catch (UnsupportedSchemaVersionException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public FormatModel getFormatModel(FormatVersion version) throws UnsupportedFormatVersionException { + PageXmlInputOutput instance = getInstance(); + return instance.validatorProvider.getSchemaParser((XmlFormatVersion)version); + } + + /** + * Post-processes the given page object using the specified image dimension and resolution.
+ * This could include scaling all coordinates if they are not measured in pixel. + * @param page Page object to post-process + * @param imageWidth Width of the document image + * @param imageHeight Height of the document image + * @param dpiHor X resolution of the document image + * @param dpiVert Y resolution of the document image + */ + public static void postProcessPage(Page page, int imageWidth, int imageHeight, double dpiHor, double dpiVert) { + if (page == null || page.getLayout() == null || MeasurementUnit.PIXEL.equals(page.getMeasurementUnit())) + return; + + PageLayout layout = page.getLayout(); + + double scaleX = 1.0; + double scaleY = 1.0; + + double conversion = page.getMeasurementUnit().getDiscreteValuesPerInch(); + + if (conversion == 0.0) + return; + + //If the image dimensions don't equal the document dimensions, we can asume that the + //document width and height are using the measurement unit as well. In that case, we + //can calculate the scaling factor from the size difference. + if (layout.getWidth() != imageWidth && layout.getHeight() != imageHeight) { + //Sanity check: If the page dimensions are in pixel, even though the + // measurement unit is not pixel, we need shouldn't use them. + + //Go through all regions a see if they are within the page bounds + boolean ok = true; + for (ContentIterator it=layout.iterator(null); it.hasNext(); ) { + Polygon polygon = it.next().getCoords(); + if (polygon != null) { + for (int i=0; i layout.getWidth() || p.y > layout.getHeight()) { + ok = false; + break; + } + } + } + } + + if (ok) { + scaleX = (double)imageWidth / (double)layout.getWidth(); + scaleY = (double)imageHeight / (double)layout.getHeight(); + } + } + + //Use the image resolution to calculate the scaling factor + if (scaleX == 1.0 && scaleY == 1.0) + { + scaleX = dpiHor / conversion; + scaleY = dpiVert / conversion; + } + + if (scaleX == 0 || scaleY == 0) + return; + + //Now scale all coordinates + // Document size + layout.setSize(imageWidth, imageHeight); + //Region, lines, words, glyphs + ContentType types[] = new ContentType[]{null, LowLevelTextType.TextLine, LowLevelTextType.Word, LowLevelTextType.Glyph}; + for (ContentType tp : types) { + for (ContentIterator it=layout.iterator(tp); it.hasNext(); ) { + scalePolygon(it.next().getCoords(), scaleX, scaleY); + } + } + //Border, print space + if (layout.getBorder() != null) + scalePolygon(layout.getBorder().getCoords(), scaleX, scaleY); + if (layout.getPrintSpace() != null) + scalePolygon(layout.getPrintSpace().getCoords(), scaleX, scaleY); + } + + /** + * Scales all points of the given polygon + * @param polygon Polygon with 2D points + * @param scaleX Multiplier for x coordinates + * @param scaleY Multiplier for y coordinates + */ + private static void scalePolygon(Polygon polygon, double scaleX, double scaleY) { + if (polygon == null) + return; + for (int i=0; i + * + * Example:
+ *   -schema
+ *     -2010-01-12
+ *       -pagecontent.xsd
+ *     -2010-03-19
+ *       -pagecontent.xsd
+ * + * @param schemaRootFolder + * @param schemaFilename + * @throws NoSchemasException No schema files found at the given location. + */ + public PageXmlModelAndValidatorProvider(String schemaRootFolder, String schemaFilename) throws NoSchemasException { + super(schemaRootFolder, schemaFilename); + } + + /** + * Adds the internal default schemas to the list of schema sources. + */ + protected void addDefaultSchemas() { + try { + //2009-03-16 + addSchemaSource(new XmlFormatVersion("2009-03-16"), + getClass().getResource("/org/primaresearch/dla/page/io/xml/schema/2009-03-16_pagecontent.xsd"), + true); + + //2010-01-12 + addSchemaSource( new XmlFormatVersion("2010-01-12"), + getClass().getResource("/org/primaresearch/dla/page/io/xml/schema/2010-01-12_pagecontent.xsd"), + true); + + //2010-03-19 + addSchemaSource( new XmlFormatVersion("2010-03-19"), + getClass().getResource("/org/primaresearch/dla/page/io/xml/schema/2010-03-19_pagecontent.xsd"), + true); + + //2013-07-15 + addSchemaSource( new XmlFormatVersion("2013-07-15"), + getClass().getResource("/org/primaresearch/dla/page/io/xml/schema/2013-07-15_pagecontent.xsd"), + true); + + //Abbyy FineReader 10 + addSchemaSource( new XmlFormatVersion("http://www.abbyy.com/FineReader_xml/FineReader10-schema-v1.xml"), + new URL("http://www.abbyy.com/FineReader_xml/FineReader10-schema-v1.xml"), + false); + + //ALTO 2.1 + addSchemaSource( new XmlFormatVersion("http://www.loc.gov/standards/alto/ns-v2#"), + new URL("http://www.loc.gov/standards/alto/alto.xsd"), + false); + + //HOCR + addSchemaSource( new XmlFormatVersion("HOCR"), + null, + false); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/StreamTarget.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/StreamTarget.java new file mode 100644 index 00000000..5a6b30a9 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/StreamTarget.java @@ -0,0 +1,39 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import java.io.OutputStream; + +import org.primaresearch.dla.page.io.OutputTarget; + +/** + * Generic output target can be any type of stream. + * + * @author Christian Clausner + * + */ +public class StreamTarget implements OutputTarget { + + private OutputStream outputStream; + + public StreamTarget(OutputStream outputStream) { + this.outputStream = outputStream; + } + + public OutputStream getOutputStream() { + return outputStream; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlNameProvider.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlNameProvider.java new file mode 100644 index 00000000..e38fae0a --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlNameProvider.java @@ -0,0 +1,30 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import org.primaresearch.dla.page.layout.physical.shared.ContentType; + + +/** + * Provides the XML element names for content objects. + * + * @author Christian Clausner + * + */ +public interface XmlNameProvider { + + public String getXmlName(ContentType type); +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageReader.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageReader.java new file mode 100644 index 00000000..24917b97 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageReader.java @@ -0,0 +1,300 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.io.FileInput; +import org.primaresearch.dla.page.io.InputSource; +import org.primaresearch.dla.page.io.PageReader; +import org.primaresearch.dla.page.io.UrlInput; +import org.primaresearch.dla.page.io.xml.sax.SaxPageHandler; +import org.primaresearch.dla.page.io.xml.sax.SaxPageHandlerFactory; +import org.primaresearch.io.UnsupportedFormatVersionException; +import org.primaresearch.io.xml.IOError; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider; +import org.primaresearch.io.xml.XmlValidator; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Page reader implementation for XML files (supports validation against schema). + * + * @author Christian Clausner + */ +public class XmlPageReader implements PageReader { + + /** Constant for recognising a shortcut out of parsing. */ + private static final String PARSING_COMPLETE = "PARSING_COMPLETE"; + + private SaxPageHandler pageHandler = null; + private SAXParser mainParser; + private SchemaVersionHandler schemaVersionHandler; + private SAXParser schemaVersionParser; + private XmlModelAndValidatorProvider validatorProvider; + private XmlFormatVersion schemaVersion = null; + private PageErrorHandler lastErrors; + + /** + * Constructor + * @param validatorProvider Schema validator provider. (optional, set to null if no validation required). + */ + public XmlPageReader(XmlModelAndValidatorProvider validatorProvider) { + this.validatorProvider = validatorProvider; + if (validatorProvider != null) { + createSchemaVersionParser(); + schemaVersionHandler = new SchemaVersionHandler(); + } + try { + createMainParser(); + } catch (UnsupportedFormatVersionException e) { + e.printStackTrace(); //Cannot happen here, as we don't have the schema version yet... + } + } + + /** + * Creates the SAX parser for PAGE XML. + * @throws UnsupportedFormatVersionException + */ + private void createMainParser() throws UnsupportedFormatVersionException { + try { + // Obtain a new instance of a SAXParserFactory. + SAXParserFactory factory = SAXParserFactory.newInstance(); + // Specifies that the parser produced by this code will provide support for XML namespaces. + factory.setNamespaceAware(true); + factory.setValidating(false); + //Fix for delay when reading HOCR (disables loading the external DTD that is defined in the HOCR file) + factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + + //Validation + if (validatorProvider != null && schemaVersion != null) { + // Specifies that the parser produced by this code will validate documents as they are parsed. + XmlValidator validator = validatorProvider.getValidator(schemaVersion); + if (validator != null) + factory.setSchema(validator.getSchema()); + } + + //this.pageHandler = new PageHandler(validatorProvider, schemaVersion); + this.pageHandler = SaxPageHandlerFactory.createHandler(validatorProvider, schemaVersion); + + // Creates a new instance of a SAXParser using the currently configured factory parameters. + mainParser = factory.newSAXParser(); + + } catch (UnsupportedFormatVersionException exc) { + throw exc; + } catch (Throwable t) { + t.printStackTrace(); + } + } + + /** + * Creates the parser that finds the schema version only. + */ + private void createSchemaVersionParser() { + try { + // Obtain a new instance of a SAXParserFactory. + SAXParserFactory factory = SAXParserFactory.newInstance(); + // Specifies that the parser produced by this code will provide support for XML namespaces. + factory.setNamespaceAware(true); + factory.setValidating(false); + //Fix for delay when reading HOCR (disables loading the external DTD that is defined in the HOCR file) + factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + + schemaVersionParser = factory.newSAXParser(); + } catch (Throwable t) { + t.printStackTrace(); + } + } + + /** + * Reads a PAGE XML file and returns a Page object. + * + * @param source FileInput representing an XML file + * @return Page object or null in case of errors (see getErrors()). + * @throws IllegalArgumentException Wrong input source type + */ + @Override + public Page read(InputSource source) throws UnsupportedFormatVersionException { + + + lastErrors = new PageErrorHandler(); + + parse(source, lastErrors); + + Page page = null; + + if (!lastErrors.hasErrors()) + page = pageHandler.getPageObject(); + + //if (!MeasurementUnit.PIXEL.equals(pageHandler.getMeasurementUnit())) + + + return page; + } + + private InputStream getInputStream(InputSource source) { + if (source instanceof FileInput) { + File f = ((FileInput)source).getFile(); + try { + return new FileInputStream(f); + } catch (FileNotFoundException e) { + e.printStackTrace(); + lastErrors.getErrors().add(new IOError("Could not open stream from file: "+e.getMessage())); + } + } + else if (source instanceof UrlInput) { + try { + return ((UrlInput)source).getUrl().openStream(); + } catch (IOException e) { + e.printStackTrace(); + lastErrors.getErrors().add(new IOError("Could not open stream from URL: "+e.getMessage())); + } + } + else + throw new IllegalArgumentException("Only FileInput and UrlInput allowed for XmlPageReader"); + return null; + } + + /** + * Returns a list of errors that occurred on the last call of read(). + */ + public List getErrors() { + return lastErrors != null ? lastErrors.getErrors() : null; + } + + /** + * Returns a list of warnings that occurred on the last call of read(). + */ + public List getWarnings() { + return lastErrors != null ? lastErrors.getWarnings() : null; + } + + /** + * Parses a PAGE file + */ + private void parse(InputSource input, PageErrorHandler errorHandler) throws UnsupportedFormatVersionException { + //Validation? + if (validatorProvider != null) { + try { + InputStream inputStream = getInputStream(input); + if (inputStream == null) + return; + schemaVersionParser.parse(inputStream, schemaVersionHandler); + //We shortcut the parsing with an exception (see below) + } catch (SAXException e) { + if (PARSING_COMPLETE.equals(e.getMessage())) { //Shortcut when no more parsing is required. + XmlFormatVersion version = schemaVersionHandler.getSchemaVersion(); + if (version == null || !version.equals(schemaVersion)) { + schemaVersion = version; + createMainParser(); //If the schema version has changed, we have to create a new parser. + } + } + else + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + try{ + XMLReader reader = mainParser.getXMLReader(); + reader.setErrorHandler(errorHandler); + reader.setContentHandler(pageHandler); + InputStream inputStream = getInputStream(input); + if (inputStream == null) + return; + org.xml.sax.InputSource saxInput = new org.xml.sax.InputSource(inputStream); + //saxInput.setEncoding("utf-8"); + reader.parse(saxInput); + } catch (Throwable t) { + t.printStackTrace(); + } + } + + + + /** + * SAX handler implementation to parse the schema version only. + * + * @author Christian Clausner + */ + private static class SchemaVersionHandler extends DefaultHandler { + private XmlFormatVersion schemaVersion = null; + + public XmlFormatVersion getSchemaVersion() { + return schemaVersion; + } + + /** + * Receive notification of the start of an element. + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) + throws SAXException { + + if (DefaultXmlNames.ELEMENT_PcGts.equals(localName)){ + + String str = namespaceURI; //Example: http://schema.primaresearch.org/PAGE/gts/pagecontent/2010-03-19 + int pos = str.lastIndexOf("/"); + schemaVersion = new XmlFormatVersion(str.substring(pos+1)); + throw new SAXException(PARSING_COMPLETE); + } + //Abbyy + else if ("document".equals(localName)) { + //String str = namespaceURI; //Example: http://www.abbyy.com/FineReader_xml/FineReader10-schema-v1.xml + if (namespaceURI.contains("abbyy")) { + schemaVersion = new XmlFormatVersion(namespaceURI); + throw new SAXException(PARSING_COMPLETE); + } + } + //ALTO + else if ("alto".equals(localName)) { + //String str = namespaceURI; //Example: http://www.loc.gov/standards/alto/ns-v2# + if (namespaceURI.contains("alto")) { + schemaVersion = new XmlFormatVersion(namespaceURI); + throw new SAXException(PARSING_COMPLETE); + } + } + //HOCR + else if ("html".equals(localName)) { + schemaVersion = new XmlFormatVersion("HOCR"); + throw new SAXException(PARSING_COMPLETE); + } + } + } + + + + + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter.java new file mode 100644 index 00000000..4ed609ff --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter.java @@ -0,0 +1,54 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import java.util.List; + +import org.primaresearch.dla.page.io.PageWriter; +import org.primaresearch.dla.page.layout.converter.ConversionMessage; + +/** + * Interface for page writers producing XML. + * + * @author Christian Clausner + */ +public interface XmlPageWriter extends PageWriter { + + /** + * Returns the XML schema version the writer supports (in format yyyy-mm-dd). + */ + public String getSchemaVersion(); + + /** + * Returns the location of the schema (e.g. http://schema.primaresearch.org/PAGE/gts/pagecontent/2010-03-19). + */ + public String getSchemaLocation(); + + /** + * Returns the URL of the schema file (e.g. http://schema.primaresearch.org/PAGE/gts/pagecontent/2010-03-19/pagecontent.xsd). + */ + public String getSchemaUrl(); + + /** + * Returns the name space. This is usually the same as the schema location. + */ + public String getNamespace(); + + /** + * Returns format conversion related messages + */ + public List getConversionInformation(); +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter_2010_03_19.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter_2010_03_19.java new file mode 100644 index 00000000..08f7cc6e --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter_2010_03_19.java @@ -0,0 +1,507 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.List; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.validation.Validator; + +import org.primaresearch.dla.page.MetaData; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.io.FileTarget; +import org.primaresearch.dla.page.io.OutputTarget; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.converter.ConversionMessage; +import org.primaresearch.dla.page.layout.logical.Group; +import org.primaresearch.dla.page.layout.logical.GroupMember; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.logical.Layers; +import org.primaresearch.dla.page.layout.logical.ReadingOrder; +import org.primaresearch.dla.page.layout.logical.RegionRef; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.TextObject; +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.io.UnsupportedFormatVersionException; +import org.primaresearch.io.xml.IOError; +import org.primaresearch.io.xml.XmlValidator; +import org.primaresearch.maths.geometry.Point; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.Variable; +import org.primaresearch.shared.variable.VariableMap; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Text; +import org.xml.sax.SAXException; + +/** + * Page writer implementation for XML files. + * + * @author Christian Clausner + */ +public class XmlPageWriter_2010_03_19 implements XmlPageWriter { + //TODO Rename class? It may be used to save files conform to other schemas. + + private static DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + + private Page page = null; + private PageLayout layout = null; + private XmlNameProvider xmlNameProvider; + private Document doc; + private XmlValidator validator; + private PageErrorHandler lastErrors; + private List lastConversionMessages; + + + /** + * Constructor + * + * @param validator Optional schema validator (use null if not required). + */ + public XmlPageWriter_2010_03_19(XmlValidator validator) { + xmlNameProvider = new DefaultXmlNames(); + this.validator = validator; + } + + public String getSchemaVersion() { + return validator != null ? validator.getSchemaVersion().toString() : "2010-03-19"; + } + + //TODO Path and filename need to be variable. + public String getSchemaLocation() { + return "http://schema.primaresearch.org/PAGE/gts/pagecontent/"+getSchemaVersion(); + } + + //TODO Path and filename need to be variable. + public String getSchemaUrl() { + return "http://schema.primaresearch.org/PAGE/gts/pagecontent/"+getSchemaVersion()+"/pagecontent.xsd"; + } + + public String getNamespace() { + return getSchemaLocation(); + } + + /** + * Writes the given Page object to an XML file. + * + * @param page Page object + * @param target FileTarget representing an XML file + * @return Returns true if written successfully, false otherwise. + */ + @Override + public boolean write(Page page, OutputTarget target) throws UnsupportedFormatVersionException { + return run(page, target, false); + } + + /** + * Validates the given Page object against the XML schema. + * + * @param page Page object + * @return Returns true if valid, false otherwise. + */ + @Override + public boolean validate(Page page) throws UnsupportedFormatVersionException { + return run(page, null, true); + } + + private boolean run(Page page, OutputTarget target, boolean validateOnly) throws UnsupportedFormatVersionException { + if (validator != null && !validator.getSchemaVersion().equals(page.getFormatVersion())) + throw new UnsupportedFormatVersionException("XML page writer doesn't support format: "+page.getFormatVersion().toString()); + + this.page = page; + layout = page.getLayout(); + lastErrors = new PageErrorHandler(); + + //Convert page file if necessary and possible + //if (validator != null) + // lastConversionMessages = ConverterHub.convert(page, validator.getSchemaVersion()); + + DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); + dbfac.setValidating(false); + dbfac.setNamespaceAware(true); + //if (validator != null) + //dbfac.setSchema(validator.getSchema()); + + DocumentBuilder docBuilder; + try { + docBuilder = dbfac.newDocumentBuilder(); + //docBuilder.setErrorHandler(lastErrors); + + doc = docBuilder.newDocument(); + + writeRoot(); + + //Validation errors? + if (validator != null) { + Validator domVal = validator.getSchema().newValidator(); + domVal.setErrorHandler(lastErrors); + + try { + domVal.validate(new DOMSource(doc)); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (lastErrors.hasErrors()) { + return false; + } + + //Write XML + if (!validateOnly) { + + TransformerFactory transfac = TransformerFactory.newInstance(); + Transformer trans = transfac.newTransformer(); + DOMSource source = new DOMSource(doc); + + OutputStream os = null; + + if (target instanceof FileTarget) { + File f = ((FileTarget)target).getFile(); + os = new FileOutputStream(f); + } else if (target instanceof StreamTarget) + os = ((StreamTarget) target).getOutputStream(); + + StreamResult result = new StreamResult(os); + trans.transform(source, result); + os.close(); + } + return true; + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } catch (TransformerConfigurationException e) { + e.printStackTrace(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (TransformerException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return false; + } + + public List getErrors() { + return lastErrors != null ? lastErrors.getErrors() : null; + } + + public List getWarnings() { + return lastErrors != null ? lastErrors.getWarnings() : null; + } + + private void writeRoot() /*throws XMLStreamException*/ { + String xmlns = getSchemaLocation(); + //String xsi = "http://www.w3.org/2001/XMLSchema-instance"; + + Element root = doc.createElementNS(xmlns, DefaultXmlNames.ELEMENT_PcGts); + doc.appendChild(root); + + //xmlns + //addAttribute(root, "xmlns", xmlns); + + //xmlns:xsi + //addAttribute(root, "xmlns:xsi", xsi); + + //Schema location + String schemaLocation = getSchemaLocation() + " " + getSchemaUrl(); + root.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation", schemaLocation); + //addAttribute(root, "xsi:schemaLocation", schemaLocation); + + //GtsID + if (page.getGtsId() != null) + addAttribute(root, DefaultXmlNames.ATTR_pcGtsId, page.getGtsId().toString()); + + addMetaData(root); + addPage(root); + } + + private void addAttribute(Element node, String name, String value) { + node.setAttributeNS(null, name, value); + } + + private void addMetaData(Element parent) /*throws XMLStreamException*/ { + MetaData metaData = page.getMetaData(); + if (metaData == null) + return; + + Element metaDataNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Metadata); + parent.appendChild(metaDataNode); + + //Creator + addTextElement(metaDataNode, DefaultXmlNames.ELEMENT_Creator, metaData.getCreator()); + + //Created + addTextElement(metaDataNode, DefaultXmlNames.ELEMENT_Created, DATE_FORMAT.format(metaData.getCreationTime())); + + //Last modified + addTextElement(metaDataNode, DefaultXmlNames.ELEMENT_LastChange, DATE_FORMAT.format(metaData.getLastModificationTime())); + + //Comments + addTextElement(metaDataNode, DefaultXmlNames.ELEMENT_Comments, metaData.getComments()); + } + + private void addPage(Element parent) { + Element pageNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Page); + parent.appendChild(pageNode); + + //Image filename + addAttribute(pageNode, DefaultXmlNames.ATTR_imageFilename, page.getImageFilename()); + + //Width/height + addAttribute(pageNode, DefaultXmlNames.ATTR_imageWidth, Integer.toString(layout.getWidth())); + addAttribute(pageNode, DefaultXmlNames.ATTR_imageHeight, Integer.toString(layout.getHeight())); + + //Border + GeometricObject border = layout.getBorder(); + if (border != null) { + Element node = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Border); + pageNode.appendChild(node); + addCoords(node, border.getCoords()); + } + + //Print space + GeometricObject printSpace = layout.getPrintSpace(); + if (printSpace != null) { + Element node = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_PrintSpace); + pageNode.appendChild(node); + addCoords(node, printSpace.getCoords()); + } + + //Reading order + addReadingOrder(pageNode, layout.getReadingOrder()); + + //Layers + addLayers(pageNode, layout.getLayers()); + + //Regions + for (int i=0; i= 0 ? DefaultXmlNames.ELEMENT_OrderedGroupIndexed : DefaultXmlNames.ELEMENT_OrderedGroup; + else + groupElementName = index >= 0 ? DefaultXmlNames.ELEMENT_UnorderedGroupIndexed : DefaultXmlNames.ELEMENT_UnorderedGroup; + + + Element groupNode = doc.createElementNS(getNamespace(), groupElementName); + parent.appendChild(groupNode); + + //ID + addAttribute(groupNode, DefaultXmlNames.ATTR_id, group.getId().toString()); + + //Index + if (index >= 0) + addAttribute(groupNode, DefaultXmlNames.ATTR_index, Integer.toString(index)); + //eventWriter.add(eventFactory.createAttribute(DefaultXmlNames.ATTR_index, Integer.toString(index))); + + //Children + GroupMember member; + for (int i=0; i= 0 ? DefaultXmlNames.ELEMENT_RegionRefIndexed : DefaultXmlNames.ELEMENT_RegionRef; + + Element refNode = doc.createElementNS(getNamespace(), elementName); + parent.appendChild(refNode); + + //ID Ref + addAttribute(refNode, DefaultXmlNames.ATTR_regionRef, regionId); + + //Index + if (index >= 0) + addAttribute(refNode, DefaultXmlNames.ATTR_index, Integer.toString(index)); + } + + private void addLayers(Element parent, Layers layers) /*throws XMLStreamException*/ { + if (layers == null || layers.getSize() == 0) + return; + + //Check if there are non-empty layers + boolean foundNonEmptyLayer = false; + for (int i=0; i skip the whole layers element + return; + + + Element layersNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Layers); + parent.appendChild(layersNode); + + Layer layer; + for (int i=0; i 0) + addLayer(layersNode, layer); + } + } + + private void addLayer(Element parent, Layer layer) /*throws XMLStreamException*/ { + + Element layerNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Layer); + parent.appendChild(layerNode); + + //ID + addAttribute(layerNode, DefaultXmlNames.ATTR_id, layer.getId().toString()); + + //Z-Index + addAttribute(layerNode, DefaultXmlNames.ATTR_zIndex, Integer.toString(layer.getZIndex())); + + //Region Refs + GroupMember member; + for (int i=0; i getConversionInformation() { + return lastConversionMessages; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter_2013_07_15.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter_2013_07_15.java new file mode 100644 index 00000000..ddd35642 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter_2013_07_15.java @@ -0,0 +1,649 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.validation.Validator; + +import org.primaresearch.dla.page.MetaData; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.Page.AlternativeImage; +import org.primaresearch.dla.page.io.FileTarget; +import org.primaresearch.dla.page.io.OutputTarget; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.converter.ConversionMessage; +import org.primaresearch.dla.page.layout.logical.ContentObjectRelation; +import org.primaresearch.dla.page.layout.logical.Group; +import org.primaresearch.dla.page.layout.logical.GroupMember; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.logical.Layers; +import org.primaresearch.dla.page.layout.logical.ReadingOrder; +import org.primaresearch.dla.page.layout.logical.RegionRef; +import org.primaresearch.dla.page.layout.logical.Relations; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.TextObject; +import org.primaresearch.dla.page.layout.physical.text.impl.TextLine; +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.io.FormatModel; +import org.primaresearch.io.UnsupportedFormatVersionException; +import org.primaresearch.io.xml.IOError; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlValidator; +import org.primaresearch.maths.geometry.Point; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.Variable; +import org.primaresearch.shared.variable.VariableMap; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Text; +import org.xml.sax.SAXException; + +/** + * Page writer implementation for XML files. + * + * @author Christian Clausner + */ +public class XmlPageWriter_2013_07_15 implements XmlPageWriter { + //TODO Rename class? It may be used to save files conform to other schemas. + + private static DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + + private Page page = null; + private PageLayout layout = null; + private XmlNameProvider xmlNameProvider; + private Document doc; + private XmlValidator validator; + private PageErrorHandler lastErrors; + private List lastConversionMessages; + private String namespace; + + + /** + * Constructor + * + * @param validator Optional schema validator (use null if not required). + */ + public XmlPageWriter_2013_07_15(XmlValidator validator) { + xmlNameProvider = new DefaultXmlNames(); + this.validator = validator; + } + + @Override + public String getSchemaVersion() { + return validator != null ? validator.getSchemaVersion().toString() : "2013-07-15"; + } + + //TODO Path and filename need to be variable. + @Override + public String getSchemaLocation() { + return "http://schema.primaresearch.org/PAGE/gts/pagecontent/"+getSchemaVersion(); + } + + //TODO Path and filename need to be variable. + @Override + public String getSchemaUrl() { + return "http://schema.primaresearch.org/PAGE/gts/pagecontent/"+getSchemaVersion()+"/pagecontent.xsd"; + } + + @Override + public String getNamespace() { + return getSchemaLocation(); + } + + /** + * Writes the given Page object to an XML file. + * + * @param page Page object + * @param target FileTarget representing an XML file + * @return Returns true if written successfully, false otherwise. + */ + @Override + public boolean write(Page page, OutputTarget target) throws UnsupportedFormatVersionException { + return run(page, target, false); + } + + /** + * Validates the given Page object against the XML schema. + * + * @param page Page object + * @return Returns true if valid, false otherwise. + */ + @Override + public boolean validate(Page page) throws UnsupportedFormatVersionException { + return run(page, null, true); + } + + private boolean run(Page page, OutputTarget target, boolean validateOnly) throws UnsupportedFormatVersionException { + if (validator != null && !validator.getSchemaVersion().equals(page.getFormatVersion())) + throw new UnsupportedFormatVersionException("XML page writer doesn't support format: "+page.getFormatVersion().toString()); + + this.page = page; + layout = page.getLayout(); + lastErrors = new PageErrorHandler(); + + //Convert page file if necessary and possible + //if (validator != null) + // lastConversionMessages = ConverterHub.convert(page, validator.getSchemaVersion()); + + DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); + dbfac.setValidating(false); + dbfac.setNamespaceAware(true); + //if (validator != null) + //dbfac.setSchema(validator.getSchema()); + + DocumentBuilder docBuilder; + try { + docBuilder = dbfac.newDocumentBuilder(); + //docBuilder.setErrorHandler(lastErrors); + + DOMImplementation domImpl = docBuilder.getDOMImplementation(); + //doc = docBuilder.newDocument(); + namespace = getSchemaLocation(); + doc = domImpl.createDocument(namespace, DefaultXmlNames.ELEMENT_PcGts, null); + + writeRoot(); + + //Validation errors? + if (validator != null) { + Validator domVal = validator.getSchema().newValidator(); + domVal.setErrorHandler(lastErrors); + + try { + domVal.validate(new DOMSource(doc)); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (lastErrors.hasErrors()) { + return false; + } + + //Write XML + if (!validateOnly) { + + TransformerFactory transfac = TransformerFactory.newInstance(); + Transformer trans = transfac.newTransformer(); + DOMSource source = new DOMSource(doc); + + OutputStream os = null; + + if (target instanceof FileTarget) { + File f = ((FileTarget)target).getFile(); + os = new FileOutputStream(f); + } else if (target instanceof StreamTarget) + os = ((StreamTarget) target).getOutputStream(); + + StreamResult result = new StreamResult(os); + trans.transform(source, result); + os.close(); + } + return true; + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } catch (TransformerConfigurationException e) { + e.printStackTrace(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (TransformerException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return false; + } + + /** + * Returns a list of writing errors + */ + public List getErrors() { + return lastErrors != null ? lastErrors.getErrors() : null; + } + + /** + * Returns a list of writing warnings + */ + public List getWarnings() { + return lastErrors != null ? lastErrors.getWarnings() : null; + } + + private void writeRoot() /*throws XMLStreamException*/ { + //String xsi = "http://www.w3.org/2001/XMLSchema-instance"; + + //Element root = doc.createElementNS(namespace, DefaultXmlNames.ELEMENT_PcGts); + //doc.appendChild(root); + + Element root = doc.getDocumentElement(); + + //xmlns + //addAttribute(root, "xmlns", xmlns); + + //xmlns:xsi + //root.setAttribute("xmlns:xsi", xsi); + //addAttribute(root, "xmlns:xsi", xsi); + + //Schema location + String schemaLocation = getSchemaLocation() + " " + getSchemaUrl(); + root.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation", schemaLocation); + //addAttribute(root, "xsi:schemaLocation", schemaLocation); + + //GtsID + if (page.getGtsId() != null) + addAttribute(root, DefaultXmlNames.ATTR_pcGtsId, page.getGtsId().toString()); + + addMetaData(root); + addPage(root); + } + + private void addAttribute(Element node, String name, String value) { + node.setAttributeNS(null, name, value); + } + + private void addMetaData(Element parent) /*throws XMLStreamException*/ { + MetaData metaData = page.getMetaData(); + if (metaData == null) + return; + + Element metaDataNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Metadata); + parent.appendChild(metaDataNode); + + //Creator + addTextElement(metaDataNode, DefaultXmlNames.ELEMENT_Creator, metaData.getCreator()); + + //Created + addTextElement(metaDataNode, DefaultXmlNames.ELEMENT_Created, DATE_FORMAT.format(metaData.getCreationTime())); + + //Last modified + addTextElement(metaDataNode, DefaultXmlNames.ELEMENT_LastChange, DATE_FORMAT.format(metaData.getLastModificationTime())); + + //Comments + addTextElement(metaDataNode, DefaultXmlNames.ELEMENT_Comments, metaData.getComments()); + } + + private void addPage(Element parent) { + Element pageNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Page); + parent.appendChild(pageNode); + + //Image filename + addAttribute(pageNode, DefaultXmlNames.ATTR_imageFilename, page.getImageFilename()); + + //Width/height + addAttribute(pageNode, DefaultXmlNames.ATTR_imageWidth, Integer.toString(layout.getWidth())); + addAttribute(pageNode, DefaultXmlNames.ATTR_imageHeight, Integer.toString(layout.getHeight())); + + //Other Attributes (page type, ...) + addContentObjectAttributes(pageNode, page.getAttributes()); + + //Alternative images + List altImages = page.getAlternativeImages(); + if (altImages != null) { + for (Iterator it = altImages.iterator(); it.hasNext(); ) { + AlternativeImage img = it.next(); + + Element node = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_AlternativeImage); + pageNode.appendChild(node); + addAttribute(node, DefaultXmlNames.ATTR_filename, img.getFilename()); + if (!img.getComments().isEmpty()) + addAttribute(node, DefaultXmlNames.ATTR_comments, img.getComments()); + } + } + + //Border + GeometricObject border = layout.getBorder(); + if (border != null) { + Element node = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Border); + pageNode.appendChild(node); + addCoords(node, border.getCoords()); + } + + //Print space + GeometricObject printSpace = layout.getPrintSpace(); + if (printSpace != null) { + Element node = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_PrintSpace); + pageNode.appendChild(node); + addCoords(node, printSpace.getCoords()); + } + + //Reading order + addReadingOrder(pageNode, layout.getReadingOrder()); + + //Layers + addLayers(pageNode, layout.getLayers()); + + //Relations + addRelations(pageNode, layout.getRelations()); + + //Regions + for (int i=0; i= 2) { + Element baselineNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Baseline); + regionNode.appendChild(baselineNode); + addPointsAttribute(baselineNode, baseline); + } + } + + // Nested regions + if (contentObj instanceof RegionContainer) { + RegionContainer cont = (RegionContainer)contentObj; + if (cont.hasRegions()) { + for (int i=0; i0) + pointList.append(" "); + pointList.append(Integer.toString(p.x)); + pointList.append(","); + pointList.append(Integer.toString(p.y)); + } + addAttribute(parent, DefaultXmlNames.ATTR_points, pointList.toString()); + } + + private void addReadingOrder(Element parent, ReadingOrder order) /*throws XMLStreamException*/ { + if (order == null || order.getRoot() == null || order.getRoot().getSize() == 0) + return; + + Element node = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_ReadingOrder); + parent.appendChild(node); + + //Root group + addReadingOrderGroup(node, order.getRoot(), -1); + } + + /** + * Writes a reading order group including its members. + * @param index Index of the group in the parent group (use -1 if not indexed). + */ + private void addReadingOrderGroup(Element parent, Group group, int index) /*throws XMLStreamException*/ { + String groupElementName; + if (group.isOrdered()) + groupElementName = index >= 0 ? DefaultXmlNames.ELEMENT_OrderedGroupIndexed : DefaultXmlNames.ELEMENT_OrderedGroup; + else + groupElementName = index >= 0 ? DefaultXmlNames.ELEMENT_UnorderedGroupIndexed : DefaultXmlNames.ELEMENT_UnorderedGroup; + + + Element groupNode = doc.createElementNS(getNamespace(), groupElementName); + parent.appendChild(groupNode); + + //ID + addAttribute(groupNode, DefaultXmlNames.ATTR_id, group.getId().toString()); + + //Caption + if (group.getCaption() != null) + addAttribute(groupNode, DefaultXmlNames.ATTR_caption, group.getCaption()); + + //Index + if (index >= 0) + addAttribute(groupNode, DefaultXmlNames.ATTR_index, Integer.toString(index)); + //eventWriter.add(eventFactory.createAttribute(DefaultXmlNames.ATTR_index, Integer.toString(index))); + + //Children + GroupMember member; + for (int i=0; i= 0 ? DefaultXmlNames.ELEMENT_RegionRefIndexed : DefaultXmlNames.ELEMENT_RegionRef; + + Element refNode = doc.createElementNS(getNamespace(), elementName); + parent.appendChild(refNode); + + //ID Ref + addAttribute(refNode, DefaultXmlNames.ATTR_regionRef, regionId); + + //Index + if (index >= 0) + addAttribute(refNode, DefaultXmlNames.ATTR_index, Integer.toString(index)); + } + + private void addLayers(Element parent, Layers layers) /*throws XMLStreamException*/ { + if (layers == null || layers.getSize() == 0) + return; + + //Check if there are non-empty layers + boolean foundNonEmptyLayer = false; + for (int i=0; i skip the whole layers element + return; + + + Element layersNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Layers); + parent.appendChild(layersNode); + + Layer layer; + for (int i=0; i 0) + addLayer(layersNode, layer); + } + } + + private void addLayer(Element parent, Layer layer) /*throws XMLStreamException*/ { + + Element layerNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Layer); + parent.appendChild(layerNode); + + //ID + addAttribute(layerNode, DefaultXmlNames.ATTR_id, layer.getId().toString()); + + //Z-Index + addAttribute(layerNode, DefaultXmlNames.ATTR_zIndex, Integer.toString(layer.getZIndex())); + + //Caption + if (layer.getCaption() != null) + addAttribute(layerNode, DefaultXmlNames.ATTR_caption, layer.getCaption()); + + //Region Refs + GroupMember member; + for (int i=0; i set = relations.exportRelations(); + for (Iterator it = set.iterator(); it.hasNext(); ) { + ContentObjectRelation rel = it.next(); + if (rel != null) { + Element relationNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_Relation); + relationsNode.appendChild(relationNode); + + //Type + addAttribute(relationNode, DefaultXmlNames.ATTR_type, rel.getRelationType().toString()); + //Custom + if (!rel.getCustomField().isEmpty()) + addAttribute(relationNode, DefaultXmlNames.ATTR_custom, rel.getCustomField()); + //Comments + if (!rel.getComments().isEmpty()) + addAttribute(relationNode, DefaultXmlNames.ATTR_comments, rel.getComments()); + + //Object 1 + Element regionRefNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_RegionRef); + relationNode.appendChild(regionRefNode); + addAttribute(regionRefNode, DefaultXmlNames.ATTR_regionRef, rel.getObject1().getId().toString()); + + //Object 2 + regionRefNode = doc.createElementNS(getNamespace(), DefaultXmlNames.ELEMENT_RegionRef); + relationNode.appendChild(regionRefNode); + addAttribute(regionRefNode, DefaultXmlNames.ATTR_regionRef, rel.getObject2().getId().toString()); + } + } + } + + + /** + * Writes a single element with text content. + */ + private void addTextElement(Element parent, String elementName, String text) /*throws XMLStreamException*/ { + Element node = doc.createElementNS(getNamespace(), elementName); + parent.appendChild(node); + + Text textNode = doc.createTextNode(text != null ? text : ""); + node.appendChild(textNode); + } + + @Override + public List getConversionInformation() { + return lastConversionMessages; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler.java new file mode 100644 index 00000000..f8731af2 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler.java @@ -0,0 +1,39 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml.sax; + +import org.primaresearch.dla.page.Page; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Abstract base class for SAX handlers intended for PAGE XML. + * + * @author Christian Clausner + * + */ +public abstract class SaxPageHandler extends DefaultHandler { + + /** + * Returns the page object that has been created from XML + * @return Page object + */ + abstract public Page getPageObject(); + + + + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerFactory.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerFactory.java new file mode 100644 index 00000000..e7bae4d4 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerFactory.java @@ -0,0 +1,61 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml.sax; + +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider; + +/** + * Creates SAX handlers for PAGE XML. + * + * @author Christian Clausner + * + */ +public class SaxPageHandlerFactory { + + /** + * Creates a handler for the given format + * @param validatorProvider Provider for XML validators + * @param schemaVersion XML schema version for the format + * @return New handler object + */ + public static SaxPageHandler createHandler(XmlModelAndValidatorProvider validatorProvider, XmlFormatVersion schemaVersion) { + + if (schemaVersion != null) { + + if (schemaVersion instanceof XmlFormatVersion) { + //Abbyy + if (((XmlFormatVersion)schemaVersion).toString().equals("http://www.abbyy.com/FineReader_xml/FineReader10-schema-v1.xml")) + return new SaxPageHandler_AbbyyFineReader10(validatorProvider, schemaVersion); + //HOCR + else if (((XmlFormatVersion)schemaVersion).toString().equals("HOCR")) + return new SaxPageHandler_Hocr(); + //ALTO + else if (((XmlFormatVersion)schemaVersion).toString().equals("http://www.loc.gov/standards/alto/ns-v2#")) + return new SaxPageHandler_Alto_2_1(validatorProvider, schemaVersion); + } + + //Old PAGE schemas + if (schemaVersion.isOlderThan(new XmlFormatVersion("2010-03-19"))) + return new SaxPageHandlerLegacy(validatorProvider, schemaVersion); + else if (schemaVersion.isOlderThan(new XmlFormatVersion("2013-07-15"))) + return new SaxPageHandler_2010_03_19(validatorProvider, schemaVersion); + } + + //Latest schema + return new SaxPageHandler_2013_07_15(validatorProvider, schemaVersion); + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerLegacy.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerLegacy.java new file mode 100644 index 00000000..434c454f --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandlerLegacy.java @@ -0,0 +1,531 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml.sax; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.primaresearch.dla.page.MetaData; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.GeometricObjectImpl; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.logical.Group; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.logical.ReadingOrder; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.TextObject; +import org.primaresearch.dla.page.layout.physical.text.impl.Glyph; +import org.primaresearch.dla.page.layout.physical.text.impl.TextLine; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.dla.page.layout.physical.text.impl.Word; +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.ident.Identifiable; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.UnsupportedSchemaVersionException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.Variable; +import org.primaresearch.shared.variable.VariableMap; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * Handler for PAGE schema version 2010-01-12 and older. + * @author Christian Clausner + * + */ +public class SaxPageHandlerLegacy extends SaxPageHandler { + + private static DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + + + private Page page = null; + private PageLayout layout = null; + private MetaData metaData = null; + + private GeometricObject currentGeometricObject = null; + private Region currentRegion = null; + private TextLine currentTextLine = null; + private Word currentWord = null; + private Glyph currentGlyph = null; + private TextObject currentTextObject = null; + private String insideElement = null; + private ReadingOrder readingOrder = null; + private Group currentLogicalGroup; + private StringBuffer currentText = null; + XmlModelAndValidatorProvider validatorProvider; + XmlFormatVersion schemaVersion; + + public SaxPageHandlerLegacy(XmlModelAndValidatorProvider validatorProvider, XmlFormatVersion schemaVersion) { + this.validatorProvider = validatorProvider; + this.schemaVersion = schemaVersion; + } + + public Page getPageObject() { + return page; + } + + /** + * Receive notification of the start of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) + throws SAXException { + + //Handle accumulated text + finishText(); + + insideElement = localName; + + if (DefaultXmlNames.ELEMENT_PcGts.equals(localName)){ + createPageObject(); + //GtsID + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_pcGtsId)) >= 0) { + try { + page.setGtsId(atts.getValue(i)); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + } + if (DefaultXmlNames.ELEMENT_Page.equals(localName)){ + handlePageElement(atts); + } + else if ( DefaultXmlNames.ELEMENT_Border.equals(localName) + || DefaultXmlNames.ELEMENT_PrintSpace.equals(localName)) { + currentGeometricObject = new GeometricObjectImpl(new Polygon()); + } + else if (DefaultXmlNames.ELEMENT_Coords.equals(localName)) { + if (currentGeometricObject != null) + currentGeometricObject.setCoords(new Polygon()); + } + else if (DefaultXmlNames.ELEMENT_Point.equals(localName)) { + handlePolygonPoint(atts); + } + else if (DefaultXmlNames.ELEMENT_TextRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.TextRegion, readId(atts)); + currentGeometricObject = currentRegion; + currentTextObject = (TextObject)currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_ImageRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.ImageRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_GraphicRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.GraphicRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_LineDrawingRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.LineDrawingRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_ChartRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.ChartRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_SeparatorRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.SeparatorRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_MathsRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.MathsRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_TableRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.TableRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_FrameRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.GraphicRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_NoiseRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.NoiseRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_UnknownRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.UnknownRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + if (currentRegion != null && currentRegion.getType() == RegionType.TextRegion) + currentTextLine = ((TextRegion)currentRegion).createTextLine(readId(atts)); + currentGeometricObject = currentTextLine; + currentTextObject = currentTextLine; + handleContentObject(currentTextLine, atts); + } + else if (DefaultXmlNames.ELEMENT_Word.equals(localName)) { + currentWord = null; + if (currentTextLine != null) + currentWord = currentTextLine.createWord(readId(atts)); + currentGeometricObject = currentWord; + currentTextObject = currentWord; + handleContentObject(currentWord, atts); + } + else if (DefaultXmlNames.ELEMENT_Glyph.equals(localName)) { + currentGlyph = null; + if (currentWord != null) + currentGlyph = currentWord.createGlyph(readId(atts)); + currentGeometricObject = currentGlyph; + currentTextObject = currentGlyph; + handleContentObject(currentGlyph, atts); + } + else if (DefaultXmlNames.ELEMENT_ReadingOrder.equals(localName)) { + readingOrder = layout.createReadingOrder(); + currentLogicalGroup = readingOrder.getRoot(); + } + else if ( DefaultXmlNames.ELEMENT_OrderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_OrderedGroupIndexed.equals(localName)) { + if (currentLogicalGroup == readingOrder.getRoot()) + currentLogicalGroup.setOrdered(DefaultXmlNames.ELEMENT_OrderedGroupIndexed.equals(localName)); + + Group group; + try { + group = currentLogicalGroup.createChildGroup(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + group.setOrdered(true); + parseId(group, atts); + + currentLogicalGroup = group; + } + else if ( DefaultXmlNames.ELEMENT_UnorderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_UnorderedGroupIndexed.equals(localName)) { + if (currentLogicalGroup == readingOrder.getRoot()) + currentLogicalGroup.setOrdered(DefaultXmlNames.ELEMENT_UnorderedGroupIndexed.equals(localName)); + + Group group; + try { + group = currentLogicalGroup.createChildGroup(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + group.setOrdered(false); + parseId(group, atts); + + currentLogicalGroup = group; + } + else if ( DefaultXmlNames.ELEMENT_RegionRef.equals(localName) + || DefaultXmlNames.ELEMENT_RegionRefIndexed.equals(localName)) { + if (readingOrder != null) { + if (currentLogicalGroup == readingOrder.getRoot()) + currentLogicalGroup.setOrdered(DefaultXmlNames.ELEMENT_RegionRefIndexed.equals(localName)); + } + + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_regionRef)) >= 0) { + currentLogicalGroup.addRegionRef(atts.getValue(i)); + } + } + else if (DefaultXmlNames.ELEMENT_Layers.equals(localName)) { + layout.createLayers(); + currentLogicalGroup = null; + } + else if (DefaultXmlNames.ELEMENT_Layer.equals(localName)) { + Layer layer = layout.getLayers().createLayer(); + currentLogicalGroup = layer; + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_zIndex)) >= 0) { + layer.setZIndex(new Integer(atts.getValue(i))); + } + parseId(layer, atts); + } + } + + /** + * Receive notification of the end of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void endElement(String namespaceURI, String localName, String qName) + throws SAXException { + + //Handle accumulated text + finishText(); + + insideElement = null; + + if (DefaultXmlNames.ELEMENT_Border.equals(localName)) { + layout.setBorder(currentGeometricObject); + currentGeometricObject = null; + } + else if (DefaultXmlNames.ELEMENT_PrintSpace.equals(localName)) { + layout.setPrintSpace(currentGeometricObject); + currentGeometricObject = null; + } + else if ( DefaultXmlNames.ELEMENT_TextRegion.equals(localName) + || DefaultXmlNames.ELEMENT_ImageRegion.equals(localName) + || DefaultXmlNames.ELEMENT_GraphicRegion.equals(localName) + || DefaultXmlNames.ELEMENT_LineDrawingRegion.equals(localName) + || DefaultXmlNames.ELEMENT_ChartRegion.equals(localName) + || DefaultXmlNames.ELEMENT_SeparatorRegion.equals(localName) + || DefaultXmlNames.ELEMENT_MathsRegion.equals(localName) + || DefaultXmlNames.ELEMENT_TableRegion.equals(localName) + || DefaultXmlNames.ELEMENT_FrameRegion.equals(localName) + || DefaultXmlNames.ELEMENT_NoiseRegion.equals(localName) + || DefaultXmlNames.ELEMENT_UnknownRegion.equals(localName) + ) { + currentRegion = null; + currentGeometricObject = null; + currentTextObject = null; + } + else if ( DefaultXmlNames.ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + currentGeometricObject = currentRegion; //Set to parent + currentTextObject = (TextObject)currentRegion; + } + else if ( DefaultXmlNames.ELEMENT_Word.equals(localName)) { + currentWord = null; + currentGeometricObject = currentTextLine; //Set to parent + currentTextObject = currentTextLine; + } + else if ( DefaultXmlNames.ELEMENT_Glyph.equals(localName)) { + currentGlyph = null; + currentGeometricObject = currentWord; //Set to parent + currentTextObject = currentWord; + } + else if (DefaultXmlNames.ELEMENT_ReadingOrder.equals(localName)) { + + //If the root group only contains one group as member, we make that member the root + Group root = readingOrder.getRoot(); + if (root.getSize() == 1 && root.getMember(0) instanceof Group) { + Group child = (Group)root.getMember(0); + root.setOrdered(child.isOrdered()); + //Copy all children of the child group to the root group + while (child.getSize()>0) + child.getMember(0).moveTo(root); + //Remove the child group from the root + root.delete(child); + } + + currentLogicalGroup = null; + readingOrder = null; + } + else if ( DefaultXmlNames.ELEMENT_OrderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_OrderedGroupIndexed.equals(localName)) { + currentLogicalGroup = currentLogicalGroup.getParent(); + } + else if ( DefaultXmlNames.ELEMENT_UnorderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_UnorderedGroupIndexed.equals(localName)) { + currentLogicalGroup = currentLogicalGroup.getParent(); + } + else if (DefaultXmlNames.ELEMENT_Layer.equals(localName)) { + currentLogicalGroup = null; + } + } + + /** + * Receive notification of character data inside an element. + * @param ch - The characters. + * @param start - The start position in the character array. + * @param length - The number of characters to use from the character array. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void characters(char[] ch, int start, int length) + throws SAXException { + + String strValue = new String(ch, start, length); + + //Text might be parsed bit by bit, so we have to accumulate until a closing tag is found. + if (currentText == null) + currentText = new StringBuffer(); + currentText.append(strValue); + } + + /** + * Writes accumulated text to the right object. + */ + private void finishText() { + if (currentText != null) { + String strValue = currentText.toString(); + + if (currentTextObject != null) { + if (DefaultXmlNames.ELEMENT_Unicode.equals(insideElement)) { + currentTextObject.setText(strValue); + } + else if (DefaultXmlNames.ELEMENT_PlainText.equals(insideElement)) { + currentTextObject.setPlainText(strValue); + } + } + if (metaData != null) { + if (DefaultXmlNames.ELEMENT_Creator.equals(insideElement)) { + metaData.setCreator(strValue); + } + else if (DefaultXmlNames.ELEMENT_Comments.equals(insideElement)) { + metaData.setComments(strValue); + } + else if (DefaultXmlNames.ELEMENT_Created.equals(insideElement)) { + metaData.setCreationTime(parseDate(strValue)); + } + else if (DefaultXmlNames.ELEMENT_LastChange.equals(insideElement)) { + metaData.setLastModifiedTime(parseDate(strValue)); + } + } + + currentText = null; + } + } + + private void createPageObject() { + if (validatorProvider != null && schemaVersion != null) { + try { + page = new Page(validatorProvider.getSchemaParser(schemaVersion)); + //page.setFormatVersion(schemaVersion); + } catch (UnsupportedSchemaVersionException e) { + e.printStackTrace(); + page = new Page(); + } + } + else + page = new Page(); + + layout = page.getLayout(); + metaData = page.getMetaData(); + } + + /** + * Reads the attributes of the Page element. + */ + private void handlePageElement(Attributes atts) { + int i; + + //Size + int width = 0; + int height = 0; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageWidth)) >= 0) { + width = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageHeight)) >= 0) { + height = new Integer(atts.getValue(i)); + } + page.getLayout().setSize(width, height); + + //Image filename + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageFilename)) >= 0) { + page.setImageFilename(atts.getValue(i)); + } + + } + + /** + * Reads the coordinates of a single polygon point. + */ + private void handlePolygonPoint(Attributes atts) { + if (currentGeometricObject == null || currentGeometricObject.getCoords() == null) + return; + + int x=0; + int y=0; + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_x)) >= 0) { + x = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(DefaultXmlNames.ATTR_y)) >= 0) { + y = new Integer(atts.getValue(i)); + } + currentGeometricObject.getCoords().addPoint(x, y); + } + + /** + * Reads the attributes of a content object. + */ + private void handleContentObject(ContentObject obj, Attributes atts) { + + //Id + //parseId(obj, atts); + + //Attributes + VariableMap map = obj.getAttributes(); + int p; + for (int i=0; i= 0) { + var.parseValue(atts.getValue(p)); + } + } + } + + private String getXmlAttributeName(String name) { + return name; //TODO Should there be a mechanism to translate attribute names to XML names? + } + + /** + * Parses a date given as string using the default date format. + */ + private Date parseDate(String str) { + try { + return DATE_FORMAT.parse(str); + } catch (ParseException e) { + return new Date(); + } + } + + private String readId(Attributes atts) { + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_id)) >= 0) + return atts.getValue(i); + return ""; + } + + /** + * Reads the ID attribute and sets it in the Identifiable object. + */ + private void parseId(Identifiable ident, Attributes atts) { + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_id)) >= 0) { + try { + ident.setId(atts.getValue(i)); + } catch (InvalidIdException e) { + //TODO Manage ID conflicts + e.printStackTrace(); + } + } + } + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2010_03_19.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2010_03_19.java new file mode 100644 index 00000000..ff71442d --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2010_03_19.java @@ -0,0 +1,515 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml.sax; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.primaresearch.dla.page.MetaData; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.GeometricObjectImpl; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.logical.Group; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.logical.ReadingOrder; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.TextObject; +import org.primaresearch.dla.page.layout.physical.text.impl.Glyph; +import org.primaresearch.dla.page.layout.physical.text.impl.TextLine; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.dla.page.layout.physical.text.impl.Word; +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.ident.Identifiable; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.UnsupportedSchemaVersionException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.Variable; +import org.primaresearch.shared.variable.VariableMap; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * Legacy PAGE XML handler for 2010 format. + * + * @author Christian Clausner + * + */ +public class SaxPageHandler_2010_03_19 extends SaxPageHandler { + + private static DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + + + private Page page = null; + private PageLayout layout = null; + private MetaData metaData = null; + + private GeometricObject currentGeometricObject = null; + private Region currentRegion = null; + private TextLine currentTextLine = null; + private Word currentWord = null; + private Glyph currentGlyph = null; + private TextObject currentTextObject = null; + private String insideElement = null; + private ReadingOrder readingOrder = null; + private Group currentLogicalGroup; + private StringBuffer currentText = null; + private XmlModelAndValidatorProvider validatorProvider; + private XmlFormatVersion schemaVersion; + + public SaxPageHandler_2010_03_19(XmlModelAndValidatorProvider validatorProvider, XmlFormatVersion schemaVersion) { + this.validatorProvider = validatorProvider; + this.schemaVersion = schemaVersion; + } + + public Page getPageObject() { + return page; + } + + /** + * Receive notification of the start of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) + throws SAXException { + + //Handle accumulated text + finishText(); + + insideElement = localName; + + if (DefaultXmlNames.ELEMENT_PcGts.equals(localName)){ + createPageObject(); + //GtsID + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_pcGtsId)) >= 0) { + try { + page.setGtsId(atts.getValue(i)); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + } + if (DefaultXmlNames.ELEMENT_Page.equals(localName)){ + handlePageElement(atts); + } + else if ( DefaultXmlNames.ELEMENT_Border.equals(localName) + || DefaultXmlNames.ELEMENT_PrintSpace.equals(localName)) { + currentGeometricObject = new GeometricObjectImpl(new Polygon()); + } + else if (DefaultXmlNames.ELEMENT_Coords.equals(localName)) { + if (currentGeometricObject != null) + currentGeometricObject.setCoords(new Polygon()); + } + else if (DefaultXmlNames.ELEMENT_Point.equals(localName)) { + handlePolygonPoint(atts); + } + else if (DefaultXmlNames.ELEMENT_TextRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.TextRegion, readId(atts)); + currentGeometricObject = currentRegion; + currentTextObject = (TextObject)currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_ImageRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.ImageRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_GraphicRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.GraphicRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_LineDrawingRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.LineDrawingRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_ChartRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.ChartRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_SeparatorRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.SeparatorRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_MathsRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.MathsRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_TableRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.TableRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_FrameRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.GraphicRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_NoiseRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.NoiseRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_UnknownRegion.equals(localName)) { + currentRegion = layout.createRegion(RegionType.UnknownRegion, readId(atts)); + currentGeometricObject = currentRegion; + handleContentObject(currentRegion, atts); + } + else if (DefaultXmlNames.ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + if (currentRegion != null && currentRegion.getType() == RegionType.TextRegion) + currentTextLine = ((TextRegion)currentRegion).createTextLine(readId(atts)); + currentGeometricObject = currentTextLine; + currentTextObject = currentTextLine; + handleContentObject(currentTextLine, atts); + } + else if (DefaultXmlNames.ELEMENT_Word.equals(localName)) { + currentWord = null; + if (currentTextLine != null) + currentWord = currentTextLine.createWord(readId(atts)); + currentGeometricObject = currentWord; + currentTextObject = currentWord; + handleContentObject(currentWord, atts); + } + else if (DefaultXmlNames.ELEMENT_Glyph.equals(localName)) { + currentGlyph = null; + if (currentWord != null) + currentGlyph = currentWord.createGlyph(readId(atts)); + currentGeometricObject = currentGlyph; + currentTextObject = currentGlyph; + handleContentObject(currentGlyph, atts); + } + else if (DefaultXmlNames.ELEMENT_ReadingOrder.equals(localName)) { + readingOrder = layout.createReadingOrder(); + currentLogicalGroup = null; + } + else if ( DefaultXmlNames.ELEMENT_OrderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_OrderedGroupIndexed.equals(localName)) { + Group group; + if (currentLogicalGroup == null) //Root group + group = readingOrder.getRoot(); + else //Child group + { + try { + group = currentLogicalGroup.createChildGroup(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + } + group.setOrdered(true); + currentLogicalGroup = group; + parseId(group, atts); + } + else if ( DefaultXmlNames.ELEMENT_UnorderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_UnorderedGroupIndexed.equals(localName)) { + Group group; + if (currentLogicalGroup == null) //Root group + group = readingOrder.getRoot(); + else //Child group + { + try { + group = currentLogicalGroup.createChildGroup(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + } + group.setOrdered(false); + currentLogicalGroup = group; + parseId(group, atts); + } + else if ( DefaultXmlNames.ELEMENT_RegionRef.equals(localName) + || DefaultXmlNames.ELEMENT_RegionRefIndexed.equals(localName)) { + + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_regionRef)) >= 0) { + currentLogicalGroup.addRegionRef(atts.getValue(i)); + } + } + else if (DefaultXmlNames.ELEMENT_Layers.equals(localName)) { + layout.createLayers(); + currentLogicalGroup = null; + } + else if (DefaultXmlNames.ELEMENT_Layer.equals(localName)) { + Layer layer = layout.getLayers().createLayer(); + currentLogicalGroup = layer; + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_zIndex)) >= 0) { + layer.setZIndex(new Integer(atts.getValue(i))); + } + parseId(layer, atts); + } + } + + /** + * Receive notification of the end of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void endElement(String namespaceURI, String localName, String qName) + throws SAXException { + + //Handle accumulated text + finishText(); + + insideElement = null; + + if (DefaultXmlNames.ELEMENT_Border.equals(localName)) { + layout.setBorder(currentGeometricObject); + currentGeometricObject = null; + } + else if (DefaultXmlNames.ELEMENT_PrintSpace.equals(localName)) { + layout.setPrintSpace(currentGeometricObject); + currentGeometricObject = null; + } + else if ( DefaultXmlNames.ELEMENT_TextRegion.equals(localName) + || DefaultXmlNames.ELEMENT_ImageRegion.equals(localName) + || DefaultXmlNames.ELEMENT_GraphicRegion.equals(localName) + || DefaultXmlNames.ELEMENT_LineDrawingRegion.equals(localName) + || DefaultXmlNames.ELEMENT_ChartRegion.equals(localName) + || DefaultXmlNames.ELEMENT_SeparatorRegion.equals(localName) + || DefaultXmlNames.ELEMENT_MathsRegion.equals(localName) + || DefaultXmlNames.ELEMENT_TableRegion.equals(localName) + || DefaultXmlNames.ELEMENT_FrameRegion.equals(localName) + || DefaultXmlNames.ELEMENT_NoiseRegion.equals(localName) + || DefaultXmlNames.ELEMENT_UnknownRegion.equals(localName) + ) { + currentRegion = null; + currentGeometricObject = null; + currentTextObject = null; + } + else if ( DefaultXmlNames.ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + currentGeometricObject = currentRegion; //Set to parent + currentTextObject = (TextObject)currentRegion; + } + else if ( DefaultXmlNames.ELEMENT_Word.equals(localName)) { + currentWord = null; + currentGeometricObject = currentTextLine; //Set to parent + currentTextObject = currentTextLine; + } + else if ( DefaultXmlNames.ELEMENT_Glyph.equals(localName)) { + currentGlyph = null; + currentGeometricObject = currentWord; //Set to parent + currentTextObject = currentWord; + } + else if (DefaultXmlNames.ELEMENT_ReadingOrder.equals(localName)) { + currentLogicalGroup = null; + readingOrder = null; + } + else if ( DefaultXmlNames.ELEMENT_OrderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_OrderedGroupIndexed.equals(localName)) { + currentLogicalGroup = currentLogicalGroup.getParent(); + } + else if ( DefaultXmlNames.ELEMENT_UnorderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_UnorderedGroupIndexed.equals(localName)) { + currentLogicalGroup = currentLogicalGroup.getParent(); + } + else if (DefaultXmlNames.ELEMENT_Layer.equals(localName)) { + currentLogicalGroup = null; + } + } + + /** + * Receive notification of character data inside an element. + * @param ch - The characters. + * @param start - The start position in the character array. + * @param length - The number of characters to use from the character array. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void characters(char[] ch, int start, int length) + throws SAXException { + + String strValue = new String(ch, start, length); + + //Text might be parsed bit by bit, so we have to accumulate until a closing tag is found. + if (currentText == null) + currentText = new StringBuffer(); + currentText.append(strValue); + } + + /** + * Writes accumulated text to the right object. + */ + private void finishText() { + if (currentText != null) { + String strValue = currentText.toString(); + + if (currentTextObject != null) { + if (DefaultXmlNames.ELEMENT_Unicode.equals(insideElement)) { + currentTextObject.setText(strValue); + } + else if (DefaultXmlNames.ELEMENT_PlainText.equals(insideElement)) { + currentTextObject.setPlainText(strValue); + } + } + if (metaData != null) { + if (DefaultXmlNames.ELEMENT_Creator.equals(insideElement)) { + metaData.setCreator(strValue); + } + else if (DefaultXmlNames.ELEMENT_Comments.equals(insideElement)) { + metaData.setComments(strValue); + } + else if (DefaultXmlNames.ELEMENT_Created.equals(insideElement)) { + metaData.setCreationTime(parseDate(strValue)); + } + else if (DefaultXmlNames.ELEMENT_LastChange.equals(insideElement)) { + metaData.setLastModifiedTime(parseDate(strValue)); + } + } + + currentText = null; + } + } + + private void createPageObject() { + if (validatorProvider != null && schemaVersion != null) { + try { + page = new Page(validatorProvider.getSchemaParser(schemaVersion)); + //page.setFormatVersion(schemaVersion); + } catch (UnsupportedSchemaVersionException e) { + e.printStackTrace(); + page = new Page(); + } + } + else + page = new Page(); + + layout = page.getLayout(); + metaData = page.getMetaData(); + } + + /** + * Reads the attributes of the Page element. + */ + private void handlePageElement(Attributes atts) { + int i; + + //Size + int width = 0; + int height = 0; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageWidth)) >= 0) { + width = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageHeight)) >= 0) { + height = new Integer(atts.getValue(i)); + } + page.getLayout().setSize(width, height); + + //Image filename + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageFilename)) >= 0) { + page.setImageFilename(atts.getValue(i)); + } + + } + + /** + * Reads the coordinates of a single polygon point. + */ + private void handlePolygonPoint(Attributes atts) { + if (currentGeometricObject == null || currentGeometricObject.getCoords() == null) + return; + + int x=0; + int y=0; + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_x)) >= 0) { + x = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(DefaultXmlNames.ATTR_y)) >= 0) { + y = new Integer(atts.getValue(i)); + } + currentGeometricObject.getCoords().addPoint(x, y); + } + + /** + * Reads the attributes of a content object. + */ + private void handleContentObject(ContentObject obj, Attributes atts) { + + //Id + //parseId(obj, atts); + + //Attributes + VariableMap map = obj.getAttributes(); + int p; + for (int i=0; i= 0) { + var.parseValue(atts.getValue(p)); + } + } + } + + private String getXmlAttributeName(String name) { + return name; //TODO Should there be a mechanism to translate attribute names to XML names? + } + + /** + * Parses a date given as string using the default date format. + */ + private Date parseDate(String str) { + try { + return DATE_FORMAT.parse(str); + } catch (ParseException e) { + return new Date(); + } + } + + private String readId(Attributes atts) { + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_id)) >= 0) + return atts.getValue(i); + return ""; + } + + /** + * Reads the ID attribute and sets it in the Identifiable object. + */ + private void parseId(Identifiable ident, Attributes atts) { + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_id)) >= 0) { + try { + ident.setId(atts.getValue(i)); + } catch (InvalidIdException e) { + //TODO Manage ID conflicts + e.printStackTrace(); + } + } + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2013_07_15.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2013_07_15.java new file mode 100644 index 00000000..3c90a31e --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_2013_07_15.java @@ -0,0 +1,733 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml.sax; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +import org.primaresearch.dla.page.MetaData; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.Page.AlternativeImage; +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.GeometricObjectImpl; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.logical.ContentObjectRelation; +import org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType; +import org.primaresearch.dla.page.layout.logical.Group; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.logical.ReadingOrder; +import org.primaresearch.dla.page.layout.logical.Relations; +import org.primaresearch.dla.page.layout.physical.AttributeContainer; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.TextObject; +import org.primaresearch.dla.page.layout.physical.text.impl.Glyph; +import org.primaresearch.dla.page.layout.physical.text.impl.TextLine; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.dla.page.layout.physical.text.impl.Word; +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.ident.Identifiable; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.UnsupportedSchemaVersionException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.Variable; +import org.primaresearch.shared.variable.VariableMap; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * XML handler for 2013 PAGE format. + * + * @author Christian Clausner + * + */ +public class SaxPageHandler_2013_07_15 extends SaxPageHandler { + + private static DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + + + private Page page = null; + private PageLayout layout = null; + private MetaData metaData = null; + + private GeometricObject currentGeometricObject = null; + private Region currentRegion = null; + private Stack regionStack = new Stack(); //for nesting of regions + private TextLine currentTextLine = null; + private Word currentWord = null; + private Glyph currentGlyph = null; + private TextObject currentTextObject = null; + private String insideElement = null; + private ReadingOrder readingOrder = null; + private Group currentLogicalGroup; + private StringBuffer currentText = null; + private XmlModelAndValidatorProvider validatorProvider; + private XmlFormatVersion schemaVersion; + private List> tempRelations; + private List currentRelation; //[type, custom, comments, id1, id2] + Map contentObjects = new HashMap(); + + public SaxPageHandler_2013_07_15(XmlModelAndValidatorProvider validatorProvider, XmlFormatVersion schemaVersion) { + this.validatorProvider = validatorProvider; + this.schemaVersion = schemaVersion; + } + + public Page getPageObject() { + return page; + } + + /** + * Receive notification of the start of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) + throws SAXException { + + //Handle accumulated text + finishText(); + + insideElement = localName; + + if (DefaultXmlNames.ELEMENT_PcGts.equals(localName)){ + createPageObject(); + //GtsID + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_pcGtsId)) >= 0) { + try { + page.setGtsId(atts.getValue(i)); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + } + if (DefaultXmlNames.ELEMENT_Page.equals(localName)){ + handlePageElement(atts); + } + else if ( DefaultXmlNames.ELEMENT_Border.equals(localName) + || DefaultXmlNames.ELEMENT_PrintSpace.equals(localName)) { + currentGeometricObject = new GeometricObjectImpl(new Polygon()); + } + else if (DefaultXmlNames.ELEMENT_Coords.equals(localName)) { + handleCoords(atts); + } + else if (DefaultXmlNames.ELEMENT_Baseline.equals(localName)) { + handleBaseline(atts); + } + else if (DefaultXmlNames.ELEMENT_TextRegion.equals(localName)) { + handleRegion(atts, RegionType.TextRegion); + currentTextObject = (TextObject)currentRegion; + + } + else if (DefaultXmlNames.ELEMENT_ImageRegion.equals(localName)) { + handleRegion(atts, RegionType.ImageRegion); + } + else if (DefaultXmlNames.ELEMENT_GraphicRegion.equals(localName)) { + handleRegion(atts, RegionType.GraphicRegion); + } + else if (DefaultXmlNames.ELEMENT_LineDrawingRegion.equals(localName)) { + handleRegion(atts, RegionType.LineDrawingRegion); + } + else if (DefaultXmlNames.ELEMENT_ChartRegion.equals(localName)) { + handleRegion(atts, RegionType.ChartRegion); + } + else if (DefaultXmlNames.ELEMENT_SeparatorRegion.equals(localName)) { + handleRegion(atts, RegionType.SeparatorRegion); + } + else if (DefaultXmlNames.ELEMENT_MathsRegion.equals(localName)) { + handleRegion(atts, RegionType.MathsRegion); + } + else if (DefaultXmlNames.ELEMENT_TableRegion.equals(localName)) { + handleRegion(atts, RegionType.TableRegion); + } + else if (DefaultXmlNames.ELEMENT_AdvertRegion.equals(localName)) { + handleRegion(atts, RegionType.AdvertRegion); + } + else if (DefaultXmlNames.ELEMENT_ChemRegion.equals(localName)) { + handleRegion(atts, RegionType.ChemRegion); + } + else if (DefaultXmlNames.ELEMENT_MusicRegion.equals(localName)) { + handleRegion(atts, RegionType.MusicRegion); + } + else if (DefaultXmlNames.ELEMENT_FrameRegion.equals(localName)) { + handleRegion(atts, RegionType.GraphicRegion); + Variable v = currentRegion.getAttributes().get("type"); + if (v != null) + { + try { + v.setValue(new StringValue("frame")); + } catch (Exception e) { + } + } + } + else if (DefaultXmlNames.ELEMENT_NoiseRegion.equals(localName)) { + handleRegion(atts, RegionType.NoiseRegion); + } + else if (DefaultXmlNames.ELEMENT_UnknownRegion.equals(localName)) { + handleRegion(atts, RegionType.UnknownRegion); + } + else if (DefaultXmlNames.ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + if (currentRegion != null && currentRegion.getType() == RegionType.TextRegion) + currentTextLine = ((TextRegion)currentRegion).createTextLine(readId(atts)); + currentGeometricObject = currentTextLine; + currentTextObject = currentTextLine; + contentObjects.put(currentTextLine.getId().toString(), currentTextLine); + handleAttributeContainer(currentTextLine, atts); + } + else if (DefaultXmlNames.ELEMENT_Word.equals(localName)) { + currentWord = null; + if (currentTextLine != null) + currentWord = currentTextLine.createWord(readId(atts)); + currentGeometricObject = currentWord; + currentTextObject = currentWord; + contentObjects.put(currentWord.getId().toString(), currentWord); + handleAttributeContainer(currentWord, atts); + } + else if (DefaultXmlNames.ELEMENT_Glyph.equals(localName)) { + currentGlyph = null; + if (currentWord != null) + currentGlyph = currentWord.createGlyph(readId(atts)); + currentGeometricObject = currentGlyph; + currentTextObject = currentGlyph; + contentObjects.put(currentGlyph.getId().toString(), currentGlyph); + handleAttributeContainer(currentGlyph, atts); + } + else if (DefaultXmlNames.ELEMENT_TextEquiv.equals(localName)) { + handleTextEquiv(atts); + } + else if (DefaultXmlNames.ELEMENT_ReadingOrder.equals(localName)) { + readingOrder = layout.createReadingOrder(); + currentLogicalGroup = null; + } + else if ( DefaultXmlNames.ELEMENT_OrderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_OrderedGroupIndexed.equals(localName)) { + Group group; + if (currentLogicalGroup == null) //Root group + group = readingOrder.getRoot(); + else //Child group + { + try { + group = currentLogicalGroup.createChildGroup(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + } + group.setOrdered(true); + currentLogicalGroup = group; + int i; + //Caption + if ((i = atts.getIndex(DefaultXmlNames.ATTR_caption)) >= 0) { + group.setCaption(atts.getValue(i)); + } + parseId(group, atts); + } + else if ( DefaultXmlNames.ELEMENT_UnorderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_UnorderedGroupIndexed.equals(localName)) { + Group group; + if (currentLogicalGroup == null) //Root group + group = readingOrder.getRoot(); + else //Child group + { + try { + group = currentLogicalGroup.createChildGroup(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + } + group.setOrdered(false); + currentLogicalGroup = group; + int i; + //Caption + if ((i = atts.getIndex(DefaultXmlNames.ATTR_caption)) >= 0) { + group.setCaption(atts.getValue(i)); + } + parseId(group, atts); + } + else if ( DefaultXmlNames.ELEMENT_RegionRef.equals(localName) + || DefaultXmlNames.ELEMENT_RegionRefIndexed.equals(localName)) { + + int i; + if (currentRelation != null) { + if ((i = atts.getIndex(DefaultXmlNames.ATTR_regionRef)) >= 0) { + currentRelation.add(atts.getValue(i)); + } + } + else if (currentLogicalGroup != null) { + if ((i = atts.getIndex(DefaultXmlNames.ATTR_regionRef)) >= 0) { + currentLogicalGroup.addRegionRef(atts.getValue(i)); + } + } + } + else if (DefaultXmlNames.ELEMENT_Layers.equals(localName)) { + layout.createLayers(); + currentLogicalGroup = null; + } + else if (DefaultXmlNames.ELEMENT_Layer.equals(localName)) { + Layer layer = layout.getLayers().createLayer(); + currentLogicalGroup = layer; + int i; + //Z-Index + if ((i = atts.getIndex(DefaultXmlNames.ATTR_zIndex)) >= 0) { + layer.setZIndex(new Integer(atts.getValue(i))); + } + //Caption + if ((i = atts.getIndex(DefaultXmlNames.ATTR_caption)) >= 0) { + layer.setCaption(atts.getValue(i)); + } + parseId(layer, atts); + } + else if (DefaultXmlNames.ELEMENT_AlternativeImage.equals(localName)) { + handleAlternativeImage(atts); + } + else if (DefaultXmlNames.ELEMENT_Relation.equals(localName)) { + handleRelationStart(atts); + } + else if (DefaultXmlNames.ELEMENT_TextStyle.equals(localName)) { + parseTextStyle((ContentObject)currentTextObject, atts); + } + } + + /** + * Receive notification of the end of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void endElement(String namespaceURI, String localName, String qName) + throws SAXException { + + //Handle accumulated text + finishText(); + + insideElement = null; + + if (DefaultXmlNames.ELEMENT_Page.equals(localName)) { + finaliseRelations(); + } + else if (DefaultXmlNames.ELEMENT_Border.equals(localName)) { + layout.setBorder(currentGeometricObject); + currentGeometricObject = null; + } + else if (DefaultXmlNames.ELEMENT_PrintSpace.equals(localName)) { + layout.setPrintSpace(currentGeometricObject); + currentGeometricObject = null; + } + else if ( DefaultXmlNames.ELEMENT_TextRegion.equals(localName) + || DefaultXmlNames.ELEMENT_ImageRegion.equals(localName) + || DefaultXmlNames.ELEMENT_GraphicRegion.equals(localName) + || DefaultXmlNames.ELEMENT_LineDrawingRegion.equals(localName) + || DefaultXmlNames.ELEMENT_ChartRegion.equals(localName) + || DefaultXmlNames.ELEMENT_SeparatorRegion.equals(localName) + || DefaultXmlNames.ELEMENT_MathsRegion.equals(localName) + || DefaultXmlNames.ELEMENT_TableRegion.equals(localName) + //|| DefaultXmlNames.ELEMENT_FrameRegion.equals(localName) + || DefaultXmlNames.ELEMENT_NoiseRegion.equals(localName) + || DefaultXmlNames.ELEMENT_UnknownRegion.equals(localName) + || DefaultXmlNames.ELEMENT_AdvertRegion.equals(localName) + || DefaultXmlNames.ELEMENT_ChemRegion.equals(localName) + || DefaultXmlNames.ELEMENT_MusicRegion.equals(localName) + ) { + handleRegionEnd(); + } + else if ( DefaultXmlNames.ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + currentGeometricObject = currentRegion; //Set to parent + currentTextObject = (TextObject)currentRegion; + } + else if ( DefaultXmlNames.ELEMENT_Word.equals(localName)) { + currentWord = null; + currentGeometricObject = currentTextLine; //Set to parent + currentTextObject = currentTextLine; + } + else if ( DefaultXmlNames.ELEMENT_Glyph.equals(localName)) { + currentGlyph = null; + currentGeometricObject = currentWord; //Set to parent + currentTextObject = currentWord; + } + else if (DefaultXmlNames.ELEMENT_ReadingOrder.equals(localName)) { + currentLogicalGroup = null; + readingOrder = null; + } + else if ( DefaultXmlNames.ELEMENT_OrderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_OrderedGroupIndexed.equals(localName)) { + currentLogicalGroup = currentLogicalGroup.getParent(); + } + else if ( DefaultXmlNames.ELEMENT_UnorderedGroup.equals(localName) + || DefaultXmlNames.ELEMENT_UnorderedGroupIndexed.equals(localName)) { + currentLogicalGroup = currentLogicalGroup.getParent(); + } + else if (DefaultXmlNames.ELEMENT_Layer.equals(localName)) { + currentLogicalGroup = null; + } + else if (DefaultXmlNames.ELEMENT_Relation.equals(localName)) { + currentRelation = null; + } + } + + /** + * Receive notification of character data inside an element. + * @param ch - The characters. + * @param start - The start position in the character array. + * @param length - The number of characters to use from the character array. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void characters(char[] ch, int start, int length) + throws SAXException { + + String strValue = new String(ch, start, length); + + //Text might be parsed bit by bit, so we have to accumulate until a closing tag is found. + if (currentText == null) + currentText = new StringBuffer(); + currentText.append(strValue); + } + + /** + * Writes accumulated text to the right object. + */ + private void finishText() { + if (currentText != null) { + String strValue = currentText.toString(); + + if (currentTextObject != null) { + if (DefaultXmlNames.ELEMENT_Unicode.equals(insideElement)) { + currentTextObject.setText(strValue); + } + else if (DefaultXmlNames.ELEMENT_PlainText.equals(insideElement)) { + currentTextObject.setPlainText(strValue); + } + } + if (metaData != null) { + if (DefaultXmlNames.ELEMENT_Creator.equals(insideElement)) { + metaData.setCreator(strValue); + } + else if (DefaultXmlNames.ELEMENT_Comments.equals(insideElement)) { + metaData.setComments(strValue); + } + else if (DefaultXmlNames.ELEMENT_Created.equals(insideElement)) { + metaData.setCreationTime(parseDate(strValue)); + } + else if (DefaultXmlNames.ELEMENT_LastChange.equals(insideElement)) { + metaData.setLastModifiedTime(parseDate(strValue)); + } + } + + currentText = null; + } + } + + private void createPageObject() { + if (validatorProvider != null && schemaVersion != null) { + try { + page = new Page(validatorProvider.getSchemaParser(schemaVersion)); + //page.setFormatVersion(schemaVersion); + } catch (UnsupportedSchemaVersionException e) { + e.printStackTrace(); + page = new Page(); + } + } + else + page = new Page(); + + layout = page.getLayout(); + metaData = page.getMetaData(); + } + + /** + * Reads the attributes of the Page element. + */ + private void handlePageElement(Attributes atts) { + int i; + + //Size + int width = 0; + int height = 0; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageWidth)) >= 0) { + width = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageHeight)) >= 0) { + height = new Integer(atts.getValue(i)); + } + page.getLayout().setSize(width, height); + + //Image filename + if ((i = atts.getIndex(DefaultXmlNames.ATTR_imageFilename)) >= 0) { + page.setImageFilename(atts.getValue(i)); + } + + //Other attributes (page type, ...) + handleAttributeContainer(page, atts); + } + + /** + * Adds an alternative image to the list of images of the page object. + */ + private void handleAlternativeImage(Attributes atts) { + if (page.getAlternativeImages() == null) + return; + + AlternativeImage img = null; + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_filename)) >= 0) { + img = new AlternativeImage(atts.getValue(i)); + page.getAlternativeImages().add(img); + } + else + return; + + //Comments + if ((i = atts.getIndex(DefaultXmlNames.ATTR_comments)) >= 0) { + img.setComments(atts.getValue(i)); + } + } + + /** + * Handles attributes of the TextEquiv element. + */ + private void handleTextEquiv(Attributes atts) { + if (currentTextObject == null) + return; + + int i; + + //OCR confidence + if ((i = atts.getIndex(DefaultXmlNames.ATTR_conf)) >= 0) { + Double confidence = new Double(atts.getValue(i)); + currentTextObject.setConfidence(confidence); + } + } + + /** + * Reads the attributes of a content object. + */ + private void handleAttributeContainer(AttributeContainer obj, Attributes atts) { + + //Id + //parseId(obj, atts); + + //Attributes + VariableMap map = obj.getAttributes(); + int p; + for (int i=0; i= 0) { + var.parseValue(atts.getValue(p)); + } + } + } + + /** + * Reads text style specific attributes + */ + private void parseTextStyle(ContentObject obj, Attributes atts) { + if (obj == null) + return; + VariableMap objectAttrs = obj.getAttributes(); + if (objectAttrs != null) { + int p; + for (int i=0; i= 0) { + var.parseValue(atts.getValue(p)); + } + } + } + } + + private void handleCoords(Attributes atts) { + if (currentGeometricObject != null) { + Polygon polygon = new Polygon(); + currentGeometricObject.setCoords(polygon); + handlePointsAttribute(polygon, atts); + } + } + + private void handleBaseline(Attributes atts) { + if (currentTextLine != null) { + Polygon baseline = new Polygon(); + currentTextLine.setBaseline(baseline); + handlePointsAttribute(baseline, atts); + } + } + + private void handleRelationStart(Attributes atts) { + if (tempRelations == null) + tempRelations = new ArrayList>(); + + int i; + //Type + if ((i = atts.getIndex(DefaultXmlNames.ATTR_type)) >= 0) { + List rel = new ArrayList(); + tempRelations.add(rel); + currentRelation = rel; + + rel.add(atts.getValue(i)); + + //Custom + if ((i = atts.getIndex(DefaultXmlNames.ATTR_custom)) >= 0) { + currentRelation.add(atts.getValue(i)); + } else + currentRelation.add(""); + //Comments + if ((i = atts.getIndex(DefaultXmlNames.ATTR_comments)) >= 0) { + currentRelation.add(atts.getValue(i)); + } else + currentRelation.add(""); + } + } + + /** + * Translates the temporary relations data structure to the proper one. + */ + private void finaliseRelations() { + if (tempRelations == null) + return; + + PageLayout layout = page.getLayout(); + Relations relations = layout.getRelations(); + if (relations == null) + return; + + for (int i=0; i rel = tempRelations.get(i); + if (rel != null && rel.size() == 5) { + RelationType type = "link".equals(rel.get(0)) ? RelationType.Link : RelationType.Join; + String custom = rel.get(1); + String comments = rel.get(2); + String id1 = rel.get(3); + String id2 = rel.get(4); + + ContentObject obj1 = contentObjects.get(id1); + ContentObject obj2 = contentObjects.get(id2); + + if (obj1 != null && obj2 != null) { + ContentObjectRelation relation = new ContentObjectRelation(obj1, obj2, type); + relation.setCustomField(custom); + relation.setComments(comments); + relations.addRelation(relation); + } + } + } + } + + + private void handlePointsAttribute(Polygon polygon, Attributes atts) { + //Points + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_points)) >= 0) { + String pointList = atts.getValue(i); + + //Split using space + String[] pointStrings = pointList.split(" "); + + for (i = 0; i= 0) + return atts.getValue(i); + return ""; + } + + /** + * Reads the ID attribute and sets it in the Identifiable object. + */ + private void parseId(Identifiable ident, Attributes atts) { + int i; + if ((i = atts.getIndex(DefaultXmlNames.ATTR_id)) >= 0) { + try { + ident.setId(atts.getValue(i)); + } catch (InvalidIdException e) { + //TODO Manage ID conflicts + e.printStackTrace(); + } + } + } + + private void handleRegion(Attributes atts, RegionType type) { + currentRegion = layout.createRegion(type, readId(atts), (RegionContainer)currentRegion); //Either adds it to the page (if currentRegion is null) or to the current region (as nested region) + regionStack.push(currentRegion); + currentGeometricObject = currentRegion; + contentObjects.put(currentRegion.getId().toString(), currentRegion); + handleAttributeContainer(currentRegion, atts); + } + + private void handleRegionEnd() { + regionStack.pop(); + if (!regionStack.isEmpty()) { + currentRegion = regionStack.lastElement(); + if (currentRegion instanceof TextObject) + currentTextObject = (TextObject)currentRegion; + currentGeometricObject = currentRegion; + } + else { + currentRegion = null; + currentGeometricObject = null; + currentTextObject = null; + } + } + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_AbbyyFineReader10.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_AbbyyFineReader10.java new file mode 100644 index 00000000..2144f42e --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_AbbyyFineReader10.java @@ -0,0 +1,401 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml.sax; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.primaresearch.dla.page.MetaData; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.UnsupportedSchemaVersionException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.maths.geometry.Rect; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * Experimental SAX XML handler to read Abbyy FineReader 10 XML files. + * + * @author Christian Clausner + * + */ +public class SaxPageHandler_AbbyyFineReader10 extends SaxPageHandler { + + private static final String ELEMENT_document = "document"; + private static final String ELEMENT_page = "page"; + private static final String ELEMENT_region = "region"; + private static final String ELEMENT_rect = "rect"; + private static final String ELEMENT_block = "block"; + + private static final String ATTR_producer = "producer"; + private static final String ATTR_width = "width"; + private static final String ATTR_height = "height"; + private static final String ATTR_originalCoords = "originalCoords"; + private static final String ATTR_l = "l"; + private static final String ATTR_t = "t"; + private static final String ATTR_r = "r"; + private static final String ATTR_b = "b"; + private static final String ATTR_blockType = "blockType"; + + private static Comparator rectComparator = new SortRectsVertically(); + + private Page page; + private PageLayout layout = null; + private MetaData metaData = null; + + @SuppressWarnings("unused") + private String insideElement = null; + private List currentRects = null; + private GeometricObject currentGeometricObject = null; + private Region currentRegion = null; + + private XmlModelAndValidatorProvider validatorProvider; + private XmlFormatVersion schemaVersion; + + public SaxPageHandler_AbbyyFineReader10(XmlModelAndValidatorProvider validatorProvider, XmlFormatVersion schemaVersion) { + this.validatorProvider = validatorProvider; + this.schemaVersion = schemaVersion; + } + + @Override + public Page getPageObject() { + return page; + } + + /** + * Receive notification of the start of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) + throws SAXException { + + //Handle accumulated text + finishText(); + + insideElement = localName; + + if (ELEMENT_document.equals(localName)){ + createPageObject(); + //Producer + int i; + if ((i = atts.getIndex(ATTR_producer)) >= 0) { + if (metaData != null) + metaData.setCreator(atts.getValue(i)); + } + } + else if (ELEMENT_page.equals(localName)){ + handlePageElement(atts); + } + else if (ELEMENT_region.equals(localName)) { + if (currentGeometricObject != null) + currentGeometricObject.setCoords(new Polygon()); + currentRects = new ArrayList(); + } + else if (ELEMENT_rect.equals(localName)) { + handleRegionRect(atts); + } + else if (ELEMENT_block.equals(localName)) { + currentRegion = createRegion(atts); + currentGeometricObject = currentRegion; + } + /*else if (ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + if (currentRegion != null && currentRegion.getType() == RegionType.TextRegion) + currentTextLine = ((TextRegion)currentRegion).createTextLine(readId(atts)); + currentGeometricObject = currentTextLine; + currentTextObject = currentTextLine; + handleContentObject(currentTextLine, atts); + } + else if (ELEMENT_Word.equals(localName)) { + currentWord = null; + if (currentTextLine != null) + currentWord = currentTextLine.createWord(readId(atts)); + currentGeometricObject = currentWord; + currentTextObject = currentWord; + handleContentObject(currentWord, atts); + } + else if (ELEMENT_Glyph.equals(localName)) { + currentGlyph = null; + if (currentWord != null) + currentGlyph = currentWord.createGlyph(readId(atts)); + currentGeometricObject = currentGlyph; + currentTextObject = currentGlyph; + handleContentObject(currentGlyph, atts); + }*/ + } + + /** + * Receive notification of the end of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void endElement(String namespaceURI, String localName, String qName) + throws SAXException { + + //Handle accumulated text + finishText(); + + insideElement = null; + + if ( ELEMENT_block.equals(localName)) { + if (currentRects != null && !currentRects.isEmpty() && currentGeometricObject != null) { + Polygon polygon = convertToPolygon(currentRects); + currentGeometricObject.setCoords(polygon); + } + currentRegion = null; + currentGeometricObject = null; + } + /*else if ( ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + currentGeometricObject = currentRegion; //Set to parent + currentTextObject = (TextObject)currentRegion; + } + else if ( ELEMENT_Word.equals(localName)) { + currentWord = null; + currentGeometricObject = currentTextLine; //Set to parent + currentTextObject = currentTextLine; + } + else if ( ELEMENT_Glyph.equals(localName)) { + currentGlyph = null; + currentGeometricObject = currentWord; //Set to parent + currentTextObject = currentWord; + }*/ + } + + /** + * Receive notification of character data inside an element. + * @param ch - The characters. + * @param start - The start position in the character array. + * @param length - The number of characters to use from the character array. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void characters(char[] ch, int start, int length) + throws SAXException { + + //String strValue = new String(ch, start, length); + + //Text might be parsed bit by bit, so we have to accumulate until a closing tag is found. + //if (currentText == null) + // currentText = new StringBuffer(); + //currentText.append(strValue); + } + + /** + * Writes accumulated text to the right object. + */ + private void finishText() { + /*if (currentText != null) { + String strValue = currentText.toString(); + + if (currentTextObject != null) { + if (ELEMENT_Unicode.equals(insideElement)) { + currentTextObject.setText(strValue); + } + else if (ELEMENT_PlainText.equals(insideElement)) { + currentTextObject.setPlainText(strValue); + } + } + if (metaData != null) { + if (ELEMENT_Creator.equals(insideElement)) { + metaData.setCreator(strValue); + } + else if (ELEMENT_Comments.equals(insideElement)) { + metaData.setComments(strValue); + } + else if (ELEMENT_Created.equals(insideElement)) { + metaData.setCreationTime(parseDate(strValue)); + } + else if (ELEMENT_LastChange.equals(insideElement)) { + metaData.setLastModifiedTime(parseDate(strValue)); + } + } + + currentText = null; + }*/ + } + + private void createPageObject() { + if (validatorProvider != null && schemaVersion != null) { + try { + page = new Page(validatorProvider.getSchemaParser(validatorProvider.getLatestSchemaVersion())); + } catch (UnsupportedSchemaVersionException e) { + e.printStackTrace(); + page = new Page(); + } + } + else + page = new Page(); + + layout = page.getLayout(); + metaData = page.getMetaData(); + } + + /** + * Reads the attributes of the Page element. + */ + private void handlePageElement(Attributes atts) { + int i; + + //Size + int width = 0; + int height = 0; + if ((i = atts.getIndex(ATTR_width)) >= 0) { + width = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(ATTR_height)) >= 0) { + height = new Integer(atts.getValue(i)); + } + page.getLayout().setSize(width, height); + + //Original coords (1==coords relative to original image, otherwise coords relative to deskewed image) + if ((i = atts.getIndex(ATTR_originalCoords)) >= 0) { + if (metaData != null) { + String comments = metaData.getComments(); + if (comments == null) + comments = ""; + else + comments += "\n"; + comments += "Original coords: "+(new Integer(atts.getValue(i)).equals(1) ? "true" : "false"); + } + } + } + + /** + * Reads the coordinates of a single rectangle. + */ + private void handleRegionRect(Attributes atts) { + if (currentRects == null) + return; + + + int i, l=0, t=0, r=0, b=0; + if ((i = atts.getIndex(ATTR_l)) >= 0) { + l = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(ATTR_t)) >= 0) { + t = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(ATTR_r)) >= 0) { + r = new Integer(atts.getValue(i)); + } + if ((i = atts.getIndex(ATTR_b)) >= 0) { + b = new Integer(atts.getValue(i)); + } + currentRects.add(new Rect(l, t, r, b)); + } + + + //private String getXmlAttributeName(String name) { + // return name; //TODO Should there be a mechanism to translate attribute names to XML names? + //} + + private Region createRegion(Attributes atts) { + String abbyyType = null; + int i; + if ((i = atts.getIndex(ATTR_blockType)) >= 0) { + abbyyType = atts.getValue(i); + } + + RegionType primaType = RegionType.UnknownRegion; + if ("Text".equals(abbyyType)) + primaType = RegionType.TextRegion; + else if ("Table".equals(abbyyType)) + primaType = RegionType.TableRegion; + else if ("Picture".equals(abbyyType)) + primaType = RegionType.ImageRegion; + else if ("Barcode".equals(abbyyType)) + primaType = RegionType.GraphicRegion; + else if ("Separator".equals(abbyyType)) + primaType = RegionType.SeparatorRegion; + else if ("SeparatorsBox".equals(abbyyType)) + primaType = RegionType.SeparatorRegion; + + return layout.createRegion(primaType); + } + + /** + * Converts a stack of rectangles to a polygon. + */ + private Polygon convertToPolygon(List rects) { + + if (rects.isEmpty()) + return null; + + Polygon polygon = new Polygon(); + + //One rectangle + if (rects.size() == 1) { + Rect rect = rects.get(0); + polygon.addPoint(rect.left, rect.top); + polygon.addPoint(rect.right, rect.top); + polygon.addPoint(rect.right, rect.bottom); + polygon.addPoint(rect.left, rect.bottom); + } + //Multiple rectangles + else { + //Sort rects vertically + Collections.sort(rects, rectComparator); + + //Create polygon + // Right sides + Rect rect; + for (int i=0; i=0; i--) { + rect = rects.get(i); + polygon.addPoint(rect.left, rect.bottom); + polygon.addPoint(rect.left, rect.top); + } + } + + return polygon; + } + + private static class SortRectsVertically implements Comparator { + @Override + public int compare(Rect rect1, Rect rect2) { + int center1 = (rect1.top + rect1.bottom) / 2; + int center2 = (rect2.top + rect2.bottom) / 2; + if (center1 < center2) + return -1; + if (center1 > center2) + return 1; + return 0; + } + } + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Alto_2_1.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Alto_2_1.java new file mode 100644 index 00000000..288914cb --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Alto_2_1.java @@ -0,0 +1,1064 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml.sax; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.primaresearch.dla.page.MetaData; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.Page.MeasurementUnit; +import org.primaresearch.dla.page.layout.GeometricObjectImpl; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.logical.Group; +import org.primaresearch.dla.page.layout.logical.ReadingOrder; +import org.primaresearch.dla.page.layout.physical.ContentIterator; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.impl.ImageRegion; +import org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.impl.TextLine; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.dla.page.layout.physical.text.impl.Word; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.UnsupportedSchemaVersionException; +import org.primaresearch.maths.geometry.Polygon; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * Experimental SAX XML handler to read ALTO XML files. + * + * @author Christian Clausner + * + */ +public class SaxPageHandler_Alto_2_1 extends SaxPageHandler { + + private static final String ELEMENT_alto = "alto"; + //private static final String ELEMENT_Description = "Description"; + //private static final String ELEMENT_Layout = "Layout"; + private static final String ELEMENT_MeasurementUnit = "MeasurementUnit"; + //private static final String ELEMENT_sourceImageInformation = "sourceImageInformation"; + private static final String ELEMENT_fileName = "fileName"; + private static final String ELEMENT_OCRProcessing = "OCRProcessing"; + private static final String ELEMENT_preProcessingStep = "preProcessingStep"; + private static final String ELEMENT_ocrProcessingStep = "ocrProcessingStep"; + private static final String ELEMENT_postProcessingStep = "postProcessingStep"; + private static final String ELEMENT_processingDateTime = "processingDateTime"; + private static final String ELEMENT_processingAgency = "processingAgency"; + private static final String ELEMENT_processingStepDescription = "processingStepDescription"; + private static final String ELEMENT_processingStepSettings = "processingStepSettings"; + private static final String ELEMENT_processingSoftware = "processingSoftware"; + private static final String ELEMENT_softwareName = "softwareName"; + private static final String ELEMENT_softwareCreator = "softwareCreator"; + private static final String ELEMENT_softwareVersion = "softwareVersion"; + private static final String ELEMENT_applicationDescription = "applicationDescription"; + private static final String ELEMENT_Page = "Page"; + private static final String ELEMENT_TopMargin = "TopMargin"; + private static final String ELEMENT_LeftMargin = "LeftMargin"; + private static final String ELEMENT_RightMargin = "RightMargin"; + private static final String ELEMENT_BottomMargin = "BottomMargin"; + private static final String ELEMENT_PrintSpace = "PrintSpace"; + private static final String ELEMENT_TextBlock = "TextBlock"; + private static final String ELEMENT_Illustration = "Illustration"; + private static final String ELEMENT_GraphicalElement = "GraphicalElement"; + private static final String ELEMENT_ComposedBlock = "ComposedBlock"; + //private static final String ELEMENT_Shape = "Shape"; + private static final String ELEMENT_Polygon = "Polygon"; + private static final String ELEMENT_Ellipse = "Ellipse"; + private static final String ELEMENT_Circle = "Circle"; + private static final String ELEMENT_TextLine = "TextLine"; + private static final String ELEMENT_String = "String"; + private static final String ELEMENT_HYP = "HYP"; + + private static final String ATTR_ID = "ID"; + private static final String ATTR_IDNEXT = "IDNEXT"; + private static final String ATTR_PAGECLASS = "PAGECLASS"; + private static final String ATTR_HEIGHT = "HEIGHT"; + private static final String ATTR_WIDTH = "WIDTH"; + private static final String ATTR_PHYSICAL_IMG_NR = "PHYSICAL_IMG_NR"; + private static final String ATTR_PRINTED_IMG_NR = "PRINTED_IMG_NR"; + private static final String ATTR_QUALITY = "QUALITY"; + private static final String ATTR_QUALITY_DETAIL = "QUALITY_DETAIL"; + private static final String ATTR_POSITION = "POSITION"; + private static final String ATTR_PROCESSING = "PROCESSING"; + private static final String ATTR_ACCURACY = "ACCURACY"; + private static final String ATTR_PC = "PC"; + private static final String ATTR_HPOS = "HPOS"; + private static final String ATTR_VPOS = "VPOS"; + private static final String ATTR_ROTATION = "ROTATION"; + private static final String ATTR_POINTS = "POINTS"; + private static final String ATTR_RADIUS = "RADIUS"; + private static final String ATTR_HLENGTH = "HLENGTH"; + private static final String ATTR_VLENGTH = "VLENGTH"; + private static final String ATTR_CONTENT = "CONTENT"; + private static final String ATTR_LANG = "LANG"; + + + private Page page; + private PageLayout layout = null; + private MetaData metaData = null; + private String comments; + private StringBuffer currentTextBuffer; + private String currentText; + private MeasurementUnit measurementUnit = MeasurementUnit.MM_BY_10; //Default + private boolean firstPageDone = false; + private boolean hasMargins = false; + private Region currentRegion = null; + private TextLine currentTextLine = null; + private Word currentWord = null; + private Word lastWord = null; + private Map> idPartialReadingOrderMap = new HashMap>(); + private List> partialReadingOrder = new ArrayList>(); + + private XmlModelAndValidatorProvider validatorProvider; + private XmlFormatVersion schemaVersion; + + + public SaxPageHandler_Alto_2_1(XmlModelAndValidatorProvider validatorProvider, XmlFormatVersion schemaVersion) { + this.validatorProvider = validatorProvider; + this.schemaVersion = schemaVersion; + } + + + @Override + public Page getPageObject() { + return page; + } + + private void createPageObject() { + if (validatorProvider != null && schemaVersion != null) { + try { + page = new Page(validatorProvider.getSchemaParser(validatorProvider.getLatestSchemaVersion())); + } catch (UnsupportedSchemaVersionException e) { + e.printStackTrace(); + page = new Page(); + } + } + else + page = new Page(); + + layout = page.getLayout(); + metaData = page.getMetaData(); + comments = "Converted from ALTO"; + page.setMeasurementUnit(measurementUnit); + } + + /** + * Receive notification of the start of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) + throws SAXException { + + if (firstPageDone) //No multi-page support + return; + + //Handle accumulated text + finishText(); + + if (ELEMENT_alto.equals(localName)){ + createPageObject(); + } + else if (ELEMENT_OCRProcessing.equals(localName)){ + comments += "\nOCR Processing Information"; + } + else if (ELEMENT_preProcessingStep.equals(localName)){ + comments += "\nPreprocessing:"; + } + else if (ELEMENT_ocrProcessingStep.equals(localName)){ + comments += "\nOCR:"; + } + else if (ELEMENT_postProcessingStep.equals(localName)){ + comments += "\nPostprocessing:"; + } + else if (ELEMENT_Page.equals(localName)){ + handlePageNode(atts); + } + else if (ELEMENT_TopMargin.equals(localName) + || ELEMENT_LeftMargin.equals(localName) + || ELEMENT_BottomMargin.equals(localName) + || ELEMENT_RightMargin.equals(localName)){ + hasMargins = true; + } + else if (ELEMENT_PrintSpace.equals(localName)) { + handlePrintSpaceNode(atts); + } + else if (ELEMENT_TextBlock.equals(localName)) { + handleBlockNode(atts, RegionType.TextRegion); + handleTextBlock(atts); + } + else if (ELEMENT_Illustration.equals(localName)) { + handleBlockNode(atts, RegionType.ImageRegion); + handleIllustrationBlock(atts); + } + else if (ELEMENT_GraphicalElement.equals(localName)) { + handleBlockNode(atts, RegionType.SeparatorRegion); + handleGraphicsBlock(atts); + } + else if (ELEMENT_ComposedBlock.equals(localName)) { + //At the moment we do not create a region for composed blocks. + //Only non-composed children get a region. + } + else if (ELEMENT_Polygon.equals(localName)) { + handlePolygonNode(atts); + } + else if (ELEMENT_Ellipse.equals(localName)) { + handleEllipseNode(atts); + } + else if (ELEMENT_Circle.equals(localName)) { + handleCircleNode(atts); + } + else if (ELEMENT_TextLine.equals(localName)) { + handleTextLineNode(atts); + } + else if (ELEMENT_String.equals(localName)) { + handleWordNode(atts); + } + else if (ELEMENT_HYP.equals(localName)) { + handleHyphenNode(atts); + } + } + + + /** + * Receive notification of the end of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void endElement(String namespaceURI, String localName, String qName) + throws SAXException { + + + //Handle accumulated text + finishText(); + + if (ELEMENT_alto.equals(localName)){ + metaData.setComments(comments); + createReadingOrder(); + composehighLevelText(); + } + + if (firstPageDone) //No multi-page support + return; + + if (ELEMENT_MeasurementUnit.equals(localName)){ + handleMeasurementUnit(currentText); + } + else if (ELEMENT_fileName.equals(localName)){ + handleFilename(currentText); + } + else if (ELEMENT_processingDateTime.equals(localName)){ + comments += "\n Date: "+currentText; + } + else if (ELEMENT_processingAgency.equals(localName)){ + comments += "\n Agency: "+currentText; + } + else if (ELEMENT_processingStepDescription.equals(localName)){ + comments += "\n Description: "+currentText; + } + else if (ELEMENT_processingStepSettings.equals(localName)){ + comments += "\n Settings: "+currentText; + } + else if (ELEMENT_processingSoftware.equals(localName)){ + comments += "\n Software: "; + } + else if (ELEMENT_softwareCreator.equals(localName)){ + comments += "\n Creator: "+currentText; + } + else if (ELEMENT_softwareName.equals(localName)){ + comments += "\n Name: "+currentText; + } + else if (ELEMENT_softwareVersion.equals(localName)){ + comments += "\n Version: "+currentText; + } + else if (ELEMENT_applicationDescription.equals(localName)){ + comments += "\n Application: "+currentText; + } + else if (ELEMENT_Page.equals(localName)){ + firstPageDone = true; + } + else if (ELEMENT_TextBlock.equals(localName)) { + currentRegion = null; + } + else if (ELEMENT_Illustration.equals(localName)) { + currentRegion = null; + } + else if (ELEMENT_GraphicalElement.equals(localName)) { + currentRegion = null; + } + else if (ELEMENT_ComposedBlock.equals(localName)) { + currentRegion = null; + } + else if (ELEMENT_TextLine.equals(localName)) { + currentTextLine = null; + lastWord = null; + } + else if (ELEMENT_String.equals(localName)) { + currentWord = null; + } + + } + + /** + * Receive notification of character data inside an element. + * @param ch - The characters. + * @param start - The start position in the character array. + * @param length - The number of characters to use from the character array. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void characters(char[] ch, int start, int length) + throws SAXException { + + if (firstPageDone) //No multi-page support + return; + + String strValue = new String(ch, start, length); + + //Text might be parsed bit by bit, so we have to accumulate until a closing tag is found. + if (currentTextBuffer == null) + currentTextBuffer = new StringBuffer(); + currentTextBuffer.append(strValue); + + } + + /** + * Writes accumulated text to the right object. + */ + private void finishText() { + if (firstPageDone) //No multi-page support + return; + if (currentTextBuffer != null) { + currentText = currentTextBuffer.toString(); + + currentTextBuffer = null; + } + } + + /** + * Creates the text region and text line text content from the words + */ + private void composehighLevelText() { + for (ContentIterator it = layout.iterator(RegionType.TextRegion); it.hasNext(); ) { + ((TextRegion)it.next()).composeText(true, true); + } + } + + private void handleMeasurementUnit(String textContent) { + comments += "\n\nMeasurement unit: "+textContent; + + if ("pixel".equals(textContent)) + measurementUnit = MeasurementUnit.PIXEL; + else if ("mm10".equals(textContent)) + measurementUnit = MeasurementUnit.MM_BY_10; + else if ("inch1200".equals(textContent)) + measurementUnit = MeasurementUnit.INCH_BY_1200; + + if (page != null) + page.setMeasurementUnit(measurementUnit); + } + + private void handleFilename(String textContent) { + page.setImageFilename(textContent); + } + + private void handlePageNode(Attributes atts) { + int i; + //Id + if ((i = atts.getIndex(ATTR_ID)) >= 0) { + try { + page.setGtsId(atts.getValue(i)); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + //Page class + if ((i = atts.getIndex(ATTR_PAGECLASS)) >= 0) { + comments += "\nPage class: "+atts.getValue(i); + } + //Width + height + if ((i = atts.getIndex(ATTR_WIDTH)) >= 0) { + int width = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HEIGHT)) >= 0) + layout.setSize(width, (int)Double.parseDouble(atts.getValue(i))); + } + //Physical image number + if ((i = atts.getIndex(ATTR_PHYSICAL_IMG_NR)) >= 0) { + comments += "\nPhysical image number: "+atts.getValue(i); + } + //Printed image number + if ((i = atts.getIndex(ATTR_PRINTED_IMG_NR)) >= 0) { + comments += "\nPrinted image number: "+atts.getValue(i); + } + //Quality + if ((i = atts.getIndex(ATTR_QUALITY)) >= 0) { + comments += "\nQuality: "+atts.getValue(i); + } + //Quality details + if ((i = atts.getIndex(ATTR_QUALITY_DETAIL)) >= 0) { + comments += "\n Quality details: "+atts.getValue(i); + } + //Position + if ((i = atts.getIndex(ATTR_POSITION)) >= 0) { + comments += "\nPosition: "+atts.getValue(i); + } + //Processing ID + if ((i = atts.getIndex(ATTR_PROCESSING)) >= 0) { + comments += "\nProcessing ID: "+atts.getValue(i); + } + //Accuracy + if ((i = atts.getIndex(ATTR_ACCURACY)) >= 0) { + comments += "\nAccuracy: "+atts.getValue(i); + } + //Confidence + if ((i = atts.getIndex(ATTR_PC)) >= 0) { + comments += "\nConfidence: "+atts.getValue(i); + } + } + + private void handlePrintSpaceNode(Attributes atts) { + int i; + + //Width + height + if (!hasMargins && layout.getWidth() <= 0) { + //No width defined in page node + //and there is no margin (meaning the print space equals the full page) + if ((i = atts.getIndex(ATTR_WIDTH)) >= 0) { + int width = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HEIGHT)) >= 0) + layout.setSize(width, (int)Double.parseDouble(atts.getValue(i))); + } + } + + //Polygon + if (hasMargins) { + int w=0, h=0, l=0, t=0; + if ((i = atts.getIndex(ATTR_WIDTH)) >= 0) + w = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HEIGHT)) >= 0) + h = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HPOS)) >= 0) + l = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_VPOS)) >= 0) + t = (int)Double.parseDouble(atts.getValue(i)); + layout.setPrintSpace(new GeometricObjectImpl(createPolygonFromBoundingBox(l, t, w, h))); + } + } + + private Polygon createPolygonFromBoundingBox(int left, int top, int width, int height) { + int right = left+width-1; + int bottom = top+height-1; + Polygon polygon = new Polygon(); + + polygon.addPoint(left, top); + polygon.addPoint(right, top); + polygon.addPoint(right, bottom); + polygon.addPoint(left, bottom); + return polygon; + } + + private void handleBlockNode(Attributes atts, RegionType type) { + int i; + //Id + String id = null; + if ((i = atts.getIndex(ATTR_ID)) >= 0) + id = atts.getValue(i); + + if (id != null) + currentRegion = layout.createRegion(type, id); + else + currentRegion = layout.createRegion(type); + + //IdNext + if ((i = atts.getIndex(ATTR_IDNEXT)) >= 0) + addRelationToReadingOrder(id, atts.getValue(i)); + + //Polygon from bounding box + int w=0, h=0, l=0, t=0; + if ((i = atts.getIndex(ATTR_WIDTH)) >= 0) + w = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HEIGHT)) >= 0) + h = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HPOS)) >= 0) + l = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_VPOS)) >= 0) + t = (int)Double.parseDouble(atts.getValue(i)); + currentRegion.setCoords(createPolygonFromBoundingBox(l, t, w, h)); + } + + private void handleTextBlock(Attributes atts) { + int i; + TextRegion region = (TextRegion)currentRegion; + + //Rotation + if ((i = atts.getIndex(ATTR_ROTATION)) >= 0) + region.setOrientation(Double.parseDouble(atts.getValue(i))); + + //Language + if ((i = atts.getIndex(ATTR_LANG)) >= 0) { + String language = altoToPrimaLanguage(atts.getValue(i)); + if (language != null) + region.setPrimaryLanguage(language); + } + } + + private void handleTextLineNode(Attributes atts) { + if (currentRegion == null || !(currentRegion instanceof TextRegion)) + return; + + + //Create line + currentTextLine = ((TextRegion)currentRegion).createTextLine(); + + int i; + + //Language + if ((i = atts.getIndex(ATTR_LANG)) >= 0) { + String language = altoToPrimaLanguage(atts.getValue(i)); + if (language != null) + currentTextLine.setPrimaryLanguage(language); + } + + //Polygon from bounding box + int w=0, h=0, l=0, t=0; + if ((i = atts.getIndex(ATTR_WIDTH)) >= 0) + w = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HEIGHT)) >= 0) + h = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HPOS)) >= 0) + l = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_VPOS)) >= 0) + t = (int)Double.parseDouble(atts.getValue(i)); + currentTextLine.setCoords(createPolygonFromBoundingBox(l, t, w, h)); + } + + private void handleWordNode(Attributes atts) { + if (currentTextLine == null) + return; + + //Create word + currentWord = currentTextLine.createWord(); + lastWord = currentWord; + + int i; + + //Language + if ((i = atts.getIndex(ATTR_LANG)) >= 0) { + String language = altoToPrimaLanguage(atts.getValue(i)); + if (language != null) + currentWord.setLanguage(language); + } + + //Polygon from bounding box + int w=0, h=0, l=0, t=0; + if ((i = atts.getIndex(ATTR_WIDTH)) >= 0) + w = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HEIGHT)) >= 0) + h = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HPOS)) >= 0) + l = (int)Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_VPOS)) >= 0) + t = (int)Double.parseDouble(atts.getValue(i)); + currentWord.setCoords(createPolygonFromBoundingBox(l, t, w, h)); + + //Text content + if ((i = atts.getIndex(ATTR_CONTENT)) >= 0) + currentWord.setText(atts.getValue(i)); + } + + private void handleHyphenNode(Attributes atts) { + if (lastWord == null) + return; + + //Attach the hyphen to the last word + // Text + int i; + String hypContent = "-"; + if ((i = atts.getIndex(ATTR_CONTENT)) >= 0) { + char code = 0; + //Is it a number? + try { + code = (char)Integer.parseInt(atts.getValue(i)); + } catch (NumberFormatException exc) { + //No need to handle + } + if (code > 0) { //We got a number + //Assuming Unicode + hypContent = new String(Character.toString(code)); + } + else //If the conversion to int doesn't return a positive number, we assume the content is the actual character + hypContent = atts.getValue(i); + } + lastWord.setText(lastWord.getText() + hypContent); + + // Coords (extend word) + int updatedRight = 0; + Polygon polygon = lastWord.getCoords(); + if (atts.getIndex(ATTR_HPOS) >= 0 && atts.getIndex(ATTR_WIDTH) >= 0) { + int hpos = (int)Double.parseDouble(atts.getValue(ATTR_HPOS)); + int width = (int)Double.parseDouble(atts.getValue(ATTR_WIDTH)); + + updatedRight = hpos + width - 1; + } + //Missing coordinates + else { + //Use text line + TextLine parentLine = (TextLine)lastWord.getParent(); + if (parentLine != null && parentLine.getCoords() != null) + updatedRight = parentLine.getCoords().getBoundingBox().right; + } + if (polygon.getBoundingBox().right < updatedRight) { + polygon.getPoint(1).x = updatedRight; + polygon.getPoint(2).x = updatedRight; + lastWord.getCoords().setBoundingBoxOutdated(); + } + } + + private void handleIllustrationBlock(Attributes atts) { + int i; + ImageRegion region = (ImageRegion)currentRegion; + + //Rotation + if ((i = atts.getIndex(ATTR_ROTATION)) >= 0) + region.setOrientation(Double.parseDouble(atts.getValue(i))); + } + + private void handleGraphicsBlock(Attributes atts) { + int i; + SeparatorRegion region = (SeparatorRegion)currentRegion; + + //Rotation + if ((i = atts.getIndex(ATTR_ROTATION)) >= 0) + region.setOrientation(Double.parseDouble(atts.getValue(i))); + } + + private String altoToPrimaLanguage(String altoLanguageValue) { + if ("ab".equals(altoLanguageValue)) return "Abkhaz"; + if ("aa".equals(altoLanguageValue)) return "Afar"; + if ("af".equals(altoLanguageValue)) return "Afrikaans"; + if ("ak".equals(altoLanguageValue)) return "Akan"; + if ("sq".equals(altoLanguageValue)) return "Albanian"; + if ("am".equals(altoLanguageValue)) return "Amharic"; + if ("ar".equals(altoLanguageValue)) return "Arabic"; + if ("an".equals(altoLanguageValue)) return "Aragonese"; + if ("hy".equals(altoLanguageValue)) return "Armenian"; + if ("as".equals(altoLanguageValue)) return "Assamese"; + if ("av".equals(altoLanguageValue)) return "Avaric"; + if ("ae".equals(altoLanguageValue)) return "Avestan"; + if ("ay".equals(altoLanguageValue)) return "Aymara"; + if ("az".equals(altoLanguageValue)) return "Azerbaijani"; + if ("bm".equals(altoLanguageValue)) return "Bambara"; + if ("ba".equals(altoLanguageValue)) return "Bashkir"; + if ("eu".equals(altoLanguageValue)) return "Basque"; + if ("be".equals(altoLanguageValue)) return "Belarusian"; + if ("bn".equals(altoLanguageValue)) return "Bengali"; + if ("bh".equals(altoLanguageValue)) return "Bihari"; + if ("bi".equals(altoLanguageValue)) return "Bislama"; + if ("bs".equals(altoLanguageValue)) return "Bosnian"; + if ("br".equals(altoLanguageValue)) return "Breton"; + if ("bg".equals(altoLanguageValue)) return "Bulgarian"; + if ("my".equals(altoLanguageValue)) return "Burmese"; + if ("km".equals(altoLanguageValue)) return "Cambodian"; + //if ("".equals(altoLanguageValue)) return "Cantonese"; + if ("ca".equals(altoLanguageValue)) return "Catalan"; + if ("ch".equals(altoLanguageValue)) return "Chamorro"; + if ("ce".equals(altoLanguageValue)) return "Chechen"; + if ("ny".equals(altoLanguageValue)) return "Chichewa"; + if ("zh".equals(altoLanguageValue)) return "Chinese"; + if ("cv".equals(altoLanguageValue)) return "Chuvash"; + if ("kw".equals(altoLanguageValue)) return "Cornish"; + if ("co".equals(altoLanguageValue)) return "Corsican"; + if ("cr".equals(altoLanguageValue)) return "Cree"; + if ("hr".equals(altoLanguageValue)) return "Croatian"; + if ("cs".equals(altoLanguageValue)) return "Czech"; + if ("da".equals(altoLanguageValue)) return "Danish"; + if ("dv".equals(altoLanguageValue)) return "Divehi"; + if ("nl".equals(altoLanguageValue)) return "Dutch"; + if ("dz".equals(altoLanguageValue)) return "Dzongkha"; + if ("en".equals(altoLanguageValue)) return "English"; + if ("en-GB".equals(altoLanguageValue)) return "English"; + if ("en-US".equals(altoLanguageValue)) return "English"; + if ("eo".equals(altoLanguageValue)) return "Esperanto"; + if ("et".equals(altoLanguageValue)) return "Estonian"; + if ("ee".equals(altoLanguageValue)) return "Ewe"; + if ("fo".equals(altoLanguageValue)) return "Faroese"; + if ("fj".equals(altoLanguageValue)) return "Fijian"; + if ("fi".equals(altoLanguageValue)) return "Finnish"; + if ("fr".equals(altoLanguageValue)) return "French"; + if ("ff".equals(altoLanguageValue)) return "Fula"; + if ("gd".equals(altoLanguageValue)) return "Gaelic"; + if ("gl".equals(altoLanguageValue)) return "Galician"; + if ("lg".equals(altoLanguageValue)) return "Ganda"; + if ("ka".equals(altoLanguageValue)) return "Georgian"; + if ("de".equals(altoLanguageValue)) return "German"; + if ("el".equals(altoLanguageValue)) return "Greek"; + if ("gn".equals(altoLanguageValue)) return "Guaraní"; + if ("gu".equals(altoLanguageValue)) return "Gujarati"; + if ("ht".equals(altoLanguageValue)) return "Haitian"; + if ("ha".equals(altoLanguageValue)) return "Hausa"; + if ("he".equals(altoLanguageValue)) return "Hebrew"; + if ("hz".equals(altoLanguageValue)) return "Herero"; + if ("hi".equals(altoLanguageValue)) return "Hindi"; + if ("ho".equals(altoLanguageValue)) return "Hiri Motu"; + if ("hu".equals(altoLanguageValue)) return "Hungarian"; + if ("is".equals(altoLanguageValue)) return "Icelandic"; + if ("io".equals(altoLanguageValue)) return "Ido"; + if ("ig".equals(altoLanguageValue)) return "Igbo"; + if ("id".equals(altoLanguageValue)) return "Indonesian"; + if ("ia".equals(altoLanguageValue)) return "Interlingua"; + if ("ie".equals(altoLanguageValue)) return "Interlingue"; + if ("iu".equals(altoLanguageValue)) return "Inuktitut"; + if ("ik".equals(altoLanguageValue)) return "Inupiaq"; + if ("ga".equals(altoLanguageValue)) return "Irish"; + if ("it".equals(altoLanguageValue)) return "Italian"; + if ("ja".equals(altoLanguageValue)) return "Japanese"; + if ("jv".equals(altoLanguageValue)) return "Javanese"; + if ("kl".equals(altoLanguageValue)) return "Kalaallisut"; + if ("kn".equals(altoLanguageValue)) return "Kannada"; + if ("kr".equals(altoLanguageValue)) return "Kanuri"; + if ("ks".equals(altoLanguageValue)) return "Kashmiri"; + if ("kk".equals(altoLanguageValue)) return "Kazakh"; + if ("km".equals(altoLanguageValue)) return "Khmer"; + if ("ki".equals(altoLanguageValue)) return "Kikuyu"; + if ("rw".equals(altoLanguageValue)) return "Kinyarwanda"; + if ("rn".equals(altoLanguageValue)) return "Kirundi"; + if ("kv".equals(altoLanguageValue)) return "Komi"; + if ("kg".equals(altoLanguageValue)) return "Kongo"; + if ("ko".equals(altoLanguageValue)) return "Korean"; + if ("ku".equals(altoLanguageValue)) return "Kurdish"; + if ("kj".equals(altoLanguageValue)) return "Kwanyama"; + if ("ky".equals(altoLanguageValue)) return "Kyrgyz"; + if ("lo".equals(altoLanguageValue)) return "Lao"; + if ("la".equals(altoLanguageValue)) return "Latin"; + if ("lv".equals(altoLanguageValue)) return "Latvian"; + if ("li".equals(altoLanguageValue)) return "Limburgish"; + if ("ln".equals(altoLanguageValue)) return "Lingala"; + if ("lt".equals(altoLanguageValue)) return "Lithuanian"; + if ("lu".equals(altoLanguageValue)) return "Luba-Katanga"; + if ("lb".equals(altoLanguageValue)) return "Luxembourgish"; + if ("mk".equals(altoLanguageValue)) return "Macedonian"; + if ("mg".equals(altoLanguageValue)) return "Malagasy"; + if ("ms".equals(altoLanguageValue)) return "Malay"; + if ("ml".equals(altoLanguageValue)) return "Malayalam"; + if ("mt".equals(altoLanguageValue)) return "Maltese"; + if ("gv".equals(altoLanguageValue)) return "Manx"; + if ("mi".equals(altoLanguageValue)) return "MÄ?ori"; + if ("mr".equals(altoLanguageValue)) return "Marathi"; + if ("mh".equals(altoLanguageValue)) return "Marshallese"; + if ("mn".equals(altoLanguageValue)) return "Mongolian"; + if ("na".equals(altoLanguageValue)) return "Nauru"; + if ("nv".equals(altoLanguageValue)) return "Navajo"; + if ("ng".equals(altoLanguageValue)) return "Ndonga"; + if ("ne".equals(altoLanguageValue)) return "Nepali"; + if ("nd".equals(altoLanguageValue)) return "North Ndebele"; + if ("se".equals(altoLanguageValue)) return "Northern Sami"; + if ("no".equals(altoLanguageValue)) return "Norwegian"; + if ("nb".equals(altoLanguageValue)) return "Norwegian BokmÃ¥l"; + if ("nn".equals(altoLanguageValue)) return "Norwegian Nynorsk"; + if ("ii".equals(altoLanguageValue)) return "Nuosu"; + if ("oc".equals(altoLanguageValue)) return "Occitan"; + if ("oj".equals(altoLanguageValue)) return "Ojibwe"; + if ("cu".equals(altoLanguageValue)) return "Old Church Slavonic"; + if ("or".equals(altoLanguageValue)) return "Oriya"; + if ("om".equals(altoLanguageValue)) return "Oromo"; + if ("os".equals(altoLanguageValue)) return "Ossetian"; + if ("pi".equals(altoLanguageValue)) return "PÄ?li"; + if ("pa".equals(altoLanguageValue)) return "Panjabi"; + if ("ps".equals(altoLanguageValue)) return "Pashto"; + if ("fa".equals(altoLanguageValue)) return "Persian"; + if ("pl".equals(altoLanguageValue)) return "Polish"; + if ("pt".equals(altoLanguageValue)) return "Portuguese"; + if ("pa".equals(altoLanguageValue)) return "Punjabi"; + if ("qu".equals(altoLanguageValue)) return "Quechua"; + if ("ro".equals(altoLanguageValue)) return "Romanian"; + if ("rm".equals(altoLanguageValue)) return "Romansh"; + if ("ru".equals(altoLanguageValue)) return "Russian"; + if ("sm".equals(altoLanguageValue)) return "Samoan"; + if ("sg".equals(altoLanguageValue)) return "Sango"; + if ("sa".equals(altoLanguageValue)) return "Sanskrit"; + if ("sc".equals(altoLanguageValue)) return "Sardinian"; + if ("sr".equals(altoLanguageValue)) return "Serbian"; + if ("sn".equals(altoLanguageValue)) return "Shona"; + if ("sd".equals(altoLanguageValue)) return "Sindhi"; + if ("si".equals(altoLanguageValue)) return "Sinhala"; + if ("sk".equals(altoLanguageValue)) return "Slovak"; + if ("sl".equals(altoLanguageValue)) return "Slovene"; + if ("so".equals(altoLanguageValue)) return "Somali"; + if ("nr".equals(altoLanguageValue)) return "South Ndebele"; + if ("st".equals(altoLanguageValue)) return "Southern Sotho"; + if ("es".equals(altoLanguageValue)) return "Spanish"; + if ("su".equals(altoLanguageValue)) return "Sundanese"; + if ("sw".equals(altoLanguageValue)) return "Swahili"; + if ("ss".equals(altoLanguageValue)) return "Swati"; + if ("sv".equals(altoLanguageValue)) return "Swedish"; + if ("tl".equals(altoLanguageValue)) return "Tagalog"; + if ("ty".equals(altoLanguageValue)) return "Tahitian"; + if ("tg".equals(altoLanguageValue)) return "Tajik"; + if ("ta".equals(altoLanguageValue)) return "Tamil"; + if ("tt".equals(altoLanguageValue)) return "Tatar"; + if ("te".equals(altoLanguageValue)) return "Telugu"; + if ("th".equals(altoLanguageValue)) return "Thai"; + if ("bo".equals(altoLanguageValue)) return "Tibetan"; + if ("ti".equals(altoLanguageValue)) return "Tigrinya"; + if ("to".equals(altoLanguageValue)) return "Tonga"; + if ("ts".equals(altoLanguageValue)) return "Tsonga"; + if ("tn".equals(altoLanguageValue)) return "Tswana"; + if ("tr".equals(altoLanguageValue)) return "Turkish"; + if ("tk".equals(altoLanguageValue)) return "Turkmen"; + if ("tw".equals(altoLanguageValue)) return "Twi"; + if ("ug".equals(altoLanguageValue)) return "Uighur"; + if ("uk".equals(altoLanguageValue)) return "Ukrainian"; + if ("ur".equals(altoLanguageValue)) return "Urdu"; + if ("uz".equals(altoLanguageValue)) return "Uzbek"; + if ("ve".equals(altoLanguageValue)) return "Venda"; + if ("vi".equals(altoLanguageValue)) return "Vietnamese"; + if ("vo".equals(altoLanguageValue)) return "Volapük"; + if ("wa".equals(altoLanguageValue)) return "Walloon"; + if ("cy".equals(altoLanguageValue)) return "Welsh"; + if ("fy".equals(altoLanguageValue)) return "Western Frisian"; + if ("wo".equals(altoLanguageValue)) return "Wolof"; + if ("xh".equals(altoLanguageValue)) return "Xhosa"; + if ("yi".equals(altoLanguageValue)) return "Yiddish"; + if ("yo".equals(altoLanguageValue)) return "Yoruba"; + if ("za".equals(altoLanguageValue)) return "Zhuang"; + if ("zu".equals(altoLanguageValue)) return "Zulu"; + if (!altoLanguageValue.isEmpty()) return "other"; + + return null; + } + + /** + * Adds a relation (from region, to region) to the temporary reading order data structure. + */ + private void addRelationToReadingOrder(String fromRegion, String toRegion) { + List group = null; + + //Find reading order group of 'toRegion' to make sure its not pointing to 'fromRegion' (illegal loop) + if (idPartialReadingOrderMap.containsKey(toRegion)) { //Found + group = idPartialReadingOrderMap.get(toRegion); + for (int i=0; i loop -> ignore and return + return; + } + } + } + + if (group != null) { //The toRegion already has a group + //Find 'toRegion' in the group + for (int i=0; i create a group + group = new ArrayList(); + partialReadingOrder.add(group); + //Add fromRegion + group.add(fromRegion); + idPartialReadingOrderMap.put(fromRegion, group); + //Add toRegion + group.add(toRegion); + } + else { //Group exists + group = idPartialReadingOrderMap.get(fromRegion); + //Find 'fromRegion' in the group + for (int i=0; i group = partialReadingOrder.get(0); + for (int i=0; i group = partialReadingOrder.get(i); + for (int j=0; j= 3) + currentRegion.setCoords(polygon); + } + + /** + * Parses an ellipse node. + */ + private void handleEllipseNode(Attributes atts) { + int i; + double x=0, y=0, horLength=0, vertLength=0; + + if ((i = atts.getIndex(ATTR_HPOS)) < 0) + x = Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_VPOS)) < 0) + y = Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_HLENGTH)) < 0) + horLength = Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_VLENGTH)) < 0) + vertLength = Double.parseDouble(atts.getValue(i)); + + double radiusX = horLength/2; + double radiusY = vertLength/2; + + Polygon polygon = ellipseToPolygon(x, y, radiusX, radiusY); + if (polygon != null && polygon.getSize() >= 3) + currentRegion.setCoords(polygon); + } + + /** + * Parses a circle node. + */ + private void handleCircleNode(Attributes atts) { + int i; + double x=0, y=0, radius=0; + + if ((i = atts.getIndex(ATTR_HPOS)) < 0) + x = Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_VPOS)) < 0) + y = Double.parseDouble(atts.getValue(i)); + if ((i = atts.getIndex(ATTR_RADIUS)) < 0) + radius = Double.parseDouble(atts.getValue(i)); + + Polygon polygon = ellipseToPolygon(x, y, radius, radius); + if (polygon != null && polygon.getSize() >= 3) + currentRegion.setCoords(polygon); + } + + /** + * Converts an ellipse to a polygon. + */ + private Polygon ellipseToPolygon(double centerX, double centerY, double radiusX, double radiusY) { + + double step = 0.00873; //0.5 degrees + + Polygon polygon = new Polygon(); + int x,y,xold=-1,yold=-1; + for (double angle = 0; angle < 6.2832; angle += step) { //0 to 360 degrees + x = (int)(centerX + Math.cos(angle) * radiusX); + y = (int)(centerY + Math.sin(angle) * radiusY); + if (x != xold || y != yold) //Coords changed? + polygon.addPoint(x, y); + xold = x; + yold = y; + } + + //polygon.SimplifyPolygon(); + //polygon->ConvertToIsothetic(); + return polygon; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Hocr.java b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Hocr.java new file mode 100644 index 00000000..28ef0b1c --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/sax/SaxPageHandler_Hocr.java @@ -0,0 +1,436 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.io.xml.sax; + +import java.io.File; +import java.util.Iterator; +import java.util.List; + +import org.primaresearch.dla.page.MetaData; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.io.xml.PageXmlInputOutput; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject; +import org.primaresearch.dla.page.layout.physical.text.impl.TextLine; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.dla.page.layout.physical.text.impl.Word; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.maths.geometry.Polygon; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; + +/** + * Experimental SAX XML handler to read HOCR XHTML files (e.g. output from Tesseract OCR engine). + * + * @author Christian Clausner + * + */ +public class SaxPageHandler_Hocr extends SaxPageHandler { + + private static final String ELEMENT_html = "html"; + //private static final String ELEMENT_head = "head"; + //private static final String ELEMENT_body = "body"; + private static final String ELEMENT_meta = "meta"; + private static final String ELEMENT_div = "div"; + private static final String ELEMENT_p = "p"; + private static final String ELEMENT_span = "span"; + + private static final String ATTR_name = "name"; + private static final String ATTR_content = "content"; + private static final String ATTR_class = "class"; + private static final String ATTR_id = "id"; + private static final String ATTR_title = "title"; + + private static final String CLASS_page = "ocr_page"; + private static final String CLASS_area = "ocr_carea"; + private static final String CLASS_paragraph = "ocr_par"; + private static final String CLASS_line = "ocr_line"; + private static final String CLASS_word = "ocrx_word"; + + private Page page; + private PageLayout layout = null; + private TextRegion currentTextRegion = null; + private TextLine currentLine = null; + private Word currentWord = null; + private StringBuffer currentText = null; + + @Override + public Page getPageObject() { + return page; + } + + /** + * Receive notification of the start of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @param atts - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) + throws SAXException { + int i; + + //Handle accumulated text + //finishText(); + + + if (ELEMENT_html.equals(localName)){ + page = new Page(PageXmlInputOutput.getLatestSchemaModel()); + layout = page.getLayout(); + } + else if (ELEMENT_meta.equals(localName)){ + handleMetaElement(atts); + } + else if (ELEMENT_div.equals(localName)){ + //Check class + if ((i = atts.getIndex(ATTR_class)) >= 0) { + String elementClass = atts.getValue(i); + //Page + if (CLASS_page.equals(elementClass)) + handlePageElement(atts); + //Area (block) + else if (CLASS_area.equals(elementClass)) + ; + } + } + else if (ELEMENT_p.equals(localName)){ + //Check class + if ((i = atts.getIndex(ATTR_class)) >= 0) { + String elementClass = atts.getValue(i); + //Paragraph + if (CLASS_paragraph.equals(elementClass)) + handleParagraphElement(atts); + } + } + else if (ELEMENT_span.equals(localName)){ + //Check class + if ((i = atts.getIndex(ATTR_class)) >= 0) { + String elementClass = atts.getValue(i); + //Text line + if (CLASS_line.equals(elementClass)) + handleTextLineElement(atts); + //Word + else if (CLASS_word.equals(elementClass)) + handleWordElement(atts); + } + } + + } + + /** + * Receive notification of the end of an element. + * + * @param namespaceURI - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. + * @param localName - The local name (without prefix), or the empty string if Namespace processing is not being performed. + * @param qName - The qualified name (with prefix), or the empty string if qualified names are not available. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void endElement(String namespaceURI, String localName, String qName) + throws SAXException { + //Handle accumulated text + //finishText(); + + if (ELEMENT_html.equals(localName)){ + } + else if (ELEMENT_div.equals(localName)){ + } + else if (ELEMENT_p.equals(localName)) { + //Accumulate text from lines + List lines = currentTextRegion.getTextObjectsSorted(); + if (lines != null) { + String text = ""; + for (Iterator it = lines.iterator(); it.hasNext(); ) { + if (!text.isEmpty()) + text += "\r\n"; + text += it.next().getText(); + } + currentTextRegion.setText(text); + } + currentTextRegion = null; + } + else if (ELEMENT_span.equals(localName)) { + if (currentWord != null) { + if (currentText != null) { + currentWord.setText(currentText.toString().trim()); + currentText = null; + } + currentWord = null; + } + else if (currentLine != null) { + //Accumulate text from words + List words = currentLine.getTextObjectsSorted(); + if (words != null) { + String text = ""; + for (Iterator it = words.iterator(); it.hasNext(); ) { + if (!text.isEmpty()) + text += " "; + text += it.next().getText(); + } + currentLine.setText(text); + } + currentLine = null; + } + } + } + + /** + * Receive notification of character data inside an element. + * @param ch - The characters. + * @param start - The start position in the character array. + * @param length - The number of characters to use from the character array. + * @throws SAXException - Any SAX exception, possibly wrapping another exception. + */ + public void characters(char[] ch, int start, int length) + throws SAXException { + + String strValue = new String(ch, start, length); + + //Text might be parsed bit by bit, so we have to accumulate until a closing tag is found. + if (currentText == null) + currentText = new StringBuffer(); + currentText.append(strValue); + } + + ///** + // * Writes accumulated text to the right object. + // */ + //private void finishText() { + /*if (currentText != null) { + String strValue = currentText.toString(); + + if (currentTextObject != null) { + if (ELEMENT_Unicode.equals(insideElement)) { + currentTextObject.setText(strValue); + } + else if (ELEMENT_PlainText.equals(insideElement)) { + currentTextObject.setPlainText(strValue); + } + } + if (metaData != null) { + if (ELEMENT_Creator.equals(insideElement)) { + metaData.setCreator(strValue); + } + else if (ELEMENT_Comments.equals(insideElement)) { + metaData.setComments(strValue); + } + else if (ELEMENT_Created.equals(insideElement)) { + metaData.setCreationTime(parseDate(strValue)); + } + else if (ELEMENT_LastChange.equals(insideElement)) { + metaData.setLastModifiedTime(parseDate(strValue)); + } + } + + currentText = null; + }*/ + //} + + /** + * Parses a metadata element from the header. + */ + private void handleMetaElement(Attributes atts) { + int i; + + //Size + String name = null; + String content = null; + if ((i = atts.getIndex(ATTR_name)) >= 0) { + name = atts.getValue(i); + } + if ((i = atts.getIndex(ATTR_content)) >= 0) { + content = atts.getValue(i); + } + + if (name != null && content != null) + addComment(name + ": " + content); + } + + /** + * Adds a comment to the comments text (also adds a line break before if not the first entry). + */ + private void addComment(String comment) { + if (page == null || comment == null || comment.isEmpty()) + return; + + MetaData metadata = page.getMetaData(); + if (metadata != null) { + String comments = metadata.getComments(); + if (comments == null) + comments = ""; + if (!comments.isEmpty()) + comments += "\r\n"; + comments += comment; + metadata.setComments(comments); + } + } + + /** + * Parses the attributes of the page 'div' node. + */ + private void handlePageElement(Attributes atts) { + int i; + + if (page == null) + return; + + //ID + if ((i = atts.getIndex(ATTR_id)) >= 0) { + try { + page.setGtsId(atts.getValue(i)); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + + //Image name and dimensions + if ((i = atts.getIndex(ATTR_title)) >= 0) { + String title = atts.getValue(i); + String parts[] = title.split("; "); + for (String part : parts) { + //Image + if (part.startsWith("image")) { + String image = null; + //Filename + // Path + if (part.contains(File.separator)) + image = part.substring(part.lastIndexOf(File.separator)+1); + // No path + else if (part.contains(" \"")) + image = part.substring(part.indexOf(" \"")+1); + + if (image != null) { + //Remove quotation mark + if (image.endsWith("\"")) + image = image.substring(0, image.length()-1); + page.setImageFilename(image); + } + } + //Bounding box + else if (part.startsWith("bbox")) { + String coords[] = part.split(" "); + if (coords.length == 5) { + layout.setSize(new Integer(coords[3]), new Integer(coords[4])); //This should be +1 but they seem to use x2/y2 as width/height + } + } + } + } + } + + /** + * Parses the given paragraph 'p' node. + */ + private void handleParagraphElement(Attributes atts) { + int i; + + if (page == null) + return; + + //ID + String id = null; + if ((i = atts.getIndex(ATTR_id)) >= 0) { + id = atts.getValue(i); + } + + //Create region + currentTextRegion = (TextRegion)layout.createRegion(RegionType.TextRegion, id); + + //Coords + if ((i = atts.getIndex(ATTR_title)) >= 0) { + Polygon coords = parseCoords(atts.getValue(i)); + if (coords != null) + currentTextRegion.setCoords(coords); + } + + } + + /** + * Parses the given paragraph 'span' node of class 'ocr_line'. + */ + private void handleTextLineElement(Attributes atts) { + int i; + + if (page == null || currentTextRegion == null) + return; + + //ID + String id = null; + if ((i = atts.getIndex(ATTR_id)) >= 0) { + id = atts.getValue(i); + } + + //Create line + currentLine = currentTextRegion.createTextLine(id); + + //Coords + if ((i = atts.getIndex(ATTR_title)) >= 0) { + Polygon coords = parseCoords(atts.getValue(i)); + if (coords != null) + currentLine.setCoords(coords); + } + } + + /** + * Parses the given paragraph 'span' node of class 'ocr_line'. + */ + private void handleWordElement(Attributes atts) { + int i; + + if (page == null || currentLine == null) + return; + + //ID + String id = null; + if ((i = atts.getIndex(ATTR_id)) >= 0) { + id = atts.getValue(i); + } + + //Create word + currentWord = currentLine.createWord(id); + + //Coords + if ((i = atts.getIndex(ATTR_title)) >= 0) { + Polygon coords = parseCoords(atts.getValue(i)); + if (coords != null) + currentWord.setCoords(coords); + } + } + + /** + * Parses a text encoded bounding box and returns a polygon. + * @return Box shaped polygon or null + */ + private Polygon parseCoords(String coordsString) { + Polygon ret = null; + String parts[] = coordsString.split(" "); + if (parts.length == 5) { + ret = new Polygon(); + int x1 = new Integer(parts[1]); + int y1 = new Integer(parts[2]); + int x2 = new Integer(parts[3]); + int y2 = new Integer(parts[4]); + ret.addPoint(x1,y1); + ret.addPoint(x2,y1); + ret.addPoint(x2,y2); + ret.addPoint(x1,y2); + } + return ret; + } + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2009-03-16_pagecontent.xsd b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2009-03-16_pagecontent.xsd new file mode 100644 index 00000000..7a0d2d64 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2009-03-16_pagecontent.xsd @@ -0,0 +1,734 @@ + + + + + + Page Content - Ground Truth and Storage + + + + + + + + + + + + + + + + + + + + + + + + + If the reading order element exists, all regions have to be covered (i.e. all region ids must be mentioned exactly once)! + + + + + If the layers element exists, all regions have to be covered (i.e. all region ids must be mentioned exactly once)! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pure text is represented as a text region. This includes drop capitals, but practically ornate text may be considered as a graphic. + + + + + + + + + + + Individual skew of the region in degrees (Range: -89.999,90) + + + + The nature of the text in the region + + + + + The text colour of the region + + + + The background colour of the region + + + + Specifies whether the colour of the text appears reversed against a background colour + + + + The size of the characters in points + + + The degree of space in points between the lines of text + + + + The degree of space in points between the characters in a string of text + + + + The direction in which text in a region should be read (within lines) + + + + + The degrees by which you need to turn your head in order to read the text when it is placed on the horizontal (Range: -89.999,90) + + + + Defines whether a region of text is indented or not + + + + The primary language used in the region + + + + The secondary language used in the region + + + + + The primary script used in the region + + + + + The secondary script used in the region + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text in a "simple" form (ASCII or extended ASCII as mostly used for typing). +I.e. no use of special characters for ligatures (should be stored as two separate characters) +etc. + + + + Correct encoding of the original, always using the corresponding Unicode code point. +I.e. ligatures have to be represented as one character +etc. + + + + + + An image is considered to be more intricate and complex than a graphic. These can be photos or drawings. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The colour bit depth required for the region + + + + + The background colour of the region + + + + + Specifies whether the region also contains text + + + + + A line drawing is a single colour illustration without solid areas. + + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The pen (foreground) colour of the region + + + + The background colour of the region + + + + Specifies whether the region also contains text + + + + + + Regions containing simple graphics, such as a company logo, should be marked as graphic regions. + + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90). + + + + The type of graphic in the region + + + + An approximation of the number of colours used in the region + + + + Specifies whether the region also contains text. + + + + + + Tabular data in any form is represented with a table region. Rows and columns may or may not have separator lines; these lines are not separator regions. + + + + + + + The orientation in degrees of the baseline of the region (Range: -89.999,90). + + + + The number of rows present in the table + + + + The number of columns present in the table + + + + The colour of the lines used in the region + + + + + The background colour of the region + + + + + Specifies the presence of line separators + + + + + Specifies whether the region also contains text + + + + + + Regions containing charts or graphs of any type, should be marked as chart regions. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The type of chart in the region + + + + An approximation of the number of colours used in the region + + + The background colour of the region + + + + + Specifies whether the region also contains text + + + + + Separators are lines that lie between columns and paragraphs and can be used to logically separate different articles from each other. + + + + + + + The orientation in degrees of the region (Range: -89.999,90) + + + + The colour of the separator + + + + + + Regions containing equations and mathematical symbols should be marked as maths regions. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The background colour of the region + + + + + Noise regions are regions where no real data lies, only false data created by artifacts on the document or scanner noise. + + + + + + + + + To be used if the region type cannot be ascertained. + + + + + + + + + + A region that surrounds other regions (e.g. a box with + blue background containing text regions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the effective area on the paper of a printed page. Its size is equal for all pages of a book (exceptions: titlepage, multipage pictures). +It contains all living elements (except marginals) like body type, footnotes, headings, running titles. +It does not contain pagenumber (if not part of running title), marginals, signature mark, preview words. + + + + + + + + + + Definition of the reading order within the page. Without further grouping, regions are supposed to be unordered on the page. +To express a reading order between elements they have to be included in a ordered group. Groups may contain further groups. + + + + + + + + + + + Numbered region + + + + Position (order number) of this item within the current hierarchy level. + + + + + + + Indexed group containing ordered elements + + + + + + + + + + Position (order number) of this item within the current hierarchy level. + + + + + + Indexed group containing unordered elements + + + + + + + + + + + Position (order number) of this item within the + current hierarchy level. + + + + + + + + + + + + Numbered group (contains ordered elements) + + + + + + + + + + + + Numbered group (contains unordered elements) + + + + + + + + + + + + Border of the actual page (if the scanned image contains parts not belonging to the page). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Can be used to express the z-index of overlapping + regions. An element with a greater z-index is always in + front of another element with lower z-index. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2010-01-12_pagecontent.xsd b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2010-01-12_pagecontent.xsd new file mode 100644 index 00000000..db966599 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2010-01-12_pagecontent.xsd @@ -0,0 +1,734 @@ + + + + + + Page Content - Ground Truth and Storage + + + + + + + + + + + + + + + + + + + + + + + + + If the reading order element exists, all regions have to be covered (i.e. all region ids must be mentioned exactly once)! + + + + + If the layers element exists, all regions have to be covered (i.e. all region ids must be mentioned exactly once)! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pure text is represented as a text region. This includes drop capitals, but practically ornate text may be considered as a graphic. + + + + + + + + + + + Individual skew of the region in degrees (Range: -89.999,90) + + + + The nature of the text in the region + + + + + The text colour of the region + + + + The background colour of the region + + + + Specifies whether the colour of the text appears reversed against a background colour + + + + The size of the characters in points + + + The degree of space in points between the lines of text + + + + The degree of space in points between the characters in a string of text + + + + The direction in which text in a region should be read (within lines) + + + + + The degrees by which you need to turn your head in order to read the text when it is placed on the horizontal (Range: -89.999,90) + + + + Defines whether a region of text is indented or not + + + + The primary language used in the region + + + + The secondary language used in the region + + + + + The primary script used in the region + + + + + The secondary script used in the region + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text in a "simple" form (ASCII or extended ASCII as mostly used for typing). +I.e. no use of special characters for ligatures (should be stored as two separate characters) +etc. + + + + Correct encoding of the original, always using the corresponding Unicode code point. +I.e. ligatures have to be represented as one character +etc. + + + + + + An image is considered to be more intricate and complex than a graphic. These can be photos or drawings. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The colour bit depth required for the region + + + + + The background colour of the region + + + + + Specifies whether the region also contains text + + + + + A line drawing is a single colour illustration without solid areas. + + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The pen (foreground) colour of the region + + + + The background colour of the region + + + + Specifies whether the region also contains text + + + + + + Regions containing simple graphics, such as a company logo, should be marked as graphic regions. + + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90). + + + + The type of graphic in the region + + + + An approximation of the number of colours used in the region + + + + Specifies whether the region also contains text. + + + + + + Tabular data in any form is represented with a table region. Rows and columns may or may not have separator lines; these lines are not separator regions. + + + + + + + The orientation in degrees of the baseline of the region (Range: -89.999,90). + + + + The number of rows present in the table + + + + The number of columns present in the table + + + + The colour of the lines used in the region + + + + + The background colour of the region + + + + + Specifies the presence of line separators + + + + + Specifies whether the region also contains text + + + + + + Regions containing charts or graphs of any type, should be marked as chart regions. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The type of chart in the region + + + + An approximation of the number of colours used in the region + + + The background colour of the region + + + + + Specifies whether the region also contains text + + + + + Separators are lines that lie between columns and paragraphs and can be used to logically separate different articles from each other. + + + + + + + The orientation in degrees of the region (Range: -89.999,90) + + + + The colour of the separator + + + + + + Regions containing equations and mathematical symbols should be marked as maths regions. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The background colour of the region + + + + + Noise regions are regions where no real data lies, only false data created by artifacts on the document or scanner noise. + + + + + + + + + To be used if the region type cannot be ascertained. + + + + + + + + + + A region that surrounds other regions (e.g. a box with + blue background containing text regions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the effective area on the paper of a printed page. Its size is equal for all pages of a book (exceptions: titlepage, multipage pictures). +It contains all living elements (except marginals) like body type, footnotes, headings, running titles. +It does not contain pagenumber (if not part of running title), marginals, signature mark, preview words. + + + + + + + + + + Definition of the reading order within the page. Without further grouping, regions are supposed to be unordered on the page. +To express a reading order between elements they have to be included in a ordered group. Groups may contain further groups. + + + + + + + + + + + Numbered region + + + + Position (order number) of this item within the current hierarchy level. + + + + + + + Indexed group containing ordered elements + + + + + + + + + + Position (order number) of this item within the current hierarchy level. + + + + + + Indexed group containing unordered elements + + + + + + + + + + + Position (order number) of this item within the + current hierarchy level. + + + + + + + + + + + + Numbered group (contains ordered elements) + + + + + + + + + + + + Numbered group (contains unordered elements) + + + + + + + + + + + + Border of the actual page (if the scanned image contains parts not belonging to the page). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Can be used to express the z-index of overlapping + regions. An element with a greater z-index is always in + front of another element with lower z-index. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2010-03-19_pagecontent.xsd b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2010-03-19_pagecontent.xsd new file mode 100644 index 00000000..4f2f68e6 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2010-03-19_pagecontent.xsd @@ -0,0 +1,738 @@ + + + + + + Page Content - Ground Truth and Storage + + + + + + + + + + + + + + + + + + + + + + + + + If the reading order element exists, all regions have to be covered (i.e. all region ids must be mentioned exactly once)! + + + + + If the layers element exists, all regions have to be covered (i.e. all region ids must be mentioned exactly once)! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pure text is represented as a text region. This includes drop capitals, but practically ornate text may be considered as a graphic. + + + + + + + + + + + Individual skew of the region in degrees (Range: -89.999,90) + + + + The nature of the text in the region + + + + + The text colour of the region + + + + The background colour of the region + + + + Specifies whether the colour of the text appears reversed against a background colour + + + + The size of the characters in points + + + The degree of space in points between the lines of text + + + + The degree of space in points between the characters in a string of text + + + + The direction in which text in a region should be read (within lines) + + + + + The degrees by which you need to turn your head in order to read the text when it is placed on the horizontal (Range: -89.999,90) + + + + Defines whether a region of text is indented or not + + + + The primary language used in the region + + + + The secondary language used in the region + + + + + The primary script used in the region + + + + + The secondary script used in the region + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Text in a "simple" form (ASCII or extended ASCII as mostly used for typing). +I.e. no use of special characters for ligatures (should be stored as two separate characters) +etc. + + + + Correct encoding of the original, always using the corresponding Unicode code point. +I.e. ligatures have to be represented as one character +etc. + + + + + + An image is considered to be more intricate and complex than a graphic. These can be photos or drawings. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The colour bit depth required for the region + + + + + The background colour of the region + + + + + Specifies whether the region also contains text + + + + + A line drawing is a single colour illustration without solid areas. + + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The pen (foreground) colour of the region + + + + The background colour of the region + + + + Specifies whether the region also contains text + + + + + + Regions containing simple graphics, such as a company logo, should be marked as graphic regions. + + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90). + + + + The type of graphic in the region + + + + An approximation of the number of colours used in the region + + + + Specifies whether the region also contains text. + + + + + + Tabular data in any form is represented with a table region. Rows and columns may or may not have separator lines; these lines are not separator regions. + + + + + + + The orientation in degrees of the baseline of the region (Range: -89.999,90). + + + + The number of rows present in the table + + + + The number of columns present in the table + + + + The colour of the lines used in the region + + + + + The background colour of the region + + + + + Specifies the presence of line separators + + + + + Specifies whether the region also contains text + + + + + + Regions containing charts or graphs of any type, should be marked as chart regions. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The type of chart in the region + + + + An approximation of the number of colours used in the region + + + The background colour of the region + + + + + Specifies whether the region also contains text + + + + + Separators are lines that lie between columns and paragraphs and can be used to logically separate different articles from each other. + + + + + + + The orientation in degrees of the region (Range: -89.999,90) + + + + The colour of the separator + + + + + + Regions containing equations and mathematical symbols should be marked as maths regions. + + + + + + + The orientation in degrees of the baseline of the rectangle that encapsulates the region (Range: -89.999,90) + + + + The background colour of the region + + + + + Noise regions are regions where no real data lies, only false data created by artifacts on the document or scanner noise. + + + + + + + + + To be used if the region type cannot be ascertained. + + + + + + + + + + A region that surrounds other regions (e.g. a box with + blue background containing text regions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the effective area on the paper of a printed page. Its size is equal for all pages of a book (exceptions: titlepage, multipage pictures). +It contains all living elements (except marginals) like body type, footnotes, headings, running titles. +It does not contain pagenumber (if not part of running title), marginals, signature mark, preview words. + + + + + + + + + + Definition of the reading order within the page. To express a reading order between elements they have to be included in an OrderedGroup. Groups may contain further groups. + + + + + + + + + + Numbered region + + + + Position (order number) of this item within the current hierarchy level. + + + + + + + Indexed group containing ordered elements + + + + + + + + + + Position (order number) of this item within the current hierarchy level. + + + + + + Indexed group containing unordered elements + + + + + + + + + + + Position (order number) of this item within the + current hierarchy level. + + + + + + + + + + + + Numbered group (contains ordered elements) + + + + + + + + + + + + Numbered group (contains unordered elements) + + + + + + + + + + + + Border of the actual page (if the scanned image contains parts not belonging to the page). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Can be used to express the z-index of overlapping + regions. An element with a greater z-index is always in + front of another element with lower z-index. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2013-07-15_pagecontent.xsd b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2013-07-15_pagecontent.xsd new file mode 100644 index 00000000..b69d9bbd --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/io/xml/schema/2013-07-15_pagecontent.xsd @@ -0,0 +1,1441 @@ + + + + + + Page Content - Ground Truth and Storage + + + + + + + + + + + + + + The timestamp has to be in UTC (Coordinated Universal Time) and not local time. + + + The timestamp has to be in UTC (Coordinated Universal Time) and not local time. + + + + + + + + + Alternative document page images (e.g. + black-and-white) + + + + + + + + + + + + + + + Unassigned regions are considered to be in the (virtual) default layer which is to be treated as below any other layers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + For generic use + + + + + Page type + + + + + + + Pure text is represented as a text region. This includes + drop capitals, but practically ornate text may be + considered as a graphic. + + + + + + + + + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The nature of the text in the region + + + + + + + The degree of space in points between the lines of + text (line spacing) + + + + + + + The direction in which text in a region should be + read (within lines) + + + + + + The angle the baseline of text withing a region has to be rotated (relative to the rectangle encapsulating the region) in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + Defines whether a region of text is indented or not + + + + + + Text align + + + + + + The primary language used in the region + + + + + + + The secondary language used in the region + + + + + + + The primary script used in the region + + + + + + + The secondary script used in the region + + + + + + + + + + + Point list with format "x1,y1 x2,y2 ..." + + + + + + + + + + Multiple connected points that mark the baseline + of the glyphs + + + + + + + + + + + + + + Overrides primaryLanguage attribute of parent text + region + + + + + + + Overrides the production attribute of the parent + text region + + + + + + For generic use + + + + + + + + + + + + + + + + + + Overrides primaryLanguage attribute of parent line + and/or text region + + + + + + + Overrides the production attribute of the parent + text line and/or text region. + + + + + + For generic use + + + + + + + + + + + + + + + + + + + + Overrides the production attribute of the parent + word / text line / text region. + + + + + + For generic use + + + + + + + + + + Text in a "simple" form (ASCII or extended ASCII + as mostly used for typing). I.e. no use of + special characters for ligatures (should be + stored as two separate characters) etc. + + + + + + + Correct encoding of the original, always using + the corresponding Unicode code point. I.e. + ligatures have to be represented as one + character etc. + + + + + + + OCR confidence value (between 0 and 1) + + + + + + + + + + + + + An image is considered to be more intricate and complex + than a graphic. These can be photos or drawings. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The colour bit depth required for the region + + + + + + + The background colour of the region + + + + + + + Specifies whether the region also contains + text + + + + + + + + + + A line drawing is a single colour illustration without + solid areas. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The pen (foreground) colour of the region + + + + + + + The background colour of the region + + + + + + + Specifies whether the region also contains + text + + + + + + + + + + Regions containing simple graphics, such as a company + logo, should be marked as graphic regions. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The type of graphic in the region + + + + + + + An approximation of the number of colours + used in the region + + + + + + + Specifies whether the region also contains + text. + + + + + + + + + + Tabular data in any form is represented with a table + region. Rows and columns may or may not have separator + lines; these lines are not separator regions. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The number of rows present in the table + + + + + + + The number of columns present in the table + + + + + + + The colour of the lines used in the region + + + + + + + The background colour of the region + + + + + + + Specifies the presence of line separators + + + + + + + Specifies whether the region also contains + text + + + + + + + + + + Regions containing charts or graphs of any type, should + be marked as chart regions. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The type of chart in the region + + + + + + + An approximation of the number of colours + used in the region + + + + + + + The background colour of the region + + + + + + + Specifies whether the region also contains + text + + + + + + + + + + Separators are lines that lie between columns and + paragraphs and can be used to logically separate + different articles from each other. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The colour of the separator + + + + + + + + + + Regions containing equations and mathematical symbols + should be marked as maths regions. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The background colour of the region + + + + + + + + + + Regions containing chemical formulas. + + + + + + + + The angle the rectangle encapsulating a + region has to be rotated in clockwise + direction in order to correct the present + skew (negative values indicate + anti-clockwise rotation). Range: + -179.999,180 + + + + + + + + The background colour of the region + + + + + + + + + + + Regions containing musical notations. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + The background colour of the region + + + + + + + + + + Regions containing advertisements. + + + + + + + The angle the rectangle encapsulating a region has to be rotated in clockwise direction in order to correct the present skew (negative values indicate anti-clockwise rotation). +Range: -179.999,180 + + + + + + + The background colour of the region + + + + + + + + + + Noise regions are regions where no real data lies, only + false data created by artifacts on the document or + scanner noise. + + + + + + + + + + To be used if the region type cannot be ascertained. + + + + + + + + + + Determines the effective area on the paper of a printed page. Its size is equal for all pages of a book (exceptions: titlepage, multipage pictures). +It contains all living elements (except marginals) like body type, footnotes, headings, running titles. +It does not contain pagenumber (if not part of running title), marginals, signature mark, preview words. + + + + + + + + + + Definition of the reading order within the page. To express a reading order between elements they have to be included in an OrderedGroup. Groups may contain further groups. + + + + + + + + + + Numbered region + + + + Position (order number) of this item within the current hierarchy level. + + + + + + + + Indexed group containing ordered elements + + + + + + + + + + + + + + + Position (order number) of this item within the + current hierarchy level. + + + + + + + + + + Indexed group containing unordered elements + + + + + + + + + + + + + Position (order number) of this item within the + current hierarchy level. + + + + + + + + + + + + + + Numbered group (contains ordered elements) + + + + + + + + + + + + + + + + + + Numbered group (contains unordered elements) + + + + + + + + + + + + + + + Border of the actual page (if the scanned image contains parts not belonging to the page). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Can be used to express the z-index of overlapping + regions. An element with a greater z-index is always in + front of another element with lower z-index. + + + + + + + + + + + + + + + + + + + + + + + + + + Point list with format "x1,y1 x2,y2 ..." + + + + + + + + + + Container for one-to-one relations between layout + objects (for example: DropCap - paragraph, caption - + image) + + + + + + + + + + + One-to-one relation between to layout object. Use 'link' + for loose relations and 'join' for strong relations + (where something is fragmented for instance). + + Examples for 'link': caption - image floating - + paragraph paragraph - paragraph (when a pragraph is + split across columns and the last word of the first + paragraph DOES NOT continue in the second paragraph) + drop-cap - paragraph (when the drop-cap is a whole word) + + Examples for 'join': word - word (separated word at the + end of a line) drop-cap - paragraph (when the drop-cap + is not a whole word) paragraph - paragraph (when a + pragraph is split across columns and the last word of + the first paragraph DOES continue in the second + paragraph) + + + + + + + + + + + + + + + + For generic use + + + + + + Text production type + + + + + + + + + + + + + + + Monospace (fixed-pitch, non-proportional) or + proportional font + + + + + + + For instance: Arial, Times New Roman. Add more + information if necessary (e.g. blackletter, + antiqua). + + + + + + + Serif or sans-serif typeface + + + + + + + + The size of the characters in points + + + + + + + The degree of space (in points) between the + characters in a string of text + + + + + + + Background colour + + + + + + Specifies whether the colour of the text appears + reversed against a background colour + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + For generic use + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/GeometricObjectImpl.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/GeometricObjectImpl.java new file mode 100644 index 00000000..86462f73 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/GeometricObjectImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout; + +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.maths.geometry.Polygon; + +/** + * Basic implementation of an object that can be located on the document page. + * + * @author Christian Clausner + * + */ +public class GeometricObjectImpl implements GeometricObject { + + private Polygon coords = null; + + /** + * Constructor + * @param coords The polygon locating the object on the page. + * @throws IllegalArgumentException if the passed polygon is null. + */ + public GeometricObjectImpl(Polygon coords) throws IllegalArgumentException { + if (coords == null) + throw new IllegalArgumentException("GeometricObjectImpl requires a polygon"); + this.coords = coords; + } + + @Override + public Polygon getCoords() { + return coords; + } + + @Override + public void setCoords(Polygon coords) { + this.coords = coords; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/GeometricObjectPositionComparator.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/GeometricObjectPositionComparator.java new file mode 100644 index 00000000..97848d7f --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/GeometricObjectPositionComparator.java @@ -0,0 +1,76 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout; + +import java.util.Comparator; + +import org.primaresearch.dla.page.layout.shared.GeometricObject; + +/** + * Comparator to sort geometric objects by bounding box position (left or top). + * Use the getInstance method to get a static instance of the comparator. + * + * @author Christian Clausner + */ +public class GeometricObjectPositionComparator implements Comparator { + + private static GeometricObjectPositionComparator instanceToSortByX = null; + private static GeometricObjectPositionComparator instanceToSortByY = null; + + private boolean sortByX; + + /** + * Constructor + * @param sortByX Set to true to sort objects left-to-right or to false to sort top-to-bottom + */ + private GeometricObjectPositionComparator(boolean sortByX) { + this.sortByX = sortByX; + } + + /** + * Creates a comparator + * @param sortByX Set to true to sort objects left-to-right or to false to sort top-to-bottom + * @return Comparator object + */ + public static GeometricObjectPositionComparator getInstance(boolean sortByX) { + if (sortByX) { + if (instanceToSortByX == null) + instanceToSortByX = new GeometricObjectPositionComparator(true); + return instanceToSortByX; + } + else { //sort by y + if (instanceToSortByY == null) + instanceToSortByY = new GeometricObjectPositionComparator(false); + return instanceToSortByY; + } + } + + + @Override + public int compare(GeometricObject obj1, GeometricObject obj2) { + if (sortByX) { + int x1 = obj1.getCoords().getBoundingBox().left; + int x2 = obj2.getCoords().getBoundingBox().left; + return x1 - x2; + } else { + int y1 = obj1.getCoords().getBoundingBox().top; + int y2 = obj2.getCoords().getBoundingBox().top; + return y1 - y2; + } + } + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/PageLayout.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/PageLayout.java new file mode 100644 index 00000000..391cf039 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/PageLayout.java @@ -0,0 +1,638 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import org.primaresearch.collections.IndexedMap; +import org.primaresearch.collections.IndexedMapImpl; +import org.primaresearch.dla.page.layout.logical.ContentObjectRelation; +import org.primaresearch.dla.page.layout.logical.ContentObjectRelation.RelationType; +import org.primaresearch.dla.page.layout.logical.Group; +import org.primaresearch.dla.page.layout.logical.GroupMember; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.logical.Layers; +import org.primaresearch.dla.page.layout.logical.ReadingOrder; +import org.primaresearch.dla.page.layout.logical.RegionRef; +import org.primaresearch.dla.page.layout.logical.Relations; +import org.primaresearch.dla.page.layout.physical.ContentFactory; +import org.primaresearch.dla.page.layout.physical.ContentIterator; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator; +import org.primaresearch.dla.page.layout.physical.impl.RegionIterator; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject; +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.maths.geometry.Dimension; +import org.primaresearch.maths.geometry.Polygon; + +/** + * Class representing the layout and text content of a document page. + * + * @author Christian Clausner + * + */ +public class PageLayout { + + private Dimension size = new Dimension(); + + private GeometricObject border = null; + private GeometricObject printSpace = null; + + private ContentFactory contentFactory; + + private IndexedMap regions = new IndexedMapImpl(); + + private ReadingOrder readingOrder = null; + private Layers layers = null; + private Relations relations = null; + + private static Comparator contentObjectSizeComparator = null; + + /** + * Constructor + * @param contentFactory Internal factory to create content such as regions, lines, reading order, ... + */ + public PageLayout(ContentFactory contentFactory) { + this.contentFactory = contentFactory; + } + + /** + * Creates a region of the specified type. + * @param type Type of region (e.g. TextRegion, ImageRegion, ...) + * @return Region object + */ + public Region createRegion(RegionType type) { + return createRegion(type, null); + } + + /** + * Creates a region of the specified type. + * @param type Type of region (e.g. TextRegion, ImageRegion, ...) + * @return Region object + */ + public Region createRegion(RegionType type, String id) { + return createRegion(type, id, null); + } + + /** + * Creates a region of the specified type. + * @param type Type of region (e.g. TextRegion, ImageRegion, ...) + * @param id Preferred ID for the region (not guaranteed, check the returned region for the actual ID) + * @param parentRegion Parent region (for nesting of regions) + * @return Region object + */ + public Region createRegion(RegionType type, String id, RegionContainer parentRegion) { + Region reg = (Region)contentFactory.createContent(type); + if (id != null) { + try { + reg.setId(id); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + if (parentRegion == null ) + regions.put(reg.getId(), reg); + else + parentRegion.addRegion(reg); + return reg; + } + + /** + * Returns the number of regions in this page layout. + */ + public int getRegionCount() { + return regions.size(); + } + + /** + * Returns the region at the specified index. + * @throws IndexOutOfBoundsException + */ + public Region getRegion(int index) { + return regions.getAt(index); + } + + /** + * Returns the region with the given ID. + */ + public Region getRegion(Id regionId) { + if (regionId == null) + return null; + return regions.get(regionId); + } + + /** + * Returns the region with the given ID. + */ + public Region getRegion(String regionId) { + if (regionId == null) + return null; + try { + return regions.get(contentFactory.getIdRegister().getId(regionId)); + } catch (InvalidIdException e) { + return null; + } + } + + /** + * Looks for a region at the given position within the document page. + * @return A region object or null. + */ + public Region getRegionAt(int x, int y) { + List candidates = new LinkedList(); + for (ContentIterator it = this.iterator(null); it.hasNext(); ) { + ContentObject region = it.next(); + if (region.getCoords() != null) { + Polygon coords = region.getCoords(); + if (coords.isPointInside(x, y)) { + candidates.add((Region)region); + } + } + } + + if (candidates.size() > 1) { + //If multiple candidates -> sort by size and return smallest + Collections.sort(candidates, getContentObjectSizeComparator()); + } + if (!candidates.isEmpty()) + return candidates.get(0); + + /*for (int i=0; inull if it could not be found + */ + public ContentObject getObject(ContentType type, String id) { + if (type instanceof RegionType) + return getRegion(id); + else if (type instanceof LowLevelTextType) { //Text lines, word, glyph + for (int i=0; inull + */ + public ContentObjectRelation getParentChildRelation(ContentType childType, String childId) { + if (childType instanceof RegionType) + return null; + else if (childType instanceof LowLevelTextType) { //Text lines, word, glyph + for (int i=0; itrue the ID will be removed from the ID register and is free to be used again + */ + public void removeRegion(Id regionId, boolean unregisterId) { + if (regionId == null) + return; + regions.remove(regionId); + if (unregisterId) + this.contentFactory.getIdRegister().unregisterId(regionId); + } + + /** + * Removes the region at the specified index from the page layout. + * @throws IndexOutOfBoundsException + */ + public void removeRegion(int index) { + removeRegion(index, false); + } + + /** + * Removes the region at the specified index from the page layout. + * @param unregisterId If set to true the ID will be removed from the ID register and is free to be used again + * @throws IndexOutOfBoundsException + */ + public void removeRegion(int index, boolean unregisterId) { + Region reg = regions.removeAt(index); + if (unregisterId && reg != null) + this.contentFactory.getIdRegister().unregisterId(reg.getId()); + } + + /** + * Returns a sorted list of all regions. The sorting is primarily done by reading order and secondarily by y position. + * @return List of region objects + */ + public List getRegionsSorted() { + List sortedRegions = new ArrayList(this.getRegionCount()); + + List notInReadingOrder = new ArrayList(); + + if (readingOrder != null) { + addRegionsFromReadingOrder(readingOrder.getRoot(), sortedRegions); + + //Save ids in a set for fast lookup + Set idSet = new HashSet(); + for (int i=0; i list) { + if (group == null) + return; + //Children + for (int i=0; inull for an iterator that includes all regions. + * @return The iterator + */ + public ContentIterator iterator(ContentType contentType) { + return iterator(contentType, null); + } + + /** + * Returns a new iterator for a specific page content type. + * @param contentType A specific region type or low level text object type. Use null for an iterator that includes all regions. + * @param layer Restrict the iterator to this layer (use null for no restriction) + * @return The iterator + */ + public ContentIterator iterator(ContentType contentType, Layer layer) { + if (contentType == null || contentType instanceof RegionType) + return new RegionIterator(this, (RegionType)contentType, layer); + else if (contentType instanceof LowLevelTextType) + return new LowLevelTextObjectIterator(this, (LowLevelTextType)contentType, layer); + throw new IllegalArgumentException("Unsupported content type for iterator"); + } + + /** + * Creates a comparator using the bounding box area of content objects + * @return Comparator object + */ + private static Comparator getContentObjectSizeComparator() { + if (contentObjectSizeComparator == null) { + contentObjectSizeComparator = new Comparator() { + @Override + public int compare(ContentObject o1, ContentObject o2) { + if (o1 == null || o2 == null || o1.getCoords() == null || o2.getCoords() == null + || o1.getCoords().getSize() < 3 || o2.getCoords().getSize() < 3) + return 0; + return new Integer(o1.getCoords().getBoundingBox().getWidth() + * o1.getCoords().getBoundingBox().getWidth()).compareTo( + new Integer(o2.getCoords().getBoundingBox().getWidth() + * o2.getCoords().getBoundingBox().getWidth())); + } + }; + } + return contentObjectSizeComparator; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ChainConverter.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ChainConverter.java new file mode 100644 index 00000000..9f7af58a --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ChainConverter.java @@ -0,0 +1,80 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.converter; + +import java.util.ArrayList; +import java.util.List; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.io.FormatVersion; + +/** + * Meta converter representing a chain of converters. + * + * @author Christian Clausner + * + */ +public class ChainConverter implements LayoutConverter { + + private List converters = new ArrayList(); + + /** + * Adds a converter to the chain + * @param converter Converter object + */ + public void addConverter(LayoutConverter converter) { + if (!converters.isEmpty() && !converters.get(converters.size()-1).getTargetVersion().equals(converter.getSourceVersion())) + throw new IllegalArgumentException("Source format version of given converter doesn't match the target format version of the last converter in the chain."); + converters.add(converter); + } + + @Override + public FormatVersion getSourceVersion() { + return converters.get(0).getSourceVersion(); + } + + @Override + public FormatVersion getTargetVersion() { + return converters.get(converters.size()-1).getTargetVersion(); + } + + @Override + public List convert(PageLayout layout) { + List messages = new ArrayList(); + + for (int i=0; i localMsg = converters.get(i).convert(layout); + if (localMsg != null) + messages.addAll(localMsg); + } + + return messages; + } + + @Override + public List checkForCompliance(PageLayout layout) { + List messages = new ArrayList(); + + for (int i=0; i localMsg = converters.get(i).checkForCompliance(layout); + if (localMsg != null) + messages.addAll(localMsg); + } + + return messages; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ConversionMessage.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ConversionMessage.java new file mode 100644 index 00000000..cd128cd5 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ConversionMessage.java @@ -0,0 +1,65 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.converter; + +/** + * Format conversion related message + * + * @author Christian Clausner + * + */ +public class ConversionMessage { + + public static final int CONVERSION_GENERAL = 0; + public static final int CONVERSION_RESET_INVALID_ATTRIBUTE = 1; + public static final int CONVERSION_ADD_REQUIRED_REGION = 2; + + + private String text; + private int code; + + /** + * Constructor for general message + * @param text Message content + */ + public ConversionMessage(String text) { + this(text, CONVERSION_GENERAL); + } + + /** + * Constructor for specific message code + * @param text Message content + * @param code Message code (see CONVERSION_... constants) + */ + public ConversionMessage(String text, int code) { + this.text = text; + } + + /** + * Returns the message content + */ + public String getText() { + return text; + } + + /** + * Returns the message code (see CONVERSION_... constants) + */ + public int getCode() { + return code; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ConverterHub.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ConverterHub.java new file mode 100644 index 00000000..699fcdf4 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/ConverterHub.java @@ -0,0 +1,226 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.converter; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject; +import org.primaresearch.io.FormatModel; +import org.primaresearch.io.FormatVersion; +import org.primaresearch.shared.variable.Variable; +import org.primaresearch.shared.variable.VariableMap; + +/** + * Central access point for converting page objects to specific format versions. + * + * @author Christian Clausner + * + */ +public class ConverterHub { + + /** Singleton instance */ + private static ConverterHub instance = null; + + + /** Registered converters */ + private Map> layoutConverters = new HashMap>(); + + /** + * Private constructor (Singleton) + */ + private ConverterHub() { + //Register layout converters + addConverter(new Converter_2010_03_19_to_2010_01_12()); + addConverter(new Converter_2010_01_12_to_2009_03_16()); + addConverter(new Converter_2013_07_15_to_2010_03_19()); + + //TODO If more schemas are added, we could dynamically create chain converters. + //2010-03-19 to 2009-03-16 + ChainConverter chain_2010_03_19_to_2009_03_16 = new ChainConverter(); + chain_2010_03_19_to_2009_03_16.addConverter(new Converter_2010_03_19_to_2010_01_12()); + chain_2010_03_19_to_2009_03_16.addConverter(new Converter_2010_01_12_to_2009_03_16()); + addConverter(chain_2010_03_19_to_2009_03_16); + + //2013-07-15 to 2010-01-12 + ChainConverter chain_2013_07_15_to_2010_01_12 = new ChainConverter(); + chain_2013_07_15_to_2010_01_12.addConverter(new Converter_2013_07_15_to_2010_03_19()); + chain_2013_07_15_to_2010_01_12.addConverter(new Converter_2010_03_19_to_2010_01_12()); + addConverter(chain_2013_07_15_to_2010_01_12); + + //2013-07-15 to 2009-03-16 + ChainConverter chain_2013_07_15_to_2009_03_16 = new ChainConverter(); + chain_2013_07_15_to_2009_03_16.addConverter(new Converter_2013_07_15_to_2010_03_19()); + chain_2013_07_15_to_2009_03_16.addConverter(new Converter_2010_03_19_to_2010_01_12()); + chain_2013_07_15_to_2009_03_16.addConverter(new Converter_2010_01_12_to_2009_03_16()); + addConverter(chain_2013_07_15_to_2009_03_16); + + } + + /** + * Returns singleton instance + */ + public static ConverterHub getInstance() { + if (instance == null) + instance = new ConverterHub(); + return instance; + } + + /** + * Registers a converter. + */ + private void addConverter(LayoutConverter converter) { + Map targets = layoutConverters.get(converter.getSourceVersion()); + if (targets == null) { + targets = new HashMap(); + layoutConverters.put(converter.getSourceVersion(), targets); + } + targets.put(converter.getTargetVersion(), converter); + } + + /** + * Converts the given page (layout) to the specified target format (might change attributes, attribute values and attribute constraints). + * + * @param page Page object containing the layout + * @param targetModel Target model for a specific format version + * @return A list of conversion messages or null. + */ + public static List convert(Page page, FormatModel targetModel) { + FormatVersion sourceVersion = page.getFormatVersion(); + if (sourceVersion == null || sourceVersion.equals(targetModel.getVersion())) + return null; + + //Layout conversion + List messages = null; + ConverterHub instance = getInstance(); + + LayoutConverter layoutConverter = instance.findConverter(page.getFormatVersion(), targetModel.getVersion()); + + if (layoutConverter != null) + messages = layoutConverter.convert(page.getLayout()); + + //Adapt existing attributes and constraints + adaptAttributes(page.getLayout(), targetModel); + + return messages; + } + + private static void adaptAttributes(PageLayout layout, FormatModel model) { + Map templates = model.getTypeAttributeTemplates(); + + for (int i=0; i templates) { + for (int i=0; i templates) { + for (int i=0; i templates) { + VariableMap attributes = obj.getAttributes(); + if (attributes == null || attributes.getType() == null) + return; + VariableMap template = templates.get(attributes.getType()); + if (template != null) { + //Remove not supported attributes and update constraints + for (int i=0; i checkForCompliance(Page page, FormatVersion targetVersion) { + FormatVersion sourceVersion = page.getFormatVersion(); + if (sourceVersion == null || sourceVersion.equals(targetVersion)) + return null; + + List messages = null; + ConverterHub instance = getInstance(); + + LayoutConverter converter = instance.findConverter(page.getFormatVersion(), targetVersion); + + if (converter != null) + messages = converter.checkForCompliance(page.getLayout()); + + return messages; + } + + //TODO If more schemas are added, we could dynamically create chain converters. + /** + * Tries to find a converter matching the given source and target versions. + * @return Converter object or null + */ + private LayoutConverter findConverter(FormatVersion source, FormatVersion target) { + Map targets = layoutConverters.get(source); + if (targets == null) + return null; + LayoutConverter conv = targets.get(target); + return conv; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/Converter_2010_01_12_to_2009_03_16.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/Converter_2010_01_12_to_2009_03_16.java new file mode 100644 index 00000000..c270665d --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/Converter_2010_01_12_to_2009_03_16.java @@ -0,0 +1,82 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.converter; + +import java.util.ArrayList; +import java.util.List; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.io.FormatVersion; +import org.primaresearch.io.xml.XmlFormatVersion; + +/** + * Converter for 2010-01-12 format to 2009-03-16 format.
+ *
+ *
    + *
  • Adds temp region if there is no region (at least one region required)
  • + *
+ * @author Christian Clausner + * + */ +public class Converter_2010_01_12_to_2009_03_16 implements LayoutConverter { + + @Override + public FormatVersion getSourceVersion() { + return new XmlFormatVersion("2010-01-12"); + } + + @Override + public FormatVersion getTargetVersion() { + return new XmlFormatVersion("2009-03-16"); + } + + @Override + public List convert(PageLayout layout) { + return run(layout, false); + } + + @Override + public List checkForCompliance(PageLayout layout) { + return run(layout, true); + } + + /** + * Runs check or conversion + * @param checkOnly If true, no conversion is carried out (dry run). + */ + public List run(PageLayout layout, boolean checkOnly) { + List messages = new ArrayList(); + + //Add a temporary region if there is no region at all + if (layout.getRegionCount() == 0) { + Region reg = layout.createRegion(RegionType.TextRegion); + try { + if (!checkOnly) + reg.setId("r"+ContentObject.TEMP_ID_SUFFIX); + messages.add(new ConversionMessage("Added temporary text region", ConversionMessage.CONVERSION_ADD_REQUIRED_REGION)); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + + return messages; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/Converter_2010_03_19_to_2010_01_12.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/Converter_2010_03_19_to_2010_01_12.java new file mode 100644 index 00000000..5f05af34 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/Converter_2010_03_19_to_2010_01_12.java @@ -0,0 +1,101 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.converter; + +import java.util.ArrayList; +import java.util.List; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.io.FormatVersion; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.shared.variable.Variable; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Converter for 2010-03-19 format to 2010-01-12 format.
+ *
+ *
    + *
  • Removes unsupported text types (signature-mark, catch-word, marginalia, footnote, footnote-continued, TOC-entry)
  • + *
+ * @author Christian Clausner + * + */ +public class Converter_2010_03_19_to_2010_01_12 implements LayoutConverter { + + @Override + public FormatVersion getSourceVersion() { + return new XmlFormatVersion("2010-03-19"); + } + + @Override + public FormatVersion getTargetVersion() { + return new XmlFormatVersion("2010-01-12"); + } + + @Override + public List convert(PageLayout layout) { + return run(layout, false); + } + + @Override + public List checkForCompliance(PageLayout layout) { + return run(layout, true); + } + + /** + * Runs check or conversion + * @param checkOnly If true, no conversion is carried out (dry run). + */ + public List run(PageLayout layout, boolean checkOnly) { + List messages = new ArrayList(); + + //Remove text type values: + // signature-mark + // catch-word + // marginalia + // footnote + // footnote-continued + // TOC-entry + for (int i=0; i + *
+ *
    + *
  • Removes unsupported graphic types (frame, barcode, decoration)
  • + *
  • Removes unsupported text types (endnote, other)
  • + *
  • Removes unsupported colours (other)
  • + *
  • Removes unsupported languages
  • + *
  • Converts unsupported regions to 'Unknown' (Music, Chem, Advert)
  • + *
  • Removes unsupported attributes from regions, lines, words, and glyphs
  • + *
+ * @author Christian Clausner + * + */ +public class Converter_2013_07_15_to_2010_03_19 implements LayoutConverter { + + @Override + public FormatVersion getSourceVersion() { + return new XmlFormatVersion("2013-07-15"); + } + + @Override + public FormatVersion getTargetVersion() { + return new XmlFormatVersion("2010-03-19"); + } + + @Override + public List convert(PageLayout layout) { + return run(layout, false); + } + + @Override + public List checkForCompliance(PageLayout layout) { + return run(layout, true); + } + + /** + * Runs check or conversion + * @param checkOnly If true, no conversion is carried out (dry run). + */ + public List run(PageLayout layout, boolean checkOnly) { + List messages = new ArrayList(); + + //Regions + List unsupportedRegions = new ArrayList(); + for (ContentIterator it = layout.iterator(null); it.hasNext(); ) { + Region reg = (Region)it.next(); + + //Graphic types frame, barcode, decoration + if (reg.getType().equals(RegionType.GraphicRegion) + && ("frame".equals(((GraphicRegion)reg).getGraphicType()) + || "barcode".equals(((GraphicRegion)reg).getGraphicType()) + || "decoration".equals(((GraphicRegion)reg).getGraphicType()))) { + + if (!checkOnly) + ((GraphicRegion)reg).setGraphicType(null); + + messages.add(new ConversionMessage("Reset unsupported graphic type for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + + //Text region types endnote, other + if (reg.getType().equals(RegionType.TextRegion) + && ("endnote".equals(((TextRegion)reg).getTextType()) + || "other".equals(((TextRegion)reg).getTextType()) + )) { + + if (!checkOnly) + ((TextRegion)reg).setTextType(null); + + messages.add(new ConversionMessage("Reset unsupported text type for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + + //Colours + try { + Variable v = reg.getAttributes().get("penColour"); + if (v != null && v.getValue().equals(new StringValue("other"))) { + if (!checkOnly) + v.setValue(null); + messages.add(new ConversionMessage("Reset unsupported colour for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + + v = reg.getAttributes().get("bgColour"); + if (v != null && v.getValue() != null && v.getValue().equals(new StringValue("other"))) { + if (!checkOnly) + v.setValue(null); + messages.add(new ConversionMessage("Reset unsupported colour for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + + v = reg.getAttributes().get("lineColour"); + if (v != null && v.getValue() != null && v.getValue().equals(new StringValue("other"))) { + if (!checkOnly) + v.setValue(null); + messages.add(new ConversionMessage("Reset unsupported colour for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + + v = reg.getAttributes().get("colour"); + if (v != null && v.getValue() != null && v.getValue().equals(new StringValue("other"))) { + if (!checkOnly) + v.setValue(null); + messages.add(new ConversionMessage("Reset unsupported colour for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + + v = reg.getAttributes().get("textColour"); + if (v != null && v.getValue() != null && v.getValue().equals(new StringValue("other"))) { + if (!checkOnly) + v.setValue(null); + messages.add(new ConversionMessage("Reset unsupported colour for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + } catch (Exception e) { + e.printStackTrace(); + } + + //Colour depth + try { + Variable v = reg.getAttributes().get("colourDepth"); + if (v != null && v.getValue() != null && v.getValue().equals(new StringValue("other"))) { + if (!checkOnly) + v.setValue(null); + messages.add(new ConversionMessage("Reset unsupported colour depth for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + } catch (Exception e) { + e.printStackTrace(); + } + + //Language + try { + Variable v = reg.getAttributes().get("primaryLanguage"); + if (v != null && v.getValue() != null) { + if (!v.getValue().equals(new StringValue("other")) + && !v.getValue().equals(new StringValue("other")) + && !v.getValue().equals(new StringValue("Afrikaans")) + && !v.getValue().equals(new StringValue("Albanian")) + && !v.getValue().equals(new StringValue("Amharic")) + && !v.getValue().equals(new StringValue("Arabic")) + && !v.getValue().equals(new StringValue("Basque")) + && !v.getValue().equals(new StringValue("Bengali")) + && !v.getValue().equals(new StringValue("Bulgarian")) + && !v.getValue().equals(new StringValue("Cambodian")) + && !v.getValue().equals(new StringValue("Cantonese")) + && !v.getValue().equals(new StringValue("Chinese")) + && !v.getValue().equals(new StringValue("Czech")) + && !v.getValue().equals(new StringValue("Danish")) + && !v.getValue().equals(new StringValue("Dutch")) + && !v.getValue().equals(new StringValue("English")) + && !v.getValue().equals(new StringValue("Estonian")) + && !v.getValue().equals(new StringValue("Finnish")) + && !v.getValue().equals(new StringValue("French")) + && !v.getValue().equals(new StringValue("German")) + && !v.getValue().equals(new StringValue("Greek")) + && !v.getValue().equals(new StringValue("Gujarati")) + && !v.getValue().equals(new StringValue("Hebrew")) + && !v.getValue().equals(new StringValue("Hindi")) + && !v.getValue().equals(new StringValue("Hungarian")) + && !v.getValue().equals(new StringValue("Icelandic")) + && !v.getValue().equals(new StringValue("Gaelic")) + && !v.getValue().equals(new StringValue("Italian")) + && !v.getValue().equals(new StringValue("Japanese")) + && !v.getValue().equals(new StringValue("Korean")) + && !v.getValue().equals(new StringValue("Latin")) + && !v.getValue().equals(new StringValue("Latvian")) + && !v.getValue().equals(new StringValue("Malay")) + && !v.getValue().equals(new StringValue("Norwegian")) + && !v.getValue().equals(new StringValue("Polish")) + && !v.getValue().equals(new StringValue("Portuguese")) + && !v.getValue().equals(new StringValue("Punjabi")) + && !v.getValue().equals(new StringValue("Russian")) + && !v.getValue().equals(new StringValue("Spanish")) + && !v.getValue().equals(new StringValue("Swedish")) + && !v.getValue().equals(new StringValue("Thai")) + && !v.getValue().equals(new StringValue("Turkish")) + && !v.getValue().equals(new StringValue("Urdu")) + && !v.getValue().equals(new StringValue("Welsh")) + && !v.getValue().equals(new StringValue("other")) + ) { + + if (!checkOnly) + v.setValue(null); + messages.add(new ConversionMessage("Reset unsupported language for region '"+reg.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + //Advert, Chem and Music + if (reg.getType().equals(RegionType.AdvertRegion) + || reg.getType().equals(RegionType.ChemRegion) + || reg.getType().equals(RegionType.MusicRegion)) { + unsupportedRegions.add(reg); + } + + } + + //Handle unsupported regions + for (Iterator it = unsupportedRegions.iterator(); it.hasNext(); ) { + Region unsupported = it.next(); + + if (!checkOnly) { + layout.removeRegion(unsupported.getId(), true); + Region unknownRegion = layout.createRegion(RegionType.UnknownRegion, unsupported.getId().toString()); + unknownRegion.setCoords(unsupported.getCoords()); + } + messages.add(new ConversionMessage("Changed region type to 'unknown' for region '"+unsupported.getId()+"'", ConversionMessage.CONVERSION_RESET_INVALID_ATTRIBUTE)); + } + + //Unsupported attributes + // Regions + for (ContentIterator it = layout.iterator(null); it.hasNext(); ) { + ContentObject obj = it.next(); + if (obj == null) + continue; + VariableMap atts = obj.getAttributes(); + if (atts != null) { + atts.remove("custom"); + atts.remove("comments"); + atts.remove("production"); + atts.remove("fontFamily"); + atts.remove("bold"); + atts.remove("italic"); + atts.remove("underlined"); + atts.remove("subscript"); + atts.remove("superscript"); + atts.remove("strikethrough"); + atts.remove("smallCaps"); + atts.remove("letterSpaced"); + } + } + // Lines + for (ContentIterator it = layout.iterator(LowLevelTextType.TextLine); it.hasNext(); ) { + ContentObject obj = it.next(); + if (obj == null) + continue; + VariableMap atts = obj.getAttributes(); + if (atts != null) { + atts.remove("custom"); + atts.remove("comments"); + atts.remove("primaryLanguage"); + atts.remove("production"); + atts.remove("fontFamily"); + atts.remove("bold"); + atts.remove("italic"); + atts.remove("underlined"); + atts.remove("subscript"); + atts.remove("superscript"); + atts.remove("strikethrough"); + atts.remove("smallCaps"); + atts.remove("letterSpaced"); + atts.remove("serif"); + atts.remove("monospace"); + atts.remove("fontSize"); + atts.remove("kerning"); + atts.remove("textColour"); + atts.remove("bgColour"); + atts.remove("reverseVideo"); + } + } + // Words + for (ContentIterator it = layout.iterator(LowLevelTextType.Word); it.hasNext(); ) { + ContentObject obj = it.next(); + if (obj == null) + continue; + VariableMap atts = obj.getAttributes(); + if (atts != null) { + atts.remove("custom"); + atts.remove("comments"); + atts.remove("language"); + atts.remove("production"); + atts.remove("fontFamily"); + atts.remove("bold"); + atts.remove("italic"); + atts.remove("underlined"); + atts.remove("subscript"); + atts.remove("superscript"); + atts.remove("strikethrough"); + atts.remove("smallCaps"); + atts.remove("letterSpaced"); + atts.remove("serif"); + atts.remove("monospace"); + atts.remove("fontSize"); + atts.remove("kerning"); + atts.remove("textColour"); + atts.remove("bgColour"); + atts.remove("reverseVideo"); + } + } + // Glyphs + for (ContentIterator it = layout.iterator(LowLevelTextType.Glyph); it.hasNext(); ) { + ContentObject obj = it.next(); + if (obj == null) + continue; + VariableMap atts = obj.getAttributes(); + if (atts != null) { + atts.remove("custom"); + atts.remove("comments"); + atts.remove("production"); + atts.remove("fontFamily"); + atts.remove("bold"); + atts.remove("italic"); + atts.remove("underlined"); + atts.remove("subscript"); + atts.remove("superscript"); + atts.remove("strikethrough"); + atts.remove("smallCaps"); + atts.remove("letterSpaced"); + atts.remove("serif"); + atts.remove("monospace"); + atts.remove("fontSize"); + atts.remove("kerning"); + atts.remove("textColour"); + atts.remove("bgColour"); + atts.remove("reverseVideo"); + } + } + + + return messages; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/LayoutConverter.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/LayoutConverter.java new file mode 100644 index 00000000..d9bbd52e --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/converter/LayoutConverter.java @@ -0,0 +1,53 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.converter; + +import java.util.List; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.io.FormatVersion; + +/** + * Interface for converters that convert a page layout to comply with a certain format version. + * + * @author Christian Clausner + * + */ +public interface LayoutConverter { + + /** + * Format version before the conversion + */ + public FormatVersion getSourceVersion(); + + /** + * Format version after the conversion + */ + public FormatVersion getTargetVersion(); + + /** + * Converts the given page layout to the specified target format. + * @return A list of conversion messages + */ + public List convert(PageLayout layout); + + /** + * Checks if the given page layout is consistent to the target format version + * of this converter. + * @return A list of inconsistencies + */ + public List checkForCompliance(PageLayout layout); +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.java new file mode 100644 index 00000000..00722f31 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/ContentObjectRelation.java @@ -0,0 +1,131 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.logical; + +import org.primaresearch.dla.page.layout.physical.ContentObject; + +/** + * Represents a relation between two page content objects (e.g. parent-child relation). + * + * @author Christian Clausner + * + */ +public class ContentObjectRelation { + + private ContentObject object1; + private ContentObject object2; + private RelationType relationType; + private String customField; + private String comments; + + /** + * Constructor + * + * @param object1 Page content object one + * @param object2 Page content object two + * @param relation Relation between object one and object two + */ + public ContentObjectRelation(ContentObject object1, ContentObject object2, RelationType relation) { + this.object1 = object1; + this.object2 = object2; + this.relationType = relation; + } + + public ContentObject getObject1() { + return object1; + } + + public ContentObject getObject2() { + return object2; + } + + public RelationType getRelationType() { + return relationType; + } + + /** + * Returns custom content + */ + public String getCustomField() { + return customField; + } + + /** + * Sets custom content + */ + public void setCustomField(String customField) { + this.customField = customField; + } + + /** + * Returns comments + * @return Comments text + */ + public String getComments() { + return comments; + } + + /** + * Sets comments + * @param comments Comments text + */ + public void setComments(String comments) { + this.comments = comments; + } + + + + + /** + * Relation type for page content objects. + * + * @author Christian Clausner + * + */ + public static class RelationType { + + /** + * Parent-child relation (e.g. word-glyph) + */ + public static final RelationType ParentChildRelation = new RelationType("ParentChildRelation"); + + /** + * Weak relation (e.g. image-caption) + */ + public static final RelationType Link = new RelationType("link"); + + /** + * Strong relation (e.g. drop capital - following text region or two parts of a word that was been wrapped) + */ + public static final RelationType Join = new RelationType("join"); + + private String id; + private RelationType(String id) { + this.id = id; + } + + @Override + public boolean equals(Object other) { + if (other instanceof RelationType) + return id.equals(((RelationType)other).id); + return false; + } + + public String toString() { + return id; + } + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/Group.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/Group.java new file mode 100644 index 00000000..5ba05e54 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/Group.java @@ -0,0 +1,251 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.logical; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.ContentFactory; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.ident.Identifiable; + +/** + * A logical group within a page layout (e.g. a reading order group). Groups can also be GroupMemebers. + * + * @author Christian Clausner + */ +public class Group implements GroupMember, Identifiable { + + private PageLayout layout; + private IdRegister idRegister; + private ContentFactory contentFactory; + private boolean canHaveGroupsAsChildren; + private Group parentGroup; + private Id id; + private String caption; + private boolean ordered; + private List members = new ArrayList(); + + /** + * Constructor + * @param layout Page layout the group belongs to + * @param idRegister ID register (needed when creating child groups) + * @param contentFactory Factory needed when creating child groups + * @param id Group ID + * @param parentGroup Parent group (null for root) + * @param canHaveGroupsAsChildren Set to true to allow child groups + */ + Group(PageLayout layout, IdRegister idRegister, ContentFactory contentFactory, Id id, Group parentGroup, boolean canHaveGroupsAsChildren) { + this.layout = layout; + this.idRegister = idRegister; + this.contentFactory = contentFactory; + this.id = id; + this.parentGroup = parentGroup; + this.canHaveGroupsAsChildren = canHaveGroupsAsChildren; + } + + /** + * Returns the parent of this group or null if it is a root group + */ + public Group getParent() { + return parentGroup; + } + + @Override + public Id getId() { + return id; + } + + /** + * Returns the caption (display name) + */ + public String getCaption() { + return caption; + } + + /** + * Sets the caption (display name) + */ + public void setCaption(String caption) { + this.caption = caption; + } + + /** + * Returns the 'ordered' state of this group + * @return true if an ordered group; false if an unordered group + */ + public boolean isOrdered() { + return ordered; + } + + /** + * Sets the 'ordered' state of this group + * @param ordered Set to true for an ordered group or false for an unordered group + */ + public void setOrdered(boolean ordered) { + this.ordered = ordered; + } + + /** + * Returns the size of this group + * @return Number of members + */ + public int getSize() { + return members.size(); + } + + /** + * Returns the group member at the given position + * @param index Position + * @return Group member object + */ + public GroupMember getMember(int index) { + return members.get(index); + } + + /** + * Creates a group and adds it as child to this group + * @return The new group + * @throws Exception The group is not allowed to have children + */ + public Group createChildGroup() throws Exception { + if (!canHaveGroupsAsChildren) + throw new Exception(""); + Group group = new Group(layout, idRegister, contentFactory, idRegister.generateId("g"), this, canHaveGroupsAsChildren); + members.add(group); + return group; + } + + /** + * Adds a reference to a region as group member + * @param id Region ID + */ + public void addRegionRef(String id) { + try { + members.add(new RegionRef(this, contentFactory.getIdRegister().getId(id))); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + + /** + * Removes a reference to a region + * @param id Region ID + */ + public void removeRegionRef(String id) { + if (members != null) { + GroupMember toRemove = null; + for (Iterator it = members.iterator(); it.hasNext(); ) { + GroupMember member = it.next(); + if (member instanceof RegionRef) { + if (((RegionRef)member).getRegionId().equals(id)) { + toRemove = member; + break; + } + } + } + + if (toRemove != null) + members.remove(toRemove); + } + } + + /** + * Recursively checks if this group or a child group contains a region reference with the given ID. + * + * @param regionId ID of referenced region + * @return True, if a reference has been found; false otherwise. + */ + public boolean containsRegionRef(Id regionId) { + if (members != null) { + for (Iterator it = members.iterator(); it.hasNext(); ) { + GroupMember member = it.next(); + if (member instanceof RegionRef) { + if (((RegionRef)member).getRegionId().equals(regionId)) + return true; + } else { //if (member instanceof Group) + if (((Group)member).containsRegionRef(regionId)) //Recursion + return true; + } + } + } + return false; + } + + /** + * Adds the given group member + */ + public void add(GroupMember member) { + members.add(member); + } + + @Override + public IdRegister getIdRegister() { + return idRegister; + } + + @Override + public void setId(String id) throws InvalidIdException { + this.id = idRegister.registerId(id, this.id); + } + + @Override + public void setId(Id id) throws InvalidIdException { + idRegister.registerId(id, this.id); + this.id = id; + } + + @Override + public void moveTo(Group newParent) { + parentGroup.remove(this); + newParent.add(this); + } + + /** + * Removes the specified member from this group. + * This method does not unregister the ID of a group. + * Intended for internal use (e.g. moveTo() of GroupMember). + * + * @return true, if the member has been found and removed, false otherwise + */ + boolean remove(GroupMember member) { + for (int i=0; i layers = new ArrayList(); + + /** + * Constructor + * @param layout Page layout which the layers are intended for + * @param idRegister ID register (for creating layers) + * @param contentFactory Content factory (for creating layers) + */ + public Layers(PageLayout layout, IdRegister idRegister, ContentFactory contentFactory) { + this.layout = layout; + this.idRegister = idRegister; + this.contentFactory = contentFactory; + } + + /** + * Returns the number of layers. + */ + public int getSize() { + return layers.size(); + } + + /** + * Returns the layer at the given index. + * @throws IndexOutOfBoundsException + */ + public Layer getLayer(int index) { + return layers.get(index); + } + + /** + * Creates and returns a new layer. + */ + public Layer createLayer() { + Layer layer; + try { + layer = new Layer(layout, idRegister, contentFactory, idRegister.generateId("lay")); + layers.add(layer); + return layer; + } catch (InvalidIdException e) { + } + return null; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/ReadingOrder.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/ReadingOrder.java new file mode 100644 index 00000000..525c4e4d --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/ReadingOrder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.logical; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.ContentFactory; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; + +/** + * Class for logical reading order of layout regions. + * The root group provides access to the actual reading order members. + * + * @author Christian Clausner + * + */ +public class ReadingOrder { + + private Group root; + + /** + * Constructor + * @param layout Page layout the reading order is intended for + * @param idRegister ID register (for creating groups) + * @param contentFactory Content factory (for creating groups) + */ + public ReadingOrder(PageLayout layout, IdRegister idRegister, ContentFactory contentFactory) { + try { + root = new Group(layout, idRegister, contentFactory, idRegister.generateId("g"), null, true); + } catch (InvalidIdException e) { + } + } + + /** + * Returns the root group (the reading order always has a root group) + */ + public Group getRoot() { + return root; + } + + /** + * Checks the the region with the given ID is referenced in the reading order. + * + * @param regionId ID of referenced region + * @return True, if the region has been found; false otherwise + */ + public boolean contains(Id regionId) { + if (root != null) + return root.containsRegionRef(regionId); + return false; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/RegionRef.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/RegionRef.java new file mode 100644 index 00000000..eda4385c --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/RegionRef.java @@ -0,0 +1,60 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.logical; + +import org.primaresearch.ident.Id; + +/** + * A group member pointing to an Identifiable object (e.g. a region). + * @author Christian Clausner + * + */ +public class RegionRef implements GroupMember { + + private Id regionId; + private Group parentGroup; + + /** + * Constructor + * @param parentGroup Parent group (this constructor does NOT add the RegionRef object to the parent group) + * @param regionId ID of referenced region + */ + RegionRef(Group parentGroup, Id regionId) { + this.parentGroup = parentGroup; + this.regionId = regionId; + } + + /** + * Returns the ID of the referenced region + */ + public Id getRegionId() { + return regionId; + } + + @Override + public Group getParent() { + return parentGroup; + } + + /** + * Moves this group member to another group. + */ + @Override + public void moveTo(Group newParent) { + parentGroup.remove(this); + newParent.add(this); + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/Relations.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/Relations.java new file mode 100644 index 00000000..62a8985f --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/logical/Relations.java @@ -0,0 +1,82 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.logical; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import org.primaresearch.ident.Id; + +/** + * Container class for relations between content objects. + * + * @author Christian Clausner + * + */ +public class Relations { + + private Map> relations = new HashMap>(); + + /** + * Checks if there are relations in this container + * @return true if empty, false otherwise + */ + public boolean isEmpty() { + return relations.isEmpty(); + } + + /** + * Adds a relation to this container. + * @param relation Relation object to add + */ + public void addRelation(ContentObjectRelation relation) { + Map targetMap = relations.get(relation.getObject1().getId()); + if (targetMap == null) { + targetMap = new HashMap(); + relations.put(relation.getObject1().getId(), targetMap); + } + targetMap.put(relation.getObject2().getId(), relation); + } + + /** + * Returns the relation for the objects with id1 and id2 or 'null', if no such relation exists. + */ + public ContentObjectRelation getRelation(Id id1, Id id2) { + Map targetMap = relations.get(id1); + if (targetMap != null) { + return targetMap.get(id2); + } else { + return getRelation(id2, id1); + } + } + + /** + * Exports a set of all relations. + */ + public Set exportRelations() { + Set rels = new HashSet(); + for (Iterator> it = relations.values().iterator(); it.hasNext(); ) { + Map targetMap = it.next(); + for (Iterator it2 = targetMap.values().iterator(); it2.hasNext(); ) { + rels.add(it2.next()); + } + } + return rels; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/AttributeContainer.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/AttributeContainer.java new file mode 100644 index 00000000..36a0ea7f --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/AttributeContainer.java @@ -0,0 +1,34 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical; + +import org.primaresearch.shared.variable.VariableMap; + +/** + * Represents an object that can have Attributes. + * + * @author Christian Clausner + * + */ +public interface AttributeContainer { + + /** + * Returns the attributes of the object. + * @return A map containing Variables + */ + public VariableMap getAttributes(); + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/AttributeFactory.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/AttributeFactory.java new file mode 100644 index 00000000..42c2cb03 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/AttributeFactory.java @@ -0,0 +1,37 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical; + +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.shared.variable.VariableMap; + +/** + * Interface for factories that create attribute collections for page content objects. + * Different types of content need different attributes. + * + * @author Christian Clausner + * + */ +public interface AttributeFactory { + + /** + * Returns a collection of attributes suitable for content objects of the given type. + * @return Map holding Variables + */ + public VariableMap createAttributes(ContentType type); + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentFactory.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentFactory.java new file mode 100644 index 00000000..b774e9a3 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentFactory.java @@ -0,0 +1,268 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.logical.Layers; +import org.primaresearch.dla.page.layout.logical.ReadingOrder; +import org.primaresearch.dla.page.layout.physical.impl.AdvertRegion; +import org.primaresearch.dla.page.layout.physical.impl.ChartRegion; +import org.primaresearch.dla.page.layout.physical.impl.ChemRegion; +import org.primaresearch.dla.page.layout.physical.impl.GraphicRegion; +import org.primaresearch.dla.page.layout.physical.impl.ImageRegion; +import org.primaresearch.dla.page.layout.physical.impl.LineDrawingRegion; +import org.primaresearch.dla.page.layout.physical.impl.MathsRegion; +import org.primaresearch.dla.page.layout.physical.impl.MusicRegion; +import org.primaresearch.dla.page.layout.physical.impl.NoiseRegion; +import org.primaresearch.dla.page.layout.physical.impl.RegionImpl; +import org.primaresearch.dla.page.layout.physical.impl.SeparatorRegion; +import org.primaresearch.dla.page.layout.physical.impl.TableRegion; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.impl.Glyph; +import org.primaresearch.dla.page.layout.physical.text.impl.TextLine; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.dla.page.layout.physical.text.impl.Word; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.VariableMap; + +/** + * Factory for creating page content objects. + * + * @author Christian Clausner + * + */ +public class ContentFactory { + + private IdRegister idRegister; + private AttributeFactory attributeFactory; + + /** + * Constructor + * @param idRegister ID register to guarantee unique content object IDs + * @param attributeFactory Factory for object attributes + */ + public ContentFactory(IdRegister idRegister, AttributeFactory attributeFactory) { + this.idRegister = idRegister; + this.attributeFactory = attributeFactory; + } + + private TextRegion createTextRegion() { + Id id; + try { + id = idRegister.generateId("r"); + TextRegion ret = new TextRegionItem(this, id, new Polygon(), + createAttributes(RegionType.TextRegion), + null); + return ret; + } catch (InvalidIdException e) { + } + return null; + } + + private TextLine createTextLine() { + Id id; + try { + id = idRegister.generateId("l"); + TextLine ret = new TextLineItem(this, id, new Polygon(), createAttributes(LowLevelTextType.TextLine), + null); + return ret; + } catch (InvalidIdException e) { + } + return null; + } + + private Word createWord() { + Id id; + try { + id = idRegister.generateId("w"); + Word ret = new WordItem(this, id, new Polygon(), createAttributes(LowLevelTextType.Word), + null); + return ret; + } catch (InvalidIdException e) { + } + return null; + } + + private Glyph createGlyph() { + Id id; + try { + id = idRegister.generateId("c"); + Glyph ret = new GlyphItem( idRegister, id, new Polygon(), createAttributes(LowLevelTextType.Glyph), + null); + return ret; + } catch (InvalidIdException e) { + } + return null; + } + + /** + * Creates a new content object of the given type + * @param type Content type (e.g. text region) + * @return The new object or null if the type is not supported + */ + public ContentObject createContent(ContentType type) { + + //Text regions are special + if (RegionType.TextRegion.equals(type)) + return createTextRegion(); + + if (LowLevelTextType.TextLine.equals(type)) + return createTextLine(); + + if (LowLevelTextType.Word.equals(type)) + return createWord(); + + if (LowLevelTextType.Glyph.equals(type)) + return createGlyph(); + + //All other regions + if (type instanceof RegionType) { + Id id = null; + try { + id = idRegister.generateId("r"); + } catch (InvalidIdException e) { + } + Region ret = null; + if (RegionType.ImageRegion.equals(type)) + ret = new ImageRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.GraphicRegion.equals(type)) + ret = new GraphicRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.LineDrawingRegion.equals(type)) + ret = new LineDrawingRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.ChartRegion.equals(type)) + ret = new ChartRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.SeparatorRegion.equals(type)) + ret = new SeparatorRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.MathsRegion.equals(type)) + ret = new MathsRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.AdvertRegion.equals(type)) + ret = new AdvertRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.ChemRegion.equals(type)) + ret = new ChemRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.MusicRegion.equals(type)) + ret = new MusicRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.TableRegion.equals(type)) + ret = new TableRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + //else if (type == RegionType.FrameRegion) + // ret = new FrameRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else if (RegionType.NoiseRegion.equals(type)) + ret = new NoiseRegion(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + else //Generic + ret = new RegionItem(idRegister, (RegionType)type, id, new Polygon(), createAttributes(type), null); + return ret; + } + return null; + } + + private VariableMap createAttributes(ContentType contentType) { + return attributeFactory.createAttributes(contentType); + } + + /** + * Creates a reading order object + * @param layout Page layout the reading order is intended for + * @return The reading order object + */ + public ReadingOrder createReadingOrder(PageLayout layout) { + return new ReadingOrder(layout, idRegister, this); + } + + /** + * Creates a layer container + * @param layout Page layout the layer container is intended for + * @return Layers object + */ + public Layers createLayers(PageLayout layout) { + return new Layers(layout, idRegister, this); + } + + /** + * Registers the specified ID + * @param id ID content + * @return ID object + * @throws InvalidIdException ID invalid + */ + public Id registerNewId(String id) throws InvalidIdException { + return idRegister.registerId(id); + } + + + //Extend class to get access to protected constructor. + private static class TextRegionItem extends TextRegion { + protected TextRegionItem(ContentFactory contentFactory, Id id, Polygon coords, + VariableMap attributes, + RegionContainer parentRegion) { + super(contentFactory, contentFactory.idRegister, id, coords, attributes, parentRegion); + } + } + + //Extend class to get access to protected constructor. + private static class TextLineItem extends TextLine { + protected TextLineItem(ContentFactory contentFactory, Id id, Polygon coords, VariableMap attributes, + LowLevelTextContainer parentRegion) { + super(contentFactory, contentFactory.idRegister, id, coords, attributes, parentRegion); + } + } + + //Extend class to get access to protected constructor. + private static class WordItem extends Word { + protected WordItem( ContentFactory contentFactory, Id id, Polygon coords, + VariableMap attributes, + LowLevelTextContainer parentRegion) { + super(contentFactory, contentFactory.idRegister, id, coords, attributes, parentRegion); + } + } + + //Extend class to get access to protected constructor. + private static class GlyphItem extends Glyph { + protected GlyphItem(IdRegister idRegister, Id id, Polygon coords, + VariableMap attributes, + LowLevelTextContainer parentRegion) { + super(idRegister, id, coords, attributes, parentRegion); + } + } + + //Extend class to get access to protected constructor. + private static class RegionItem extends RegionImpl { + protected RegionItem(IdRegister idRegister, RegionType type, Id id, Polygon coords, VariableMap attributes, + RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + } + + /** + * Sets the attribute factory that is used for creating attributes for new objects + */ + public void setAttributeFactory(AttributeFactory factory) { + this.attributeFactory = factory; + } + + /** + * Sets the ID register that is used for creating new objects + */ + public IdRegister getIdRegister() { + return idRegister; + } + + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentIterator.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentIterator.java new file mode 100644 index 00000000..ea682b25 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentIterator.java @@ -0,0 +1,40 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical; + +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; + +/** + * Iterator for all page content objects of a specified type + * + * @author Christian Clausner + * + */ +public interface ContentIterator { + + /** Is there another page content object? */ + public boolean hasNext(); + + /** Progresses the iterator and returns the next page content object. */ + public ContentObject next(); + + /** Returns the content type of the page content objects this iterator was created for. */ + public ContentType getContentType(); + + /** Returns the layer this iterator is restricted to (no null for no restriction) */ + public Layer getLayer(); +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentObject.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentObject.java new file mode 100644 index 00000000..10937861 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentObject.java @@ -0,0 +1,45 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical; + +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.shared.GeometricObject; +import org.primaresearch.ident.Identifiable; + +/** + * Represents physical page content objects (e.g. region, text line). + * + * @author Christian Clausner + * + */ +public interface ContentObject extends AttributeContainer, Identifiable, GeometricObject { + + /** + * Suffix used for IDs of temporary content objects + */ + public static final String TEMP_ID_SUFFIX = "357564684568544579089"; + + /** + * Returns the type of this page content object + */ + public ContentType getType(); + + /** + * Checks if this is a temporary content object + * @return true if temporary, false if normal content object + */ + public boolean isTemporary(); +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentObjectProcessor.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentObjectProcessor.java new file mode 100644 index 00000000..c7435e3f --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/ContentObjectProcessor.java @@ -0,0 +1,129 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical; + +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.TextObject; + +/** + * Processes all content objects of a page using a customisable processing method. + * + * @author Christian Clausner + * + */ +public abstract class ContentObjectProcessor { + + private ContentObject currentObject = null; + + /** Flag to set if text lines, words, and glyphs should be included or not */ + private boolean includeLowLevelTextObjects = true; + + /** + * Called for each content object. Override with custom implementation. + */ + public abstract void doProcess(ContentObject contentObject); + + /** + * Called for each content object. + */ + private void process(ContentObject contentObject) { + currentObject = contentObject; + doProcess(contentObject); + currentObject = null; + } + + /** + * Returns the content object that is currently processed. + */ + public ContentObject getCurrentObject() { + return currentObject; + } + + /** + * Run the processor. + */ + public void run(Page page) { + + //Handle content objects + PageLayout layout = page.getLayout(); + for (int r=0; r + *
+ * In static mode types and attributes are hard coded. In dynamic use only the types are hard coded, the attributes are generated dynamically from a schema. + * + * @author Christian Clausner + * + */ +public class DefaultAttributeFactory implements + AttributeFactory { + + private static Map> contentTypeAttrMap = null; + private static List textStyleAttrs = null; + + private FormatModel schemaParser = null; + + /** + * Constructor for static use + */ + public DefaultAttributeFactory() { + } + + /** + * Constructor for dynamic use. + * @param schemaParser Parser for XML schema + */ + public DefaultAttributeFactory(FormatModel schemaParser) { + this.schemaParser = schemaParser; + } + + /** + * Creates map with hard coded types and attributes. + */ + private static Map> getMap() { + if (contentTypeAttrMap == null) { + contentTypeAttrMap = new HashMap>(); + + List vars; + + //Page + vars = new ArrayList(); + contentTypeAttrMap.put(ContentType.Page, vars); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("type", null)); + + //Text Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.TextRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("type", new StringValue("paragraph"))); + vars.add(new IntegerVariable("leading", null)); + vars.add(new StringVariable("readingDirection", null)); + vars.add(new DoubleVariable("readingOrientation", null)); + vars.add(new BooleanVariable("indented", null)); + vars.add(new StringVariable("primaryLanguage", null)); + vars.add(new StringVariable("secondaryLanguage", null)); + vars.add(new StringVariable("primaryScript", null)); + vars.add(new StringVariable("secondaryScript", null)); + vars.add(new StringVariable("production", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Image Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.ImageRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("colourDepth", null)); + vars.add(new StringVariable("bgColour", null)); + vars.add(new BooleanVariable("embText", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Line Drawing Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.LineDrawingRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("penColour", null)); + vars.add(new StringVariable("bgColour", null)); + vars.add(new BooleanVariable("embText", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Graphic Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.GraphicRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("type", null)); + vars.add(new IntegerVariable("numColours", null)); + vars.add(new BooleanVariable("embText", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Table Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.TableRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new IntegerVariable("rows", null)); + vars.add(new IntegerVariable("columns", null)); + vars.add(new StringVariable("lineColour", null)); + vars.add(new StringVariable("bgColour", null)); + vars.add(new BooleanVariable("lineSeparators", null)); + vars.add(new BooleanVariable("embText", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Chart Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.ChartRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("type", null)); + vars.add(new IntegerVariable("numColours", null)); + vars.add(new StringVariable("bgColour", null)); + vars.add(new BooleanVariable("embText", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Separator Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.SeparatorRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("colour", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Maths Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.MathsRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("bgColour", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Advert Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.AdvertRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("bgColour", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Chem Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.ChemRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("bgColour", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Music Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.MusicRegion, vars); + vars.add(new DoubleVariable("orientation", null)); + vars.add(new StringVariable("bgColour", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Noise Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.NoiseRegion, vars); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Frame Region + //vars = new ArrayList(); + //contentTypeAttrMap.put(RegionType.FrameRegion, vars); + //vars.add(new StringVariable("bgColour", null)); + //vars.add(new BooleanVariable("borderPresent", null)); + + //Unknown Region + vars = new ArrayList(); + contentTypeAttrMap.put(RegionType.UnknownRegion, vars); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Text line + vars = new ArrayList(); + contentTypeAttrMap.put(LowLevelTextType.TextLine, vars); + vars.add(new StringVariable("primaryLanguage", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Word + vars = new ArrayList(); + contentTypeAttrMap.put(LowLevelTextType.Word, vars); + vars.add(new StringVariable("language", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + + //Glyph + vars = new ArrayList(); + contentTypeAttrMap.put(LowLevelTextType.Glyph, vars); + vars.add(new BooleanVariable("ligature", null)); + vars.add(new BooleanVariable("symbol", null)); + vars.add(new StringVariable("custom", null)); + vars.add(new StringVariable("comments", null)); + } + return contentTypeAttrMap; + } + + private List getTextStyleList() { + if (textStyleAttrs == null) { + textStyleAttrs = new ArrayList(); + textStyleAttrs.add(new StringVariable("textColour", null)); + textStyleAttrs.add(new StringVariable("bgColour", null)); + textStyleAttrs.add(new BooleanVariable("reverseVideo", null)); + textStyleAttrs.add(new DoubleVariable("fontSize", null)); + textStyleAttrs.add(new IntegerVariable("kerning", null)); + textStyleAttrs.add(new StringVariable("fontFamily", null)); + textStyleAttrs.add(new BooleanVariable("serif", null)); + textStyleAttrs.add(new BooleanVariable("monospace", null)); + textStyleAttrs.add(new BooleanVariable("bold", null)); + textStyleAttrs.add(new BooleanVariable("italic", null)); + textStyleAttrs.add(new BooleanVariable("underlined", null)); + textStyleAttrs.add(new BooleanVariable("subscript", null)); + textStyleAttrs.add(new BooleanVariable("superscript", null)); + textStyleAttrs.add(new BooleanVariable("strikethrough", null)); + textStyleAttrs.add(new BooleanVariable("smallCaps", null)); + textStyleAttrs.add(new BooleanVariable("letterSpaced", null)); + } + return textStyleAttrs; + } + + @Override + public VariableMap createAttributes(ContentType type) { + + //Dynamic schema + VariableMap varMap = new VariableMap(); + if (schemaParser != null) { + Map typeAttrTemplates = schemaParser.getTypeAttributeTemplates(); + if (typeAttrTemplates != null) { + String schemaTypeName = getSchemaTypeName(type); + varMap.setType(schemaTypeName); + if (schemaTypeName != null) { + VariableMap template = typeAttrTemplates.get(schemaTypeName); + if (template != null) { + for (int i=0; i> map = getMap(); + List vars = map.get(type); + if (vars != null) { + for (int i=0; i typeAttrTemplates = schemaParser.getTypeAttributeTemplates(); + if (typeAttrTemplates != null) { + String schemaTypeName = "TextStyleType"; + //varMap.setType(schemaTypeName); + VariableMap template = typeAttrTemplates.get(schemaTypeName); + if (template != null) { + for (int i=0; i list = getTextStyleList(); + if (list != null) { + for (int i=0; inull if it has no parent */ + public RegionContainer getParentRegion(); + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/RegionContainer.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/RegionContainer.java new file mode 100644 index 00000000..9af0c2d4 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/RegionContainer.java @@ -0,0 +1,57 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical; + + +/** + * Interface for classes that are able to contain nested layout regions. + * + * @author Christian Clausner + * + */ +public interface RegionContainer { + + /** + * Checks if this object contains nested regions + * @return true if there are nested regions, false otherwise + */ + public boolean hasRegions(); + + /** + * Returns the number of regions that are nested within this object + */ + public int getRegionCount(); + + /** + * Returns a nested region + * @param index Position + * @return Region object + */ + public Region getRegion(int index); + + /** + * Adds a nested region + * @param region Region to add + */ + public void addRegion(Region region); + + /** + * Removes a nested region + * @param region Region to remove + */ + public void removeRegion(Region region); + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/AdvertRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/AdvertRegion.java new file mode 100644 index 00000000..d7caa4a5 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/AdvertRegion.java @@ -0,0 +1,67 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for advert regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + */ +public class AdvertRegion extends RegionImpl { + + public AdvertRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ChartRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ChartRegion.java new file mode 100644 index 00000000..43077523 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ChartRegion.java @@ -0,0 +1,105 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.IntegerValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for chart regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + */ +public class ChartRegion extends RegionImpl { + + public ChartRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getChartType() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_type).getValue()).val; + } + + public void setChartType(String type) { + try { + getAttributes().get(DefaultXmlNames.ATTR_type).setValue(VariableValue.createValueObject(type)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public int getNumColours() { + return ((IntegerValue)getAttributes().get(DefaultXmlNames.ATTR_numColours).getValue()).val; + } + + public void setNumColours(int num) { + try { + getAttributes().get(DefaultXmlNames.ATTR_numColours).setValue(VariableValue.createValueObject(num)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public boolean hasEmbeddedText() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_embText).getValue()).val; + } + + public void setEmbeddedText(boolean hasText) { + try { + getAttributes().get(DefaultXmlNames.ATTR_embText).setValue(VariableValue.createValueObject(hasText)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ChemRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ChemRegion.java new file mode 100644 index 00000000..820b0fe5 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ChemRegion.java @@ -0,0 +1,67 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for chemical formula regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + */ +public class ChemRegion extends RegionImpl { + + public ChemRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/FrameRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/FrameRegion.java new file mode 100644 index 00000000..704cb61c --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/FrameRegion.java @@ -0,0 +1,67 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for frame regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + */ +public class FrameRegion extends RegionImpl { + + public FrameRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public boolean isBorderPresent() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_borderPresent).getValue()).val; + } + + public void setBorderPresent(boolean border) { + try { + getAttributes().get(DefaultXmlNames.ATTR_borderPresent).setValue(VariableValue.createValueObject(border)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/GraphicRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/GraphicRegion.java new file mode 100644 index 00000000..1517561e --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/GraphicRegion.java @@ -0,0 +1,93 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.IntegerValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for graphic regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + */ +public class GraphicRegion extends RegionImpl { + + public GraphicRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getGraphicType() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_type).getValue()).val; + } + + public void setGraphicType(String type) { + try { + getAttributes().get(DefaultXmlNames.ATTR_type).setValue(VariableValue.createValueObject(type)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public int getNumColours() { + return ((IntegerValue)getAttributes().get(DefaultXmlNames.ATTR_numColours).getValue()).val; + } + + public void setNumColours(int num) { + try { + getAttributes().get(DefaultXmlNames.ATTR_numColours).setValue(VariableValue.createValueObject(num)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public boolean hasEmbeddedText() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_embText).getValue()).val; + } + + public void setEmbeddedText(boolean hasText) { + try { + getAttributes().get(DefaultXmlNames.ATTR_embText).setValue(VariableValue.createValueObject(hasText)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ImageRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ImageRegion.java new file mode 100644 index 00000000..b818c69b --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/ImageRegion.java @@ -0,0 +1,93 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for image regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + * + */ +public class ImageRegion extends RegionImpl { + + public ImageRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getColourDepth() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_colourDepth).getValue()).val; + } + + public void setColourDepth(String colourDepth) { + try { + getAttributes().get(DefaultXmlNames.ATTR_colourDepth).setValue(VariableValue.createValueObject(colourDepth)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public boolean hasEmbeddedText() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_embText).getValue()).val; + } + + public void setEmbeddedText(boolean hasText) { + try { + getAttributes().get(DefaultXmlNames.ATTR_embText).setValue(VariableValue.createValueObject(hasText)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/LineDrawingRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/LineDrawingRegion.java new file mode 100644 index 00000000..b2bfd563 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/LineDrawingRegion.java @@ -0,0 +1,92 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for line drawing regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + */ +public class LineDrawingRegion extends RegionImpl { + + public LineDrawingRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getPenColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_penColour).getValue()).val; + } + + public void setPenColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_penColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public boolean hasEmbeddedText() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_embText).getValue()).val; + } + + public void setEmbeddedText(boolean hasText) { + try { + getAttributes().get(DefaultXmlNames.ATTR_embText).setValue(VariableValue.createValueObject(hasText)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/LowLevelTextObjectIterator.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/LowLevelTextObjectIterator.java new file mode 100644 index 00000000..03f1aa70 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/LowLevelTextObjectIterator.java @@ -0,0 +1,91 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.physical.ContentIterator; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject; + +/** + * Page content object iterator implementation for low level text objects (text lines, words, and glyphs). + * + * @author Christian Clausner + * + */ +public class LowLevelTextObjectIterator implements ContentIterator { + + private LowLevelTextType contentType; + private Layer layer; + private int index = 0; + private ContentIterator parentIterator; + private LowLevelTextContainer parent = null; + + /** + * Constructor + * @param contentType Low level text object type (text line, word, or glyph) + * @param layer Restrict the iterator to this layer (use null for no restriction) + */ + public LowLevelTextObjectIterator(PageLayout pageLayout, LowLevelTextType contentType, Layer layer) { + this.contentType = contentType; + this.layer = layer; + + if (contentType.equals(LowLevelTextType.TextLine)) + parentIterator = new RegionIterator(pageLayout, RegionType.TextRegion, layer); + else if (contentType.equals(LowLevelTextType.Word)) + parentIterator = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.TextLine, layer); + else if (contentType.equals(LowLevelTextType.Glyph)) + parentIterator = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.Word, layer); + + parent = (LowLevelTextContainer)parentIterator.next(); + } + + @Override + public boolean hasNext() { + while (parent != null) { + if (index < parent.getTextObjectCount()) + return true; + parent = (LowLevelTextContainer)parentIterator.next(); + index = 0; + } + return false; + } + + @Override + public ContentObject next() { + if (!hasNext()) + return null; + LowLevelTextObject ret = parent.getTextObject(index); + index++; + return ret; + } + + @Override + public ContentType getContentType() { + return contentType; + } + + @Override + public Layer getLayer() { + return layer; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/MathsRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/MathsRegion.java new file mode 100644 index 00000000..79f6bcbf --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/MathsRegion.java @@ -0,0 +1,67 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for maths regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + */ +public class MathsRegion extends RegionImpl { + + public MathsRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/MusicRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/MusicRegion.java new file mode 100644 index 00000000..a1ffb1ba --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/MusicRegion.java @@ -0,0 +1,67 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised implementation for musical notation regions. + * Provides getters and setters for default attributes. + * + * @author Christian Clausner + */ +public class MusicRegion extends RegionImpl { + + public MusicRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/NoiseRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/NoiseRegion.java new file mode 100644 index 00000000..80075367 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/NoiseRegion.java @@ -0,0 +1,37 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.VariableMap; + +/** + * Specialised implementation for noise regions. + * + * @author Christian Clausner + */ +public class NoiseRegion extends RegionImpl { + + public NoiseRegion(IdRegister idRegister, RegionType type, Id id, + Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + super(idRegister, type, id, coords, attributes, parentRegion); + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/RegionImpl.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/RegionImpl.java new file mode 100644 index 00000000..59be332c --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/RegionImpl.java @@ -0,0 +1,145 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.VariableMap; + +/** + * Basic implementation for layout regions. + * + * @author Christian Clausner + * + */ +public abstract class RegionImpl implements Region { + + private RegionType type; + private Id id; + private IdRegister idRegister; + + private Polygon coords; + + private VariableMap attributes; + + private RegionContainer parentRegion; + + private List nestedRegions = new ArrayList(); + + /** + * Constructor + * @param idRegister ID register (for creating child objects) + * @param type Region type + * @param id Region ID + * @param coords Region outline + * @param attributes Region attributes + * @param parentRegion (optional) Parent region + */ + protected RegionImpl(IdRegister idRegister, RegionType type, Id id, Polygon coords, VariableMap attributes, RegionContainer parentRegion) { + this.id = id; + this.idRegister = idRegister; + this.coords = coords; + this.attributes = attributes; + this.parentRegion = parentRegion; + this.type = type; + } + + @Override + public ContentType getType() { + return type; + } + + @Override + public boolean hasRegions() { + return !nestedRegions.isEmpty(); + } + + @Override + public int getRegionCount() { + return nestedRegions.size(); + } + + @Override + public Region getRegion(int index) { + return nestedRegions.get(index); + } + + @Override + public RegionContainer getParentRegion() { + return parentRegion; + } + + @Override + public VariableMap getAttributes() { + return attributes; + } + + @Override + public Polygon getCoords() { + return coords; + } + + @Override + public void setCoords(Polygon coords) { + this.coords = coords; + } + + @Override + public Id getId() { + return id; + } + + @Override + public IdRegister getIdRegister() { + return idRegister; + } + + @Override + public void setId(String id) throws InvalidIdException { + this.id = idRegister.registerId(id, this.id); + } + + @Override + public void setId(Id id) throws InvalidIdException { + idRegister.registerId(id, this.id); + this.id = id; + } + + @Override + public boolean isTemporary() { + return this.getId().toString().equals(TEMP_ID_SUFFIX); + } + + @Override + public void addRegion(Region region) { + nestedRegions.add(region); + } + + @Override + public void removeRegion(Region region) { + nestedRegions.remove(region); + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/RegionIterator.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/RegionIterator.java new file mode 100644 index 00000000..1fb97140 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/impl/RegionIterator.java @@ -0,0 +1,290 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.impl; + +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.physical.ContentIterator; +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; + +/** + * Page content object iterator implementation for regions (zones/blocks). + * + * @author Christian Clausner + * + */ +public class RegionIterator implements ContentIterator { + + protected RegionType contentType; + protected PageLayout pageLayout; + protected Layer layer; + protected int index = 0; + protected NestedRegionIterator currentNestedRegionIterator = null; + + /** + * Constructor + * @param contentType Specific region type (e.g. table) or null to include all regions + * @param layer Restrict the iterator to this layer (use null for no restriction) + */ + public RegionIterator(PageLayout pageLayout, RegionType contentType, Layer layer) { + this.contentType = contentType; + this.pageLayout = pageLayout; + this.layer = layer; + } + + + @Override + public boolean hasNext() { + if (contentType == null && layer == null) { //No specific region type or layer + if (currentNestedRegionIterator == null) + return index < pageLayout.getRegionCount(); + else + return currentNestedRegionIterator.hasNext() || index < pageLayout.getRegionCount()-1; + } + //Filter by region type and/or layer + else { + boolean ok; + int startIndex = index; + + //Check current nested iterator first + if (currentNestedRegionIterator != null) { + if (currentNestedRegionIterator.hasNext()) + return true; + else + startIndex++; + } + + //Go through all remaining regions + for (int i=startIndex; itrue if there are children, false if empty + */ + public boolean hasTextObjects(); + + /** + * Returns the number of child text objects + */ + public int getTextObjectCount(); + + /** + * Returns a child text object + * @param index Position + * @return Child text object + * @throws IndexOutOfBoundsException Invalid index + */ + public LowLevelTextObject getTextObject(int index) throws IndexOutOfBoundsException; + + /** + * Returns a child text object + * @param id ID of child + * @return Child text object + */ + public LowLevelTextObject getTextObject(Id id); + + /** + * Adds a child text object + * @param textObj Object to add + */ + public void addTextObject(LowLevelTextObject textObj); + + /** + * Removes a child text object + * @param index Position + * @throws IndexOutOfBoundsException Invalid index + */ + public void removeTextObject(int index) throws IndexOutOfBoundsException; + + /** + * Removes a child text object + * @param id ID of child + */ + public void removeTextObject(Id id); + + /** + * Returns a sorted list of all text objects (sorts by x or y position, depending on the object type). + */ + public List getTextObjectsSorted(); + + /** + * Composes the text for this object using the child text objects. + * @param replaceTextContent If set to true the text content of this object will be replaced by the composed text (only if the composed text is not empty) + * @param recursive If set to true all lower levels of text objects are used for the composition + * @return Composed text + */ + public String composeText(boolean replaceTextContent, boolean recursive); + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainerImpl.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainerImpl.java new file mode 100644 index 00000000..3d9a48eb --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/LowLevelTextContainerImpl.java @@ -0,0 +1,73 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.text; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.primaresearch.collections.IndexedMap; +import org.primaresearch.collections.IndexedMapImpl; +import org.primaresearch.dla.page.layout.GeometricObjectPositionComparator; +import org.primaresearch.ident.Id; + +/** + * Basic implementation of a low level text object container. + * + * @author Christian Clausner + * + */ +public class LowLevelTextContainerImpl { + + private IndexedMap textObjects = new IndexedMapImpl(); + + public boolean hasTextObjects() { + return !textObjects.isEmpty(); + } + + public int getTextObjectCount() { + return textObjects.size(); + } + + public LowLevelTextObject getTextObject(int index) { + return textObjects.getAt(index); + } + + public void addTextObject(LowLevelTextObject textObj) { + textObjects.put(textObj.getId(), textObj); + } + + public LowLevelTextObject getTextObject(Id id) { + return textObjects.get(id); + } + + public void removeTextObject(int index) throws IndexOutOfBoundsException { + textObjects.removeAt(index); + } + + public void removeTextObject(Id id) { + textObjects.remove(id); + } + + public List getTextObjectsSorted(boolean sortByX) { + List sorted = new ArrayList(textObjects.size()); + sorted.addAll(textObjects.values()); + Collections.sort(sorted, GeometricObjectPositionComparator.getInstance(sortByX)); + return sorted; + } + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/LowLevelTextObject.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/LowLevelTextObject.java new file mode 100644 index 00000000..10017bb1 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/LowLevelTextObject.java @@ -0,0 +1,145 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.text; + +import org.primaresearch.dla.page.layout.physical.ContentObject; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.VariableMap; + +/** + * Abstract class representing low level text objects such as text line, word and glyph. + * + * @author Christian Clausner + * + */ +abstract public class LowLevelTextObject implements TextObject, ContentObject { + + private Id id; + private IdRegister idRegister; + + private Polygon coords; + + private String textConentUnicode; + private String textContentPlain; + + private Double ocrConfidence = null; + + private VariableMap attributes; + //private VariableMap textStyle; + + private LowLevelTextContainer parent; + + + protected LowLevelTextObject(IdRegister idRegister, Id id, Polygon coords, + VariableMap attributes, LowLevelTextContainer parent) { + this.idRegister = idRegister; + this.id = id; + this.coords = coords; + this.attributes = attributes; + //this.textStyle = textStyle; + this.parent = parent; + } + + @Override + public String getText() { + return textConentUnicode; + } + + @Override + public String getPlainText() { + return textContentPlain; + } + + @Override + public void setText(String text) { + textConentUnicode = text; + } + + @Override + public void setPlainText(String text) { + textContentPlain = text; + } + + @Override + public VariableMap getAttributes() { + return attributes; + } + + @Override + public Polygon getCoords() { + return coords; + } + + @Override + public void setCoords(Polygon coords) { + this.coords = coords; + } + + @Override + public Id getId() { + return id; + } + + @Override + public IdRegister getIdRegister() { + return idRegister; + } + + @Override + public void setId(String id) throws InvalidIdException { + this.id = idRegister.registerId(id, this.id); + } + + @Override + public void setId(Id id) throws InvalidIdException { + idRegister.registerId(id, this.id); + this.id = id; + } + + @Override + public boolean isTemporary() { + return this.getId().toString().equals(TEMP_ID_SUFFIX); + } + + + @Override + public Double getConfidence() { + return ocrConfidence; + } + + @Override + public void setConfidence(Double confidence) { + this.ocrConfidence = confidence; + } + + public LowLevelTextContainer getParent() { + return parent; + } + + public void setParent(LowLevelTextContainer parent) { + this.parent = parent; + } + + //@Override + //public VariableMap getTextStyle() { + // return textStyle; + //} + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/TextObject.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/TextObject.java new file mode 100644 index 00000000..0f9ffe5d --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/TextObject.java @@ -0,0 +1,154 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.text; + + +/** + * Interface for objects with text content (e.g. text region, word, ...). + * + * @author Christian Clausner + * + */ +public interface TextObject { + + /** + * Returns the Unicode text. + */ + public String getText(); + + /** + * Returns the plain text. + */ + public String getPlainText(); + + /** + * Sets the Unicode text. + */ + public void setText(String text); + + /** + * Sets the plain text. + */ + public void setPlainText(String text); + + /** + * Returns the OCR confidence for the text content. + */ + public Double getConfidence(); + + /** + * Sets the OCR confidence for the text content. + */ + public void setConfidence(Double confidence); + + /** + * Bold text? + * @return true for bold text, false for normal text, or null if not set. + */ + public Boolean isBold(); + + /** + * Bold text? + * @param bold true for bold text, false for normal text, or null for 'not set'. + */ + public void setBold(Boolean bold); + + /** + * Italic text? + * @return true for italic text, false for normal text, or null if not set. + */ + public Boolean isItalic(); + + /** + * Italic text? + * @param italic true for italic text, false for normal text, or null for 'not set'. + */ + public void setItalic(Boolean italic); + + /** + * Underlined text? + * @return true for underlined text, false for not underlined text, or null if not set. + */ + public Boolean isUnderlined(); + + /** + * Underlined text? + * @param underlined true for underlined text, false for not underlined text, or null if not set. + */ + public void setUnderlined(Boolean underlined); + + /** + * Subscript (small letters below the baseline)? + * @return true for subscript, false for normal text, or null if not set. + */ + public Boolean isSubscript(); + + /** + * Subscript (small letters below the baseline)? + * @param subscript true for subscript, false for normal text, or null if not set. + */ + public void setSubscript(Boolean subscript); + + /** + * Superscript (small letters above the line of text)? + * @return true for superscript, false for normal text, or null if not set. + */ + public Boolean isSuperscript(); + + /** + * Superscript (small letters above the line of text)? + * @param superscript true for superscript, false for normal text, or null if not set. + */ + public void setSuperscript(Boolean superscript); + + /** + * Strikethrough (line through text)? + * @return true for strikethrough, false for normal text, or null if not set. + */ + public Boolean isStrikethrough(); + + /** + * Strikethrough (line through text)? + * @param strikethrough true for strikethrough, false for normal text, or null if not set. + */ + public void setStrikethrough(Boolean strikethrough); + + /** + * Small caps (lower case characters appear as smaller capitals)? + * @return true for small caps, false for normal text, or null if not set. + */ + public Boolean isSmallCaps(); + + /** + * Small caps (lower case characters appear as smaller capitals)? + * @param smallCaps true for small caps, false for normal text, or null if not set. + */ + public void setSmallCaps(Boolean smallCaps); + + /** + * Letter spaced (gaps between characters)? + * @return true for letter spaced text, false for normal text, or null if not set. + */ + public Boolean isLetterSpaced(); + + /** + * Letter spaced (gaps between characters)? + * @param letterSpaced true for letter spaced text, false for normal text, or null if not set. + */ + public void setLetterSpaced(Boolean letterSpaced); + + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/DefaultTextRegionTypes.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/DefaultTextRegionTypes.java new file mode 100644 index 00000000..7a052801 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/DefaultTextRegionTypes.java @@ -0,0 +1,42 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.text.impl; + +/** + * Collection of text region sub-types in compliance with the PAGE XML schema (version 2013-07-15). + * + * @author Christian Clausner + * + */ +public interface DefaultTextRegionTypes { + public static final String PARAGRAPH = "paragraph"; + public static final String HEADING = "heading"; + public static final String CAPTION = "caption"; + public static final String HEADER = "header"; + public static final String FOOTER = "footer"; + public static final String PAGE_NUMBER = "page-number"; + public static final String DROP_CAPITAL = "drop-capital"; + public static final String CREDIT = "credit"; + public static final String FLOATING = "floating"; + public static final String SIGNATURE_MARK = "signature-mark"; + public static final String CATCH_WORD = "catch-word"; + public static final String MARGINALIA = "marginalia"; + public static final String FOOTNOTE = "footnote"; + public static final String FOOTNOTE_CONTINUED = "footnote-continued"; + public static final String TOC_ENTRY = "TOC-entry"; + public static final String ENDNOTE = "endnote"; + public static final String OTHER = "other"; +} \ No newline at end of file diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/Glyph.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/Glyph.java new file mode 100644 index 00000000..9c81a271 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/Glyph.java @@ -0,0 +1,156 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.text.impl; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised low level text object representing glyphs within a page layout. + * + * @author Christian Clausner + * + */ +public class Glyph extends LowLevelTextObject { + + protected Glyph(IdRegister idRegister, Id id, Polygon coords, VariableMap attributes, + LowLevelTextContainer parentWord) { + super(idRegister, id, coords, attributes, parentWord); + } + + @Override + public ContentType getType() { + return LowLevelTextType.Glyph; + } + + @Override + public Boolean isBold() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_bold).getValue()).val; + } + + @Override + public void setBold(Boolean bold) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bold).setValue(VariableValue.createValueObject(bold)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isItalic() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_bold).getValue()).val; + } + + @Override + public void setItalic(Boolean italic) { + try { + getAttributes().get(DefaultXmlNames.ATTR_italic).setValue(VariableValue.createValueObject(italic)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isUnderlined() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_italic).getValue()).val; + } + + @Override + public void setUnderlined(Boolean underlined) { + try { + getAttributes().get(DefaultXmlNames.ATTR_underlined).setValue(VariableValue.createValueObject(underlined)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSubscript() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_underlined).getValue()).val; + } + + @Override + public void setSubscript(Boolean subscript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_subscript).setValue(VariableValue.createValueObject(subscript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSuperscript() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_subscript).getValue()).val; + } + + @Override + public void setSuperscript(Boolean superscript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_superscript).setValue(VariableValue.createValueObject(superscript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isStrikethrough() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_superscript).getValue()).val; + } + + @Override + public void setStrikethrough(Boolean strikethrough) { + try { + getAttributes().get(DefaultXmlNames.ATTR_strikethrough).setValue(VariableValue.createValueObject(strikethrough)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSmallCaps() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_smallCaps).getValue()).val; + } + + @Override + public void setSmallCaps(Boolean smallCaps) { + try { + getAttributes().get(DefaultXmlNames.ATTR_smallCaps).setValue(VariableValue.createValueObject(smallCaps)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isLetterSpaced() { + return false; + } + + @Override + public void setLetterSpaced(Boolean letterSpaced) { + //Glyph cannot be letter spaced + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/TextLine.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/TextLine.java new file mode 100644 index 00000000..c2aa4684 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/TextLine.java @@ -0,0 +1,282 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.text.impl; + +import java.util.List; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.ContentFactory; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; + +/** + * Specialised low level text object representing text lines within a page layout. + * + * @author Christian Clausner + * + */ +public class TextLine extends LowLevelTextObject + implements LowLevelTextContainer { + + private LowLevelTextContainerImpl words = new LowLevelTextContainerImpl(); + + private Polygon baseline; + + private ContentFactory contentFactory; + + + protected TextLine(ContentFactory contentFactory, IdRegister idRegister, Id id, Polygon coords, + VariableMap attributes, //VariableMap textStyle, + LowLevelTextContainer parentRegion) { + super(idRegister, id, coords, attributes, parentRegion); + this.contentFactory = contentFactory; + } + + @Override + public boolean hasTextObjects() { + return words.hasTextObjects(); + } + + @Override + public int getTextObjectCount() { + return words.getTextObjectCount(); + } + + @Override + public LowLevelTextObject getTextObject(int index) { + return words.getTextObject(index); + } + + public Word createWord() { + return createWord(null); + } + + /** + * Creates a new word object and adds it to this text line. + * @param id Preferred ID for the word (not guaranteed, check the result word for the actual ID) + * @return The new word + */ + public Word createWord(String id) { + Word word = (Word)contentFactory.createContent(LowLevelTextType.Word); + word.setParent(this); + if (id != null) { + try { + word.setId(id); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + addTextObject(word); + return word; + } + + @Override + public void addTextObject(LowLevelTextObject textObj) { + words.addTextObject(textObj); + } + + @Override + public ContentType getType() { + return LowLevelTextType.TextLine; + } + + @Override + public LowLevelTextObject getTextObject(Id id) { + return words.getTextObject(id); + } + + @Override + public void removeTextObject(int index) throws IndexOutOfBoundsException { + words.removeTextObject(index); + } + + @Override + public void removeTextObject(Id id) { + words.removeTextObject(id); + } + + @Override + public List getTextObjectsSorted() { + return words.getTextObjectsSorted(true); + } + + /** + * Returns the baseline attached to this text line. + */ + public Polygon getBaseline() { + return baseline; + } + + /** + * Sets the baseline attached to this text line. + */ + public void setBaseline(Polygon baseline) { + this.baseline = baseline; + } + + @Override + public Boolean isBold() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_bold).getValue()).val; + } + + @Override + public void setBold(Boolean bold) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bold).setValue(VariableValue.createValueObject(bold)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isItalic() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_bold).getValue()).val; + } + + @Override + public void setItalic(Boolean italic) { + try { + getAttributes().get(DefaultXmlNames.ATTR_italic).setValue(VariableValue.createValueObject(italic)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isUnderlined() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_italic).getValue()).val; + } + + @Override + public void setUnderlined(Boolean underlined) { + try { + getAttributes().get(DefaultXmlNames.ATTR_underlined).setValue(VariableValue.createValueObject(underlined)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSubscript() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_underlined).getValue()).val; + } + + @Override + public void setSubscript(Boolean subscript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_subscript).setValue(VariableValue.createValueObject(subscript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSuperscript() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_subscript).getValue()).val; + } + + @Override + public void setSuperscript(Boolean superscript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_superscript).setValue(VariableValue.createValueObject(superscript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isStrikethrough() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_superscript).getValue()).val; + } + + @Override + public void setStrikethrough(Boolean strikethrough) { + try { + getAttributes().get(DefaultXmlNames.ATTR_strikethrough).setValue(VariableValue.createValueObject(strikethrough)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSmallCaps() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_smallCaps).getValue()).val; + } + + @Override + public void setSmallCaps(Boolean smallCaps) { + try { + getAttributes().get(DefaultXmlNames.ATTR_smallCaps).setValue(VariableValue.createValueObject(smallCaps)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isLetterSpaced() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_letterSpaced).getValue()).val; + } + + @Override + public void setLetterSpaced(Boolean letterSpaced) { + try { + getAttributes().get(DefaultXmlNames.ATTR_letterSpaced).setValue(VariableValue.createValueObject(letterSpaced)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getPrimaryLanguage() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_primaryLanguage).getValue()).val; + } + + public void setPrimaryLanguage(String lang) { + try { + getAttributes().get(DefaultXmlNames.ATTR_primaryLanguage).setValue(VariableValue.createValueObject(lang)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public String composeText(boolean replaceTextContent, boolean recursive) { + String composed = ""; + //Compose from words + for (int i=0; i 0) + composed += " "; + composed += words.getTextObject(i).getText(); + } + if (replaceTextContent && !composed.isEmpty()) + setText(composed); + return composed; + } + +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/TextRegion.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/TextRegion.java new file mode 100644 index 00000000..78fd2c77 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/TextRegion.java @@ -0,0 +1,488 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.text.impl; + +import java.util.List; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.ContentFactory; +import org.primaresearch.dla.page.layout.physical.RegionContainer; +import org.primaresearch.dla.page.layout.physical.impl.RegionImpl; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject; +import org.primaresearch.dla.page.layout.physical.text.TextObject; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.DoubleValue; +import org.primaresearch.shared.variable.IntegerValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; + +/** + * Specialised layout region for text. + * + * @author Christian Clausner + * + */ +public class TextRegion extends RegionImpl implements TextObject, LowLevelTextContainer { + + + private LowLevelTextContainerImpl textLines = new LowLevelTextContainerImpl(); + + private String textConentUnicode; + private String textContentPlain; + + private Double ocrConfidence = null; + + private ContentFactory contentFactory; + + + protected TextRegion(ContentFactory contentFactory, IdRegister idRegister, Id id, Polygon coords, + VariableMap attributes, //VariableMap textStyle, + RegionContainer parentRegion) { + super(idRegister, RegionType.TextRegion, id, coords, attributes, parentRegion); + this.contentFactory = contentFactory; + } + + @Override + public ContentType getType() { + return RegionType.TextRegion; + } + + @Override + public String getText() { + return textConentUnicode; + } + + @Override + public String getPlainText() { + return textContentPlain; + } + + @Override + public void setText(String text) { + textConentUnicode = text; + } + + @Override + public void setPlainText(String text) { + textContentPlain = text; + } + + @Override + public boolean hasTextObjects() { + return textLines.hasTextObjects(); + } + + @Override + public int getTextObjectCount() { + return textLines.getTextObjectCount(); + } + + @Override + public LowLevelTextObject getTextObject(int index) { + return textLines.getTextObject(index); + } + + /** + * Creates a child text line + * @return The new text line object + */ + public TextLine createTextLine() { + return createTextLine(null); + } + + /** + * Creates a new text line object and adds it to this text region + * @param id Preferred ID for the text line (not guaranteed, check the returned line for the actual ID) + * @return New text line + */ + public TextLine createTextLine(String id) { + TextLine line = (TextLine)contentFactory.createContent(LowLevelTextType.TextLine); + line.setParent(this); + if (id != null) { + try { + line.setId(id); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + addTextObject(line); + return line; + } + + @Override + public void addTextObject(LowLevelTextObject textObj) { + textLines.addTextObject(textObj); + } + + @Override + public LowLevelTextObject getTextObject(Id id) { + return textLines.getTextObject(id); + } + + @Override + public void removeTextObject(int index) throws IndexOutOfBoundsException { + textLines.removeTextObject(index); + } + + @Override + public void removeTextObject(Id id) { + textLines.removeTextObject(id); + } + + @Override + public boolean isTemporary() { + return this.getId().toString().equals(TEMP_ID_SUFFIX); + } + + public String getTextType() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_type).getValue()).val; + } + + public void setTextType(String type) { + try { + getAttributes().get(DefaultXmlNames.ATTR_type).setValue(VariableValue.createValueObject(type)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_orientation).getValue()).val; + } + + public void setOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_orientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getTextColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_textColour).getValue()).val; + } + + public void setTextColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_textColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getBgColour() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_bgColour).getValue()).val; + } + + public void setBgColour(String colour) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bgColour).setValue(VariableValue.createValueObject(colour)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public boolean isReverseVideo() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_reverseVideo).getValue()).val; + } + + public void setReverseVideo(boolean reverseVideo) { + try { + getAttributes().get(DefaultXmlNames.ATTR_reverseVideo).setValue(VariableValue.createValueObject(reverseVideo)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getFontSize() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_fontSize).getValue()).val; + } + + public void setFontSize(double fontSize) { + try { + getAttributes().get(DefaultXmlNames.ATTR_fontSize).setValue(VariableValue.createValueObject(fontSize)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public int getLeading() { + return ((IntegerValue)getAttributes().get(DefaultXmlNames.ATTR_leading).getValue()).val; + } + + public void setLeading(int leading) { + try { + getAttributes().get(DefaultXmlNames.ATTR_leading).setValue(VariableValue.createValueObject(leading)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public int getKerning() { + return ((IntegerValue)getAttributes().get(DefaultXmlNames.ATTR_kerning).getValue()).val; + } + + public void setKerning(int kerning) { + try { + getAttributes().get(DefaultXmlNames.ATTR_kerning).setValue(VariableValue.createValueObject(kerning)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getReadingDirection() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_readingDirection).getValue()).val; + } + + public void setReadingDirection(String direction) { + try { + getAttributes().get(DefaultXmlNames.ATTR_readingDirection).setValue(VariableValue.createValueObject(direction)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public double getReadingOrientation() { + return ((DoubleValue)getAttributes().get(DefaultXmlNames.ATTR_readingOrientation).getValue()).val; + } + + public void setReadingOrientation(double orientation) { + try { + getAttributes().get(DefaultXmlNames.ATTR_readingOrientation).setValue(VariableValue.createValueObject(orientation)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public boolean isIndented() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_indented).getValue()).val; + } + + public void setIndented(boolean indented) { + try { + getAttributes().get(DefaultXmlNames.ATTR_indented).setValue(VariableValue.createValueObject(indented)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getPrimaryLanguage() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_primaryLanguage).getValue()).val; + } + + public void setPrimaryLanguage(String lang) { + try { + getAttributes().get(DefaultXmlNames.ATTR_primaryLanguage).setValue(VariableValue.createValueObject(lang)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getSecondaryLanguage() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_secondaryLanguage).getValue()).val; + } + + public void setSecondaryLanguage(String lang) { + try { + getAttributes().get(DefaultXmlNames.ATTR_secondaryLanguage).setValue(VariableValue.createValueObject(lang)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getPrimaryScript() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_primaryScript).getValue()).val; + } + + public void setPrimarySkript(String skript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_primaryScript).setValue(VariableValue.createValueObject(skript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getSecondaryScript() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_secondaryScript).getValue()).val; + } + + public void setSecondarySkript(String skript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_secondaryScript).setValue(VariableValue.createValueObject(skript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public List getTextObjectsSorted() { + return textLines.getTextObjectsSorted(false); + } + + @Override + public Double getConfidence() { + return ocrConfidence; + } + + @Override + public void setConfidence(Double confidence) { + this.ocrConfidence = confidence; + } + + //@Override + //public VariableMap getTextStyle() { + // return textStyle; + //} + + @Override + public Boolean isBold() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_bold).getValue()).val; + } + + @Override + public void setBold(Boolean bold) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bold).setValue(VariableValue.createValueObject(bold)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isItalic() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_bold).getValue()).val; + } + + @Override + public void setItalic(Boolean italic) { + try { + getAttributes().get(DefaultXmlNames.ATTR_italic).setValue(VariableValue.createValueObject(italic)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isUnderlined() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_italic).getValue()).val; + } + + @Override + public void setUnderlined(Boolean underlined) { + try { + getAttributes().get(DefaultXmlNames.ATTR_underlined).setValue(VariableValue.createValueObject(underlined)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSubscript() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_underlined).getValue()).val; + } + + @Override + public void setSubscript(Boolean subscript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_subscript).setValue(VariableValue.createValueObject(subscript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSuperscript() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_subscript).getValue()).val; + } + + @Override + public void setSuperscript(Boolean superscript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_superscript).setValue(VariableValue.createValueObject(superscript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isStrikethrough() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_superscript).getValue()).val; + } + + @Override + public void setStrikethrough(Boolean strikethrough) { + try { + getAttributes().get(DefaultXmlNames.ATTR_strikethrough).setValue(VariableValue.createValueObject(strikethrough)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSmallCaps() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_smallCaps).getValue()).val; + } + + @Override + public void setSmallCaps(Boolean smallCaps) { + try { + getAttributes().get(DefaultXmlNames.ATTR_smallCaps).setValue(VariableValue.createValueObject(smallCaps)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isLetterSpaced() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_letterSpaced).getValue()).val; + } + + @Override + public void setLetterSpaced(Boolean letterSpaced) { + try { + getAttributes().get(DefaultXmlNames.ATTR_letterSpaced).setValue(VariableValue.createValueObject(letterSpaced)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public String composeText(boolean replaceTextContent, boolean recursive) { + String composed = ""; + //Compose from text lines + for (int i=0; i 0) + composed += "\n"; + composed += textLines.getTextObject(i).getText(); + } + if (replaceTextContent && !composed.isEmpty()) + setText(composed); + return composed; + } +} diff --git a/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/Word.java b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/Word.java new file mode 100644 index 00000000..9dcec7a9 --- /dev/null +++ b/java/PrimaDla/src/org/primaresearch/dla/page/layout/physical/text/impl/Word.java @@ -0,0 +1,260 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical.text.impl; + +import java.util.List; + +import org.primaresearch.dla.page.io.xml.DefaultXmlNames; +import org.primaresearch.dla.page.layout.physical.ContentFactory; +import org.primaresearch.dla.page.layout.physical.shared.ContentType; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainer; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextContainerImpl; +import org.primaresearch.dla.page.layout.physical.text.LowLevelTextObject; +import org.primaresearch.ident.Id; +import org.primaresearch.ident.IdRegister; +import org.primaresearch.ident.IdRegister.InvalidIdException; +import org.primaresearch.maths.geometry.Polygon; +import org.primaresearch.shared.variable.BooleanValue; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.VariableMap; +import org.primaresearch.shared.variable.VariableValue; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +/** + * Specialised low level text object representing words within a page layout. + * + * @author Christian Clausner + * + */ +public class Word extends LowLevelTextObject implements LowLevelTextContainer { + + private LowLevelTextContainerImpl glyphs = new LowLevelTextContainerImpl(); + + ContentFactory contentFactory; + + + protected Word(ContentFactory contentFactory, IdRegister idRegister, Id id, Polygon coords, VariableMap attributes, + LowLevelTextContainer parentLine) { + super(idRegister, id, coords, attributes, parentLine); + this.contentFactory = contentFactory; + } + + @Override + public boolean hasTextObjects() { + return glyphs.hasTextObjects(); + } + + @Override + public int getTextObjectCount() { + return glyphs.getTextObjectCount(); + } + + @Override + public LowLevelTextObject getTextObject(int index) { + return glyphs.getTextObject(index); + } + + public Glyph createGlyph() { + return createGlyph(null); + } + + /** + * Creates a new glyph object and adds it to this word + * @param id Preferred ID for the glyph (not guaranteed, check the returned glyph for the actual ID) + * @return New glyph + */ + public Glyph createGlyph(String id) { + Glyph glyph = (Glyph)contentFactory.createContent(LowLevelTextType.Glyph); + glyph.setParent(this); + if (id != null) { + try { + glyph.setId(id); + } catch (InvalidIdException e) { + e.printStackTrace(); + } + } + addTextObject(glyph); + return glyph; + } + + @Override + public void addTextObject(LowLevelTextObject textObj) { + glyphs.addTextObject(textObj); + } + + @Override + public ContentType getType() { + return LowLevelTextType.Word; + } + + @Override + public LowLevelTextObject getTextObject(Id id) { + return glyphs.getTextObject(id); + } + + @Override + public void removeTextObject(int index) throws IndexOutOfBoundsException { + glyphs.removeTextObject(index); + } + + @Override + public void removeTextObject(Id id) { + glyphs.removeTextObject(id); + } + + @Override + public List getTextObjectsSorted() { + return glyphs.getTextObjectsSorted(true); + } + + @Override + public Boolean isBold() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_bold).getValue()).val; + } + + @Override + public void setBold(Boolean bold) { + try { + getAttributes().get(DefaultXmlNames.ATTR_bold).setValue(VariableValue.createValueObject(bold)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isItalic() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_bold).getValue()).val; + } + + @Override + public void setItalic(Boolean italic) { + try { + getAttributes().get(DefaultXmlNames.ATTR_italic).setValue(VariableValue.createValueObject(italic)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isUnderlined() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_italic).getValue()).val; + } + + @Override + public void setUnderlined(Boolean underlined) { + try { + getAttributes().get(DefaultXmlNames.ATTR_underlined).setValue(VariableValue.createValueObject(underlined)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSubscript() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_underlined).getValue()).val; + } + + @Override + public void setSubscript(Boolean subscript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_subscript).setValue(VariableValue.createValueObject(subscript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSuperscript() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_subscript).getValue()).val; + } + + @Override + public void setSuperscript(Boolean superscript) { + try { + getAttributes().get(DefaultXmlNames.ATTR_superscript).setValue(VariableValue.createValueObject(superscript)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isStrikethrough() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_superscript).getValue()).val; + } + + @Override + public void setStrikethrough(Boolean strikethrough) { + try { + getAttributes().get(DefaultXmlNames.ATTR_strikethrough).setValue(VariableValue.createValueObject(strikethrough)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isSmallCaps() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_smallCaps).getValue()).val; + } + + @Override + public void setSmallCaps(Boolean smallCaps) { + try { + getAttributes().get(DefaultXmlNames.ATTR_smallCaps).setValue(VariableValue.createValueObject(smallCaps)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public Boolean isLetterSpaced() { + return ((BooleanValue)getAttributes().get(DefaultXmlNames.ATTR_letterSpaced).getValue()).val; + } + + @Override + public void setLetterSpaced(Boolean letterSpaced) { + try { + getAttributes().get(DefaultXmlNames.ATTR_letterSpaced).setValue(VariableValue.createValueObject(letterSpaced)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + public String getLanguage() { + return ((StringValue)getAttributes().get(DefaultXmlNames.ATTR_language).getValue()).val; + } + + public void setLanguage(String lang) { + try { + getAttributes().get(DefaultXmlNames.ATTR_language).setValue(VariableValue.createValueObject(lang)); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + } + + @Override + public String composeText(boolean replaceTextContent, boolean recursive) { + String composed = ""; + //Compose from glyphs + // No recursion (glyphs are the lowest level) + for (int i=0; i list = new ArrayList(); + list.add(obj2); + list.add(obj1); + list.add(obj3); + + //Sort by x + Collections.sort(list, GeometricObjectPositionComparator.getInstance(true)); + assertTrue(list.get(0) == obj1); + assertTrue(list.get(1) == obj2); + assertTrue(list.get(2) == obj3); + + //Sort by y + Collections.sort(list, GeometricObjectPositionComparator.getInstance(false)); + assertTrue(list.get(0) == obj1); + assertTrue(list.get(1) == obj3); + assertTrue(list.get(2) == obj2); + } + +} diff --git a/java/PrimaDla/test/org/primaresearch/dla/page/layout/converter/ConverterHubTest.java b/java/PrimaDla/test/org/primaresearch/dla/page/layout/converter/ConverterHubTest.java new file mode 100644 index 00000000..f1746a66 --- /dev/null +++ b/java/PrimaDla/test/org/primaresearch/dla/page/layout/converter/ConverterHubTest.java @@ -0,0 +1,132 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.converter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; + +import java.util.List; + +import org.junit.Test; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.io.xml.PageXmlInputOutput; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.converter.ConversionMessage; +import org.primaresearch.dla.page.layout.converter.ConverterHub; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.io.UnsupportedFormatVersionException; +import org.primaresearch.io.xml.XmlFormatVersion; +import org.primaresearch.io.xml.XmlModelAndValidatorProvider.NoSchemasException; +import org.primaresearch.shared.variable.StringValue; +import org.primaresearch.shared.variable.Variable; +import org.primaresearch.shared.variable.Variable.WrongVariableTypeException; + +public class ConverterHubTest { + + @Test + public void testConvert() { + + try { + PageXmlInputOutput.setAdditionalSchemaLocation(null, null); + } catch (NoSchemasException e1) { + e1.printStackTrace(); + } + + //Convert from 2010-03-19 to 2010-01-12 + Page page = new Page(); + + PageLayout layout = page.getLayout(); + + TextRegion reg = (TextRegion)layout.createRegion(RegionType.TextRegion); + Variable textType = reg.getAttributes().get("type"); + try { + textType.setValue(new StringValue("TOC-entry")); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + + List messages = null; + try { + messages = ConverterHub.convert(page, PageXmlInputOutput.getInstance().getFormatModel(new XmlFormatVersion("2010-01-12"))); + } catch (UnsupportedFormatVersionException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + assertNotNull(messages); + assertEquals(1, messages.size()); + assertNull(textType.getValue()); + + //Convert from 2013-07-15 to 2010-03-19 + page = new Page(); + layout = page.getLayout(); + + // Text type + reg = (TextRegion)layout.createRegion(RegionType.TextRegion); + textType = reg.getAttributes().get("type"); + try { + textType.setValue(new StringValue("endnote")); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + + // Music region + layout.createRegion(RegionType.MusicRegion); + + messages = null; + try { + messages = ConverterHub.convert(page, PageXmlInputOutput.getInstance().getFormatModel(new XmlFormatVersion("2010-03-19"))); + } catch (UnsupportedFormatVersionException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + assertNotNull(messages); + assertEquals(2, messages.size()); + assertNull(textType.getValue()); + + } + + @Test + public void testCheckForCompliance() { + + try { + PageXmlInputOutput.setAdditionalSchemaLocation(null, null); + } catch (NoSchemasException e1) { + e1.printStackTrace(); + } + + //Check for compliance against 2010-01-12 + Page page = new Page(); + + PageLayout layout = page.getLayout(); + + TextRegion reg = (TextRegion)layout.createRegion(RegionType.TextRegion); + Variable textType = reg.getAttributes().get("type"); + try { + textType.setValue(new StringValue("TOC-entry")); + } catch (WrongVariableTypeException e) { + e.printStackTrace(); + } + + List messages = ConverterHub.checkForCompliance(page, new XmlFormatVersion("2010-01-12")); + assertNotNull(messages); + assertEquals(1, messages.size()); + assertNotNull(textType.getValue()); + } + +} diff --git a/java/PrimaDla/test/org/primaresearch/dla/page/layout/physical/PageIteratorTest.java b/java/PrimaDla/test/org/primaresearch/dla/page/layout/physical/PageIteratorTest.java new file mode 100644 index 00000000..8f39ec51 --- /dev/null +++ b/java/PrimaDla/test/org/primaresearch/dla/page/layout/physical/PageIteratorTest.java @@ -0,0 +1,443 @@ +/* + * Copyright 2014 PRImA Research Lab, University of Salford, United Kingdom + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in 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. + */ +package org.primaresearch.dla.page.layout.physical; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.primaresearch.dla.page.Page; +import org.primaresearch.dla.page.layout.PageLayout; +import org.primaresearch.dla.page.layout.logical.Layer; +import org.primaresearch.dla.page.layout.physical.ContentIterator; +import org.primaresearch.dla.page.layout.physical.Region; +import org.primaresearch.dla.page.layout.physical.impl.LowLevelTextObjectIterator; +import org.primaresearch.dla.page.layout.physical.impl.RegionIterator; +import org.primaresearch.dla.page.layout.physical.shared.LowLevelTextType; +import org.primaresearch.dla.page.layout.physical.shared.RegionType; +import org.primaresearch.dla.page.layout.physical.text.impl.Glyph; +import org.primaresearch.dla.page.layout.physical.text.impl.TextLine; +import org.primaresearch.dla.page.layout.physical.text.impl.TextRegion; +import org.primaresearch.dla.page.layout.physical.text.impl.Word; + +public class PageIteratorTest { + + @Test + public void testRegionIterator() { + //Create a few regions + Page page = new Page(); + PageLayout pageLayout = page.getLayout(); + Region r1 = pageLayout.createRegion(RegionType.TextRegion); + Region r2 = pageLayout.createRegion(RegionType.ChartRegion); + Region r3 = pageLayout.createRegion(RegionType.TextRegion); + Region r4 = pageLayout.createRegion(RegionType.TextRegion); + Region r5 = pageLayout.createRegion(RegionType.MusicRegion); + + //Use iterator factory + ContentIterator it = pageLayout.iterator(null); + + assertTrue("Iterator created", it != null && it instanceof RegionIterator); + + assertTrue("Region 1", it.hasNext() && it.next() == r1); + assertTrue("Region 2", it.hasNext() && it.next() == r2); + assertTrue("Region 3", it.hasNext() && it.next() == r3); + assertTrue("Region 4", it.hasNext() && it.next() == r4); + assertTrue("Region 5", it.hasNext() && it.next() == r5); + assertFalse("End", it.hasNext()); + + //Region type + it = new RegionIterator(pageLayout, RegionType.TextRegion, null); + + assertTrue("Region iterator with type filter created", it != null && it instanceof RegionIterator); + + assertTrue("Text region 1", it.hasNext() && it.next() == r1); + assertTrue("Text region 3", it.hasNext() && it.next() == r3); + assertTrue("Text region 4", it.hasNext() && it.next() == r4); + assertFalse("End iterator with type filter", it.hasNext()); + + //Layer + pageLayout.createLayers(); + Layer layer = pageLayout.getLayers().createLayer(); + layer.addRegionRef(r2.getId().toString()); + layer.addRegionRef(r4.getId().toString()); + layer.addRegionRef(r5.getId().toString()); + + it = new RegionIterator(pageLayout, null, layer); + + assertTrue("Region iterator with layer filter created", it != null && it instanceof RegionIterator); + + assertTrue("Region 2 (in layer)", it.hasNext() && it.next() == r2); + assertTrue("Region 4 (in layer)", it.hasNext() && it.next() == r4); + assertTrue("Region 5 (in layer)", it.hasNext() && it.next() == r5); + assertFalse("End iterator with layer filter", it.hasNext()); + + //Layer and region type + layer.removeRegionRef(r5.getId().toString()); + + it = new RegionIterator(pageLayout, RegionType.MusicRegion, layer); + + assertTrue("Region iterator with layer and type filter created", it != null && it instanceof RegionIterator); + + assertFalse("End iterator with layer and type filter", it.hasNext()); + } + + @Test + public void testRegionIteratorWithNesting() { + //Create a few regions + Page page = new Page(); + PageLayout pageLayout = page.getLayout(); + Region r1 = pageLayout.createRegion(RegionType.TextRegion); + Region r2 = pageLayout.createRegion(RegionType.ChartRegion); + Region r3 = pageLayout.createRegion(RegionType.TextRegion, null, r2); + Region r4 = pageLayout.createRegion(RegionType.TextRegion, null, r2); + Region r5 = pageLayout.createRegion(RegionType.MusicRegion); + Region r6 = pageLayout.createRegion(RegionType.TextRegion, null, r5); + + //Use iterator factory + ContentIterator it = pageLayout.iterator(null); + + assertTrue("Iterator created", it != null && it instanceof RegionIterator); + + assertTrue("Region 1", it.hasNext() && it.next() == r1); + assertTrue("Region 2", it.hasNext() && it.next() == r2); + assertTrue("Region 3", it.hasNext() && it.next() == r3); + assertTrue("Region 4", it.hasNext() && it.next() == r4); + assertTrue("Region 5", it.hasNext() && it.next() == r5); + assertTrue("Region 6", it.hasNext() && it.next() == r6); + assertFalse("End", it.hasNext()); + + //Region type + it = new RegionIterator(pageLayout, RegionType.TextRegion, null); + + assertTrue("Region iterator with type filter created", it != null && it instanceof RegionIterator); + + assertTrue("Text region 1", it.hasNext() && it.next() == r1); + assertTrue("Text region 3", it.hasNext() && it.next() == r3); + assertTrue("Text region 4", it.hasNext() && it.next() == r4); + assertTrue("Text region 6", it.hasNext() && it.next() == r6); + assertFalse("End iterator with type filter", it.hasNext()); + + //Layer + pageLayout.createLayers(); + Layer layer = pageLayout.getLayers().createLayer(); + layer.addRegionRef(r2.getId().toString()); + layer.addRegionRef(r4.getId().toString()); + layer.addRegionRef(r5.getId().toString()); + + it = new RegionIterator(pageLayout, null, layer); + + assertTrue("Region iterator with layer filter created", it != null && it instanceof RegionIterator); + + assertTrue("Region 2 (in layer)", it.hasNext() && it.next() == r2); + assertTrue("Region 4 (in layer)", it.hasNext() && it.next() == r4); + assertTrue("Region 5 (in layer)", it.hasNext() && it.next() == r5); + assertFalse("End iterator with layer filter", it.hasNext()); + + //Layer and region type + layer.removeRegionRef(r5.getId().toString()); + + it = new RegionIterator(pageLayout, RegionType.MusicRegion, layer); + + assertTrue("Region iterator with layer and type filter created", it != null && it instanceof RegionIterator); + + assertFalse("End iterator with layer and type filter", it.hasNext()); + } + + @SuppressWarnings("unused") + @Test + public void testTextLineIterator() { + //Create a few regions with text lines + Page page = new Page(); + PageLayout pageLayout = page.getLayout(); + TextRegion r1 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t11 = r1.createTextLine(); + Region r2 = pageLayout.createRegion(RegionType.ChartRegion); + TextRegion r3 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextRegion r4 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t41 = r4.createTextLine(); + TextLine t42 = r4.createTextLine(); + TextRegion r5 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t51 = r5.createTextLine(); + + //Use iterator factory + ContentIterator it = pageLayout.iterator(LowLevelTextType.TextLine); + + assertTrue("Iterator created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Line 11", it.hasNext() && it.next() == t11); + assertTrue("Line 41", it.hasNext() && it.next() == t41); + assertTrue("Line 42", it.hasNext() && it.next() == t42); + assertTrue("Line 51", it.hasNext() && it.next() == t51); + assertFalse("End", it.hasNext()); + + //Layer + pageLayout.createLayers(); + Layer layer = pageLayout.getLayers().createLayer(); + layer.addRegionRef(r2.getId().toString()); + layer.addRegionRef(r4.getId().toString()); + layer.addRegionRef(r5.getId().toString()); + + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.TextLine, layer); + + assertTrue("Text line iterator with layer filter created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Line 41 (in layer)", it.hasNext() && it.next() == t41); + assertTrue("Line 42 (in layer)", it.hasNext() && it.next() == t42); + assertTrue("Line 51 (in layer)", it.hasNext() && it.next() == t51); + assertFalse("End it with layer filter", it.hasNext()); + + //Layer (no matching region) + layer.removeRegionRef(r4.getId().toString()); + layer.removeRegionRef(r5.getId().toString()); + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.TextLine, layer); + assertTrue("Text line iterator with layer filter created (no match)", it != null && it instanceof LowLevelTextObjectIterator); + assertFalse("End it with layer filter (no match)", it.hasNext()); + } + + @SuppressWarnings("unused") + @Test + public void testTextLineIteratorWithNesting() { + //Create a few regions with text lines: tr1, cr2 (tr3,tr4), tr5 (tr6) + Page page = new Page(); + PageLayout pageLayout = page.getLayout(); + TextRegion r1 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t11 = r1.createTextLine(); + + Region r2 = pageLayout.createRegion(RegionType.ChartRegion); + TextRegion r3 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r2); + TextRegion r4 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r2); + TextLine t41 = r4.createTextLine(); + TextLine t42 = r4.createTextLine(); + + TextRegion r5 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextRegion r6 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r5); + TextLine t61 = r6.createTextLine(); + + //Use iterator factory + ContentIterator it = pageLayout.iterator(LowLevelTextType.TextLine); + + assertTrue("Iterator created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Line 11", it.hasNext() && it.next() == t11); + assertTrue("Line 41", it.hasNext() && it.next() == t41); + assertTrue("Line 42", it.hasNext() && it.next() == t42); + assertTrue("Line 51", it.hasNext() && it.next() == t61); + assertFalse("End", it.hasNext()); + + //Layer + pageLayout.createLayers(); + Layer layer = pageLayout.getLayers().createLayer(); + layer.addRegionRef(r2.getId().toString()); + layer.addRegionRef(r4.getId().toString()); + layer.addRegionRef(r5.getId().toString()); + + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.TextLine, layer); + + assertTrue("Text line iterator with layer filter created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Line 41 (in layer)", it.hasNext() && it.next() == t41); + assertTrue("Line 42 (in layer)", it.hasNext() && it.next() == t42); + assertFalse("End it with layer filter", it.hasNext()); + + //Layer (no matching region) + layer.removeRegionRef(r4.getId().toString()); + layer.removeRegionRef(r5.getId().toString()); + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.TextLine, layer); + assertTrue("Text line iterator with layer filter created (no match)", it != null && it instanceof LowLevelTextObjectIterator); + assertFalse("End it with layer filter (no match)", it.hasNext()); + } + + @SuppressWarnings("unused") + @Test + public void testWordIterator() { + //Create a few regions with text lines and words + Page page = new Page(); + PageLayout pageLayout = page.getLayout(); + TextRegion r1 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t11 = r1.createTextLine(); + Word w111 = t11.createWord(); + + Region r2 = pageLayout.createRegion(RegionType.ChartRegion); + + TextRegion r3 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + + TextRegion r4 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t41 = r4.createTextLine(); + Word w411 = t41.createWord(); + Word w412 = t41.createWord(); + TextLine t42 = r4.createTextLine(); + + TextRegion r5 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + + TextRegion r6 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t61 = r6.createTextLine(); + Word w611 = t61.createWord(); + + //Use iterator factory + ContentIterator it = pageLayout.iterator(LowLevelTextType.Word); + + assertTrue("Iterator created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Word 111", it.hasNext() && it.next() == w111); + assertTrue("Word 411", it.hasNext() && it.next() == w411); + assertTrue("Word 412", it.hasNext() && it.next() == w412); + assertTrue("Word 611", it.hasNext() && it.next() == w611); + assertFalse("End", it.hasNext()); + + //Layer + pageLayout.createLayers(); + Layer layer = pageLayout.getLayers().createLayer(); + layer.addRegionRef(r2.getId().toString()); + layer.addRegionRef(r4.getId().toString()); + layer.addRegionRef(r5.getId().toString()); + + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.Word, layer); + + assertTrue("Word iterator with layer filter created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Word 411 (in layer)", it.hasNext() && it.next() == w411); + assertTrue("Word 412 (in layer)", it.hasNext() && it.next() == w412); + assertFalse("End it with layer filter", it.hasNext()); + + //Layer (no matching region) + layer.removeRegionRef(r4.getId().toString()); + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.Word, layer); + assertTrue("Word iterator with layer filter created (no match)", it != null && it instanceof LowLevelTextObjectIterator); + assertFalse("End it with layer filter (no match)", it.hasNext()); + } + + @SuppressWarnings("unused") + @Test + public void testWordIteratorWithNesting() { + //Create a few regions with text lines and words: tr1, cr2 (tr3,tr4), tr5 (tr6) + Page page = new Page(); + PageLayout pageLayout = page.getLayout(); + TextRegion r1 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t11 = r1.createTextLine(); + Word w111 = t11.createWord(); + + Region r2 = pageLayout.createRegion(RegionType.ChartRegion); + + TextRegion r3 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r2); + + TextRegion r4 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r2); + TextLine t41 = r4.createTextLine(); + Word w411 = t41.createWord(); + Word w412 = t41.createWord(); + TextLine t42 = r4.createTextLine(); + + TextRegion r5 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + + TextRegion r6 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion, null, r5); + TextLine t61 = r6.createTextLine(); + Word w611 = t61.createWord(); + + //Use iterator factory + ContentIterator it = pageLayout.iterator(LowLevelTextType.Word); + + assertTrue("Iterator created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Word 111", it.hasNext() && it.next() == w111); + assertTrue("Word 411", it.hasNext() && it.next() == w411); + assertTrue("Word 412", it.hasNext() && it.next() == w412); + assertTrue("Word 611", it.hasNext() && it.next() == w611); + assertFalse("End", it.hasNext()); + + //Layer + pageLayout.createLayers(); + Layer layer = pageLayout.getLayers().createLayer(); + layer.addRegionRef(r2.getId().toString()); + layer.addRegionRef(r4.getId().toString()); + layer.addRegionRef(r5.getId().toString()); + + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.Word, layer); + + assertTrue("Word iterator with layer filter created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Word 411 (in layer)", it.hasNext() && it.next() == w411); + assertTrue("Word 412 (in layer)", it.hasNext() && it.next() == w412); + assertFalse("End it with layer filter", it.hasNext()); + + //Layer (no matching region) + layer.removeRegionRef(r4.getId().toString()); + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.Word, layer); + assertTrue("Word iterator with layer filter created (no match)", it != null && it instanceof LowLevelTextObjectIterator); + assertFalse("End it with layer filter (no match)", it.hasNext()); + } + + @SuppressWarnings("unused") + @Test + public void testGlyphIterator() { + //Create a few regions with text lines, words and glyphs + Page page = new Page(); + PageLayout pageLayout = page.getLayout(); + TextRegion r1 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t11 = r1.createTextLine(); + Word w111 = t11.createWord(); + Glyph g1111 = w111.createGlyph(); + + Region r2 = pageLayout.createRegion(RegionType.ChartRegion); + + TextRegion r3 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + + TextRegion r4 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t41 = r4.createTextLine(); + Word w411 = t41.createWord(); + Glyph g4111 = w411.createGlyph(); + Glyph g4112 = w411.createGlyph(); + Word w412 = t41.createWord(); + TextLine t42 = r4.createTextLine(); + + TextRegion r5 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + + TextRegion r6 = (TextRegion)pageLayout.createRegion(RegionType.TextRegion); + TextLine t61 = r6.createTextLine(); + Word w611 = t61.createWord(); + Glyph g6111 = w611.createGlyph(); + + //Use iterator factory + ContentIterator it = pageLayout.iterator(LowLevelTextType.Glyph); + + assertTrue("Iterator created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Glyph 1111", it.hasNext() && it.next() == g1111); + assertTrue("Glyph 4111", it.hasNext() && it.next() == g4111); + assertTrue("Glyph 4112", it.hasNext() && it.next() == g4112); + assertTrue("Glyph 6111", it.hasNext() && it.next() == g6111); + assertFalse("End", it.hasNext()); + + //Layer + pageLayout.createLayers(); + Layer layer = pageLayout.getLayers().createLayer(); + layer.addRegionRef(r2.getId().toString()); + layer.addRegionRef(r4.getId().toString()); + layer.addRegionRef(r5.getId().toString()); + + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.Glyph, layer); + + assertTrue("Glyph iterator with layer filter created", it != null && it instanceof LowLevelTextObjectIterator); + + assertTrue("Glyph 4111 (in layer)", it.hasNext() && it.next() == g4111); + assertTrue("Glyph 4112 (in layer)", it.hasNext() && it.next() == g4112); + assertFalse("End it with layer filter", it.hasNext()); + + //Layer (no matching region) + layer.removeRegionRef(r4.getId().toString()); + it = new LowLevelTextObjectIterator(pageLayout, LowLevelTextType.Glyph, layer); + assertTrue("Glyph iterator with layer filter created (no match)", it != null && it instanceof LowLevelTextObjectIterator); + assertFalse("End it with layer filter (no match)", it.hasNext()); + } +}