Class DisabledPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class DisabledPanel extends JPanel
See Also:
  • Constructor Details

    • DisabledPanel

      public DisabledPanel(Container container)
      Create a DisablePanel for the specified Container. The disabled color will be the following color from the UIManager with an alpha value: UIManager.getColor("inactiveCaptionBorder");
      Parameters:
      container - a Container to be added to this DisabledPanel
    • DisabledPanel

      public DisabledPanel(Container container, Color disabledColor)
      Create a DisablePanel for the specified Container using the specified disabled color.
      Parameters:
      container - a Container to be added to this DisabledPanel
      disabledColor - the background color of the GlassPane
  • Method Details

    • getDisabledColor

      public Color getDisabledColor()
      The background color of the glass pane.
      Returns:
      the background color of the glass pane
    • setDisabledColor

      public void setDisabledColor(Color disabledColor)
      Set the background color of the glass pane. This color should contain an alpha value to give the glass pane a transparent effect.
      Parameters:
      disabledColor - the background color of the glass pane
    • getGlassPane

      public JComponent getGlassPane()
      The glass pane of this DisablePanel. It can be customized by adding components to it.
      Returns:
      the glass pane
    • setGlassPane

      public void setGlassPane(JComponent glassPane)
      Use a custom glass pane. You are responsible for adding the appropriate mouse listeners to intercept mouse events.
      Parameters:
      glassPane - a JComponent to be used as a glass pane
    • setEnabled

      public void setEnabled(boolean enabled)
      Change the enabled state of the panel.
      Overrides:
      setEnabled in class JComponent
      Parameters:
      enabled - the enabled flag. If this flag is set to false, then the glassPane is set visible.
    • isOptimizedDrawingEnabled

      public boolean isOptimizedDrawingEnabled()
      Because we use layered panels this should be disabled.
      Overrides:
      isOptimizedDrawingEnabled in class JComponent
    • disable

      public static void disable(Container container)
      Convenience static method to disable all components of a given Container, including nested Containers.
      Parameters:
      container - the Container containing Components to be disabled
    • enable

      public static void enable(Container container)
      Convenience static method to enable Components disabled by using the disable() method. Only Components disable by the disable() method will be enabled.
      Parameters:
      container - a Container that has been previously disabled.
    • setDisabledOverlayComponent

      public void setDisabledOverlayComponent(JComponent comp)