Class FloatFormField.FloatFormFieldBuilder
java.lang.Object
com.github.tadukoo.view.form.field.FormField.FormFieldBuilder<Type>
com.github.tadukoo.view.form.field.number.NumberFormField.NumberFormFieldBuilder<Float>
com.github.tadukoo.view.form.field.number.FloatFormField.FloatFormFieldBuilder
- Enclosing class:
- FloatFormField
public static class FloatFormField.FloatFormFieldBuilder
extends NumberFormField.NumberFormFieldBuilder<Float>
Builder to be used to create an
This builder also provides methods and parameters for
FloatFormField
. 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 0 |
labelType | The LabelType to use for the field |
Defaults to LabelType.LABEL |
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 |
minValue | The minimum value allowed for the field | Defaults to null (no minimum) |
maxValue | The maximum value allowed for the field | Defaults to null (no maximum) |
stepSize | The increment value for the spinner for the field | Defaults to 1.0 |
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.1
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Fields inherited from class com.github.tadukoo.view.form.field.number.NumberFormField.NumberFormFieldBuilder
maxValue, minValue, stepSize
Fields 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
ModifierConstructorDescriptionprivate
Can't create outside of FloatFormField -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theFormField
colPos
(int colPos) colSpan
(int colSpan) defaultValue
(Float 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)
-
Constructor Details
-
FloatFormFieldBuilder
private FloatFormFieldBuilder()Can't create outside of FloatFormField
-
-
Method Details
-
key
- Overrides:
key
in classFormField.FormFieldBuilder<Float>
- Parameters:
key
- The name of the field (used as a key inForms
)- Returns:
- this, to continue building
-
defaultValue
- Overrides:
defaultValue
in classFormField.FormFieldBuilder<Float>
- Parameters:
defaultValue
- The starting value of the field- Returns:
- this, to continue building
-
labelType
- Overrides:
labelType
in classFormField.FormFieldBuilder<Float>
- Parameters:
labelType
- TheLabelType
to use for the field- Returns:
- this, to continue building
-
labelForegroundPaint
- Overrides:
labelForegroundPaint
in classFormField.FormFieldBuilder<Float>
- Parameters:
labelForegroundPaint
- TheSizablePaint
for the foreground of the Label- Returns:
- this, to continue building
-
labelBackgroundPaint
- Overrides:
labelBackgroundPaint
in classFormField.FormFieldBuilder<Float>
- Parameters:
labelBackgroundPaint
- TheSizablePaint
for the background of the Label- Returns:
- this, to continue building
-
labelFont
public FloatFormField.FloatFormFieldBuilder labelFont(FontFamily labelFontFamily, int labelFontStyle, int labelFontSize) Specifies the font to use on the Label- Overrides:
labelFont
in classFormField.FormFieldBuilder<Float>
- Parameters:
labelFontFamily
- TheFontFamily
for the Label's fontlabelFontStyle
- The font style for the LabellabelFontSize
- The font size for the Label- Returns:
- this, to continue building
-
labelShape
- Overrides:
labelShape
in classFormField.FormFieldBuilder<Float>
- Parameters:
labelShape
- TheShapeInfo
to use for the Label- Returns:
- this, to continue building
-
labelBorder
- Overrides:
labelBorder
in classFormField.FormFieldBuilder<Float>
- Parameters:
labelBorder
- TheBorder
to use for the Label- Returns:
- this, to continue building
-
rowPos
- Overrides:
rowPos
in classFormField.FormFieldBuilder<Float>
- Parameters:
rowPos
- The row position of the field- Returns:
- this, to continue building
-
colPos
- Overrides:
colPos
in classFormField.FormFieldBuilder<Float>
- Parameters:
colPos
- The column position of the field- Returns:
- this, to continue building
-
rowSpan
- Overrides:
rowSpan
in classFormField.FormFieldBuilder<Float>
- Parameters:
rowSpan
- The row span of the field- Returns:
- this, to continue building
-
colSpan
- Overrides:
colSpan
in classFormField.FormFieldBuilder<Float>
- Parameters:
colSpan
- The column span of the field- Returns:
- this, to continue building
-
logFontResourceLoaderWarnings
public FloatFormField.FloatFormFieldBuilder logFontResourceLoaderWarnings(boolean logFontResourceLoaderWarnings) - Overrides:
logFontResourceLoaderWarnings
in classFormField.FormFieldBuilder<Float>
- 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 FloatFormField.FloatFormFieldBuilder logger(com.github.tadukoo.util.logger.EasyLogger logger) - Overrides:
logger
in classFormField.FormFieldBuilder<Float>
- Parameters:
logger
- AnEasyLogger
that will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
graphEnv
- Overrides:
graphEnv
in classFormField.FormFieldBuilder<Float>
- Parameters:
graphEnv
- TheGraphicsEnvironment
to load fonts to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
fontFolder
- Overrides:
fontFolder
in classFormField.FormFieldBuilder<Float>
- 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 FloatFormField.FloatFormFieldBuilder fontResourceLoader(FontResourceLoader fontResourceLoader) - Overrides:
fontResourceLoader
in classFormField.FormFieldBuilder<Float>
- Parameters:
fontResourceLoader
- TheFontResourceLoader
to use in loading fonts and/or ensuring they're in the system- Returns:
- this, to continue building
-
minValue
- Overrides:
minValue
in classNumberFormField.NumberFormFieldBuilder<Float>
- Parameters:
minValue
- The minimum value allowed for the field- Returns:
- this, to continue building
-
maxValue
- Overrides:
maxValue
in classNumberFormField.NumberFormFieldBuilder<Float>
- Parameters:
maxValue
- The maximum value allowed for the field- Returns:
- this, to continue building
-
stepSize
- Overrides:
stepSize
in classNumberFormField.NumberFormFieldBuilder<Float>
- Parameters:
stepSize
- The increment value for the spinner for the field- Returns:
- this, to continue building
-
build
Builds theFormField
- Specified by:
build
in classNumberFormField.NumberFormFieldBuilder<Float>
- Returns:
- A newly created
FormField
-