Module org.bigdataviewer.core
Package bdv.ui.settings
Class SelectAndEditProfileSettingsPage<T extends SelectAndEditProfileSettingsPage.Profile>
- java.lang.Object
-
- bdv.ui.settings.SelectAndEditProfileSettingsPage<T>
-
- Type Parameters:
T- type of thing being edited, e.g.,TrackSchemeStyle.
- All Implemented Interfaces:
SettingsPage
- Direct Known Subclasses:
KeymapSettingsPage
public class SelectAndEditProfileSettingsPage<T extends SelectAndEditProfileSettingsPage.Profile> extends Object implements SettingsPage
ASettingsPagefor the following common scenario: There are multiple "profiles" (e.g., keymaps, trackscheme styles, ...) to select from, and its possible to edit each individual profile.To instantiate such a
SettingsPage, aProfileManagerand aProfileEditPanelhave to be provided. TheSelectAndEditProfileSettingsPage.ProfileManageris responsible for selecting/renaming/etc profile. TheSelectAndEditProfileSettingsPage.ProfileEditPanelis responsible for editing an individual profile.The
SelectAndEditProfileSettingsPageprovides UI for selecting, duplicating, renaming, and deleting profiles. If aProfileisbuilt-init is unmodifiable. When the user edits it, a duplicate is made automatically.- Author:
- Tobias Pietzsch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSelectAndEditProfileSettingsPage.ProfileInterface for the objects that are edited and selected in aSelectAndEditProfileSettingsPage.static interfaceSelectAndEditProfileSettingsPage.ProfileEditPanel<T>Class that edits a profile of typeTin a JPanel.static interfaceSelectAndEditProfileSettingsPage.ProfileManager<T extends SelectAndEditProfileSettingsPage.Profile>Interface for classes that manage a collection of profiles.
-
Constructor Summary
Constructors Constructor Description SelectAndEditProfileSettingsPage(String treePath, SelectAndEditProfileSettingsPage.ProfileManager<T> profileManager, SelectAndEditProfileSettingsPage.ProfileEditPanel<T> profileEditPanel)Creates a newSelectAndEditProfileSettingsPagefor the specified profile manager and the specified editor panel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply()Called by theSettingsPanelif user presses "OK" or "Apply".voidcancel()Called by theSettingsPanelif user presses "Cancel".static <M extends StyleManager<M,S>,S extends Style<S>>
SelectAndEditProfileSettingsPage<StyleProfile<S>>forStyle(M manager, M editingManager, SelectAndEditProfileSettingsPage.ProfileEditPanel<StyleProfile<S>> settingsPage, String treePath)JPanelgetJPanel()StringgetTreePath()Get the path of this page in the settings tree.org.scijava.listeners.Listeners<ModificationListener>modificationListeners()
-
-
-
Constructor Detail
-
SelectAndEditProfileSettingsPage
public SelectAndEditProfileSettingsPage(String treePath, SelectAndEditProfileSettingsPage.ProfileManager<T> profileManager, SelectAndEditProfileSettingsPage.ProfileEditPanel<T> profileEditPanel)
Creates a newSelectAndEditProfileSettingsPagefor the specified profile manager and the specified editor panel.- Parameters:
treePath- path of this page in the settings tree.profileManager- the profile manager.profileEditPanel- the profile edit panel.
-
-
Method Detail
-
forStyle
public static <M extends StyleManager<M,S>,S extends Style<S>> SelectAndEditProfileSettingsPage<StyleProfile<S>> forStyle(M manager, M editingManager, SelectAndEditProfileSettingsPage.ProfileEditPanel<StyleProfile<S>> settingsPage, String treePath)
-
getTreePath
public String getTreePath()
Description copied from interface:SettingsPageGet the path of this page in the settings tree.The path is split at "
>" to get the nodes along the settings tree branch.- Specified by:
getTreePathin interfaceSettingsPage- Returns:
- the path.
-
getJPanel
public JPanel getJPanel()
- Specified by:
getJPanelin interfaceSettingsPage
-
modificationListeners
public org.scijava.listeners.Listeners<ModificationListener> modificationListeners()
- Specified by:
modificationListenersin interfaceSettingsPage
-
apply
public void apply()
Description copied from interface:SettingsPageCalled by theSettingsPanelif user presses "OK" or "Apply". Should commit any modified state.- Specified by:
applyin interfaceSettingsPage
-
cancel
public void cancel()
Description copied from interface:SettingsPageCalled by theSettingsPanelif user presses "Cancel". Should restore any modified state to the original state.- Specified by:
cancelin interfaceSettingsPage
-
-