Package org.eclipse.graphiti.tb
Class TextDecorator
- java.lang.Object
-
- org.eclipse.graphiti.tb.AbstractDecorator
-
- org.eclipse.graphiti.tb.TextDecorator
-
- All Implemented Interfaces:
ILocation,IDecorator,ITextDecorator
public class TextDecorator extends AbstractDecorator implements ITextDecorator
Text decorators can be used to add a text to the visualization of a shape without modifying the dirty state of the displaying editor, seeIDecorator.- Since:
- 0.10
-
-
Constructor Summary
Constructors Constructor Description TextDecorator(java.lang.String text)Creates a new text decorator that decorates a shape with the given text.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IColorConstantgetBackgroundColor()Returns the color that will be used for painting the background of the shape to decorate.java.lang.StringgetFontName()Gets the name of the font used in the decorator.intgetFontSize()Gets the size of the font used in the decorator.IColorConstantgetForegroundColor()Returns the color that will be used for painting the foreground of the shape to decorate.java.lang.StringgetText()Returns the text of the decorator.intgetX()Gets the x value.intgetY()Gets the y value.voidsetBackgroundColor(IColorConstant backgroundColor)Sets the color that will be used for painting the background of the text.voidsetFontName(java.lang.String fontName)Sets the name of the font used in the decorator.voidsetFontSize(int fontSize)Sets the size of the font used in the decorator.voidsetForegroundColor(IColorConstant foregroundColor)Sets the color that will be used for painting the foreground of the text.voidsetText(java.lang.String text)Sets the text or the decorator.voidsetX(int x)Sets the x coordinate of this location.voidsetY(int y)Sets the y coordinate of this location.-
Methods inherited from class org.eclipse.graphiti.tb.AbstractDecorator
getMessage, setMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.graphiti.tb.IDecorator
getMessage, setMessage
-
-
-
-
Constructor Detail
-
TextDecorator
public TextDecorator(java.lang.String text)
Creates a new text decorator that decorates a shape with the given text. The default font used for displaying the text is Arial in size 10, the text will appear by default 4px from the upper left corner of the decorated shape.- Parameters:
text- aStringproviding the text
-
-
Method Detail
-
getX
public int getX()
Description copied from interface:ILocationGets the x value.
-
getY
public int getY()
Description copied from interface:ILocationGets the y value.
-
setX
public void setX(int x)
Description copied from interface:ILocationSets the x coordinate of this location.
-
setY
public void setY(int y)
Description copied from interface:ILocationSets the y coordinate of this location.
-
getText
public java.lang.String getText()
Description copied from interface:ITextDecoratorReturns the text of the decorator.- Specified by:
getTextin interfaceITextDecorator- Returns:
- A
Stringcontaining the text
-
setText
public void setText(java.lang.String text)
Description copied from interface:ITextDecoratorSets the text or the decorator.- Specified by:
setTextin interfaceITextDecorator- Parameters:
text- AStringcontaining the text
-
getFontName
public java.lang.String getFontName()
Description copied from interface:ITextDecoratorGets the name of the font used in the decorator.- Specified by:
getFontNamein interfaceITextDecorator- Returns:
- A
Stringcontaining the name of the font.
-
setFontName
public void setFontName(java.lang.String fontName)
Description copied from interface:ITextDecoratorSets the name of the font used in the decorator.- Specified by:
setFontNamein interfaceITextDecorator- Parameters:
fontName- AStringcontaining the name of the font.
-
getFontSize
public int getFontSize()
Description copied from interface:ITextDecoratorGets the size of the font used in the decorator.- Specified by:
getFontSizein interfaceITextDecorator- Returns:
- An integer defining the size of the font.
-
setFontSize
public void setFontSize(int fontSize)
Description copied from interface:ITextDecoratorSets the size of the font used in the decorator.- Specified by:
setFontSizein interfaceITextDecorator- Parameters:
fontSize- An integer defining the size of the font.
-
getForegroundColor
public IColorConstant getForegroundColor()
Description copied from interface:ITextDecoratorReturns the color that will be used for painting the foreground of the shape to decorate. By default (when returningnull) the original foreground color of the shape is kept.- Specified by:
getForegroundColorin interfaceITextDecorator- Returns:
- a
IColorConstantdefining the color
-
setForegroundColor
public void setForegroundColor(IColorConstant foregroundColor)
Description copied from interface:ITextDecoratorSets the color that will be used for painting the foreground of the text. By default (when returningnull) the original foreground color of the text is kept.- Specified by:
setForegroundColorin interfaceITextDecorator
-
getBackgroundColor
public IColorConstant getBackgroundColor()
Description copied from interface:ITextDecoratorReturns the color that will be used for painting the background of the shape to decorate. By default (when returningnull) the original background color of the shape is kept.- Specified by:
getBackgroundColorin interfaceITextDecorator- Returns:
- a
IColorConstantdefining the color
-
setBackgroundColor
public void setBackgroundColor(IColorConstant backgroundColor)
Description copied from interface:ITextDecoratorSets the color that will be used for painting the background of the text. By default (when returningnull) the original background color of the text is kept.- Specified by:
setBackgroundColorin interfaceITextDecorator
-
-