Package qupath.lib.gui.prefs
Class QuPathStyleManager
java.lang.Object
qupath.lib.gui.prefs.QuPathStyleManager
Class to facilitate the use of different styles within QuPath.
These register themselves with PathPrefs
so that they can be persistent across restarts.
- Author:
- Pete Bankhead
-
Property Summary
TypePropertyDescriptionGet a list of available fonts.Get the current available styles as an observable list.Get the current selected font.Get the current selected style. -
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Available font families.static interface
Interface defining a style that may be applied to QuPath. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet a list of available fonts.Get the current available styles as an observable list.Get the current selected font.static boolean
installStyles
(Collection<File> list) Handle installing CSS files (which can be used to style QuPath).static boolean
Check if the default JavaFX style is used.static void
refresh()
Refresh the current style.Get the current selected style.static void
Request that the list of available styles is updated.
-
Property Details
-
availableStyles
Get the current available styles as an observable list. The list is unmodifiable, since any changes should be made via adding/removing files inUserDirectoryManager.getCssStylesPath()
.- See Also:
-
selectedStyle
Get the current selected style.- See Also:
-
availableFonts
Get a list of available fonts. The list is unmodifiable, since this is primarily used to overcome issues with the default font on macOS by changing the font family. More fine-grained changes can be made via css.- See Also:
-
font
Get the current selected font.- See Also:
-
-
Constructor Details
-
QuPathStyleManager
public QuPathStyleManager()
-
-
Method Details
-
updateAvailableStyles
public static void updateAvailableStyles()Request that the list of available styles is updated. It makes sense to call this when a new user directory has been set, so that a check for CSS files can be performed. -
installStyles
Handle installing CSS files (which can be used to style QuPath).- Parameters:
list
- list of css files- Returns:
-
refresh
public static void refresh()Refresh the current style. This should not normally be required, but may be useful during startup to ensure that the style is properly set at the appropriate time. -
isDefaultStyle
public static boolean isDefaultStyle()Check if the default JavaFX style is used.- Returns:
- true if the default style is used, false otherwise.
-
availableStylesProperty
Get the current available styles as an observable list. The list is unmodifiable, since any changes should be made via adding/removing files inUserDirectoryManager.getCssStylesPath()
.- Returns:
-
selectedStyleProperty
Get the current selected style.- Returns:
-
availableFontsProperty
Get a list of available fonts. The list is unmodifiable, since this is primarily used to overcome issues with the default font on macOS by changing the font family. More fine-grained changes can be made via css.- Returns:
- list of available fonts
-
fontProperty
Get the current selected font.- Returns:
-