public final class ZOrder extends Object
HighlightsLayer
in relation
to other layers. Instances of this class are immutable.
Developers are encouraged to use the predefined z-order constants in this class. Each constant refers to a rack in vertical ordering with a specific purpose. The racks are ordered in the following way:
ZOrder.TOP_RACK
- the highest rack
ZOrder.SHOW_OFF_RACK
ZOrder.DEFAULT_RACK
ZOrder.CARET_RACK
ZOrder.SYNTAX_RACK
ZOrder.BOTTOM_RACK
- the lowest rack
It is possible to further specify a position of a layer within a rack by
using the ZOrder.forPosition(int)
method. The ZOrder
constants
for each rack use zero as the default position. Therefore calling forPosition
with a positive number will create a ZOrder
above the rack marker
and using a negative number will produce ZOrder
below the rack marker.
When positioning your layer you should choose the rack that suites the purpose
of your layer. It is possible to further define more precise ordering
between layers within a rack. For example, if you have two layers - one providing
syntactical highlighting and the other one providing semantical highlighting -
they both belong to the SYNTAX_RACK
, but the semantical layer should be placed
above the syntactical one, because it provides 'more accurate' highlights. You could
define ZOrder
of your layers like this:
ZOrder syntaxLayerZOrder = ZOrder.SYNTAX; ZOrder semanticLayerZOrder = ZOrder.SYNTAX.forPosition(10);
Modifier and Type | Field and Description |
---|---|
static ZOrder |
BOTTOM_RACK
The lowest rack of z-orders.
|
static ZOrder |
CARET_RACK
The rack for highlights showing the position of a caret.
|
static ZOrder |
DEFAULT_RACK
The default rack of z-orders.
|
static ZOrder |
SHOW_OFF_RACK
The show off rack of z-orders.
|
static ZOrder |
SYNTAX_RACK
The syntax highlighting rack of z-order.
|
static ZOrder |
TOP_RACK
The highest rack of z-orders.
|
Modifier and Type | Method and Description |
---|---|
ZOrder |
forPosition(int position)
Creates a new ZOrder for given position.
|
String |
toString() |
public static final ZOrder TOP_RACK
public static final ZOrder SHOW_OFF_RACK
public static final ZOrder DEFAULT_RACK
public static final ZOrder CARET_RACK
public static final ZOrder SYNTAX_RACK
public static final ZOrder BOTTOM_RACK
public ZOrder forPosition(int position)
ZOrder
will belong to the same rack as the original one, but will have the
the new position passed in as a parameter.position
- The new position.ZOrder
instance.