Interface DMDesignManager
public interface DMDesignManager
With this class you can create, edit and delete designs,
font configurations, imported fonts and widgets.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateDesign
(@NotNull String name) Creates a new design with a specific name.createFontConfig
(@NotNull String name) Creates a new font configuration with a specific name.createFontFromURL
(@NotNull String path, @NotNull String url) Creates a new widget with a specific name from an url.createWidgetFromURL
(@NotNull String path, @NotNull String url) Creates a new widget with a specific name from an url.boolean
deleteDesign
(@NotNull String name) Deletes a design with a specific name.boolean
deleteFont
(@NotNull String name) Deletes a font with a specific name.boolean
deleteFontConfig
(@NotNull String name) Deletes a font configuration with a specific name.boolean
deleteWidget
(@NotNull String name) Deletes a widget with a specific name.boolean
existsDesign
(@NotNull String name) Checks if a design with a specific name exists.boolean
existsFont
(@NotNull String path) Checks if a font with a specific name exists.boolean
existsFontConfig
(@NotNull String name) Checks if a font configuration with a specific name exists.boolean
existsWidget
(@NotNull String path) Checks if a widget with a specific name exists.Gets a design with a specific name.Gets all the designs.Gets a font with a specific name.getFontConfig
(@NotNull String name) Gets a font configuration with a specific name.Gets a list of all font configuration paths.Gets a list of all font paths.Gets a widget with a specific name.Gets a list of all widget paths.
-
Method Details
-
getDesign
Gets a design with a specific name.- Parameters:
name
- The name of the design.- Returns:
- The design with the given name.
-
existsDesign
Checks if a design with a specific name exists.- Parameters:
name
- The name of the design.- Returns:
- True if the design exists, false otherwise.
-
createDesign
Creates a new design with a specific name. If a design with this name already exists it will be overwritten!- Parameters:
name
- The name of the design.- Returns:
- The design with the given name.
-
deleteDesign
Deletes a design with a specific name.- Parameters:
name
- The name of the design.- Returns:
- True if the design was successfully deleted, false otherwise.
-
getDesigns
Gets all the designs.- Returns:
- A list with all the designs.
-
getWidget
Gets a widget with a specific name.- Parameters:
path
- The name of the widget.- Returns:
- The widget with the given name.
-
existsWidget
Checks if a widget with a specific name exists.- Parameters:
path
- The name of the widget.- Returns:
- True if the widget exists, false otherwise.
-
createWidgetFromURL
DMImportedWidget createWidgetFromURL(@NotNull @NotNull String path, @NotNull @NotNull String url) throws InvalidImageUrlException Creates a new widget with a specific name from an url. Instead of catching an exception, you can use the methodImageUtils.isValidImage(String)
to check if the image is valid. If a widget with this path already exists it will be overwritten!- Parameters:
path
- The path to the widget file.url
- The url of the widget.- Returns:
- The widget with the given name.
- Throws:
InvalidImageUrlException
- If the url is invalid.
-
deleteWidget
Deletes a widget with a specific name.- Parameters:
name
- The name of the widget.- Returns:
- True if the widget was successfully deleted, false otherwise.
-
getWidgetPaths
Gets a list of all widget paths.- Returns:
- A list of all widget paths.
-
getFont
Gets a font with a specific name.- Parameters:
path
- The name of the font.- Returns:
- The font with the given name.
-
existsFont
Checks if a font with a specific name exists.- Parameters:
path
- The name of the font.- Returns:
- True if the font exists, false otherwise.
-
createFontFromURL
DMImportedFont createFontFromURL(@NotNull @NotNull String path, @NotNull @NotNull String url) throws InvalidFontUrlException Creates a new widget with a specific name from an url. Instead of catching an exception, you can use the methodFontUtils.isValidFont(String)
to check if the font is valid. If a font with this path already exists it will be overwritten!- Parameters:
path
- The path to the font file.url
- The url of the font.- Returns:
- The font with the given name.
- Throws:
InvalidFontUrlException
- If the url is invalid.
-
deleteFont
Deletes a font with a specific name.- Parameters:
name
- The name of the font.- Returns:
- True if the font was successfully deleted, false otherwise.
-
getFontPaths
Gets a list of all font paths.- Returns:
- A list of all font paths.
-
getFontConfig
Gets a font configuration with a specific name.- Parameters:
name
- The name of the font configuration.- Returns:
- The font configuration with the given name.
-
existsFontConfig
Checks if a font configuration with a specific name exists.- Parameters:
name
- The name of the font configuration.- Returns:
- True if the font configuration exists, false otherwise.
-
createFontConfig
Creates a new font configuration with a specific name. If a font config with this name already exists it will be overwritten!- Parameters:
name
- The name of the font configuration.- Returns:
- The font configuration with the given name.
-
deleteFontConfig
Deletes a font configuration with a specific name.- Parameters:
name
- The name of the font configuration.- Returns:
- True if the font configuration was successfully deleted, false otherwise.
-
getFontConfigs
List<DMFontConfig> getFontConfigs()Gets a list of all font configuration paths.- Returns:
- A list of all font configuration paths.
-