Package com.inet.pdfc.config
Class DefaultSetting
- java.lang.Object
-
- com.inet.pdfc.config.DefaultSetting
-
- All Implemented Interfaces:
Settings
,ColorProvider
,java.io.Serializable
@JsonData public class DefaultSetting extends java.lang.Object implements Settings
This is the Defaultsetting with the default values. This setting will be used for the first installation. All setting forDiffGroup.GroupType
andSettings.EXPORT
are enabled Setting forSettings.OPTION
are disabled Differencemarker color (Settings.METAOPTION
) are blue AddAndRemoved Elements are red Modified content are orange Modified styles are red Meta Data changed are light blue- Since:
- 4.1
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.inet.pdfc.config.Settings
Settings.EXPORT, Settings.FILTER, Settings.METAOPTION, Settings.OPTION
-
-
Field Summary
-
Fields inherited from interface com.inet.pdfc.config.Settings
IMAGE_SCALE_FACTOR, MAX_ERRORS_PER_FILE
-
-
Constructor Summary
Constructors Constructor Description DefaultSetting()
The Defaultsetting with the default values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Settings
copy()
Create a copy of the current settingjava.util.List<ObjectSetting<?>>
getAllObjectSettingNames()
Returns all registered additional settings.java.awt.Color
getColor(com.inet.pdfc.config.ColorSetting colorSetting)
Get the color for a settingjava.awt.Color
getMarkerColor(DiffGroup.GroupType content)
Returns the color of the marker for a difference group of the given typejava.awt.Color
getOutlineColor(DiffGroup.GroupType content)
Returns the color to mark the difference elements inside a difference group of the given typejava.lang.Object
getSetting(java.lang.String setting)
Return the value for this settingboolean
isEnabled(VisibilitySetting content)
Get the visibility for this settingvoid
setColor(java.awt.Color color, com.inet.pdfc.config.ColorSetting setting)
Set the color for this setting.void
setEnabled(boolean isVisible, VisibilitySetting... visibles)
Set the visibility for this settingvoid
setMarkerColor(java.awt.Color color, DiffGroup.GroupType content)
Set the color for the marker.void
setSetting(java.lang.Object value, java.lang.String setting)
Set the specific setting with the value
-
-
-
Method Detail
-
getAllObjectSettingNames
public java.util.List<ObjectSetting<?>> getAllObjectSettingNames()
Returns all registered additional settings. To query the current value of the setting passVisibilitySetting.name()
to theSettings.getSetting(String)
method.- Specified by:
getAllObjectSettingNames
in interfaceSettings
- Returns:
- all additional settings, not
null
-
setMarkerColor
public void setMarkerColor(@Nonnull java.awt.Color color, @Nonnull DiffGroup.GroupType content)
Set the color for the marker. Overrides the default provided by {linkColorProvider.getMarkerColor(DiffGroup.GroupType)
. (For visible set the alpha to 0)- Specified by:
setMarkerColor
in interfaceSettings
- Parameters:
color
- the marker colorcontent
- the group type tp set the marker color for
-
setColor
public void setColor(java.awt.Color color, @Nonnull com.inet.pdfc.config.ColorSetting setting)
Set the color for this setting. If the key is aDiffGroup.GroupType
, it overrides the default provided byColorProvider.getOutlineColor(DiffGroup.GroupType)
).
Note: Colors forDiffGroup.GroupType
s should be semi-transparent.- Specified by:
setColor
in interfaceSettings
- Parameters:
color
- the color to be used to the markupsetting
- the setting key. e.G. aDiffGroup.GroupType
or theSettings.METAOPTION.ALLOUTLINEMARKER
- See Also:
DiffGroup.GroupType
,Settings.METAOPTION
-
setEnabled
public void setEnabled(boolean isVisible, @Nonnull VisibilitySetting... visibles)
Set the visibility for this setting- Specified by:
setEnabled
in interfaceSettings
- Parameters:
isVisible
- true for visible otherwise falsevisibles
- the visibility setting key(s) to update the vsibility for- See Also:
Settings.EXPORT
,Settings.METAOPTION
,Settings.OPTION
,Settings.FILTER
,DiffGroup.GroupType
-
isEnabled
public boolean isEnabled(VisibilitySetting content)
Get the visibility for this setting- Specified by:
isEnabled
in interfaceSettings
- Parameters:
content
- the setting key to get the visibility for- Returns:
true
for visible hencefalse
- See Also:
Settings.EXPORT
,Settings.METAOPTION
,Settings.OPTION
,Settings.FILTER
,DiffGroup.GroupType
-
getMarkerColor
@Nonnull public java.awt.Color getMarkerColor(@Nonnull DiffGroup.GroupType content)
Returns the color of the marker for a difference group of the given type- Specified by:
getMarkerColor
in interfaceColorProvider
- Parameters:
content
- the type of the difference group- Returns:
- the color of the marker for a difference group, should not be null
-
getColor
public java.awt.Color getColor(@Nonnull com.inet.pdfc.config.ColorSetting colorSetting)
Get the color for a setting
-
getSetting
@Nullable public java.lang.Object getSetting(java.lang.String setting)
Return the value for this setting- Specified by:
getSetting
in interfaceSettings
- Parameters:
setting
- the setting name- Returns:
- value for this setting or null if no setting be set.
-
setSetting
public void setSetting(@Nullable java.lang.Object value, java.lang.String setting)
Set the specific setting with the value- Specified by:
setSetting
in interfaceSettings
- Parameters:
value
- value for the setting or null for remove the settingsetting
- the setting name, usuallyVisibilitySetting.name()
-
copy
@Nonnull public Settings copy()
Create a copy of the current setting
-
getOutlineColor
@Nonnull public java.awt.Color getOutlineColor(DiffGroup.GroupType content)
Returns the color to mark the difference elements inside a difference group of the given type- Specified by:
getOutlineColor
in interfaceColorProvider
- Parameters:
content
- the type of the difference group- Returns:
- the color to mark the difference elements, should not be null
-
-