站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

ZOrder (Editor Library 2) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib2/1 1.3 2

org.netbeans.spi.editor.highlighting
Class ZOrder

java.lang.Object
  extended by org.netbeans.spi.editor.highlighting.ZOrder

public final class ZOrder
extends Object

This class determines a position of a 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:

It is possible to further specify a position of a layer within a rack by using the 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);
 


Field Summary
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.
 
Method Summary
 ZOrder forPosition(int position)
          Creates a new ZOrder for given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP_RACK

public static final ZOrder TOP_RACK
The highest rack of z-orders. Layers in this rack will be placed at the top of the hierarchy.


SHOW_OFF_RACK

public static final ZOrder SHOW_OFF_RACK
The show off rack of z-orders. This rack is meant to be used by layers with short-lived highlights that can temporarily override highlights provided by other layers (eg. syntax coloring).


DEFAULT_RACK

public static final ZOrder DEFAULT_RACK
The default rack of z-orders. This rack should be used by most of the layers.


CARET_RACK

public static final ZOrder CARET_RACK
The rack for highlights showing the position of a caret.


SYNTAX_RACK

public static final ZOrder SYNTAX_RACK
The syntax highlighting rack of z-order. This rack is meant to be used by layers that provide highlighting of a text according to its syntactical or semantical rules.


BOTTOM_RACK

public static final ZOrder BOTTOM_RACK
The lowest rack of z-orders. Layers in this rack will be placed at the bottom of the hierarchy.

Method Detail

forPosition

public ZOrder forPosition(int position)
Creates a new ZOrder for given position. The new ZOrder will belong to the same rack as the original one, but will have the the new position passed in as a parameter.

Parameters:
position - The new position.
Returns:
A new ZOrder instance.

org.netbeans.modules.editor.lib2/1 1.3 2

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.