Package qupath.lib.gui
Class UserDirectoryManager
java.lang.Object
qupath.lib.gui.UserDirectoryManager
Helper class for managing a user directory, and associated subdirectories.
Note that only the main user directory can be directly specified. Other directories are derived from this.
- Since:
- v0.5.0
- Author:
- Pete Bankhead
-
Property Summary
TypePropertyDescriptionRead only property representing the custom colormaps directory.Read only property representing the css directory.Read only property representing the extensions directory.Read only property representing the localization directory.Read only property representing the log file directory.Read only property representing the shared scripts directory.Property representing the user directory. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of subdirectory containing colormaps.static final String
Name of subdirectory containing css files for styling.static final String
Name of subdirectory containing extensions.static final String
Name of subdirectory containing properties files for localization.static final String
Name of subdirectory containing log files.static final String
Name of subdirectory containing shared scripts. -
Method Summary
Modifier and TypeMethodDescriptionRead only property representing the custom colormaps directory.createRelativePathProperty
(String other) Create a read only property for a relative path of the user subdirectory.Read only property representing the css directory.Read only property representing the extensions directory.Get the path to where colormaps should be written.Get the path to where user directory for storing CSS styles.Get the path to where extensions should be stored.static UserDirectoryManager
Get the singleton instance of the UserDirectoryManager.Get the path to where localization property files should be written.Get the path to where log files should be written.getRelativePathOrNull
(String other) Get the path to where shared script files should be written.Get the user path where additional files may be stored.Read only property representing the localization directory.Read only property representing the log file directory.Read only property representing the shared scripts directory.void
setUserPath
(Path path) Set the user path where additional files may be stored.Property representing the user directory.
-
Property Details
-
userDirectory
Property representing the user directory. This may be null if the directory has not been set.- See Also:
-
extensionsDirectory
Read only property representing the extensions directory. This is based uponuserDirectoryProperty
andDIR_EXTENSIONS
.- See Also:
-
cssDirectory
Read only property representing the css directory. This is based uponuserDirectoryProperty
andDIR_CSS
.- See Also:
-
localizationDirectory
Read only property representing the localization directory. This is based uponuserDirectoryProperty
andDIR_LOCALIZATION
.- See Also:
-
logDirectory
Read only property representing the log file directory. This is based uponuserDirectoryProperty
andDIR_LOGS
.- See Also:
-
scriptsDirectory
Read only property representing the shared scripts directory. This is based uponuserDirectoryProperty
andDIR_SCRIPTS
.- See Also:
-
colormapsDirectory
Read only property representing the custom colormaps directory. This is based uponuserDirectoryProperty
andDIR_COLORMAPS
.- See Also:
-
-
Field Details
-
DIR_EXTENSIONS
Name of subdirectory containing extensions.- See Also:
-
DIR_CSS
Name of subdirectory containing css files for styling.- See Also:
-
DIR_SCRIPTS
Name of subdirectory containing shared scripts.- See Also:
-
DIR_COLORMAPS
Name of subdirectory containing colormaps.- See Also:
-
DIR_LOGS
Name of subdirectory containing log files.- See Also:
-
DIR_LOCALIZATION
Name of subdirectory containing properties files for localization.- See Also:
-
-
Method Details
-
getInstance
Get the singleton instance of the UserDirectoryManager.- Returns:
-
createRelativePathProperty
Create a read only property for a relative path of the user subdirectory. This can be used if the default subdirectories aren't sufficient.- Parameters:
other
-- Returns:
-
userDirectoryProperty
Property representing the user directory. This may be null if the directory has not been set.- Returns:
-
extensionsDirectoryProperty
Read only property representing the extensions directory. This is based uponuserDirectoryProperty
andDIR_EXTENSIONS
.- Returns:
-
cssDirectoryProperty
Read only property representing the css directory. This is based uponuserDirectoryProperty
andDIR_CSS
.- Returns:
-
localizationDirectoryProperty
Read only property representing the localization directory. This is based uponuserDirectoryProperty
andDIR_LOCALIZATION
.- Returns:
-
logDirectoryProperty
Read only property representing the log file directory. This is based uponuserDirectoryProperty
andDIR_LOGS
.- Returns:
-
scriptsDirectoryProperty
Read only property representing the shared scripts directory. This is based uponuserDirectoryProperty
andDIR_SCRIPTS
.- Returns:
-
colormapsDirectoryProperty
Read only property representing the custom colormaps directory. This is based uponuserDirectoryProperty
andDIR_COLORMAPS
.- Returns:
-
getUserPath
Get the user path where additional files may be stored.- Returns:
-
getRelativePathOrNull
-
setUserPath
Set the user path where additional files may be stored. Note that the specified path must exist and must represent a directory.- Parameters:
path
-- Throws:
IllegalArgumentException
- if the path is not null, but does not represent a valid, existing directory
-
getExtensionsPath
Get the path to where extensions should be stored. This depends uponuserDirectoryProperty()
.- Returns:
- the path if available, or null if
getUserPath()
returns null
-
getCssStylesPath
Get the path to where user directory for storing CSS styles. This depends uponuserDirectoryProperty()
.- Returns:
- the path if available, or null if
getUserPath()
returns null - Since:
- v0.4.0
-
getLogDirectoryPath
Get the path to where log files should be written. This depends uponuserDirectoryProperty()
.- Returns:
- the path if available, or null if
getUserPath()
returns null
-
getLocalizationDirectoryPath
Get the path to where localization property files should be written. This depends uponuserDirectoryProperty()
.- Returns:
- the path if available, or null if
getUserPath()
returns null
-
getColormapsDirectoryPath
Get the path to where colormaps should be written. This depends uponuserDirectoryProperty()
.- Returns:
- the path if available, or null if
getUserPath()
returns null
-
getScriptsDirectoryPath
Get the path to where shared script files should be written. This depends uponuserDirectoryProperty()
.- Returns:
- the path if available, or null if
getUserPath()
returns null
-