public class CompositeSoftWrapPainter extends java.lang.Object implements SoftWrapPainter
SoftWrapPainter
implementations; chooses the one to use and delegates all
processing to it.
Not thread-safe.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CUSTOM_AFTER_SOFT_WRAP_SIGN_KEY
Defines a key to use for checking for code of the custom unicode symbol to use for
'after soft wrap' representation. |
static java.lang.String |
CUSTOM_BEFORE_SOFT_WRAP_SIGN_KEY
Defines a key to use for checking for code of the custom unicode symbol to use for
'before soft wrap' representation. |
Constructor and Description |
---|
CompositeSoftWrapPainter(EditorEx editor) |
Modifier and Type | Method and Description |
---|---|
boolean |
canUse()
Allows to answer if it's possible to use current painter implementation at local environment (e.g.
|
int |
getDrawingHorizontalOffset(java.awt.Graphics g,
SoftWrapDrawingType drawingType,
int x,
int y,
int lineHeight)
Allows to ask about horizontal offset to be applied to the given
'x' coordinate if drawing of the given
type is performed at the given graphics buffer. |
int |
getMinDrawingWidth(SoftWrapDrawingType drawingType)
Allows to ask for the minimal width in pixels required for painting of the given type.
|
int |
paint(java.awt.Graphics g,
SoftWrapDrawingType drawingType,
int x,
int y,
int lineHeight)
Asks to paint drawing of target type at the given graphics buffer at the given position.
|
void |
reinit()
Called after a change of font preferences in editor, so that a painter could reset any related internal caches.
|
public static final java.lang.String CUSTOM_BEFORE_SOFT_WRAP_SIGN_KEY
'before soft wrap'
representation.
Target value (if any) is assumed to be in hex format.public static final java.lang.String CUSTOM_AFTER_SOFT_WRAP_SIGN_KEY
'after soft wrap'
representation.
Target value (if any) is assumed to be in hex format.public CompositeSoftWrapPainter(EditorEx editor)
public int paint(java.awt.Graphics g, SoftWrapDrawingType drawingType, int x, int y, int lineHeight)
SoftWrapPainter
paint
in interface SoftWrapPainter
g
- target graphics buffer to draw indrawingType
- target drawing typex
- target 'x'
coordinate to usey
- target 'y'
coordinate to uselineHeight
- line height used at editorpublic int getDrawingHorizontalOffset(java.awt.Graphics g, SoftWrapDrawingType drawingType, int x, int y, int lineHeight)
SoftWrapPainter
'x'
coordinate if drawing of the given
type is performed at the given graphics buffer.
Generally, this method is useful when we don't want to perform actual drawing for now but want to reserve
a space necessary to do that in future. I.e. the aim is to avoid horizontal movement of already drawn content
when the drawing is actually performed.getDrawingHorizontalOffset
in interface SoftWrapPainter
g
- target graphics buffer to draw indrawingType
- target drawing typex
- target 'x'
coordinate to usey
- target 'y'
coordinate to uselineHeight
- line height used at editorpublic int getMinDrawingWidth(SoftWrapDrawingType drawingType)
SoftWrapPainter
getMinDrawingWidth
in interface SoftWrapPainter
drawingType
- target drawing typepublic boolean canUse()
SoftWrapPainter
canUse
in interface SoftWrapPainter
true
if current painter can be used at local environment; false
otherwisepublic void reinit()
SoftWrapPainter
reinit
in interface SoftWrapPainter