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

DrawLayer (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Interface DrawLayer

All Known Implementing Classes:
DrawLayer.AbstractLayer, DrawLayerFactory.AnnotationLayer, DrawLayerFactory.BlockSearchLayer, DrawLayerFactory.CaretLayer, DrawLayerFactory.ColorLineLayer, DrawLayerFactory.HighlightSearchLayer, DrawLayerFactory.IncSearchLayer, DrawLayerFactory.StyleLayer, DrawLayerFactory.SyntaxLayer, DrawLayerFactory.WordColoringLayer

Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2.

public interface DrawLayer

Draw layer applies changes to draw context during painting process. Each extended UI has its own set of layers. It can currently include changes to font bold and italic attributes, and foreground and background color (and probably more in future). These changes are made by draw layer to draw context in updateContext() method. Draw layers form double-linked lists. Renderer goes through this list every time it draws the tokens of the text. A layer can work either by returning the next-activity-change-offset or by being activated through the draw-marks that it places at the appropriate positions or it can mix these two approaches.


Nested Class Summary
static class DrawLayer.AbstractLayer
          Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2.
 
Field Summary
static String TEXT_FRAME_END_POSITION_COMPONENT_PROPERTY
          Deprecated. End of the next region with the frame.
static String TEXT_FRAME_START_POSITION_COMPONENT_PROPERTY
          Deprecated. Start of the next region with the frame.
 
Method Summary
 boolean extendsEmptyLine()
          Deprecated. Whether the layer marks the empty line with the background by half of the character.
 boolean extendsEOL()
          Deprecated. Whether the layer wants to use the last context's background till the end of the window or not.
 String getName()
          Deprecated. Get the name of the layer.
 int getNextActivityChangeOffset(DrawContext ctx)
          Deprecated. Get the next position at which the activity of the layer will change.
 void init(DrawContext ctx)
          Deprecated. Called each time the paint begins for all layers in the layer chain regardless whether they are currently active or not.
 boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark)
          Deprecated. Return whether the layer is active or not.
 void updateContext(DrawContext ctx)
          Deprecated. Update draw context by setting colors, fonts and possibly other draw properties.
 int updateLineNumberContext(int lineNumber, DrawContext ctx)
          Deprecated. Update draw context related to the drawing of line number for the given line by setting colors, fonts and possibly other draw properties.
 

Field Detail

TEXT_FRAME_START_POSITION_COMPONENT_PROPERTY

static final String TEXT_FRAME_START_POSITION_COMPONENT_PROPERTY
Deprecated. 
Start of the next region with the frame.

See Also:
Constant Field Values

TEXT_FRAME_END_POSITION_COMPONENT_PROPERTY

static final String TEXT_FRAME_END_POSITION_COMPONENT_PROPERTY
Deprecated. 
End of the next region with the frame.

See Also:
Constant Field Values
Method Detail

getName

String getName()
Deprecated. 
Get the name of the layer. The layers that should work together over one component must have the different names.


extendsEOL

boolean extendsEOL()
Deprecated. 
Whether the layer wants to use the last context's background till the end of the window or not.


extendsEmptyLine

boolean extendsEmptyLine()
Deprecated. 
Whether the layer marks the empty line with the background by half of the character.


getNextActivityChangeOffset

int getNextActivityChangeOffset(DrawContext ctx)
Deprecated. 
Get the next position at which the activity of the layer will change. It can return Integer.MAX_VALUE to mark that the activity will never change or if it will change only by draw-marks. When this position will be reached the isActive will be called.


init

void init(DrawContext ctx)
Deprecated. 
Called each time the paint begins for all layers in the layer chain regardless whether they are currently active or not. It is intended to prepare the layer. It doesn't need to set the next-activity-change-offset because isActive() will be called at the begining of the drawing when this method finishes.


isActive

boolean isActive(DrawContext ctx,
                 MarkFactory.DrawMark mark)
Deprecated. 
Return whether the layer is active or not. This method is called at the begining of the drawing, then each time when the draw-mark is found at the current fragment offset or when drawing reaches the next-activity-change-offset of this layer (mark parameter is null in this case). The layer must return whether it wants to be active for the next drawing or not. The layer should also consider changing the next-activity-change-offset because the draw-engine will ask for it after this method finishes. If the mark is found at the same position like next-activity-change-offset is, then this method is called only once with the valid mark parameter.

Parameters:
ctx - current context with the information about the drawing
mark - draw-mark at the fragment-offset or null if called because of the next-activity-change-offset.

updateContext

void updateContext(DrawContext ctx)
Deprecated. 
Update draw context by setting colors, fonts and possibly other draw properties. The method can use information from the context to find where the painting process is currently located. It is called only if the layer is active.


updateLineNumberContext

int updateLineNumberContext(int lineNumber,
                            DrawContext ctx)
Deprecated. 
Update draw context related to the drawing of line number for the given line by setting colors, fonts and possibly other draw properties. The method can also change the current line number by returning the modified line-number than the original one. At the begining the first layer gets the line-number lineOffset + 1 but some layers can change it. If the layer doesn't want to change the line-number it should return the same value as it gets. The context can be affected to change the font and colors for the line-number. The context's getFragmentOffset() returns the begining of the line. The following methods in the context return undefined values: isEOL(), getBuffer(), getTokenID(), getTokenOffset(), getTokenLength(). The process of calling this method is independent of the status of the layers and is called for each layer even if it's not active.

Parameters:
lineNumber - the number that will be drawn before the line's text. The layer can change it by returning a different value.
ctx - the draw context

org.netbeans.modules.editor.lib/1 1.14.0 3

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