Class ResetSpanStylePaintInstruction
- java.lang.Object
-
- org.eclipse.nebula.widgets.richtext.painter.instructions.ResetSpanStylePaintInstruction
-
- All Implemented Interfaces:
FontMetricsProvider
,PaintInstruction
public class ResetSpanStylePaintInstruction extends java.lang.Object implements PaintInstruction, FontMetricsProvider
PaintInstruction
to reset style information that were set via span tag.
-
-
Field Summary
Fields Modifier and Type Field Description private SpanElement
span
private TagProcessingState
state
-
Constructor Summary
Constructors Constructor Description ResetSpanStylePaintInstruction(TagProcessingState state, SpanElement span)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.FontMetrics
getFontMetrics(org.eclipse.swt.graphics.GC gc)
Calculates theFontMetrics
based on the font information of thisFontMetricsProvider
in conjunction with the current set font information set to the givenGC
.void
paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle area)
-
-
-
Field Detail
-
state
private TagProcessingState state
-
span
private SpanElement span
-
-
Constructor Detail
-
ResetSpanStylePaintInstruction
public ResetSpanStylePaintInstruction(TagProcessingState state, SpanElement span)
-
-
Method Detail
-
paint
public void paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle area)
- Specified by:
paint
in interfacePaintInstruction
-
getFontMetrics
public org.eclipse.swt.graphics.FontMetrics getFontMetrics(org.eclipse.swt.graphics.GC gc)
Description copied from interface:FontMetricsProvider
Calculates theFontMetrics
based on the font information of thisFontMetricsProvider
in conjunction with the current set font information set to the givenGC
.Note: To retrieve the
FontMetrics
it is necessary to set theFont
based on the local font information and the current applied font. You should not reset theFont
on theGC
in this method again, because the font information might be used by otherFontMetricsProvider
.- Specified by:
getFontMetrics
in interfaceFontMetricsProvider
- Parameters:
gc
- TheGC
that should be used to retrieve theFontMetrics
- Returns:
- The
FontMetrics
based on the font information of thisFontMetricsProvider
in conjunction with the current set font information set to the givenGC
.
-
-