Package xtwm.plugins

Class SystemMonitor

  • All Implemented Interfaces:
    java.lang.Comparable<TWidget>

    public class SystemMonitor
    extends PluginWidget
    SystemMonitor is a simple real-time performance monitor that shows the CPU, memory, and disk usage exposed to the JVM through the Java management interfaces (java.lang.management).
    • Constructor Detail

      • SystemMonitor

        public SystemMonitor​(TWidget parent)
        Public constructor.
        Parameters:
        parent - parent widget
      • SystemMonitor

        public SystemMonitor()
        No-argument constructor that is intended only for use by XTWMApplication.loadPlugin().
    • Method Detail

      • draw

        public void draw()
        Draw the values obtained from the Java management interfaces.
        Overrides:
        draw in class TWidget
      • initialize

        public void initialize​(XTWMApplication app)
        Initialize the plugin. Since plugins are required to have a no-argument constructor, this method is called to provide a hook for the plugin to perform initialization. Subclasses that override initialize should call super.initialize() to set the XTWMApplication reference.
        Overrides:
        initialize in class PluginWidget
        Parameters:
        app - the application that will be using this plugin
      • getMenuMnemonic

        public java.lang.String getMenuMnemonic()
        Get the translated menu label for this plugin.
        Specified by:
        getMenuMnemonic in class PluginWidget
        Returns:
        a mnemonic string that will be populated in the menu
      • getPluginName

        public java.lang.String getPluginName()
        Get the translated short name for this plugin.
        Specified by:
        getPluginName in class PluginWidget
        Returns:
        a short name, e.g. "SystemMonitor"
      • getPluginDescription

        public java.lang.String getPluginDescription()
        Get the translated full description for this plugin.
        Specified by:
        getPluginDescription in class PluginWidget
        Returns:
        a short name, e.g. "A simple monitor for the JVM."
      • isApplication

        public boolean isApplication()
        See if this is an "Application" plugin.
        Specified by:
        isApplication in class PluginWidget
        Returns:
        true if this plugin should be listed the Application | Programs menu
      • getApplicationCommand

        public java.lang.String getApplicationCommand()
        Get the command line to execute if this is an "Application" plugin.
        Specified by:
        getApplicationCommand in class PluginWidget
        Returns:
        a command line
      • isWidget

        public boolean isWidget()
        See if this is a "Widget" plugin.
        Specified by:
        isWidget in class PluginWidget
        Returns:
        true if this plugin should be available in the Application | Widgets meny and the Panel | "Switch to" dialog
      • getWindowTitle

        public java.lang.String getWindowTitle()
        Get the translated window title for this plugin.
        Specified by:
        getWindowTitle in class PluginWidget
        Returns:
        the title for the window when this widget is opened in the Application | Widgets menu, or null if this widget should have no title for its window.
      • isOnAllDesktops

        public boolean isOnAllDesktops()
        Whether or not this plugin should be on all desktops when loaded as a widget at startup.
        Overrides:
        isOnAllDesktops in class PluginWidget
        Returns:
        true if this plugin should be on all desktops
      • getPluginSettingsEditor

        public TWidget getPluginSettingsEditor​(TWidget parent)
        Get an interface for editing the plugin settings.
        Overrides:
        getPluginSettingsEditor in class PluginWidget
        Parameters:
        parent - parent widget
        Returns:
        a widget that has settings
      • getPreferredWidth

        public int getPreferredWidth()
        Get the desired width when rendering this plugin.
        Specified by:
        getPreferredWidth in class PluginWidget
        Returns:
        the width
      • getPreferredHeight

        public int getPreferredHeight()
        Get the desired height when rendering this plugin.
        Specified by:
        getPreferredHeight in class PluginWidget
        Returns:
        the height
      • isResizable

        public boolean isResizable()
        Check if widget should be in a resizable window.
        Overrides:
        isResizable in class PluginWidget
        Returns:
        true if the widget should be resizable when in a window