public class LayoutAnalyzer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LayoutAnalyzer.LayoutType |
protected class |
LayoutAnalyzer.ListInfo |
protected class |
LayoutAnalyzer.TableInfo |
Constructor and Description |
---|
LayoutAnalyzer(AreaTree atree) |
Modifier and Type | Method and Description |
---|---|
protected LayoutAnalyzer.TableInfo |
collectTableStats(Area parent,
java.util.List<Area> nodes,
int startchild,
boolean check) |
protected int |
countValidColumns(int[] cols,
int min1,
int min2)
Counts valid columns detected in the table.
|
LayoutAnalyzer.LayoutType |
detectLayoutType(Area area)
Detects the layout type of the given area.
|
int |
findListEnd(Area area,
java.util.List<Area> nodes,
int startchild)
If a list starts at the specified child index of the area, tries to detect
the end of the list.
|
int |
findTableEnd(Area area,
java.util.List<Area> nodes,
int startchild)
If a table starts at the specified child index of the area, tries to detect
the end of the table.
|
protected int[] |
findTableGridPositions(LayoutAnalyzer.TableInfo stat) |
protected boolean |
isList(Area area,
java.util.List<Area> nodes,
int startchild) |
protected boolean |
isTable(Area area,
java.util.List<Area> nodes,
int startchild) |
protected boolean |
isValidTable(LayoutAnalyzer.TableInfo stat)
Checks if the whole table is acceptable.
|
protected boolean |
isValidTableStart(LayoutAnalyzer.TableInfo stat)
Checks if this is an acceptable beginning of a table
|
protected AreaTree atree
public LayoutAnalyzer(AreaTree atree)
public LayoutAnalyzer.LayoutType detectLayoutType(Area area)
area
- public int findTableEnd(Area area, java.util.List<Area> nodes, int startchild)
area
- The area where the table is placed.nodes
- The child areas of the area that should be taken into account.startchild
- The first child index that forms the table.protected int[] findTableGridPositions(LayoutAnalyzer.TableInfo stat)
protected LayoutAnalyzer.TableInfo collectTableStats(Area parent, java.util.List<Area> nodes, int startchild, boolean check)
protected boolean isValidTable(LayoutAnalyzer.TableInfo stat)
stat
- protected boolean isValidTableStart(LayoutAnalyzer.TableInfo stat)
stat
- protected int countValidColumns(int[] cols, int min1, int min2)
cols
- The column occurence countsmin1
- Minimal number of occurences to consider the first column to be validmin2
- Minimal number of occurences to consider the remaining columns to be validpublic int findListEnd(Area area, java.util.List<Area> nodes, int startchild)
area
- The area where the list is placed.nodes
- The child areas of the area that should be taken into account.startchild
- The first child index that forms the list.