public class TextReaderSettings extends Object implements ReaderSettings
TextReaderSettings
can be used to configure several parameters pertaining to
the text format.Modifier and Type | Field and Description |
---|---|
protected Dimension |
borderSize |
protected Charset |
charset |
static Charset |
DEFAULT_CHARSET
ISO-8859-1, used as default charset.
|
static String |
DEFAULT_CHARSET_NAME
ISO-8859-1, used as default charset name.
|
static Charset |
EBCDIC_CHARSET
EBCDIC charset.
|
static String |
EBCDIC_CHARSET_NAME
EBCDIC charset name.
|
Constructor and Description |
---|
TextReaderSettings() |
Modifier and Type | Method and Description |
---|---|
TextReaderSettings |
createSnapshot()
Create a snapshot copy of this instance.
|
void |
enableByteOrderMarkDetection(boolean enableByteOrderMarkDetection)
Enable / disable byte-order-mark (BOM) detection.
|
boolean |
equals(Object o) |
Dimension |
getBorderSize()
Returns the border size of the displayed text page.
|
Charset |
getCharSet()
Gets the
Charset to be used to read and write textual data. |
String |
getCharsetName()
Gets the
Charset name to be used to read and write textual data. |
int |
getCharsPerLine()
Returns the maximum number of characters per line.
|
float |
getFixedLineHeight()
If
useFixedLineHeight is enabled, this line height is used as a fixed height for each
line. |
TextFormat |
getFormat()
Return a text format configured with the current reader settings.
|
int |
getLinesPerPage()
Returns maximum lines per page.
|
int |
getResolution()
Returns the resolution (in dots per inch) to be used when displaying text pagesegments.
|
TextFont |
getTextFont()
Gets the
TextFont . |
char[] |
getTruncationChars()
Returns the characters displayed when text exceeds maximum characters per line
|
int |
hashCode() |
boolean |
isByteOrderMarkDetectionEnabled()
Returns the current byte-order-mark (BOM) detection flag.
|
boolean |
isPreformatted()
Returns an indicator whether the text content has a preformatted layout.
|
void |
setBorderSize(Dimension borderSize)
Changes the border size of the displayed text page.
|
void |
setCharset(Charset cSet)
Sets the charset used to read and write textual data.
|
void |
setCharsPerLine(int charsPerLine)
Changes the maximum number of characters per line.
|
void |
setFixedLineHeight(float fixedLineHeight)
If
useFixedLineHeight is enabled, this line height is used as a fixed height for each
line. |
void |
setLinesPerPage(int linesPerPage)
Changes the maximum number of lines per page.
|
void |
setPreformatted(boolean preformatted)
The preformatted property indicates whether the text content is preformatted.
|
void |
setResolution(int resolution)
Changes the resolution (in dots per inch) to be used when displaying text pagesegments.
|
void |
setTextFont(TextFont textFont)
Sets the
TextFont . |
void |
setTruncationChars(char[] truncationChars)
Sets the characters displayed when text exceeds maximum characters per line
|
void |
setTruncationChars(String truncationChars)
Works in the same way as
setTruncationChars(char[]) except that the
argument is a String . |
void |
setUseFixedLineHeight(boolean useFixedLineHeight)
Set to true if a fixed line height (
getFixedLineHeight() ) shall be used. |
boolean |
useFixedLineHeight()
Returns a boolean if a fixed line height (
getFixedLineHeight() ) shall be used. |
public static final String DEFAULT_CHARSET_NAME
public static final String EBCDIC_CHARSET_NAME
public static final Charset DEFAULT_CHARSET
public static final Charset EBCDIC_CHARSET
protected Dimension borderSize
protected Charset charset
public TextReaderSettings createSnapshot()
SerializableProcessingSettings
createSnapshot
in interface ProcessingSettings
createSnapshot
in interface SerializableProcessingSettings
public char[] getTruncationChars()
null
.public void setTruncationChars(char[] truncationChars)
the Default characters are "..." (three dots). When the characters are null then the truncationChars will be set empty.
truncationChars
- the characters displayed when text exceeds maximum characters per line.public void setTruncationChars(String truncationChars)
setTruncationChars(char[])
except that the
argument is a String
.setTruncationChars(char[])
public Dimension getBorderSize()
public Charset getCharSet()
Charset
to be used to read and write textual data.Charset
public String getCharsetName()
Charset
name to be used to read and write textual data.
Every implementation of the Java platform is required to support the following character encodings. Consult the release documentation for your java implementation to see if any other encodings are supported.
public int getCharsPerLine()
public int getLinesPerPage()
public TextFont getTextFont()
TextFont
.
This font will be used to display textual contents.
public void setTextFont(TextFont textFont)
TextFont
.
This font will be used to display textual contents.
textFont,
- the font used to display text. If null
is passed in, the default
font provided by TextFont.getDefaultTextFont()
is used.public void setBorderSize(Dimension borderSize)
null
a size of 0,0 is assumed.borderSize
- the borderSize to setpublic void setCharset(Charset cSet)
If the given charset parameter is null
the default charset ISO-8859-1
will be used instead.
cSet
- the requested charset. If cSet
is null
the
ISO-8859-1
charset will be used instead.public void setCharsPerLine(int charsPerLine)
The default value of this property is defined in the jadice configuration by the key jadice.viewer.ASCII-text.maxCharsPerLine. If this preference is not set, 500 is assumed as default value.
Setting this value have to be done before the text data will be loaded. All changes after the loading process will be ignored.
charsPerLine
- maximum number of characters per line. Positive values greater than or equal
to 1
and smaller than 500
are accepted. Negative values or
0
are assumed as 1
. Positive values greater than
500
are assumed as 500
.public void setLinesPerPage(int linesPerPage)
The default value of this property is defined in the jadice configuration by the key jadice.viewer.ASCII-text.maxLinesPerPage. If this preference is not set, 60 is assumed as default value.
Setting this value have to be done before the text data will be loaded. All changes after the loading process will be ignored.
linesPerPage
- maximum number of lines per page. Positive values greater than or equal to
1
and smaller than 1000
are accepted. Negative values or
0
are assumed as 1
. Positive values greater than
1000
are assumed as 1000
.public boolean isPreformatted()
public void setPreformatted(boolean preformatted)
false
.
If the text content is marked as preformatted, the text content functionalities, such as text
selection, will respect the text layout and preserves white spaces. If set to false
,
which is the default value, the text content functionalities analyze the content and tries to
recognize words, lines and blocks. In this case whitespaces may be lost.
public TextFormat getFormat()
public boolean useFixedLineHeight()
getFixedLineHeight()
) shall be used.setFixedLineHeight(float)
,
getFixedLineHeight()
public void setUseFixedLineHeight(boolean useFixedLineHeight)
getFixedLineHeight()
) shall be used.setFixedLineHeight(float)
,
getFixedLineHeight()
public float getFixedLineHeight()
useFixedLineHeight
is enabled, this line height is used as a fixed height for each
line. Returns the fixedLineHeight.public void setFixedLineHeight(float fixedLineHeight) throws IllegalArgumentException
useFixedLineHeight
is enabled, this line height is used as a fixed height for each
line. The height may not be smaller than 0. If so an IllegalArgumentException is thrown. If the
height is smaller than the font-size, letters may overlap.IllegalArgumentException
- if the fixedLineHeight is smaller than 0public void enableByteOrderMarkDetection(boolean enableByteOrderMarkDetection)
A BOM match will override the character set definition.
BOM detection is enabled by default.
enableByteOrderMarkDetection
- Flag to enable / disable byte-order-mark (BOM) detectionpublic boolean isByteOrderMarkDetectionEnabled()
public int getResolution()
public void setResolution(int resolution)
Copyright © 2024 levigo holding gmbh. All rights reserved.