Class IntFormField
java.lang.Object
com.github.tadukoo.view.form.field.FormField<Type>
com.github.tadukoo.view.form.field.number.NumberFormField<Integer>
com.github.tadukoo.view.form.field.number.IntFormField
An Int Form Field is a
FormField used to store Integers.- Since:
- Alpha v.0.2.1
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.github.tadukoo.view.form.field.number.NumberFormField
NumberFormField.NumberFormFieldBuilder<Type extends Number & Comparable<?>>Nested classes/interfaces inherited from class com.github.tadukoo.view.form.field.FormField
FormField.FormFieldBuilder<Type> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateIntFormField(String key, Integer defaultValue, LabelType labelType, SizablePaint labelForegroundPaint, SizablePaint labelBackgroundPaint, FontFamily labelFontFamily, int labelFontStyle, int labelFontSize, ShapeInfo labelShape, Border labelBorder, int rowPos, int colPos, int rowSpan, int colSpan, boolean logFontResourceLoaderWarnings, com.github.tadukoo.util.logger.EasyLogger logger, GraphicsEnvironment graphEnv, String fontFolder, FontResourceLoader fontResourceLoader, Integer minValue, Integer maxValue, Integer stepSize) Creates a new IntFormField with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()protected IntegerconvertToType(Number number) Used inNumberFormField.getValue(JComponent)to convert theNumberfrom theJSpinnerinto the type used in this particular FormField.Methods inherited from class com.github.tadukoo.view.form.field.number.NumberFormField
getComponent, getMaxValue, getMinValue, getStepSize, getValueMethods inherited from class com.github.tadukoo.view.form.field.FormField
getColPos, getColSpan, getDefaultValue, getFontFolder, getFontResourceLoader, getGraphEnv, getKey, getLabelBackgroundPaint, getLabelBorder, getLabelFontFamily, getLabelFontSize, getLabelFontStyle, getLabelForegroundPaint, getLabelShape, getLabelType, getLogger, getRowPos, getRowSpan, getType, logFontResourceLoaderWarnings
-
Constructor Details
-
IntFormField
private IntFormField(String key, Integer defaultValue, LabelType labelType, SizablePaint labelForegroundPaint, SizablePaint labelBackgroundPaint, FontFamily labelFontFamily, int labelFontStyle, int labelFontSize, ShapeInfo labelShape, Border labelBorder, int rowPos, int colPos, int rowSpan, int colSpan, boolean logFontResourceLoaderWarnings, com.github.tadukoo.util.logger.EasyLogger logger, GraphicsEnvironment graphEnv, String fontFolder, FontResourceLoader fontResourceLoader, Integer minValue, Integer maxValue, Integer stepSize) Creates a new IntFormField with the given parameters.- Parameters:
key- The name of this field (used as a key inForms)defaultValue- The starting value of the fieldlabelType- TheLabelTypeto use for this fieldlabelForegroundPaint- TheSizablePaintfor the foreground of the LabellabelBackgroundPaint- TheSizablePaintfor the background of the LabellabelFontFamily- TheFontFamilyfor the Label's fontlabelFontStyle- The font style for the LabellabelFontSize- The font size for the LabellabelShape- TheShapeInfoto use for the LabellabelBorder- TheBorderto use for the LabelrowPos- The row position of this fieldcolPos- The column position of this fieldrowSpan- The row span of this fieldcolSpan- The column span of this fieldlogFontResourceLoaderWarnings- Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderlogger- AnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoadergraphEnv- TheGraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderfontFolder- The path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderfontResourceLoader- TheFontResourceLoaderto use for fonts on this fieldminValue- The minimum value allowed for this fieldmaxValue- The maximum value allowed for this fieldstepSize- The increment value for the spinner for this field
-
-
Method Details
-
builder
- Returns:
- A new
IntFormField.IntFormFieldBuilderto use to make anIntFormField
-
convertToType
Used inNumberFormField.getValue(JComponent)to convert theNumberfrom theJSpinnerinto the type used in this particular FormField.- Specified by:
convertToTypein classNumberFormField<Integer>- Parameters:
number- TheNumberwe got from theJSpinner- Returns:
- The number in its proper Type
-