public class DocumentLayer extends Object implements Comparable<DocumentLayer>
Document
. The layers represent the z-axis of a document.
Each Page
in the document consists of a stack of AbstractPageSegment
s which
correspond to DocumentLayer
s. In other words, a DocumentLayer
represents a virtual slot in the stack of layers that make up the document whereas the
PageSegment
s fill these slots.
Please note: the layers pertain to the whole document, therefore not all layers of a page need to be occupied with page segments.
Modifier and Type | Field and Description |
---|---|
static DocumentLayer |
ANNOTATIONS
A layer typically used for annotations.
|
static DocumentLayer |
BACKGROUND
A layer typically used for a document backdrop, e.g.
|
static DocumentLayer |
DEFAULT
A layer typically used for the document itself.
HINT: This layer is installed by default in the default layer cache. |
static DocumentLayer |
EMBEDDED_ANNOTATIONS
A layer typically used for format specific inline annotations.
|
static DocumentLayer |
FORM
A layer typically used for form elements.
HINT: This layer is installed by default in the default layer cache. |
static DocumentLayer |
OCR
A layer typically used for OCR informations, e.g.
|
static List<DocumentLayer> |
STANDARD_LAYERS
A list of the standard layers defined as constants in this class.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DocumentLayer o)
Compare two DocumentLayers.
|
boolean |
equals(Object obj) |
static DocumentLayer |
get(String name)
Return the document layer with the given name.
|
static DocumentLayer |
get(String name,
int priority)
Return the document layer with the given name and priority.
|
String |
getName()
Gets the name.
|
int |
getPriority()
Return this layer's default ordering priority.
|
int |
hashCode() |
static void |
setDocumentLayerCache(DocumentLayerCache documentLayerCache)
This method replaces the currently used layer cache.
|
String |
toString()
Return text representation of the layer.
|
public static final DocumentLayer ANNOTATIONS
public static final DocumentLayer FORM
public static final DocumentLayer EMBEDDED_ANNOTATIONS
public static final DocumentLayer OCR
public static final DocumentLayer DEFAULT
public static final DocumentLayer BACKGROUND
public static final List<DocumentLayer> STANDARD_LAYERS
public static DocumentLayer get(String name)
DocumentLayerCache
is not replaced. If the layer
does not already exist, a new layer will be created with its default priority being the same as
DEFAULT
.IllegalArgumentException
- if name
is null
setDocumentLayerCache(DocumentLayerCache)
public static DocumentLayer get(String name, int priority)
DocumentLayerCache
is not replaced. If
the layer does not already exist, a new layer will be created the given priority. If the layer
does already exist, but the requested priority differs from the one of the existing
layer, an IllegalArgumentException
is thrown.name
- the layer namepriority
- the priority.IllegalArgumentException
- if name is null
or there is already a document
layer with the given name, but the requested priority differs from the existing
one's.setDocumentLayerCache(DocumentLayerCache)
public static void setDocumentLayerCache(DocumentLayerCache documentLayerCache)
documentLayerCache
- the new layer cache to be used, this parameter must not be
null
public String getName()
public int compareTo(DocumentLayer o)
compareTo
in interface Comparable<DocumentLayer>
Comparable.compareTo(Object)
public String toString()
toString
in class Object
Object.toString()
public int getPriority()
Ordering priorities indicate the layer position within the layer stack. Higher priorities indicating a position closer to the top of the layer stack, lower priorities positions closer to the bottom.
Copyright © 2024 levigo holding gmbh. All rights reserved.