public class XprEntity
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ANY_CHAR_BUT_DIGIT
Pattern matches string as containing any char except digit.
|
private int |
bgColor
Background color for filled rectangles.
|
private java.util.Map<java.lang.String,XprObjBookmark> |
bkmks
Separate list of bookmark objects in use.
|
private double |
charsPerInch
Current characters per inch value (default is 10).
|
private double |
colCurr
Current column value in new entity.
|
private double |
colFrom
Column value for FROM tag.
|
static double |
CPI_DEFAULT
Default CPI value for screen report.
|
private java.lang.String |
currFontName
Current font name (default is 'Courier New').
|
private static java.lang.String |
DECIMAL_DIGIT
Pattern matches string as containing only digits, allowing decimal one.
|
static int |
DPI_PDF_DEFAULT
Default DPI value for PDF images rendering.
|
private double |
dpiScalingFactor
Device independent DPI scaling factor
|
private int |
fgColor
Foreground color for text.
|
private static java.lang.String |
FONT_NAME_DEFAULT
Font name default value for XPR.
|
private static int |
FONT_SIZE_DEFAULT
Font size default value for XPR.
|
private static java.lang.String |
GT_AS_TEXT
Constant to replace temporary substitution for gt char.
|
private static java.lang.String |
GT_IN_TEXT
This string to be considered as text, not a tag end.
|
private static java.lang.String |
GT_IN_TEXT_SUBST
Constant to temporary replace gt char in text for the time of tags processing.
|
static double |
INCH_2_MM
Inch to mm transformation.
|
private static java.lang.String |
INTEGER_DIGIT
Pattern matches string as containing only integer digits.
|
private boolean |
isBoldFont
Flag indicating if the font is currently bold or not.
|
private boolean |
isItalicFont
Flag indicating if the font is currently italic or not.
|
private double |
leftMargin
Column value for LEFT tag.
|
private int |
lineColor
Line color for lines, rectangles and border of the filled rectangles.
|
private double |
linesPerInch
Current lines per inch value (default is 6).
|
private double |
linesPerInchSaved
Previously saved lines per inch value (default is not saved).
|
private int |
lineWidth
Current line width value.
|
private static java.lang.String |
LPI_AS_TEXT
LPI identifier as tag value part.
|
static double |
LPI_DEFAULT
Default LPI value for screen report.
|
private static java.lang.String |
LT_AS_TEXT
Constant to replace temporary substitution for lt char
|
private static java.lang.String |
LT_IN_TEXT
This string to be considered as text, not a tag start.
|
private static java.lang.String |
LT_IN_TEXT_SUBST
Constant to temporary replace lt char in text for the time of tags processing.
|
private boolean |
noModal
The value of the per document MODAL mode tag.
|
private boolean |
noProgressStyle
The value of the per document PROGRESS line style tag.
|
private int |
numCopies
Number of copies (single by default).
|
private java.util.List<java.util.List<java.lang.String>> |
origPagesBuffer
Original data from source file as array of pages.
|
private static java.lang.String |
PAGE_SEPARATOR
Page separator marker.
|
private java.util.List<XprPageOptions> |
pageOptions
New page specific options.
|
private int |
pageOrientation
Current page orientation.
|
private java.util.List<java.util.List<XprObjBase>> |
pages
The Z-ordered list of the objects recognized inside current file entity, paginated.
|
private int |
parSize
Current font size (default is 12).
|
private boolean |
preview
The value of the per document PREVIEW tag.
|
private double |
rowCurr
Current row value in new entity.
|
private double |
rowFrom
Row value for FROM tag.
|
private static java.lang.String |
TAG_VALUE_ERROR
Page separator marker.
|
private double |
topMargin
Raw value for TOP tag.
|
private int |
units
Base units type, inches or mm.
|
private static int |
UNITS_INCHES
Base units is inches constant.
|
private static int |
UNITS_MM
Base units is mm constant.
|
private static java.util.Map<java.lang.String,ColorRgb> |
xprPalette
Enhanced vpxPrint color palette.
|
Constructor and Description |
---|
XprEntity(java.io.Reader xprFileReader)
Creates new instance of the object for given file object.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
findSingleTag(java.lang.String tagToSearch)
Gets the line for the given single tag.
|
private int |
getColorFromTag(java.lang.String tagValue)
Extract the color nalue from the given tag value.
|
private java.lang.String |
getNextTagOrTextInLine(java.lang.String lineToScan)
Gets the next tag value or text part for the given text line.
|
java.util.List<XprObjBase> |
getObjectsInPage(int pageNum)
Getting internal object list from XPR object for particular page.
|
int |
getPageHeight(int pageNum)
Getting the page height for given page numbers.
|
int |
getPageWidth(int pageNum)
Getting the page width for given page numbers.
|
private java.lang.String |
getSingleTagValue(java.lang.String tagToSearch)
Gets the single tag value for the given line.
|
private java.lang.String |
getTagValue(java.lang.String fullTag,
java.lang.String tagMatch)
Gets the tag value for the given full tag string.
|
int |
getTotalPageNumbers()
Getting total number of pages in document.
|
void |
init()
Setting up internal object of this entity.
|
private boolean |
initGlobals()
Initializes global variables.
|
private boolean |
initObjects()
Initializes internal objets for this XPR entity.
|
private void |
resetInitials()
Resets current variables to initial values.
|
private boolean |
tagMatch(java.lang.String textToScan,
java.lang.String tag)
Calculate if the given text match the tag value provided.
|
public static final double LPI_DEFAULT
public static final double CPI_DEFAULT
public static final int DPI_PDF_DEFAULT
private static final int UNITS_INCHES
private static final int UNITS_MM
public static final double INCH_2_MM
private static final int FONT_SIZE_DEFAULT
private static final java.lang.String FONT_NAME_DEFAULT
private static final java.lang.String PAGE_SEPARATOR
private static final java.lang.String TAG_VALUE_ERROR
private static final java.lang.String LT_IN_TEXT
private static final java.lang.String LT_AS_TEXT
private static final java.lang.String LT_IN_TEXT_SUBST
private static final java.lang.String GT_IN_TEXT
private static final java.lang.String GT_AS_TEXT
private static final java.lang.String GT_IN_TEXT_SUBST
private static final java.lang.String DECIMAL_DIGIT
private static final java.lang.String INTEGER_DIGIT
private static final java.lang.String ANY_CHAR_BUT_DIGIT
private static final java.lang.String LPI_AS_TEXT
private java.util.List<java.util.List<java.lang.String>> origPagesBuffer
private java.util.List<java.util.List<XprObjBase>> pages
private java.util.List<XprPageOptions> pageOptions
private java.util.Map<java.lang.String,XprObjBookmark> bkmks
private static java.util.Map<java.lang.String,ColorRgb> xprPalette
private boolean preview
private boolean noModal
private boolean noProgressStyle
private int numCopies
private double colCurr
private double rowCurr
private double colFrom
private double rowFrom
private double leftMargin
private double topMargin
private int lineWidth
private java.lang.String currFontName
private int parSize
private double linesPerInch
private double linesPerInchSaved
private double charsPerInch
private boolean isBoldFont
private boolean isItalicFont
private int bgColor
private int fgColor
private int lineColor
private int units
private double dpiScalingFactor
private int pageOrientation
public XprEntity(java.io.Reader xprFileReader) throws java.io.IOException
xprFileReader
- The XPR file object reader to process.java.io.IOException
public void init()
private boolean initObjects()
TRUE
if success, FALSE
otherwise.public java.util.List<XprObjBase> getObjectsInPage(int pageNum)
pageNum
- 0 based page number for objects to get.public int getTotalPageNumbers()
public int getPageWidth(int pageNum)
pageNum
- 0 based page number for option to get.public int getPageHeight(int pageNum)
pageNum
- 0 based page number for option to get.private boolean initGlobals()
TRUE
if success, FALSE
otherwise.private boolean findSingleTag(java.lang.String tagToSearch)
tagToSearch
- The tag to look for in whole lines buffer.TRUE
if tag has been found, FALSE
otherwise.private java.lang.String getNextTagOrTextInLine(java.lang.String lineToScan)
lineToScan
- The text line to search.NULL
in case of empty string.private java.lang.String getSingleTagValue(java.lang.String tagToSearch)
tagToSearch
- The tag to search.private java.lang.String getTagValue(java.lang.String fullTag, java.lang.String tagMatch)
fullTag
- The full tag text including braces enclosed (<...>).tagMatch
- The tag used to locate this entry.private int getColorFromTag(java.lang.String tagValue)
tagValue
- The tag value to check without tag start and end markers.private void resetInitials()
private boolean tagMatch(java.lang.String textToScan, java.lang.String tag)
textToScan
- The text to compute tag matching.tag
- The uppercased tag value to find within text.TRUE
if tag found, FALSE
otherwise.