Class TagProcessingState
java.lang.Object
org.eclipse.nebula.widgets.richtext.painter.TagProcessingState
public class TagProcessingState
extends java.lang.Object
This class is used to keep track of the style setting regarding opened tags. It is needed to
support styling ranges over several lines or rendering, because tags can be opened for rendering
on one line, while it is closed on another line.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TagProcessingState.TextAlignment
Enumeration to specify the text alignment in a paragraph. -
Constructor Summary
Constructors Constructor Description TagProcessingState()
-
Method Summary
Modifier and Type Method Description void
activateNextLine()
void
addPreviousBgColor(org.eclipse.swt.graphics.Color prevBgColor)
Add the givenColor
to the stack of previous set background colors.void
addPreviousColor(org.eclipse.swt.graphics.Color prevColor)
Add the givenColor
to the stack of previous set foreground colors.void
addPreviousFont(org.eclipse.swt.graphics.Font font)
Add the givenFont
to the stack of previous set fonts.void
calculateX(int areaWidth)
org.eclipse.swt.graphics.FontMetrics
getCurrentBiggestFontMetrics()
LinePainter
getCurrentLine()
int
getCurrentLineHeight()
java.lang.Integer
getCurrentListNumber()
int
getListDepth()
int
getListMargin()
int
getMarginLeft()
int
getParagraphCount()
org.eclipse.swt.graphics.Point
getPointer()
TagProcessingState.TextAlignment
getTextAlignment()
boolean
hasPreviousBgColor()
void
increaseCurrentListNumber()
void
increaseParagraphCount()
void
increaseX(int x)
void
increaseY(int y)
void
initCurrentListNumber()
boolean
isOrderedList()
boolean
isRendering()
boolean
isStrikethroughActive()
boolean
isUnderlineActive()
org.eclipse.swt.graphics.Color
pollPreviousBgColor()
Removes and returns the last color from the previous background color stack.org.eclipse.swt.graphics.Color
pollPreviousColor()
Removes and returns the last color from the previous foreground color stack.org.eclipse.swt.graphics.Font
pollPreviousFont()
Removes and returns the last font from the previous font stack.void
resetListConfiguration()
void
resetX()
Reset the x coordinate of the pointer to the value of the left margin.void
setLineIterator(java.util.Iterator<LinePainter> lineIterator)
void
setListMargin(int listMargin)
void
setMarginLeft(int marginLeft)
void
setOrderedList(boolean orderedList)
void
setRendering(boolean render)
void
setStartingPoint(int startX, int startY)
void
setStrikethroughActive(boolean strikethroughActive)
void
setTextAlignment(TagProcessingState.TextAlignment textAlignment)
void
setUnderlineActive(boolean underlineActive)
void
setX(int x)
void
setY(int y)
-
Constructor Details
-
TagProcessingState
public TagProcessingState()
-
-
Method Details
-
addPreviousColor
public void addPreviousColor(org.eclipse.swt.graphics.Color prevColor)Add the givenColor
to the stack of previous set foreground colors.- Parameters:
prevColor
- TheColor
to add to the previous foreground color stack.
-
pollPreviousColor
public org.eclipse.swt.graphics.Color pollPreviousColor()Removes and returns the last color from the previous foreground color stack. (LIFO)- Returns:
- The last
Color
that was added to the previous foreground color stack.
-
addPreviousBgColor
public void addPreviousBgColor(org.eclipse.swt.graphics.Color prevBgColor)Add the givenColor
to the stack of previous set background colors.- Parameters:
prevBgColor
- TheColor
to add to the previous background color stack.
-
pollPreviousBgColor
public org.eclipse.swt.graphics.Color pollPreviousBgColor()Removes and returns the last color from the previous background color stack. (LIFO)- Returns:
- The last
Color
that was added to the previous background color stack.
-
hasPreviousBgColor
public boolean hasPreviousBgColor()- Returns:
true
if there is a previous background color registered on the stack,false
if not.
-
addPreviousFont
public void addPreviousFont(org.eclipse.swt.graphics.Font font)Add the givenFont
to the stack of previous set fonts.- Parameters:
font
- TheFont
to add to the previous font stack
-
pollPreviousFont
public org.eclipse.swt.graphics.Font pollPreviousFont()Removes and returns the last font from the previous font stack. (LIFO)- Returns:
- The last
Font
that was added to the previous font stack.
-
isUnderlineActive
public boolean isUnderlineActive()- Returns:
true
if underline styling is active,false
if not.
-
setUnderlineActive
public void setUnderlineActive(boolean underlineActive)- Parameters:
underlineActive
-true
if underline styling should be active,false
if not.
-
isStrikethroughActive
public boolean isStrikethroughActive()- Returns:
true
if strikethrough styling is active,false
if not.
-
setStrikethroughActive
public void setStrikethroughActive(boolean strikethroughActive)- Parameters:
strikethroughActive
-true
if strikethrough styling should be active,false
if not.
-
setStartingPoint
public void setStartingPoint(int startX, int startY) -
getPointer
public org.eclipse.swt.graphics.Point getPointer() -
increaseX
public void increaseX(int x) -
increaseY
public void increaseY(int y) -
setX
public void setX(int x) -
setY
public void setY(int y) -
resetX
public void resetX()Reset the x coordinate of the pointer to the value of the left margin. This is used to start a new line. -
calculateX
public void calculateX(int areaWidth) -
getMarginLeft
public int getMarginLeft() -
setMarginLeft
public void setMarginLeft(int marginLeft) -
getTextAlignment
-
setTextAlignment
-
getCurrentLine
-
setLineIterator
-
activateNextLine
public void activateNextLine() -
getCurrentLineHeight
public int getCurrentLineHeight() -
getCurrentBiggestFontMetrics
public org.eclipse.swt.graphics.FontMetrics getCurrentBiggestFontMetrics() -
isRendering
public boolean isRendering() -
setRendering
public void setRendering(boolean render) -
isOrderedList
public boolean isOrderedList() -
setOrderedList
public void setOrderedList(boolean orderedList) -
getListMargin
public int getListMargin() -
setListMargin
public void setListMargin(int listMargin) -
getCurrentListNumber
public java.lang.Integer getCurrentListNumber() -
initCurrentListNumber
public void initCurrentListNumber() -
increaseCurrentListNumber
public void increaseCurrentListNumber() -
getListDepth
public int getListDepth() -
resetListConfiguration
public void resetListConfiguration() -
getParagraphCount
public int getParagraphCount() -
increaseParagraphCount
public void increaseParagraphCount()
-