Class TadukooButton.TadukooButtonBuilder
java.lang.Object
com.github.tadukoo.view.components.TadukooButton.TadukooButtonBuilder
- Enclosing class:
 - TadukooButton
 
Builder to be used to create a 
     
 There are also parameters for loading the font using a 
     
TadukooButton. It has the following parameters:
 | Name | Description | Default Value or Required | 
|---|---|---|
| text | The text to use on the Button | Defaults to null | 
| icon | The icon to use on the Button | Defaults to null | 
| actionListener | The action to perform on click of the Button | Defaults to null | 
| foregroundPaint | The SizablePaint to use for the foreground of the Button | 
         Defaults to null (to use the Look & Feel's default Button foreground paint) | 
| backgroundPaint | The SizablePaint to use for the background of the Button | 
         Defaults to null (to use the Look & Feel's default Button background paint) | 
| selectPaint | The SizablePaint to use for when the Button is selected | 
         Defaults to null (to use the Look & Feel's default Button select paint) | 
| focusPaint | The SizablePaint to use for when the Button is focused | 
         Defaults to null (to use the Look & Feel's default Button focus paint) | 
| disabledTextPaint | The SizablePaint to use for disabled text on the Button | 
         Defaults to null (to use the Look & Feel's default Button disabled text paint) | 
| font | The Font to use on the Button (specified via FontFamily, font style,
         and font size | 
         Defaults to null (to use the Look & Feel's default Button font) | 
| shapeInfo | The ShapeInfo to use on the Button | 
         Defaults to null (to use the Look & Feel's default Button shape, if supported) | 
| border | The Border to use on the Button | 
         Defaults to null (to use the Look & Feel's default Button border) | 
FontResourceLoader, which can be ignored if
 you don't specify a Font for this button:
 | 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 | 
     
- Since:
 - Alpha v.0.2
 - Version:
 - Alpha v.0.3
 - Author:
 - Logan Ferree (Tadukoo)
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ActionListenerThe action to perform on click of the Buttonprivate SizablePaintTheSizablePaintto use for the background of the Buttonprivate BorderTheBorderto use on the Buttonprivate SizablePaintTheSizablePaintto use for disabled text on the Buttonprivate SizablePaintTheSizablePaintto use for when the Button is focusedprivate FontFamilyTheFontFamilyto use on the font of the Buttonprivate 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 Buttonprivate intThe font style to use on the font of the Buttonprivate SizablePaintTheSizablePaintto use for the foreground of the Buttonprivate GraphicsEnvironmentTheGraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate IconThe icon to use on the Buttonprivate 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 SizablePaintTheSizablePaintto use for when the Button is selectedprivate ShapeInfoTheShapeInfoto use on the Buttonprivate StringThe text to use on the Button - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCan't create outside of Tadukoo Button - 
Method Summary
Modifier and TypeMethodDescriptionactionListener(ActionListener actionListener) backgroundPaint(SizablePaint backgroundPaint) build()Builds aTadukooButtondisabledTextPaint(SizablePaint disabledTextPaint) focusPaint(SizablePaint focusPaint) font(FontFamily fontFamily, int fontStyle, int fontSize) Specifies the font to use on the ButtonfontFolder(String fontFolder) fontResourceLoader(FontResourceLoader fontResourceLoader) foregroundPaint(SizablePaint foregroundPaint) graphEnv(GraphicsEnvironment graphEnv) logFontResourceLoaderWarnings(boolean logFontResourceLoaderWarnings) logger(com.github.tadukoo.util.logger.EasyLogger logger) selectPaint(SizablePaint selectPaint)  
- 
Field Details
- 
text
The text to use on the Button - 
icon
The icon to use on the Button - 
actionListener
The action to perform on click of the Button - 
foregroundPaint
TheSizablePaintto use for the foreground of the Button - 
backgroundPaint
TheSizablePaintto use for the background of the Button - 
selectPaint
TheSizablePaintto use for when the Button is selected - 
focusPaint
TheSizablePaintto use for when the Button is focused - 
disabledTextPaint
TheSizablePaintto use for disabled text on the Button - 
fontFamily
TheFontFamilyto use on the font of the Button - 
fontStyle
private int fontStyleThe font style to use on the font of the Button - 
fontSize
private int fontSizeThe font size to use on the font of the Button - 
shapeInfo
TheShapeInfoto use on the Button - 
border
TheBorderto use on the Button - 
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
- 
TadukooButtonBuilder
private TadukooButtonBuilder()Can't create outside of Tadukoo Button 
 - 
 - 
Method Details
- 
text
- Parameters:
 text- The text to use on the Button- Returns:
 - this, to continue building
 
 - 
icon
- Parameters:
 icon- The icon to use on the Button- Returns:
 - this, to continue building
 
 - 
actionListener
- Parameters:
 actionListener- The action to perform on click of the Button- Returns:
 - this, to continue building
 
 - 
foregroundPaint
- Parameters:
 foregroundPaint- TheSizablePaintto use for the foreground of the Button- Returns:
 - this, to continue building
 
 - 
backgroundPaint
- Parameters:
 backgroundPaint- TheSizablePaintto use for the background of the Button- Returns:
 - this, to continue building
 
 - 
selectPaint
- Parameters:
 selectPaint- TheSizablePaintto use for when the Button is selected- Returns:
 - this, to continue building
 
 - 
focusPaint
- Parameters:
 focusPaint- TheSizablePaintto use for when the Button is focused- Returns:
 - this, to continue building
 
 - 
disabledTextPaint
- Parameters:
 disabledTextPaint- TheSizablePaintto use for disabled text on the Button- Returns:
 - this, to continue building
 
 - 
font
Specifies the font to use on the Button- 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 Button- Returns:
 - this, to continue building
 
 - 
border
- Parameters:
 border- TheBorderto use on the Button- Returns:
 - this, to continue building
 
 - 
logFontResourceLoaderWarnings
public TadukooButton.TadukooButtonBuilder 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 aTadukooButton- Returns:
 - A newly created 
TadukooButton - Throws:
 IOException- If something goes wrong duringfont resource loadingFontFormatException- If something goes wrong duringfont resource loading
 
 -