Oxygen XML Editor 12.2 Author API

ro.sync.ecss.extensions.api.highlights
Class ColorHighlightPainter

java.lang.Object
  extended by ro.sync.ecss.extensions.api.highlights.ColorHighlightPainter
All Implemented Interfaces:
HighlightPainter

public class ColorHighlightPainter
extends java.lang.Object
implements HighlightPainter

Painter that can be used to customize the way that a highlight is displayed by setting custom text decoration, text decoration stroke, background color or stroke color.


Nested Class Summary
static class ColorHighlightPainter.TextDecoration
          The decoration added to text.
 
Constructor Summary
ColorHighlightPainter()
          Default constructor.
ColorHighlightPainter(Color color, int height, int totalHeight)
          Constructor.
 
Method Summary
 Color getBgColor()
           
 Color getColor()
           
 void paint(HighlightPainterInfo pi)
          Renders the highlight.
 void setBgColor(Color bgColor)
           
 void setColor(Color c)
          Set the color used for decoration (strike out or underline)
 void setStrikeOut(boolean strikeOut)
          Deprecated. Use setTextDecoration(TextDecoration) instead.
 void setTextDecoration(ColorHighlightPainter.TextDecoration decoration)
          Set the text decoration.
 void setTextDecorationStroke(int stroke)
          Set the text decoration stroke.
 boolean useBaseLineForUnderline()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorHighlightPainter

public ColorHighlightPainter()
Default constructor. The color is red.


ColorHighlightPainter

public ColorHighlightPainter(Color color,
                             int height,
                             int totalHeight)
Constructor.

Parameters:
color - The color to use for highlight.
height - The height of the highlight line. This may be smaller than the total height. If it is, the extra space will remain under the line.
totalHeight - The height of the highlight.
Method Detail

paint

public void paint(HighlightPainterInfo pi)
Description copied from interface: HighlightPainter
Renders the highlight.

Specified by:
paint in interface HighlightPainter
Parameters:
pi - Information used by highlight
See Also:
HighlightPainter.paint(ro.sync.ecss.extensions.api.highlights.HighlightPainterInfo)

setColor

public void setColor(Color c)
Set the color used for decoration (strike out or underline)

Parameters:
c - The decoration color.

setTextDecoration

public void setTextDecoration(ColorHighlightPainter.TextDecoration decoration)
Set the text decoration. If is set to ColorHighlightPainter.TextDecoration.NONE no line will be drawn.

Parameters:
decoration - The new text decoration.

setBgColor

public void setBgColor(Color bgColor)
Parameters:
bgColor - The background color to set.

useBaseLineForUnderline

public boolean useBaseLineForUnderline()
Returns:
true if use the base line for underlining

setTextDecorationStroke

public void setTextDecorationStroke(int stroke)
Set the text decoration stroke.

Parameters:
stroke - The new Stroke type. Constants are defined in Graphics.

setStrikeOut

@Deprecated
public void setStrikeOut(boolean strikeOut)
Deprecated. Use setTextDecoration(TextDecoration) instead.

Parameters:
strikeOut - Set this highlight as strike out.

getBgColor

public Color getBgColor()
Returns:
Returns the background color.

getColor

public Color getColor()
Returns:
Returns the color used for decoration (strike out or underline)

Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.