Interface DMDesignManager


public interface DMDesignManager
With this class you can create, edit and delete designs, font configurations, imported fonts and widgets.
See Also:
  • Method Details

    • getDesign

      @Nullable DMDesign getDesign(@NotNull @NotNull String name)
      Gets a design with a specific name.
      Parameters:
      name - The name of the design.
      Returns:
      The design with the given name.
    • existsDesign

      boolean existsDesign(@NotNull @NotNull String name)
      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

      DMDesign createDesign(@NotNull @NotNull String name)
      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

      boolean deleteDesign(@NotNull @NotNull String name)
      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

      List<DMDesign> getDesigns()
      Gets all the designs.
      Returns:
      A list with all the designs.
    • getWidget

      @Nullable DMImportedWidget getWidget(@NotNull @NotNull String path)
      Gets a widget with a specific name.
      Parameters:
      path - The name of the widget.
      Returns:
      The widget with the given name.
    • existsWidget

      boolean existsWidget(@NotNull @NotNull String path)
      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 method ImageUtils.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

      boolean deleteWidget(@NotNull @NotNull String name)
      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

      List<String> getWidgetPaths()
      Gets a list of all widget paths.
      Returns:
      A list of all widget paths.
    • getFont

      @Nullable DMImportedFont getFont(@NotNull @NotNull String path)
      Gets a font with a specific name.
      Parameters:
      path - The name of the font.
      Returns:
      The font with the given name.
    • existsFont

      boolean existsFont(@NotNull @NotNull String path)
      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 method FontUtils.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

      boolean deleteFont(@NotNull @NotNull String name)
      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

      List<String> getFontPaths()
      Gets a list of all font paths.
      Returns:
      A list of all font paths.
    • getFontConfig

      @Nullable DMFontConfig getFontConfig(@NotNull @NotNull String name)
      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

      boolean existsFontConfig(@NotNull @NotNull String name)
      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

      DMFontConfig createFontConfig(@NotNull @NotNull String name)
      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

      boolean deleteFontConfig(@NotNull @NotNull String name)
      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.