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 void
close()
protected void
finalize()
final @NotNull String
Returns the block's attributes as a JSON string.final @NotNull ContentBlock[]
Returns the children of this block.final @NotNull String
getId()
Returns the identifier of this block.final @Nullable ContentBlock
Returns the parent of this block.final @NotNull String
Returns an identifier that can be used to match corresponding calls toICanvas.startGroup(String, float, float, float, float, boolean)
.final @NotNull String
getType()
Returns the type of this block.final boolean
isClosed()
Tells whether theclose()
method has been called.final @NotNull String
toString()
Returns a String representation of the object.Methods inherited from class com.myscript.iink.ContentSelection
getBox, getConversionState, getPart, isValid
-
Method Details
-
finalize
- Overrides:
finalize
in classContentSelection
- Throws:
Throwable
-
close
public final void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classContentSelection
-
isClosed
public final boolean isClosed()Tells whether theclose()
method has been called. Once an object is closed any method will throwIllegalStateException
.- Overrides:
isClosed
in classContentSelection
- Returns:
true
if 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
null
if this block is the root block. - Throws:
IllegalStateException
- when this block is closed.IllegalStateException
- when block is invalid.- Since:
- 1.4
-
toString
Returns a String representation of the object.- Overrides:
toString
in classContentSelection
- Returns:
- the representation of the object.
- Since:
- 2.1
-