public class TextLines extends Object
| Modifier and Type | Field and Description |
|---|---|
Map<Integer,int[][]> |
areas
Highlight Areas stored here
|
| Constructor and Description |
|---|
TextLines() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHighlights(int[][] highlights,
boolean areaSelect,
int page)
Method to highlight text on page.
|
void |
addToLineAreas(int[] area,
int writingMode,
int page) |
void |
clearHighlights()
Clear all highlights that are being displayed
|
Map |
getAllHighlights()
Get all the highlights currently stored.
|
int[][] |
getHighlightableInArea(int[] highlights,
boolean areaSelect,
int page) |
int[][] |
getHighlightedAreasAs2DArray(int page)
Creates a two-dimensional int array containing x,y,width and height
values for each rectangle that is stored in the localAreas map,
which allows us to create a swing/fx rectangle on these values.
|
int[][] |
getLineAreasAs2DArray(int page)
Creates a two-dimensional int array containing x,y,width and height
values for each rectangle that is stored in the localLineAreas map,
which allows us to create a swing/fx rectangle on these values.
|
int[] |
getLineWritingMode(int page) |
boolean |
hasHighlightAreasUpdated() |
static boolean |
intersects(int[] paramsOne,
int[] paramsTwo)
Checks whether two rectangles intersect
Takes the raw x,y,w,h data of the rectangles in array form.
|
void |
removeFoundTextArea(int[] rectArea,
int page)
remove zone on page for text localAreas if present
|
void |
removeFoundTextAreas(int[][] rectArea,
int page)
remove highlight zones on page for text localAreas on single pages null value will totally reset
|
int[] |
setFoundParagraphAsArray(int x,
int y,
int page)
Highlights a section of lines that form a paragraph and
returns the area that encloses all highlight localAreas.
|
void |
setLineAreas(Map<Integer,int[][]> la) |
void |
setLineWritingMode(Map<Integer,int[]> lineOrientation) |
public int[] setFoundParagraphAsArray(int x,
int y,
int page)
x - Coord x value to begin looking for a paragraphy - Coord y value to begin looking for a paragraphpage - Page number of page to look for a paragraph onpublic void addToLineAreas(int[] area,
int writingMode,
int page)
public void removeFoundTextArea(int[] rectArea,
int page)
rectArea - Text area to removepage - Page to check for these localAreaspublic void removeFoundTextAreas(int[][] rectArea,
int page)
rectArea - Text localAreas to removepage - Page to check for these localAreaspublic void clearHighlights()
public void addHighlights(int[][] highlights,
boolean areaSelect,
int page)
If areaSelect = true then the Rectangle array will be highlgihted on screen unmodified. areaSelect should be true if being when used with values returned from the search as these localAreas are already corrected and modified for display.
If areaSelect = false then all lines between the top left point and bottom right point will be selected including two partial lines the top line starting from the top left point of the rectangle and the bottom line ending at the bottom right point of the rectangle.
highlights - :: The 2DArray contains the raw x,y,w,h params of a set of rectangles that you wish to have highlightedareaSelect - :: The flag that will either select text as line between points if false or characters within an area if true.page - :: The page to add highlights to.public int[][] getHighlightableInArea(int[] highlights,
boolean areaSelect,
int page)
public boolean hasHighlightAreasUpdated()
public Map getAllHighlights()
public int[][] getHighlightedAreasAs2DArray(int page)
page - of type int.public int[][] getLineAreasAs2DArray(int page)
page - of type int.public int[] getLineWritingMode(int page)
public static boolean intersects(int[] paramsOne,
int[] paramsTwo)
paramsOne - paramsTwo - Copyright © 2017. All rights reserved.