public class Background extends Object
IElement
's background. This class is meant to be used as the value for the Property.BACKGROUND
key in an IPropertyContainer
. Allows to define a background color, and positive or negative changes to the location of the edges of the background coloring.
Modifier and Type | Field and Description |
---|---|
protected Color |
color
Deprecated.
|
protected float |
extraBottom |
protected float |
extraLeft |
protected float |
extraRight |
protected float |
extraTop |
protected TransparentColor |
transparentColor |
Constructor and Description |
---|
Background(Color color)
Creates a background with a specified color.
|
Background(Color color, float opacity)
Creates a background with a specified color and opacity.
|
Background(Color color, float extraLeft, float extraTop, float extraRight, float extraBottom)
Creates a background with a specified color, and extra space that must be counted as part of the background and therefore colored.
|
Background(Color color, float opacity, float extraLeft, float extraTop, float extraRight, float extraBottom)
Creates a background with a specified color, and extra space that must be counted as part of the background and therefore colored.
|
Modifier and Type | Method and Description |
---|---|
Color |
getColor()
Gets the background's color.
|
float |
getExtraBottom()
Gets the extra space that must be filled at the bottom of the Element.
|
float |
getExtraLeft()
Gets the extra space that must be filled to the left of the Element.
|
float |
getExtraRight()
Gets the extra space that must be filled to the right of the Element.
|
float |
getExtraTop()
Gets the extra space that must be filled at the top of the Element.
|
float |
getOpacity()
Gets the opacity of the background.
|
@Deprecated protected Color color
protected TransparentColor transparentColor
protected float extraLeft
protected float extraRight
protected float extraTop
protected float extraBottom
public Background(Color color)
color
- the background color
public Background(Color color, float opacity)
color
- the background color
opacity
- the opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
public Background(Color color, float extraLeft, float extraTop, float extraRight, float extraBottom)
color
- the background color
extraLeft
- extra coloring to the left side
extraTop
- extra coloring at the top
extraRight
- extra coloring to the right side
extraBottom
- extra coloring at the bottom
public Background(Color color, float opacity, float extraLeft, float extraTop, float extraRight, float extraBottom)
color
- the background color
opacity
- the opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
extraLeft
- extra coloring to the left side
extraTop
- extra coloring at the top
extraRight
- extra coloring to the right side
extraBottom
- extra coloring at the bottom
public Color getColor()
Color
of any supported kind
public float getOpacity()
public float getExtraLeft()
public float getExtraRight()
public float getExtraTop()
public float getExtraBottom()
Copyright © 1998–2017 iText Group NV. All rights reserved.