Class EditorColor
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.configurable.editor.EditorDefault<Color>
-
- de.fraunhofer.iosb.ilt.configurable.editor.EditorColor
-
- All Implemented Interfaces:
ConfigEditor<Color>
public class EditorColor extends EditorDefault<Color>
- Author:
- Hylke van der Schaaf
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEditorColor.EdOptsColor
-
Field Summary
Fields Modifier and Type Field Description Set<String>profilesEdit-
Fields inherited from interface de.fraunhofer.iosb.ilt.configurable.ConfigEditor
DEFAULT_PROFILE_NAME
-
-
Constructor Summary
Constructors Constructor Description EditorColor()EditorColor(Color dflt)EditorColor(Color deflt, boolean editAlpha)EditorColor(Color deflt, boolean editAlpha, String label, String description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanEdit()True if the component is editable in the current profile.intgetAlpha()intgetBlue()com.google.gson.JsonElementgetConfig()Get the current (edited) state of the configuration.intgetGreen()GuiFactoryFxgetGuiFactoryFx()Get a factory that can generate a JavaFX-based gui for this editor.GuiFactorySwinggetGuiFactorySwing()Get a factory that can generate a swing-based gui for this editor.SchemaItemgetJsonSchema(RootSchema rootSchema)Get the JSON Schema for this editor, using the given rootSchema for shared $defs.intgetRed()ColorgetValue()Get the value configured in the editor.voidinitFor(Field field)Initialise the editor for the given Field, using the Field name and type and any annotations present on the Field.booleanisDefault()booleanisEditAlpla()voidsetAlpha(int alpha)voidsetBlue(int blue)voidsetConfig(com.google.gson.JsonElement config)Load the given configuration into this editor.voidsetGreen(int green)voidsetProfile(String profile)Sets the currently active profile.voidsetProfilesEdit(String csv)voidsetRed(int red)voidsetValue(Color value)Set the value in the editor.-
Methods inherited from class de.fraunhofer.iosb.ilt.configurable.editor.EditorDefault
getDescription, getHelpButton, getHelpFrame, getLabel, popupDescription, setDescription, setLabel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.fraunhofer.iosb.ilt.configurable.ConfigEditor
getJsonRootSchema, initFor
-
-
-
-
Method Detail
-
initFor
public void initFor(Field field)
Description copied from interface:ConfigEditorInitialise the editor for the given Field, using the Field name and type and any annotations present on the Field.- Specified by:
initForin interfaceConfigEditor<Color>- Overrides:
initForin classEditorDefault<Color>- Parameters:
field- the Field to initialise the editor for.
-
setConfig
public void setConfig(com.google.gson.JsonElement config)
Description copied from interface:ConfigEditorLoad the given configuration into this editor.- Parameters:
config- the configuration to load into this editor.
-
getConfig
public com.google.gson.JsonElement getConfig()
Description copied from interface:ConfigEditorGet the current (edited) state of the configuration.- Returns:
- The current (edited) configuration.
-
getJsonSchema
public SchemaItem getJsonSchema(RootSchema rootSchema)
Description copied from interface:ConfigEditorGet the JSON Schema for this editor, using the given rootSchema for shared $defs.- Parameters:
rootSchema- the root schema to use for $defs. If null, the return value must be a root schema.- Returns:
- the schema for this editor.
-
getGuiFactorySwing
public GuiFactorySwing getGuiFactorySwing()
Description copied from interface:ConfigEditorGet a factory that can generate a swing-based gui for this editor.- Returns:
- A factory that can generate a swing-based gui for this editor.
-
getGuiFactoryFx
public GuiFactoryFx getGuiFactoryFx()
Description copied from interface:ConfigEditorGet a factory that can generate a JavaFX-based gui for this editor.- Returns:
- A factory that can generate a JavaFX-based gui for this editor.
-
getRed
public int getRed()
-
setRed
public void setRed(int red)
-
getGreen
public int getGreen()
-
setGreen
public void setGreen(int green)
-
getBlue
public int getBlue()
-
setBlue
public void setBlue(int blue)
-
getAlpha
public int getAlpha()
-
setAlpha
public void setAlpha(int alpha)
-
isEditAlpla
public boolean isEditAlpla()
-
getValue
public Color getValue()
Description copied from interface:ConfigEditorGet the value configured in the editor.- Returns:
- the value configured in the editor.
-
setValue
public void setValue(Color value)
Description copied from interface:ConfigEditorSet the value in the editor. Used for saving an (externally) updated configuration.- Parameters:
value- the value in the editor.
-
setProfile
public void setProfile(String profile)
Description copied from interface:ConfigEditorSets the currently active profile.- Parameters:
profile- the currently active profile.
-
setProfilesEdit
public void setProfilesEdit(String csv)
-
canEdit
public boolean canEdit()
Description copied from interface:ConfigEditorTrue if the component is editable in the current profile.- Returns:
- True if the component is editable in the current profile.
-
isDefault
public boolean isDefault()
-
-