Package com.myscript.iink
Class ContentBlock
java.lang.Object
com.myscript.iink.ContentSelection
com.myscript.iink.ContentBlock
- All Implemented Interfaces:
AutoCloseable
Represents a block of content. The tree of content blocks provides the
hierarchical structure of a content part into semantic units.
-
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()protected voidfinalize()final @NotNull StringReturns the block's attributes as a JSON string.@NotNull RectanglegetBox()Returns the box that represents the position of this block.final @NotNull ContentBlock[]Returns the children of this block.@NotNull EnumSet<ConversionState>Returns the current conversion state of this block, as a set of ConversionState values.final @NotNull StringgetId()Returns the identifier of this block.final @Nullable ContentBlockReturns the parent of this block.final @NotNull StringReturns an identifier that can be used to match corresponding calls toICanvas.startGroup(String, float, float, float, float, boolean).final @NotNull StringgetType()Returns the type of this block.final booleanisClosed()Tells whether theclose()method has been called.final @NotNull StringtoString()Returns a String representation of the object.Methods inherited from class com.myscript.iink.ContentSelection
getPart, isValid
-
Method Details
-
finalize
- Overrides:
finalizein classContentSelection- Throws:
Throwable
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classContentSelection
-
isClosed
public final boolean isClosed()Tells whether theclose()method has been called. Once an object is closed any method will throwIllegalStateException.- Overrides:
isClosedin classContentSelection- Returns:
trueif this object is closed.
-
getType
Returns the type of this block.- Returns:
- the type name.
- Throws:
IllegalStateException- when this block is closed.IllegalStateException- when block is invalid.
-
getId
Returns the identifier of this block.- Returns:
- the identifier.
- Throws:
IllegalStateException- when this block is closed.IllegalStateException- when block is invalid.
-
getRenderingId
Returns an identifier that can be used to match corresponding calls toICanvas.startGroup(String, float, float, float, float, boolean).- Returns:
- the rendering identifier.
- Throws:
IllegalStateException- when this block is closed.IllegalStateException- when block is invalid.
-
getAttributes
Returns the block's attributes as a JSON string.- Returns:
- the attributes.
- Throws:
IllegalStateException- when this block is closed.IllegalStateException- when block is invalid.- Since:
- 1.1
-
getChildren
Returns the children of this block. The returned array is a copy of the list of child blocks, which makes it safe against concurrent changes.- Returns:
- an array of the child blocks.
- Throws:
IllegalStateException- when this block is closed.IllegalStateException- when block is invalid.
-
getParent
Returns the parent of this block.- Returns:
- the parent of this block, or
nullif this block is the root block. - Throws:
IllegalStateException- when this block is closed.IllegalStateException- when block is invalid.- Since:
- 1.4
-
getBox
Returns the box that represents the position of this block.- Returns:
- the block (document coordinates in mm).
- Throws:
IllegalStateException- when this block is closed.IllegalStateException- when block is invalid.
-
getConversionState
Returns the current conversion state of this block, as a set of ConversionState values.- Returns:
- the conversion state of this block.
- Throws:
IllegalStateException- when this block is closed.IllegalStateException- when block is invalid.
-
toString
Returns a String representation of the object.- Overrides:
toStringin classContentSelection- Returns:
- the representation of the object.
- Since:
- 2.1
-