Class ButtonFormField
java.lang.Object
com.github.tadukoo.view.form.field.FormField<String>
com.github.tadukoo.view.form.field.ButtonFormField
Button Form Field is a
FormField that is just a button- Since:
- Alpha v.0.2
- 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.FormField
FormField.FormFieldBuilder<Type> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ActionListenerThe action to perform on click of the Buttonprivate final SizablePaintTheSizablePaintto use for the background of the Buttonprivate final BorderTheBorderto use on the Buttonprivate final SizablePaintTheSizablePaintto use for disabled text on the Buttonprivate final SizablePaintTheSizablePaintto use for when the Button is focusedprivate final FontFamilyTheFontFamilyto use on the font of the Buttonprivate final intThe font size to use on the font of the Buttonprivate final intThe font style to use on the font of the Buttonprivate final SizablePaintTheSizablePaintto use for the foreground of the Buttonprivate final SizablePaintTheSizablePaintto use for when the Button is selectedprivate final ShapeInfoTheShapeInfoto use on the Button -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateButtonFormField(String key, String 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, ActionListener actionListener, SizablePaint buttonForegroundPaint, SizablePaint buttonBackgroundPaint, SizablePaint buttonSelectPaint, SizablePaint buttonFocusPaint, SizablePaint buttonDisabledTextPaint, FontFamily buttonFontFamily, int buttonFontStyle, int buttonFontSize, Border buttonBorder, ShapeInfo buttonShape) Creates a new ButtonFormField with the given parameters -
Method Summary
Modifier and TypeMethodDescriptionbuilder()intintCreates theJComponentto be used for this field.getValue(JComponent component) Takes in theJComponentfor this field and grabs the data off of it, returning it in the proper format for the field to be repopulated on the form.Methods 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
-
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 final int buttonFontStyleThe font style to use on the font of the Button -
buttonFontSize
private final 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
-
ButtonFormField
private ButtonFormField(String key, String 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, ActionListener actionListener, SizablePaint buttonForegroundPaint, SizablePaint buttonBackgroundPaint, SizablePaint buttonSelectPaint, SizablePaint buttonFocusPaint, SizablePaint buttonDisabledTextPaint, FontFamily buttonFontFamily, int buttonFontStyle, int buttonFontSize, Border buttonBorder, ShapeInfo buttonShape) Creates a new ButtonFormField with the given parameters- Parameters:
key- The name of this field (used as a key in Forms)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 fieldactionListener- The action to perform on click of the ButtonbuttonForegroundPaint- TheSizablePaintto use for the foreground of the ButtonbuttonBackgroundPaint- TheSizablePaintto use for the background of the ButtonbuttonSelectPaint- TheSizablePaintto use for when the Button is selectedbuttonFocusPaint- TheSizablePaintto use for when the Button is focusedbuttonDisabledTextPaint- TheSizablePaintto use for disabled text on the ButtonbuttonFontFamily- TheFontFamilyto use on the font of the ButtonbuttonFontStyle- The font style to use on the font of the ButtonbuttonFontSize- The font size to use on the font of the ButtonbuttonBorder- TheBorderto use on the ButtonbuttonShape- TheShapeInfoto use on the Button
-
-
Method Details
-
builder
- Returns:
- A new
ButtonFormField.ButtonFormFieldBuilderto use to make aButtonFormField
-
getActionListener
- Returns:
- The action to perform on click of the Button
-
getButtonForegroundPaint
- Returns:
- The
SizablePaintto use for the foreground of the Button
-
getButtonBackgroundPaint
- Returns:
- The
SizablePaintto use for the background of the Button
-
getButtonSelectPaint
- Returns:
- The
SizablePaintto use for when the Button is selected
-
getButtonFocusPaint
- Returns:
- The
SizablePaintto use for when the Button is focused
-
getButtonDisabledTextPaint
- Returns:
- The
SizablePaintto use for disabled text on the Button
-
getButtonFontFamily
- Returns:
- The
FontFamilyto use on the font of the Button
-
getButtonFontStyle
public int getButtonFontStyle()- Returns:
- The font style to use on the font of the Button
-
getButtonFontSize
public int getButtonFontSize()- Returns:
- The font size to use on the font of the Button
-
getButtonBorder
- Returns:
- The
Borderto use on the Button
-
getButtonShape
- Returns:
- The
ShapeInfoto use on the Button
-
getComponent
Creates theJComponentto be used for this field.- Specified by:
getComponentin classFormField<String>- Returns:
- A newly created
JComponentto use on the form - Throws:
IOExceptionFontFormatException
-
getValue
Takes in theJComponentfor this field and grabs the data off of it, returning it in the proper format for the field to be repopulated on the form.- Specified by:
getValuein classFormField<String>- Parameters:
component- TheJComponentassociated with this field- Returns:
- The data extracted from the
JComponent
-