Class NodePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class NodePanel extends JPanel
This class displays the connection status, execution status and number of tasks for a node.
Author:
Laurent Cohen
See Also:
  • Field Details

  • Constructor Details

    • NodePanel

      public NodePanel()
      Initialize this UI.
  • Method Details

    • createTopPanel

      protected JComponent createTopPanel()
      Create the panel on top of the node monitoring panel.
      Returns:
      the panel as a JComponent.
    • addLayoutComp

      protected void addLayoutComp(JPanel panel, GridBagLayout g, GridBagConstraints c, Component comp)
      Add a component to a panel with the specified constraints.
      Parameters:
      panel - the panel to add the component to.
      g - the GridBagLayout set on the panel.
      c - the constraints to apply to the component.
      comp - the component to add.
    • updateConnectionStatus

      public void updateConnectionStatus(boolean ok)
      Update the status of the connection to the server.
      Parameters:
      ok - true if the status is ok, false otherwise.
    • updateExecutionStatus

      public void updateExecutionStatus(boolean ok)
      Update the status of the execution to the server.
      Parameters:
      ok - true if the status is ok, false otherwise.
    • updateTimeLabel

      public void updateTimeLabel()
      Update the text of the label indicating how long the screensaver has been active.
    • incTaskCount

      public long incTaskCount(long increment)
      Increment the number of tasks executed by the node.
      Parameters:
      increment - the number by which to increment.
      Returns:
      the number of tasks as a long value.
    • toStringDuration

      public static String toStringDuration(long duration)
      Transform a duration in milliseconds into a string with hours, minutes, seconds and milliseconds..
      Parameters:
      duration - the duration to transform, expressed in milliseconds.
      Returns:
      a string specifying the duration in terms of hours, minutes, seconds and milliseconds.