Class ContentPart

java.lang.Object
com.myscript.iink.ContentPart
All Implemented Interfaces:
AutoCloseable

public class ContentPart extends Object implements 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 Details

    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • isClosed

      public final boolean isClosed()
      Tells whether the close() method has been called. Once an object is closed any method will throw IllegalStateException.
      Returns:
      true if this object is closed.
    • getPackage

      @NotNull public final @NotNull ContentPackage getPackage()
      Returns the package that contains this part.
      Returns:
      the package.
      Throws:
      IllegalStateException - when this part is closed.
    • getId

      @Nullable public final @Nullable String getId()
      Returns the identifier of this part.
      Returns:
      the part identifier.
      Throws:
      IllegalStateException - when this part is closed.
    • getType

      @Nullable public final @Nullable String getType()
      Returns the type of this part.
      Returns:
      the part type.
      Throws:
      IllegalStateException - when this part is closed.
    • getViewBox

      @Nullable public @Nullable Rectangle 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

      @NotNull public final @NotNull String 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

      @NotNull public final @NotNull ParameterSet getMetadata()
      Returns the part's metadata as a parameter set.
      Returns:
      the parameter set.
      Throws:
      IllegalStateException - when this part is closed.
    • setMetadata

      public final void setMetadata(@NotNull @NotNull ParameterSet parameters)
      Set the part's metadata with the given parameter set.
      Parameters:
      parameters - the parameters to set.
      Throws:
      IllegalStateException - when this part is closed.
      IllegalStateException - when parameters is closed.
    • toString

      @NotNull public @NotNull String toString()
      Returns a String representation of the object.
      Overrides:
      toString in class Object
      Returns:
      the representation of the object.
      Since:
      2.1