public class DefaultCodeAreaPainter extends java.lang.Object implements CodeAreaPainter
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultCodeAreaPainter.PaintData
Paint cache data structure for single paint operation.
|
Modifier and Type | Field and Description |
---|---|
protected CodeArea |
codeArea |
static int |
EXCEPTION1_CODE_POINT |
static int |
EXCEPTION2_CODE_POINT |
protected char[] |
charMapping |
static int |
INV_SPACE_CODE_POINT |
static int |
MAX_MONOSPACE_CODE_POINT |
static int |
MIN_MONOSPACE_CODE_POINT |
protected java.util.Map<java.lang.Character,java.lang.Character> |
unprintableCharactersMapping |
Constructor and Description |
---|
DefaultCodeAreaPainter(CodeArea codeArea) |
Modifier and Type | Method and Description |
---|---|
protected void |
drawCenteredChar(org.eclipse.swt.graphics.GC g,
char[] drawnChars,
int charOffset,
int charWidthSpace,
int startX,
int positionY)
Draws char in array centering it in precomputed space.
|
protected void |
drawShiftedChar(org.eclipse.swt.graphics.GC g,
char[] drawnChars,
int charOffset,
int charWidthSpace,
int startX,
int positionY,
int shift) |
org.eclipse.swt.graphics.Color |
getHeaderPositionColor(int byteOnLine,
int charOnLine) |
org.eclipse.swt.graphics.Color |
getPositionColor(int byteOnLine,
int charOnLine,
org.exbin.deltahex.Section section,
ColorsGroup.ColorType colorType,
DefaultCodeAreaPainter.PaintData paintData)
Returns color of given type for specified position.
|
void |
paintBackground(org.eclipse.swt.graphics.GC g)
Paints background.
|
void |
paintCursor(org.eclipse.swt.graphics.GC g)
Paints cursor symbol.
|
void |
paintHeader(org.eclipse.swt.graphics.GC g)
Paints header for hexadecimal editor.
|
void |
paintLineBackground(org.eclipse.swt.graphics.GC g,
int linePositionX,
int linePositionY,
DefaultCodeAreaPainter.PaintData paintData) |
void |
paintLineNumbers(org.eclipse.swt.graphics.GC g)
Paints line number.
|
void |
paintLineText(org.eclipse.swt.graphics.GC g,
int linePositionX,
int linePositionY,
DefaultCodeAreaPainter.PaintData paintData) |
void |
paintMainArea(org.eclipse.swt.graphics.GC g)
Paints main hexadecimal data section of the component.
|
void |
paintMainArea(org.eclipse.swt.graphics.GC g,
DefaultCodeAreaPainter.PaintData paintData) |
void |
paintOverall(org.eclipse.swt.graphics.GC g)
Paints overall hexadecimal editor parts.
|
public static final int MIN_MONOSPACE_CODE_POINT
public static final int MAX_MONOSPACE_CODE_POINT
public static final int INV_SPACE_CODE_POINT
public static final int EXCEPTION1_CODE_POINT
public static final int EXCEPTION2_CODE_POINT
protected final CodeArea codeArea
protected final char[] charMapping
protected java.util.Map<java.lang.Character,java.lang.Character> unprintableCharactersMapping
public DefaultCodeAreaPainter(CodeArea codeArea)
public void paintOverall(org.eclipse.swt.graphics.GC g)
CodeAreaPainter
paintOverall
in interface CodeAreaPainter
g
- graphicspublic void paintHeader(org.eclipse.swt.graphics.GC g)
CodeAreaPainter
paintHeader
in interface CodeAreaPainter
g
- graphicspublic org.eclipse.swt.graphics.Color getHeaderPositionColor(int byteOnLine, int charOnLine)
public void paintBackground(org.eclipse.swt.graphics.GC g)
CodeAreaPainter
paintBackground
in interface CodeAreaPainter
g
- graphicspublic void paintLineNumbers(org.eclipse.swt.graphics.GC g)
CodeAreaPainter
paintLineNumbers
in interface CodeAreaPainter
g
- graphicspublic void paintMainArea(org.eclipse.swt.graphics.GC g)
CodeAreaPainter
paintMainArea
in interface CodeAreaPainter
g
- graphicspublic void paintMainArea(org.eclipse.swt.graphics.GC g, DefaultCodeAreaPainter.PaintData paintData)
public void paintLineBackground(org.eclipse.swt.graphics.GC g, int linePositionX, int linePositionY, DefaultCodeAreaPainter.PaintData paintData)
public void paintLineText(org.eclipse.swt.graphics.GC g, int linePositionX, int linePositionY, DefaultCodeAreaPainter.PaintData paintData)
public org.eclipse.swt.graphics.Color getPositionColor(int byteOnLine, int charOnLine, org.exbin.deltahex.Section section, ColorsGroup.ColorType colorType, DefaultCodeAreaPainter.PaintData paintData)
byteOnLine
- byte on linecharOnLine
- character on linesection
- rendering sectioncolorType
- color typepaintData
- cached paint dataprotected void drawCenteredChar(org.eclipse.swt.graphics.GC g, char[] drawnChars, int charOffset, int charWidthSpace, int startX, int positionY)
g
- graphicsdrawnChars
- array of charscharOffset
- index of target character in arraycharWidthSpace
- default character widthstartX
- X position of drawing area startpositionY
- Y position of drawing area startprotected void drawShiftedChar(org.eclipse.swt.graphics.GC g, char[] drawnChars, int charOffset, int charWidthSpace, int startX, int positionY, int shift)
public void paintCursor(org.eclipse.swt.graphics.GC g)
CodeAreaPainter
paintCursor
in interface CodeAreaPainter
g
- graphics