JIDE 3.5.15

com.jidesoft.margin
Interface MarginPainter

All Known Subinterfaces:
MarginPainter
All Known Implementing Classes:
AbstractMarginPainter, AbstractMarginPainter, BraceMatchingMarginPainter

public interface MarginPainter

A painter interface to paint the margin area. This painter is mainly used to add extra content to an existing margin. For example, you have a code folding margin. Now you want to use the same space to add extra information about bracket matching. You can certainly create a new margin to do it but it will take extra space. So we can use this MarginPainter to paint a layer on top of the code folding margin.

You can add many MarginPainters to AbstractMargin. In order to decide the order to paint them, each MarginPainter has layer index. The lower the layer index is, the earlier it gets painted. In the other word, the painter has a higher index will overwrite those that have lower index. The default layer index is defined as LAYER_DEFAULT_INDEX. The original content of the margin is painted on this layer. For example, in code folding margin, code folding information is painted on LAYER_DEFAULT_INDEX. If you want to your painter painted before code folding information, use a layer index smaller than LAYER_DEFAULT_INDEX. If you want it painted after code folding, use an index larger than LAYER_DEFAULT_INDEX.


Field Summary
static int LAYER_DEFAULT_INDEX
          The default layer index.
 
Method Summary
 int getLayer()
          Gets the layer index.
 void paintMargin(Graphics g, MarginSupport support)
          Paints the margin.
 

Field Detail

LAYER_DEFAULT_INDEX

static final int LAYER_DEFAULT_INDEX
The default layer index. The original content of the margin is painted on this layer.

See Also:
Constant Field Values
Method Detail

paintMargin

void paintMargin(Graphics g,
                 MarginSupport support)
Paints the margin.

Parameters:
g -
support - The Code Editor

getLayer

int getLayer()
Gets the layer index. The painter has a higher index will overwrite those that have lower index.

Returns:
the layer index.

JIDE 3.5.15