Class BlockContentManager
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.row.AbstractBlockContentManager
-
- org.daisy.dotify.formatter.impl.row.BlockContentManager
-
- All Implemented Interfaces:
BlockStatistics
public class BlockContentManager extends AbstractBlockContentManager
BlockHandler is responsible for breaking blocks of text into rows. BlockProperties such as list numbers, leaders and margins are resolved in the process. The input text is filtered using the supplied StringFilter before breaking into rows, since the length of the text could change.
-
-
Constructor Summary
Constructors Constructor Description BlockContentManager(String blockId, int flowWidth, List<Segment> segments, RowDataProperties rdp, CrossReferenceHandler refs, DefaultContext context, FormatterCoreContext fcontext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractBlockContentManager
copy()
int
getForceBreakCount()
Gets the number of forced line breaks.List<String>
getGroupAnchors()
List<String>
getGroupIdentifiers()
List<Marker>
getGroupMarkers()
Get markers that are not attached to a row, i.e.Optional<RowImpl>
getNext(LineProperties lineProps)
int
getRowCount()
Gets the number of rows produced.boolean
hasNext()
Returns true if the manager has more rows.boolean
hasSignificantContent()
Returns true if the manager has some "significant" content.void
reset()
Resets the state of the content manager to the first row.void
setContext(DefaultContext context)
boolean
supportsVariableWidth()
Returns true if this manager supports rows with variable maximum width, false otherwise.-
Methods inherited from class org.daisy.dotify.formatter.impl.row.AbstractBlockContentManager
getCollapsiblePreContentRows, getInnerPreContentRows, getLeftMarginParent, getMinimumAvailableWidth, getNext, getPostContentRows, getRightMarginParent, getSkippablePostContentRows, hasCollapsiblePreContentRows, hasInnerPreContentRows, hasPostContentRows, hasSkippablePostContentRows
-
-
-
-
Constructor Detail
-
BlockContentManager
public BlockContentManager(String blockId, int flowWidth, List<Segment> segments, RowDataProperties rdp, CrossReferenceHandler refs, DefaultContext context, FormatterCoreContext fcontext)
-
-
Method Detail
-
setContext
public void setContext(DefaultContext context)
- Specified by:
setContext
in classAbstractBlockContentManager
-
copy
public AbstractBlockContentManager copy()
- Specified by:
copy
in classAbstractBlockContentManager
-
getRowCount
public int getRowCount()
Description copied from interface:BlockStatistics
Gets the number of rows produced.- Returns:
- the number of rows produced
-
supportsVariableWidth
public boolean supportsVariableWidth()
Description copied from class:AbstractBlockContentManager
Returns true if this manager supports rows with variable maximum width, false otherwise.- Specified by:
supportsVariableWidth
in classAbstractBlockContentManager
- Returns:
- true if variable maximum width is supported, false otherwise
-
reset
public void reset()
Description copied from class:AbstractBlockContentManager
Resets the state of the content manager to the first row.- Specified by:
reset
in classAbstractBlockContentManager
-
hasNext
public boolean hasNext()
Description copied from class:AbstractBlockContentManager
Returns true if the manager has more rows.- Specified by:
hasNext
in classAbstractBlockContentManager
- Returns:
- returns true if there are more rows, false otherwise
-
getNext
public Optional<RowImpl> getNext(LineProperties lineProps)
- Specified by:
getNext
in classAbstractBlockContentManager
-
getForceBreakCount
public int getForceBreakCount()
Description copied from interface:BlockStatistics
Gets the number of forced line breaks.- Returns:
- the number of forced line breaks
-
getGroupMarkers
public List<Marker> getGroupMarkers()
Description copied from class:AbstractBlockContentManager
Get markers that are not attached to a row, i.e. markers that proceeds any text contents- Specified by:
getGroupMarkers
in classAbstractBlockContentManager
- Returns:
- returns markers that proceeds this FlowGroups text contents
-
getGroupAnchors
public List<String> getGroupAnchors()
- Specified by:
getGroupAnchors
in classAbstractBlockContentManager
-
getGroupIdentifiers
public List<String> getGroupIdentifiers()
- Specified by:
getGroupIdentifiers
in classAbstractBlockContentManager
-
hasSignificantContent
public boolean hasSignificantContent()
Description copied from class:AbstractBlockContentManager
Returns true if the manager has some "significant" content.- Specified by:
hasSignificantContent
in classAbstractBlockContentManager
- Returns:
- returns true if there is significant content, false otherwise.
-
-