Class Editor
- All Implemented Interfaces:
AutoCloseable
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull ContentBlock
Adds a new block to the part.final @NotNull ContentBlock
addBlock
(float x, float y, @NotNull String blockType, @NotNull MimeType mimeType, @NotNull String data) Adds a new block to the part and fills it with data.final @NotNull ContentBlock
Adds a new image to the part.final void
addListener
(@NotNull IEditorListener listener) Adds the specified listener to this editor.final void
applyStyle
(@NotNull ContentSelection selection, @NotNull String style) Applies CSS style properties to a content selection.final boolean
canRedo()
Tells whether redo can be performed on the part or notfinal boolean
canUndo()
Tells whether undo can be performed on the part or notvoid
clampViewOffset
(@NotNull Point viewOffset) Clamps the supplied view offset to the area that ensures standard scrolling behavior.final void
clear()
Removes all content from the part.final void
close()
final void
convert
(@Nullable ContentSelection selection, @NotNull ConversionState targetState) Converts the specified content to digital form.final void
copy
(@Nullable ContentSelection selection) Copies a selection to the internal clipboard.final void
drawStroke
(@NotNull PointerEvent[] events, @NotNull ICanvas canvas) Draws pointer events with current editor style settings on the given canvas.final void
erase
(@NotNull ContentSelection selection) Erases a content selection from the part.final @NotNull String
export_
(@Nullable ContentSelection selection, @NotNull MimeType mimeType) Exports the specified content.final String
export_
(@Nullable ContentSelection selection, @NotNull MimeType mimeType, @Nullable ParameterSet overrideConfiguration) Exports the specified content.final void
export_
(@Nullable ContentSelection selection, @NotNull OutputStream outputStream, @NotNull MimeType mimeType, @Nullable IImagePainter imagePainter) Exports the specified content.final void
export_
(@Nullable ContentSelection selection, @NotNull OutputStream outputStream, @NotNull MimeType mimeType, @Nullable IImagePainter imagePainter, @Nullable ParameterSet overrideConfiguration) Exports the specified content.final void
export_
(@Nullable ContentSelection selection, @NotNull String outputFilePath, @NotNull MimeType mimeType, @Nullable IImagePainter imagePainter) Exports the specified content.final void
export_
(@Nullable ContentSelection selection, @NotNull String outputFilePath, @NotNull MimeType mimeType, @Nullable IImagePainter imagePainter, @Nullable ParameterSet overrideConfiguration) Exports the specified content.final void
export_
(@Nullable ContentSelection selection, @NotNull String outputFilePath, @Nullable IImagePainter imagePainter) Exports the specified content.final void
export_
(@Nullable ContentSelection selection, @NotNull String outputFilePath, @Nullable IImagePainter imagePainter, @Nullable ParameterSet overrideConfiguration) Exports the specified content.protected void
finalize()
final @NotNull EnumSet<ContentSelectionMode>
Returns the available selection modes for the active content selection associated with this editor.final @NotNull String[]
getAvailableSelectionTypes
(@NotNull ContentSelection selection) Returns the available types for a selection.final @Nullable ContentBlock
getBlockById
(@NotNull String id) Returns the content block associated with a givenid
.@NotNull Rectangle
getBox
(@NotNull ContentSelection selection) Returns the box that represents the position of a selection.final @NotNull Configuration
Returns theConfiguration
associated with this editor.@NotNull EnumSet<ConversionState>
getConversionState
(@NotNull ContentSelection selection) Returns the current conversion state of a selection, as a set of ConversionState values.final @NotNull Engine
Returns theEngine
to which this editor is attached.final @NotNull String[]
getIncludedBlocks
(@NotNull ContentSelection selection) Returns the content block ids included in the specified content selection.final @NotNull IndentationLevels
getIndentationLevels
(@NotNull ContentSelection selection) Warning: This is a Beta API.final @NotNull String[]
getIntersectingBlocks
(@NotNull ContentSelection selection) Returns the content block ids intersecting with the specified content selection.final @NotNull MathSolverController
Returns theMathSolverController
associated with this editor.final @Nullable ContentPart
getPart()
Returns the part managed by this editor.final @NotNull PlaceholderController
Returns thePlaceholderController
associated with this editor.final int
The number of operations that can be redone.final int
The number of operations that can be undone.final @NotNull Renderer
Returns theRenderer
associated with this editor.final @Nullable ContentBlock
Returns the content block at the root of the current part.final @NotNull ContentSelection
Returns the content selection associated with this editor.final @NotNull ContentSelectionMode
Returns the selection mode of the active content selection associated with this editor.final @NotNull MimeType[]
getSupportedAddBlockDataMimeTypes
(@NotNull String type) Returns the supported formats for adding a new block with data.final @NotNull String[]
Returns the types of blocks that can be added to the part.final @NotNull MimeType[]
getSupportedExportMimeTypes
(@Nullable ContentSelection selection) Returns the supported export formats for specified content.final @NotNull MimeType[]
getSupportedImportMimeTypes
(@Nullable ContentSelection selection) Returns the supported import formats for specified content.final @NotNull ConversionState[]
getSupportedTargetConversionStates
(@Nullable ContentSelection selection) Returns the supported target conversion states for the specified content.final @NotNull EnumSet<TextFormat>
getSupportedTextFormats
(@NotNull ContentSelection selection) Returns the supported text formats for specified content selection.final @NotNull String
getTheme()
Returns the rendering theme style sheet, in CSS format.final @NotNull ToolController
Returns theToolController
associated with this editor.final @NotNull EnumSet<TransformError>
getTransformStatus
(@Nullable ContentSelection selection, @NotNull Transform transform) Checks if a transformation is allowed on a content selection.final @NotNull String
getUndoRedoIdAt
(int stackIndex) Returns the id of an undo or redo action, based on its position in the stack index.final int
Returns the number of operations performed on the part, since content part was opened.final int
The height of the view.final int
The width of the view.final boolean
Tells if this editor has an active content selection.final @Nullable ContentBlock
hitBlock
(float x, float y) Return the block at the given position, ornull
if there is no block at that position.final @Nullable ContentSelection
hitSelection
(float x, float y) Returns the active content selection at the given position, ornull
if there is no active content selection at that position.final void
import_
(@NotNull MimeType mimeType, @NotNull String data, @Nullable ContentSelection selection) Imports data into the part or a selection.final void
import_
(@NotNull MimeType mimeType, @NotNull String data, @Nullable ContentSelection selection, @Nullable ParameterSet overrideConfiguration) Imports data into the part or a selection.final void
indent
(@NotNull ContentSelection selection, int offset) Warning: This is a Beta API.final boolean
isClosed()
Tells whether theclose()
method has been called.final boolean
isEmpty
(@Nullable ContentSelection selection) Checks whether a block is empty.final boolean
isIdle()
Checks whether part modification operations are over.final boolean
Checks whether scrolling on the part is allowed at this time.final void
paste
(float x, float y) Pastes the content of the internal clipboard at a given position.final void
pointerCancel
(int pointerId) Cancels an ongoing pointer trace.final @Nullable String
pointerDown
(float x, float y, long t, float f, float tilt, float orientation, @NotNull PointerType pointerType, int pointerId) Registers a pointer down event.final @Nullable String
pointerDown
(float x, float y, long t, float f, @NotNull PointerType pointerType, int pointerId) Registers a pointer down event.final void
pointerEvents
(@NotNull PointerEvent[] events, boolean processGestures) Registers a list of pointer events.final void
pointerMove
(float x, float y, long t, float f, float tilt, float orientation, @NotNull PointerType pointerType, int pointerId) Registers a pointer move event.final void
pointerMove
(float x, float y, long t, float f, @NotNull PointerType pointerType, int pointerId) Registers a pointer move event.final void
pointerUp
(float x, float y, long t, float f, float tilt, float orientation, @NotNull PointerType pointerType, int pointerId) Registers a pointer up event.final void
pointerUp
(float x, float y, long t, float f, @NotNull PointerType pointerType, int pointerId) Registers a pointer up event.final void
redo()
Redo the last action reverted byundo
on part.final void
Removes the gesture handler from this editor, if any.final void
removeListener
(@NotNull IEditorListener listener) Removes the specified listener from this editor.final void
setFontMetricsProvider
(@Nullable IFontMetricsProvider fontMetricsProvider) Sets a font metrics provider to this editor.final void
setGestureHandler
(@Nullable IGestureHandler handler) Registers the specified gesture handler to this editor.final void
setPart
(@Nullable ContentPart part) Sets the part managed by this editor.final void
setSelection
(@Nullable ContentSelection selection) Sets the specified content selection as the active content selection in this editor.final void
setSelectionMode
(@NotNull ContentSelectionMode mode) Sets the specified selection mode to the active content selection associated with this editor.final void
setSelectionType
(@NotNull ContentSelection selection, @NotNull String type, boolean forceSingleBlock) Sets a selection to the specified type.final void
setTextFormat
(@NotNull ContentSelection selection, @NotNull TextFormat format) Applies Format to all text blocks in selection.final void
Changes the rendering theme style sheet, from a buffer containing CSS styling information.final void
setViewSize
(int width, int height) Sets the size of the view.@NotNull String
toString()
Returns a String representation of the object, with its active part and package.@NotNull String
toString
(@NotNull ContentSelection selection) Returns a String representation of a selection, with its part type and box.final void
transform
(@NotNull ContentSelection selection, @NotNull Transform transform) Transforms a selection.final void
undo()
Undo the last action on part.final void
Waits until part modification operations are over.
-
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.
-
addListener
Adds the specified listener to this editor.- Parameters:
listener
- the listener to be added.- Throws:
IllegalStateException
- when this editor is closed.IllegalArgumentException
- whenlistener
is null.
-
removeListener
Removes the specified listener from this editor.- Parameters:
listener
- the listener to be removed.- Throws:
IllegalStateException
- when this editor is closed.IllegalArgumentException
- whenlistener
is null.
-
setGestureHandler
Registers the specified gesture handler to this editor.- Parameters:
handler
- the gesture handler to be used.- Throws:
IllegalStateException
- when this editor is closed.- Since:
- 2.1
-
removeGestureHandler
public final void removeGestureHandler()Removes the gesture handler from this editor, if any.- Throws:
IllegalStateException
- when this editor is closed.- Since:
- 2.1
-
setFontMetricsProvider
public final void setFontMetricsProvider(@Nullable @Nullable IFontMetricsProvider fontMetricsProvider) Sets a font metrics provider to this editor.- Parameters:
fontMetricsProvider
- aIFontMetricsProvider
.- Throws:
IllegalStateException
- when this editor is closed.
-
getEngine
Returns theEngine
to which this editor is attached.- Returns:
- the engine.
-
getRenderer
Returns theRenderer
associated with this editor.- Returns:
- the renderer.
-
getPlaceholderController
Returns thePlaceholderController
associated with this editor.Note: do not close the returned object as it is owned by the editor.
- Returns:
- the placeholder controller.
- Since:
- 3.2
-
getMathSolverController
Returns theMathSolverController
associated with this editor.Note: do not close the returned object as it is owned by the editor.
- Returns:
- the math solver controller.
- Since:
- 4.0
-
getToolController
Returns theToolController
associated with this editor.Note: do not close the returned object as it is owned by the editor.
- Returns:
- the tool controller.
- Since:
- 2.0
-
getPart
Returns the part managed by this editor.- Returns:
- the part.
-
setPart
Sets the part managed by this editor.- Parameters:
part
- the part.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when noIFontMetricsProvider
has been set, viasetFontMetricsProvider(IFontMetricsProvider)
).IllegalStateException
- whenpart
is already bound.IllegalStateException
- when this editor cannot be configured.
-
clear
public final void clear()Removes all content from the part.- Throws:
IllegalStateException
- when this editor is closed.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
canUndo
public final boolean canUndo()Tells whether undo can be performed on the part or not- Returns:
true
if undo can be performed, otherwisefalse
.- Throws:
IllegalStateException
- when this editor is closed.
-
undo
public final void undo()Undo the last action on part.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when undo operations failed.
-
canRedo
public final boolean canRedo()Tells whether redo can be performed on the part or not- Returns:
true
if redo can be performed, otherwisefalse
.- Throws:
IllegalStateException
- when this editor is closed.
-
redo
public final void redo()Redo the last action reverted byundo
on part.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when redo operations failed.
-
getUndoStackIndex
public final int getUndoStackIndex()Returns the number of operations performed on the part, since content part was opened.Note: the undo stack is partially purged from time to time to control memory consumption. The number of possible undo operations at a given time is provided by
getPossibleUndoCount()
, while the total number of operations since content part was opened is provided bygetUndoStackIndex()
.- Returns:
- the number of operations performed on the part.
- Throws:
IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when this editor is closed.- Since:
- 1.1
-
getPossibleUndoCount
public final int getPossibleUndoCount()The number of operations that can be undone.- Returns:
- the number of operations that can be undone.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.- Since:
- 1.1
-
getPossibleRedoCount
public final int getPossibleRedoCount()The number of operations that can be redone.- Returns:
- the number of operations that can be redone.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.- Since:
- 1.2
-
getUndoRedoIdAt
Returns the id of an undo or redo action, based on its position in the stack index. Valid stack index values range from (current stack index - possible undo count) to (current stack index + possible redo count - 1).- Parameters:
stackIndex
- the index in the stack of the undo/redo action to retrieve.- Returns:
- the id of the undo/redo operation at the specific index in the undo/redo stack.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- whenstackIndex
is invalid.IllegalStateException
- when this editor is not associated with a part.- Since:
- 1.2
-
pointerDown
@Nullable public final @Nullable String pointerDown(float x, float y, long t, float f, @NotNull @NotNull PointerType pointerType, int pointerId) Registers a pointer down event.- Parameters:
x
- pointer event x coordinate (view coordinates in pixel).y
- pointer event y coordinate (view coordinates in pixel).t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure, in [0,1].pointerType
- the type of input.pointerId
- the id of the pointer.- Returns:
- the render item identifier of the starting stroke if any, otherwise
null
. - Throws:
IllegalStateException
- when this editor is closed.NullPointerException
- whenpointerType
is null.IllegalArgumentException
- whenx
is not a number.IllegalArgumentException
- wheny
is not a number.IllegalArgumentException
- whent
exceeds year 9999.IllegalArgumentException
- whenf
is not a number or is negative.UnsupportedOperationException
- whenpointerDown()
has already been called.IllegalStateException
- in "Text Document" parts, when no view size is set.
-
pointerDown
@Nullable public final @Nullable String pointerDown(float x, float y, long t, float f, float tilt, float orientation, @NotNull @NotNull PointerType pointerType, int pointerId) Registers a pointer down event.- Parameters:
x
- pointer event x coordinate (view coordinates in pixel).y
- pointer event y coordinate (view coordinates in pixel).t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure, in [0,1].tilt
- the tilt in radians.0
is perpendicular,Pi/2
if flat on screen.orientation
- the orientation in radians.0
is pointing up,-Pi/2
is left,Pi/2
is right,+/-Pi
is down.pointerType
- the type of input.pointerId
- the id of the pointer.- Returns:
- the render item identifier of the starting stroke if any, otherwise
null
. - Throws:
IllegalStateException
- when this editor is closed.NullPointerException
- whenpointerType
is null.IllegalArgumentException
- whenx
is not a number.IllegalArgumentException
- wheny
is not a number.IllegalArgumentException
- whent
exceeds year 9999.IllegalArgumentException
- whenf
is not a number or is negative.IllegalArgumentException
- whentilt
is not a number or is outside [0, Pi/2].IllegalArgumentException
- whenorientation
is not a number or is outside [-Pi, Pi].UnsupportedOperationException
- whenpointerDown()
has already been called.IllegalStateException
- in "Text Document" parts, when no view size is set.- Since:
- 4.0
-
pointerMove
public final void pointerMove(float x, float y, long t, float f, @NotNull @NotNull PointerType pointerType, int pointerId) Registers a pointer move event.- Parameters:
x
- pointer event x coordinate (view coordinates in pixel).y
- pointer event y coordinate (view coordinates in pixel).t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure, in [0,1].pointerType
- the type of input.pointerId
- the id of the pointer.- Throws:
IllegalStateException
- when this editor is closed.NullPointerException
- whenpointerType
is null.IllegalArgumentException
- whenx
is not a number.IllegalArgumentException
- wheny
is not a number.IllegalArgumentException
- whent
exceeds year 9999.IllegalArgumentException
- whenf
is not a number or is negative.IllegalArgumentException
- when stroke has too many points.UnsupportedOperationException
- whenpointerDown()
has not been called before.
-
pointerMove
public final void pointerMove(float x, float y, long t, float f, float tilt, float orientation, @NotNull @NotNull PointerType pointerType, int pointerId) Registers a pointer move event.- Parameters:
x
- pointer event x coordinate (view coordinates in pixel).y
- pointer event y coordinate (view coordinates in pixel).t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure, in [0,1].tilt
- the tilt in radians.0
is perpendicular,Pi/2
if flat on screen.orientation
- the orientation in radians.0
is pointing up,-Pi/2
is left,Pi/2
is right,+/-Pi
is down.pointerType
- the type of input.pointerId
- the id of the pointer.- Throws:
IllegalStateException
- when this editor is closed.NullPointerException
- whenpointerType
is null.IllegalArgumentException
- whenx
is not a number.IllegalArgumentException
- wheny
is not a number.IllegalArgumentException
- whent
exceeds year 9999.IllegalArgumentException
- whenf
is not a number or is negative.IllegalArgumentException
- whentilt
is not a number or is outside [0, Pi/2].IllegalArgumentException
- whenorientation
is not a number or is outside [-Pi, Pi].IllegalArgumentException
- when stroke has too many points.UnsupportedOperationException
- whenpointerDown()
has not been called before.- Since:
- 4.0
-
pointerUp
public final void pointerUp(float x, float y, long t, float f, @NotNull @NotNull PointerType pointerType, int pointerId) Registers a pointer up event.- Parameters:
x
- pointer event x coordinate (view coordinates in pixel).y
- pointer event y coordinate (view coordinates in pixel).t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure, in [0,1].pointerType
- the type of input.pointerId
- the id of the pointer.- Throws:
IllegalStateException
- when this editor is closed.NullPointerException
- whenpointerType
is null.IllegalArgumentException
- whenx
is not a number.IllegalArgumentException
- wheny
is not a number.IllegalArgumentException
- whent
exceeds year 9999.IllegalArgumentException
- whenf
is not a number or is negative.UnsupportedOperationException
- whenpointerDown()
has not been called before.
-
pointerUp
public final void pointerUp(float x, float y, long t, float f, float tilt, float orientation, @NotNull @NotNull PointerType pointerType, int pointerId) Registers a pointer up event.- Parameters:
x
- pointer event x coordinate (view coordinates in pixel).y
- pointer event y coordinate (view coordinates in pixel).t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure, in [0,1].tilt
- the tilt in radians.0
is perpendicular,Pi/2
if flat on screen.orientation
- the orientation in radians.0
is pointing up,-Pi/2
is left,Pi/2
is right,+/-Pi
is down.pointerType
- the type of input.pointerId
- the id of the pointer.- Throws:
IllegalStateException
- when this editor is closed.NullPointerException
- whenpointerType
is null.IllegalArgumentException
- whenx
is not a number.IllegalArgumentException
- wheny
is not a number.IllegalArgumentException
- whent
exceeds year 9999.IllegalArgumentException
- whenf
is not a number or is negative.IllegalArgumentException
- whentilt
is not a number or is outside [0, Pi/2].IllegalArgumentException
- whenorientation
is not a number or is outside [-Pi, Pi].UnsupportedOperationException
- whenpointerDown()
has not been called before.- Since:
- 4.0
-
pointerCancel
public final void pointerCancel(int pointerId) Cancels an ongoing pointer trace.- Parameters:
pointerId
- the id of the pointer.- Throws:
IllegalStateException
- when this editor is closed.
-
pointerEvents
Registers a list of pointer events.- Parameters:
events
- the list of events (view coordinates in pixel).processGestures
- tells whether to process gestures or not.- Throws:
IllegalStateException
- when this editor is closed.NullPointerException
- when events is null.NullPointerException
- when a pointer event contains a nullpointerType
.IllegalArgumentException
- when a pointer event contains incorrect data.IllegalArgumentException
- when a stroke has too many points.IllegalArgumentException
- when events contain more than20
strokes and processGestures istrue
.UnsupportedOperationException
- when event sequence is not allowed.
-
setViewSize
public final void setViewSize(int width, int height) Sets the size of the view.- Parameters:
width
- the view width (view coordinates in pixel).height
- the view height (view coordinates in pixel).- Throws:
IllegalStateException
- when this editor is closed.IllegalArgumentException
- whenwidth
orheight
is negative.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
getViewWidth
public final int getViewWidth()The width of the view.- Returns:
- the width of the view (view coordinates in pixel).
- Throws:
IllegalStateException
- when this editor is closed.- Since:
- 1.3
-
getViewHeight
public final int getViewHeight()The height of the view.- Returns:
- the height of the view (view coordinates in pixel).
- Throws:
IllegalStateException
- when this editor is closed.- Since:
- 1.3
-
clampViewOffset
Clamps the supplied view offset to the area that ensures standard scrolling behavior. For "Text" and "Text Document" it allows scrolling one screen outside of the view box downward. For other part types it allows scrolling one screen outside of the view box in each direction.- Parameters:
viewOffset
- the view offset to clamp (document coordinates in mm).- Throws:
IllegalStateException
- when this editor is closed.
-
setTheme
Changes the rendering theme style sheet, from a buffer containing CSS styling information.- Parameters:
styleSheet
- the style sheet, in CSS format.- Throws:
IllegalStateException
- when this editor is closed.IllegalArgumentException
- whenstyleSheet
is invalid.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
getTheme
Returns the rendering theme style sheet, in CSS format.- Returns:
- the style sheet, in CSS format.
- Throws:
IllegalStateException
- when this editor is closed.
-
getRootBlock
Returns the content block at the root of the current part.- Returns:
- the root content block.
- Throws:
IllegalStateException
- when this editor is closed.
-
getBlockById
Returns the content block associated with a givenid
.- Parameters:
id
- the identifier of the block.- Returns:
- the content block associated with
id
ornull
if there is no such block in the current part. - Throws:
IllegalStateException
- when this editor is closed.
-
isEmpty
Checks whether a block is empty.- Parameters:
selection
- the selection to check,null
means check the full part.- Returns:
true
if selection is empty or invalid or editor is not associated with a part, otherwisefalse
.- Throws:
IllegalStateException
- when this editor is closed.
-
getSupportedAddBlockTypes
Returns the types of blocks that can be added to the part.Note: to add a Placeholder block, please use the Editor's PlaceholderController.
- Returns:
- an array of the supported new content block types.
- Throws:
IllegalStateException
- when this editor is closed.
-
getSupportedAddBlockDataMimeTypes
@NotNull public final @NotNull MimeType[] getSupportedAddBlockDataMimeTypes(@NotNull @NotNull String type) Returns the supported formats for adding a new block with data.- Parameters:
type
- the type of the new block.- Returns:
- an array of the supported mime types.
- Throws:
IllegalStateException
- when this editor is closed.
-
addBlock
@NotNull public final @NotNull ContentBlock addBlock(float x, float y, @NotNull @NotNull String blockType) Adds a new block to the part.- Parameters:
x
- the approximate x position of the new block (view coordinates in pixel).y
- the approximate y position of the new block (view coordinates in pixel).blockType
- the type of the new block.- Returns:
- block the newly added block.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- if type is not supported by current part type.IllegalStateException
- if editor is not configured.IllegalStateException
- if a block already exists at this position, and is not a "Container" block.IllegalStateException
- if empty space around position is too small for a new block.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
addBlock
@NotNull public final @NotNull ContentBlock addBlock(float x, float y, @NotNull @NotNull String blockType, @NotNull @NotNull MimeType mimeType, @NotNull @NotNull String data) Adds a new block to the part and fills it with data.- Parameters:
x
- the approximate x position of the new block (view coordinates in pixel).y
- the approximate y position of the new block (view coordinates in pixel).blockType
- the type of the new block.mimeType
- the mime type that specifies the format ofdata
.data
- the data to put in the new block.- Returns:
- block the newly added block.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- if type is not supported by current part type.IllegalStateException
- if editor is not configured.IllegalStateException
- if a block already exists at this position, and is not a "Container" block.IllegalStateException
- if empty space around position is too small for a new block.IllegalStateException
- when the content of data could not be added to the new block.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
addImage
@NotNull public final @NotNull ContentBlock addImage(float x, float y, @NotNull @NotNull File inputFile, @NotNull @NotNull MimeType mimeType) throws NullPointerException, IllegalArgumentException, IOException Adds a new image to the part.Note: in a "Text Document" part, this method creates a new "Drawing" block in which the image will be added.
- Parameters:
x
- the approximate x position of the new image (view coordinates in pixel).y
- the approximate y position of the new image (view coordinates in pixel).inputFile
- the image file to add.mimeType
- the mime type that specifies the format ofinputFile
.- Returns:
- the block associated with the newly added image. In a ContentPart of type "Text Document", this will be a block of type "Drawing".
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- if editor is not configured.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifmimeType
is null.NullPointerException
- ifinputFile
is null.IllegalStateException
- ifinputFile
does not exist.IllegalArgumentException
- if the mime type is not an image format.IllegalStateException
- if a block already exists at this position, and is not a "Container" block.IllegalStateException
- if empty space around position is too small for a new block.IOException
- if an I/O operation fails.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
erase
Erases a content selection from the part.- Parameters:
selection
- the content selection to erase.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalArgumentException
- when selection isnull
.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
hitBlock
Return the block at the given position, ornull
if there is no block at that position.- Parameters:
x
- the hit position x coordinate (view coordinates in pixel).y
- the hit position y coordinate (view coordinates in pixel).- Returns:
- the block below hit position, or
null
if no block was found. - Throws:
IllegalStateException
- when this editor is closed.
-
getSupportedTargetConversionStates
@NotNull public final @NotNull ConversionState[] getSupportedTargetConversionStates(@Nullable @Nullable ContentSelection selection) Returns the supported target conversion states for the specified content.- Parameters:
selection
- the selection for which the supported target conversion states are requested,null
means convert full part.- Returns:
- an array of the supported target conversion states.
-
convert
public final void convert(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull ConversionState targetState) Converts the specified content to digital form.- Parameters:
selection
- the selection to convert,null
means convert full part.targetState
- the target conversion state for the selection.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- if editor is not configured.IllegalArgumentException
- when the target conversion state is not reachable from the current state of the specified selection.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
getSupportedExportMimeTypes
@NotNull public final @NotNull MimeType[] getSupportedExportMimeTypes(@Nullable @Nullable ContentSelection selection) Returns the supported export formats for specified content.- Parameters:
selection
- the selection to request,null
means full part.- Returns:
- an array of the supported mime types.
- Throws:
IllegalStateException
- when this editor is closed.
-
export_
@NotNull public final @NotNull String export_(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull MimeType mimeType) throws NullPointerException, IllegalArgumentException, IllegalStateException, IOException Exports the specified content.- Parameters:
selection
- the selection to export,null
means export full part.mimeType
- the mime type that specifies the output format.- Returns:
- the exported content.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifmimeType
is null.IllegalArgumentException
- if the mime type is not a textual format.IllegalStateException
- if the specified mime type is not supported.IOException
- if an I/O operation fails.IllegalStateException
- when there are some ongoing operations on the part that prevent export, seeisIdle()
.
-
export_
public final void export_(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull OutputStream outputStream, @NotNull @NotNull MimeType mimeType, @Nullable @Nullable IImagePainter imagePainter) throws NullPointerException, IllegalStateException, IOException Exports the specified content.- Parameters:
selection
- the selection to export,null
means export full part.outputStream
- the stream to export to.mimeType
- the MIME type that specifies the desired output format.imagePainter
- an image painter that is required for some output formats. If you know that the specified output format does not require it you can leave it null.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifoutputStream
is null.NullPointerException
- ifmimeType
is null.IllegalStateException
- if the specified mime type is not supported.IOException
- if an I/O operation fails.IllegalStateException
- when there are some ongoing operations on the part that prevent export, seeisIdle()
.
-
export_
public final void export_(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull OutputStream outputStream, @NotNull @NotNull MimeType mimeType, @Nullable @Nullable IImagePainter imagePainter, @Nullable @Nullable ParameterSet overrideConfiguration) throws NullPointerException, IllegalStateException, IOException Exports the specified content.- Parameters:
selection
- the selection to export,null
means export full part.outputStream
- the stream to export to.mimeType
- the MIME type that specifies the desired output format.imagePainter
- an image painter that is required for some output formats. If you know that the specified output format does not require it you can leave it null.overrideConfiguration
- the extra configuration used when exporting.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifoutputStream
is null.NullPointerException
- ifmimeType
is null.IllegalStateException
- if the specified mime type is not supported.IOException
- if an I/O operation fails.IllegalStateException
- when there are some ongoing operations on the part that prevent export, seeisIdle()
.IllegalArgumentException
- ifoverrideConfiguration
is invalid.
-
export_
public final void export_(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull String outputFilePath, @Nullable @Nullable IImagePainter imagePainter) throws NullPointerException, IllegalArgumentException, IllegalStateException, IOException Exports the specified content.- Parameters:
selection
- the selection to export,null
means export full part.outputFilePath
- the path of the file to export to.imagePainter
- an image painter that is required for some output formats. If you know that the specified output format does not require it you can leave it null.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifoutputFilePath
is null.IllegalArgumentException
- ifoutputFilePath
is invalid.IllegalArgumentException
- if the mime type cannot be determined from the output file name.IllegalStateException
- if the specified mime type is not supported.IOException
- if an I/O operation fails.IllegalStateException
- when there are some ongoing operations on the part that prevent export, seeisIdle()
.
-
export_
public final void export_(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull String outputFilePath, @NotNull @NotNull MimeType mimeType, @Nullable @Nullable IImagePainter imagePainter) throws NullPointerException, IllegalStateException, IOException Exports the specified content.- Parameters:
selection
- the selection to export,null
means export full part.outputFilePath
- the path of the file to export to.mimeType
- the mime type that specifies the output format.imagePainter
- an image painter that is required for some output formats. If you know that the specified output format does not require it you can leave it null.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifoutputFilePath
is null.IllegalArgumentException
- ifoutputFilePath
is invalid.NullPointerException
- ifmimeType
is null.IllegalStateException
- if the specified mime type is not supported.IOException
- if an I/O operation fails.IllegalStateException
- when there are some ongoing operations on the part that prevent export, seeisIdle()
.
-
export_
public final String export_(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull MimeType mimeType, @Nullable @Nullable ParameterSet overrideConfiguration) throws NullPointerException, IllegalArgumentException, IllegalStateException, IOException Exports the specified content.- Parameters:
selection
- the selection to export,null
means export full part.mimeType
- the mime type that specifies the output format.overrideConfiguration
- the extra configuration used when exporting.- Returns:
- the exported content.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifmimeType
is null.IllegalArgumentException
- if the mime type is not a textual format.IllegalStateException
- if there is nothing to export.IllegalStateException
- if the specified mime type is not supported.IOException
- if an I/O operation fails.IllegalStateException
- when there are some ongoing operations on the part that prevent export, seeisIdle()
.IllegalArgumentException
- ifoverrideConfiguration
is invalid.- Since:
- 1.2
-
export_
public final void export_(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull String outputFilePath, @Nullable @Nullable IImagePainter imagePainter, @Nullable @Nullable ParameterSet overrideConfiguration) throws NullPointerException, IllegalArgumentException, IOException Exports the specified content.- Parameters:
selection
- the selection to export,null
means export full part.outputFilePath
- the path of the file to export to.imagePainter
- an image painter that is required for some output formats. If you know that the specified output format does not require it you can leave it null.overrideConfiguration
- the extra configuration used when exporting.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifoutputFilePath
is null.IllegalArgumentException
- ifoutputFilePath
is invalid.IllegalArgumentException
- if the mime type cannot be determined from the output file name.IllegalStateException
- if there is nothing to export.IllegalStateException
- if the specified mime type is not supported.IOException
- if an I/O operation fails.IllegalStateException
- when there are some ongoing operations on the part that prevent export, seeisIdle()
.IllegalArgumentException
- ifoverrideConfiguration
is invalid.- Since:
- 1.2
-
export_
public final void export_(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull String outputFilePath, @NotNull @NotNull MimeType mimeType, @Nullable @Nullable IImagePainter imagePainter, @Nullable @Nullable ParameterSet overrideConfiguration) throws NullPointerException, IllegalStateException, IOException Exports the specified content.- Parameters:
selection
- the selection to export,null
means export full part.outputFilePath
- the path of the file to export to.mimeType
- the mime type that specifies the output format.imagePainter
- an image painter that is required for some output formats. If you know that the specified output format does not require it you can leave it null.overrideConfiguration
- the extra configuration used when exporting.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- ifoutputFilePath
is null.IllegalArgumentException
- ifoutputFilePath
is invalid.NullPointerException
- ifmimeType
is null.IllegalStateException
- if there is nothing to export.IllegalStateException
- if the specified mime type is not supported.IOException
- if an I/O operation fails.IllegalStateException
- when there are some ongoing operations on the part that prevent export, seeisIdle()
.IllegalArgumentException
- ifoverrideConfiguration
is invalid.- Since:
- 1.2
-
getSupportedImportMimeTypes
@NotNull public final @NotNull MimeType[] getSupportedImportMimeTypes(@Nullable @Nullable ContentSelection selection) Returns the supported import formats for specified content.- Parameters:
selection
- the selection to request,null
means full part.- Returns:
- an array of the supported mime types.
- Throws:
IllegalStateException
- when this editor is closed.
-
import_
public final void import_(@NotNull @NotNull MimeType mimeType, @NotNull @NotNull String data, @Nullable @Nullable ContentSelection selection) throws IllegalStateException Imports data into the part or a selection.- Parameters:
mimeType
- the mime type that specifies the format ofdata
.data
- the data to import.selection
- the target content selection, or null to let editor detect the target.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when the specified mime type is not supported.IllegalStateException
- whendata
could not be imported.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
import_
public final void import_(@NotNull @NotNull MimeType mimeType, @NotNull @NotNull String data, @Nullable @Nullable ContentSelection selection, @Nullable @Nullable ParameterSet overrideConfiguration) throws IllegalStateException Imports data into the part or a selection.- Parameters:
mimeType
- the mime type that specifies the format ofdata
.data
- the data to import.selection
- the target content selection, or null to let editor detect the target.overrideConfiguration
- the extra configuration used when importing.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when the specified mime type is not supported.IllegalStateException
- whendata
could not be imported.IllegalArgumentException
- ifoverrideConfiguration
is invalid.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
copy
Copies a selection to the internal clipboard.- Parameters:
selection
- the selection to copy,null
means full part.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when selection cannot be copied.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
paste
Pastes the content of the internal clipboard at a given position. Internal clipboard is filled by callingcopy(ContentSelection)
. If internal clipboard is empty, this does nothing.Note: Following limitation applies: the part managed by this editor must be a "Text Document" and clipboard must contain a single block, that is not a "Container", from a "Text Document".
- Parameters:
x
- the target pasted selection x coordinate (view coordinates in pixel).y
- the target pasted selection y coordinate (view coordinates in pixel).- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when content of the clipboard cannot be pasted on the part.UnsupportedOperationException
- when a sequence of pointer events is ongoing.
-
isIdle
public final boolean isIdle()Checks whether part modification operations are over.- Returns:
true
if there are no pending operations.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.
-
waitForIdle
public final void waitForIdle()Waits until part modification operations are over.- Throws:
IllegalStateException
- when this editor is closed.
-
isScrollAllowed
public final boolean isScrollAllowed()Checks whether scrolling on the part is allowed at this time.- Returns:
true
if scrolling is allowed.- Throws:
IllegalStateException
- when this editor is closed.
-
getConfiguration
Returns theConfiguration
associated with this editor.Note: do not close the returned object as it is owned by the editor.
- Returns:
- the editor configuration.
- Throws:
IllegalStateException
- when this editor is closed.
-
drawStroke
public final void drawStroke(@NotNull @NotNull PointerEvent[] events, @NotNull @NotNull ICanvas canvas) Draws pointer events with current editor style settings on the given canvas.Note: For use with extra-brushes, first call:
canvas.setKeepGLRenderer(true)
.- Parameters:
events
- the list of events (view coordinates in pixel).canvas
- the canvas on which editor should send the drawing commands.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- when events is null.NullPointerException
- when canvas is null.NullPointerException
- when a pointer event contains a nullpointerType
.IllegalArgumentException
- when when renderer configuration is invalid.IllegalArgumentException
- when a pointer event contains incorrect data.IllegalArgumentException
- when a stroke has too many points.UnsupportedOperationException
- when events sequence is not allowed.- Since:
- 1.5.1
-
hasSelection
public final boolean hasSelection()Tells if this editor has an active content selection.- Returns:
true
if the editor has an active content selection, otherwisefalse
.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.- Since:
- 2.0
-
getSelection
Returns the content selection associated with this editor. Note this content selection is empty if the editor has nothing selected.- Returns:
- the current content selection.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.- Since:
- 2.0
-
setSelection
Sets the specified content selection as the active content selection in this editor. Note it unsets the active content selection if the specified content selection is empty ornull
.- Parameters:
selection
- the content selection to set as active.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.UnsupportedOperationException
- when a sequence of pointer events is ongoing.- Since:
- 2.0
-
hitSelection
Returns the active content selection at the given position, ornull
if there is no active content selection at that position.- Parameters:
x
- the hit position x coordinate (view coordinates in pixel).y
- the hit position y coordinate (view coordinates in pixel).- Returns:
- the content selection below the hit position (i.e. the active content selection),
otherwise
null
. - Throws:
IllegalStateException
- when this editor is closed.- Since:
- 2.0
-
getIntersectingBlocks
@NotNull public final @NotNull String[] getIntersectingBlocks(@NotNull @NotNull ContentSelection selection) Returns the content block ids intersecting with the specified content selection.- Parameters:
selection
- the content selection on which to get the intersecting block ids.- Returns:
- an array that contains all the content block ids intersecting with the content selection.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalArgumentException
- when selection isnull
.- Since:
- 2.0
-
getIncludedBlocks
@NotNull public final @NotNull String[] getIncludedBlocks(@NotNull @NotNull ContentSelection selection) Returns the content block ids included in the specified content selection.- Parameters:
selection
- the content selection on which to get the included block ids.- Returns:
- an array that contains all the content block ids included in the content selection.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalArgumentException
- when selection isnull
.- Since:
- 2.0
-
getTransformStatus
@NotNull public final @NotNull EnumSet<TransformError> getTransformStatus(@Nullable @Nullable ContentSelection selection, @NotNull @NotNull Transform transform) Checks if a transformation is allowed on a content selection.- Parameters:
selection
- the content selection on which to check the transformation.transform
- the transformation to check.- Returns:
- an error code from enum
TransformError
. - Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.NullPointerException
- when transform isnull
.- Since:
- 2.0
-
transform
public final void transform(@NotNull @NotNull ContentSelection selection, @NotNull @NotNull Transform transform) Transforms a selection.- Parameters:
selection
- the content selection on which to apply the transformation.transform
- the transformation to apply.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalArgumentException
- when selection isnull
.IllegalArgumentException
- when transform is not valid for this operation.NullPointerException
- when transform isnull
.UnsupportedOperationException
- when a sequence of pointer events is ongoing.- Since:
- 2.0
-
applyStyle
public final void applyStyle(@NotNull @NotNull ContentSelection selection, @NotNull @NotNull String style) Applies CSS style properties to a content selection.- Parameters:
selection
- the content selection on which to apply the style.style
- the CSS style properties to apply.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.UnsupportedOperationException
- when a sequence of pointer events is ongoing.- Since:
- 2.0
-
setTextFormat
public final void setTextFormat(@NotNull @NotNull ContentSelection selection, @NotNull @NotNull TextFormat format) Applies Format to all text blocks in selection.- Parameters:
selection
- the content selection on which to apply the format.format
- the format to apply.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.UnsupportedOperationException
- when a sequence of pointer events is ongoing.- Since:
- 2.0
-
getSupportedTextFormats
@NotNull public final @NotNull EnumSet<TextFormat> getSupportedTextFormats(@NotNull @NotNull ContentSelection selection) Returns the supported text formats for specified content selection.- Parameters:
selection
- the content selection on which to get all formats.- Returns:
- an array that contains all the formats of selection.
- Throws:
IllegalStateException
- when this editor is closed.- Since:
- 2.0
-
getSelectionMode
Returns the selection mode of the active content selection associated with this editor.- Returns:
- the selection mode of the current content selection.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.- Since:
- 2.0
-
setSelectionMode
Sets the specified selection mode to the active content selection associated with this editor.- Parameters:
mode
- the selection mode to set on the active content selection.- Throws:
IllegalArgumentException
- when the mode is not supported.IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.UnsupportedOperationException
- when a sequence of pointer events is ongoing.- Since:
- 2.0
-
getAvailableSelectionModes
Returns the available selection modes for the active content selection associated with this editor.- Returns:
- an array that contains all the available selection modes.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.- Since:
- 2.0
-
setSelectionType
public final void setSelectionType(@NotNull @NotNull ContentSelection selection, @NotNull @NotNull String type, boolean forceSingleBlock) Sets a selection to the specified type.- Parameters:
selection
- the content selection on which to set the type.type
- the content type to set. SeegetAvailableSelectionTypes(ContentSelection)
.forceSingleBlock
-true
to force converting the selection to a single block,false
otherwise.- Throws:
IllegalArgumentException
- when the type is not supported.IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when selection is not valid.IllegalStateException
- when selection is not compatible with the type.UnsupportedOperationException
- when a sequence of pointer events is ongoing.- Since:
- 2.0.1
-
getAvailableSelectionTypes
@NotNull public final @NotNull String[] getAvailableSelectionTypes(@NotNull @NotNull ContentSelection selection) Returns the available types for a selection.- Parameters:
selection
- the content selection on which to get the types.- Returns:
- an array that contains all the available selection types.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when selection is not valid.- Since:
- 2.0.1
-
getIndentationLevels
@NotNull public final @NotNull IndentationLevels getIndentationLevels(@NotNull @NotNull ContentSelection selection) Warning: This is a Beta API.Returns the indentation levels of a selection.
- Parameters:
selection
- the content selection on which to get indentation levels.- Returns:
- the indentation levels of the selection.
- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when selection is not valid.- Since:
- 2.1
-
indent
Warning: This is a Beta API.Indents/de-indents a selection by the specified offset. Note resulting indentation levels will be clamped to
[0, max_indentation[
. SeegetIndentationLevels(ContentSelection)
.- Parameters:
selection
- the content selection to indent/de-indent.offset
- the number of levels to indent/de-indent the selection.- Throws:
IllegalStateException
- when this editor is closed.IllegalStateException
- when this editor is not associated with a part.IllegalStateException
- when selection is not valid.IllegalStateException
- when selection is not indentable.UnsupportedOperationException
- when a sequence of pointer events is ongoing.- Since:
- 2.1
-
getBox
Returns the box that represents the position of a selection.- Parameters:
selection
- the content selection for which the box is requested.- Returns:
- the box of this selection (document coordinates in mm).
- Throws:
IllegalStateException
- when this selection is closed.IllegalStateException
- when selection is invalid.- Since:
- 3.0
-
getConversionState
@NotNull public @NotNull EnumSet<ConversionState> getConversionState(@NotNull @NotNull ContentSelection selection) Returns the current conversion state of a selection, as a set of ConversionState values.- Parameters:
selection
- the content selection for which the conversion state is requested.- Returns:
- the conversion state of this selection.
- Throws:
IllegalStateException
- when this selection is closed.IllegalStateException
- when selection is invalid.- Since:
- 3.0
-
toString
Returns a String representation of the object, with its active part and package. -
toString
Returns a String representation of a selection, with its part type and box.- Returns:
- the representation of a selection.
- Throws:
IllegalStateException
- when the selection is closed.IllegalStateException
- when the selection is invalid.- Since:
- 4.0
-