Package com.myscript.iink
Class ContentBlock
- java.lang.Object
-
- com.myscript.iink.ContentSelection
-
- com.myscript.iink.ContentBlock
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ContentBlock extends ContentSelection
Represents a block of content. The tree of content blocks provides the hierarchical structure of a content part into semantic units.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
finalize()
@NotNull java.lang.String
getAttributes()
Returns the block's attributes as a JSON string.@NotNull ContentBlock[]
getChildren()
Returns the children of this block.@NotNull java.lang.String
getId()
Returns the identifier of this block.@Nullable ContentBlock
getParent()
Returns the parent of this block.@NotNull java.lang.String
getRenderingId()
Returns an identifier that can be used to match corresponding calls toICanvas.startGroup(String, float, float, float, float, boolean)
.@NotNull java.lang.String
getType()
Returns the type of this block.boolean
isClosed()
Tells whether theclose()
method has been called.-
Methods inherited from class com.myscript.iink.ContentSelection
getBox, getConversionState, getPart, isValid
-
-
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classContentSelection
- Throws:
java.lang.Throwable
-
close
public final void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- 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
@NotNull public final @NotNull java.lang.String getType()
Returns the type of this block.- Returns:
- the type name.
- Throws:
java.lang.IllegalStateException
- when this block is closed.java.lang.IllegalStateException
- when block is invalid.
-
getId
@NotNull public final @NotNull java.lang.String getId()
Returns the identifier of this block.- Returns:
- the identifier.
- Throws:
java.lang.IllegalStateException
- when this block is closed.java.lang.IllegalStateException
- when block is invalid.
-
getRenderingId
@NotNull public final @NotNull java.lang.String 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:
java.lang.IllegalStateException
- when this block is closed.java.lang.IllegalStateException
- when block is invalid.
-
getAttributes
@NotNull public final @NotNull java.lang.String getAttributes()
Returns the block's attributes as a JSON string.- Returns:
- the attributes.
- Throws:
java.lang.IllegalStateException
- when this block is closed.java.lang.IllegalStateException
- when block is invalid.- Since:
- 1.1
-
getChildren
@NotNull public final @NotNull ContentBlock[] 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:
java.lang.IllegalStateException
- when this block is closed.java.lang.IllegalStateException
- when block is invalid.
-
getParent
@Nullable public final @Nullable ContentBlock getParent()
Returns the parent of this block.- Returns:
- the parent of this block, or
null
if this block is the root block. - Throws:
java.lang.IllegalStateException
- when this block is closed.java.lang.IllegalStateException
- when block is invalid.- Since:
- 1.4
-
-