Class JMemoryStateBar

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class JMemoryStateBar extends JPanel
This class represents a simple widget dedicated to the monitoring of the available Java Runtime memory. The memory state bar is a JPanel standalone component that can be embedded into other components.
Since:
1.0.0
Version:
"1.0.14" - b202111241200L
Author:
Julien SEINTURIER - Université de Toulon / CNRS LIS umr 7020 - github.com/jorigin/jcommon (contact@jorigin.org)
See Also:
  • Field Details

    • COMMAND_GARBAGE

      public static final String COMMAND_GARBAGE
      The command used to trigger garbage collecting.
      See Also:
    • COMMAND_ACTIVE

      public static final String COMMAND_ACTIVE
      The command used to activate the memory state bar.
      See Also:
  • Constructor Details

    • JMemoryStateBar

      public JMemoryStateBar()
      Construct a new default memory monitor
  • Method Details

    • initGUI

      protected void initGUI()
      Init the GUI component of the memory monitor
    • startMonitor

      public void startMonitor()
      Start the monitoring of the Java Runtime memory. The components of the state bar are updated by a thread at the frequency given by the refresh delay.
      See Also:
    • stopMonitor

      public void stopMonitor()
      Stop the monitoring of the Java Runtime memory. The monitoring thread is sopped and the components are no more updated.
      See Also:
    • setRefreshDelay

      public void setRefreshDelay(long delay)
      Get the delay of time in milliseconds between two refreshes of the memory state bar.
      Parameters:
      delay - the delay of time.
      See Also:
    • getRefreshDelay

      public long getRefreshDelay()
      Set the delay of time in milliseconds between two refreshes of the memory state bar.
      Returns:
      the delay of time.
      See Also:
    • getGarbageIcon

      public Icon getGarbageIcon()
      Get the icon displayed on the garbage button.
      Returns:
      the icon used on the garbage button.
    • setGarbageIcon

      public void setGarbageIcon(Icon icon)
      Set the icon displayed on the garbage button.
      Parameters:
      icon - the icon used on the garbage button.
    • getActiveIcon

      public Icon getActiveIcon()
      Get the active icon.
      Returns:
      the active icon.
    • setActiveIcon

      public void setActiveIcon(Icon icon)
      Set the active icon.
      Parameters:
      icon - the active icon
    • getInactiveIcon

      public Icon getInactiveIcon()
      Get the inactive icon
      Returns:
      the inactive icon
    • setInactiveIcon

      public void setInactiveIcon(Icon icon)
      Set the inactive icon
      Parameters:
      icon - the inactive icon