com.lizardtech.djvu.text
Class DjVuText.Zone

java.lang.Object
  extended by com.lizardtech.djvu.DjVuObject
      extended by com.lizardtech.djvu.GRect
          extended by com.lizardtech.djvu.text.DjVuText.Zone
All Implemented Interfaces:
DjVuInterface, java.lang.Cloneable
Enclosing class:
DjVuText

public static class DjVuText.Zone
extends GRect

Data structure representing document textual components. The text structure is represented by a hierarchy of rectangular zones.


Field Summary
 boolean add_separators
          Controls whether separators are added between lexical elements.
 java.util.Vector children
          List of children zone.
 int text_length
          Length of the zone text in substring textByteArray.
 int text_start
          Position of the zone text in substring textByteArray.
 int ztype
          Type of the zone.
 
Fields inherited from class com.lizardtech.djvu.GRect
xmax, xmin, ymax, ymin
 
Fields inherited from class com.lizardtech.djvu.DjVuObject
hasReferences
 
Constructor Summary
DjVuText.Zone()
          Creates a new Zone object.
 
Method Summary
 DjVuText.Zone append_child()
          Appends another subzone inside this zone.
 void append_zones(java.util.Vector list, int start, int end)
          Find the zones used by the specified substring and append them to the list.
 DjVuText.Zone get_parent()
          Find out this Zone's parent.
 void get_smallest(java.util.Vector list)
          Finds the smallest rectangles and appends them to the list.
 void get_smallest(java.util.Vector list, int padding)
          Finds the smallest rectangles and appends them to the list after padding the smallest unit to fit width or height for the parent rectangle and adding the number of specified pixels.
 void get_text_with_rect(GRect box, NumContext byteArray_start, NumContext byteArray_end)
          Find the text_start and text_end indicated by the given box.
 
Methods inherited from class com.lizardtech.djvu.GRect
area, clear, clone, contains, contains, equals, height, inflate, intersect, isEmpty, recthull, translate, width
 
Methods inherited from class com.lizardtech.djvu.DjVuObject
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, setDjVuOptions
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

public java.util.Vector children
List of children zone.


add_separators

public boolean add_separators
Controls whether separators are added between lexical elements. This is included to handle differences in languages. In English, for example, words are separated by spaces and when searching, the spaces are significant. In Japanese, there are no spaces and words may also be broken between lines. We would expect add_separators to be true for English (default) and false for Japanese.


text_length

public int text_length
Length of the zone text in substring textByteArray.


text_start

public int text_start
Position of the zone text in substring textByteArray.


ztype

public int ztype
Type of the zone.

Constructor Detail

DjVuText.Zone

public DjVuText.Zone()
Creates a new Zone object.

Method Detail

append_child

public DjVuText.Zone append_child()
Appends another subzone inside this zone. The new zone is initialized with an empty rectangle, empty text, and has the same type as this zone.

Returns:
DOCUMENT ME!

append_zones

public void append_zones(java.util.Vector list,
                         int start,
                         int end)
Find the zones used by the specified substring and append them to the list.

Parameters:
list - vector to append zones to
start - byte position to list
end - byte position to list

get_parent

public DjVuText.Zone get_parent()
Find out this Zone's parent.

Returns:
the parent Zone

get_smallest

public void get_smallest(java.util.Vector list)
Finds the smallest rectangles and appends them to the list.

Parameters:
list - vector to append zones to

get_smallest

public void get_smallest(java.util.Vector list,
                         int padding)
Finds the smallest rectangles and appends them to the list after padding the smallest unit to fit width or height for the parent rectangle and adding the number of specified pixels.

Parameters:
list - vector to append zones to
padding - number of pixels to expand each zone by

get_text_with_rect

public void get_text_with_rect(GRect box,
                               NumContext byteArray_start,
                               NumContext byteArray_end)
Find the text_start and text_end indicated by the given box.

Parameters:
box - DOCUMENT ME!
byteArray_start - DOCUMENT ME!
byteArray_end - DOCUMENT ME!