|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.text.line.LineBreaker
org.foray.text.line.EagerLineBreaker
org.foray.text.line.solitary.SolitaryLineBreaker
public class SolitaryLineBreaker
An "eager" line-breaking implementaton which considers only the current line in the line-breaking computation (hence the name "solitary"). It look neither forward nor backward in its computation, but merely attempts to find the best break that it can for the current line.
Field Summary | |
---|---|
protected static byte |
CONNECTOR
Possible value for previousCharacter , indicating that the
previous character was an interword connectors, like whitespace or a
hyphen. |
protected static byte |
NOTHING
Possible value for previousCharacter , indicating that there
was no previous character. |
protected static byte |
TEXT
Possible value for previousCharacter , indicating that the
previous character was text within a "word". |
Constructor Summary | |
---|---|
SolitaryLineBreaker(TextServer4a server,
org.axsl.text.line.LineBreakControl control,
org.axsl.text.line.LineBreakHandler handler,
org.axsl.font.FontConsumer fontConsumer)
Constructor. |
Method Summary | |
---|---|
protected int |
processLineText(org.axsl.text.line.LineText lineText,
int start,
int end)
Processes a line-text item. |
int |
tryHyphenation()
Extracts a word for hyphenation and calls the hyphenation package. |
Methods inherited from class org.foray.text.line.EagerLineBreaker |
---|
addLineContent, getCurrentLine, getLineContent, lineReceivingContent, overflowMessage, processInput, processLineContent, processLineNonText, setCurrentLine |
Methods inherited from class org.foray.text.line.LineBreaker |
---|
allowsLineBreak, canBreakMidWord, charWidth, forcesLineBreak, getCharWidth, getFontConsumer, getHandler, getHyphenWidth, getLineBreakControl, getLogger, getTextServer, getWordWidth, isInLowerCase, isLowerCase, isNonBreakingSpace, isSpace, isUpperCase, isWhitespace, isZeroWidthSpace, setInLowerCase |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final byte NOTHING
previousCharacter
, indicating that there
was no previous character.
protected static final byte CONNECTOR
previousCharacter
, indicating that the
previous character was an interword connectors, like whitespace or a
hyphen.
protected static final byte TEXT
previousCharacter
, indicating that the
previous character was text within a "word".
Constructor Detail |
---|
public SolitaryLineBreaker(TextServer4a server, org.axsl.text.line.LineBreakControl control, org.axsl.text.line.LineBreakHandler handler, org.axsl.font.FontConsumer fontConsumer)
server
- The "parent" TextServer.control
- The client object that provides process-time information,
specifically by providing line length information.handler
- The client object that is responsible for taking the
results of the line-breaking work and doing something with it.fontConsumer
- Provides the line-breaking system with the
FontConsumer instance that should be used for interfacing with the Font
subsystem.Method Detail |
---|
protected int processLineText(org.axsl.text.line.LineText lineText, int start, int end) throws org.axsl.text.TextException
EagerLineBreaker
processLineText
in class EagerLineBreaker
lineText
- The line-text item to be processed.start
- The index to the first character in the line-text item that
should be processed.end
- The index to the last character in the line-text item that
should be processed.
org.axsl.text.TextException
- For errors during line-breaking.public int tryHyphenation() throws org.axsl.text.TextException
org.axsl.text.TextException
- For errors during the hyphenation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |