Class ColorPreference
java.lang.Object
org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting
org.openstreetmap.josm.gui.preferences.ExtensibleTabPreferenceSetting
org.openstreetmap.josm.gui.preferences.display.ColorPreference
- All Implemented Interfaces:
EventListener,ListSelectionListener,TableModelListener,PreferenceSetting,TabPreferenceSetting
public class ColorPreference
extends ExtensibleTabPreferenceSetting
implements ListSelectionListener, TableModelListener
Color preferences.
GUI preference to let the user customize named colors.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classstatic classFactory used to create a newColorPreference. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JButtonprivate JTableprivate JButtonprivate JButtonprivate ColorPreference.ColorTableModel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the GUI elements to the dialog.private static voidAdd all missing color entries.private static intgetCategoryPriority(String category) Returns a map with the colors in the table (key = preference key, value = color info).Returns the help context for this preferences settings tab.booleanisExpert()Called to know if the preferences tab has only to be displayed in expert mode.private static booleanbooleanok()Called when OK is pressed to save the setting in the preferences file.voidSet the colors to be shown in the preference table.voidprivate voidvoidMethods inherited from class org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting
addSubTab, addSubTab, canBeHidden, createPreferenceTabWithScrollPane, getDescription, getIconName, getSelectedSubTab, getSubTab, getTabPane, getTitle, getTooltip, registerSubTab, selectSubTabMethods inherited from class org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
saveBoolean, saveDouble, saveIntMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.gui.preferences.TabPreferenceSetting
getIcon
-
Field Details
-
tableModel
-
colors
-
colorEdit
-
defaultSet
-
remove
-
-
Constructor Details
-
ColorPreference
-
-
Method Details
-
setColors
Set the colors to be shown in the preference table. This method creates a table model if none exists and overwrites all existing values.- Parameters:
colorMap- the map holding the colors (key = preference key, value =ColorInfoinstance)
-
getCategoryPriority
-
getColors
Returns a map with the colors in the table (key = preference key, value = color info).- Returns:
- a map holding the colors.
-
addGui
Description copied from interface:PreferenceSettingAdd the GUI elements to the dialog. The elements should be initialized after the current preferences.- Specified by:
addGuiin interfacePreferenceSetting- Overrides:
addGuiin classExtensibleTabPreferenceSetting- Parameters:
gui- the preferences tab pane
-
isRemoveColor
-
fixColorPrefixes
Add all missing color entries. -
ok
Description copied from interface:PreferenceSettingCalled when OK is pressed to save the setting in the preferences file. Return true when restart is required.- Specified by:
okin interfacePreferenceSetting- Returns:
trueif restart is required
-
isExpert
Description copied from interface:PreferenceSettingCalled to know if the preferences tab has only to be displayed in expert mode.- Specified by:
isExpertin interfacePreferenceSetting- Overrides:
isExpertin classDefaultPreferenceSetting- Returns:
- true if the tab has only to be displayed in expert mode, false otherwise.
-
valueChanged
- Specified by:
valueChangedin interfaceListSelectionListener
-
tableChanged
- Specified by:
tableChangedin interfaceTableModelListener
-
updateEnabledState
-
getHelpContext
Description copied from interface:TabPreferenceSettingReturns the help context for this preferences settings tab.- Specified by:
getHelpContextin interfaceTabPreferenceSetting- Overrides:
getHelpContextin classDefaultTabPreferenceSetting- Returns:
- the help context for this preferences settings tab
-