Package com.myscript.iink
Class ContentPart
java.lang.Object
com.myscript.iink.ContentPart
- All Implemented Interfaces:
AutoCloseable
A part stores one content item. It is structured into several blocks that
consist of semantically meaningful sub sections of content. A part can be
interpreted as a hierarchy of blocks.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
protected void
finalize()
final @Nullable String
getId()
Returns the identifier of this part.final @NotNull String
Returns the language of this part.final @NotNull ParameterSet
Returns the part's metadata as a parameter set.final @NotNull ContentPackage
Returns the package that contains this part.final @Nullable String
getType()
Returns the type of this part.@Nullable Rectangle
Returns the view box, the rectangle that represents the viewable area of this part's content.final boolean
isClosed()
Tells whether theclose()
method has been called.final void
setMetadata
(@NotNull ParameterSet parameters) Set the part's metadata with the given parameter set.@NotNull String
toString()
Returns a String representation of the object.
-
Method Details
-
finalize
-
close
public final void close()- Specified by:
close
in interfaceAutoCloseable
-
isClosed
public final boolean isClosed()Tells whether theclose()
method has been called. Once an object is closed any method will throwIllegalStateException
.- Returns:
true
if this object is closed.
-
getPackage
Returns the package that contains this part.- Returns:
- the package.
- Throws:
IllegalStateException
- when this part is closed.
-
getId
Returns the identifier of this part.- Returns:
- the part identifier.
- Throws:
IllegalStateException
- when this part is closed.
-
getType
Returns the type of this part.- Returns:
- the part type.
- Throws:
IllegalStateException
- when this part is closed.
-
getViewBox
Returns the view box, the rectangle that represents the viewable area of this part's content.- Returns:
- the view box (document coordinates in mm).
- Throws:
IllegalStateException
- when this part is closed.
-
getLanguage
Returns the language of this part.- Returns:
- the part language locale identifier, empty if not set yet
(will be set by
Editor.setPart(com.myscript.iink.ContentPart)
). - Throws:
IllegalStateException
- when this part is closed.IllegalStateException
- when part does not support text recognition (i.e. for types Math and Drawing).- Since:
- 2.0
-
getMetadata
Returns the part's metadata as a parameter set.- Returns:
- the parameter set.
- Throws:
IllegalStateException
- when this part is closed.
-
setMetadata
Set the part's metadata with the given parameter set.- Parameters:
parameters
- the parameters to set.- Throws:
IllegalStateException
- when this part is closed.IllegalStateException
- whenparameters
is closed.
-
toString
Returns a String representation of the object.
-