Module MaterialFX

Class MFXDepthManager

java.lang.Object
io.github.palexdev.materialfx.effects.MFXDepthManager

public class MFXDepthManager extends Object
Utility class which manages a preset number of DropShadow effects ordered by DepthLevel, but it also allows to create custom DropShadow effects with shadowOf(Color, double, double, double, double).

DepthLevel
  • Constructor Details

    • MFXDepthManager

      public MFXDepthManager()
  • Method Details

    • shadowOf

      public static DropShadow shadowOf(Color color, double radius, double spread, double offsetX, double offsetY)
      Returns a new instance of DropShadow with the specified characteristics.
      Returns:
      The desired custom DropShadow effect
      See Also:
    • shadowOf

      public static DropShadow shadowOf(DepthLevel level)
      Retrieves the DropShadow associated with the specified DepthLevel.
      Parameters:
      level - The desired DepthLevel between 1 and 5
      Returns:
      The desired DropShadow effect
    • shadowOf

      public static DropShadow shadowOf(DepthLevel level, int delta)
      Retrieves the DropShadow associated with the specified DepthLevel added to delta.

      Example 1: for a depth level equal to 3 and a delta equal to 2, the returned DropShadow effect is the effected associated to a depth level of 5.

      Example 2: for a depth level equal to 5 and a delta equal to whatever integer, the returned DropShadow effect is the effected associated to a depth level of 5.
      Parameters:
      level - The desired DepthLevel between 1 and 5
      delta - The number of levels to shift
      Returns:
      The final DropShadow effect}

      nextLevel(DepthLevel)