public interface SoftWrapPainter
This is a long text that is soft-wrappedImplementations of this interface are not obliged to be thread-safe.
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.
|
int paint(java.awt.Graphics g, SoftWrapDrawingType drawingType, int x, int y, int lineHeight)
g
- target graphics buffer to draw indrawingType
- target drawing typex
- target 'x'
coordinate to usey
- target 'y'
coordinate to uselineHeight
- line height used at editorint getDrawingHorizontalOffset(java.awt.Graphics g, SoftWrapDrawingType drawingType, int x, int y, int lineHeight)
'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.g
- target graphics buffer to draw indrawingType
- target drawing typex
- target 'x'
coordinate to usey
- target 'y'
coordinate to uselineHeight
- line height used at editorint getMinDrawingWidth(SoftWrapDrawingType drawingType)
drawingType
- target drawing typeboolean canUse()
true
if current painter can be used at local environment; false
otherwisevoid reinit()