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

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

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

org.netbeans.spi.editor.highlighting
Class HighlightsLayer

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

public final class HighlightsLayer
extends Object

The highlight layer defines a set of highlights used for rendering a document.

There can be multiple highlight layers participating in rendering one document. Each highlight layer provides its z-order, which defines an order in which the layers are used. The higher the z-order the more 'visible' the layer is. In other word highlights provided by a layer with higher z-order can hide highlights provided by a layer with lower z-order for the same part of a document.

The highlights provided by a HighlightsLayer can define any attributes affecting text rendering including attributes that affect the size of the view containing the rendered text. The layers that use those attributes have to participate in the view layout and therefore need to be treated in a special way. The isFixedSize attribute can be true if and only if layer's highlights will never contain attributes that influence the layout of a view (e.g. font size).

For example attributes changing foreground or background color such as StyleConstants.Foreground or StyleConstants.Background do not affect metrics while the following attributes do affect it StyleConstants.FontFamily, StyleConstants.FontSize, StyleConstants.Bold, StyleConstants.Italic.


Method Summary
static HighlightsLayer create(String layerTypeId, ZOrder zOrder, boolean fixedSize, HighlightsContainer container)
          Creates a new HighlightsLayer with contents defined by HighlightsContainer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static HighlightsLayer create(String layerTypeId,
                                     ZOrder zOrder,
                                     boolean fixedSize,
                                     HighlightsContainer container)
Creates a new HighlightsLayer with contents defined by HighlightsContainer.

Parameters:
layerTypeId - The unique identifier of the new layer. This id is used for identifying this layer among other layers that may be created for the same Document and it is used for example for the purpose of z-order.
zOrder - The layer's z-order.
fixedSize - Whether this layer defines any attributes affecting text rendering; including attributes that affect the size of the view containing the rendered text. Pass in true if and only if the layer does not change metrics of rendered text.
container - The HighlightsContainer that should be used as a contents of this layer.
See Also:
ZOrder, HighlightsContainer

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

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