Package pygar.demo0P

Class TeamMember

java.lang.Object
pygar.communication.MessageAgent
pygar.demo0P.TeamMember
All Implemented Interfaces:
java.lang.Runnable

public class TeamMember
extends MessageAgent
A TeamMember represents one of the parties in a blind negotiation. It contains a state machine that performs the functions of the TeamMember according to events received through a messaging system. A GUI panel displays status information during the operation of TeamMember.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    class  TeamMember.Logger
    This inner class provides a log facility for debugging.
    class  TeamMember.TeamFrame
    TeamFrame holds the GUI for the TeamMember.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    TeamMember.Logger logger  
    java.util.Set<java.lang.String> sessionGroup  
    StateMachine<Pmessage> state  

    Fields inherited from class pygar.communication.MessageAgent

    name, pms, t
  • Constructor Summary

    Constructors 
    Constructor Description
    TeamMember​(Profile p, int xoffset, int yoffset, java.awt.Color color)
    A single instance of this type is needed to represent one party or team member in the negotiation session.
  • Method Summary

    Modifier and Type Method Description
    void _initCrypto​(java.lang.String dirPath)  
    void printLog()  
    void run()
    Provide a process to run on the team member's thread, to watch for message events, and to pass message events to the state machine.
    void updateConsole​(java.lang.String message)
    Append a message to the console.
    void updatePBarIndef​(java.lang.String label)
    Update the progress label of the panel and set the progress bar into the indefinite state - a state in which it appears to change and convey the idea of work in progress.
    void updatePBarPercent​(int percent, java.lang.String label)
    Update the progress label and the progress bar.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • TeamMember

      public TeamMember​(Profile p, int xoffset, int yoffset, java.awt.Color color) throws MessageSystemException, ConfigurationError
      A single instance of this type is needed to represent one party or team member in the negotiation session. Each party is associated with a file system directory where it keeps information. It is governed by a state machine that is created by the constructor of TeamMember and it communicates by message passing. It maintains a GUI panel to show progress and data files.
      Parameters:
      p - an instance of a Profile object which supplies configuration information.
      xoffset - upper left corner location of gui panel
      yoffset - upper left corner location of gui panel
      color - color of the frame of the gui panel
      Throws:
      MessageSystemException
      ConfigurationError
  • Method Details

    • updatePBarIndef

      public void updatePBarIndef​(java.lang.String label)
      Update the progress label of the panel and set the progress bar into the indefinite state - a state in which it appears to change and convey the idea of work in progress. Obviously, the routine should be called at the start of a step that may require some time before landing in a longer duration state.
      Parameters:
      label -
    • updatePBarPercent

      public void updatePBarPercent​(int percent, java.lang.String label)
      Update the progress label and the progress bar. This function is most useful when it is called successively during a long calculation to show progress towards the completion of the calculation.
      Parameters:
      percent -
      label -
    • updateConsole

      public void updateConsole​(java.lang.String message)
      Append a message to the console. These message log the progress of the session for this party.
      Parameters:
      message -
    • printLog

      public void printLog()
    • run

      public void run()
      Provide a process to run on the team member's thread, to watch for message events, and to pass message events to the state machine.
      Specified by:
      run in interface java.lang.Runnable
      Overrides:
      run in class MessageAgent
    • _initCrypto

      public void _initCrypto​(java.lang.String dirPath) throws ConfigurationError, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException
      Throws:
      ConfigurationError
      java.security.InvalidKeyException
      java.security.NoSuchAlgorithmException
      javax.crypto.NoSuchPaddingException