Package org.fest.swing.fixture
Class FontFixture
java.lang.Object
org.fest.swing.fixture.FontFixture
Understands state verification of
Font
s.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFontFixture
(Font target) Creates a newFontFixture
.FontFixture
(Font target, String description) Creates a newFontFixture
.FontFixture
(Font target, org.fest.assertions.Description description) Creates a newFontFixture
. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Returns this fixture's description.private String
Verifies that this fixture's font is bold.private FontFixture
requireBold
(boolean bold) requireFamily
(String family) Verifies that the family name of this fixture's font is equal to the given one.Verifies that this fixture's font is italic.private FontFixture
requireItalic
(boolean italic) requireName
(String name) Verifies that the logical name of this fixture's font is equal to the given one.Verifies that this fixture's font is not bold.Verifies that this fixture's font is not italic.Verifies that this fixture's font is not plain.Verifies that this fixture's font is plain.private FontFixture
requirePlain
(boolean plain) requireSize
(int size) Verifies that the point size of this fixture's font is equal to the given one.target()
Returns this fixture's font.
-
Field Details
-
PROPERTY_SEPARATOR
- See Also:
-
BOLD_PROPERTY
- See Also:
-
FAMILY_PROPERTY
- See Also:
-
ITALIC_PROPERTY
- See Also:
-
NAME_PROPERTY
- See Also:
-
PLAIN_PROPERTY
- See Also:
-
SIZE_PROPERTY
- See Also:
-
target
-
description
private final org.fest.assertions.Description description
-
-
Constructor Details
-
FontFixture
Creates a newFontFixture
.- Parameters:
target
- the font to manage.- Throws:
NullPointerException
- iftarget
isnull
.
-
FontFixture
Creates a newFontFixture
.- Parameters:
target
- the font to manage.description
- this fixture's description.- Throws:
NullPointerException
- iftarget
isnull
.
-
FontFixture
Creates a newFontFixture
.- Parameters:
target
- the font to manage.description
- this fixture's description.- Throws:
NullPointerException
- iftarget
isnull
.
-
-
Method Details
-
requireFamily
Verifies that the family name of this fixture's font is equal to the given one.- Parameters:
family
- the expected family name.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the family name of this fixture's font is not equal to the given one.- See Also:
-
requireName
Verifies that the logical name of this fixture's font is equal to the given one.- Parameters:
name
- the expected logical name.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the logical name of this fixture's font is not equal to the given one.- See Also:
-
requireSize
Verifies that the point size of this fixture's font is equal to the given one.- Parameters:
size
- the expected point size.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the point size of this fixture's font is not equal to the given one.- See Also:
-
requireBold
Verifies that this fixture's font is bold.- Returns:
- this assertion object.
- Throws:
AssertionError
- if this fixture's font is not bold.- See Also:
-
requireNotBold
Verifies that this fixture's font is not bold.- Returns:
- this assertion object.
- Throws:
AssertionError
- if this fixture's font is bold.- See Also:
-
requireBold
-
requireItalic
Verifies that this fixture's font is italic.- Returns:
- this assertion object.
- Throws:
AssertionError
- if this fixture's font is not italic.- See Also:
-
requireNotItalic
Verifies that this fixture's font is not italic.- Returns:
- this assertion object.
- Throws:
AssertionError
- if this fixture's font is italic.- See Also:
-
requireItalic
-
requirePlain
Verifies that this fixture's font is plain.- Returns:
- this assertion object.
- Throws:
AssertionError
- if this fixture's font is not plain.- See Also:
-
requireNotPlain
Verifies that this fixture's font is not plain.- Returns:
- this assertion object.
- Throws:
AssertionError
- if this fixture's font is plain.- See Also:
-
requirePlain
-
property
-
target
Returns this fixture's font.- Returns:
- this fixture's font.
-
description
Returns this fixture's description.- Returns:
- this fixture's description.
-