Class LinePainter
- java.lang.Object
-
- org.eclipse.nebula.widgets.richtext.painter.LinePainter
-
public class LinePainter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.FontMetrics
biggestMetrics
private int
contentWidth
private java.util.Collection<PaintInstruction>
instructions
private int
justifySpace
private int
roundingPixels
private int
trimmedContentWidth
private java.util.List<java.lang.String>
words
-
Constructor Summary
Constructors Constructor Description LinePainter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInstruction(PaintInstruction instruction)
org.eclipse.swt.graphics.FontMetrics
getBiggestMetrics()
int
getContentWidth()
int
getLineHeight()
int
getNextJustifySpace()
int
getTrimmedContentWidth()
void
increaseContentWidth(int width)
Increase the static content with with spaces.void
increaseTrimmedContentWidth(int width)
Increase the static content with without spaces.void
paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle area)
-
-
-
Field Detail
-
instructions
private java.util.Collection<PaintInstruction> instructions
-
biggestMetrics
private org.eclipse.swt.graphics.FontMetrics biggestMetrics
-
contentWidth
private int contentWidth
-
trimmedContentWidth
private int trimmedContentWidth
-
justifySpace
private int justifySpace
-
roundingPixels
private int roundingPixels
-
words
private java.util.List<java.lang.String> words
-
-
Method Detail
-
paint
public void paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle area)
-
addInstruction
public void addInstruction(PaintInstruction instruction)
-
getBiggestMetrics
public org.eclipse.swt.graphics.FontMetrics getBiggestMetrics()
-
getLineHeight
public int getLineHeight()
-
getContentWidth
public int getContentWidth()
- Returns:
- The static content width taking spaces into account.
-
increaseContentWidth
public void increaseContentWidth(int width)
Increase the static content with with spaces.- Parameters:
width
- The width that should be added to the static content width.
-
getTrimmedContentWidth
public int getTrimmedContentWidth()
- Returns:
- The static content width without spaces.
-
increaseTrimmedContentWidth
public void increaseTrimmedContentWidth(int width)
Increase the static content with without spaces.- Parameters:
width
- The width that should be added to the static content width.
-
getNextJustifySpace
public int getNextJustifySpace()
- Returns:
- The number of pixels that need to be added to render a text justified.
-
-