Module MaterialFX

Class MFXScrimEffect

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

public class MFXScrimEffect extends Object
From Google's material design guidelines:

Scrims are temporary treatments that can be applied to Material surfaces for the purpose of making content on a surface less prominent. They help direct user attention to other parts of the screen, away from the surface receiving a scrim.

  • Constructor Details

    • MFXScrimEffect

      public MFXScrimEffect()
  • Method Details

    • scrim

      public void scrim(Pane pane, double opacity)
      Adds a scrim effect to the specified pane with specified opacity.
      Parameters:
      pane - The pane to which add the effect
      opacity - The effect opacity/strength
    • modalScrim

      public void modalScrim(Pane pane, double opacity)
      Same as scrim(Pane, double) but the effect is placed at the end of the children list, covering all the pane's nodes
      Parameters:
      pane - The pane to which add the effect
      opacity - The effect opacity/strength
    • modalScrim

      public void modalScrim(Pane parent, Node child, double opacity)
      Adds a scrim effect to the specified pane with specified opacity. It also simulates the modal behavior of Stages, leaving only the specified Node interactive.
      Parameters:
      parent - The pane to which add the effect
      child - The node to leave interactive
      opacity - The effect opacity/strength
    • scrimWindow

      public void scrimWindow(Window window, double opacity)
      Adds a scrim effect to the specified Window's root pane with the specified opacity.
      Parameters:
      window - The desired window
      opacity - The desired opacity
    • removeEffect

      public void removeEffect(Pane pane)
      Removes the scrim effect from the specified pane.
      Parameters:
      pane - The pane to which remove the effect.
    • removeEffect

      public void removeEffect(Window window)
      Removes the scrim effect from the specified window.
      Parameters:
      window - The window to which remove the effect.
    • getScrimNode

      public Node getScrimNode()