Class MMCanvas

    • Method Detail

      • mousePressed

        public void mousePressed​(MouseEvent evt)
        Method invoked everytime the use clicks on a blue arrow: it updates the TextMessage component displaying the type of the message.
        Specified by:
        mousePressed in interface MouseListener
        Parameters:
        evt - mouse event
      • mouseClicked

        public void mouseClicked​(MouseEvent evt)
        This method is invoked every time a user double-click on a blue arrow in the message canvas: the double-click occurs on a blue arrow in the message canavs, a dialog box is displayed with the entire message.
        Specified by:
        mouseClicked in interface MouseListener
        Parameters:
        evt - mouse event
      • selAgent

        public Agent selAgent​(MouseEvent evt)
        Returns an Agent if an Agent has been selected form the user, otherwise returns null.
        Parameters:
        evt - mouse event
        Returns:
        Agent selected or null if no Agent was selected
      • getVertDim

        public int getVertDim()
      • rAgfromNoSniffVector

        public void rAgfromNoSniffVector​(Agent agent)
        Adds an agent to canvas agent then repaints it
        Parameters:
        agent - agent to be add
      • addAgent

        public void addAgent​(Agent agent)
      • removeAgent

        public void removeAgent​(String agentName)
        Removes an agent from the canvas agent then repaints it
        Parameters:
        agentName - agent to be removed
      • removeAllAgents

        public void removeAllAgents()
        Removes all the agents and messages from their lists then repaints the canvas
      • repaintNoSniffedAgent

        public void repaintNoSniffedAgent​(Agent agent)
      • addMessage

        public void addMessage​(Message mess)
        Adds a message to canvas message then repaints the canvas
        Parameters:
        mess - message to be added
      • removeAllMessages

        public void removeAllMessages()
        Removes all the messages in the message list then repaints the canvas
      • isPresent

        public boolean isPresent​(String agName)
        Looks if an agent is present on Agent Canvas
        Parameters:
        agName - agent name to look for
        Returns:
        true if agent is present, false otherwise
      • getAgentList

        public AgentList getAgentList()
        Returns an handler to the agent list. The agent list contains all the agents contained in the Agent Canvas displayed by grey or red boxes
        Returns:
        handler to agent list
      • getMessageList

        public MessageList getMessageList()
        Returns an handler to the message list. The message list contains all sniffed messages displayed on the Message Canavs as blue arrows
        Returns:
        handler to the message list
      • setAgentList

        public void setAgentList​(AgentList savedList)
        Set the agent list handler as the parameter passed then repaints the canvas
        Parameters:
        savedList - new list of agents
      • setMessageList

        public void setMessageList​(MessageList savedList)
        Set the message list handler as the parameter passed then repaints the canvas
        Parameters:
        savedList - new list of messages
      • recMessage

        public void recMessage​(Message newMess)
        Returns new messages and put them into canvas agent
        Parameters:
        newMess - new message