Class SpanStylePaintInstruction
- java.lang.Object
-
- org.eclipse.nebula.widgets.richtext.painter.instructions.SpanStylePaintInstruction
-
- All Implemented Interfaces:
FontMetricsProvider,PaintInstruction
public class SpanStylePaintInstruction extends java.lang.Object implements PaintInstruction, FontMetricsProvider
PaintInstructionthat applies style information to theGCvia span tag attributes.
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.ColorbackgroundColorThe background color that should be applied on paint.private java.lang.IntegerfontSizeThe font size in points that should be applied on paint.private java.lang.StringfontTypeThe font type that should be applied on paint.private org.eclipse.swt.graphics.ColorforegroundColorThe foreground color that should be applied on paint.private TagProcessingStatestate
-
Constructor Summary
Constructors Constructor Description SpanStylePaintInstruction(TagProcessingState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.FontMetricsgetFontMetrics(org.eclipse.swt.graphics.GC gc)Calculates theFontMetricsbased on the font information of thisFontMetricsProviderin conjunction with the current set font information set to the givenGC.voidpaint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle area)voidsetBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)voidsetFontSize(java.lang.Integer fontSize)voidsetFontType(java.lang.String fontType)voidsetForegroundColor(org.eclipse.swt.graphics.Color foregroundColor)
-
-
-
Field Detail
-
state
private TagProcessingState state
-
foregroundColor
private org.eclipse.swt.graphics.Color foregroundColor
The foreground color that should be applied on paint.
-
backgroundColor
private org.eclipse.swt.graphics.Color backgroundColor
The background color that should be applied on paint.
-
fontSize
private java.lang.Integer fontSize
The font size in points that should be applied on paint.
-
fontType
private java.lang.String fontType
The font type that should be applied on paint.
-
-
Constructor Detail
-
SpanStylePaintInstruction
public SpanStylePaintInstruction(TagProcessingState state)
-
-
Method Detail
-
paint
public void paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle area)- Specified by:
paintin interfacePaintInstruction
-
getFontMetrics
public org.eclipse.swt.graphics.FontMetrics getFontMetrics(org.eclipse.swt.graphics.GC gc)
Description copied from interface:FontMetricsProviderCalculates theFontMetricsbased on the font information of thisFontMetricsProviderin conjunction with the current set font information set to the givenGC.Note: To retrieve the
FontMetricsit is necessary to set theFontbased on the local font information and the current applied font. You should not reset theFonton theGCin this method again, because the font information might be used by otherFontMetricsProvider.- Specified by:
getFontMetricsin interfaceFontMetricsProvider- Parameters:
gc- TheGCthat should be used to retrieve theFontMetrics- Returns:
- The
FontMetricsbased on the font information of thisFontMetricsProviderin conjunction with the current set font information set to the givenGC.
-
setForegroundColor
public void setForegroundColor(org.eclipse.swt.graphics.Color foregroundColor)
-
setBackgroundColor
public void setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)
-
setFontSize
public void setFontSize(java.lang.Integer fontSize)
-
setFontType
public void setFontType(java.lang.String fontType)
-
-