org.icepdf.core.pobjects.graphics.text
Class LineText

java.lang.Object
  extended by org.icepdf.core.pobjects.graphics.text.AbstractText
      extended by org.icepdf.core.pobjects.graphics.text.LineText
All Implemented Interfaces:
Text, TextSelect

public class LineText
extends AbstractText
implements TextSelect

Line text is make up WordText objects. This structure is to aid the the identification of words for text extraction, searching and selecting.

Since:
4.0

Field Summary
 
Fields inherited from class org.icepdf.core.pobjects.graphics.text.AbstractText
bounds, hasHighlight, hasSelected, highlight, selected
 
Constructor Summary
LineText()
           
 
Method Summary
 void addAll(java.util.List<WordText> words)
           
protected  void addText(GlyphText sprite)
          Add the sprite to the current word in this line/sentence.
 void clearHighlighted()
          Dehighlights all text in the line; all word and glyph children.
 void clearSelected()
          Deselects all text in this line; all word and glyph children.
 java.awt.geom.Rectangle2D.Float getBounds()
          Gets the bounds of the respective text object.
 java.lang.StringBuilder getSelected()
          Interates over child elements getting the selected text as defined by the child glyphs unicode value.
 java.util.List<WordText> getWords()
          Gets the words that make up this line.
 void selectAll()
          Select all text in this line; all word and glyph children.
protected  void setWords(java.util.List<WordText> words)
           
 java.lang.String toString()
           
 
Methods inherited from class org.icepdf.core.pobjects.graphics.text.AbstractText
clearBounds, hasHighligh, hasSelected, intersects, isHighlighted, isSelected, setHasHighlight, setHasSelected, setHighlighted, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineText

public LineText()
Method Detail

getBounds

public java.awt.geom.Rectangle2D.Float getBounds()
Description copied from class: AbstractText
Gets the bounds of the respective text object.

Specified by:
getBounds in interface Text
Specified by:
getBounds in class AbstractText
Returns:
bounds of text object.

addText

protected void addText(GlyphText sprite)
Add the sprite to the current word in this line/sentence. This method also candles white space detection and word division.

Parameters:
sprite - sprite to add to line.

addAll

public void addAll(java.util.List<WordText> words)

setWords

protected void setWords(java.util.List<WordText> words)

getWords

public java.util.List<WordText> getWords()
Gets the words that make up this line.

Returns:
words in a line.

selectAll

public void selectAll()
Select all text in this line; all word and glyph children.

Specified by:
selectAll in interface TextSelect

clearSelected

public void clearSelected()
Deselects all text in this line; all word and glyph children.

Specified by:
clearSelected in interface TextSelect

clearHighlighted

public void clearHighlighted()
Dehighlights all text in the line; all word and glyph children.

Specified by:
clearHighlighted in interface TextSelect

getSelected

public java.lang.StringBuilder getSelected()
Interates over child elements getting the selected text as defined by the child glyphs unicode value. Line breaks and spaces are preserved where possible.

Specified by:
getSelected in interface TextSelect
Returns:
StringBuffer of selected text in this line.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object