Class ButtonFormField.ButtonFormFieldBuilder
java.lang.Object
com.github.tadukoo.view.form.field.FormField.FormFieldBuilder<String>
com.github.tadukoo.view.form.field.ButtonFormField.ButtonFormFieldBuilder
- Enclosing class:
- ButtonFormField
public static class ButtonFormField.ButtonFormFieldBuilder
extends FormField.FormFieldBuilder<String>
Builder to be used to create a
This builder also provides methods and parameters for
ButtonFormField. It has the following parameters:
| Name | Description | Default Value or Required |
|---|---|---|
| key | The name of the field (used as a key in Forms) |
Required |
| defaultValue | The starting value of the field | Defaults to null |
| labelType | The LabelType to use for the field |
Defaults to LabelType.NONE |
| labelForegroundPaint | The SizablePaint for the foreground of the Label |
Defaults to null (to use the Look & Feel's default Label foreground paint) |
| labelBackgroundPaint | The SizablePaint for the background of the Label |
Defaults to null (to use the Look & Feel's default Label background paint) |
| labelFont | The Font to use for the Label - specified as a FontFamily, style, and size |
Defaults to null (to use the Look & Feel's default Label font) |
| labelShape | The ShapeInfo to use for the Label |
Defaults to null (to use the Look & Feel's default Label shape) |
| labelBorder | The Border to use for the Label |
Defaults to null (to use the Look & Feel's default Label border) |
| rowPos | The row position of the field | Required |
| colPos | The column position of the field | Required |
| rowSpan | The row span of the field | Defaults to 1 |
| colSpan | The column span of the field | Defaults to 1 |
| actionListener | The action to perform on click of the Button | Defaults to null (no action) |
| buttonForegroundPaint | The SizablePaint to use for the foreground of the Button |
Defaults to null (to use the Look & Feel's default Button foreground paint) |
| buttonBackgroundPaint | The SizablePaint to use for the background of the Button |
Defaults to null (to use the Look & Feel's default Button background paint) |
| buttonSelectPaint | The SizablePaint to use for when the Button is selected |
Defaults to null (to use the Look & Feel's default Button select paint) |
| buttonFocusPaint | The SizablePaint to use for when the Button is focused |
Defaults to null (to use the Look & Feel's default Button focus paint) |
| buttonDisabledTextPaint | The SizablePaint to use for disabled text on the Button |
Defaults to null (to use the Look & Feel's default Button disabled text paint) |
| buttonFont | 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) |
| buttonBorder | The Border to use on the Button |
Defaults to null (to use the Look & Feel's default Button border) |
| buttonShape | The ShapeInfo to use on the Button |
Defaults to null (to use the Look & Feel's default Button shape) |
font resource loading:
| 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 fonts 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 fonts and/or ensuring they're in the system |
a new FontResourceLoader with the specified values for logFontResourceLoaderWarnings(boolean),
logger(com.github.tadukoo.util.logger.EasyLogger), graphEnv(java.awt.GraphicsEnvironment), and fontFolder(java.lang.String) |
- 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 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 SizablePaintTheSizablePaintto use for when the Button is selectedprivate ShapeInfoTheShapeInfoto use on the ButtonFields inherited from class com.github.tadukoo.view.form.field.FormField.FormFieldBuilder
colPos, colSpan, defaultValue, fontFolder, fontResourceLoader, graphEnv, key, labelBackgroundPaint, labelBorder, labelFontFamily, labelFontSize, labelFontStyle, labelForegroundPaint, labelShape, labelType, logFontResourceLoaderWarnings, logger, rowPos, rowSpan -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNot allowed to create ButtonFormFieldBuilder outside of ButtonFormField -
Method Summary
Modifier and TypeMethodDescriptionactionListener(ActionListener actionListener) build()Builds theFormFieldbuttonBackgroundPaint(SizablePaint buttonBackgroundPaint) buttonBorder(Border buttonBorder) buttonDisabledTextPaint(SizablePaint buttonDisabledTextPaint) buttonFocusPaint(SizablePaint buttonFocusPaint) buttonFont(FontFamily buttonFontFamily, int buttonFontStyle, int buttonFontSize) Specifies the font to use on the ButtonbuttonForegroundPaint(SizablePaint buttonForegroundPaint) buttonSelectPaint(SizablePaint buttonSelectPaint) buttonShape(ShapeInfo buttonShape) colPos(int colPos) colSpan(int colSpan) defaultValue(String defaultValue) fontFolder(String fontFolder) fontResourceLoader(FontResourceLoader fontResourceLoader) graphEnv(GraphicsEnvironment graphEnv) labelBackgroundPaint(SizablePaint labelBackgroundPaint) labelBorder(Border labelBorder) labelFont(FontFamily labelFontFamily, int labelFontStyle, int labelFontSize) Specifies the font to use on the LabellabelForegroundPaint(SizablePaint labelForegroundPaint) labelShape(ShapeInfo labelShape) logFontResourceLoaderWarnings(boolean logFontResourceLoaderWarnings) logger(com.github.tadukoo.util.logger.EasyLogger logger) rowPos(int rowPos) rowSpan(int rowSpan)
-
Field Details
-
actionListener
The action to perform on click of the Button -
buttonForegroundPaint
TheSizablePaintto use for the foreground of the Button -
buttonBackgroundPaint
TheSizablePaintto use for the background of the Button -
buttonSelectPaint
TheSizablePaintto use for when the Button is selected -
buttonFocusPaint
TheSizablePaintto use for when the Button is focused -
buttonDisabledTextPaint
TheSizablePaintto use for disabled text on the Button -
buttonFontFamily
TheFontFamilyto use on the font of the Button -
buttonFontStyle
private int buttonFontStyleThe font style to use on the font of the Button -
buttonFontSize
private int buttonFontSizeThe font size to use on the font of the Button -
buttonBorder
TheBorderto use on the Button -
buttonShape
TheShapeInfoto use on the Button
-
-
Constructor Details
-
ButtonFormFieldBuilder
private ButtonFormFieldBuilder()Not allowed to create ButtonFormFieldBuilder outside of ButtonFormField
-
-
Method Details
-
key
- Overrides:
keyin classFormField.FormFieldBuilder<String>- Parameters:
key- The name of the field (used as a key inForms)- Returns:
- this, to continue building
-
defaultValue
- Overrides:
defaultValuein classFormField.FormFieldBuilder<String>- Parameters:
defaultValue- The starting value of the field- Returns:
- this, to continue building
-
labelType
- Overrides:
labelTypein classFormField.FormFieldBuilder<String>- Parameters:
labelType- TheLabelTypeto use for the field- Returns:
- this, to continue building
-
labelForegroundPaint
public ButtonFormField.ButtonFormFieldBuilder labelForegroundPaint(SizablePaint labelForegroundPaint) - Overrides:
labelForegroundPaintin classFormField.FormFieldBuilder<String>- Parameters:
labelForegroundPaint- TheSizablePaintfor the foreground of the Label- Returns:
- this, to continue building
-
labelBackgroundPaint
public ButtonFormField.ButtonFormFieldBuilder labelBackgroundPaint(SizablePaint labelBackgroundPaint) - Overrides:
labelBackgroundPaintin classFormField.FormFieldBuilder<String>- Parameters:
labelBackgroundPaint- TheSizablePaintfor the background of the Label- Returns:
- this, to continue building
-
labelFont
public ButtonFormField.ButtonFormFieldBuilder labelFont(FontFamily labelFontFamily, int labelFontStyle, int labelFontSize) Specifies the font to use on the Label- Overrides:
labelFontin classFormField.FormFieldBuilder<String>- Parameters:
labelFontFamily- TheFontFamilyfor the Label's fontlabelFontStyle- The font style for the LabellabelFontSize- The font size for the Label- Returns:
- this, to continue building
-
labelShape
- Overrides:
labelShapein classFormField.FormFieldBuilder<String>- Parameters:
labelShape- TheShapeInfoto use for the Label- Returns:
- this, to continue building
-
labelBorder
- Overrides:
labelBorderin classFormField.FormFieldBuilder<String>- Parameters:
labelBorder- TheBorderto use for the Label- Returns:
- this, to continue building
-
rowPos
- Overrides:
rowPosin classFormField.FormFieldBuilder<String>- Parameters:
rowPos- The row position of the field- Returns:
- this, to continue building
-
colPos
- Overrides:
colPosin classFormField.FormFieldBuilder<String>- Parameters:
colPos- The column position of the field- Returns:
- this, to continue building
-
rowSpan
- Overrides:
rowSpanin classFormField.FormFieldBuilder<String>- Parameters:
rowSpan- The row span of the field- Returns:
- this, to continue building
-
colSpan
- Overrides:
colSpanin classFormField.FormFieldBuilder<String>- Parameters:
colSpan- The column span of the field- Returns:
- this, to continue building
-
logFontResourceLoaderWarnings
public ButtonFormField.ButtonFormFieldBuilder logFontResourceLoaderWarnings(boolean logFontResourceLoaderWarnings) - Overrides:
logFontResourceLoaderWarningsin classFormField.FormFieldBuilder<String>- 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
public ButtonFormField.ButtonFormFieldBuilder logger(com.github.tadukoo.util.logger.EasyLogger logger) - Overrides:
loggerin classFormField.FormFieldBuilder<String>- 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
- Overrides:
graphEnvin classFormField.FormFieldBuilder<String>- Parameters:
graphEnv- TheGraphicsEnvironmentto load fonts to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
fontFolder
- Overrides:
fontFolderin classFormField.FormFieldBuilder<String>- 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
public ButtonFormField.ButtonFormFieldBuilder fontResourceLoader(FontResourceLoader fontResourceLoader) - Overrides:
fontResourceLoaderin classFormField.FormFieldBuilder<String>- Parameters:
fontResourceLoader- TheFontResourceLoaderto use in loading fonts and/or ensuring they're in the system- Returns:
- this, to continue building
-
actionListener
- Parameters:
actionListener- The action to perform on click of the Button- Returns:
- this, to continue building
-
buttonForegroundPaint
public ButtonFormField.ButtonFormFieldBuilder buttonForegroundPaint(SizablePaint buttonForegroundPaint) - Parameters:
buttonForegroundPaint- TheSizablePaintto use for the foreground of the Button- Returns:
- this, to continue building
-
buttonBackgroundPaint
public ButtonFormField.ButtonFormFieldBuilder buttonBackgroundPaint(SizablePaint buttonBackgroundPaint) - Parameters:
buttonBackgroundPaint- TheSizablePaintto use for the background of the Button- Returns:
- this, to continue building
-
buttonSelectPaint
- Parameters:
buttonSelectPaint- TheSizablePaintto use for when the Button is selected- Returns:
- this, to continue building
-
buttonFocusPaint
- Parameters:
buttonFocusPaint- TheSizablePaintto use for when the Button is focused- Returns:
- this, to continue building
-
buttonDisabledTextPaint
public ButtonFormField.ButtonFormFieldBuilder buttonDisabledTextPaint(SizablePaint buttonDisabledTextPaint) - Parameters:
buttonDisabledTextPaint- TheSizablePaintto use for disabled text on the Button- Returns:
- this, to continue building
-
buttonFont
public ButtonFormField.ButtonFormFieldBuilder buttonFont(FontFamily buttonFontFamily, int buttonFontStyle, int buttonFontSize) Specifies the font to use on the Button- Parameters:
buttonFontFamily- TheFontFamilyto usebuttonFontStyle- The font style to usebuttonFontSize- The font size to use- Returns:
- this, to continue building
-
buttonBorder
- Parameters:
buttonBorder- TheBorderto use on the Button- Returns:
- this, to continue building
-
buttonShape
- Parameters:
buttonShape- TheShapeInfoto use on the Button- Returns:
- this, to continue building
-
build
Builds theFormField- Specified by:
buildin classFormField.FormFieldBuilder<String>- Returns:
- A newly created
FormField
-