Class TadukooLabel.TadukooLabelBuilder
java.lang.Object
com.github.tadukoo.view.components.TadukooLabel.TadukooLabelBuilder
- Enclosing class:
- TadukooLabel
Builder to be used to create a
There are also parameters for loading the font using a
TadukooLabel. It has the following parameters:
| Name | Description | Default or Required |
|---|---|---|
| text | The text to use on the Label | Defaults to null |
| icon | The icon to use on the Label | Defaults to null |
| foregroundPaint | The SizablePaint to use for the foreground of the Label |
Defaults to null (to use the Look & Feel's default Label foreground paint) |
| backgroundPaint | The SizablePaint to use for the background of the Label |
Defaults to null (to use the Look & Feel's default Label background paint) |
| disabledForegroundPaint | The SizablePaint to use for the disabled foreground of the Label |
Defaults to null (to use the Look & Feel's default Label disabledForeground paint) |
| font | The Font to use on the Label (specified via FontFamily, font style,
and font size |
Defaults to null (to use the Look & Feel's default Label font) |
| shapeInfo | The ShapeInfo to use on the Label |
Defaults to null (to use the Look & Feel's default Label shapeInfo) |
| border | The Border to use on the Label |
Defaults to null (to use the Look & Feel's default Label border) |
FontResourceLoader, which can be ignored if
you don't specify a Font for this label:
| Field | Description | Default Value |
|---|---|---|
| logFontResourceLoaderWarnings | Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader | false |
| logger | An EasyLogger that will be sent to the FontResourceLoader by default
- can be ignored if you specify your own FontResourceLoader |
null (since logging warnings is set to false by default) |
| graphEnv | The GraphicsEnvironment to load a font to in the FontResourceLoader
- can be ignored if you specify your own FontResourceLoader |
GraphicsEnvironment.getLocalGraphicsEnvironment() |
| fontFolder | The path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader | "fonts/" |
| fontResourceLoader | The FontResourceLoader to use in loading a font and/or ensuring they're in the system |
a new FontResourceLoader with the specified values for logFontResourceLoaderWarnings,
logger, graphEnv, and fontFolder |
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SizablePaintTheSizablePaintto use for the background of the Labelprivate BorderTheBorderto use on the Labelprivate SizablePaintTheSizablePaintto use for the disabled foreground of the Labelprivate FontFamilyTheFontFamilyto use on the font of the Labelprivate StringThe path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate FontResourceLoaderTheFontResourceLoaderto use in loading a font and/or ensuring they're in the systemprivate intThe font size to use on the font of the Labelprivate intThe font style to use on the font of the Labelprivate SizablePaintTheSizablePaintto use for the foreground of the Labelprivate GraphicsEnvironmentTheGraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate IconThe icon to use on the Labelprivate booleanWhether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate com.github.tadukoo.util.logger.EasyLoggerAnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoaderprivate ShapeInfoTheShapeInfoto use on the Labelprivate StringThe text to use on the Label -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCan't create Tadukoo Label Builder outside of Tadukoo Label -
Method Summary
Modifier and TypeMethodDescriptionbackgroundPaint(SizablePaint backgroundPaint) build()Builds aTadukooLabeldisabledForegroundPaint(SizablePaint disabledForegroundPaint) font(FontFamily fontFamily, int fontStyle, int fontSize) Specifies the font to use on the LabelfontFolder(String fontFolder) fontResourceLoader(FontResourceLoader fontResourceLoader) foregroundPaint(SizablePaint foregroundPaint) graphEnv(GraphicsEnvironment graphEnv) logFontResourceLoaderWarnings(boolean logFontResourceLoaderWarnings) logger(com.github.tadukoo.util.logger.EasyLogger logger)
-
Field Details
-
text
The text to use on the Label -
icon
The icon to use on the Label -
foregroundPaint
TheSizablePaintto use for the foreground of the Label -
backgroundPaint
TheSizablePaintto use for the background of the Label -
disabledForegroundPaint
TheSizablePaintto use for the disabled foreground of the Label -
fontFamily
TheFontFamilyto use on the font of the Label -
fontStyle
private int fontStyleThe font style to use on the font of the Label -
fontSize
private int fontSizeThe font size to use on the font of the Label -
shapeInfo
TheShapeInfoto use on the Label -
border
TheBorderto use on the Label -
logFontResourceLoaderWarnings
private boolean logFontResourceLoaderWarningsWhether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader -
logger
private com.github.tadukoo.util.logger.EasyLogger loggerAnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoader -
graphEnv
TheGraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader -
fontFolder
The path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader -
fontResourceLoader
TheFontResourceLoaderto use in loading a font and/or ensuring they're in the system
-
-
Constructor Details
-
TadukooLabelBuilder
private TadukooLabelBuilder()Can't create Tadukoo Label Builder outside of Tadukoo Label
-
-
Method Details
-
text
- Parameters:
text- The text to use on the Label- Returns:
- this, to continue building
-
icon
- Parameters:
icon- The icon to use on the Label- Returns:
- this, to continue building
-
foregroundPaint
- Parameters:
foregroundPaint- TheSizablePaintto use for the foreground of the Label- Returns:
- this, to continue building
-
backgroundPaint
- Parameters:
backgroundPaint- TheSizablePaintto use for the background of the Label- Returns:
- this, to continue building
-
disabledForegroundPaint
public TadukooLabel.TadukooLabelBuilder disabledForegroundPaint(SizablePaint disabledForegroundPaint) - Parameters:
disabledForegroundPaint- TheSizablePaintto use for the disabled foreground of the Label- Returns:
- this, to continue building
-
font
Specifies the font to use on the Label- Parameters:
fontFamily- TheFontFamilyto usefontStyle- The font style to usefontSize- The font size to use- Returns:
- this, to continue building
-
shapeInfo
- Parameters:
shapeInfo- TheShapeInfoto use on the Label- Returns:
- this, to continue building
-
border
- Parameters:
border- TheBorderto use on the Label- Returns:
- this, to continue building
-
logFontResourceLoaderWarnings
public TadukooLabel.TadukooLabelBuilder logFontResourceLoaderWarnings(boolean logFontResourceLoaderWarnings) - Parameters:
logFontResourceLoaderWarnings- Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
logger
- Parameters:
logger- AnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
graphEnv
- Parameters:
graphEnv- TheGraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
fontFolder
- Parameters:
fontFolder- The path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
fontResourceLoader
- Parameters:
fontResourceLoader- TheFontResourceLoaderto use in loading a font and/or ensuring they're in the system- Returns:
- this, to continue building
-
build
Builds aTadukooLabel- Returns:
- A newly created
TadukooLabel - Throws:
IOException- If something goes wrong duringfont resource loadingFontFormatException- If something goes wrong duringfont resource loading
-